You need to sign in or sign up before continuing.
Commit 3c3d5ae9 authored by Pavel Vaynerman's avatar Pavel Vaynerman

i/o debugging

parent 9128b312
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.97 Version: 0.97
Release: eter3 Release: eter6
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: GPL License: GPL
Group: Development/C++ Group: Development/C++
...@@ -178,6 +178,15 @@ rm -f %buildroot%_libdir/*.la ...@@ -178,6 +178,15 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %changelog
* Tue Sep 22 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter5
- minor fixes in SM
* Tue Sep 22 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter4
- minor fixes in IOBase
* Tue Sep 22 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter3
- fixed bugs in IOControl
* Sat Sep 19 2009 Vitaly Lipatov <lav@altlinux.ru> 0.97-eter2 * Sat Sep 19 2009 Vitaly Lipatov <lav@altlinux.ru> 0.97-eter2
- fix build - fix build
......
...@@ -12,10 +12,18 @@ using namespace UniSetExtensions; ...@@ -12,10 +12,18 @@ using namespace UniSetExtensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::ostream& operator<<( std::ostream& os, IOControl::IOInfo& inf ) std::ostream& operator<<( std::ostream& os, IOControl::IOInfo& inf )
{ {
return os << "(" << inf.si.id << ")" << conf->oind->getMapName(inf.si.id) os << "(" << inf.si.id << ")" << conf->oind->getMapName(inf.si.id)
<< " card=" << inf.ncard << " channel=" << inf.channel << " subdev=" << inf.subdev << " card=" << inf.ncard << " channel=" << inf.channel << " subdev=" << inf.subdev
<< " aref=" << inf.aref << " range=" << inf.range << " aref=" << inf.aref << " range=" << inf.range
<< " default=" << inf.defval << " safety=" << inf.safety; << " default=" << inf.defval << " safety=" << inf.safety;
if( inf.cal.minRaw!=inf.cal.maxRaw )
os << " rmin=" << inf.cal.minRaw
<< " rmax=" << inf.cal.maxRaw
<< " cmin=" << inf.cal.minCal
<< " cmax=" << inf.cal.maxCal;
return os;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -155,7 +163,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -155,7 +163,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
ptBlink2.setTiming(blink2_msec); ptBlink2.setTiming(blink2_msec);
int blink3_msec = conf->getArgPInt("--io-blink3-time",it.getProp("blink3-time"), 100); int blink3_msec = conf->getArgPInt("--io-blink3-time",it.getProp("blink3-time"), 100);
ptBlink3.setTiming(blink2_msec); ptBlink3.setTiming(blink3_msec);
smReadyTimeout = conf->getArgInt("--io-sm-ready-timeout",it.getProp("ready_timeout")); smReadyTimeout = conf->getArgInt("--io-sm-ready-timeout",it.getProp("ready_timeout"));
if( smReadyTimeout == 0 ) if( smReadyTimeout == 0 )
...@@ -475,8 +483,8 @@ void IOControl::ioread( IOInfo* it ) ...@@ -475,8 +483,8 @@ void IOControl::ioread( IOInfo* it )
{ {
if( !it->lamp ) if( !it->lamp )
{ {
IOBase::processingAsAO( ib, shm, force_out ); long rval = IOBase::processingAsAO( ib, shm, force_out );
card->setAnalogChannel(it->subdev,it->channel,it->value,it->range,it->aref); card->setAnalogChannel(it->subdev,it->channel,rval,it->range,it->aref);
} }
else // else //
{ {
......
...@@ -180,10 +180,13 @@ void SharedMemory::timerInfo( TimerMessage *tm ) ...@@ -180,10 +180,13 @@ void SharedMemory::timerInfo( TimerMessage *tm )
saveHistory(); saveHistory();
else if( tm->id == tmPulsar ) else if( tm->id == tmPulsar )
{ {
if( siPulsar.id != DefaultObjectId )
{
bool st = localGetState(ditPulsar,siPulsar); bool st = localGetState(ditPulsar,siPulsar);
st ^= true; st ^= true;
localSaveState(ditPulsar,siPulsar,st,getId()); localSaveState(ditPulsar,siPulsar,st,getId());
} }
}
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
......
...@@ -107,7 +107,7 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force ...@@ -107,7 +107,7 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
if( it->cdiagram ) // if( it->cdiagram ) //
{ {
// , // ,
// , // ,
if( !it->nofilter && it->df.size() > 1 ) if( !it->nofilter && it->df.size() > 1 )
{ {
...@@ -129,7 +129,7 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force ...@@ -129,7 +129,7 @@ void IOBase::processingAsAI( IOBase* it, long val, SMInterface* shm, bool force
else else
{ {
IOController_i::CalibrateInfo* cal( &(it->cal) ); IOController_i::CalibrateInfo* cal( &(it->cal) );
if( cal->maxRaw!=0 && cal->maxRaw!=cal->minRaw ) // if( cal->maxRaw!=cal->minRaw ) //
val = UniSetTypes::lcalibrate(val,cal->minRaw,cal->maxRaw,cal->minCal,cal->maxCal,true); val = UniSetTypes::lcalibrate(val,cal->minRaw,cal->maxRaw,cal->minCal,cal->maxCal,true);
// , // ,
...@@ -196,7 +196,7 @@ void IOBase::processingFasAI( IOBase* it, float fval, SMInterface* shm, bool for ...@@ -196,7 +196,7 @@ void IOBase::processingFasAI( IOBase* it, float fval, SMInterface* shm, bool for
} }
IOController_i::CalibrateInfo* cal( &(it->cal) ); IOController_i::CalibrateInfo* cal( &(it->cal) );
if( cal->maxRaw!=0 && cal->maxRaw!=cal->minRaw ) // if( cal->maxRaw!=cal->minRaw ) //
val = UniSetTypes::lcalibrate(val,cal->minRaw,cal->maxRaw,cal->minCal,cal->maxCal,true); val = UniSetTypes::lcalibrate(val,cal->minRaw,cal->maxRaw,cal->minCal,cal->maxCal,true);
// "", // "",
...@@ -287,7 +287,7 @@ long IOBase::processingAsAO( IOBase* it, SMInterface* shm, bool force ) ...@@ -287,7 +287,7 @@ long IOBase::processingAsAO( IOBase* it, SMInterface* shm, bool force )
else else
{ {
IOController_i::CalibrateInfo* cal( &(it->cal) ); IOController_i::CalibrateInfo* cal( &(it->cal) );
if( cal && cal->maxRaw!=0 && cal->maxRaw!=cal->minRaw ) // if( cal && cal->maxRaw!=cal->minRaw ) //
{ {
// !!! // !!!
val = UniSetTypes::lcalibrate(it->value, val = UniSetTypes::lcalibrate(it->value,
...@@ -351,7 +351,7 @@ float IOBase::processingFasAO( IOBase* it, SMInterface* shm, bool force ) ...@@ -351,7 +351,7 @@ float IOBase::processingFasAO( IOBase* it, SMInterface* shm, bool force )
{ {
float fval = val; float fval = val;
IOController_i::CalibrateInfo* cal( &(it->cal) ); IOController_i::CalibrateInfo* cal( &(it->cal) );
if( cal->maxRaw!=0 && cal->maxRaw!=cal->minRaw ) // if( cal->maxRaw!=cal->minRaw ) //
{ {
// !!! // !!!
fval = UniSetTypes::fcalibrate(fval, fval = UniSetTypes::fcalibrate(fval,
...@@ -475,7 +475,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm, ...@@ -475,7 +475,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm,
if( !it.getProp("filtersize").empty() ) if( !it.getProp("filtersize").empty() )
{ {
#warning " 0, f_size def_filtersize?" #warning " 0, f_size def_filtersize?"
f_size = it.getPIntProp("filtersize", 0); f_size = it.getPIntProp("filtersize",def_filtersize);
} }
} }
......
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