Commit c685c1b1 authored by Pavel Vainerman's avatar Pavel Vainerman

(iocontrol): заменил unideb на dlog так как он используется

во всех extensions
parent a17b2b77
#include <sstream> #include <sstream>
#include "ORepHelpers.h" #include "ORepHelpers.h"
#include "UniSetTypes.h" #include "UniSetTypes.h"
#include "Extensions.h" #include "Extensions.h"
...@@ -64,7 +64,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -64,7 +64,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
maxCardNum = conf->getArgInt("--"+prefix+"-max-cardnum","10"); maxCardNum = conf->getArgInt("--"+prefix+"-max-cardnum","10");
cards.resize(maxCardNum+1); cards.resize(maxCardNum+1);
unideb[Debug::INFO] << myname << "(init): numcards=" << numcards << endl; dlog[Debug::INFO] << myname << "(init): numcards=" << numcards << endl;
UniXML_iterator it(cnode); UniXML_iterator it(cnode);
...@@ -89,7 +89,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -89,7 +89,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
{ {
if( cards[i] == NULL ) if( cards[i] == NULL )
{ {
unideb[Debug::LEVEL3] << myname << "(init): Card N" << i dlog[Debug::LEVEL3] << myname << "(init): Card N" << i
<< " DISABLED! dev='" << " DISABLED! dev='"
<< iodev << "'" << endl; << iodev << "'" << endl;
} }
...@@ -98,7 +98,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -98,7 +98,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
{ {
noCards = false; noCards = false;
cards[i] = new ComediInterface(iodev); cards[i] = new ComediInterface(iodev);
unideb[Debug::LEVEL3] << myname << "(init): ADD card" << i << " dev=" << iodev << endl; dlog[Debug::LEVEL3] << myname << "(init): ADD card" << i << " dev=" << iodev << endl;
} }
if( cards[i] != NULL ) if( cards[i] != NULL )
...@@ -121,7 +121,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -121,7 +121,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
if( !stype.empty() ) if( !stype.empty() )
{ {
unideb[Debug::INFO] << myname dlog[Debug::INFO] << myname
<< "(init): card" << i << "(init): card" << i
<< " subdev" << s << " set type " << stype << endl; << " subdev" << s << " set type " << stype << endl;
...@@ -132,7 +132,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -132,7 +132,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
} }
} }
unideb[Debug::INFO] << myname << "(init): result numcards=" << cards.size() << endl; dlog[Debug::INFO] << myname << "(init): result numcards=" << cards.size() << endl;
polltime = conf->getArgInt("--"+prefix+"-polltime",it.getProp("polltime")); polltime = conf->getArgInt("--"+prefix+"-polltime",it.getProp("polltime"));
if( !polltime ) if( !polltime )
...@@ -153,11 +153,11 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -153,11 +153,11 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
{ {
ostringstream err; ostringstream err;
err << myname << ": Unkown ID for " << testlamp; err << myname << ": Unkown ID for " << testlamp;
unideb[Debug::CRIT] << myname << "(init): " << err.str() << endl; dlog[Debug::CRIT] << myname << "(init): " << err.str() << endl;
throw SystemError(err.str()); throw SystemError(err.str());
} }
unideb[Debug::INFO] << myname << "(init): testLamp_S='" << testlamp << "'" << endl; dlog[Debug::INFO] << myname << "(init): testLamp_S='" << testlamp << "'" << endl;
} }
string tmode = conf->getArgParam("--"+prefix+"-test-mode",it.getProp("testmode_as")); string tmode = conf->getArgParam("--"+prefix+"-test-mode",it.getProp("testmode_as"));
...@@ -168,11 +168,11 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -168,11 +168,11 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
{ {
ostringstream err; ostringstream err;
err << myname << ": Unknown ID for " << tmode; err << myname << ": Unknown ID for " << tmode;
unideb[Debug::CRIT] << myname << "(init): " << err.str() << endl; dlog[Debug::CRIT] << myname << "(init): " << err.str() << endl;
throw SystemError(err.str()); throw SystemError(err.str());
} }
unideb[Debug::INFO] << myname << "(init): testMode_as='" << testmode << "'" << endl; dlog[Debug::INFO] << myname << "(init): testMode_as='" << testmode << "'" << endl;
} }
shm = new SMInterface(icID,&ui,myid,ic); shm = new SMInterface(icID,&ui,myid,ic);
...@@ -181,7 +181,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -181,7 +181,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
s_field = conf->getArgParam("--"+prefix+"-s-filter-field"); s_field = conf->getArgParam("--"+prefix+"-s-filter-field");
s_fvalue = conf->getArgParam("--"+prefix+"-s-filter-value"); s_fvalue = conf->getArgParam("--"+prefix+"-s-filter-value");
unideb[Debug::INFO] << myname << "(init): read s_field='" << s_field dlog[Debug::INFO] << myname << "(init): read s_field='" << s_field
<< "' s_fvalue='" << s_fvalue << "'" << endl; << "' s_fvalue='" << s_fvalue << "'" << endl;
int blink_msec = conf->getArgPInt("--"+prefix+"-blink-time",it.getProp("blink-time"), 300); int blink_msec = conf->getArgPInt("--"+prefix+"-blink-time",it.getProp("blink-time"), 300);
...@@ -205,12 +205,12 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -205,12 +205,12 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
if( sidTestSMReady == DefaultObjectId ) if( sidTestSMReady == DefaultObjectId )
{ {
sidTestSMReady = conf->getSensorID("TestMode_S"); sidTestSMReady = conf->getSensorID("TestMode_S");
unideb[Debug::WARN] << myname dlog[Debug::WARN] << myname
<< "(init): Unknown ID for sm-ready-test-sid (--" << prefix << "-sm-ready-test-sid)." << "(init): Unknown ID for sm-ready-test-sid (--" << prefix << "-sm-ready-test-sid)."
<< " Use 'TestMode_S'" << endl; << " Use 'TestMode_S'" << endl;
} }
else else
unideb[Debug::INFO] << myname << "(init): test-sid: " << sm_ready_sid << endl; dlog[Debug::INFO] << myname << "(init): test-sid: " << sm_ready_sid << endl;
// ----------------------- // -----------------------
...@@ -222,7 +222,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, ...@@ -222,7 +222,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
{ {
ostringstream err; ostringstream err;
err << myname << ": Not found ID for 'HeartBeat' " << heart; err << myname << ": Not found ID for 'HeartBeat' " << heart;
unideb[Debug::CRIT] << myname << "(init): " << err.str() << endl; dlog[Debug::CRIT] << myname << "(init): " << err.str() << endl;
throw SystemError(err.str()); throw SystemError(err.str());
} }
...@@ -284,7 +284,7 @@ void IOControl::execute() ...@@ -284,7 +284,7 @@ void IOControl::execute()
} }
maxHalf = maxItem / 2; maxHalf = maxItem / 2;
unideb[Debug::INFO] << myname << "(init): iomap size = " << iomap.size() << endl; dlog[Debug::INFO] << myname << "(init): iomap size = " << iomap.size() << endl;
cerr << myname << "(iomap size): " << iomap.size() << endl; cerr << myname << "(iomap size): " << iomap.size() << endl;
...@@ -312,7 +312,7 @@ void IOControl::execute() ...@@ -312,7 +312,7 @@ void IOControl::execute()
} }
if( !activated ) if( !activated )
unideb[Debug::CRIT] << myname << "(execute): ************* don`t activate?! ************" << endl; dlog[Debug::CRIT] << myname << "(execute): ************* don`t activate?! ************" << endl;
try try
{ {
...@@ -379,16 +379,16 @@ void IOControl::execute() ...@@ -379,16 +379,16 @@ void IOControl::execute()
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
unideb[Debug::LEVEL3] << myname << "(execute): " << ex << endl; dlog[Debug::LEVEL3] << myname << "(execute): " << ex << endl;
} }
catch(CORBA::SystemException& ex) catch(CORBA::SystemException& ex)
{ {
unideb[Debug::LEVEL3] << myname << "(execute): CORBA::SystemException: " dlog[Debug::LEVEL3] << myname << "(execute): CORBA::SystemException: "
<< ex.NP_minorString() << endl; << ex.NP_minorString() << endl;
} }
catch(...) catch(...)
{ {
unideb[Debug::LEVEL3] << myname << "(execute): catch ..." << endl; dlog[Debug::LEVEL3] << myname << "(execute): catch ..." << endl;
} }
if( term ) if( term )
...@@ -502,7 +502,7 @@ void IOControl::ioread( IOInfo* it ) ...@@ -502,7 +502,7 @@ void IOControl::ioread( IOInfo* it )
/* /*
if( unideb.debugging(Debug::LEVEL3) ) if( unideb.debugging(Debug::LEVEL3) )
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll): read AI " dlog[Debug::LEVEL3] << myname << "(iopoll): read AI "
<< " sid=" << it->si.id << " sid=" << it->si.id
<< " subdev=" << it->subdev << " subdev=" << it->subdev
<< " chan=" << it->channel << " chan=" << it->channel
...@@ -518,7 +518,7 @@ void IOControl::ioread( IOInfo* it ) ...@@ -518,7 +518,7 @@ void IOControl::ioread( IOInfo* it )
/* /*
if( unideb.debugging(Debug::LEVEL3) ) if( unideb.debugging(Debug::LEVEL3) )
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll): read DI " dlog[Debug::LEVEL3] << myname << "(iopoll): read DI "
<< " sid=" << it->si.id << " sid=" << it->si.id
<< " subdev=" << it->subdev << " subdev=" << it->subdev
<< " chan=" << it->channel << " chan=" << it->channel
...@@ -640,28 +640,28 @@ void IOControl::ioread( IOInfo* it ) ...@@ -640,28 +640,28 @@ void IOControl::ioread( IOInfo* it )
} }
catch(IOController_i::NameNotFound &ex) catch(IOController_i::NameNotFound &ex)
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll):(NameNotFound) " << ex.err << endl; dlog[Debug::LEVEL3] << myname << "(iopoll):(NameNotFound) " << ex.err << endl;
} }
catch(IOController_i::IOBadParam& ex ) catch(IOController_i::IOBadParam& ex )
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll):(IOBadParam) " << ex.err << endl; dlog[Debug::LEVEL3] << myname << "(iopoll):(IOBadParam) " << ex.err << endl;
} }
catch(IONotifyController_i::BadRange ) catch(IONotifyController_i::BadRange )
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll): (BadRange)..." << endl; dlog[Debug::LEVEL3] << myname << "(iopoll): (BadRange)..." << endl;
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll): " << ex << endl; dlog[Debug::LEVEL3] << myname << "(iopoll): " << ex << endl;
} }
catch(CORBA::SystemException& ex) catch(CORBA::SystemException& ex)
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll): СORBA::SystemException: " dlog[Debug::LEVEL3] << myname << "(iopoll): СORBA::SystemException: "
<< ex.NP_minorString() << endl; << ex.NP_minorString() << endl;
} }
catch(...) catch(...)
{ {
unideb[Debug::LEVEL3] << myname << "(iopoll): catch ..." << endl; dlog[Debug::LEVEL3] << myname << "(iopoll): catch ..." << endl;
} }
} }
...@@ -729,7 +729,7 @@ bool IOControl::initIOItem( UniXML_iterator& it ) ...@@ -729,7 +729,7 @@ bool IOControl::initIOItem( UniXML_iterator& it )
if( c.empty() || inf.ncard < 0 || inf.ncard >= (int)cards.size() ) if( c.empty() || inf.ncard < 0 || inf.ncard >= (int)cards.size() )
{ {
unideb[Debug::LEVEL3] << myname dlog[Debug::LEVEL3] << myname
<< "(initIOItem): Unknown or bad card number (" << "(initIOItem): Unknown or bad card number ("
<< inf.ncard << ") for " << it.getProp("name") << inf.ncard << ") for " << it.getProp("name")
<< " set default=" << defCardNum << endl; << " set default=" << defCardNum << endl;
...@@ -761,7 +761,7 @@ bool IOControl::initIOItem( UniXML_iterator& it ) ...@@ -761,7 +761,7 @@ bool IOControl::initIOItem( UniXML_iterator& it )
inf.channel = it.getIntProp("channel"); inf.channel = it.getIntProp("channel");
if( inf.channel < 0 || inf.channel > 32 ) if( inf.channel < 0 || inf.channel > 32 )
{ {
unideb[Debug::WARN] << myname << "(readItem): Unknown channel: " << inf.channel dlog[Debug::WARN] << myname << "(readItem): Unknown channel: " << inf.channel
<< " for " << it.getProp("name") << endl; << " for " << it.getProp("name") << endl;
return false; return false;
} }
...@@ -781,7 +781,7 @@ bool IOControl::initIOItem( UniXML_iterator& it ) ...@@ -781,7 +781,7 @@ bool IOControl::initIOItem( UniXML_iterator& it )
inf.range = it.getIntProp("range"); inf.range = it.getIntProp("range");
if( inf.range < 0 || inf.range > 3 ) if( inf.range < 0 || inf.range > 3 )
{ {
unideb[Debug::CRIT] << myname << "(readItem): Unknown 'range': " << inf.range dlog[Debug::CRIT] << myname << "(readItem): Unknown 'range': " << inf.range
<< " for " << it.getProp("name") << " for " << it.getProp("name")
<< " Must be range=[0..3]" << endl; << " Must be range=[0..3]" << endl;
return false; return false;
...@@ -790,7 +790,7 @@ bool IOControl::initIOItem( UniXML_iterator& it ) ...@@ -790,7 +790,7 @@ bool IOControl::initIOItem( UniXML_iterator& it )
inf.aref = it.getIntProp("aref"); inf.aref = it.getIntProp("aref");
if( inf.aref < 0 || inf.aref > 3 ) if( inf.aref < 0 || inf.aref > 3 )
{ {
unideb[Debug::CRIT] << myname << "(readItem): Unknown 'aref': " << inf.aref dlog[Debug::CRIT] << myname << "(readItem): Unknown 'aref': " << inf.aref
<< " for " << it.getProp("name") << " for " << it.getProp("name")
<< ". Must be aref=[0..3]" << endl; << ". Must be aref=[0..3]" << endl;
return false; return false;
...@@ -798,7 +798,7 @@ bool IOControl::initIOItem( UniXML_iterator& it ) ...@@ -798,7 +798,7 @@ bool IOControl::initIOItem( UniXML_iterator& it )
} }
if( unideb.debugging(Debug::LEVEL3) ) if( unideb.debugging(Debug::LEVEL3) )
unideb[Debug::LEVEL3] << myname << "(readItem): add: " << inf.stype << " " << inf << endl; dlog[Debug::LEVEL3] << myname << "(readItem): add: " << inf.stype << " " << inf << endl;
// если вектор уже заполнен // если вектор уже заполнен
// то увеличиваем его на 10 элементов (с запасом) // то увеличиваем его на 10 элементов (с запасом)
...@@ -812,7 +812,7 @@ bool IOControl::initIOItem( UniXML_iterator& it ) ...@@ -812,7 +812,7 @@ bool IOControl::initIOItem( UniXML_iterator& it )
{ {
IOPriority p(prior,maxItem); IOPriority p(prior,maxItem);
pmap.push_back(p); pmap.push_back(p);
unideb[Debug::LEVEL3] << myname << "(readItem): add to priority list: " << dlog[Debug::LEVEL3] << myname << "(readItem): add to priority list: " <<
it.getProp("name") it.getProp("name")
<< " priority=" << prior << endl; << " priority=" << prior << endl;
} }
...@@ -871,7 +871,7 @@ void IOControl::sigterm( int signo ) ...@@ -871,7 +871,7 @@ void IOControl::sigterm( int signo )
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
unideb[Debug::LEVEL3] << myname << "(sigterm): " << ex << endl; dlog[Debug::LEVEL3] << myname << "(sigterm): " << ex << endl;
} }
catch(...){} catch(...){}
} }
...@@ -907,7 +907,7 @@ void IOControl::initOutputs() ...@@ -907,7 +907,7 @@ void IOControl::initOutputs()
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
unideb[Debug::LEVEL3] << myname << "(initOutput): " << ex << endl; dlog[Debug::LEVEL3] << myname << "(initOutput): " << ex << endl;
} }
} }
} }
...@@ -948,7 +948,7 @@ void IOControl::initIOCard() ...@@ -948,7 +948,7 @@ void IOControl::initIOCard()
} }
catch( Exception& ex) catch( Exception& ex)
{ {
unideb[Debug::CRIT] << myname << "(initIOCard): sid=" << it->si.id dlog[Debug::CRIT] << myname << "(initIOCard): sid=" << it->si.id
<< " " << ex << endl; << " " << ex << endl;
} }
} }
...@@ -1061,7 +1061,7 @@ void IOControl::check_testmode() ...@@ -1061,7 +1061,7 @@ void IOControl::check_testmode()
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
unideb[Debug::LEVEL3] << myname << "(sigterm): " << ex << endl; dlog[Debug::LEVEL3] << myname << "(sigterm): " << ex << endl;
} }
catch(...){} catch(...){}
} }
...@@ -1070,7 +1070,7 @@ void IOControl::check_testmode() ...@@ -1070,7 +1070,7 @@ void IOControl::check_testmode()
} }
catch( Exception& ex) catch( Exception& ex)
{ {
unideb[Debug::CRIT] << myname << "(check_testmode): " << ex << endl; dlog[Debug::CRIT] << myname << "(check_testmode): " << ex << endl;
} }
catch(...) catch(...)
{ {
...@@ -1135,7 +1135,7 @@ void IOControl::check_testlamp() ...@@ -1135,7 +1135,7 @@ void IOControl::check_testlamp()
} }
catch( Exception& ex) catch( Exception& ex)
{ {
unideb[Debug::CRIT] << myname << "(check_testlamp): " << ex << endl; dlog[Debug::CRIT] << myname << "(check_testlamp): " << ex << endl;
} }
catch(...) catch(...)
{ {
...@@ -1165,7 +1165,7 @@ IOControl* IOControl::init_iocontrol( int argc, const char* const* argv, ...@@ -1165,7 +1165,7 @@ IOControl* IOControl::init_iocontrol( int argc, const char* const* argv,
int numcards = conf->getArgPInt("--"+prefix+"-numcards",1); int numcards = conf->getArgPInt("--"+prefix+"-numcards",1);
unideb[Debug::INFO] << "(iocontrol): name = " << name << "(" << ID << ")" << endl; dlog[Debug::INFO] << "(iocontrol): name = " << name << "(" << ID << ")" << endl;
return new IOControl(ID,icID,ic,numcards,prefix); return new IOControl(ID,icID,ic,numcards,prefix);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -1260,7 +1260,7 @@ void IOControl::sysCommand( SystemMessage* sm ) ...@@ -1260,7 +1260,7 @@ void IOControl::sysCommand( SystemMessage* sm )
} }
if( !activated ) if( !activated )
unideb[Debug::CRIT] << myname << "(sysCommand): ************* don`t activate?! ************" << endl; dlog[Debug::CRIT] << myname << "(sysCommand): ************* don`t activate?! ************" << endl;
askSensors(UniversalIO::UIONotify); askSensors(UniversalIO::UIONotify);
break; break;
...@@ -1337,7 +1337,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd ) ...@@ -1337,7 +1337,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd )
<< "(askSensors): Не дождались готовности(work) SharedMemory к работе в течение " << "(askSensors): Не дождались готовности(work) SharedMemory к работе в течение "
<< activateTimeout << " мсек"; << activateTimeout << " мсек";
unideb[Debug::CRIT] << err.str() << endl; dlog[Debug::CRIT] << err.str() << endl;
kill(SIGTERM,getpid()); // прерываем (перезапускаем) процесс... kill(SIGTERM,getpid()); // прерываем (перезапускаем) процесс...
throw SystemError(err.str()); throw SystemError(err.str());
} }
...@@ -1352,7 +1352,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd ) ...@@ -1352,7 +1352,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd )
} }
if( !readconf_ok ) if( !readconf_ok )
unideb[Debug::CRIT] << myname << "(askSensors): ************* don`t read configuration?! ************" << endl; dlog[Debug::CRIT] << myname << "(askSensors): ************* don`t read configuration?! ************" << endl;
try try
{ {
...@@ -1361,7 +1361,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd ) ...@@ -1361,7 +1361,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd )
} }
catch( Exception& ex) catch( Exception& ex)
{ {
unideb[Debug::CRIT] << myname << "(askSensors): " << ex << endl; dlog[Debug::CRIT] << myname << "(askSensors): " << ex << endl;
} }
try try
...@@ -1371,7 +1371,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd ) ...@@ -1371,7 +1371,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd )
} }
catch( Exception& ex) catch( Exception& ex)
{ {
unideb[Debug::CRIT] << myname << "(askSensors): " << ex << endl; dlog[Debug::CRIT] << myname << "(askSensors): " << ex << endl;
} }
for( IOMap::iterator it=iomap.begin(); it!=iomap.end(); ++it ) for( IOMap::iterator it=iomap.begin(); it!=iomap.end(); ++it )
...@@ -1393,7 +1393,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd ) ...@@ -1393,7 +1393,7 @@ void IOControl::askSensors( UniversalIO::UIOCommand cmd )
} }
catch( Exception& ex) catch( Exception& ex)
{ {
unideb[Debug::CRIT] << myname << "(askSensors): " << ex << endl; dlog[Debug::CRIT] << myname << "(askSensors): " << ex << endl;
} }
} }
} }
...@@ -1403,7 +1403,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm ) ...@@ -1403,7 +1403,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm )
{ {
if( unideb.debugging(Debug::LEVEL1) ) if( unideb.debugging(Debug::LEVEL1) )
{ {
unideb[Debug::LEVEL1] << myname << "(sensorInfo): sm->id=" << sm->id dlog[Debug::LEVEL1] << myname << "(sensorInfo): sm->id=" << sm->id
<< " val=" << sm->value << endl; << " val=" << sm->value << endl;
} }
...@@ -1412,7 +1412,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm ) ...@@ -1412,7 +1412,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm )
if( sm->id == testLamp_S ) if( sm->id == testLamp_S )
{ {
unideb[Debug::INFO] << myname << "(sensorInfo): test_lamp=" << sm->state << endl; dlog[Debug::INFO] << myname << "(sensorInfo): test_lamp=" << sm->state << endl;
isTestLamp = sm->state; isTestLamp = sm->state;
} }
else if( sm->id == testMode_as ) else if( sm->id == testMode_as )
...@@ -1427,7 +1427,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm ) ...@@ -1427,7 +1427,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm )
{ {
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
{ {
unideb[Debug::INFO] << myname << "(sensorInfo): sid=" << sm->id dlog[Debug::INFO] << myname << "(sensorInfo): sid=" << sm->id
<< " state=" << sm->state << " state=" << sm->state
<< " value=" << sm->value << " value=" << sm->value
<< endl; << endl;
...@@ -1530,7 +1530,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm ) ...@@ -1530,7 +1530,7 @@ void IOControl::sensorInfo( UniSetTypes::SensorMessage* sm )
{ {
if( unideb.debugging(Debug::LEVEL1) ) if( unideb.debugging(Debug::LEVEL1) )
{ {
unideb[Debug::LEVEL1] << myname << "(sensorInfo): DO: sm->id=" << sm->id dlog[Debug::LEVEL1] << myname << "(sensorInfo): DO: sm->id=" << sm->id
<< " val=" << sm->value << endl; << " val=" << sm->value << endl;
} }
uniset_spin_lock lock(it->val_lock); uniset_spin_lock lock(it->val_lock);
...@@ -1555,7 +1555,7 @@ void IOControl::waitSM() ...@@ -1555,7 +1555,7 @@ void IOControl::waitSM()
err << myname << "(execute): did not wait for the ready 'SharedMemory'. Timeout " err << myname << "(execute): did not wait for the ready 'SharedMemory'. Timeout "
<< smReadyTimeout << " msec"; << smReadyTimeout << " msec";
unideb[Debug::CRIT] << err.str() << endl; dlog[Debug::CRIT] << err.str() << endl;
throw SystemError(err.str()); throw SystemError(err.str());
} }
} }
...@@ -1565,14 +1565,14 @@ void IOControl::buildCardsList() ...@@ -1565,14 +1565,14 @@ void IOControl::buildCardsList()
xmlNode* nnode = conf->getXMLNodesSection(); xmlNode* nnode = conf->getXMLNodesSection();
if( !nnode ) if( !nnode )
{ {
unideb[Debug::WARN] << myname << "(buildCardsList): <nodes> not found?!" << endl; dlog[Debug::WARN] << myname << "(buildCardsList): <nodes> not found?!" << endl;
return; return;
} }
UniXML* xml = conf->getConfXML(); UniXML* xml = conf->getConfXML();
if( !xml ) if( !xml )
{ {
unideb[Debug::WARN] << myname << "(buildCardsList): xml=NULL?!" << endl; dlog[Debug::WARN] << myname << "(buildCardsList): xml=NULL?!" << endl;
return; return;
} }
...@@ -1590,7 +1590,7 @@ void IOControl::buildCardsList() ...@@ -1590,7 +1590,7 @@ void IOControl::buildCardsList()
if( !mynode ) if( !mynode )
{ {
unideb[Debug::WARN] << myname << "(buildCardsList): node='" << conf->getLocalNodeName() << "' not found.." << endl; dlog[Debug::WARN] << myname << "(buildCardsList): node='" << conf->getLocalNodeName() << "' not found.." << endl;
return; return;
} }
...@@ -1600,14 +1600,14 @@ void IOControl::buildCardsList() ...@@ -1600,14 +1600,14 @@ void IOControl::buildCardsList()
if( !cnode ) if( !cnode )
{ {
unideb[Debug::WARN] << myname << "(buildCardsList): Not found <iocards> for node=" << conf->getLocalNodeName() << "(" << conf->getLocalNode() << ")" << endl; dlog[Debug::WARN] << myname << "(buildCardsList): Not found <iocards> for node=" << conf->getLocalNodeName() << "(" << conf->getLocalNode() << ")" << endl;
return; return;
} }
UniXML_iterator it(cnode); UniXML_iterator it(cnode);
if( !it.goChildren() ) if( !it.goChildren() )
{ {
unideb[Debug::WARN] << myname << "(buildCardsList): <iocards> empty.." << endl; dlog[Debug::WARN] << myname << "(buildCardsList): <iocards> empty.." << endl;
return; return;
} }
...@@ -1625,21 +1625,21 @@ void IOControl::buildCardsList() ...@@ -1625,21 +1625,21 @@ void IOControl::buildCardsList()
if( cardnum <=0 ) if( cardnum <=0 )
{ {
unideb[Debug::LEVEL3] << myname << "(init): Unknown card number?! card=" << it.getIntProp("card") << "(" << cname << ")" << endl; dlog[Debug::LEVEL3] << myname << "(init): Unknown card number?! card=" << it.getIntProp("card") << "(" << cname << ")" << endl;
continue; continue;
} }
if( cardnum > maxCardNum ) if( cardnum > maxCardNum )
{ {
unideb[Debug::LEVEL3] << myname << "(init): BAD card number card='" << it.getIntProp("card") << "'(" << cname << "). Must be < " << maxCardNum << endl; dlog[Debug::LEVEL3] << myname << "(init): BAD card number card='" << it.getIntProp("card") << "'(" << cname << "). Must be < " << maxCardNum << endl;
continue; continue;
} }
if( it.getIntProp("ignore") ) if( it.getIntProp("ignore") )
{ {
cards[cardnum] = NULL; cards[cardnum] = NULL;
unideb[Debug::LEVEL3] << myname << "(init): card=" << it.getProp("card") << "(" << cname << ")" dlog[Debug::LEVEL3] << myname << "(init): card=" << it.getProp("card") << "(" << cname << ")"
<< " DISABLED! ignore=1" << endl; << " DISABLED! ignore=1" << endl;
continue; continue;
} }
...@@ -1650,7 +1650,7 @@ void IOControl::buildCardsList() ...@@ -1650,7 +1650,7 @@ void IOControl::buildCardsList()
if( findArgParam( s.str(), conf->getArgc(), conf->getArgv()) != -1 ) if( findArgParam( s.str(), conf->getArgc(), conf->getArgv()) != -1 )
{ {
cards[cardnum] = NULL; cards[cardnum] = NULL;
unideb[Debug::LEVEL3] << myname << "(init): card=" << it.getProp("card") << "(" << cname << ")" dlog[Debug::LEVEL3] << myname << "(init): card=" << it.getProp("card") << "(" << cname << ")"
<< " DISABLED! (" << s.str() << ")" << endl; << " DISABLED! (" << s.str() << ")" << endl;
continue; continue;
} }
...@@ -1660,13 +1660,13 @@ void IOControl::buildCardsList() ...@@ -1660,13 +1660,13 @@ void IOControl::buildCardsList()
if( iodev.empty() || iodev == "/dev/null" ) if( iodev.empty() || iodev == "/dev/null" )
{ {
cards[cardnum] = NULL; cards[cardnum] = NULL;
unideb[Debug::LEVEL3] << myname << "(init): card=" << it.getProp("card") << "(" << cname << ")" dlog[Debug::LEVEL3] << myname << "(init): card=" << it.getProp("card") << "(" << cname << ")"
<< " DISABLED! iodev='" << " DISABLED! iodev='"
<< iodev << "'" << endl; << iodev << "'" << endl;
continue; continue;
} }
unideb[Debug::LEVEL3] << myname << "(init): ADD card=" << it.getProp("card") << "(" << cname << ")" << " dev=" << iodev << endl; dlog[Debug::LEVEL3] << myname << "(init): ADD card=" << it.getProp("card") << "(" << cname << ")" << " dev=" << iodev << endl;
try try
{ {
...@@ -1675,7 +1675,7 @@ void IOControl::buildCardsList() ...@@ -1675,7 +1675,7 @@ void IOControl::buildCardsList()
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
unideb[Debug::CRIT] << myname << "(buildCardsList): " << ex << endl; dlog[Debug::CRIT] << myname << "(buildCardsList): " << ex << endl;
throw; throw;
} }
...@@ -1703,7 +1703,7 @@ void IOControl::buildCardsList() ...@@ -1703,7 +1703,7 @@ void IOControl::buildCardsList()
string subdev_name( it.getProp(s.str()) ); string subdev_name( it.getProp(s.str()) );
if( subdev_name.empty() ) if( subdev_name.empty() )
{ {
unideb[Debug::INFO] << myname << "(buidCardList): empty subdev. ignore... (" << s.str() << ")" << endl; dlog[Debug::INFO] << myname << "(buidCardList): empty subdev. ignore... (" << s.str() << ")" << endl;
continue; continue;
} }
...@@ -1716,7 +1716,7 @@ void IOControl::buildCardsList() ...@@ -1716,7 +1716,7 @@ void IOControl::buildCardsList()
throw SystemError(err.str()); throw SystemError(err.str());
} }
unideb[Debug::INFO] << myname << "(buildCardsList): card=" << it.getProp("card") dlog[Debug::INFO] << myname << "(buildCardsList): card=" << it.getProp("card")
<< "(" << cname << ")" << "(" << cname << ")"
<< " init subdev" << i << " " << it.getProp(s.str()) << endl; << " init subdev" << i << " " << it.getProp(s.str()) << endl;
cards[cardnum]->configureSubdev(i-1,st); cards[cardnum]->configureSubdev(i-1,st);
......
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