Release for adding short names

This commit is contained in:
TraYali 2024-03-20 20:17:15 +01:00
parent a0d06edf7b
commit 25fef43d66
10 changed files with 49 additions and 37 deletions

View file

@ -31,7 +31,7 @@ class Dtu {
// void printMicroinverters();
void printMicroinverters(std::vector<std::string> &parametersToGet, bool allParameters, std::vector<long long> &microinvertersToGet);
void printMicroinverters(std::vector<std::string> &parametersToGet, bool allParameters, std::vector<long long> &microinvertersToGet, bool shortNames);
~Dtu();
};

View file

@ -21,7 +21,7 @@ class Microinverter {
void updatePorts(std::vector<std::string> &parametersToGet, bool allParameters);
void printPorts(std::vector<std::string> &parametersToGet, bool allParameters);
void printPorts(std::vector<std::string> &parametersToGet, bool allParameters, bool shortNames);
long long getTodayProduction();

View file

@ -28,7 +28,7 @@ class Port {
void updateParameters(std::vector<std::string> &parametersToGet, bool allParameters);
void printParameters(std::vector<std::string> &parametersToGet, bool allParameters);
void printParameters(std::vector<std::string> &parametersToGet, bool allParameters, bool shortNames);
};
#endif

View file

@ -16,7 +16,7 @@ class PortParameter {
virtual void setValueFromRegisters(uint16_t *readArray, int registerCount);
public:
PortParameter(std::string name, uint16_t parameterAddressOffset, int registerSize);
PortParameter(std::string name, std::string shortName, uint16_t parameterAddressOffset, int registerSize);
virtual ~PortParameter();
@ -33,6 +33,8 @@ class PortParameter {
public:
std::string name;
std::string shortName;
int age;
std::pair<PortParameterValue, PortParameterValueType> getValue();
@ -42,24 +44,24 @@ class PortParameter {
void updateValue(std::shared_ptr<class modbus> modubs, uint16_t portStartAddress);
};
class PortParameterFloat : virtual public PortParameter {
class PortParameterFloat : public PortParameter {
protected:
int decimalPlaces;
virtual void setValueFromRegisters(uint16_t *readArray, int registerCount);
public:
PortParameterFloat(std::string name, int decimalPlaces, uint16_t parameterAddressOffset, int registerSize);
PortParameterFloat(std::string name, std::string shortName, int decimalPlaces, uint16_t parameterAddressOffset, int registerSize);
std::string getOutputValue();
};
class PortParameterInt : virtual public PortParameter {
class PortParameterInt : public PortParameter {
protected:
virtual void setValueFromRegisters(uint16_t *readArray, int registerCount);
public:
PortParameterInt(std::string name, uint16_t parameterAddressOffset, int registerSize);
PortParameterInt(std::string name, std::string shortName, uint16_t parameterAddressOffset, int registerSize);
std::string getOutputValue();
};