Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
512e39c7
Commit
512e39c7
authored
Jun 26, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(calibration): расширил тест для проверки работы класса Calibration
parent
c5a96aea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
test.xml
conf/test.xml
+5
-0
calibration.cc
extensions/tests/calibration.cc
+4
-0
No files found.
conf/test.xml
View file @
512e39c7
...
...
@@ -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>
extensions/tests/calibration.cc
View file @
512e39c7
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment