OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityUnits.h
Go to the documentation of this file.
1#pragma once
2#include "EntityBase.h"
3
4#include <map>
5#include <string>
6#include <list>
7
8class __declspec(dllexport) EntityUnits : public EntityBase
9{
10public:
11 EntityUnits(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
12
13 virtual bool getEntityBox(double & xmin, double & xmax, double & ymin, double & ymax, double & zmin, double & zmax) override;
14 virtual entityType getEntityType(void) override { return TOPOLOGY; }
15
16 virtual void createProperties(void);
17 virtual bool updateFromProperties(void) override;
18 virtual void addVisualizationNodes(void) override;
19 virtual std::string getClassName(void) override { return "EntityUnits"; };
20
21 void TurnToSIDimension(double & value, std::string& formerUnit);
22 void TurnToSITemperature(double & value, std::string& formerUnit);
23 void TurnToSIFrequency(double & value, std::string& formerUnit);
24 void TurnToSITime(double & value, std::string& formerUnit);
25 void TurnToSIVoltage(double & value, std::string& formerUnit);
26 void TurnToSICurrent(double & value, std::string& formerUnit);
27 void TurnToSIConductance(double & value, std::string& formerUnit);
28 void TurnToSIResistance(double & value, std::string& formerUnit);
29 void TurnToSIInductance(double & value, std::string& formerUnit);
30 void TurnToSICapacitance(double& value, std::string& formerUnit);
31 void TurnToSIConductivity(double& value, std::string& formerUnit);
32
33private:
34
35 const std::string unitGroupname = "Units";
36
37 const std::string unitNameDimension = "Dimension";
38 const std::string unitNameTemperature = "Temperature";
39 const std::string unitNameFrequency = "Frequency";
40 const std::string unitNameTime = "Time";
41 const std::string unitNameVoltage = "Voltage";
42 const std::string unitNameCurrent = "Current";
43 const std::string unitNameConductance = "Conductance";
44 const std::string unitNameResistance = "Resistance";
45 const std::string unitNameInductance = "Inductance";
46 const std::string unitNameCapacitance = "Capacitance";
47 const std::string unitNameConductivity = "Conductivity";
48
49 std::list<std::pair<std::string, double>> dimensionsList;
50 std::list<std::pair<std::string, double>> temperatureList;
51 std::list<std::pair<std::string, double>> frequencyList;
52 std::list<std::pair<std::string, double>> timeList;
53 std::list<std::pair<std::string, double>> voltageList;
54 std::list<std::pair<std::string, double>> currentList;
55 std::list<std::pair<std::string, double>> conductanceList;
56 std::list<std::pair<std::string, double>> resistanceList;
57 std::list<std::pair<std::string, double>> inductanceList;
58 std::list<std::pair<std::string, double>> capacitanceList;
59 std::list<std::pair<std::string, double>> conductivityList;
60
61 std::map<std::string, double> dimensions;
62 std::map<std::string, double> temperature;
63 std::map<std::string, double> frequency;
64 std::map<std::string, double> time;
65 std::map<std::string, double> voltage;
66 std::map<std::string, double> current;
67 std::map<std::string, double> conductance;
68 std::map<std::string, double> resistance;
69 std::map<std::string, double> inductance;
70 std::map<std::string, double> capacitance;
71 std::map<std::string, double> conductivity;
72
73 void SetUnitLists();
74 std::list<std::string> GetUnitList(std::list<std::pair<std::string, double>>& quantity);
75 void BuildMap(const std::list<std::pair<std::string, double>>& list, std::map<std::string, double>& map);
76};
bsoncxx::types::value value
Definition DocumentManager.h:16
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27