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
b238fb11
Commit
b238fb11
authored
Jan 30, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(IOControl): исправление ошибки конфигурирования пороговых датчиков
parent
f2d57bfe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
56 deletions
+63
-56
test.xml
conf/test.xml
+31
-31
IOControl.cc
extensions/IOControl/IOControl.cc
+31
-21
start_fg.sh
extensions/IOControl/start_fg.sh
+1
-4
No files found.
conf/test.xml
View file @
b238fb11
This diff is collapsed.
Click to expand it.
extensions/IOControl/IOControl.cc
View file @
b238fb11
...
@@ -331,7 +331,6 @@ void IOControl::execute()
...
@@ -331,7 +331,6 @@ void IOControl::execute()
{
{
try
try
{
{
if
(
!
noCards
)
if
(
!
noCards
)
{
{
check_testmode
();
check_testmode
();
...
@@ -749,6 +748,37 @@ bool IOControl::initIOItem( UniXML_iterator& it )
...
@@ -749,6 +748,37 @@ bool IOControl::initIOItem( UniXML_iterator& it )
else
else
inf
.
subdev
=
DefaultSubdev
;
inf
.
subdev
=
DefaultSubdev
;
}
}
if
(
!
IOBase
::
initItem
(
&
inf
,
it
,
shm
,
&
unideb
,
myname
,
filtersize
,
filterT
)
)
return
false
;
// если вектор уже заполнен
// то увеличиваем его на 30 элементов (с запасом)
// после инициализации делается resize
// под реальное количество
if
(
maxItem
>=
iomap
.
size
()
)
iomap
.
resize
(
maxItem
+
30
);
int
prior
=
it
.
getIntProp
(
"iopriority"
);
if
(
prior
>
0
)
{
IOPriority
p
(
prior
,
maxItem
);
pmap
.
push_back
(
p
);
if
(
dlog
.
debugging
(
Debug
::
LEVEL3
)
)
dlog
[
Debug
::
LEVEL3
]
<<
myname
<<
"(readItem): add to priority list: "
<<
it
.
getProp
(
"name"
)
<<
" priority="
<<
prior
<<
endl
;
}
// значит это пороговый датчик..
if
(
inf
.
t_ai
!=
DefaultObjectId
)
{
iomap
[
maxItem
++
]
=
inf
;
if
(
dlog
.
debugging
(
Debug
::
LEVEL3
)
)
dlog
[
Debug
::
LEVEL3
]
<<
myname
<<
"(readItem): add threshold '"
<<
it
.
getProp
(
"name"
)
<<
" for '"
<<
conf
->
oind
->
getNameById
(
inf
.
t_ai
)
<<
endl
;
return
true
;
}
inf
.
channel
=
it
.
getIntProp
(
"channel"
);
inf
.
channel
=
it
.
getIntProp
(
"channel"
);
if
(
inf
.
channel
<
0
||
inf
.
channel
>
32
)
if
(
inf
.
channel
<
0
||
inf
.
channel
>
32
)
...
@@ -758,9 +788,6 @@ bool IOControl::initIOItem( UniXML_iterator& it )
...
@@ -758,9 +788,6 @@ bool IOControl::initIOItem( UniXML_iterator& it )
return
false
;
return
false
;
}
}
if
(
!
IOBase
::
initItem
(
&
inf
,
it
,
shm
,
&
unideb
,
myname
,
filtersize
,
filterT
)
)
return
false
;
inf
.
lamp
=
it
.
getIntProp
(
"lamp"
);
inf
.
lamp
=
it
.
getIntProp
(
"lamp"
);
inf
.
no_testlamp
=
it
.
getIntProp
(
"no_iotestlamp"
);
inf
.
no_testlamp
=
it
.
getIntProp
(
"no_iotestlamp"
);
inf
.
enable_testmode
=
it
.
getIntProp
(
"enable_testmode"
);
inf
.
enable_testmode
=
it
.
getIntProp
(
"enable_testmode"
);
...
@@ -792,23 +819,6 @@ bool IOControl::initIOItem( UniXML_iterator& it )
...
@@ -792,23 +819,6 @@ bool IOControl::initIOItem( UniXML_iterator& it )
if
(
unideb
.
debugging
(
Debug
::
LEVEL3
)
)
if
(
unideb
.
debugging
(
Debug
::
LEVEL3
)
)
dlog
[
Debug
::
LEVEL3
]
<<
myname
<<
"(readItem): add: "
<<
inf
.
stype
<<
" "
<<
inf
<<
endl
;
dlog
[
Debug
::
LEVEL3
]
<<
myname
<<
"(readItem): add: "
<<
inf
.
stype
<<
" "
<<
inf
<<
endl
;
// если вектор уже заполнен
// то увеличиваем его на 10 элементов (с запасом)
// после инициализации делается resize
// под реальное количество
if
(
maxItem
>=
iomap
.
size
()
)
iomap
.
resize
(
maxItem
+
10
);
int
prior
=
it
.
getIntProp
(
"iopriority"
);
if
(
prior
>
0
)
{
IOPriority
p
(
prior
,
maxItem
);
pmap
.
push_back
(
p
);
dlog
[
Debug
::
LEVEL3
]
<<
myname
<<
"(readItem): add to priority list: "
<<
it
.
getProp
(
"name"
)
<<
" priority="
<<
prior
<<
endl
;
}
iomap
[
maxItem
++
]
=
inf
;
iomap
[
maxItem
++
]
=
inf
;
return
true
;
return
true
;
}
}
...
...
extensions/IOControl/start_fg.sh
View file @
b238fb11
...
@@ -9,11 +9,8 @@ uniset-start.sh -f ./uniset-iocontrol --smemory-id SharedMemory \
...
@@ -9,11 +9,8 @@ uniset-start.sh -f ./uniset-iocontrol --smemory-id SharedMemory \
--io-polltime
100
\
--io-polltime
100
\
--io-s-filter-field
io
\
--io-s-filter-field
io
\
--io-s-filter-value
1
\
--io-s-filter-value
1
\
--io-numcards
2
\
--iodev1
/dev/null
\
--iodev2
/dev/null
\
--io-test-lamp
Input1_S
\
--io-test-lamp
Input1_S
\
--io-heartbeat-id
AI_AS
\
--io-heartbeat-id
AI_AS
\
--io-sm-ready-test-sid
Input1_S
\
--io-sm-ready-test-sid
Input1_S
\
--unideb-add-levels
info,crit,warn,level9,system
--unideb-add-levels
any
--dlog-add-levels
any
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