Commit 0c3eb913 authored by Pavel Vaynerman's avatar Pavel Vaynerman

fixed bug in PassiveTimer (default getInterval()) and new release

parent 4a845cba
......@@ -3,9 +3,8 @@
Name: libuniset
Version: 0.96
Release: eter47
Release: eter49
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
Url: http://sourceforge.net/uniset
......@@ -176,6 +175,12 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Tue Aug 18 2009 Pavel Vainerman <pv@etersoft.ru> 0.96-eter48
- fixed bug in PassiveTimer
* Tue Aug 18 2009 Pavel Vainerman <pv@etersoft.ru> 0.96-eter47
- new build
* Tue Aug 18 2009 Pavel Vainerman <pv@etersoft.ru> 0.96-eter46
- new build
......
......@@ -40,7 +40,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
readconf_ok(false),
term(false)
{
cout << "$Id: IOControl.cc,v 1.3 2009/01/23 23:56:54 vpashka Exp $" << endl;
// cout << "$Id: IOControl.cc,v 1.3 2009/01/23 23:56:54 vpashka Exp $" << endl;
// {
// string myfullname = conf->oind->getNameById(id);
// myname = ORepHelpers::getShortName(myfullname.c_str());
......@@ -337,7 +337,6 @@ void IOControl::execute()
// --------------------------------------------------------------------------------
void IOControl::iopoll()
{
for( IOMap::iterator it=iomap.begin(); it!=iomap.end(); ++it )
{
if( it->ignore || it->ncard == defCardNum )
......@@ -345,6 +344,11 @@ void IOControl::iopoll()
ComediInterface* card = cards.getCard(it->ncard);
// cout << conf->oind->getMapName(it->si.id)
// << " card=" << card << " ncard=" << it->ncard
// << " subdev: " << it->subdev << " chan: " << it->channel << endl;
if( card == NULL || it->subdev==DefaultSubdev || it->channel==DefaultChannel )
continue;
......@@ -391,7 +395,13 @@ void IOControl::iopoll()
<< endl;
}
*/
// cout << " jar=" << ib->ptJar.getInterval()
// << " ondelay=" << ib->ptOnDelay.getInterval()
// << endl;
IOBase::processingAsDI( ib, set, shm, force );
// cout << "val=" << ib->value << endl;
//
// .
......
......@@ -101,6 +101,8 @@ public:
virtual timeout_t getCurrent(); /*!< , */
virtual timeout_t getInterval() /*!< , , */
{
if( timeSS == WaitUpTime )
return 0;
return timeSS*10;
}
......
......@@ -65,7 +65,7 @@ bool PassiveTimer::checkTime()
// printf("times=%d, act=%d\n",times(0),timeAct);
// printf("%d\n",timeSS); msleep(10);
if( timeSS == WaitUpTime)
if( timeSS == WaitUpTime )
return false;
if( times() >= timeAct )
......
......@@ -9,6 +9,19 @@ PassiveTimer pt(1000);
int main()
{
PassiveTimer pt1(5000);
cout << " pt1.getInterval()=" << pt1.getInterval() << endl;
PassiveTimer pt2;
cout << " pt2.getInterval()=" << pt2.getInterval() << endl;
if( pt2.getInterval() != 0 )
{
cerr << "BAD DEFAULT INITIALIZATION!!!" << endl;
return 1;
}
while(1)
{
cerr << "timer=" << pt.checkTime() << endl;
......
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