TwiceAsNice
2019-02-18
|
#include <JumoDevice.h>
Public Types | |
typedef ::Basda::DeviceAsync | DeviceAsync |
typedef ::Basda::DeviceAsync | DeviceAsync |
Public Member Functions | |
JumoDevice (const Nice::JointPtr &config) | |
virtual | ~JumoDevice () |
virtual void | open (void) |
virtual void | close (void) |
close device More... | |
virtual void | reset (DeviceAsync &=::Basda::Device::s_async) |
reset the device More... | |
virtual void | init (DeviceAsync &=Basda::Device::s_async) |
init the device More... | |
virtual void | deinit (DeviceAsync &=::Basda::Device::s_async) |
deinit the device More... | |
virtual void | activate (DeviceAsync &=::Basda::Device::s_async) |
activate the device More... | |
virtual void | deactivate (DeviceAsync &=::Basda::Device::s_async) |
deactivate the device More... | |
virtual void | updateProperties () |
virtual void | version () |
virtual bool | isReachable () |
function to check whether the device is reachable or not More... | |
void | setReachable (const bool state) |
set reachability status of the device More... | |
void | queryDataFromJumo () |
queries the Jumo device for current data More... | |
JumoDevice (const Nice::JointPtr &config) | |
virtual | ~JumoDevice () |
virtual void | open (void) |
open device More... | |
virtual void | close (void) |
close device More... | |
virtual void | reset (DeviceAsync &=::Basda::Device::s_async) |
reset the device More... | |
virtual void | init (DeviceAsync &=Basda::Device::s_async) |
init the device More... | |
virtual void | deinit (DeviceAsync &=::Basda::Device::s_async) |
deinit the device More... | |
virtual void | activate (DeviceAsync &=::Basda::Device::s_async) |
activate the device More... | |
virtual void | deactivate (DeviceAsync &=::Basda::Device::s_async) |
deactivate the device More... | |
virtual void | updateProperties () |
virtual void | version () |
version More... | |
virtual bool | isReachable () |
function to check whether the device is reachable or not More... | |
void | setReachable (const bool state) |
set reachability status of the device More... | |
void | queryDataFromJumo () |
queries the Jumo device for current data More... | |
![]() | |
TempoDevice (const Nice::JointPtr &config) | |
virtual | ~TempoDevice () |
TempoDevice (const Nice::JointPtr &config) | |
virtual | ~TempoDevice () |
TempoDevice (const Nice::JointPtr &config) | |
virtual | ~TempoDevice () |
![]() | |
Device (const Nice::JointPtr &_config) | |
constructor. This is an elementary (lazy) action which stores the name and gets configuration. More... | |
virtual | ~Device () |
destructor Does nothing More... | |
virtual void | setConfig (const Nice::JointPtr &_config) |
init with config tree ptr More... | |
Nice::JointPtr & | config () |
retrieve the property tree More... | |
std::string & | name () |
retrieve the name set at ctor time. More... | |
Device (const Nice::JointPtr &_config) | |
constructor. This is an elementary (lazy) action which stores the name and gets configuration. More... | |
virtual | ~Device () |
destructor Does nothing More... | |
virtual void | setConfig (const Nice::JointPtr &_config) |
init with config tree ptr More... | |
Nice::JointPtr & | config () |
retrieve the property tree More... | |
std::string & | name () |
retrieve the name set at ctor time. More... | |
Protected Attributes | |
jumoData | m_data |
The collection of analog and digital data read most recently from the device. More... | |
![]() | |
Nice::JointPtr | m_config |
Nice::JointPtr | m_cfg |
Nice::JointPtr | m_var |
std::string | m_name |
Private Member Functions | |
void | setPropertiesToUnknown () |
set all device properties to unknown More... | |
void | handleErrors () |
does the device specific error handling More... | |
void | initJumoData () |
init the Jumo data More... | |
void | readRegister (modbus_t *ctx, int add, int nReg, Nice::U16 *dataReg) |
work-around method for logging data into a file at a certain rate More... | |
void | writeRegister (modbus_t *ctx, int add, int nReg) |
float | getFloatFromReading (Nice::U16 byteOne, Nice::U16 byteTwo) |
helper function to extract correct float value from read data bytes via modbus More... | |
void | extractBinaryInputs (Nice::U16 inByte) |
helper function to get the binary inputs More... | |
void | extractAlarmOutputs (const Nice::BitSet &_alarms) |
helper function to get the binary alarm outputs More... | |
void | setPropertiesToUnknown () |
set all device properties to unknown More... | |
void | handleErrors () |
does the device specific error handling More... | |
void | initJumoData () |
init the Jumo data More... | |
void | readRegister (modbus_t *ctx, int add, int nReg, Nice::U16 *dataReg) |
work-around method for logging data into a file at a certain rate More... | |
void | writeRegister (modbus_t *ctx, int add, int nReg) |
float | getFloatFromReading (Nice::U16 byteOne, Nice::U16 byteTwo) |
helper function to extract correct float value from read data bytes via modbus More... | |
void | extractBinaryInputs (Nice::U16 inByte) |
helper function to get the binary inputs More... | |
void | extractAlarmOutputs (const Nice::BitSet &_alarms) |
helper function to get the binary alarm outputs More... | |
Private Attributes | |
std::string | m_connection |
stores the connection address of the device currently connected to More... | |
IceUtil::RecMutex | m_syncMutex |
bool | m_isReachable |
reachable flag More... | |
modbus_t * | m_modbus |
storing the modbus context More... | |
Additional Inherited Members | |
![]() | |
static DeviceAsyncImpl | s_async |
A JUMO controller with a set of analog and digital inputs and outputs.
Basda::Tempo::JumoDevice::JumoDevice | ( | const Nice::JointPtr & | config | ) |
Ctor. Set the state to unreachable and configure the leaves.
config | The Nice node to be configured. |
|
virtual |
Dtor. This is a dummy action and does nothing.
Basda::Tempo::JumoDevice::JumoDevice | ( | const Nice::JointPtr & | config | ) |
|
virtual |
|
inlinevirtual |
activate the device
Implements Basda::Device.
|
inlinevirtual |
activate the device
Implements Basda::Device.
|
virtual |
close device
Implements Basda::Device.
|
virtual |
close device
Implements Basda::Device.
|
inlinevirtual |
deactivate the device
Implements Basda::Device.
|
inlinevirtual |
deactivate the device
Implements Basda::Device.
|
virtual |
deinit the device
Implements Basda::Device.
|
virtual |
deinit the device
Implements Basda::Device.
|
private |
helper function to get the binary alarm outputs
|
private |
helper function to get the binary alarm outputs
Split the contents of a register into the logical bits.
Extracts the bits of siren alarm and LBT alarm.
inByte | The register value to be split. |
|
private |
helper function to get the binary inputs
Split the contents of a register into the logical bits.
Extracts the bits of cooling flow and cabling alarms and fans with a hardcoded mask that gives meaning to the individual bits.
inByte | The register value to be split. |
|
private |
helper function to get the binary inputs
|
private |
helper function to extract correct float value from read data bytes via modbus
Combine two register values of the the internal Jumo format to one floating point values.
byteOne | The first register. |
byteTwo | the second register |
|
private |
helper function to extract correct float value from read data bytes via modbus
|
private |
does the device specific error handling
|
private |
does the device specific error handling
Set the property values to unknown, the device to unreachable and disconnect.
|
virtual |
init the device
Implements Basda::Device.
|
virtual |
init the device
Implements Basda::Device.
|
private |
init the Jumo data
|
private |
|
virtual |
function to check whether the device is reachable or not
Implements Basda::Tempo::TempoDevice.
|
virtual |
function to check whether the device is reachable or not
Implements Basda::Tempo::TempoDevice.
|
virtual |
Reopen and reconnect to the device.
If the device is already open, close first
Get the way of communication from the CON node. This must start with "tcp". Other attempts of connectino are refused.
open the MODBUS RTU_TCP connection given host and port
Implements Basda::Device.
|
virtual |
open device
Implements Basda::Device.
void Basda::Tempo::JumoDevice::queryDataFromJumo | ( | ) |
queries the Jumo device for current data
void Basda::Tempo::JumoDevice::queryDataFromJumo | ( | ) |
queries the Jumo device for current data
Send request of obtaining the 4 temperatures, fan speeds and alarm bits.
The JUMO register addresses are hardcoded here for any of the pieces of information. Temperatures above 50 lead to setting status flags of the temperatures to false.
|
private |
work-around method for logging data into a file at a certain rate
wrapper around modbus lib read method for advanced handling (if wanted)
Extract a number of register values from the device This is forwarded to a call of the libmodbus library.
ctx | The handle of the libmodbus library |
add | Address of the Modbus |
nreg | Number of registers to be read |
dataReg | Where the result is stored. |
|
private |
work-around method for logging data into a file at a certain rate
wrapper around modbus lib read method for advanced handling (if wanted)
|
virtual |
reset the device
Implements Basda::Device.
|
virtual |
reset the device
Implements Basda::Device.
|
private |
set all device properties to unknown
Set all properties of fans to unknown and status flags to false.
The temperature and fan values themselves are not touched, nor the alarms. So this is conservatively preserving data that are actually read off the device.
|
private |
set all device properties to unknown
set reachability status of the device
state | true if reachable, false otherwise |
set reachability status of the device
state | true if reachable, false otherwise |
Assign a new state of being reachable or not.
state | The new state on return of this function. |
|
virtual |
Load the currente values into the properties.
This updates the data on fans, the 4 temperatures, the 4 alarm flags and the 4 status flags. The data are those read earlier, and not obtained in this function.
Implements Basda::Tempo::TempoDevice.
|
virtual |
Implements Basda::Tempo::TempoDevice.
|
virtual |
|
virtual |
version
Implements Basda::Device.
|
private |
|
private |
|
private |
stores the connection address of the device currently connected to
|
protected |
The collection of analog and digital data read most recently from the device.
|
private |
reachable flag
|
private |
storing the modbus context
|
private |