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
b9012840
Commit
b9012840
authored
Jan 30, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Перенёс оптимизацию для ObjectIndex_idXML.h из 2.0, очень уж актуально.
parent
d85c3ef9
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
35 additions
and
38 deletions
+35
-38
IOController_i.idl
IDL/Processes/IOController_i.idl
+3
-3
TODO
TODO
+1
-1
ctl-cpp-main.xsl
Utilities/codegen/ctl-cpp-main.xsl
+2
-2
libuniset.spec
conf/libuniset.spec
+1
-1
SMInterface.cc
extensions/lib/SMInterface.cc
+1
-1
IOController.h
include/IOController.h
+3
-3
IONotifyController.h
include/IONotifyController.h
+1
-1
ObjectIndex_idXML.h
include/ObjectIndex_idXML.h
+1
-1
UInterface.cc
src/Interfaces/UInterface.cc
+2
-2
ObjectIndex_idXML.cc
src/ObjectRepository/ObjectIndex_idXML.cc
+4
-7
IOController.cc
src/Processes/IOController.cc
+8
-8
IONotifyController.cc
src/Processes/IONotifyController.cc
+8
-8
No files found.
IDL/Processes/IOController_i.idl
View file @
b9012840
...
...
@@ -68,7 +68,7 @@ interface IOController_i : UniSetManager_i
//
установка
неопределённого
состояния
//
(
пока
работает
только
для
аналоговых
датчиков
)
void
setUndefinedState
(
in
UniSetTypes
::
ObjectId
sid
,
in
boolean
undefined
,
in
UniSetTypes
::
ObjectId
sup_id
)
void
setUndefinedState
(
in
UniSetTypes
::
ObjectId
sid
,
in
boolean
undefined
,
in
UniSetTypes
::
ObjectId
sup_id
)
raises
(
NameNotFound
)
;
//
fast
version
(
не
вырабатывает
исключения
)
...
...
@@ -101,8 +101,8 @@ interface IOController_i : UniSetManager_i
boolean
undefined
; /*!< признак неопределённости значения */
boolean
blocked
; /*!< данное значение блокировано другим */
long
real_value
; /*!< запомненное состояние, до блокировки */
UniversalIO
::
IOType
type
; /*!< тип */
long
priority
; /*!< приоритет уведомления */
UniversalIO
::
IOType
type
; /*!< тип */
long
priority
; /*!< приоритет уведомления */
IOController_i
::
SensorInfo
si
;
long
default_val
; /*!< значение по умолчанию */
CalibrateInfo
ci
; /*!< калибровочные параметры */
...
...
TODO
View file @
b9012840
...
...
@@ -32,4 +32,4 @@ Version 2.0
- отказаться от alias-ов.. (не прижилось, а накладные расходы большие)
- сделать ли ObjectId short? В связи с отказом от alias, нужна ли пара (id,node)
- "продумать" функцию key()... может наложить ограничение на диапазон id..
Utilities/codegen/ctl-cpp-main.xsl
View file @
b9012840
...
...
@@ -81,8 +81,8 @@ int main( int argc, const char** argv )
obj.mylog.logFile( logname.c_str() );
</xsl:if>
UniSetActivator* act = UniSetActivator::Instance();
UniSetActivator* act = UniSetActivator::Instance();
act-
>
addObject(static_cast
<
class UniSetObject*
>
(
&
obj));
SystemMessage sm(SystemMessage::StartUp);
...
...
conf/libuniset.spec
View file @
b9012840
...
...
@@ -334,7 +334,7 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%changelog
* Thu Jan 30 2014 Pavel Vainerman <pv@altlinux.ru> 2.0-alt0.3
- optimization: avoiding the use of 'alias mechanism'
- optimization: avoiding the use of 'alias mechanism'
('objectid@virtualnode:realnode' ==> 'objectid')
- add ObjectActivator::Instance function (singlton pattern)
- minor fixes
...
...
extensions/lib/SMInterface.cc
View file @
b9012840
...
...
@@ -173,7 +173,7 @@ IONotifyController_i::ThresholdsListSeq* SMInterface::getThresholdsList()
{
BEG_FUNC1
(
SMInterface
::
getThresholdsList
)
return
ic
->
getThresholdsList
();
END_FUNC
(
SMInterface
::
getThresholdsList
)
END_FUNC
(
SMInterface
::
getThresholdsList
)
}
BEG_FUNC
(
SMInterface
::
getThresholdsList
)
...
...
include/IOController.h
View file @
b9012840
...
...
@@ -59,7 +59,7 @@ class IOController:
UniSetTypes
::
ObjectId
sup_id
=
UniSetTypes
::
DefaultObjectId
);
// ----------------------------------------------------------------
virtual
void
setUndefinedState
(
UniSetTypes
::
ObjectId
sid
,
virtual
void
setUndefinedState
(
UniSetTypes
::
ObjectId
sid
,
CORBA
::
Boolean
undefined
,
UniSetTypes
::
ObjectId
sup_id
=
UniSetTypes
::
DefaultObjectId
);
...
...
@@ -74,13 +74,13 @@ class IOController:
virtual
IOController_i
::
SensorIOInfo
getSensorIOInfo
(
UniSetTypes
::
ObjectId
sid
);
virtual
CORBA
::
Long
getRawValue
(
UniSetTypes
::
ObjectId
sid
);
virtual
void
calibrate
(
UniSetTypes
::
ObjectId
sid
,
virtual
void
calibrate
(
UniSetTypes
::
ObjectId
sid
,
const
IOController_i
::
CalibrateInfo
&
ci
,
UniSetTypes
::
ObjectId
adminId
);
IOController_i
::
CalibrateInfo
getCalibrateInfo
(
UniSetTypes
::
ObjectId
sid
);
inline
IOController_i
::
SensorInfo
SensorInfo
(
const
UniSetTypes
::
ObjectId
sid
,
inline
IOController_i
::
SensorInfo
SensorInfo
(
const
UniSetTypes
::
ObjectId
sid
,
const
UniSetTypes
::
ObjectId
node
=
UniSetTypes
::
conf
->
getLocalNode
())
{
IOController_i
::
SensorInfo
si
;
...
...
include/IONotifyController.h
View file @
b9012840
...
...
@@ -139,7 +139,7 @@ class IONotifyController:
virtual
UniSetTypes
::
ObjectType
getType
(){
return
UniSetTypes
::
ObjectType
(
"IONotifyController"
);
}
virtual
void
askSensor
(
const
UniSetTypes
::
ObjectId
sid
,
const
UniSetTypes
::
ConsumerInfo
&
ci
,
UniversalIO
::
UIOCommand
cmd
);
virtual
void
askThreshold
(
const
UniSetTypes
::
ObjectId
sid
,
const
UniSetTypes
::
ConsumerInfo
&
ci
,
virtual
void
askThreshold
(
const
UniSetTypes
::
ObjectId
sid
,
const
UniSetTypes
::
ConsumerInfo
&
ci
,
UniSetTypes
::
ThresholdId
tid
,
CORBA
::
Long
lowLimit
,
CORBA
::
Long
hiLimit
,
CORBA
::
Boolean
invert
,
UniversalIO
::
UIOCommand
cmd
);
...
...
include/ObjectIndex_idXML.h
View file @
b9012840
...
...
@@ -28,7 +28,7 @@ class ObjectIndex_idXML:
virtual
void
build
(
UniXML
&
xml
);
void
read_section
(
UniXML
&
xml
,
const
std
::
string
&
sec
);
void
read_nodes
(
UniXML
&
xml
,
const
std
::
string
&
sec
);
private
:
typedef
std
::
map
<
UniSetTypes
::
ObjectId
,
UniSetTypes
::
ObjectInfo
>
MapObjects
;
MapObjects
omap
;
...
...
src/Interfaces/UInterface.cc
View file @
b9012840
...
...
@@ -115,7 +115,7 @@ void UInterface::initBackId( const UniSetTypes::ObjectId backid )
* \exception IOBadParam - генерируется если указано неправильное имя датчика или секции
* \exception IOTimeOut - генерируется если в течение времени timeout небыл получен ответ
*/
long
UInterface
::
getValue
(
const
ObjectId
id
,
const
ObjectId
node
)
const
long
UInterface
::
getValue
(
const
ObjectId
id
,
const
ObjectId
node
)
const
throw
(
IO_THROW_EXCEPTIONS
)
{
if
(
id
==
DefaultObjectId
)
...
...
@@ -1157,7 +1157,7 @@ string UInterface::set_err( const std::string& pre, const ObjectId id, const Obj
nm
=
"UnknownName"
;
ostringstream
s
;
s
<<
pre
<<
" ("
<<
id
<<
":"
<<
node
<<
")"
<<
nm
;
s
<<
pre
<<
" ("
<<
id
<<
":"
<<
node
<<
")"
<<
nm
;
return
s
.
str
();
}
// --------------------------------------------------------------------------------------------
...
...
src/ObjectRepository/ObjectIndex_idXML.cc
View file @
b9012840
...
...
@@ -225,13 +225,10 @@ const ObjectInfo* ObjectIndex_idXML::getObjectInfo( const ObjectId id )
// ------------------------------------------------------------------------------------------
const
ObjectInfo
*
ObjectIndex_idXML
::
getObjectInfo
(
const
std
::
string
&
name
)
{
const
char
*
n
=
name
.
c_str
();
for
(
MapObjects
::
iterator
it
=
omap
.
begin
();
it
!=
omap
.
end
();
++
it
)
{
if
(
!
strcmp
(
it
->
second
.
repName
,
n
)
)
return
&
(
it
->
second
);
}
MapObjectKey
::
iterator
it
=
mok
.
find
(
name
);
if
(
it
!=
mok
.
end
()
)
return
getObjectInfo
(
it
->
second
);
return
NULL
;
return
NULL
;
}
// ------------------------------------------------------------------------------------------
src/Processes/IOController.cc
View file @
b9012840
...
...
@@ -143,7 +143,7 @@ long IOController::localGetValue( IOController::IOStateList::iterator& li, const
// -------------
ostringstream
err
;
err
<<
myname
<<
"(localGetValue): Not found sensor ("
<<
sid
<<
") "
err
<<
myname
<<
"(localGetValue): Not found sensor ("
<<
sid
<<
") "
<<
conf
->
oind
->
getNameById
(
sid
);
uinfo
<<
err
.
str
()
<<
endl
;
...
...
@@ -240,7 +240,7 @@ void IOController::setValue( UniSetTypes::ObjectId sid, CORBA::Long value, UniSe
}
// ------------------------------------------------------------------------------------------
void
IOController
::
localSetValue
(
IOController
::
IOStateList
::
iterator
&
li
,
UniSetTypes
::
ObjectId
sid
,
UniSetTypes
::
ObjectId
sid
,
CORBA
::
Long
value
,
UniSetTypes
::
ObjectId
sup_id
)
{
if
(
sup_id
==
UniSetTypes
::
DefaultObjectId
)
...
...
@@ -350,7 +350,7 @@ void IOController::ioRegistration( const USensorInfo& ainf, bool force )
if
(
li
!=
ioList
.
end
()
)
{
ostringstream
err
;
err
<<
"Попытка повторной регистрации датчика("
<<
ainf
.
si
.
id
<<
"). имя: "
err
<<
"Попытка повторной регистрации датчика("
<<
ainf
.
si
.
id
<<
"). имя: "
<<
conf
->
oind
->
getNameById
(
ainf
.
si
.
id
);
throw
ObjectNameAlready
(
err
.
str
().
c_str
());
}
...
...
@@ -498,7 +498,7 @@ IOController_i::SensorIOInfo IOController::getSensorIOInfo( const UniSetTypes::O
// -------------
ostringstream
err
;
err
<<
myname
<<
"(getSensorIOInfo): Unknown sensor ("
<<
sid
<<
")"
err
<<
myname
<<
"(getSensorIOInfo): Unknown sensor ("
<<
sid
<<
")"
<<
conf
->
oind
->
getNameById
(
sid
);
uinfo
<<
err
.
str
()
<<
endl
;
...
...
@@ -512,7 +512,7 @@ CORBA::Long IOController::getRawValue( UniSetTypes::ObjectId sid )
if
(
it
==
ioList
.
end
()
)
{
ostringstream
err
;
err
<<
myname
<<
"(getRawValue): Unknown analog sensor ("
<<
sid
<<
")"
err
<<
myname
<<
"(getRawValue): Unknown analog sensor ("
<<
sid
<<
")"
<<
conf
->
oind
->
getNameById
(
sid
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
...
...
@@ -532,7 +532,7 @@ CORBA::Long IOController::getRawValue( UniSetTypes::ObjectId sid )
return
it
->
second
.
value
;
}
// --------------------------------------------------------------------------------------------------------------
void
IOController
::
calibrate
(
UniSetTypes
::
ObjectId
sid
,
void
IOController
::
calibrate
(
UniSetTypes
::
ObjectId
sid
,
const
IOController_i
::
CalibrateInfo
&
ci
,
UniSetTypes
::
ObjectId
adminId
)
{
...
...
@@ -540,7 +540,7 @@ void IOController::calibrate( UniSetTypes::ObjectId sid,
if
(
it
==
ioList
.
end
()
)
{
ostringstream
err
;
err
<<
myname
<<
"(calibrate): Unknown analog sensor ("
<<
sid
<<
")"
err
<<
myname
<<
"(calibrate): Unknown analog sensor ("
<<
sid
<<
")"
<<
conf
->
oind
->
getNameById
(
sid
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
...
...
@@ -556,7 +556,7 @@ IOController_i::CalibrateInfo IOController::getCalibrateInfo( UniSetTypes::Objec
if
(
it
==
ioList
.
end
()
)
{
ostringstream
err
;
err
<<
myname
<<
"(calibrate): Unknown analog sensor ("
<<
sid
<<
")"
err
<<
myname
<<
"(calibrate): Unknown analog sensor ("
<<
sid
<<
")"
<<
conf
->
oind
->
getNameById
(
sid
);
throw
IOController_i
::
NameNotFound
(
err
.
str
().
c_str
());
}
...
...
src/Processes/IONotifyController.cc
View file @
b9012840
...
...
@@ -171,7 +171,7 @@ void IONotifyController::askSensor(const UniSetTypes::ObjectId sid,
smsg
.
node
=
conf
->
getLocalNode
();
smsg
.
consumer
=
ci
.
id
;
smsg
.
supplier
=
getId
();
smsg
.
sensor_type
=
li
->
second
.
type
;
smsg
.
sensor_type
=
li
->
second
.
type
;
smsg
.
priority
=
(
Message
::
Priority
)
li
->
second
.
priority
;
smsg
.
sm_tv_sec
=
li
->
second
.
tv_sec
;
smsg
.
sm_tv_usec
=
li
->
second
.
tv_usec
;
...
...
@@ -195,7 +195,7 @@ void IONotifyController::askSensor(const UniSetTypes::ObjectId sid,
}
catch
(
CORBA
::
SystemException
&
ex
)
{
uwarn
<<
myname
<<
"(askSensor): "
<<
conf
->
oind
->
getNameById
(
ci
.
id
)
<<
"@"
<<
ci
.
node
uwarn
<<
myname
<<
"(askSensor): "
<<
conf
->
oind
->
getNameById
(
ci
.
id
)
<<
"@"
<<
ci
.
node
<<
" недоступен!!(CORBA::SystemException): "
<<
ex
.
NP_minorString
()
<<
endl
;
}
...
...
@@ -208,7 +208,7 @@ void IONotifyController::askSensor(const UniSetTypes::ObjectId sid,
}
// ------------------------------------------------------------------------------------------
void
IONotifyController
::
ask
(
AskMap
&
askLst
,
const
UniSetTypes
::
ObjectId
sid
,
void
IONotifyController
::
ask
(
AskMap
&
askLst
,
const
UniSetTypes
::
ObjectId
sid
,
const
UniSetTypes
::
ConsumerInfo
&
cons
,
UniversalIO
::
UIOCommand
cmd
)
{
// поиск датчика в списке
...
...
@@ -510,7 +510,7 @@ void IONotifyController::dumpThresholdList( const UniSetTypes::ObjectId sid, con
}
// --------------------------------------------------------------------------------------------------------------
void
IONotifyController
::
askThreshold
(
UniSetTypes
::
ObjectId
sid
,
const
UniSetTypes
::
ConsumerInfo
&
ci
,
void
IONotifyController
::
askThreshold
(
UniSetTypes
::
ObjectId
sid
,
const
UniSetTypes
::
ConsumerInfo
&
ci
,
UniSetTypes
::
ThresholdId
tid
,
CORBA
::
Long
lowLimit
,
CORBA
::
Long
hiLimit
,
CORBA
::
Boolean
invert
,
UniversalIO
::
UIOCommand
cmd
)
...
...
@@ -682,7 +682,7 @@ bool IONotifyController::addThreshold( ThresholdExtList& lst, ThresholdInfoExt&
// запоминаем начальное время
struct
timeval
tm
;
struct
timezone
tz
;
tm
.
tv_sec
=
0
;
tm
.
tv_sec
=
0
;
tm
.
tv_usec
=
0
;
gettimeofday
(
&
tm
,
&
tz
);
ti
.
tv_sec
=
tm
.
tv_sec
;
...
...
@@ -849,7 +849,7 @@ IONotifyController_i::ThresholdInfo IONotifyController::getThresholdInfo( UniSet
if
(
it
==
askTMap
.
end
()
)
{
ostringstream
err
;
err
<<
myname
<<
"(getThresholds): Not found sensor ("
<<
sid
<<
") "
err
<<
myname
<<
"(getThresholds): Not found sensor ("
<<
sid
<<
") "
<<
conf
->
oind
->
getNameById
(
sid
);
uinfo
<<
err
.
str
()
<<
endl
;
...
...
@@ -863,7 +863,7 @@ IONotifyController_i::ThresholdInfo IONotifyController::getThresholdInfo( UniSet
}
ostringstream
err
;
err
<<
myname
<<
"(getThresholds): Not found for sensor ("
<<
sid
<<
") "
err
<<
myname
<<
"(getThresholds): Not found for sensor ("
<<
sid
<<
") "
<<
conf
->
oind
->
getNameById
(
sid
)
<<
" ThresholdID='"
<<
tid
<<
"'"
;
uinfo
<<
err
.
str
()
<<
endl
;
...
...
@@ -878,7 +878,7 @@ IONotifyController_i::ThresholdList* IONotifyController::getThresholds( UniSetTy
if
(
it
==
askTMap
.
end
()
)
{
ostringstream
err
;
err
<<
myname
<<
"(getThresholds): Not found sensor ("
<<
sid
<<
") "
err
<<
myname
<<
"(getThresholds): Not found sensor ("
<<
sid
<<
") "
<<
conf
->
oind
->
getNameById
(
sid
);
uinfo
<<
err
.
str
()
<<
endl
;
...
...
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