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
583757f6
Commit
583757f6
authored
Feb 02, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fix: pow10() --> pow()
parent
a78dbd78
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
10 deletions
+14
-10
libuniset2.spec
conf/libuniset2.spec
+4
-1
DBServer_MySQL.cc
extensions/DBServer-MySQL/DBServer_MySQL.cc
+1
-1
DBServer_SQLite.cc
extensions/DBServer-SQLite/DBServer_SQLite.cc
+1
-1
test_mbslave.cc
extensions/ModbusSlave/tests/test_mbslave.cc
+3
-3
IOBase.cc
extensions/lib/IOBase.cc
+5
-4
No files found.
conf/libuniset2.spec
View file @
583757f6
...
...
@@ -17,7 +17,7 @@
Name: libuniset2
Version: 2.7
Release: alt
2.1
Release: alt
3
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
...
...
@@ -518,6 +518,9 @@ rm -f %buildroot%_libdir/*.la
# history of current unpublished changes
%changelog
* Thu Feb 01 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt3
- minor fixes
* Wed Jan 10 2018 Alexei Takaseev <taf@altlinux.org> 2.7-alt2.1
- Rebuild with poco 1.8.1
...
...
extensions/DBServer-MySQL/DBServer_MySQL.cc
View file @
583757f6
...
...
@@ -205,7 +205,7 @@ void DBServer_MySQL::sensorInfo( const uniset::SensorMessage* si )
<<
endl
;
}
float
val
=
(
float
)
si
->
value
/
(
float
)
pow
10
(
si
->
ci
.
precision
);
float
val
=
(
float
)
si
->
value
/
(
float
)
pow
(
10.0
,
si
->
ci
.
precision
);
// см. DBTABLE AnalogSensors, DigitalSensors
ostringstream
data
;
...
...
extensions/DBServer-SQLite/DBServer_SQLite.cc
View file @
583757f6
...
...
@@ -187,7 +187,7 @@ void DBServer_SQLite::sensorInfo( const uniset::SensorMessage* si )
<<
endl
;
}
float
val
=
(
float
)
si
->
value
/
(
float
)
pow
10
(
si
->
ci
.
precision
);
float
val
=
(
float
)
si
->
value
/
(
float
)
pow
(
10.0
,
si
->
ci
.
precision
);
// см. DBTABLE AnalogSensors, DigitalSensors
ostringstream
data
;
...
...
extensions/ModbusSlave/tests/test_mbslave.cc
View file @
583757f6
...
...
@@ -659,7 +659,7 @@ static void test_write10_F2( const float& val )
si
.
id
=
2007
;
si
.
node
=
conf
->
getLocalNode
();
IOController_i
::
CalibrateInfo
cal
=
ui
->
getCalibrateInfo
(
si
);
float
fval
=
(
float
)
ui
->
getValue
(
si
.
id
)
/
pow
10
(
cal
.
precision
);
float
fval
=
(
float
)
ui
->
getValue
(
si
.
id
)
/
pow
(
10.0
,
cal
.
precision
);
REQUIRE
(
fval
==
val
);
}
...
...
@@ -680,7 +680,7 @@ static void test_write10_F2r( const float& val )
si
.
id
=
2008
;
si
.
node
=
conf
->
getLocalNode
();
IOController_i
::
CalibrateInfo
cal
=
ui
->
getCalibrateInfo
(
si
);
float
fval
=
(
float
)
ui
->
getValue
(
si
.
id
)
/
pow
10
(
cal
.
precision
);
float
fval
=
(
float
)
ui
->
getValue
(
si
.
id
)
/
pow
(
10.0
,
cal
.
precision
);
REQUIRE
(
fval
==
val
);
}
...
...
@@ -729,7 +729,7 @@ static void test_write10_F4prec( const float& val )
si
.
id
=
2009
;
si
.
node
=
conf
->
getLocalNode
();
IOController_i
::
CalibrateInfo
cal
=
ui
->
getCalibrateInfo
(
si
);
float
fval
=
(
float
)
ui
->
getValue
(
si
.
id
)
/
pow
10
(
cal
.
precision
);
float
fval
=
(
float
)
ui
->
getValue
(
si
.
id
)
/
pow
(
10.0
,
cal
.
precision
);
REQUIRE
(
fval
==
val
);
}
...
...
extensions/lib/IOBase.cc
View file @
583757f6
...
...
@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// -------------------------------------------------------------------------
#include <cmath>
#include "Configuration.h"
#include "Extensions.h"
#include "UniSetTypes.h"
...
...
@@ -247,7 +248,7 @@ namespace uniset
}
if
(
!
it
->
noprecision
&&
it
->
cal
.
precision
!=
0
)
val
=
lround
(
val
*
pow
10
(
it
->
cal
.
precision
)
);
val
=
lround
(
val
*
pow
(
10.0
,
it
->
cal
.
precision
)
);
}
}
// end of 'check_depend'
...
...
@@ -283,7 +284,7 @@ namespace uniset
memcpy
(
&
val
,
&
fval
,
std
::
min
(
sizeof
(
val
),
sizeof
(
fval
)));
}
else
if
(
it
->
cal
.
precision
!=
0
&&
!
it
->
noprecision
)
val
=
lroundf
(
fval
*
pow
10
(
it
->
cal
.
precision
)
);
val
=
lroundf
(
fval
*
pow
(
10.0
,
it
->
cal
.
precision
)
);
// проверка на обрыв
if
(
it
->
check_channel_break
(
val
)
)
...
...
@@ -395,7 +396,7 @@ namespace uniset
{
// сперва "убираем степень", потом калибруем.. (это обратная последовательность для AsAI)
if
(
!
it
->
noprecision
&&
it
->
cal
.
precision
!=
0
)
val
=
lroundf
(
(
float
)
it
->
value
/
pow
10
(
it
->
cal
.
precision
)
);
val
=
lroundf
(
(
float
)
it
->
value
/
pow
(
10.0
,
it
->
cal
.
precision
)
);
IOController_i
::
CalibrateInfo
*
cal
(
&
(
it
->
cal
)
);
...
...
@@ -461,7 +462,7 @@ namespace uniset
}
if
(
!
it
->
noprecision
&&
it
->
cal
.
precision
!=
0
)
return
(
fval
/
pow
10
(
it
->
cal
.
precision
)
);
return
(
fval
/
pow
(
10.0
,
it
->
cal
.
precision
)
);
}
else
// if( it->stype == UniversalIO::DI || it->stype == UniversalIO::DO )
fval
=
val
?
1.0
:
0.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