Commit 512e39c7 authored by Pavel Vainerman's avatar Pavel Vainerman

(calibration): расширил тест для проверки работы класса Calibration

parent c5a96aea
......@@ -131,6 +131,9 @@
<item default="6553604" iotype="AI" mb_vtype="U2" mbaddr="0x01" mbreg="0x14" mbtcp="2" mbtype="rtu" name="MB2_AS" priority="Medium" textname="Analog input"/>
<item default="65536045" iotype="AI" mb_vtype="F2" mbaddr="0x01" mbreg="0x17" mbtcp="2" mbtype="rtu" name="MB3_AS" priority="Medium" textname="Analog input"/>
<item iotype="AI" name="IOTestMode_AS" priority="Medium" textname="testmode for IOControl"/>
<item name="imitator_performance1" precision="6" textname="Производительность танка 1" iotype="AI" rs="mbslave" mbreg="43" mb_vtype="I2"/>
<item name="performance1" precision="6" noprecision="1" textname="Производительность танка 1" iotype="AI" rs="mbmaster" tcp_vtype="I2" tcp_mbtype="rtu"
tcp_mbaddr="1" tcp_mbreg="43" tcp_mbfunc="0x04"/>
</sensors>
<thresholds name="thresholds">
<sensor iotype="AI" name="AI_AS">
......@@ -178,11 +181,13 @@
<Calibrations name="Calibrations">
<diagram name="testcal">
<point x="-200" y="-60"/>
<point x="-100" y="-60"/>
<point x="-50" y="-20"/>
<point x="0" y="0"/>
<point x="50" y="20"/>
<point x="100" y="60"/>
<point x="200" y="60"/>
</diagram>
</Calibrations>
</UNISETPLC>
......@@ -19,6 +19,7 @@ int main( int argc, const char** argv )
cout << "diagram: " << cal << endl;
cout << "-1500 --> " << cal->getValue(-1500) << endl;
cout << "-200 --> " << cal->getValue(-200) << endl;
cout << "-100 --> " << cal->getValue(-100) << endl;
cout << " -75 --> " << cal->getValue(-75) << endl;
cout << " -50 --> " << cal->getValue(-50) << endl;
......@@ -28,10 +29,12 @@ int main( int argc, const char** argv )
cout << " 50 --> " << cal->getValue(50) << endl;
cout << " 75 --> " << cal->getValue(75) << endl;
cout << " 100 --> " << cal->getValue(100) << endl;
cout << " 200 --> " << cal->getValue(200) << endl;
cout << " 1500 --> " << cal->getValue(1500) << endl;
cout << endl << " RAW VALUE.." << endl;
cout << "-1220 --> " << cal->getRawValue(-1220) << endl;
cout << " -200 --> " << cal->getRawValue(-200) << endl;
cout << " -60 --> " << cal->getRawValue(-60) << endl;
cout << " -40 --> " << cal->getRawValue(-40) << endl;
cout << " -20 --> " << cal->getRawValue(-20) << endl;
......@@ -39,6 +42,7 @@ int main( int argc, const char** argv )
cout << " 20 --> " << cal->getRawValue(20) << endl;
cout << " 40 --> " << cal->getRawValue(40) << endl;
cout << " 60 --> " << cal->getRawValue(60) << endl;
cout << " 200 --> " << cal->getRawValue(200) << endl;
cout << " 1500 --> " << cal->getRawValue(1500) << endl;
return 0;
......
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