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
5faa3b57
Commit
5faa3b57
authored
Mar 23, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(IOController): подправил сообщения об ошибках (частично перевёл).
parent
5b6d5020
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
37 deletions
+52
-37
IOController.cc
src/Processes/IOController.cc
+52
-37
No files found.
src/Processes/IOController.cc
View file @
5faa3b57
...
@@ -149,8 +149,8 @@ bool IOController::localGetState( IOController::DIOStateList::iterator& li,
...
@@ -149,8 +149,8 @@ bool IOController::localGetState( IOController::DIOStateList::iterator& li,
// -------------
// -------------
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(localGetState):
дискретный вход(выход) с именем "
err
<<
myname
<<
"(localGetState):
Not found digital sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
") "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" не найден"
;
<<
conf
->
oind
->
getNameById
(
si
.
id
);
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
...
@@ -174,10 +174,12 @@ long IOController::localGetValue( IOController::AIOStateList::iterator& li,
...
@@ -174,10 +174,12 @@ long IOController::localGetValue( IOController::AIOStateList::iterator& li,
// -------------
// -------------
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(localGetValue): аналоговый вход(выход) с именем "
err
<<
myname
<<
"(localGetValue): Not found analog sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
") "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" не найден"
;
<<
conf
->
oind
->
getNameById
(
si
.
id
);
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
...
@@ -216,9 +218,9 @@ void IOController::localSetUndefinedState( AIOStateList::iterator& li,
...
@@ -216,9 +218,9 @@ void IOController::localSetUndefinedState( AIOStateList::iterator& li,
if
(
li
==
aioList
.
end
()
)
if
(
li
==
aioList
.
end
()
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(localSetUndefined):
не зарегистрирован датчик
"
err
<<
myname
<<
"(localSetUndefined):
Unknown sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")
"
<<
"
имя
: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
"
name
: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
"
узел: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
<<
"
node: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
...
@@ -243,18 +245,19 @@ void IOController::localSaveState( IOController::DIOStateList::iterator& li,
...
@@ -243,18 +245,19 @@ void IOController::localSaveState( IOController::DIOStateList::iterator& li,
if
(
li
==
dioList
.
end
()
)
if
(
li
==
dioList
.
end
()
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(
saveState): не зарегистрирован датчик
"
err
<<
myname
<<
"(
localSaveState): Unknown sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")
"
<<
"
имя
: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
"
name
: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
"
узел: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
<<
"
node: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
if
(
li
->
second
.
type
!=
UniversalIO
::
DigitalInput
)
// && li->second.type != UniversalIO::DigitalOutput )
if
(
li
->
second
.
type
!=
UniversalIO
::
DigitalInput
)
// && li->second.type != UniversalIO::DigitalOutput )
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(saveState): неверно указан тип( "
<<
li
->
second
.
type
<<
") дискретного датчика имя: "
err
<<
myname
<<
"(localSaveState): Bad sensor iotype="
<<
li
->
second
.
type
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
". Sensor must be 'DI'. ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
" узел: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
<<
" name: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" node: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
throw
IOController_i
::
IOBadParam
(
err
.
str
().
c_str
());
throw
IOController_i
::
IOBadParam
(
err
.
str
().
c_str
());
}
}
...
@@ -302,7 +305,7 @@ void IOController::localSaveState( IOController::DIOStateList::iterator& li,
...
@@ -302,7 +305,7 @@ void IOController::localSaveState( IOController::DIOStateList::iterator& li,
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
{
{
unideb
[
Debug
::
INFO
]
<<
myname
<<
":
сохраняем состояние дискретного датчика
"
unideb
[
Debug
::
INFO
]
<<
myname
<<
":
save digital sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")
"
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" = "
<<
state
<<
" = "
<<
state
<<
" blocked="
<<
blocked
<<
" blocked="
<<
blocked
...
@@ -350,18 +353,19 @@ void IOController::localSaveValue( IOController::AIOStateList::iterator& li,
...
@@ -350,18 +353,19 @@ void IOController::localSaveValue( IOController::AIOStateList::iterator& li,
if
(
li
==
aioList
.
end
()
)
if
(
li
==
aioList
.
end
()
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(
saveValue): не зарегистрирован датчик
"
err
<<
myname
<<
"(
localSaveValue): Unknown sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")
"
<<
"
имя
: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
"
name
: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
"
узел: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
<<
"
node: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
if
(
li
->
second
.
type
!=
UniversalIO
::
AnalogInput
)
// && li->second.type != UniversalIO::AnalogOutput )
if
(
li
->
second
.
type
!=
UniversalIO
::
AnalogInput
)
// && li->second.type != UniversalIO::AnalogOutput )
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(saveValue): неверно указан тип("
<<
li
->
second
.
type
err
<<
myname
<<
"(localSaveValue): Bad sensor iotype="
<<
li
->
second
.
type
<<
") аналогового датчика имя: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
". Sensor must be 'AI'. ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
" узел: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
<<
" name: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" node: "
<<
conf
->
oind
->
getMapName
(
si
.
node
);
throw
IOController_i
::
IOBadParam
(
err
.
str
().
c_str
());
throw
IOController_i
::
IOBadParam
(
err
.
str
().
c_str
());
}
}
...
@@ -377,9 +381,10 @@ void IOController::localSaveValue( IOController::AIOStateList::iterator& li,
...
@@ -377,9 +381,10 @@ void IOController::localSaveValue( IOController::AIOStateList::iterator& li,
{
{
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
{
{
unideb
[
Debug
::
INFO
]
<<
myname
<<
": сохраняем состояние аналогового датчика "
unideb
[
Debug
::
INFO
]
<<
myname
<<
": save analog sensor value ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" name: "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" = "
<<
value
<<
endl
;
<<
" node: "
<<
conf
->
oind
->
getMapName
(
si
.
node
)
<<
" value="
<<
value
<<
endl
;
}
}
if
(
!
blocked
)
if
(
!
blocked
)
li
->
second
.
real_value
=
li
->
second
.
value
;
li
->
second
.
real_value
=
li
->
second
.
value
;
...
@@ -521,7 +526,7 @@ void IOController::localSetState( IOController::DIOStateList::iterator& li,
...
@@ -521,7 +526,7 @@ void IOController::localSetState( IOController::DIOStateList::iterator& li,
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
{
{
unideb
[
Debug
::
INFO
]
<<
myname
unideb
[
Debug
::
INFO
]
<<
myname
<<
":
сохраняем состояние дискретного выхода
"
<<
":
save state for DO ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")
"
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" = "
<<
state
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" = "
<<
state
<<
" blocked="
<<
li
->
second
.
blocked
<<
" blocked="
<<
li
->
second
.
blocked
<<
" --> state="
<<
li
->
second
.
state
<<
" --> state="
<<
li
->
second
.
state
...
@@ -538,7 +543,7 @@ void IOController::localSetState( IOController::DIOStateList::iterator& li,
...
@@ -538,7 +543,7 @@ void IOController::localSetState( IOController::DIOStateList::iterator& li,
// -------------
// -------------
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(localSetState):
выход с именем "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" не найден"
;
err
<<
myname
<<
"(localSetState):
Unknown sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
conf
->
oind
->
getNameById
(
si
.
id
)
;
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
...
@@ -573,7 +578,8 @@ void IOController::localSetValue( IOController::AIOStateList::iterator& li,
...
@@ -573,7 +578,8 @@ void IOController::localSetValue( IOController::AIOStateList::iterator& li,
li
->
second
.
tv_usec
=
tm
.
tv_usec
;
li
->
second
.
tv_usec
=
tm
.
tv_usec
;
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
{
{
unideb
[
Debug
::
INFO
]
<<
myname
<<
"(localSetValue): сохраняем состояние аналогового выхода "
unideb
[
Debug
::
INFO
]
<<
myname
<<
"(localSetValue): save analog value for ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" = "
<<
value
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" = "
<<
value
<<
" blocked="
<<
li
->
second
.
blocked
<<
" blocked="
<<
li
->
second
.
blocked
<<
" --> val="
<<
li
->
second
.
value
<<
endl
;
<<
" --> val="
<<
li
->
second
.
value
<<
endl
;
...
@@ -584,7 +590,7 @@ void IOController::localSetValue( IOController::AIOStateList::iterator& li,
...
@@ -584,7 +590,7 @@ void IOController::localSetValue( IOController::AIOStateList::iterator& li,
// -------------
// -------------
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(localSetValue):
выход с именем "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" не найден"
;
err
<<
myname
<<
"(localSetValue):
Unknown sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
conf
->
oind
->
getNameById
(
si
.
id
)
;
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
...
@@ -774,7 +780,7 @@ void IOController::logging( UniSetTypes::SensorMessage& sm )
...
@@ -774,7 +780,7 @@ void IOController::logging( UniSetTypes::SensorMessage& sm )
{
{
if
(
isPingDBServer
)
if
(
isPingDBServer
)
{
{
unideb
[
Debug
::
CRIT
]
<<
myname
<<
"(logging): DBServer
недоступен
"
<<
endl
;
unideb
[
Debug
::
CRIT
]
<<
myname
<<
"(logging): DBServer
unavailable
"
<<
endl
;
isPingDBServer
=
false
;
isPingDBServer
=
false
;
}
}
}
}
...
@@ -926,8 +932,12 @@ IOController_i::DigitalIOInfo IOController::getDInfo(const IOController_i::Senso
...
@@ -926,8 +932,12 @@ IOController_i::DigitalIOInfo IOController::getDInfo(const IOController_i::Senso
// -------------
// -------------
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(getDInfo): дискретный вход(выход) с именем "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" не найден"
;
err
<<
myname
<<
"(getDInfo): Unknown digital sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
);
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
// --------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------
...
@@ -942,8 +952,12 @@ IOController_i::AnalogIOInfo IOController::getAInfo(const IOController_i::Sensor
...
@@ -942,8 +952,12 @@ IOController_i::AnalogIOInfo IOController::getAInfo(const IOController_i::Sensor
// -------------
// -------------
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(getAInfo): аналоговый вход(выход) с именем "
<<
conf
->
oind
->
getNameById
(
si
.
id
)
<<
" не найден"
;
err
<<
myname
<<
"(getAInfo): Unknown analog sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
);
if
(
unideb
.
debugging
(
Debug
::
INFO
)
)
unideb
[
Debug
::
INFO
]
<<
err
.
str
()
<<
endl
;
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
// --------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------
...
@@ -953,8 +967,8 @@ CORBA::Long IOController::getRawValue(const IOController_i::SensorInfo& si)
...
@@ -953,8 +967,8 @@ CORBA::Long IOController::getRawValue(const IOController_i::SensorInfo& si)
if
(
it
==
aioList
.
end
()
)
if
(
it
==
aioList
.
end
()
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(
calibrate): аналоговый вход(выход) с именем "
err
<<
myname
<<
"(
getRawValue): Unknown analog sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" не найден"
;
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
...
@@ -982,7 +996,8 @@ void IOController::calibrate(const IOController_i::SensorInfo& si,
...
@@ -982,7 +996,8 @@ void IOController::calibrate(const IOController_i::SensorInfo& si,
if
(
it
==
aioList
.
end
()
)
if
(
it
==
aioList
.
end
()
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(calibrate): аналоговый вход(выход) с именем "
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" не найден"
;
err
<<
myname
<<
"(calibrate): Unknown analog sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
...
@@ -998,8 +1013,8 @@ IOController_i::CalibrateInfo IOController::getCalibrateInfo(const IOController_
...
@@ -998,8 +1013,8 @@ IOController_i::CalibrateInfo IOController::getCalibrateInfo(const IOController_
if
(
it
==
aioList
.
end
()
)
if
(
it
==
aioList
.
end
()
)
{
{
ostringstream
err
;
ostringstream
err
;
err
<<
myname
<<
"(calibrate):
аналоговый вход(выход) с именем "
err
<<
myname
<<
"(calibrate):
Unknown analog sensor ("
<<
si
.
id
<<
":"
<<
si
.
node
<<
")"
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
)
<<
" не найден"
;
<<
conf
->
oind
->
getNameById
(
si
.
id
,
si
.
node
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
}
return
it
->
second
.
ci
;
return
it
->
second
.
ci
;
...
...
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