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