Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
268c847c
Commit
268c847c
authored
Sep 15, 2020
by
Claes
Committed by
Esteban Blanc
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alias node works for sev, and 'localnode' can be used in SevHistThread.ServerNode
parent
cb1522c1
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
9 deletions
+60
-9
sev/exe/sev_server/src/sev_server.cpp
sev/exe/sev_server/src/sev_server.cpp
+16
-1
sev/lib/sev/src/sev_db.cpp
sev/lib/sev/src/sev_db.cpp
+3
-0
sev/lib/sev/src/sev_db.h
sev/lib/sev/src/sev_db.h
+3
-0
sev/lib/sev/src/sev_dbms.cpp
sev/lib/sev/src/sev_dbms.cpp
+7
-5
src/exe/rt_sevhistmon/src/rt_sevhistmon.cpp
src/exe/rt_sevhistmon/src/rt_sevhistmon.cpp
+17
-2
src/exp/inc/src/pwr_class.h
src/exp/inc/src/pwr_class.h
+1
-0
src/lib/rt/src/rt_ini_load.c
src/lib/rt/src/rt_ini_load.c
+1
-0
src/wbl/pwrb/src/pwrb_c_sevhistthread.wb_load
src/wbl/pwrb/src/pwrb_c_sevhistthread.wb_load
+2
-1
src/wbl/pwrs/src/pwrs_c_node.wb_load
src/wbl/pwrs/src/pwrs_c_node.wb_load
+10
-0
No files found.
sev/exe/sev_server/src/sev_server.cpp
View file @
268c847c
...
@@ -100,8 +100,10 @@ int sev_server::init(int noneth)
...
@@ -100,8 +100,10 @@ int sev_server::init(int noneth)
if
(
!
m_noneth
)
{
if
(
!
m_noneth
)
{
// Check server config object
// Check server config object
pwr_tOid
conf_oid
;
pwr_tOid
conf_oid
;
pwr_sNode
*
np
;
pwr_tOid
node_oid
;
sts
=
gdh_Init
(
"sev_server"
);
m_
sts
=
gdh_Init
(
"sev_server"
);
if
(
EVEN
(
m_sts
))
if
(
EVEN
(
m_sts
))
throw
co_error
(
m_sts
);
throw
co_error
(
m_sts
);
...
@@ -121,6 +123,19 @@ int sev_server::init(int noneth)
...
@@ -121,6 +123,19 @@ int sev_server::init(int noneth)
memset
(
m_config
->
ServerThreads
,
0
,
sizeof
(
m_config
->
ServerThreads
));
memset
(
m_config
->
ServerThreads
,
0
,
sizeof
(
m_config
->
ServerThreads
));
if
(
!
m_config
->
GarbageInterval
)
if
(
!
m_config
->
GarbageInterval
)
m_config
->
GarbageInterval
=
sev_cGarbageInterval
;
m_config
->
GarbageInterval
=
sev_cGarbageInterval
;
sts
=
gdh_GetNodeObject
(
0
,
&
node_oid
);
if
(
EVEN
(
sts
))
{
errh_CErrLog
(
PWR__SRVNOTCONF
,
0
);
exit
(
0
);
}
sts
=
gdh_ObjidToPointer
(
node_oid
,
(
void
**
)
&
np
);
if
(
EVEN
(
sts
))
{
errh_CErrLog
(
PWR__SRVNOTCONF
,
0
);
exit
(
0
);
}
sev_db
::
set_orignode
(
np
->
OrigName
);
}
else
{
}
else
{
// Read config from proview.cnf
// Read config from proview.cnf
static
pwr_sClass_SevServer
config
;
static
pwr_sClass_SevServer
config
;
...
...
sev/lib/sev/src/sev_db.cpp
View file @
268c847c
...
@@ -47,6 +47,8 @@
...
@@ -47,6 +47,8 @@
#include "sev_dbsqlite.h"
#include "sev_dbsqlite.h"
#include "sev_dbhdf5.h"
#include "sev_dbhdf5.h"
char
sev_db
::
m_orignode
[
80
]
=
""
;
sev_attr
::
sev_attr
()
:
type
(
pwr_eType_
),
size
(
0
),
elem
(
0
),
ip
(
0
),
refid
(
pwr_cNRefId
)
sev_attr
::
sev_attr
()
:
type
(
pwr_eType_
),
size
(
0
),
elem
(
0
),
ip
(
0
),
refid
(
pwr_cNRefId
)
{
{
strcpy
(
aname
,
""
);
strcpy
(
aname
,
""
);
...
@@ -105,6 +107,7 @@ sev_item::~sev_item()
...
@@ -105,6 +107,7 @@ sev_item::~sev_item()
sev_db
::
sev_db
()
:
m_meanvalue_interval1
(
0
),
m_meanvalue_interval2
(
0
)
sev_db
::
sev_db
()
:
m_meanvalue_interval1
(
0
),
m_meanvalue_interval2
(
0
)
{
{
strcpy
(
m_orignode
,
""
);
}
}
sev_db
::~
sev_db
()
sev_db
::~
sev_db
()
...
...
sev/lib/sev/src/sev_db.h
View file @
268c847c
...
@@ -166,6 +166,7 @@ public:
...
@@ -166,6 +166,7 @@ public:
float
m_meanvalue_interval1
;
float
m_meanvalue_interval1
;
float
m_meanvalue_interval2
;
float
m_meanvalue_interval2
;
sev_sDbConfig
m_cnf
;
sev_sDbConfig
m_cnf
;
static
char
m_orignode
[
80
];
sev_db
();
sev_db
();
virtual
~
sev_db
();
virtual
~
sev_db
();
...
@@ -174,6 +175,8 @@ public:
...
@@ -174,6 +175,8 @@ public:
pwr_tStatus
tree_update_value
(
int
item_idx
,
int
attr_idx
,
pwr_tTime
time
,
void
*
buf
);
pwr_tStatus
tree_update_value
(
int
item_idx
,
int
attr_idx
,
pwr_tTime
time
,
void
*
buf
);
void
get_item_idx
(
pwr_tStatus
*
sts
,
unsigned
int
*
item_idx
,
pwr_tOid
oid
,
void
get_item_idx
(
pwr_tStatus
*
sts
,
unsigned
int
*
item_idx
,
pwr_tOid
oid
,
char
*
attributename
);
char
*
attributename
);
static
void
set_orignode
(
char
*
node
)
{
strncpy
(
m_orignode
,
node
,
sizeof
(
m_orignode
));}
static
void
get_orignode
(
char
*
node
)
{
strcpy
(
node
,
m_orignode
);}
virtual
int
check_item
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
,
char
*
oname
,
virtual
int
check_item
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
,
char
*
oname
,
char
*
aname
,
pwr_tDeltaTime
storatetime
,
pwr_eType
type
,
char
*
aname
,
pwr_tDeltaTime
storatetime
,
pwr_eType
type
,
...
...
sev/lib/sev/src/sev_dbms.cpp
View file @
268c847c
...
@@ -846,7 +846,7 @@ int sev_dbms_env::get_systemname()
...
@@ -846,7 +846,7 @@ int sev_dbms_env::get_systemname()
{
{
FILE
*
file
;
FILE
*
file
;
pwr_tFileName
fname
;
pwr_tFileName
fname
;
char
nodename
[
4
0
];
char
nodename
[
8
0
];
char
*
bus_str
;
char
*
bus_str
;
int
bus
;
int
bus
;
char
line
[
200
];
char
line
[
200
];
...
@@ -855,10 +855,12 @@ int sev_dbms_env::get_systemname()
...
@@ -855,10 +855,12 @@ int sev_dbms_env::get_systemname()
if
(
!
streq
(
m_systemName
,
""
))
if
(
!
streq
(
m_systemName
,
""
))
return
1
;
return
1
;
sev_db
::
get_orignode
(
nodename
);
if
(
streq
(
nodename
,
""
))
{
syi_NodeName
(
&
sts
,
nodename
,
sizeof
(
nodename
));
syi_NodeName
(
&
sts
,
nodename
,
sizeof
(
nodename
));
if
(
EVEN
(
sts
))
if
(
EVEN
(
sts
))
return
0
;
return
0
;
}
bus_str
=
getenv
(
"PWR_BUS_ID"
);
bus_str
=
getenv
(
"PWR_BUS_ID"
);
if
(
!
bus_str
)
if
(
!
bus_str
)
return
0
;
return
0
;
...
...
src/exe/rt_sevhistmon/src/rt_sevhistmon.cpp
View file @
268c847c
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#include "co_error.h"
#include "co_error.h"
#include "co_string.h"
#include "co_string.h"
#include "co_time.h"
#include "co_time.h"
#include "co_syi.h"
#include "rt_gdh.h"
#include "rt_gdh.h"
#include "rt_qcom_msg.h"
#include "rt_qcom_msg.h"
...
@@ -56,6 +57,8 @@
...
@@ -56,6 +57,8 @@
#include "rt_sev_msg.h"
#include "rt_sev_msg.h"
#include "rt_pwr_msg.h"
#include "rt_pwr_msg.h"
static
int
plog
=
1
;
#define evbuf_next_idx(idx) \
#define evbuf_next_idx(idx) \
idx++; \
idx++; \
if (idx >= sizeof(event_buffer) / sizeof(event_buffer[0])) \
if (idx >= sizeof(event_buffer) / sizeof(event_buffer[0])) \
...
@@ -146,6 +149,8 @@ int rt_sevhistmon::init()
...
@@ -146,6 +149,8 @@ int rt_sevhistmon::init()
for
(
nid
=
qcom_cNNid
;
qcom_NextNode
(
&
sts
,
&
node
,
nid
);
nid
=
node
.
nid
)
{
for
(
nid
=
qcom_cNNid
;
qcom_NextNode
(
&
sts
,
&
node
,
nid
);
nid
=
node
.
nid
)
{
sev_node
n
;
sev_node
n
;
if
(
node
.
nid
==
m_nodes
[
0
].
nid
)
continue
;
n
.
nid
=
node
.
nid
;
n
.
nid
=
node
.
nid
;
strncpy
(
n
.
name
,
node
.
name
,
sizeof
(
n
.
name
));
strncpy
(
n
.
name
,
node
.
name
,
sizeof
(
n
.
name
));
...
@@ -191,6 +196,9 @@ int rt_sevhistmon::init_objects()
...
@@ -191,6 +196,9 @@ int rt_sevhistmon::init_objects()
hs
.
oid
=
hs_oid
;
hs
.
oid
=
hs_oid
;
hs
.
scantime
=
hs
.
threadp
->
ScanTime
;
hs
.
scantime
=
hs
.
threadp
->
ScanTime
;
strncpy
(
hs
.
nodename
,
hs
.
threadp
->
ServerNode
,
sizeof
(
hs
.
nodename
));
strncpy
(
hs
.
nodename
,
hs
.
threadp
->
ServerNode
,
sizeof
(
hs
.
nodename
));
if
(
strcmp
(
hs
.
nodename
,
"localhost"
)
==
0
)
syi_NodeName
(
&
m_sts
,
hs
.
nodename
,
sizeof
(
hs
.
nodename
));
hs
.
threadp
->
NoOfItems
=
0
;
hs
.
size
=
0
;
hs
.
size
=
0
;
bool
found
=
false
;
bool
found
=
false
;
...
@@ -1052,6 +1060,9 @@ bool rt_sevhistmon::send_connect(pwr_tNid nid, pwr_tStatus* sts)
...
@@ -1052,6 +1060,9 @@ bool rt_sevhistmon::send_connect(pwr_tNid nid, pwr_tStatus* sts)
qcom_sPut
put
;
qcom_sPut
put
;
pwr_tStatus
lsts
;
pwr_tStatus
lsts
;
if
(
plog
)
printf
(
"rt_sevhistmon: Send connect %d
\n
"
,
nid
);
tgt
.
nid
=
nid
;
tgt
.
nid
=
nid
;
tgt
.
qix
=
sev_eProcSevServer
;
tgt
.
qix
=
sev_eProcSevServer
;
...
@@ -1887,14 +1898,18 @@ int rt_sevhistmon::mainloop()
...
@@ -1887,14 +1898,18 @@ int rt_sevhistmon::mainloop()
case
sev_cMsgClass
:
case
sev_cMsgClass
:
switch
((
int
)
get
.
type
.
s
)
{
switch
((
int
)
get
.
type
.
s
)
{
case
sev_eMsgType_NodeUp
:
case
sev_eMsgType_NodeUp
:
if
(
plog
)
printf
(
"rt_sevhistmon: Node up received
\n
"
);
printf
(
"rt_sevhistmon: Node up received
\n
"
);
send_itemlist
(
get
.
sender
.
nid
);
send_itemlist
(
get
.
sender
.
nid
);
break
;
break
;
case
sev_eMsgType_ExportNodeUp
:
case
sev_eMsgType_ExportNodeUp
:
if
(
plog
)
printf
(
"rt_sevhistmon: Export node up received
\n
"
);
printf
(
"rt_sevhistmon: Export node up received
\n
"
);
send_exportitemlist
(
get
.
sender
.
nid
);
send_exportitemlist
(
get
.
sender
.
nid
);
break
;
break
;
case
sev_eMsgType_HistItemsRequest
:
case
sev_eMsgType_HistItemsRequest
:
if
(
plog
)
printf
(
"rt_sevhistmon: Export histitems request received
\n
"
);
send_itemlist
(
get
.
sender
.
nid
);
send_itemlist
(
get
.
sender
.
nid
);
break
;
break
;
case
sev_eMsgType_ExportItemsRequest
:
case
sev_eMsgType_ExportItemsRequest
:
...
...
src/exp/inc/src/pwr_class.h
View file @
268c847c
...
@@ -1066,6 +1066,7 @@ struct pwr_s_Node {
...
@@ -1066,6 +1066,7 @@ struct pwr_s_Node {
pwr_tBoolean
EmergBreakTrue
pwr_dAlignW
;
pwr_tBoolean
EmergBreakTrue
pwr_dAlignW
;
pwr_tUInt32
EmergBreakSelect
pwr_dAlignW
;
pwr_tUInt32
EmergBreakSelect
pwr_dAlignW
;
pwr_tRedundancyStateEnum
RedundancyState
pwr_dAlignW
;
pwr_tRedundancyStateEnum
RedundancyState
pwr_dAlignW
;
pwr_tString80
OrigName
pwr_dAlignW
;
};
};
#define pwr_mAppl_PLC 1
/* This is the PLC program */
#define pwr_mAppl_PLC 1
/* This is the PLC program */
...
...
src/lib/rt/src/rt_ini_load.c
View file @
268c847c
...
@@ -1501,6 +1501,7 @@ pwr_tBoolean ini_BuildNode(pwr_tStatus* status, ini_sContext* cp)
...
@@ -1501,6 +1501,7 @@ pwr_tBoolean ini_BuildNode(pwr_tStatus* status, ini_sContext* cp)
create_active_io
();
create_active_io
();
strncpy
(
cp
->
np
->
OrigName
,
cp
->
origname
,
sizeof
(
cp
->
np
->
OrigName
));
return
ODD
(
*
sts
);
return
ODD
(
*
sts
);
}
}
...
...
src/wbl/pwrb/src/pwrb_c_sevhistthread.wb_load
View file @
268c847c
...
@@ -51,7 +51,7 @@ SObject pwrb:Class
...
@@ -51,7 +51,7 @@ SObject pwrb:Class
! @b See also
! @b See also
! @classlink SevHist pwrb_sevhist.html
! @classlink SevHist pwrb_sevhist.html
! @classlink SevHistMonitor pwrb_sevhistmonitor.html
! @classlink SevHistMonitor pwrb_sevhistmonitor.html
! @classlink Sev
HistServer pwrb_sevhist
server.html
! @classlink Sev
Server pwrb_sev
server.html
!*/
!*/
Object SevHistThread $ClassDef 107
Object SevHistThread $ClassDef 107
Body SysBody
Body SysBody
...
@@ -73,6 +73,7 @@ SObject pwrb:Class
...
@@ -73,6 +73,7 @@ SObject pwrb:Class
!/**
!/**
! The name of the node where the data is stored.
! The name of the node where the data is stored.
! The SevHistServer has to be started on this node.
! The SevHistServer has to be started on this node.
! 'localnode' denotes the server on the local node.
!*/
!*/
Object ServerNode $Attribute 2
Object ServerNode $Attribute 2
Body SysBody
Body SysBody
...
...
src/wbl/pwrs/src/pwrs_c_node.wb_load
View file @
268c847c
...
@@ -296,6 +296,16 @@ SObject pwrs:Class
...
@@ -296,6 +296,16 @@ SObject pwrs:Class
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndBody
EndObject
EndObject
!/**
! Original node name if alias name is used.
!*/
Object OrigName $Attribute 27
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
EndObject
Object Template $Node
Object Template $Node
Body SysBody
Body SysBody
...
...
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