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
73965f0f
Commit
73965f0f
authored
Aug 01, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add history logging in SharedMemory
parent
66eb4a98
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
317 additions
and
22 deletions
+317
-22
admin.sh
Utilities/Admin/admin.sh
+1
-2
create_links.sh
Utilities/Admin/create_links.sh
+3
-5
test.xml
conf/test.xml
+18
-1
create_links.sh
extensions/IOControl/create_links.sh
+4
-1
create_links.sh
extensions/LogicProcessor/create_links.sh
+4
-1
create_links.sh
extensions/MBTCPMaster/create_links.sh
+4
-1
create_links.sh
extensions/ModbusSlave/create_links.sh
+4
-1
create_links.sh
extensions/RTUExchange/create_links.sh
+3
-1
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+169
-2
SharedMemory.h
extensions/SharedMemory/SharedMemory.h
+59
-3
create_links.sh
extensions/SharedMemory/create_links.sh
+3
-1
start_fg.sh
extensions/SharedMemory/start_fg.sh
+5
-2
create_links.sh
extensions/UDPExchange/create_links.sh
+4
-1
IONotifyController.h
include/IONotifyController.h
+6
-0
IONotifyController.cc
src/Processes/IONotifyController.cc
+24
-0
NCRestorer.cc
src/Various/NCRestorer.cc
+6
-0
No files found.
Utilities/Admin/admin.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
START
=
uniset-start.sh
./uniset-start.sh
-f
"./uniset-admin --confile test.xml --
`
basename
$0
.sh
`
$1
$2
$3
$4
"
${
START
}
-f
"./uniset-admin --confile test.xml --
`
basename
$0
.sh
`
$1
$2
$3
$4
"
Utilities/Admin/create_links.sh
View file @
73965f0f
...
@@ -8,10 +8,6 @@ ln -s -f admin.sh foldUp
...
@@ -8,10 +8,6 @@ ln -s -f admin.sh foldUp
ln
-s
-f
admin.sh info
ln
-s
-f
admin.sh info
ln
-s
-f
admin.sh alarm
ln
-s
-f
admin.sh alarm
ln
-s
-f
admin.sh create
ln
-s
-f
admin.sh create
#ln -s -f admin.sh setState
#ln -s -f admin.sh dbcreate
#ln -s -f admin.sh statistic
#ln -s -f admin.sh database
ln
-s
-f
admin.sh logrotate
ln
-s
-f
admin.sh logrotate
ln
-s
-f
admin.sh omap
ln
-s
-f
admin.sh omap
ln
-s
-f
admin.sh msgmap
ln
-s
-f
admin.sh msgmap
...
@@ -28,5 +24,7 @@ ln -s -f admin.sh getCalibrate
...
@@ -28,5 +24,7 @@ ln -s -f admin.sh getCalibrate
ln
-s
-f
admin.sh
help
ln
-s
-f
admin.sh
help
ln
-s
-f
admin.sh oinfo
ln
-s
-f
admin.sh oinfo
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
conf/test.xml
View file @
73965f0f
...
@@ -44,7 +44,12 @@
...
@@ -44,7 +44,12 @@
<dlog
name=
"dlog"
levels=
""
file=
""
/>
<dlog
name=
"dlog"
levels=
""
file=
""
/>
<SharedMemory
name=
"SharedMemory"
shmID=
"SharedMemory"
/>
<SharedMemory
name=
"SharedMemory"
shmID=
"SharedMemory"
>
<History
savetime=
"200"
>
<item
id=
"1"
fuse=
"AlarmFuse1_S"
size=
"30"
filter=
"a1"
/>
<item
id=
"2"
fuse=
"AlarmFuse2_S"
size=
"30"
filter=
"a2"
/>
</History>
</SharedMemory>
<MBMaster1
name=
"MBMaster1"
iaddr=
"127.0.0.1"
addr=
"0x31"
port=
"30000"
<MBMaster1
name=
"MBMaster1"
iaddr=
"127.0.0.1"
addr=
"0x31"
port=
"30000"
levels=
"info,warn,crit"
poll_time=
"200"
reply_timeout=
"60"
levels=
"info,warn,crit"
poll_time=
"200"
reply_timeout=
"60"
...
@@ -123,6 +128,18 @@
...
@@ -123,6 +128,18 @@
<item
name=
"RespondRTU_S"
textname=
"respond rtu"
node=
""
iotype=
"DI"
/>
<item
name=
"RespondRTU_S"
textname=
"respond rtu"
node=
""
iotype=
"DI"
/>
<item
name=
"NoRespondRTU2_S"
textname=
"no respond rtu"
node=
""
iotype=
"DI"
/>
<item
name=
"NoRespondRTU2_S"
textname=
"no respond rtu"
node=
""
iotype=
"DI"
/>
<item
name=
"AlarmFuse1_S"
textname=
"alarm fuse sensor 1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"AlarmFuse2_S"
textname=
"alarm fuse sensor 2"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor1_S"
textname=
"alarm dumpm sensor 1"
a1=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor2_S"
textname=
"alarm dumpm sensor 2"
a1=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor3_S"
textname=
"alarm dumpm sensor 3"
a1=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor4_S"
textname=
"alarm dumpm sensor 4"
a1=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor5_S"
textname=
"alarm dumpm sensor 5"
a2=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor6_S"
textname=
"alarm dumpm sensor 6"
a2=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor7_S"
textname=
"alarm dumpm sensor 7"
a2=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
<item
name=
"DumpSensor8_S"
textname=
"alarm dumpm sensor 8"
a2=
"1"
node=
""
iotype=
"DI"
priority=
"Medium"
/>
</sensors>
</sensors>
<thresholds
name=
"thresholds"
>
<thresholds
name=
"thresholds"
>
...
...
extensions/IOControl/create_links.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
extensions/LogicProcessor/create_links.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
extensions/MBTCPMaster/create_links.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
extensions/ModbusSlave/create_links.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
extensions/RTUExchange/create_links.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
extensions/SharedMemory/SharedMemory.cc
View file @
73965f0f
...
@@ -12,6 +12,7 @@ using namespace UniSetExtensions;
...
@@ -12,6 +12,7 @@ using namespace UniSetExtensions;
SharedMemory
::
SharedMemory
(
ObjectId
id
,
string
datafile
)
:
SharedMemory
::
SharedMemory
(
ObjectId
id
,
string
datafile
)
:
IONotifyController_LT
(
id
),
IONotifyController_LT
(
id
),
heartbeatCheckTime
(
5000
),
heartbeatCheckTime
(
5000
),
histSaveTime
(
200
),
wdt
(
0
),
wdt
(
0
),
activated
(
false
),
activated
(
false
),
workready
(
false
),
workready
(
false
),
...
@@ -26,9 +27,11 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
...
@@ -26,9 +27,11 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
UniXML_iterator
it
(
cnode
);
UniXML_iterator
it
(
cnode
);
// ----------------------
// ----------------------
buildHistoryList
(
cnode
);
signal_change_state
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
SharedMemory
::
updateHistory
));
// ----------------------
restorer
=
NULL
;
restorer
=
NULL
;
NCRestorer_XML
*
rxml
=
new
NCRestorer_XML
(
datafile
);
NCRestorer_XML
*
rxml
=
new
NCRestorer_XML
(
datafile
);
// rxml = new NCRestorer_XML1(datafile);
string
s_field
=
conf
->
getArgParam
(
"--s-filter-field"
);
string
s_field
=
conf
->
getArgParam
(
"--s-filter-field"
);
string
s_fvalue
=
conf
->
getArgParam
(
"--s-filter-value"
);
string
s_fvalue
=
conf
->
getArgParam
(
"--s-filter-value"
);
...
@@ -158,6 +161,8 @@ void SharedMemory::timerInfo( TimerMessage *tm )
...
@@ -158,6 +161,8 @@ void SharedMemory::timerInfo( TimerMessage *tm )
sendEvent
(
sm1
);
sendEvent
(
sm1
);
askTimer
(
tm
->
id
,
0
);
askTimer
(
tm
->
id
,
0
);
}
}
else
if
(
tm
->
id
==
tmHistory
)
saveHistory
();
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
...
@@ -185,6 +190,7 @@ void SharedMemory::sysCommand( SystemMessage *sm )
...
@@ -185,6 +190,7 @@ void SharedMemory::sysCommand( SystemMessage *sm )
UniSetTypes
::
uniset_mutex_lock
l
(
mutex_start
,
10000
);
UniSetTypes
::
uniset_mutex_lock
l
(
mutex_start
,
10000
);
askTimer
(
tmHeartBeatCheck
,
heartbeatCheckTime
);
askTimer
(
tmHeartBeatCheck
,
heartbeatCheckTime
);
askTimer
(
tmEvent
,
evntPause
,
1
);
askTimer
(
tmEvent
,
evntPause
,
1
);
askTimer
(
tmHistory
,
histSaveTime
);
}
}
break
;
break
;
...
@@ -207,14 +213,21 @@ void SharedMemory::sysCommand( SystemMessage *sm )
...
@@ -207,14 +213,21 @@ void SharedMemory::sysCommand( SystemMessage *sm )
void
SharedMemory
::
askSensors
(
UniversalIO
::
UIOCommand
cmd
)
void
SharedMemory
::
askSensors
(
UniversalIO
::
UIOCommand
cmd
)
{
{
/*
for( History::iterator it=hist.begin(); it!=hist.end(); ++it )
{
if( sm->id == it->idFuse )
{
try
try
{
{
//
ui.askState( SID, cmd);
ui.askState( SID, cmd);
}
}
catch(Exception& ex)
catch(Exception& ex)
{
{
dlog[Debug::CRIT] << myname << "(askSensors): " << ex << endl;
dlog[Debug::CRIT] << myname << "(askSensors): " << ex << endl;
}
}
}
*/
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
...
@@ -237,6 +250,15 @@ bool SharedMemory::activateObject()
...
@@ -237,6 +250,15 @@ bool SharedMemory::activateObject()
it
->
dit
=
mydioEnd
();
it
->
dit
=
mydioEnd
();
}
}
for
(
History
::
iterator
it
=
hist
.
begin
();
it
!=
hist
.
end
();
++
it
)
{
for
(
HistoryList
::
iterator
hit
=
it
->
hlst
.
begin
();
hit
!=
it
->
hlst
.
end
();
++
hit
)
{
hit
->
ait
=
myaioEnd
();
hit
->
dit
=
mydioEnd
();
}
}
activated
=
true
;
activated
=
true
;
}
}
cerr
<<
"************************** activate: "
<<
pt
.
getCurrent
()
<<
" msec "
<<
endl
;
cerr
<<
"************************** activate: "
<<
pt
.
getCurrent
()
<<
" msec "
<<
endl
;
...
@@ -322,6 +344,9 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
...
@@ -322,6 +344,9 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
catch
(...){}
catch
(...){}
}
}
// check history filters
checkHistoryFilter
(
it
);
if
(
heartbeat_node
.
empty
()
||
it
.
getProp
(
"heartbeat"
).
empty
())
if
(
heartbeat_node
.
empty
()
||
it
.
getProp
(
"heartbeat"
).
empty
())
return
true
;
return
true
;
...
@@ -523,3 +548,145 @@ void SharedMemory::loggingInfo( SensorMessage& sm )
...
@@ -523,3 +548,145 @@ void SharedMemory::loggingInfo( SensorMessage& sm )
IONotifyController_LT
::
loggingInfo
(
sm
);
IONotifyController_LT
::
loggingInfo
(
sm
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
SharedMemory
::
buildHistoryList
(
xmlNode
*
cnode
)
{
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(buildHistoryList): ..."
<<
endl
;
xmlNode
*
n
=
conf
->
findNode
(
cnode
,
"History"
);
if
(
!
n
)
{
dlog
[
Debug
::
WARN
]
<<
myname
<<
"(buildHistoryList): <History> not found "
<<
endl
;
return
;
}
UniXML_iterator
it
(
n
);
histSaveTime
=
uni_atoi
(
it
.
getProp
(
"savetime"
).
c_str
());
if
(
histSaveTime
<
0
)
histSaveTime
=
200
;
if
(
!
it
.
goChildren
()
)
{
dlog
[
Debug
::
WARN
]
<<
myname
<<
"(buildHistoryList): <History> empty..."
<<
endl
;
return
;
}
for
(
;
it
.
getCurrent
();
it
.
goNext
()
)
{
HistoryInfo
hi
;
hi
.
id
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"id"
).
c_str
()
);
hi
.
size
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"size"
).
c_str
()
);
if
(
hi
.
size
<=
0
)
continue
;
hi
.
filter
=
it
.
getProp
(
"filter"
);
if
(
hi
.
filter
.
empty
()
)
continue
;
hi
.
idFuse
=
conf
->
getSensorID
(
it
.
getProp
(
"fuse"
));
if
(
hi
.
idFuse
==
DefaultObjectId
)
{
dlog
[
Debug
::
WARN
]
<<
myname
<<
"(buildHistory): not found sensor ID for "
<<
it
.
getProp
(
"idFuse"
)
<<
" history item id="
<<
it
.
getProp
(
"id"
)
<<
endl
;
continue
;
}
hi
.
invert
=
uni_atoi
(
it
.
getProp
(
"invert"
).
c_str
());
// WARNING: no check duplicates...
hist
.
push_back
(
hi
);
}
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(buildHistoryList): histoty size="
<<
hist
.
size
()
<<
endl
;
}
// -----------------------------------------------------------------------------
void
SharedMemory
::
checkHistoryFilter
(
UniXML_iterator
&
xit
)
{
for
(
History
::
iterator
it
=
hist
.
begin
();
it
!=
hist
.
end
();
++
it
)
{
if
(
xit
.
getProp
(
it
->
filter
).
empty
()
)
continue
;
HistoryItem
ai
;
if
(
!
xit
.
getProp
(
"id"
).
empty
()
)
{
ai
.
id
=
uni_atoi
(
xit
.
getProp
(
"id"
).
c_str
());
it
->
hlst
.
push_back
(
ai
);
continue
;
}
ai
.
id
=
conf
->
getSensorID
(
xit
.
getProp
(
"name"
));
if
(
ai
.
id
==
DefaultObjectId
)
{
dlog
[
Debug
::
WARN
]
<<
myname
<<
"(checkHistoryFilter): not found sensor ID for "
<<
xit
.
getProp
(
"name"
)
<<
endl
;
continue
;
}
it
->
hlst
.
push_back
(
ai
);
}
}
// -----------------------------------------------------------------------------
SharedMemory
::
HistorySlot
SharedMemory
::
signal_history
()
{
return
m_historySignal
;
}
// -----------------------------------------------------------------------------
void
SharedMemory
::
saveHistory
()
{
// if( dlog.debugging(Debug::INFO) )
// dlog[Debug::INFO] << myname << "(saveHistory): ..." << endl;
for
(
History
::
iterator
it
=
hist
.
begin
();
it
!=
hist
.
end
();
++
it
)
{
for
(
HistoryList
::
iterator
hit
=
it
->
hlst
.
begin
();
hit
!=
it
->
hlst
.
end
();
++
hit
)
{
long
val
=
0
;
if
(
hit
->
ait
!=
myaioEnd
()
)
val
=
localGetValue
(
hit
->
ait
,
hit
->
ait
->
second
.
si
);
else
if
(
hit
->
dit
!=
mydioEnd
()
)
val
=
localGetState
(
hit
->
dit
,
hit
->
dit
->
second
.
si
);
else
continue
;
hit
->
add
(
val
,
it
->
size
);
}
}
}
// -----------------------------------------------------------------------------
void
SharedMemory
::
updateHistory
(
UniSetTypes
::
SensorMessage
*
sm
)
{
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
{
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(updateHistory): "
<<
" sid="
<<
sm
->
id
<<
" state="
<<
sm
->
state
<<
" value="
<<
sm
->
value
<<
endl
;
}
for
(
History
::
iterator
it
=
hist
.
begin
();
it
!=
hist
.
end
();
++
it
)
{
if
(
sm
->
id
==
it
->
idFuse
)
{
bool
st
=
it
->
invert
?
!
sm
->
state
:
sm
->
state
;
if
(
st
)
{
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(updateHistory): HISTORY EVENT for "
<<
(
*
it
)
<<
endl
;
m_historySignal
.
emit
(
&
(
*
it
)
);
}
}
}
}
// -----------------------------------------------------------------------------
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
SharedMemory
::
HistoryInfo
&
h
)
{
os
<<
"id="
<<
h
.
id
<<
" idFuse="
<<
h
.
idFuse
;
return
os
;
}
// ------------------------------------------------------------------------------------------
extensions/SharedMemory/SharedMemory.h
View file @
73965f0f
...
@@ -13,9 +13,11 @@
...
@@ -13,9 +13,11 @@
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
/*!
/*!
,
:
( ),
-
- ( ),
"" .
"" .
-
*/
*/
class
SharedMemory
:
class
SharedMemory
:
public
IONotifyController_LT
public
IONotifyController_LT
...
@@ -46,6 +48,51 @@ class SharedMemory:
...
@@ -46,6 +48,51 @@ class SharedMemory:
void
addReadItem
(
Restorer_XML
::
ReaderSlot
sl
);
void
addReadItem
(
Restorer_XML
::
ReaderSlot
sl
);
// ------------ HISTORY --------------------
typedef
std
::
list
<
long
>
HBuffer
;
struct
HistoryItem
{
HistoryItem
()
:
id
(
UniSetTypes
::
DefaultObjectId
){}
UniSetTypes
::
ObjectId
id
;
HBuffer
buf
;
AIOStateList
::
iterator
ait
;
DIOStateList
::
iterator
dit
;
void
add
(
long
val
,
int
size
)
{
buf
.
push_back
(
val
);
if
(
buf
.
size
()
>=
size
)
buf
.
erase
(
buf
.
begin
());
}
};
typedef
std
::
list
<
HistoryItem
>
HistoryList
;
struct
HistoryInfo
{
HistoryInfo
()
:
id
(
0
),
idFuse
(
UniSetTypes
::
DefaultObjectId
),
size
(
0
),
filter
(
""
),
invert
(
false
){}
long
id
;
// ID
UniSetTypes
::
ObjectId
idFuse
;
// fuse sesnsor
HistoryList
hlst
;
// history list
int
size
;
std
::
string
filter
;
// filter field
bool
invert
;
};
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
HistoryInfo
&
h
);
typedef
std
::
list
<
HistoryInfo
>
History
;
typedef
sigc
::
signal
<
void
,
HistoryInfo
*>
HistorySlot
;
HistorySlot
signal_history
();
protected
:
protected
:
typedef
std
::
list
<
Restorer_XML
::
ReaderSlot
>
ReadSlotList
;
typedef
std
::
list
<
Restorer_XML
::
ReaderSlot
>
ReadSlotList
;
ReadSlotList
lstRSlot
;
ReadSlotList
lstRSlot
;
...
@@ -97,11 +144,13 @@ class SharedMemory:
...
@@ -97,11 +144,13 @@ class SharedMemory:
enum
Timers
enum
Timers
{
{
tmHeartBeatCheck
,
tmHeartBeatCheck
,
tmEvent
tmEvent
,
tmHistory
};
};
int
heartbeatCheckTime
;
int
heartbeatCheckTime
;
std
::
string
heartbeat_node
;
std
::
string
heartbeat_node
;
int
histSaveTime
;
void
checkHeartBeat
();
void
checkHeartBeat
();
...
@@ -126,6 +175,13 @@ class SharedMemory:
...
@@ -126,6 +175,13 @@ class SharedMemory:
private
:
private
:
HistorySlot
m_historySignal
;
History
hist
;
void
buildHistoryList
(
xmlNode
*
cnode
);
void
checkHistoryFilter
(
UniXML_iterator
&
it
);
void
saveHistory
();
void
updateHistory
(
UniSetTypes
::
SensorMessage
*
sm
);
};
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#endif // SharedMemory_H_
#endif // SharedMemory_H_
...
...
extensions/SharedMemory/create_links.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
extensions/SharedMemory/start_fg.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
export
LD_LIBRARY_PATH
=
"../../lib/.libs;../lib/.libs"
ulimit
-Sc
1000000000000
ulimit
-Sc
1000000000000
uniset-start.sh
-f
./uniset-smemory
--smemory-id
SharedMemory1
\
./uniset-start.sh
-f
./uniset-smemory
--smemory-id
SharedMemory
\
--confile
test.xml
--datfile
test.xml
\
--confile
test.xml
--datfile
test.xml
\
--unideb-add-levels
info,crit,warn,level9,system
--unideb-add-levels
info,crit,warn,level9,system
\
--dlog-add-levels
info,crit,warn
extensions/UDPExchange/create_links.sh
View file @
73965f0f
#!/bin/sh
#!/bin/sh
ln
-s
-f
/usr/bin/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-start.sh
ln
-s
-f
../../Utilities/scripts/uniset-stop.sh stop.sh
ln
-s
-f
../../Utilities/scripts/uniset-functions.sh
ln
-s
-f
../../conf/test.xml test.xml
ln
-s
-f
../../conf/test.xml test.xml
include/IONotifyController.h
View file @
73965f0f
...
@@ -69,6 +69,10 @@ class IONotifyController:
...
@@ -69,6 +69,10 @@ class IONotifyController:
const
UniSetTypes
::
ConsumerInfo
&
ci
,
UniversalIO
::
UIOCommand
cmd
);
const
UniSetTypes
::
ConsumerInfo
&
ci
,
UniversalIO
::
UIOCommand
cmd
);
// -----------------------------------------------
typedef
sigc
::
signal
<
void
,
UniSetTypes
::
SensorMessage
*>
ChangeSignal
;
ChangeSignal
signal_change_state
(){
return
changeSignal
;
}
// -------------------- !!!!!!!!! ---------------------------------
// -------------------- !!!!!!!!! ---------------------------------
virtual
IONotifyController_i
::
ThresholdsListSeq
*
getThresholdsList
();
virtual
IONotifyController_i
::
ThresholdsListSeq
*
getThresholdsList
();
...
@@ -209,6 +213,8 @@ class IONotifyController:
...
@@ -209,6 +213,8 @@ class IONotifyController:
void
onChangeUndefined
(
DependsList
::
iterator
it
,
bool
undefined
);
void
onChangeUndefined
(
DependsList
::
iterator
it
,
bool
undefined
);
ChangeSignal
changeSignal
;
private
:
private
:
friend
class
NCRestorer
;
friend
class
NCRestorer
;
...
...
src/Processes/IONotifyController.cc
View file @
73965f0f
...
@@ -487,6 +487,12 @@ void IONotifyController::localSaveState( IOController::DIOStateList::iterator& i
...
@@ -487,6 +487,12 @@ void IONotifyController::localSaveState( IOController::DIOStateList::iterator& i
try
try
{
{
changeSignal
.
emit
(
&
sm
);
}
catch
(...){}
try
{
loggingInfo
(
sm
);
loggingInfo
(
sm
);
}
}
catch
(...){}
catch
(...){}
...
@@ -544,6 +550,12 @@ void IONotifyController::localSaveValue( IOController::AIOStateList::iterator& l
...
@@ -544,6 +550,12 @@ void IONotifyController::localSaveValue( IOController::AIOStateList::iterator& l
try
try
{
{
changeSignal
.
emit
(
&
sm
);
}
catch
(...){}
try
{
loggingInfo
(
sm
);
loggingInfo
(
sm
);
}
}
catch
(...){}
catch
(...){}
...
@@ -1175,6 +1187,12 @@ void IONotifyController::localSetState( IOController::DIOStateList::iterator& it
...
@@ -1175,6 +1187,12 @@ void IONotifyController::localSetState( IOController::DIOStateList::iterator& it
try
try
{
{
changeSignal
.
emit
(
&
sm
);
}
catch
(...){}
try
{
loggingInfo
(
sm
);
loggingInfo
(
sm
);
}
}
catch
(...){}
catch
(...){}
...
@@ -1225,6 +1243,12 @@ void IONotifyController::localSetValue( IOController::AIOStateList::iterator& li
...
@@ -1225,6 +1243,12 @@ void IONotifyController::localSetValue( IOController::AIOStateList::iterator& li
try
try
{
{
changeSignal
.
emit
(
&
sm
);
}
catch
(...){}
try
{
loggingInfo
(
sm
);
loggingInfo
(
sm
);
}
}
catch
(...){}
catch
(...){}
...
...
src/Various/NCRestorer.cc
View file @
73965f0f
...
@@ -128,6 +128,9 @@ void NCRestorer::addthresholdlist( IONotifyController* ic, SInfo& inf, IONotifyC
...
@@ -128,6 +128,9 @@ void NCRestorer::addthresholdlist( IONotifyController* ic, SInfo& inf, IONotifyC
case
UniversalIO
:
:
AnalogOutput
:
case
UniversalIO
:
:
AnalogOutput
:
ic
->
asRegistration
(
inf
);
ic
->
asRegistration
(
inf
);
break
;
break
;
default
:
break
;
}
}
}
}
}
}
...
@@ -157,6 +160,9 @@ void NCRestorer::addthresholdlist( IONotifyController* ic, SInfo& inf, IONotifyC
...
@@ -157,6 +160,9 @@ void NCRestorer::addthresholdlist( IONotifyController* ic, SInfo& inf, IONotifyC
ic
->
checkThreshold
(
it
,
inf
.
si
,
false
);
ic
->
checkThreshold
(
it
,
inf
.
si
,
false
);
}
}
break
;
break
;
default
:
break
;
}
}
}
}
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