Reading data based on new documentation
This commit is contained in:
parent
fd6476cd6e
commit
35c4c661c7
9 changed files with 66 additions and 64 deletions
|
|
@ -28,7 +28,7 @@ class Port {
|
|||
|
||||
// void updateParameters(std::vector<std::string> ¶metersToGet, bool allParameters);
|
||||
|
||||
void setParametersFromMicroinverterArray(uint8_t *registers, int addressOffset);
|
||||
void setParametersFromMicroinverterArray(uint16_t *registers, int addressOffset);
|
||||
|
||||
void printParameters(std::vector<std::string> ¶metersToGet, bool allParameters, bool shortNames);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
class PortParameterMicroinverterSerialNumber : public PortParameterInt {
|
||||
private:
|
||||
void setValueFromRegisters(uint8_t *registers, int addressOffset);
|
||||
void setValueFromRegisters(uint16_t *registers, int addressOffset);
|
||||
|
||||
public:
|
||||
PortParameterMicroinverterSerialNumber();
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@ class PortParameter {
|
|||
uint16_t parameterAddressOffset;
|
||||
int registerSize;
|
||||
|
||||
std::string unit;
|
||||
|
||||
public:
|
||||
PortParameter(std::string name, std::string shortName, uint16_t parameterAddressOffset, int registerSize);
|
||||
PortParameter(std::string name, std::string shortName, std::string unit, uint16_t parameterAddressOffset, int registerSize);
|
||||
|
||||
virtual ~PortParameter();
|
||||
|
||||
|
|
@ -39,7 +41,7 @@ class PortParameter {
|
|||
|
||||
virtual std::string getOutputValue();
|
||||
|
||||
virtual void setValueFromRegisters(uint8_t *registers, int addressOffset);
|
||||
virtual void setValueFromRegisters(uint16_t *registers, int addressOffset);
|
||||
|
||||
// void updateValue(std::shared_ptr<class modbus> modubs, uint16_t portStartAddress);
|
||||
};
|
||||
|
|
@ -49,22 +51,22 @@ class PortParameterFloat : public PortParameter {
|
|||
int decimalPlaces;
|
||||
|
||||
public:
|
||||
PortParameterFloat(std::string name, std::string shortName, int decimalPlaces, uint16_t parameterAddressOffset, int registerSize);
|
||||
PortParameterFloat(std::string name, std::string shortName, std::string unit, int decimalPlaces, uint16_t parameterAddressOffset, int registerSize);
|
||||
|
||||
std::string getOutputValue();
|
||||
|
||||
virtual void setValueFromRegisters(uint8_t *registers, int addressOffset);
|
||||
virtual void setValueFromRegisters(uint16_t *registers, int addressOffset);
|
||||
};
|
||||
|
||||
class PortParameterInt : public PortParameter {
|
||||
protected:
|
||||
|
||||
public:
|
||||
PortParameterInt(std::string name, std::string shortName, uint16_t parameterAddressOffset, int registerSize);
|
||||
PortParameterInt(std::string name, std::string shortName, std::string unit, uint16_t parameterAddressOffset, int registerSize);
|
||||
|
||||
std::string getOutputValue();
|
||||
|
||||
virtual void setValueFromRegisters(uint8_t *registers, int addressOffset);
|
||||
virtual void setValueFromRegisters(uint16_t *registers, int addressOffset);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue