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
1aec772e
Commit
1aec772e
authored
Jan 14, 2021
by
Pavel Vainerman
Committed by
Pavel Vainerman
Jan 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed getSensorIOInfo interface (supported old omniORB)
parent
2b9068f2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
34 deletions
+34
-34
admin.cc
Utilities/Admin/admin.cc
+11
-11
test_ui.cc
extensions/tests/test_ui.cc
+21
-21
UInterface.h
include/UInterface.h
+1
-1
UInterface.cc
src/Core/UInterface.cc
+1
-1
No files found.
Utilities/Admin/admin.cc
View file @
1aec772e
...
...
@@ -1219,7 +1219,7 @@ int sinfo(const string& args, UInterface& ui )
if
(
it
.
si
.
node
==
DefaultObjectId
)
it
.
si
.
node
=
conf
->
getLocalNode
();
IOController_i
::
SensorIOInfo_var
sinf
=
ui
.
getSensorIOInfo
(
it
.
si
);
auto
sinf
=
ui
.
getSensorIOInfo
(
it
.
si
);
#if 0
UniversalIO::IOType type; /*!< тип */
long priority; /*!< приоритет уведомления */
...
...
@@ -1229,22 +1229,22 @@ int sinfo(const string& args, UInterface& ui )
const
int
w
=
14
;
print_help
(
w
,
"id"
,
std
::
to_string
(
it
.
si
.
id
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"node"
,
std
::
to_string
(
it
.
si
.
node
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"value"
,
std
::
to_string
(
sinf
->
value
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"real_value"
,
std
::
to_string
(
sinf
->
real_value
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"frozen"
,
std
::
to_string
(
sinf
->
frozen
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"undefined"
,
std
::
to_string
(
sinf
->
undefined
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"blocked"
,
std
::
to_string
(
sinf
->
blocked
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"value"
,
std
::
to_string
(
sinf
.
value
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"real_value"
,
std
::
to_string
(
sinf
.
real_value
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"frozen"
,
std
::
to_string
(
sinf
.
frozen
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"undefined"
,
std
::
to_string
(
sinf
.
undefined
)
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"blocked"
,
std
::
to_string
(
sinf
.
blocked
)
+
"
\n
"
,
" "
,
" : "
);
if
(
sinf
->
depend_sid
!=
DefaultObjectId
)
print_help
(
w
,
"depend_sensor"
,
"("
+
to_string
(
sinf
->
depend_sid
)
+
")"
+
ORepHelpers
::
getShortName
(
conf
->
oind
->
getMapName
(
sinf
->
depend_sid
))
+
"
\n
"
,
" "
,
" : "
);
if
(
sinf
.
depend_sid
!=
DefaultObjectId
)
print_help
(
w
,
"depend_sensor"
,
"("
+
to_string
(
sinf
.
depend_sid
)
+
")"
+
ORepHelpers
::
getShortName
(
conf
->
oind
->
getMapName
(
sinf
.
depend_sid
))
+
"
\n
"
,
" "
,
" : "
);
if
(
sinf
->
supplier
==
uniset
::
AdminID
)
if
(
sinf
.
supplier
==
uniset
::
AdminID
)
print_help
(
w
,
"supplier"
,
"admin
\n
"
,
" "
,
" : "
);
else
print_help
(
w
,
"supplier"
,
ORepHelpers
::
getShortName
(
conf
->
oind
->
getMapName
(
sinf
->
supplier
))
+
"
\n
"
,
" "
,
" : "
);
print_help
(
w
,
"supplier"
,
ORepHelpers
::
getShortName
(
conf
->
oind
->
getMapName
(
sinf
.
supplier
))
+
"
\n
"
,
" "
,
" : "
);
ostringstream
ts
;
ts
<<
dateToString
(
sinf
->
tv_sec
)
<<
" "
<<
timeToString
(
sinf
->
tv_sec
)
<<
"."
<<
sinf
->
tv_nsec
<<
"
\n
"
;
ts
<<
dateToString
(
sinf
.
tv_sec
)
<<
" "
<<
timeToString
(
sinf
.
tv_sec
)
<<
"."
<<
sinf
.
tv_nsec
<<
"
\n
"
;
print_help
(
w
,
"changed"
,
ts
.
str
(),
" "
,
" : "
);
}
catch
(
const
uniset
::
Exception
&
ex
)
...
...
extensions/tests/test_ui.cc
View file @
1aec772e
...
...
@@ -291,37 +291,37 @@ TEST_CASE("UInterface::getSensorIOInfo", "[UInterface][getSensorIOInfo]")
REQUIRE_NOTHROW
(
ui
->
getSensorIOInfo
(
si
)
);
auto
inf
=
ui
->
getSensorIOInfo
(
si
);
REQUIRE
(
inf
->
supplier
==
testOID
);
REQUIRE
(
inf
->
value
==
200
);
REQUIRE
(
inf
->
real_value
==
200
);
REQUIRE
(
inf
->
blocked
==
false
);
REQUIRE
(
inf
->
frozen
==
false
);
REQUIRE
(
inf
->
undefined
==
false
);
REQUIRE
(
inf
->
tv_sec
>
0
);
REQUIRE
(
inf
->
dbignore
==
false
);
REQUIRE
(
inf
->
depend_sid
==
DefaultObjectId
);
REQUIRE
(
inf
.
supplier
==
testOID
);
REQUIRE
(
inf
.
value
==
200
);
REQUIRE
(
inf
.
real_value
==
200
);
REQUIRE
(
inf
.
blocked
==
false
);
REQUIRE
(
inf
.
frozen
==
false
);
REQUIRE
(
inf
.
undefined
==
false
);
REQUIRE
(
inf
.
tv_sec
>
0
);
REQUIRE
(
inf
.
dbignore
==
false
);
REQUIRE
(
inf
.
depend_sid
==
DefaultObjectId
);
// freeze/unfreeze
REQUIRE_NOTHROW
(
ui
->
freezeValue
(
si
,
true
,
10
,
testOID
)
);
inf
=
ui
->
getSensorIOInfo
(
si
);
REQUIRE
(
inf
->
frozen
==
true
);
REQUIRE
(
inf
->
supplier
==
testOID
);
REQUIRE
(
inf
.
frozen
==
true
);
REQUIRE
(
inf
.
supplier
==
testOID
);
REQUIRE_NOTHROW
(
ui
->
freezeValue
(
si
,
false
,
10
,
testOID
)
);
inf
=
ui
->
getSensorIOInfo
(
si
);
REQUIRE
(
inf
->
frozen
==
false
);
REQUIRE
(
inf
->
supplier
==
testOID
);
REQUIRE
(
inf
.
frozen
==
false
);
REQUIRE
(
inf
.
supplier
==
testOID
);
// undef
REQUIRE_NOTHROW
(
ui
->
setUndefinedState
(
si
,
true
,
testOID
));
inf
=
ui
->
getSensorIOInfo
(
si
);
REQUIRE
(
inf
->
undefined
==
true
);
REQUIRE
(
inf
->
supplier
==
testOID
);
REQUIRE
(
inf
.
undefined
==
true
);
REQUIRE
(
inf
.
supplier
==
testOID
);
REQUIRE_NOTHROW
(
ui
->
setUndefinedState
(
si
,
false
,
testOID
));
inf
=
ui
->
getSensorIOInfo
(
si
);
REQUIRE
(
inf
->
undefined
==
false
);
REQUIRE
(
inf
->
supplier
==
testOID
);
REQUIRE
(
inf
.
undefined
==
false
);
REQUIRE
(
inf
.
supplier
==
testOID
);
// depend
si
.
id
=
100
;
...
...
@@ -330,14 +330,14 @@ TEST_CASE("UInterface::getSensorIOInfo", "[UInterface][getSensorIOInfo]")
si
.
id
=
101
;
inf
=
ui
->
getSensorIOInfo
(
si
);
REQUIRE
(
inf
->
blocked
==
true
);
REQUIRE
(
inf
->
depend_sid
==
100
);
REQUIRE
(
inf
.
blocked
==
true
);
REQUIRE
(
inf
.
depend_sid
==
100
);
si
.
id
=
100
;
REQUIRE_NOTHROW
(
ui
->
setValue
(
si
,
10
,
testOID
)
);
si
.
id
=
101
;
inf
=
ui
->
getSensorIOInfo
(
si
);
REQUIRE
(
inf
->
blocked
==
false
);
REQUIRE
(
inf
->
depend_sid
==
100
);
REQUIRE
(
inf
.
blocked
==
false
);
REQUIRE
(
inf
.
depend_sid
==
100
);
}
include/UInterface.h
View file @
1aec772e
...
...
@@ -80,7 +80,7 @@ namespace uniset
IOController_i
::
SensorInfoSeq_var
getSensorSeq
(
const
uniset
::
IDList
&
lst
);
//! Получение состояния информации о датчике
IOController_i
::
SensorIOInfo
_var
getSensorIOInfo
(
const
IOController_i
::
SensorInfo
&
si
);
IOController_i
::
SensorIOInfo
getSensorIOInfo
(
const
IOController_i
::
SensorInfo
&
si
);
/*! Изменения состояния списка входов/выходов
\return Возвращает список не найденных идентификаторов */
...
...
src/Core/UInterface.cc
View file @
1aec772e
...
...
@@ -2236,7 +2236,7 @@ namespace uniset
}
// --------------------------------------------------------------------------------------------
IOController_i
::
SensorIOInfo
_var
UInterface
::
getSensorIOInfo
(
const
IOController_i
::
SensorInfo
&
si
)
IOController_i
::
SensorIOInfo
UInterface
::
getSensorIOInfo
(
const
IOController_i
::
SensorInfo
&
si
)
{
if
(
si
.
id
==
uniset
::
DefaultObjectId
)
throw
uniset
::
ORepFailed
(
"UI(getSensorIOInfo): error node=uniset::DefaultObjectId"
);
...
...
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