File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44#include <QSettings>
55#include <QModbusDataUnit>
6+ #include "modbuslimits.h"
67
78///
89/// \brief The DisplayDefinition struct
@@ -18,10 +19,10 @@ struct DisplayDefinition
1819 void normalize ()
1920 {
2021 UpdateRate = qBound (20U , UpdateRate , 10000U );
21- DeviceId = qBound < quint8 > (1 , DeviceId , 255 );
22- PointAddress = qMax < quint16 > (1U , PointAddress );
22+ DeviceId = qMax < quint8 > (ModbusLimits :: slaveRange (). from () , DeviceId );
23+ PointAddress = qMax < quint16 > (ModbusLimits :: addressRange (). from () , PointAddress );
2324 PointType = qBound (QModbusDataUnit ::DiscreteInputs , PointType , QModbusDataUnit ::HoldingRegisters );
24- Length = qBound < quint16 > (1 , Length , 200 );
25+ Length = qBound < quint16 > (ModbusLimits :: lengthRange (). from () , Length , ModbusLimits :: lengthRange (). to () );
2526 }
2627};
2728Q_DECLARE_METATYPE (DisplayDefinition )
You can’t perform that action at this time.
0 commit comments