chounits.hpp
来自「gspiceui电子CAD仿真程序.用于电路参数模拟仿真」· HPP 代码 · 共 106 行
HPP
106 行
//*****************************************************************************// ChoUnits.hpp *// -------------- *// *// Description : This class is intended to provide useful functionality for *// managing the units associated with some variable. It is *// particular aimed at parameters to do with electronics. *// Started : 27/03/2004 *// Last Update : 01/07/2005 *// Copyright : (C) 2004 by MSWaters *// Email : M.Waters@bom.gov.au *//*****************************************************************************//*****************************************************************************// *// This program is free software; you can redistribute it and/or modify *// it under the terms of the GNU General Public License as published by *// the Free Software Foundation; either version 2 of the License, or *// (at your option) any later version. *// *//*****************************************************************************#ifndef CHOUNITS_HPP#define CHOUNITS_HPP// System Includes#include <iostream>#include <cmath>#include <cfloat>// wxWindows Includes#include <wx/wx.h>#include <wx/string.h>#include <wx/wxchar.h>// Application Includes#include "ConvertType.hpp"// Local Constant Declarations//*****************************************************************************class ChoUnits : public wxChoice{ public: // The various number types supported by this class enum eUnitsType { eUNTS_NONE = 0, // No units specified eUNTS_CAP, // Capacitance eUNTS_IND, // Inductance eUNTS_RES, // Resistance eUNTS_VOLT, // Voltage eUNTS_CURR, // Current eUNTS_TIME, // Time eUNTS_FREQ, // Frequency eUNTS_PHASE, // Phase eUNTS_TEMP, // Temperature eUNTS_SCLR, // Scalar eUNTS_INVALID, eUNTS_FST = eUNTS_NONE, eUNTS_LST = eUNTS_SCLR }; private: eUnitsType m_eUnitsType; wxString m_osDefUnits; public: ChoUnits( void ); ~ChoUnits( ); bool bCreate( wxWindow * poWin, wxWindowID oWinID, int iWidth=-1 ); bool bIsCreated( void ) { return( GetParent( )!=NULL ? TRUE : FALSE ); } bool bClear( void ); bool bSetUType( eUnitsType eUType ); bool bSetDefUs( const wxString rosUnits ); bool bSetUnits( const wxString rosUnits ); bool bSetUnits( int iExponent ); eUnitsType eGetUType( void ) { return( m_eUnitsType ); } const wxString & rosGetDefUs( void ) { return( m_osDefUnits ); } const wxString & rosGetUnits( void ); int iGetUnits( void ); // These functions take a value and return it including the selected units long liGetValue( float fValue ); double dfGetValue( float fValue ); const wxString & rosGetValue( float fValue );};//*****************************************************************************#endif // CHOUNITS_HPP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?