2024-03-16 21:15:15 +01:00
|
|
|
#ifndef PORT_H
|
|
|
|
|
#define PORT_H
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2024-03-16 22:51:32 +01:00
|
|
|
#include "portParametersGeneric.h"
|
2024-03-19 16:59:41 +01:00
|
|
|
#include "modbus.h"
|
2024-03-16 22:51:32 +01:00
|
|
|
|
2024-03-16 21:15:15 +01:00
|
|
|
class Port {
|
|
|
|
|
private:
|
|
|
|
|
void populateParameters();
|
|
|
|
|
|
2024-03-19 09:22:21 +01:00
|
|
|
void fixCurrent();
|
|
|
|
|
bool currentFixed;
|
|
|
|
|
|
2024-03-28 19:44:54 +01:00
|
|
|
// void increaseParametersAge();
|
2024-03-20 22:48:59 +01:00
|
|
|
|
2024-03-16 21:15:15 +01:00
|
|
|
public:
|
2024-03-28 19:44:54 +01:00
|
|
|
Port(int portStartAddress);
|
2024-03-16 21:15:15 +01:00
|
|
|
|
2024-03-28 11:05:07 +01:00
|
|
|
int portStartAddress;
|
2024-03-20 22:48:59 +01:00
|
|
|
|
2024-03-18 23:48:37 +01:00
|
|
|
std::vector<std::shared_ptr<PortParameter>> parameters;
|
|
|
|
|
|
2024-03-20 19:55:36 +01:00
|
|
|
std::pair<std::shared_ptr<PortParameter>, bool> getParameterByName(std::string name);
|
2024-03-18 23:48:37 +01:00
|
|
|
|
2024-03-28 19:44:54 +01:00
|
|
|
// void updateParameters(std::vector<std::string> ¶metersToGet, bool allParameters);
|
|
|
|
|
|
|
|
|
|
void setParametersFromMicroinverterArray(uint8_t *registers, int addressOffset);
|
2024-03-20 11:28:43 +01:00
|
|
|
|
2024-03-20 20:17:15 +01:00
|
|
|
void printParameters(std::vector<std::string> ¶metersToGet, bool allParameters, bool shortNames);
|
2024-03-16 21:15:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|