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
5f9d11d5
Commit
5f9d11d5
authored
Nov 22, 2012
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Calibration): добавил функции getMinRaw(),getMaxRaw(),getMinVal(),getMaxVal()
а также параметр crop_result в функции getRawValue()
parent
c6e29a5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
libuniset.spec
conf/libuniset.spec
+4
-1
Calibration.h
extensions/include/Calibration.h
+12
-1
Calibration.cc
extensions/lib/Calibration.cc
+15
-2
No files found.
conf/libuniset.spec
View file @
5f9d11d5
...
...
@@ -3,7 +3,7 @@
Name: libuniset
Version: 1.5
Release: alt
2
Release: alt
3
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
...
...
@@ -211,6 +211,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Thu Nov 22 2012 Pavel Vainerman <pv@altlinux.ru> 1.5-alt3
- (Calibration): add getMinRaw(),getMaxRaw(),getMinVal(),getMaxVal()
* Wed Nov 21 2012 Pavel Vainerman <pv@altlinux.ru> 1.5-alt2
- new ConfirmMessage format (eterbug #8842)
...
...
extensions/include/Calibration.h
View file @
5f9d11d5
...
...
@@ -40,12 +40,21 @@ class Calibration
*/
long
getValue
(
long
raw
,
bool
crop_raw
=
false
);
inline
long
getMinVal
(){
return
minVal
;
}
inline
long
getMaxVal
(){
return
maxVal
;
}
/*!
Получение сырого значения по калиброванному
\param crop - обрезать значение по крайним точкам,
если результат < minRaw или > maxRaw
Если crop_result=false, то может быть возвращено значение outOfRange.
*/
long
getRawValue
(
long
cal
);
long
getRawValue
(
long
cal
,
bool
crop_result
=
false
);
inline
long
getMinRaw
(){
return
minRaw
;
}
inline
long
getMaxRaw
(){
return
maxRaw
;
}
/*! построение характеристрики из конф. файла
\param name - название характеристики в файле
...
...
@@ -130,6 +139,8 @@ class Calibration
// список надо отсортировать по x!
typedef
std
::
list
<
Part
>
PartsList
;
long
minRaw
,
maxRaw
,
minVal
,
maxVal
;
private
:
PartsList
plist
;
...
...
extensions/lib/Calibration.cc
View file @
5f9d11d5
...
...
@@ -94,6 +94,7 @@ Calibration::TypeOfValue Calibration::Part::calcX( TypeOfValue y )
// ----------------------------------------------------------------------------
Calibration
::
Calibration
()
:
minRaw
(
0
),
maxRaw
(
0
),
minVal
(
0
),
maxVal
(
0
),
myname
(
""
)
{
}
...
...
@@ -101,13 +102,15 @@ myname("")
// ----------------------------------------------------------------------------
Calibration
::
Calibration
(
const
string
name
,
const
string
confile
)
:
minRaw
(
0
),
maxRaw
(
0
),
minVal
(
0
),
maxVal
(
0
),
myname
(
name
)
{
build
(
name
,
confile
,
0
);
}
// ----------------------------------------------------------------------------
Calibration
::
Calibration
(
xmlNode
*
node
)
Calibration
::
Calibration
(
xmlNode
*
node
)
:
minRaw
(
0
),
maxRaw
(
0
),
minVal
(
0
),
maxVal
(
0
)
{
UniXML_iterator
it
(
node
);
myname
=
it
.
getProp
(
"name"
);
...
...
@@ -168,6 +171,16 @@ void Calibration::build( const string name, const string confile, xmlNode* root
// cout << myname << "(Calibration::build):"
// << "\tadd x=" << p.x << " y=" << p.y << endl;
if
(
p
.
y
>
maxRaw
)
maxRaw
=
p
.
y
;
else
if
(
p
.
y
<
minRaw
)
minRaw
=
p
.
y
;
if
(
p
.
x
>
maxVal
)
maxVal
=
p
.
x
;
else
if
(
p
.
x
<
minVal
)
minVal
=
p
.
x
;
if
(
prev
)
{
// cout << myname << "(Calibration::build):"
...
...
@@ -223,7 +236,7 @@ long Calibration::getValue( long raw, bool crop_raw )
return
it
->
calcY
(
raw
);
}
// ----------------------------------------------------------------------------
long
Calibration
::
getRawValue
(
long
cal
)
long
Calibration
::
getRawValue
(
long
cal
,
bool
crop_cal
)
{
for
(
PartsList
::
iterator
it
=
plist
.
begin
();
it
!=
plist
.
end
();
++
it
)
{
...
...
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