Fotobot
Get data from your photovoltaic plant
invertors.h
Go to the documentation of this file.
1 
7 #ifndef __INVERTORS_H__
8 #define __INVERTORS_H__
9 
10 #include <QList>
11 #include <QTimer>
12 #include <QObject>
13 #include <QCoreApplication>
14 #include "invertor.h"
15 #include "invertor_status.h"
16 
17 
36 class INVERTORS : public QObject {
37  Q_OBJECT
38  public:
39  INVERTORS(QCoreApplication *);
40 
44  QList<INVERTOR_status> status();
45 
46  signals:
56  void quitInvertors();
57 
61  void storeData(DBT_DATA);
62 
63  public slots:
70  void openLines();
71 
75  void closeLines();
76 
80  void slotStoreData(DBT_DATA);
81 
82  private slots:
86  void databaseChanged();
87 
91  void slotCountWorking();
92 
100  void slotQuitInvertors();
101 
109  void slotLoopFinished(int number_of_ok, int number_of_err);
110 
114  void data(DBT_DATA);
115 
116  private:
117  QList<INVERTOR*> m_invertors;
118  QTimer *m_timer;
119 
120  QTimer *m_timerWorking;
121  QList<DBT_LINES_STATUS> m_working;
122 };
123 
124 #endif
Manages list of invertors and their threads.
Definition: invertors.h:36
QTimer * m_timerWorking
Timer for periodic status update.
Definition: invertors.h:120
QTimer * m_timer
Timer for database changes responses.
Definition: invertors.h:118
void data(DBT_DATA)
For debugging only, writes read data to console.
Definition: invertors.cpp:124
void slotQuitInvertors()
Slot is called a few seconds after configuration change.
Definition: invertors.cpp:45
QList< INVERTOR * > m_invertors
List of all invertors.
Definition: invertors.h:117
Class describing database table DATA.
void databaseChanged()
Slot is called when configuration changed in database.
Definition: invertors.cpp:37
void storeData(DBT_DATA)
Signal for database to store invertor data.
QList< DBT_LINES_STATUS > m_working
List of working invertors.
Definition: invertors.h:121
void openLines()
Opens all configured invertors.
Definition: invertors.cpp:93
void slotLoopFinished(int number_of_ok, int number_of_err)
Slot is called when the line finished the reading cycle.
Definition: invertors.cpp:162
QList< INVERTOR_status > status()
Returns list of current invertors status.
Definition: invertors.cpp:67
void closeLines()
Closes all existing invertors and destoroy their instances.
Definition: invertors.cpp:51
void slotCountWorking()
Count working invertors.
Definition: invertors.cpp:83
void quitInvertors()
Signal for invertors to quit.
void slotStoreData(DBT_DATA)
Slot for handling of requests for storing of invertor data in database.
Definition: invertors.cpp:170