Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Units.h

Go to the documentation of this file.
00001 #ifndef UnitsH
00002 #define UnitsH
00003 
00004 /*******************************************************************************
00005 Copyright 2001,2002 Petr Kulhanek
00006 
00007     This file is part of Core plugin.
00008 
00009     Core plugin is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     Core plugin is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with Core plugin; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 *******************************************************************************/
00023 /*******************************************************************************
00024 ** PROJEKT:             Projekt NEMESIS
00025 ** SOUBOR:              Units
00026 ** úČEL:                slouží pro změnu metriky jednotek
00027 ** VERZE:               2.0
00028 ** JAZYK:               CBuilder C++
00029 ** CÍLOVÝ POČÍTAČ:      IBM PC
00030 ** PROGRAMÁTOR:         Petr Kulhánek
00031 ** HISTORIE úPRAV:
00032 VERZE   DATUM       POZNÁMKA
00033 1.0     ????-??-??  třída CUnitClass
00034 2.0     2001-
00035 2.1     2002-08-11  změněn název na CUnits
00036 *******************************************************************************/
00037 
00041 /* HLAVIČKOVÉ SOUBORY *********************************************************/
00042 
00043 #include "CoreMainHeader.h"
00044 #include "SmallString.h"
00045 #include "SimpleList.h"
00046 #include "EventSystem.h"
00047 
00048 /* KONEC HLAVIČKOVÝCH SOUBORů *************************************************/
00049 
00050 /* DEFINICE TŘÍD **************************************************************/
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     // zjišťovací operace
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 /* KONEC DEFINICE TŘÍD ********************************************************/
00115 
00116 #endif

Generated on Sun Feb 9 12:53:51 2003 for NemesisCore by doxygen1.3-rc2