Commit 7bee3168 authored by Pavel Vainerman's avatar Pavel Vainerman

(SMonit): сделал вывод значения с учётом "precision"

parent 9c4d0ee5
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
---------- ----------
smonit: processing "precision"
admin: processing "precision" admin: processing "precision"
......
#!/bin/sh #!/bin/sh
uniset-start.sh -f ./uniset-smonit --name TestProc --confile test.xml --unideb-add-levels system,info,level9 $* uniset-start.sh -f ./uniset-smonit --name TestProc --confile test.xml --sid $*
#--unideb-add-levels system,info,level9 $*
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <cmath>
#include "SMonitor.h" #include "SMonitor.h"
#include "Configuration.h" #include "Configuration.h"
#include "ORepHelpers.h" #include "ORepHelpers.h"
...@@ -134,7 +135,7 @@ void SMonitor::sensorInfo( SensorMessage *si ) ...@@ -134,7 +135,7 @@ void SMonitor::sensorInfo( SensorMessage *si )
if( si->sensor_type == UniversalIO::DigitalInput || si->sensor_type == UniversalIO::DigitalOutput ) if( si->sensor_type == UniversalIO::DigitalInput || si->sensor_type == UniversalIO::DigitalOutput )
cout << "\tstate=" << si->state << endl; cout << "\tstate=" << si->state << endl;
else if( si->sensor_type == UniversalIO::AnalogInput || si->sensor_type == UniversalIO::AnalogOutput ) else if( si->sensor_type == UniversalIO::AnalogInput || si->sensor_type == UniversalIO::AnalogOutput )
cout << "\tvalue=" << si->value << endl; cout << "\tvalue=" << si->value << "\tfvalue=" << ( (float)si->value / pow(10.0,si->ci.precision) ) << 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