OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityBlockDatabaseAccess.h
Go to the documentation of this file.
1#pragma once
2#include "EntityBlock.h"
4
5struct __declspec(dllexport) ValueCharacteristicProperties
6{
7 EntityPropertiesString* m_unit;
8 EntityPropertiesString* m_dataType;
9 EntityPropertiesSelection* m_label;
10};
11
12class __declspec(dllexport) EntityBlockDatabaseAccess : public EntityBlock
13{
14public:
15 EntityBlockDatabaseAccess(ot::UID ID, EntityBase* parent, EntityObserver* obs, ModelState* ms, ClassFactoryHandler* factory, const std::string& owner);
16 virtual std::string getClassName(void) override { return "EntityBlockDatabaseAccess"; };
17 virtual entityType getEntityType(void) override { return TOPOLOGY; }
18
19 void createProperties(std::list<std::string>& comparators);
20 void setSelectionSeries(std::list<std::string>& _options, const std::string& _selectedValue);
21
22 std::string getSelectedProjectName();
23 std::string getQueryDimension();
24
25 const bool isQueryDimension1D();
26 const bool isQueryDimension2D();
27 const bool isQueryDimension3D();
28
29 //const std::string& getPropertyNameMeasurementSeries() { return m_propertyNameSeriesMetadata; }
30 //const std::string& getPropertyValueDimension1() { return m_propertyValueDimension1; }
31 //const std::string& getPropertyValueDimension2() { return m_propertyValueDimension2; }
32 //const std::string& getPropertyValueDimension3() { return m_propertyValueDimension3; }
33
34 //const std::string& getGroupQuerySettings() { return m_groupQuerySettings; }
35 //const std::string& getGroupQuantity() { return m_groupQuantitySetttings; }
36 //const std::string& getGroupParameter1() { return m_groupParamSettings1; }
37 //const std::string& getGroupParameter2() { return m_groupParamSettings2; }
38 //const std::string& getGroupParameter3() { return m_groupParamSettings3; }
39
40 /*const std::string& getPropertyName() { return m_propertyName; }
41 const std::string& getPropertyDataType() { return m_propertyDataType; }*/
42
43 EntityPropertiesSelection* getSeriesSelection();
44 EntityPropertiesSelection* getQuantityValueDescriptionSelection();
45
46 ValueCharacteristicProperties getParameterValueCharacteristic1();
47 ValueCharacteristicProperties getParameterValueCharacteristic2();
48 ValueCharacteristicProperties getParameterValueCharacteristic3();
49 ValueCharacteristicProperties getQuantityValueCharacteristic();
50 ValueCharacteristicProperties getValueCharacteristics(const std::string& _groupName);
51
52 const ValueComparisionDefinition getSelectedQuantityDefinition();
53 const ValueComparisionDefinition getSelectedParameter1Definition();
54 const ValueComparisionDefinition getSelectedParameter2Definition();
55 const ValueComparisionDefinition getSelectedParameter3Definition();
56
57 const ot::Connector getConnectorQuantity() const { return m_connectorQuantity; }
58 const ot::Connector getConnectorParameter1() const { return m_connectorParameter1; }
59 const ot::Connector getConnectorParameter2() const { return m_connectorParameter2; }
60 const ot::Connector getConnectorParameter3() const { return m_connectorParameter3; }
61
62 virtual bool updateFromProperties() override;
63
64 virtual ot::GraphicsItemCfg* CreateBlockCfg() override;
65
66 static const std::string getIconName() {return "Database_access.svg";}
67protected:
68 void AddStorageData(bsoncxx::builder::basic::document& storage) override;
69 void readSpecificDataFromDataBase(bsoncxx::document::view& doc_view, std::map<ot::UID, EntityBase*>& entityMap) override;
70
71private:
72
73 const std::string m_propertyNameProjectName = "Projectname";
74
75 const std::string m_propertyNameDimension = "Outcome dimension";
76 const std::string m_propertyValueDimension1 = "1D";
77 const std::string m_propertyValueDimension2 = "2D";
78 const std::string m_propertyValueDimension3 = "3D";
79 const std::string m_propertyValueDimensionCustom = "custom";
80
81 const std::string m_propertyNameSeriesMetadata = "Measurement series";
82
83 const std::string m_groupQuerySettings = "Query settings";
84 const std::string m_groupQuantitySetttings = "Quantity settings";
85 const std::string m_groupParamSettings1 = "Parameter 1";
86 const std::string m_groupParamSettings2 = "Parameter 2";
87 const std::string m_groupParamSettings3 = "Parameter 3";
88
89 const std::string m_propertyName = "Name";
90 const std::string m_propertyValueDescription = "Type";
91 const std::string m_propertyDataType = "Data type";
92 const std::string m_propertyComparator = "Comparator";
93 const std::string m_propertyValue = "Value";
94 const std::string m_propertyUnit = "Unit";
95
96 ot::Connector m_connectorQuantity;
97 ot::Connector m_connectorParameter1;
98 ot::Connector m_connectorParameter2;
99 ot::Connector m_connectorParameter3;
100
101 void createUpdatedProperty(const std::string& _propName, const std::string& _propGroup, const std::string& _labelValue, EntityProperties& properties);
102
103 const ValueComparisionDefinition getSelectedValueComparisionDefinition(const std::string& _groupName);
104 bool setVisibleParameter2(bool _visible);
105 bool setVisibleParameter3(bool _visible);
106 bool setVisibleParameter(const std::string& _groupName,bool _visible);
107 void updateBlockConfig();
108 void updateConnections(std::list<std::string>& connectorsForRemoval);
109 void removeConnectionsAtConnectedEntities(std::list<ot::UID>& connectionsForRemoval);
110
111};
The GraphicsItemCfg is the base class for all graphics item configurations.
Definition GraphicsItemCfg.h:33
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27