Quick rewrite
This commit is contained in:
parent
266dcefdfd
commit
e6928a3aa6
27 changed files with 6041 additions and 773 deletions
|
|
@ -10,23 +10,21 @@
|
|||
|
||||
class Dtu {
|
||||
private:
|
||||
std::shared_ptr<class modbus> modbus;
|
||||
modbus_t *modbus;
|
||||
|
||||
std::vector<Microinverter> microinverters;
|
||||
|
||||
bool connected;
|
||||
|
||||
void populateMicroinverters();
|
||||
|
||||
public:
|
||||
Dtu(const char *ip_address, int port);
|
||||
Dtu(const char *address, int id, bool rtu, bool tcp);
|
||||
|
||||
std::pair<Microinverter *, bool> getMicroinverterBySerialNumber(long long serialNumber);
|
||||
|
||||
bool isConnected();
|
||||
|
||||
bool modbusError();
|
||||
|
||||
std::string modbusErrorMessage();
|
||||
|
||||
void updateMicroinverters(std::vector<std::string> ¶metersToGet, bool allParameters, std::vector<long long> µinvertersToGet);
|
||||
|
||||
void printMicroinverters(std::vector<std::string> ¶metersToGet, bool allParameters, std::vector<long long> µinvertersToGet, bool shortNames, bool printTodayProduction, bool printTotalProduction);
|
||||
|
|
@ -35,6 +33,8 @@ class Dtu {
|
|||
|
||||
bool empty();
|
||||
|
||||
void listOfMicroinverters();
|
||||
|
||||
~Dtu();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
class Microinverter {
|
||||
private:
|
||||
std::shared_ptr<class modbus> modbus;
|
||||
modbus_t *modbus;
|
||||
|
||||
Sunspec sunspec;
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ class Microinverter {
|
|||
int statusStartAddress;
|
||||
|
||||
public:
|
||||
Microinverter(std::shared_ptr<class modbus> modbus, int startAddress, long long serialNumber);
|
||||
Microinverter(modbus_t *modbus, int startAddress, long long serialNumber);
|
||||
|
||||
long long serialNumber;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ class Port {
|
|||
|
||||
void printParameters(std::vector<std::string> ¶metersToGet, bool allParameters, bool shortNames);
|
||||
|
||||
void turnOff(class modbus &modbus);
|
||||
void turnOff(modbus_t *modbus);
|
||||
|
||||
bool isOff(class modbus &modbus);
|
||||
bool isOff(modbus_t *modbus);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -42,7 +42,7 @@ class PortParameter {
|
|||
|
||||
std::pair<PortParameterValue, PortParameterValueType> getValue();
|
||||
|
||||
PortParameter& writeValue(uint16_t value, class modbus& modbus, int portStartAddress);
|
||||
PortParameter& writeValue(uint16_t value, modbus_t *modbus, int portStartAddress);
|
||||
|
||||
virtual std::string getOutputValue();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
class Sunspec {
|
||||
protected:
|
||||
std::shared_ptr<class modbus> modbus;
|
||||
modbus_t *modbus;
|
||||
|
||||
std::vector<std::shared_ptr<SunspecParameter>> parameters;
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ class Sunspec {
|
|||
void populateParameters();
|
||||
|
||||
public:
|
||||
Sunspec(int address, std::shared_ptr<class modbus> modbus);
|
||||
Sunspec(int address, modbus_t *modbus);
|
||||
|
||||
uint16_t getAddress();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue