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
3d967054
Commit
3d967054
authored
May 19, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(IOControl): Исправлены две критических ошибки.
parent
eb9a3684
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
libuniset.spec
conf/libuniset.spec
+4
-1
IOControl.cc
extensions/IOControl/IOControl.cc
+16
-11
No files found.
conf/libuniset.spec
View file @
3d967054
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 1.0
Version: 1.0
Release: alt3
3
Release: alt3
4
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
License: GPL
License: GPL
Group: Development/C++
Group: Development/C++
...
@@ -207,6 +207,9 @@ rm -f %buildroot%_libdir/*.la
...
@@ -207,6 +207,9 @@ rm -f %buildroot%_libdir/*.la
%changelog
%changelog
* Thu May 19 2011 Pavel Vainerman <pv@etersoft.ru> 1.0-alt34
- fixed bug in IOControl
* Thu May 19 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt33
* Thu May 19 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt33
- fixed bug in DBInterface::ping (again). Many thanks uzum
- fixed bug in DBInterface::ping (again). Many thanks uzum
...
...
extensions/IOControl/IOControl.cc
View file @
3d967054
...
@@ -196,10 +196,10 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
...
@@ -196,10 +196,10 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
sidTestSMReady
=
conf
->
getSensorID
(
sm_ready_sid
);
sidTestSMReady
=
conf
->
getSensorID
(
sm_ready_sid
);
if
(
sidTestSMReady
==
DefaultObjectId
)
if
(
sidTestSMReady
==
DefaultObjectId
)
{
{
sidTestSMReady
=
4100
;
/* TestMode_S */
sidTestSMReady
=
conf
->
getSensorID
(
"TestMode_S"
);
unideb
[
Debug
::
WARN
]
<<
myname
unideb
[
Debug
::
WARN
]
<<
myname
<<
"(init):
не указан идентификатор датчика теста SM
(--"
<<
prefix
<<
"-sm-ready-test-sid)."
<<
"(init):
Unknown ID for sm-ready-test-sid
(--"
<<
prefix
<<
"-sm-ready-test-sid)."
<<
"
Берём TestMode_S(4100)
"
<<
endl
;
<<
"
Use 'TestMode_S'
"
<<
endl
;
}
}
else
else
unideb
[
Debug
::
INFO
]
<<
myname
<<
"(init): test-sid: "
<<
sm_ready_sid
<<
endl
;
unideb
[
Debug
::
INFO
]
<<
myname
<<
"(init): test-sid: "
<<
sm_ready_sid
<<
endl
;
...
@@ -213,7 +213,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
...
@@ -213,7 +213,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
if
(
sidHeartBeat
==
DefaultObjectId
)
if
(
sidHeartBeat
==
DefaultObjectId
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
":
не найден идентификатор для датчика
'HeartBeat' "
<<
heart
;
err
<<
myname
<<
":
Not found ID for
'HeartBeat' "
<<
heart
;
unideb
[
Debug
::
CRIT
]
<<
myname
<<
"(init): "
<<
err
.
str
()
<<
endl
;
unideb
[
Debug
::
CRIT
]
<<
myname
<<
"(init): "
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
throw
SystemError
(
err
.
str
());
}
}
...
@@ -319,7 +319,7 @@ void IOControl::execute()
...
@@ -319,7 +319,7 @@ void IOControl::execute()
}
}
catch
(...){}
catch
(...){}
while
(
!
term
)
while
(
!
term
)
{
{
try
try
{
{
...
@@ -356,9 +356,11 @@ void IOControl::execute()
...
@@ -356,9 +356,11 @@ void IOControl::execute()
catch
(...){}
catch
(...){}
}
}
{
uniset_mutex_lock
l
(
iopollMutex
,
5000
);
uniset_mutex_lock
l
(
iopollMutex
,
5000
);
iopoll
();
iopoll
();
}
}
}
if
(
sidHeartBeat
!=
DefaultObjectId
&&
ptHeartBeat
.
checkTime
()
)
if
(
sidHeartBeat
!=
DefaultObjectId
&&
ptHeartBeat
.
checkTime
()
)
{
{
...
@@ -460,10 +462,12 @@ void IOControl::ioread( IOInfo* it )
...
@@ -460,10 +462,12 @@ void IOControl::ioread( IOInfo* it )
ComediInterface
*
card
=
cards
.
getCard
(
it
->
ncard
);
ComediInterface
*
card
=
cards
.
getCard
(
it
->
ncard
);
// cout << conf->oind->getMapName(it->si.id)
/*
// << " card=" << card << " ncard=" << it->ncard
cout << conf->oind->getMapName(it->si.id)
// << " subdev: " << it->subdev << " chan: " << it->channel << endl;
<< " card=" << card << " ncard=" << it->ncard
<< " dev=" << card->devname()
<< " subdev: " << it->subdev << " chan: " << it->channel << endl;
*/
if
(
card
==
NULL
||
it
->
subdev
==
DefaultSubdev
||
it
->
channel
==
DefaultChannel
)
if
(
card
==
NULL
||
it
->
subdev
==
DefaultSubdev
||
it
->
channel
==
DefaultChannel
)
return
;
return
;
...
@@ -505,7 +509,7 @@ void IOControl::ioread( IOInfo* it )
...
@@ -505,7 +509,7 @@ void IOControl::ioread( IOInfo* it )
{
{
unideb[Debug::LEVEL3] << myname << "(iopoll): read DI "
unideb[Debug::LEVEL3] << myname << "(iopoll): read DI "
<< " sid=" << it->si.id
<< " sid=" << it->si.id
<< " subdev
" << it->subdev
<< " subdev
=" << it->subdev
<< " chan=" << it->channel
<< " chan=" << it->channel
<< " state=" << set
<< " state=" << set
<< endl;
<< endl;
...
@@ -1592,7 +1596,7 @@ void IOControl::buildCardsList()
...
@@ -1592,7 +1596,7 @@ void IOControl::buildCardsList()
return
;
return
;
}
}
size_t
lastnum
=
0
;
size_t
lastnum
=
1
;
for
(
;
lastnum
<
cards
.
size
();
lastnum
++
)
for
(
;
lastnum
<
cards
.
size
();
lastnum
++
)
{
{
if
(
cards
[
lastnum
]
==
0
)
if
(
cards
[
lastnum
]
==
0
)
...
@@ -1622,6 +1626,7 @@ void IOControl::buildCardsList()
...
@@ -1622,6 +1626,7 @@ void IOControl::buildCardsList()
try
try
{
{
cards
[
lastnum
]
=
new
ComediInterface
(
iodev
);
cards
[
lastnum
]
=
new
ComediInterface
(
iodev
);
noCards
=
false
;
}
}
catch
(
Exception
&
ex
)
catch
(
Exception
&
ex
)
{
{
...
...
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