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
2ed382d6
Commit
2ed382d6
authored
Jul 25, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Мелкие правки.
parent
808274cb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
24 deletions
+33
-24
abort-script-example.sh
extensions/tests/SMemoryTest/abort-script-example.sh
+2
-0
IOController.h
include/IOController.h
+12
-7
MessageType.h
include/MessageType.h
+8
-7
ObjectIndex_idXML.cc
src/ObjectRepository/ObjectIndex_idXML.cc
+1
-1
IONotifyController.cc
src/Processes/IONotifyController.cc
+5
-4
NCRestorer_XML.cc
src/Processes/NCRestorer_XML.cc
+2
-2
MessageType.cc
src/Various/MessageType.cc
+3
-3
No files found.
extensions/tests/SMemoryTest/abort-script-example.sh
View file @
2ed382d6
...
...
@@ -2,3 +2,5 @@
gdb
--batch
-n
-ex
"thread apply all bt"
$1
$2
# | ssh xxxxxx
# gcore $2
include/IOController.h
View file @
2ed382d6
...
...
@@ -345,18 +345,23 @@ class IOController:
inline
UniSetTypes
::
SensorMessage
makeSensorMessage
()
{
UniSetTypes
::
SensorMessage
sm
;
UniSetTypes
::
uniset_rwmutex_rlock
lock
(
val_lock
);
sm
.
id
=
si
.
id
;
sm
.
node
=
si
.
node
;
// uniset_conf()->getLocalNode()?
sm
.
sensor_type
=
type
;
sm
.
value
=
value
;
sm
.
undefined
=
undefined
;
sm
.
priority
=
(
UniSetTypes
::
Message
::
Priority
)
priority
;
sm
.
sm_tv_sec
=
tv_sec
;
sm
.
sm_tv_usec
=
tv_usec
;
sm
.
ci
=
ci
;
sm
.
supplier
=
supplier
;
// лочим только изменяемые поля
{
UniSetTypes
::
uniset_rwmutex_rlock
lock
(
val_lock
);
sm
.
value
=
value
;
sm
.
sm_tv_sec
=
tv_sec
;
sm
.
sm_tv_usec
=
tv_usec
;
sm
.
ci
=
ci
;
sm
.
supplier
=
supplier
;
sm
.
undefined
=
undefined
;
}
return
std
::
move
(
sm
);
}
};
...
...
include/MessageType.h
View file @
2ed382d6
...
...
@@ -137,8 +137,8 @@ namespace UniSetTypes
bool
threshold
;
/*!< TRUE - сработал порог, FALSE - порог отключился */
UniSetTypes
::
ThresholdId
tid
;
SensorMessage
(
SensorMessage
&&
)
=
default
;
SensorMessage
&
operator
=
(
SensorMessage
&&
)
=
default
;
SensorMessage
(
SensorMessage
&&
m
)
=
default
;
SensorMessage
&
operator
=
(
SensorMessage
&&
m
)
=
default
;
SensorMessage
(
const
SensorMessage
&
)
=
default
;
SensorMessage
&
operator
=
(
const
SensorMessage
&
)
=
default
;
...
...
@@ -164,15 +164,16 @@ namespace UniSetTypes
Unknown
,
StartUp
,
/*! начать работу */
FoldUp
,
/*! нет связи с главной станцией */
Finish
,
/*! завершить работу */
WatchDog
,
/*! контроль состояния */
Finish
,
/*! завершить работу */
WatchDog
,
/*! контроль состояния */
ReConfiguration
,
/*! обновились параметры конфигурации */
NetworkInfo
,
/*! обновилась информация о состоянии узлов в сети
поля
data[0] - кто
data[1] - новое состояние(true - connect, false - disconnect)
*/
LogRotate
/*! переоткрыть файлы логов */
LogRotate
,
/*! переоткрыть файлы логов */
TheLastFieldOfCommand
};
SystemMessage
(
SystemMessage
&&
)
=
default
;
...
...
@@ -229,7 +230,7 @@ namespace UniSetTypes
ConfirmMessage
(
const
VoidMessage
*
msg
);
ConfirmMessage
(
long
in_sensor_id
,
ConfirmMessage
(
ObjectId
in_sensor_id
,
double
in_value
,
time_t
in_time
,
time_t
in_time_usec
,
...
...
@@ -241,7 +242,7 @@ namespace UniSetTypes
ConfirmMessage
(
const
ConfirmMessage
&
)
=
default
;
ConfirmMessage
&
operator
=
(
const
ConfirmMessage
&
)
=
default
;
long
sensor_id
;
/* ID датчика */
ObjectId
sensor_id
;
/* ID датчика */
double
value
;
/* значение датчика */
time_t
time
;
/* время, когда датчик получил сигнал */
time_t
time_usec
;
/* время в микросекундах */
...
...
src/ObjectRepository/ObjectIndex_idXML.cc
View file @
2ed382d6
...
...
@@ -25,7 +25,7 @@ using namespace std;
// -----------------------------------------------------------------------------------------
ObjectIndex_idXML
::
ObjectIndex_idXML
(
const
string
&
xmlfile
)
{
shared_ptr
<
UniXML
>
xml
=
make_shared
<
UniXML
>
();
auto
xml
=
make_shared
<
UniXML
>
();
// try
// {
xml
->
open
(
xmlfile
);
...
...
src/Processes/IONotifyController.cc
View file @
2ed382d6
...
...
@@ -100,7 +100,7 @@ bool IONotifyController::addConsumer( ConsumerListInfo& lst, const ConsumerInfo&
}
catch
(...)
{}
lst
.
clst
.
push
_front
(
std
::
move
(
cinf
)
);
lst
.
clst
.
emplace
_front
(
std
::
move
(
cinf
)
);
return
true
;
}
// ------------------------------------------------------------------------------------------
...
...
@@ -444,8 +444,9 @@ void IONotifyController::dumpOrdersList( const UniSetTypes::ObjectId sid,
try
{
IOController_i
::
SensorIOInfo
ainf
(
getSensorIOInfo
(
sid
)
);
// делаем через tmp, т.к. у нас определён operator=
NCRestorer
::
SInfo
tmp
=
ainf
;
std
::
shared_ptr
<
NCRestorer
::
SInfo
>
sinf
=
make_shared
<
NCRestorer
::
SInfo
>
(
std
::
move
(
tmp
)
);
auto
sinf
=
make_shared
<
NCRestorer
::
SInfo
>
(
std
::
move
(
tmp
)
);
restorer
->
dump
(
this
,
sinf
,
lst
);
}
catch
(
const
Exception
&
ex
)
...
...
@@ -463,7 +464,7 @@ void IONotifyController::dumpThresholdList( const UniSetTypes::ObjectId sid, con
try
{
IOController_i
::
SensorIOInfo
ainf
(
getSensorIOInfo
(
sid
));
shared_ptr
<
NCRestorer
::
SInfo
>
sinf
=
make_shared
<
NCRestorer
::
SInfo
>
(
ainf
);
auto
sinf
=
make_shared
<
NCRestorer
::
SInfo
>
(
std
::
move
(
ainf
)
);
restorer
->
dumpThreshold
(
this
,
sinf
,
lst
);
}
catch
(
const
Exception
&
ex
)
...
...
@@ -646,7 +647,7 @@ bool IONotifyController::addThreshold( ThresholdExtList& lst, ThresholdInfoExt&&
ti
.
tv_sec
=
tm
.
tv_sec
;
ti
.
tv_usec
=
tm
.
tv_usec
;
lst
.
push
_back
(
std
::
move
(
ti
)
);
lst
.
emplace
_back
(
std
::
move
(
ti
)
);
return
true
;
}
// --------------------------------------------------------------------------------------------------------------
...
...
src/Processes/NCRestorer_XML.cc
View file @
2ed382d6
...
...
@@ -127,7 +127,7 @@ void NCRestorer_XML::read_list( const std::shared_ptr<UniXML>& xml, xmlNode* nod
if
(
!
check_list_item
(
it
)
)
continue
;
std
::
shared_ptr
<
NCRestorer_XML
::
SInfo
>
inf
=
make_shared
<
NCRestorer_XML
::
SInfo
>
();
auto
inf
=
make_shared
<
NCRestorer_XML
::
SInfo
>
();
if
(
!
getSensorInfo
(
xml
,
it
,
inf
)
)
{
...
...
@@ -140,7 +140,7 @@ void NCRestorer_XML::read_list( const std::shared_ptr<UniXML>& xml, xmlNode* nod
// т.к. в функции может обновится inf
// вызываем перед регистрацией
// (потому-что в xxRegistration inf будет скопирована
std
::
shared_ptr
<
IOController
::
USensorInfo
>
uinf
=
std
::
static_pointer_cast
<
IOController
::
USensorInfo
>
(
inf
);
auto
uinf
=
std
::
static_pointer_cast
<
IOController
::
USensorInfo
>
(
inf
);
ncrslot
(
xml
,
it
,
node
,
uinf
);
...
...
src/Various/MessageType.cc
View file @
2ed382d6
...
...
@@ -52,7 +52,7 @@ namespace UniSetTypes
//--------------------------------------------------------------------------------------------
Message
::
Message
()
:
type
(
Unused
),
priority
(
Medium
),
node
(
UniSetTypes
::
uniset_conf
()
->
getLocalNode
()
),
node
(
UniSetTypes
::
uniset_conf
()
?
UniSetTypes
::
uniset_conf
()
->
getLocalNode
()
:
DefaultObjectId
),
supplier
(
DefaultObjectId
),
consumer
(
DefaultObjectId
)
{
...
...
@@ -180,7 +180,7 @@ namespace UniSetTypes
if
(
c
==
SystemMessage
::
LogRotate
)
return
os
<<
"LogRotate"
;
return
os
<<
""
;
return
os
;
}
//--------------------------------------------------------------------------------------------
TimerMessage
::
TimerMessage
()
:
...
...
@@ -210,7 +210,7 @@ namespace UniSetTypes
assert
(
this
->
type
==
Message
::
Confirm
);
}
//--------------------------------------------------------------------------------------------
ConfirmMessage
::
ConfirmMessage
(
long
in_sensor_id
,
ConfirmMessage
::
ConfirmMessage
(
UniSetTypes
::
ObjectId
in_sensor_id
,
double
in_value
,
time_t
in_time
,
time_t
in_time_usec
,
...
...
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