Commit 347f7bc0 authored by Pavel Vainerman's avatar Pavel Vainerman

(IOBase): добавил WARNING при одновременном использовании

debouncedelay, ondelay и offdelay.
parent 30945503
......@@ -38,9 +38,6 @@ Version 2.0
- ModbusMaster: встроить возможность задать 'pulsar' (регистр сердцебиения)
- IOBase: выдавать warning если заданые одновременно jardelay,ondelay и offdelay
- ТЕСТЫ! ТЕСТЫ! ТЕСТЫ!
- Перевести взаимодействие PassiveObject <--> ProxyManager на shared_ptr (или weak_ptr).
......
......@@ -550,14 +550,28 @@ bool IOBase::initItem( IOBase* b, UniXML::iterator& it, const std::shared_ptr<SM
b->breaklim = initIntProp(it, "breaklim", prefix, init_prefix_only);
b->rawdata = initIntProp(it, "rawdata", prefix, init_prefix_only);
long msec = initIntProp(it, "debouncedelay", prefix, init_prefix_only, UniSetTimer::WaitUpTime);
b->ptDebounce.setTiming(msec);
long d_msec = initIntProp(it, "debouncedelay", prefix, init_prefix_only, UniSetTimer::WaitUpTime);
b->ptDebounce.setTiming(d_msec);
msec = initIntProp(it, "ondelay", prefix, init_prefix_only, UniSetTimer::WaitUpTime);
b->ptOnDelay.setTiming(msec);
long d_on_msec = initIntProp(it, "ondelay", prefix, init_prefix_only, UniSetTimer::WaitUpTime);
b->ptOnDelay.setTiming(d_on_msec);
long d_off_msec = initIntProp(it, "offdelay", prefix, init_prefix_only, UniSetTimer::WaitUpTime);
b->ptOffDelay.setTiming(d_off_msec);
if( dlog && d_msec != UniSetTimer::WaitUpTime
&& d_on_msec != UniSetTimer::WaitUpTime
&& d_off_msec != UniSetTimer::WaitUpTime )
{
dlog->warn() << myname <<"(IOBase::readItem): "
<< " 'debouncedelay' is used in conjunction with the 'ondelay' and 'offdelay'. Sure?"
<< " [ debouncedelay=" << d_msec
<< " ondelay=" << d_on_msec
<< " offdelay=" << d_off_msec
<< " ]" << endl;
}
msec = initIntProp(it, "offdelay", prefix, init_prefix_only, UniSetTimer::WaitUpTime);
b->ptOffDelay.setTiming(msec);
b->front = false;
std::string front_t( initProp(it, "iofront", prefix, init_prefix_only) );
......
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