Starting to move thte library
This commit is contained in:
parent
f6b42b2460
commit
381dcbdc57
14 changed files with 750 additions and 21 deletions
|
|
@ -6,13 +6,17 @@
|
|||
// #include <mutex>
|
||||
|
||||
#include "microinverter.h"
|
||||
#include "modbus.h"
|
||||
|
||||
struct _modbus;
|
||||
typedef _modbus modbus_t;
|
||||
// struct _modbus;
|
||||
// typedef _modbus modbus_t;
|
||||
|
||||
class Dtu {
|
||||
private:
|
||||
std::shared_ptr<modbus_t*> modbus_context;
|
||||
// std::shared_ptr<modbus_t*> modbus_context;
|
||||
|
||||
std::shared_ptr<modbus> modbus;
|
||||
|
||||
// std::mutex modbus_context_mutex;
|
||||
|
||||
std::vector<Microinverter> microinverters;
|
||||
|
|
|
|||
|
|
@ -6,19 +6,23 @@
|
|||
// #include <mutex>
|
||||
|
||||
#include "port.h"
|
||||
#include "modbus.h"
|
||||
|
||||
struct _modbus;
|
||||
typedef _modbus modbus_t;
|
||||
// struct _modbus;
|
||||
// typedef _modbus modbus_t;
|
||||
|
||||
class Microinverter {
|
||||
private:
|
||||
std::shared_ptr<modbus_t*> modbus_context;
|
||||
// std::shared_ptr<modbus_t*> modbus_context;
|
||||
|
||||
std::shared_ptr<modbus> modbus;
|
||||
|
||||
// std::mutex *modbus_context_mutex;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
Microinverter(std::shared_ptr<modbus_t*> modbus_context, long serialNumber);
|
||||
Microinverter(class modbus modbus, long serialNumber);
|
||||
|
||||
long serialNumber;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,13 +8,17 @@
|
|||
// #include <mutex>
|
||||
|
||||
#include "portParametersGeneric.h"
|
||||
#include "modbus.h"
|
||||
|
||||
struct _modbus;
|
||||
typedef _modbus modbus_t;
|
||||
// struct _modbus;
|
||||
// typedef _modbus modbus_t;
|
||||
|
||||
class Port {
|
||||
private:
|
||||
std::shared_ptr<modbus_t*> modbus_context;
|
||||
// std::shared_ptr<modbus_t*> modbus_context;
|
||||
|
||||
std::shared_ptr<modbus> modbus;
|
||||
|
||||
// std::mutex *modbus_context_mutex;
|
||||
|
||||
uint16_t portStartAddress;
|
||||
|
|
@ -25,7 +29,7 @@ class Port {
|
|||
bool currentFixed;
|
||||
|
||||
public:
|
||||
Port(std::shared_ptr<modbus_t*> modbus_context, uint16_t portStartAddress);
|
||||
Port(std::shared_ptr<class modbus> modbus, uint16_t portStartAddress);
|
||||
|
||||
std::vector<std::shared_ptr<PortParameter>> parameters;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class PortParameter {
|
|||
|
||||
virtual std::string getOutputValue();
|
||||
|
||||
void updateValue(std::shared_ptr<modbus_t*> modbus_context, uint16_t portStartAddress);
|
||||
void updateValue(std::shared_ptr<class modbus> modbus_context, uint16_t portStartAddress);
|
||||
};
|
||||
|
||||
class PortParameterFloat : virtual public PortParameter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue