Added CLI
This commit is contained in:
parent
b63bd9ae42
commit
70b27a0c07
8 changed files with 151 additions and 32 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
// #include <mutex>
|
||||
|
||||
#include "microinverter.h"
|
||||
|
|
@ -34,8 +35,12 @@ class Dtu {
|
|||
|
||||
void updateMicroinverters();
|
||||
|
||||
void updateMicroinverters(std::vector<std::string> ¶metersToGet);
|
||||
|
||||
void printMicroinverters();
|
||||
|
||||
void printMicroinverters(std::vector<std::string> ¶metersToGet);
|
||||
|
||||
~Dtu();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
// #include <mutex>
|
||||
|
||||
#include "port.h"
|
||||
|
|
@ -31,11 +32,15 @@ class Microinverter {
|
|||
|
||||
void updatePorts();
|
||||
|
||||
void updatePorts(std::vector<std::string> ¶metersToGet);
|
||||
|
||||
void updatePort(int i);
|
||||
|
||||
Port getPort(int i);
|
||||
|
||||
void printPorts();
|
||||
|
||||
void printPorts(std::vector<std::string> ¶metersToGet);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -4,27 +4,20 @@
|
|||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
// #include <mutex>
|
||||
|
||||
#include "portParametersGeneric.h"
|
||||
#include "modbus.h"
|
||||
|
||||
// struct _modbus;
|
||||
// typedef _modbus modbus_t;
|
||||
|
||||
class Port {
|
||||
private:
|
||||
// std::shared_ptr<modbus_t*> modbus_context;
|
||||
|
||||
std::shared_ptr<class modbus> modbus;
|
||||
|
||||
// std::mutex *modbus_context_mutex;
|
||||
|
||||
uint16_t portStartAddress;
|
||||
|
||||
void populateParameters();
|
||||
|
||||
std::pair<std::shared_ptr<PortParameter>, bool> getParameterByName(std::string name);
|
||||
|
||||
void fixCurrent();
|
||||
bool currentFixed;
|
||||
|
||||
|
|
@ -35,7 +28,11 @@ class Port {
|
|||
|
||||
void updateParameters();
|
||||
|
||||
void updateParameters(std::vector<std::string> ¶metersToGet);
|
||||
|
||||
void printParameters();
|
||||
|
||||
void printParameters(std::vector<std::string> ¶metersToGet);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -40,7 +40,7 @@ class PortParameter {
|
|||
|
||||
virtual std::string getOutputValue();
|
||||
|
||||
void updateValue(std::shared_ptr<class modbus> modbus_context, uint16_t portStartAddress);
|
||||
void updateValue(std::shared_ptr<class modbus> modubs, uint16_t portStartAddress);
|
||||
};
|
||||
|
||||
class PortParameterFloat : virtual public PortParameter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue