Commit 1044b53c authored by Pavel Vainerman's avatar Pavel Vainerman

add new service function: operator<<(IOController_i::CalibrationInfo)

parent 49d0fa05
......@@ -1208,11 +1208,7 @@ int getCalibrate(string arg, UniversalInterface &ui)
si.id = sid;
si.node = conf->getLocalNode();
IOController_i::CalibrateInfo ci = ui.getCalibrateInfo(si);
cout << "rmin=" << ci.minRaw << " rmax=" << ci.maxRaw;
cout << " cmin=" << ci.minCal << " cmax=" << ci.maxCal;
cout << " sensibility=" << ci.sensibility;
cout << endl;
cout << ci << endl;
return 0;
}
......
......@@ -18,10 +18,7 @@ std::ostream& operator<<( std::ostream& os, IOControl::IOInfo& inf )
<< " 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;
os << inf.cal;
return os;
}
......
......@@ -1331,10 +1331,7 @@ std::ostream& operator<<( std::ostream& os, const MBTCPMaster::RSProperty& p )
if( p.stype == UniversalIO::AnalogInput || p.stype == UniversalIO::AnalogOutput )
{
os << " rmin=" << p.cal.minRaw
<< " rmax=" << p.cal.maxRaw
<< " cmin=" << p.cal.maxCal
<< " cmax=" << p.cal.maxCal
os << p.cal
<< " cdiagram=" << ( p.cdiagram ? "yes" : "no" );
}
......
......@@ -787,10 +787,7 @@ std::ostream& operator<<( std::ostream& os, MBSlave::IOProperty& p )
if( p.stype == UniversalIO::AnalogInput || p.stype == UniversalIO::AnalogOutput )
{
os << " rmin=" << p.cal.minRaw
<< " rmax=" << p.cal.maxRaw
<< " cmin=" << p.cal.maxCal
<< " cmax=" << p.cal.maxCal
os << p.cal
<< " cdiagram=" << ( p.cdiagram ? "yes" : "no" );
}
......
......@@ -1473,10 +1473,7 @@ std::ostream& operator<<( std::ostream& os, const RTUExchange::RSProperty& p )
if( p.stype == UniversalIO::AnalogInput || p.stype == UniversalIO::AnalogOutput )
{
os << " rmin=" << p.cal.minRaw
<< " rmax=" << p.cal.maxRaw
<< " cmin=" << p.cal.maxCal
<< " cmax=" << p.cal.maxCal
os << p.cal
<< " cdiagram=" << ( p.cdiagram ? "yes" : "no" );
}
......
......@@ -36,6 +36,7 @@
#include <omniORB4/CORBA.h>
#include "UniSetTypes_i.hh"
#include "IOController_i.hh"
#include "Mutex.h"
// -----------------------------------------------------------------------------------------
/*! */
......@@ -56,6 +57,9 @@ namespace UniSetTypes
UniversalIO::IOTypes getIOType( const std::string s );
std::ostream& operator<<( std::ostream& os, const UniversalIO::IOTypes t );
std::ostream& operator<<( std::ostream& os, const IOController_i::CalibrateInfo c );
/*! */
enum LampCommand
{
......
......@@ -204,14 +204,14 @@ using namespace UniSetTypes;
// ------------------------------------------------------------------------------------------
UniversalIO::IOTypes UniSetTypes::getIOType( const std::string stype )
{
if( stype == "AI" )
if ( stype == "DI" || stype == "di" )
return UniversalIO::DigitalInput;
if( stype == "AI" || stype == "ai" )
return UniversalIO::AnalogInput;
if ( stype == "AO" )
return UniversalIO::AnalogOutput;
if ( stype == "DO" )
if ( stype == "DO" || stype == "do" )
return UniversalIO::DigitalOutput;
if ( stype == "DI" )
return UniversalIO::DigitalInput;
if ( stype == "AO" || stype == "ao" )
return UniversalIO::AnalogOutput;
return UniversalIO::UnknownIOType;
}
......@@ -233,3 +233,11 @@ using namespace UniSetTypes;
return os << "UnknownIOType";
}
// ------------------------------------------------------------------------------------------
std::ostream& UniSetTypes::operator<<( std::ostream& os, const IOController_i::CalibrateInfo c )
{
return os << " rmin=" << c.minRaw << " rmax=" << c.maxRaw
<< " cmin=" << c.minCal << " cmax=" << c.maxCal
<< " precision=" << c.precision
<< " sensibility=" << c.sensibility;
}
// ------------------------------------------------------------------------------------------
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