Commit 06c7c27c authored by Pavel Vainerman's avatar Pavel Vainerman

new version

parent 5955d512
...@@ -31,6 +31,7 @@ static const int NoSafety = -1; ...@@ -31,6 +31,7 @@ static const int NoSafety = -1;
f_median(false), f_median(false),
ignore(false), ignore(false),
invert(false), invert(false),
noprecision(false),
jar_state(false), jar_state(false),
ondelay_state(false), ondelay_state(false),
offdelay_state(false), offdelay_state(false),
...@@ -62,6 +63,7 @@ static const int NoSafety = -1; ...@@ -62,6 +63,7 @@ static const int NoSafety = -1;
bool ignore; /*!< */ bool ignore; /*!< */
bool invert; /*!< */ bool invert; /*!< */
bool noprecision;
PassiveTimer ptJar; /*!< */ PassiveTimer ptJar; /*!< */
PassiveTimer ptOnDelay; /*!< */ PassiveTimer ptOnDelay; /*!< */
...@@ -76,6 +78,8 @@ static const int NoSafety = -1; ...@@ -76,6 +78,8 @@ static const int NoSafety = -1;
bool ondelay_state; /*!< */ bool ondelay_state; /*!< */
bool offdelay_state; /*!< */ bool offdelay_state; /*!< */
// //
UniSetTypes::ObjectId t_ai; /*!< , UniSetTypes::ObjectId t_ai; /*!< ,
, ,
......
...@@ -143,6 +143,10 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force ...@@ -143,6 +143,10 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
} }
} }
if( !it->noprecision && it->cal.precision > 0 )
val *= lround(pow10(it->cal.precision));
// "", // "",
// //
{ {
...@@ -150,9 +154,6 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force ...@@ -150,9 +154,6 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
if( it->value == ChannelBreakValue ) if( it->value == ChannelBreakValue )
shm->localSetUndefinedState(it->ait,false,it->si.id); shm->localSetUndefinedState(it->ait,false,it->si.id);
if( it->cal.precision > 0 )
val *= lround(pow10(it->cal.precision));
if( force || it->value != val ) if( force || it->value != val )
{ {
if( it->stype == UniversalIO::AnalogInput ) if( it->stype == UniversalIO::AnalogInput )
...@@ -417,6 +418,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm, ...@@ -417,6 +418,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm,
b->ignore = atoi( it.getProp("ioignore").c_str() ); b->ignore = atoi( it.getProp("ioignore").c_str() );
b->invert = atoi( it.getProp("ioinvert").c_str() ); b->invert = atoi( it.getProp("ioinvert").c_str() );
b->defval = atoi( it.getProp("default").c_str() ); b->defval = atoi( it.getProp("default").c_str() );
b->noprecision = atoi( it.getProp("noprecision").c_str() );
b->value = b->defval; b->value = b->defval;
b->breaklim = atoi( it.getProp("breaklim").c_str() ); b->breaklim = atoi( it.getProp("breaklim").c_str() );
......
...@@ -616,13 +616,13 @@ namespace ModbusRTU ...@@ -616,13 +616,13 @@ namespace ModbusRTU
{ {
ModbusData start; /*!< */ ModbusData start; /*!< */
ModbusData quant; /*!< */ ModbusData quant; /*!< */
ModbusCRC crc;
// ------- from slave ------- // ------- from slave -------
ForceCoilsRetMessage( ModbusMessage& m ); ForceCoilsRetMessage( ModbusMessage& m );
ForceCoilsRetMessage& operator=( ModbusMessage& m ); ForceCoilsRetMessage& operator=( ModbusMessage& m );
void init( ModbusMessage& m ); void init( ModbusMessage& m );
ModbusCRC crc;
// ------- to master ------- // ------- to master -------
/*! /*!
* \param _from - * \param _from -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment