![]() |
Fotobot
Get data from your photovoltaic plant
|
Manages list of invertors and their threads. More...
#include <invertors.h>
Public Slots | |
void | openLines () |
Opens all configured invertors. More... | |
void | closeLines () |
Closes all existing invertors and destoroy their instances. | |
void | slotStoreData (DBT_DATA) |
Slot for handling of requests for storing of invertor data in database. | |
Signals | |
void | quitInvertors () |
Signal for invertors to quit. More... | |
void | storeData (DBT_DATA) |
Signal for database to store invertor data. | |
Public Member Functions | |
INVERTORS (QCoreApplication *) | |
QList< INVERTOR_status > | status () |
Returns list of current invertors status. | |
Private Slots | |
void | databaseChanged () |
Slot is called when configuration changed in database. More... | |
void | slotCountWorking () |
Count working invertors. | |
void | slotQuitInvertors () |
Slot is called a few seconds after configuration change. More... | |
void | slotLoopFinished (int number_of_ok, int number_of_err) |
Slot is called when the line finished the reading cycle. More... | |
void | data (DBT_DATA) |
For debugging only, writes read data to console. | |
Private Attributes | |
QList< INVERTOR * > | m_invertors |
List of all invertors. | |
QTimer * | m_timer |
Timer for database changes responses. | |
QTimer * | m_timerWorking |
Timer for periodic status update. | |
QList< DBT_LINES_STATUS > | m_working |
List of working invertors. | |
Manages list of invertors and their threads.
Containter for list of active lines. Every line is stored in it's own thread - virtual class INVERTOR.
Connects data sent from invertor's thread using signal INVERTORS::data(DBT_DATA) to database's slot insertData(DBT_DATA). Receives signal DATABASE::sigDatabaseChanged() in slot INVERTORS::databaseChanged() and after a short delay closes all open lines (class INVERTOR) and restart new instances based on new configuration stored in database.
Stores status of working lines in list of DBT_LINES_STATUS structures. The status is updated every 30 seconds independently of invertors functionality. This allows to update status in situations when no invertor connected to line worked and the INVERTOR class thread was blocked and not responding.
Definition at line 36 of file invertors.h.
|
privateslot |
Slot is called when configuration changed in database.
Registers changes made in database.
Response to changes in database is delayed since database tends to make changes in groups.
Definition at line 37 of file invertors.cpp.
|
slot |
Opens all configured invertors.
Opens serial lines administered in database.
Every invertor is opened in it's own thread so more invertors can work at the same time.
Definition at line 93 of file invertors.cpp.
|
signal |
Signal for invertors to quit.
When the signal is emitted then:
|
privateslot |
Slot is called when the line finished the reading cycle.
Slot receives number of successfull data and error data. When all the invertors are in error, then the interfacebox is restarted
Definition at line 162 of file invertors.cpp.
|
privateslot |
Slot is called a few seconds after configuration change.
Sends signal to invertors and wait a moment to close them.
It sends signal quitInvertors() and after a short pause (timer) calls closeLines() to destroy invertors.
Definition at line 45 of file invertors.cpp.