Fotobot
Get data from your photovoltaic plant
database_tables.h
Go to the documentation of this file.
1 
7 #ifndef _DATABASE_TABLES_H_
8 #define _DATABASE_TABLES_H_
9 
10 #include <QString>
11 #include <QDateTime>
12 #include <QHostAddress>
13 #include <QVariant>
14 
18 class DBT_LINES {
19  public:
20  enum Type {
21  Fronius = 0,
22  ModbusTCP,
23  ModbusRTU,
24  Unknown
25  };
26  int line;
27  QString description;
28  QString device;
29  QString sn_format;
30  int speed;
31  int retries;
32  int timeout;
33  Type type;
34  QString hostname;
35  int portnumber;
36  DBT_LINES() {
37  line=0; speed=9600; retries=5; timeout=3000; type = Fronius; portnumber = 502;
38  }
39 };
40 Q_DECLARE_METATYPE(DBT_LINES)
41 
42 
43 
51  public:
52  int line;
53  int working;
54  int invertors;
55  DBT_LINES_STATUS() {
56  line=0; working=0; invertors=0;
57  }
58 };
59 
60 
65  public:
66  int invertor;
67  QString description;
68  int line;
69  int address;
70  bool now_power;
71  bool now_ac_current;
72  bool now_ac_voltage;
73  bool now_ac_frequency;
74  bool now_dc_current;
75  bool now_dc_voltage;
76  bool day_energy;
77  bool day_power_maximum;
78  bool day_ac_voltage_maximum;
79  bool day_ac_voltage_minimum;
80  bool day_dc_voltage_maximum;
81  bool day_operating_hours;
82  bool total_energy;
83  bool total_power_maximum;
84  bool total_ac_voltage_maximum;
85  bool total_ac_voltage_minimum;
86  bool total_dc_voltage_maximum;
87  bool total_operating_hours;
88  bool temperature_1;
89  bool temperature_2;
90  bool irradiance;
91 };
92 Q_DECLARE_METATYPE(DBT_INVERTORS)
93 
94 
95 
99  public:
100  int interfacebox;
101  int line;
102  QString description;
103 };
104 Q_DECLARE_METATYPE(DBT_INTERFACEBOXES)
105 
106 
107 
111  public:
112  QVariant longitude;
113  QVariant latitude;
114  DBT_GEOCOORDINATES() {
115  };
116 };
117 Q_DECLARE_METATYPE(DBT_GEOCOORDINATES)
118 
119 
120 
123 class DBT_DATA {
124  public:
125  int invertor;
126  QDateTime date;
127  QString error;
128  QVariant now_power;
129  QVariant now_ac_current;
130  QVariant now_ac_voltage;
131  QVariant now_ac_frequency;
132  QVariant now_dc_current;
133  QVariant now_dc_voltage;
134  QVariant day_energy;
135  QVariant day_power_maximum;
136  QVariant day_ac_voltage_maximum;
137  QVariant day_ac_voltage_minimum;
138  QVariant day_dc_voltage_maximum;
139  QVariant day_operating_hours;
140  QVariant total_energy;
141  QVariant total_power_maximum;
142  QVariant total_ac_voltage_maximum;
143  QVariant total_ac_voltage_minimum;
144  QVariant total_dc_voltage_maximum;
145  QVariant total_operating_hours;
146  QVariant temperature_1;
147  QVariant temperature_2;
148  QVariant irradiance;
149  QString status;
150  DBT_DATA() {
151  invertor = 0;
152  date = QDateTime::currentDateTime();
153  };
154 };
155 Q_DECLARE_METATYPE(DBT_DATA)
156 
157 
158 
161 class DBT_DATA_VW {
162  public:
163  int line;
164  int address;
165  QDateTime date;
166  QString error;
167  QVariant now_power;
168  QVariant now_ac_current;
169  QVariant now_ac_voltage;
170  QVariant now_ac_frequency;
171  QVariant now_dc_current;
172  QVariant now_dc_voltage;
173  QVariant day_energy;
174  QVariant day_power_maximum;
175  QVariant day_ac_voltage_maximum;
176  QVariant day_ac_voltage_minimum;
177  QVariant day_dc_voltage_maximum;
178  QVariant day_operating_hours;
179  QVariant total_energy;
180  QVariant total_power_maximum;
181  QVariant total_ac_voltage_maximum;
182  QVariant total_ac_voltage_minimum;
183  QVariant total_dc_voltage_maximum;
184  QVariant total_operating_hours;
185  QVariant temperature_1;
186  QVariant temperature_2;
187  QVariant irradiance;
188  QString status;
189  QString serial_number;
190  DBT_DATA_VW() {
191  line = 0;
192  address = 0;
193  };
194 };
195 Q_DECLARE_METATYPE(DBT_DATA_VW)
196 
197 
200 class DBT_USERS {
201  public:
202  QString id;
203  QString user;
204  QString password;
205  bool can_access_data;
206  bool can_change_settings;
207 };
208 Q_DECLARE_METATYPE(DBT_USERS)
209 
210 
214  public:
215  int days;
216 };
217 
218 #endif
Class describing database table GEOCOORDINATES.
Class describing database table MAINTENANCE.
Class describing database table DATA.
Class describing lines status.
Class describing database table USERS.
Class describing database table DATA + INVERTORS.
Class describing database table LINES.
Class describing database table INVERTORS.