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
0e200950
Commit
0e200950
authored
Sep 16, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SystemStatus attribut in NodeLinkSup objects
parent
10e50f23
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
src/exe/rt_linksup/src/rt_linksup.c
src/exe/rt_linksup/src/rt_linksup.c
+9
-2
src/wbl/pwrb/src/pwrb_c_nodelinksup.wb_load
src/wbl/pwrb/src/pwrb_c_nodelinksup.wb_load
+12
-0
No files found.
src/exe/rt_linksup/src/rt_linksup.c
View file @
0e200950
...
@@ -73,6 +73,7 @@ struct s_Node {
...
@@ -73,6 +73,7 @@ struct s_Node {
gdh_tDlid
dlid
;
gdh_tDlid
dlid
;
pwr_tBoolean
found
;
pwr_tBoolean
found
;
plc_sTimer
*
timer
;
plc_sTimer
*
timer
;
pwr_tStatus
*
subvalue
;
};
};
static
eListState
list_state
=
eListState_Init
;
static
eListState
list_state
=
eListState_Init
;
...
@@ -309,10 +310,14 @@ init_node (
...
@@ -309,10 +310,14 @@ init_node (
tid
.
c
.
bix
=
1
;
tid
.
c
.
bix
=
1
;
aref
.
Objid
=
o
->
Node
;
aref
.
Objid
=
o
->
Node
;
sts
=
gdh_ClassAttrToAttrref
(
pwr_eClass_Node
,
".
CurrentVersion
"
,
&
aref
);
sts
=
gdh_ClassAttrToAttrref
(
pwr_eClass_Node
,
".
SystemStatus
"
,
&
aref
);
sts
=
gdh_SubRefObjectInfoAttrref
(
&
aref
,
&
o
->
SubId
);
sts
=
gdh_SubRefObjectInfoAttrref
(
&
aref
,
&
o
->
SubId
);
if
(
EVEN
(
sts
))
if
(
EVEN
(
sts
))
{
errh_Error
(
"Couldn't get link to Node object, %m"
,
sts
);
errh_Error
(
"Couldn't get link to Node object, %m"
,
sts
);
o
->
SystemStatus
=
PWR__NETTIMEOUT
;
}
else
gdh_SubAssociateBuffer
(
o
->
SubId
,
(
void
**
)
&
np
->
subvalue
,
sizeof
(
pwr_tStatus
));
}
}
return
np
;
return
np
;
...
@@ -429,11 +434,13 @@ scan_nodes ()
...
@@ -429,11 +434,13 @@ scan_nodes ()
time_Aadd
(
&
Timeout
,
&
LastUpdate
,
&
Delta
);
time_Aadd
(
&
Timeout
,
&
LastUpdate
,
&
Delta
);
if
(
time_Acomp
(
&
CurrentTime
,
&
Timeout
)
<
0
)
if
(
time_Acomp
(
&
CurrentTime
,
&
Timeout
)
<
0
)
LinkUp
=
1
;
LinkUp
=
1
;
o
->
SystemStatus
=
*
np
->
subvalue
;
}
}
if
(
o
->
LinkUp
&&
!
LinkUp
)
{
if
(
o
->
LinkUp
&&
!
LinkUp
)
{
o
->
LinkUp
=
0
;
o
->
LinkUp
=
0
;
o
->
DownTime
=
CurrentTime
;
o
->
DownTime
=
CurrentTime
;
o
->
SystemStatus
=
PWR__NETTIMEOUT
;
}
else
if
(
!
o
->
LinkUp
&&
LinkUp
)
{
}
else
if
(
!
o
->
LinkUp
&&
LinkUp
)
{
o
->
LinkUp
=
1
;
o
->
LinkUp
=
1
;
o
->
UpTime
=
CurrentTime
;
o
->
UpTime
=
CurrentTime
;
...
...
src/wbl/pwrb/src/pwrb_c_nodelinksup.wb_load
View file @
0e200950
...
@@ -575,6 +575,18 @@ SObject pwrb:Class
...
@@ -575,6 +575,18 @@ SObject pwrb:Class
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndBody
EndObject
EndObject
!/**
! Contains the system status of the supervised node.
! If the link is down, the status is PWR__NETTIMEOUT.
!*/
Object SystemStatus $Intern 43
Body SysBody
Attr PgmName = "SystemStatus"
Attr TypeRef = "pwrs:Type-$Status"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!
!
! End Timer struct
! End Timer struct
! --
! --
...
...
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