00001 #ifndef UnitsH
00002 #define UnitsH
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00041
00042
00043 #include "CoreMainHeader.h"
00044 #include "SmallString.h"
00045 #include "SimpleList.h"
00046 #include "EventSystem.h"
00047
00048
00049
00050
00051
00052 extern NEMESIS_CORE_PACKAGE CEventIdentifier ET_UPDATE_MEASUREMENT;
00053
00054
00055
00057
00060 class NEMESIS_CORE_PACKAGE CUnits{
00061 public:
00062 enum EUnit{
00063 distance=0,
00064 angle,
00065 energy,
00066 time,
00067 percentage,
00068 temperature,
00069 pressure,
00070 dipole,
00071 irfrequency,
00072 END_OF_UNITS,
00073 };
00074
00075 public:
00076 __fastcall CUnits(void);
00077
00078 void __fastcall MakeCopyFrom(CUnits& copy);
00079
00080
00081 CSmallString __fastcall GetRealValueCaption(double internalvalue,const CSmallString& format,EUnit unit);
00082 CSmallString __fastcall GetRealValueCaption(double internalvalue,EUnit unit);
00083 double __fastcall GetRealValue(double internalvalue,EUnit unit);
00084 double __fastcall GetValue(double realvalue,EUnit unit);
00085 double __fastcall GetValue(const CSmallString& realvalue,EUnit unit);
00086
00087 const CSmallString __fastcall GetUnitCaption(EUnit unit);
00088
00089 bool __fastcall Init(void);
00090 bool __fastcall SaveAll(void);
00091
00092
00093 public:
00094 class NEMESIS_CORE_PACKAGE CUnitData{
00095 public:
00096 __fastcall CUnitData(void);
00097 __fastcall CUnitData(CUnitData* p_ud);
00098 public:
00099 CSmallString UnitCaption;
00100 CSmallString Format;
00101 double Ratio;
00102 };
00103 class NEMESIS_CORE_PACKAGE CUnitDescription{
00104 public:
00105 CSimpleList<CUnitData> Possibilities;
00106 CUnitData* Current;
00107 };
00108
00109 CUnitDescription Units[END_OF_UNITS];
00110 };
00111
00112 extern NEMESIS_CORE_PACKAGE CUnits Units;
00113
00114
00115
00116 #endif