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
309323a4
Commit
309323a4
authored
Nov 01, 2016
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redundance communication 3
parent
ab6bf4ff
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
934 additions
and
205 deletions
+934
-205
src/doc/man/en_us/man_opg.dat
src/doc/man/en_us/man_opg.dat
+56
-0
src/exe/rt_emon/src/rt_emon.c
src/exe/rt_emon/src/rt_emon.c
+250
-89
src/exe/rt_qmon/src/rt_qmon.c
src/exe/rt_qmon/src/rt_qmon.c
+33
-11
src/exe/rt_redcom/src/rt_redcom.c
src/exe/rt_redcom/src/rt_redcom.c
+212
-46
src/exp/inc/src/pwr_class.h
src/exp/inc/src/pwr_class.h
+2
-1
src/exp/inc/src/pwr_lst.h
src/exp/inc/src/pwr_lst.h
+1
-0
src/lib/rt/src/rt_plc_thread.c
src/lib/rt/src/rt_plc_thread.c
+93
-3
src/lib/rt/src/rt_redu.c
src/lib/rt/src/rt_redu.c
+27
-16
src/lib/rt/src/rt_redu.h
src/lib/rt/src/rt_redu.h
+4
-1
src/msg/rt/src/rt_plc_msg.msg
src/msg/rt/src/rt_plc_msg.msg
+2
-1
src/msg/rt/src/rt_redu_msg.msg
src/msg/rt/src/rt_redu_msg.msg
+50
-0
src/msg/used_facility_numbers.txt
src/msg/used_facility_numbers.txt
+1
-0
src/wbl/pwrb/src/pwrb_c_a_redcomlink.wb_load
src/wbl/pwrb/src/pwrb_c_a_redcomlink.wb_load
+1
-1
src/wbl/pwrb/src/pwrb_c_asup.wb_load
src/wbl/pwrb/src/pwrb_c_asup.wb_load
+15
-0
src/wbl/pwrb/src/pwrb_c_asupcomp.wb_load
src/wbl/pwrb/src/pwrb_c_asupcomp.wb_load
+15
-0
src/wbl/pwrb/src/pwrb_c_dsup.wb_load
src/wbl/pwrb/src/pwrb_c_dsup.wb_load
+15
-0
src/wbl/pwrb/src/pwrb_c_dsupcomp.wb_load
src/wbl/pwrb/src/pwrb_c_dsupcomp.wb_load
+16
-0
src/wbl/pwrb/src/pwrb_c_getconstiv.wb_load
src/wbl/pwrb/src/pwrb_c_getconstiv.wb_load
+1
-1
src/wbl/pwrb/src/pwrb_c_redcomconfig.wb_load
src/wbl/pwrb/src/pwrb_c_redcomconfig.wb_load
+32
-4
src/wbl/pwrb/src/pwrb_c_redcompacket.wb_load
src/wbl/pwrb/src/pwrb_c_redcompacket.wb_load
+10
-0
src/wbl/pwrs/src/pwrs_td_redundancystateenum.wb_load
src/wbl/pwrs/src/pwrs_td_redundancystateenum.wb_load
+10
-0
wb/lib/wb/src/wb_gcg.cpp
wb/lib/wb/src/wb_gcg.cpp
+30
-18
xtt/exp/ge/src/pwr_c_redcomconfig.pwg
xtt/exp/ge/src/pwr_c_redcomconfig.pwg
+11
-2
xtt/lib/xtt/src/xtt_ev.cpp
xtt/lib/xtt/src/xtt_ev.cpp
+2
-0
xtt/lib/xtt/src/xtt_evlist.cpp
xtt/lib/xtt/src/xtt_evlist.cpp
+32
-9
xtt/lib/xtt/src/xtt_xnav_tables.cpp
xtt/lib/xtt/src/xtt_xnav_tables.cpp
+13
-2
No files found.
src/doc/man/en_us/man_opg.dat
View file @
309323a4
...
...
@@ -2822,6 +2822,8 @@ ODD() <LINK> ODD()
get_language() <LINK> get_language()
GetUser() <LINK> getuser()
GetPrivileges() <LINK> getprivileges()
GetGraphInstance() <LINK> getgraphinstance()
GetGraphInstanceNext() <LINK> getgraphinstancenext()
<h2>xtt-commands
xtt-commands <LINK> xtt-commands
...
...
@@ -4044,6 +4046,8 @@ ODD() <t>Check if value is odd. <LINK> ODD()
get_language() <t>Get the current language <LINK> get_language()
GetUser() <t>Get the current user. <LINK> getuser()
GetPrivileges() <t>Get the privileges for the current user. <LINK> getprivileges()
GetGraphInstance() <t>Get the instance object for a graph. <LINK> getgraphinstance()
GetGraphInstanceNext() <t>Get the instance object for next graph. <LINK> getgraphinstancenext()
</TOPIC>
<headerlevel>
...
...
@@ -4287,6 +4291,58 @@ Get the privileges for the current user.
<c> endif
</TOPIC>
<TOPIC> getgraphinstance() <style> function
GetGraphInstance()
string GetGraphInstance( string graph)
<b>Description
Get the instance object for an open object graph.
Returns the instance object, or an empty string if the
graph is node open.
<b>Arguments
string <t>graph <t>Graph file name.
<b>Example
<c> string instance;
<c> instance = GetGraphInstance( "$pwr_exe/pwr_c_dv.pwg");
</TOPIC>
<TOPIC> getgraphinstancenext() <style> function
GetGraphInstanceNext()
string GetGraphInstanceNext( string graph, string previous)
<b>Description
Get the next instance object for the specified object graph.
Used when several versions of the same object graph is open for
different objects.
Returns the instance object, or an empty string if there is
no next instance.
<b>Arguments
string <t>graph <t>Graph file name.
string <t>previous <t>Previous instance.
<b>Example
<c> string instance;
<c> instance = GetGraphInstance( "$pwr_exe/pwr_c_dv.pwg");
<c> while ( instance != "")
<c> printf( "Instance %s\n", instance);
<c> instance = GetGraphInstanceNext( "$pwr_exe/pwr_c_dv.pwg", instance);
<c> endwile
</TOPIC>
</headerlevel>
<TOPIC> xtt-commands <style> function
...
...
src/exe/rt_emon/src/rt_emon.c
View file @
309323a4
This diff is collapsed.
Click to expand it.
src/exe/rt_qmon/src/rt_qmon.c
View file @
309323a4
...
...
@@ -204,6 +204,7 @@ struct sLink {
pwr_tDeltaTime
ack_delay
;
unsigned
int
exp_buf_quota
;
sIseg
tmo
;
thread_sMutex
eseg_mutex
;
};
...
...
@@ -588,6 +589,7 @@ clean_insert (
if
((
!
pending
)
&&
(
esp
->
head
.
flags
.
b
.
first
))
{
thread_MutexLock
(
&
esp
->
lp
->
eseg_mutex
);
for
(
sp
=
lst_Succ
(
NULL
,
le
,
&
se
);
se
!=
le
;
sp
=
nsp
)
{
li
=
se
;
nsp
=
lst_Succ
(
NULL
,
se
,
&
se
);
...
...
@@ -609,12 +611,14 @@ clean_insert (
break
;
}
}
thread_MutexUnlock
(
&
esp
->
lp
->
eseg_mutex
);
if
(
!
esp
->
head
.
flags
.
b
.
last
&&
first
)
ret_pend
=
TRUE
;
if
(
!
first
)
li
=
le
;
}
else
if
(
pending
)
{
thread_MutexLock
(
&
esp
->
lp
->
eseg_mutex
);
for
(
sp
=
lst_Succ
(
NULL
,
le
,
&
se
);
se
!=
le
;
sp
=
nsp
)
{
li
=
se
;
nsp
=
lst_Succ
(
NULL
,
se
,
&
se
);
...
...
@@ -631,6 +635,7 @@ clean_insert (
break
;
}
}
thread_MutexUnlock
(
&
esp
->
lp
->
eseg_mutex
);
if
(
!
first
)
li
=
le
;
ret_pend
=
!
esp
->
head
.
flags
.
b
.
last
;
...
...
@@ -651,7 +656,9 @@ clean_insert (
}
}
#endif
thread_MutexLock
(
&
esp
->
lp
->
eseg_mutex
);
lst_InsertPred
(
NULL
,
li
,
&
esp
->
c
.
le
,
esp
);
thread_MutexUnlock
(
&
esp
->
lp
->
eseg_mutex
);
return
ret_pend
;
...
...
@@ -1016,17 +1023,19 @@ export_thread ()
thread_MutexLock
(
&
l
.
bcast
);
esp
=
sp
;
thread_MutexLock
(
&
sp
->
lp
->
eseg_mutex
);
esp
=
sp
;
do
{
ssp
=
esp
;
do
{
ssp
=
esp
;
do
{
ssp
->
c
.
action
=
eAction_export
;
que_Put
(
NULL
,
&
ssp
->
lp
->
q_in
,
&
ssp
->
c
.
le
,
ssp
);
ssp
=
lst_Succ
(
NULL
,
&
ssp
->
le_seg
,
NULL
)
;
}
while
(
ssp
!=
esp
);
esp
=
lst_Succ
(
NULL
,
&
ssp
->
le_bcast
,
NULL
)
;
}
while
(
esp
!=
sp
);
ssp
->
c
.
action
=
eAction_export
;
que_Put
(
NULL
,
&
ssp
->
lp
->
q_in
,
&
ssp
->
c
.
le
,
ssp
);
ssp
=
lst_Succ
(
NULL
,
&
ssp
->
le_seg
,
NULL
)
;
}
while
(
ssp
!=
esp
);
esp
=
lst_Succ
(
NULL
,
&
ssp
->
le_bcast
,
NULL
)
;
}
while
(
esp
!=
sp
);
thread_MutexUnlock
(
&
sp
->
lp
->
eseg_mutex
);
thread_MutexUnlock
(
&
l
.
bcast
);
}
...
...
@@ -1312,6 +1321,7 @@ lack (
lst_sEntry
*
se
;
int
diff
;
sEseg
*
sp
,
*
nsp
;
thread_sMutex
*
mx
;
for
(
sp
=
lst_Succ
(
NULL
,
&
lp
->
lh_win
,
&
se
);
se
!=
&
lp
->
lh_win
;
sp
=
nsp
)
{
nsp
=
lst_Succ
(
NULL
,
se
,
&
se
);
...
...
@@ -1327,7 +1337,10 @@ lack (
window_remove
(
lp
,
sp
);
mx
=
&
sp
->
lp
->
eseg_mutex
;
thread_MutexLock
(
mx
);
eseg_free
(
sp
);
thread_MutexUnlock
(
mx
);
}
else
{
/* This is the oldest not acked segment. */
lp
->
np
->
link
[
lp
->
lix
].
lack
=
sp
->
head
.
lack
;
...
...
@@ -1437,6 +1450,7 @@ link_disconnect (
/* Empty window list */
thread_MutexLock
(
&
lp
->
eseg_mutex
);
for
(
sp
=
lst_Succ
(
NULL
,
&
lp
->
lh_win
,
NULL
);
sp
!=
NULL
;
...
...
@@ -1445,6 +1459,7 @@ link_disconnect (
lst_Remove
(
NULL
,
&
sp
->
c
.
le
);
eseg_free
(
sp
);
}
thread_MutexUnlock
(
&
lp
->
eseg_mutex
);
lp
->
np
->
link
[
lp
->
lix
].
win_count
=
0
;
...
...
@@ -1544,6 +1559,7 @@ link_purge (
/* Purge send list */
int
i
=
0
;
thread_MutexUnlock
(
&
lp
->
eseg_mutex
);
for
(
sp
=
lst_Succ
(
NULL
,
&
lp
->
lh_send
,
NULL
);
sp
!=
NULL
;
...
...
@@ -1560,6 +1576,7 @@ link_purge (
alloc_cnt
+=
sp
->
size
;
i
++
;
}
thread_MutexUnlock
(
&
lp
->
eseg_mutex
);
printf
(
"link_purge: %d cnt %d (%d)
\n
"
,
i
,
lp
->
np
->
link
[
lp
->
lix
].
export_alloc_cnt
,
alloc_cnt
);
lp
->
np
->
link
[
lp
->
lix
].
export_alloc_cnt
=
alloc_cnt
;
lp
->
np
->
link
[
lp
->
lix
].
export_purge_cnt
++
;
...
...
@@ -1825,6 +1842,7 @@ new_link (
lp
->
np
->
link
[
lp
->
lix
].
rtt_rxmax
=
rtt_rxmax
;
lp
->
np
->
link
[
lp
->
lix
].
rtt_rxmin
=
rtt_rxmin
;
lp
->
tmo
.
c
.
action
=
eAction_tmo
;
sts
=
thread_MutexInit
(
&
lp
->
eseg_mutex
);
if
(
mp
!=
NULL
)
{
#if defined OS_VMS
...
...
@@ -1901,11 +1919,15 @@ pending_send (
sLink
*
lp
)
{
sEseg
*
sp
;
if
(
lp
->
np
->
link
[
lp
->
lix
].
win_count
>=
lp
->
np
->
link
[
lp
->
lix
].
win_max
)
return
NULL
;
return
lst_RemoveSucc
(
NULL
,
&
lp
->
lh_send
,
NULL
);
thread_MutexLock
(
&
lp
->
eseg_mutex
);
sp
=
lst_RemoveSucc
(
NULL
,
&
lp
->
lh_send
,
NULL
);
thread_MutexUnlock
(
&
lp
->
eseg_mutex
);
return
sp
;
}
static
void
...
...
src/exe/rt_redcom/src/rt_redcom.c
View file @
309323a4
This diff is collapsed.
Click to expand it.
src/exp/inc/src/pwr_class.h
View file @
309323a4
...
...
@@ -643,7 +643,8 @@ typedef pwr_tEnum pwr_tRedundancyStateEnum;
typedef
enum
{
pwr_eRedundancyState_Off
,
pwr_eRedundancyState_Passive
,
pwr_eRedundancyState_Active
pwr_eRedundancyState_Active
,
pwr_eRedundancyState_Init
}
pwr_eRedundancyState
;
...
...
src/exp/inc/src/pwr_lst.h
View file @
309323a4
...
...
@@ -87,6 +87,7 @@
(p)->pre = (void *)(&(o)->e))
#define LstRem(p) ((p)->nex->pre = (p)->pre,(p)->pre->nex = (p)->nex)
#define LstNul(p) ((p)->nex = (p)->pre = NULL)
#define LstIsNul(p) ((p)->nex == NULL && (p)->pre == NULL)
#define LstInl(p) ((p)->nex != NULL && (p)->pre != NULL)
#define LstIni(h) ((h)->nex = (h)->pre = (h))
#define LstObj(p) ((p)->obj)
...
...
src/lib/rt/src/rt_plc_thread.c
View file @
309323a4
...
...
@@ -113,10 +113,10 @@ static pwr_tStatus plc_redu_init( plc_sThread *tp)
sts
=
redu_init
(
&
tp
->
redu
,
tp
->
pp
->
Node
,
p
);
if
(
EVEN
(
sts
))
return
sts
;
break
;
return
PLC__SUCCESS
;
}
}
return
PLC__
SUCCESS
;
return
PLC__
REDUCONFIG
;
}
static
pwr_tStatus
plc_redu_receive
(
plc_sThread
*
tp
)
...
...
@@ -138,8 +138,11 @@ static pwr_tStatus plc_redu_receive( plc_sThread *tp)
redu_free_table
(
tp
->
redu
);
sts
=
redu_receive_table
(
tp
->
redu
,
msg
);
if
(
tp
->
redu
->
packetp
)
tp
->
redu
->
packetp
->
TableStatus
=
sts
;
if
(
EVEN
(
sts
))
return
sts
;
tp
->
redu
->
table_sent
=
1
;
break
;
case
redu_eMsgType_Cyclic
:
if
(
tp
->
redu
->
packetp
)
...
...
@@ -147,6 +150,69 @@ static pwr_tStatus plc_redu_receive( plc_sThread *tp)
sts
=
redu_unpack_message
(
tp
->
redu
,
msg
);
if
(
EVEN
(
sts
))
return
sts
;
break
;
case
redu_eMsgType_TableRequest
:
{
void
*
table_msg
;
if
(
!
tp
->
redu
->
table_sent
)
{
sts
=
redu_create_table
(
tp
->
redu
);
if
(
tp
->
redu
->
packetp
)
tp
->
redu
->
packetp
->
TableStatus
=
sts
;
if
(
EVEN
(
sts
))
return
sts
;
}
sts
=
redu_send_table
(
tp
->
redu
,
&
table_msg
);
if
(
tp
->
redu
->
packetp
)
tp
->
redu
->
packetp
->
TableStatus
=
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
redu_send
(
tp
->
redu
,
table_msg
,
((
redu_sTableMsgHeader
*
)
table_msg
)
->
size
+
sizeof
(
redu_sTableMsgHeader
),
tp
->
redu
->
msgid_table
);
if
(
EVEN
(
sts
))
return
sts
;
tp
->
redu
->
table_sent
=
1
;
break
;
}
default:
printf
(
"Redu: Unknown message type
\n
"
);
}
qcom_Free
(
&
sts
,
msg
);
return
PLC__SUCCESS
;
}
static
pwr_tStatus
plc_redu_receive_active
(
plc_sThread
*
tp
)
{
pwr_tStatus
sts
;
void
*
msg
;
int
size
;
sts
=
redu_receive
(
tp
->
redu
,
qcom_cTmoNone
,
&
size
,
&
msg
);
if
(
EVEN
(
sts
))
return
sts
;
switch
(
((
redu_sHeader
*
)
msg
)
->
type
)
{
break
;
case
redu_eMsgType_TableRequest
:
{
void
*
table_msg
;
if
(
!
tp
->
redu
->
table_sent
)
{
sts
=
redu_create_table
(
tp
->
redu
);
if
(
tp
->
redu
->
packetp
)
tp
->
redu
->
packetp
->
TableStatus
=
sts
;
if
(
EVEN
(
sts
))
return
sts
;
}
sts
=
redu_send_table
(
tp
->
redu
,
&
table_msg
);
if
(
tp
->
redu
->
packetp
)
tp
->
redu
->
packetp
->
TableStatus
=
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
redu_send
(
tp
->
redu
,
table_msg
,
((
redu_sTableMsgHeader
*
)
table_msg
)
->
size
+
sizeof
(
redu_sTableMsgHeader
),
tp
->
redu
->
msgid_table
);
if
(
EVEN
(
sts
))
return
sts
;
tp
->
redu
->
table_sent
=
1
;
break
;
}
case
redu_eMsgType_Table
:
case
redu_eMsgType_Cyclic
:
break
;
default:
printf
(
"Redu: Unknown message type
\n
"
);
...
...
@@ -164,9 +230,13 @@ static pwr_tStatus plc_redu_send( plc_sThread *tp)
void
*
table_msg
;
sts
=
redu_create_table
(
tp
->
redu
);
if
(
tp
->
redu
->
packetp
)
tp
->
redu
->
packetp
->
TableStatus
=
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
redu_send_table
(
tp
->
redu
,
&
table_msg
);
if
(
tp
->
redu
->
packetp
)
tp
->
redu
->
packetp
->
TableStatus
=
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
redu_send
(
tp
->
redu
,
table_msg
,
...
...
@@ -190,6 +260,21 @@ static pwr_tStatus plc_redu_send( plc_sThread *tp)
return
sts
;
}
static
pwr_tStatus
plc_redu_send_table_request
(
plc_sThread
*
tp
)
{
pwr_tStatus
sts
;
void
*
msg
;
sts
=
redu_create_table_request_message
(
tp
->
redu
,
&
msg
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
redu_send
(
tp
->
redu
,
msg
,
sizeof
(
redu_sHeader
),
0
);
free
(
msg
);
return
sts
;
}
void
plc_thread
(
...
...
@@ -479,6 +564,10 @@ scan (
}
if
(
tp
->
redu
&&
tp
->
pp
->
Node
->
RedundancyState
==
pwr_eRedundancyState_Passive
)
{
if
(
tp
->
redu_state_old
==
pwr_eRedundancyState_Off
||
tp
->
redu_state_old
==
pwr_eRedundancyState_Init
)
{
/* Send table request */
sts
=
plc_redu_send_table_request
(
tp
);
}
time_GetTimeMonotonic
(
&
tp
->
before_scan
);
time_GetTime
(
&
tp
->
before_scan_abs
);
...
...
@@ -503,7 +592,7 @@ scan (
return
;
}
if
(
tp
->
pp
->
Node
->
RedundancyState
!=
pwr_eRedundancyState_Passive
)
{
if
(
!
tp
->
redu
||
(
tp
->
pp
->
Node
->
RedundancyState
!=
pwr_eRedundancyState_Passive
)
)
{
if
(
pp
->
IOHandler
->
IOReadWriteFlag
)
{
if
(
tp
->
redu_state_old
==
pwr_eRedundancyState_Passive
)
...
...
@@ -555,6 +644,7 @@ scan (
}
}
if
(
tp
->
redu
&&
tp
->
pp
->
Node
->
RedundancyState
==
pwr_eRedundancyState_Active
)
{
sts
=
plc_redu_receive_active
(
tp
);
sts
=
plc_redu_send
(
tp
);
}
}
...
...
src/lib/rt/src/rt_redu.c
View file @
309323a4
...
...
@@ -48,6 +48,7 @@
#include "rt_qcom.h"
#include "rt_qcom_msg.h"
#include "rt_redu.h"
#include "rt_redu_msg.h"
static
pwr_tStatus
add_table_object
(
redu_tCtx
ctx
,
pwr_tAttrRef
*
o
);
static
pwr_tStatus
add_table_attr
(
redu_tCtx
ctx
,
pwr_tAttrRef
*
aref
,
gdh_sAttrDef
*
bd
);
...
...
@@ -80,7 +81,7 @@ pwr_tStatus redu_create_table( redu_tCtx ctx)
}
#endif
return
1
;
return
REDU__TABLECREATED
;
}
void
redu_free
(
redu_tCtx
ctx
)
...
...
@@ -146,7 +147,7 @@ static pwr_tStatus add_table_object( redu_tCtx ctx, pwr_tAttrRef *o)
o
=
&
maref
;
}
else
return
1
;
return
REDU__SUCCESS
;
sts
=
gdh_GetAttrRefTid
(
o
,
&
tid
);
if
(
EVEN
(
sts
))
return
sts
;
...
...
@@ -220,7 +221,7 @@ static pwr_tStatus add_table_object( redu_tCtx ctx, pwr_tAttrRef *o)
if
(
EVEN
(
sts
))
return
sts
;
}
}
return
1
;
return
REDU__SUCCESS
;
}
static
pwr_tStatus
add_table_attr
(
redu_tCtx
ctx
,
pwr_tAttrRef
*
aref
,
gdh_sAttrDef
*
bd
)
...
...
@@ -234,7 +235,7 @@ static pwr_tStatus add_table_attr( redu_tCtx ctx, pwr_tAttrRef *aref, gdh_sAttrD
if
(
aref
->
Flags
.
b
.
Indirect
)
{
if
(
*
(
unsigned
long
*
)
p
==
0
)
return
1
;
return
REDU__SUCCESS
;
p
=
gdh_TranslateRtdbPointer
(
*
(
unsigned
long
*
)
p
);
}
...
...
@@ -253,7 +254,14 @@ static pwr_tStatus add_table_attr( redu_tCtx ctx, pwr_tAttrRef *aref, gdh_sAttrD
ctx
->
current_offset
+=
t
->
size
;
ctx
->
attr_cnt
++
;
return
1
;
return
REDU__SUCCESS
;
}
pwr_tStatus
redu_create_table_request_message
(
redu_tCtx
ctx
,
void
**
msg
)
{
*
msg
=
malloc
(
sizeof
(
redu_sHeader
));
((
redu_sHeader
*
)(
*
msg
))
->
type
=
redu_eMsgType_TableRequest
;
return
REDU__SUCCESS
;
}
pwr_tStatus
redu_create_message
(
redu_tCtx
ctx
,
void
**
msg
)
...
...
@@ -287,7 +295,7 @@ pwr_tStatus redu_create_message( redu_tCtx ctx, void **msg)
ctx
->
packetp
->
PackTime
=
ctx
->
msg_time
;
}
*
msg
=
buf
;
return
1
;
return
REDU__SUCCESS
;
}
pwr_tStatus
redu_unpack_message
(
redu_tCtx
ctx
,
void
*
msg
)
...
...
@@ -313,7 +321,7 @@ pwr_tStatus redu_unpack_message( redu_tCtx ctx, void *msg)
ctx
->
packetp
->
ReceiveCnt
++
;
ctx
->
packetp
->
UnpackTime
=
ctx
->
msg_time
;
}
return
1
;
return
REDU__SUCCESS
;
}
pwr_tStatus
redu_send_table
(
redu_tCtx
ctx
,
void
**
table_msg
)
...
...
@@ -336,10 +344,12 @@ pwr_tStatus redu_send_table( redu_tCtx ctx, void **table_msg)
msgp
+=
sizeof
(
redu_sTableMsgElement
);
}
ctx
->
packetp
->
TablePacketSize
=
size
;
ctx
->
packetp
->
Attributes
=
ctx
->
attr_cnt
;
if
(
ctx
->
packetp
)
{
ctx
->
packetp
->
TablePacketSize
=
size
;
ctx
->
packetp
->
Attributes
=
ctx
->
attr_cnt
;
}
*
table_msg
=
msg
;
return
1
;
return
REDU__TABLESENT
;
}
pwr_tStatus
redu_receive_table
(
redu_tCtx
ctx
,
void
*
table_msg
)
...
...
@@ -386,7 +396,7 @@ pwr_tStatus redu_receive_table( redu_tCtx ctx, void *table_msg)
ctx
->
attr_cnt
++
;
msgp
+=
sizeof
(
redu_sTableMsgElement
);
}
return
1
;
return
REDU__TABLERECEIVED
;
}
void
redu_print_table
(
redu_tCtx
ctx
)
...
...
@@ -483,7 +493,7 @@ int redu_init( redu_tCtx *ctx, pwr_sNode *nodep, pwr_sClass_RedcomPacket *packet
c
->
send_qid
.
qix
=
redu_cQixExport
;
c
->
send_qid
.
nid
=
0
;
return
1
;
return
REDU__SUCCESS
;
}
int
redu_receive
(
redu_tCtx
ctx
,
unsigned
int
timeout
,
int
*
size
,
void
**
msg
)
...
...
@@ -524,7 +534,7 @@ pwr_tStatus redu_get_initial_state( char *nodename, int busid, int *state)
dcli_translate_filename
(
fname
,
fname
);
fp
=
fopen
(
fname
,
"r"
);
if
(
!
fp
)
return
0
;
return
REDU__REDCOMFILE
;
while
((
s
=
fgets
(
buffer
,
sizeof
(
buffer
)
-
1
,
fp
))
!=
NULL
)
{
...
...
@@ -539,14 +549,15 @@ pwr_tStatus redu_get_initial_state( char *nodename, int busid, int *state)
if
(
strcmp
(
name
,
nodename
)
==
0
)
{
local_found
=
1
;
*
state
=
atoi
(
s_state
);
// *state = atoi(s_state);
*
state
=
pwr_eRedundancyState_Init
;
break
;
}
}
fclose
(
fp
);
if
(
!
local_found
)
return
0
;
return
1
;
return
REDU__LOCALNODE
;
return
REDU__SUCCESS
;
}
src/lib/rt/src/rt_redu.h
View file @
309323a4
...
...
@@ -66,10 +66,12 @@ extern "C" {
typedef
enum
{
redu_eMsgType_Table
,
redu_eMsgType_Cyclic
redu_eMsgType_Cyclic
,
redu_eMsgType_TableRequest
}
redu_eMsgType
;
typedef
enum
{
redu_ePrio_0
=
0
,
redu_ePrio_1
=
1
,
redu_ePrio_2
=
2
,
redu_ePrio_3
=
3
,
...
...
@@ -136,6 +138,7 @@ pwr_tStatus redu_create_message( redu_tCtx ctx, void **msg);
pwr_tStatus
redu_unpack_message
(
redu_tCtx
ctx
,
void
*
msg
);
pwr_tStatus
redu_receive_table
(
redu_tCtx
ctx
,
void
*
table_msg
);
pwr_tStatus
redu_send_table
(
redu_tCtx
ctx
,
void
**
table_msg
);
pwr_tStatus
redu_create_table_request_message
(
redu_tCtx
ctx
,
void
**
msg
);
int
redu_init
(
redu_tCtx
*
ctx
,
pwr_sNode
*
nodep
,
pwr_sClass_RedcomPacket
*
packetp
);
int
redu_send
(
redu_tCtx
ctx
,
void
*
msg
,
int
size
,
unsigned
int
msg_id
);
int
redu_receive
(
redu_tCtx
ctx
,
unsigned
int
timeout
,
int
*
size
,
void
**
msg
);
...
...
src/msg/rt/src/rt_plc_msg.msg
View file @
309323a4
...
...
@@ -72,5 +72,6 @@ ininstep <initialize init steps> /error
iostalled <IO stalled, cyclesup delay detected> /fatal
ioread <IO stalled, io read error> /fatal
iowrite <IO stalled, io write error> /fatal
reduinit <Redundcancy init error> /error
reduinit <Redundancy init error> /error
reduconfig <Redundancy not configured> /error
.end
src/msg/rt/src/rt_redu_msg.msg
0 → 100644
View file @
309323a4
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2016 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! rt_redu_msg.msg -- <short description>
!
.facility REDU,27 /prefix = REDU__
success <Successful completion> /succ
tablereceived <Table successfully received> /succ
tablecreated <Table successfully created> /succ
tablesent <Table sent> /succ
redcomfile <Unable to open redcom file> /error
localnode <Local node not found> /error
.end
src/msg/used_facility_numbers.txt
View file @
309323a4
...
...
@@ -16,6 +16,7 @@
24 PROC
25 SEV
26 SIM
27 REDU
50 HD
100 CDH
101 NDC
...
...
src/wbl/pwrb/src/pwrb_c_a_redcomlink.wb_load
View file @
309323a4
...
...
@@ -184,7 +184,7 @@ SObject pwrb:Class
!/**
! Disable.
!*/
Object Disable $Attribute 1
4
Object Disable $Attribute 1
5
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
...
...
src/wbl/pwrb/src/pwrb_c_asup.wb_load
View file @
309323a4
...
...
@@ -172,6 +172,7 @@ SObject pwrb:Class
Attr PgmName = "Action"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "act"
EndBody
...
...
@@ -189,6 +190,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "ack"
EndBody
EndObject
...
...
@@ -209,6 +211,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "blk"
EndBody
EndObject
...
...
@@ -401,6 +404,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -412,6 +416,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -425,6 +430,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -438,6 +444,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -449,6 +456,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -462,6 +470,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -475,6 +484,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -487,6 +497,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -499,6 +510,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -565,6 +577,7 @@ SObject pwrb:Class
Body SysBody
Attr PgmName = "High"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -590,6 +603,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
...
...
@@ -614,6 +628,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_asupcomp.wb_load
View file @
309323a4
...
...
@@ -166,6 +166,7 @@ SObject pwrb:Class
Attr PgmName = "Action"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
...
...
@@ -182,6 +183,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -201,6 +203,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
! ++
...
...
@@ -228,6 +231,7 @@ SObject pwrb:Class
Body SysBody
Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -383,6 +387,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -394,6 +399,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -407,6 +413,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -420,6 +427,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -431,6 +439,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -444,6 +453,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -457,6 +467,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -469,6 +480,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -481,6 +493,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -572,6 +585,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
...
...
@@ -596,6 +610,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_dsup.wb_load
View file @
309323a4
...
...
@@ -175,6 +175,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "act"
EndBody
EndObject
...
...
@@ -190,6 +191,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "ack"
EndBody
EndObject
...
...
@@ -211,6 +213,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "blk"
EndBody
EndObject
...
...
@@ -239,6 +242,7 @@ SObject pwrb:Class
Body SysBody
Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -397,6 +401,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -408,6 +413,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -421,6 +427,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -434,6 +441,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -445,6 +453,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -458,6 +467,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -471,6 +481,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -483,6 +494,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -495,6 +507,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -554,6 +567,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
...
...
@@ -578,6 +592,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_dsupcomp.wb_load
View file @
309323a4
...
...
@@ -168,6 +168,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -182,6 +183,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -202,6 +204,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
! ++
...
...
@@ -229,6 +232,7 @@ SObject pwrb:Class
Body SysBody
Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -380,6 +384,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -391,6 +396,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -404,6 +410,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -417,6 +424,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -428,6 +436,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -441,6 +450,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -454,6 +464,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -466,6 +477,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -478,6 +490,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
@@ -537,6 +550,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
...
...
@@ -561,6 +575,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
...
...
@@ -590,6 +605,7 @@ SObject pwrb:Class
Body SysBody
Attr PgmName = "TimerTime"
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody
EndObject
!/**
...
...
src/wbl/pwrb/src/pwrb_c_getconstiv.wb_load
View file @
309323a4
...
...
@@ -64,7 +64,7 @@ SObject pwrb:Class
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_DEVBODYREF
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr GraphName = "val"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_redcomconfig.wb_load
View file @
309323a4
...
...
@@ -68,33 +68,60 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! Link timeout time.
! If no messages in passive state is received within this
! time the link is regarded as down.
!*/
Object LinkTimeout $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Force state.
! State can only be changed from Active/Passive buttons in
! object graph. I will not automatically be changed by system
! events or errors.
!*/
Object Force $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Set redundancy state Active.
!*/
Object SetActive $Attribute
3
Object SetActive $Attribute
5
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Set redundancy state Passive.
!*/
Object SetPassive $Attribute
4
Object SetPassive $Attribute
6
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Set redundancy state Off.
!*/
Object SetOff $Attribute
5
Object SetOff $Attribute
7
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Link state.
!*/
Object Link $Attribute
6
Object Link $Attribute
8
Body SysBody
Attr Flags |= PWR_MASK_ARRAY
Attr Flags |= PWR_MASK_CLASS
...
...
@@ -106,6 +133,7 @@ SObject pwrb:Class
Object Template RedcomConfig
Body RtBody
Attr CycleTime = 0.005
Attr LinkTimeout = 0.200
EndBody
EndObject
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_redcompacket.wb_load
View file @
309323a4
...
...
@@ -118,6 +118,16 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! Table status.
!*/
Object TableStatus $Attribute 12
Body SysBody
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
Attr TypeRef = "pwrs:Type-$Status"
EndBody
EndObject
!/**
! Number of attributes.
!*/
Object Attributes $Attribute 8
...
...
src/wbl/pwrs/src/pwrs_td_redundancystateenum.wb_load
View file @
309323a4
...
...
@@ -76,6 +76,16 @@ SObject pwrs:Type
Attr Value = 2
EndBody
EndObject
!/**
! Initialization.
!*/
Object Init $Value
Body SysBody
Attr PgmName = "Init"
Attr Text = "Init"
Attr Value = 3
EndBody
EndObject
EndObject
EndSObject
...
...
wb/lib/wb/src/wb_gcg.cpp
View file @
309323a4
...
...
@@ -3610,9 +3610,11 @@ int gcg_get_outputstring (
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
*
objdid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
objdid
);
return
GSX__NEXTPAR
;
if
(
!
gcg_in_libhier
(
gcgctx
,
output_node
->
ln
.
oid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
objdid
);
return
GSX__NEXTPAR
;
}
}
strcpy
(
parstring
,
...
...
@@ -3650,9 +3652,11 @@ int gcg_get_outputstring (
}
/* Check that object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
if
(
!
gcg_in_libhier
(
gcgctx
,
output_node
->
ln
.
oid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
}
strcpy
(
parstring
,
...
...
@@ -3780,9 +3784,11 @@ static int gcg_get_outputstring_spec(
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
if
(
!
gcg_in_libhier
(
gcgctx
,
output_node
->
ln
.
oid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
}
/* Get the attribute name of last segment */
...
...
@@ -3842,9 +3848,11 @@ static int gcg_get_outputstring_spec(
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
if
(
!
gcg_in_libhier
(
gcgctx
,
output_node
->
ln
.
oid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
}
strcpy
(
parstring
,
...
...
@@ -3895,9 +3903,11 @@ static int gcg_get_outputstring_spec(
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
if
(
!
gcg_in_libhier
(
gcgctx
,
output_node
->
ln
.
oid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
}
/* Get the attribute name of last segment */
...
...
@@ -3998,9 +4008,11 @@ static int gcg_get_outputstring_spec(
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
if
(
!
gcg_in_libhier
(
gcgctx
,
output_node
->
ln
.
oid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
}
/* Check if DisableAttr is present */
...
...
xtt/exp/ge/src/pwr_c_redcomconfig.pwg
View file @
309323a4
...
...
@@ -44,7 +44,7 @@
117 0
118 134
119 112
120
1
120
0
121 Claes context
122 0
126 0.5
...
...
@@ -7391,12 +7391,21 @@ pwr_exe:
102 35454972
103 0
61
6100
6101 3
6102 4
6103 470
6104 2
6105 1
6106 0
99
61
6100 $node.RedundancyState##Int32
6101 2
6102 4
6103 410
6104 1
6105
1
6105
3
6106 0
99
12
...
...
xtt/lib/xtt/src/xtt_ev.cpp
View file @
309323a4
...
...
@@ -766,6 +766,7 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP)
brow_GetObjectList
(
ev
->
ala
->
browbase
->
ctx
,
&
object_list
,
&
object_cnt
);
ev
->
ala
->
size
=
object_cnt
;
// Reset check to find obsolete items
for
(
i
=
0
;
i
<
object_cnt
;
i
++
)
{
...
...
@@ -839,6 +840,7 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP)
case
evlist_eItemType_Alarm
:
if
(
MsgP
->
Nix
==
item
->
eventid
.
Nix
&&
!
item
->
check
)
{
ev
->
ala
->
event_delete
(
&
item
->
eventid
);
printf
(
"Sts ala del %d,%d
\n
"
,
item
->
eventid
.
Nix
,
item
->
eventid
.
Idx
);
for
(
int
k
=
0
;
k
<
ev
->
sala_cnt
;
k
++
)
ev
->
sala
[
k
]
->
event_delete
(
&
item
->
eventid
);
i
--
;
...
...
xtt/lib/xtt/src/xtt_evlist.cpp
View file @
309323a4
...
...
@@ -924,6 +924,8 @@ void EvList::event_alarm( mh_sMessage *msg)
ItemAlarm
*
dest
;
flow_eDest
dest_code
;
brow_tNode
dest_node
;
ItemAlarm
*
item
;
if
(
type
==
ev_eType_AlarmList
)
{
if
(
!
(
msg
->
Status
&
mh_mEventStatus_NotAck
||
...
...
@@ -931,12 +933,18 @@ void EvList::event_alarm( mh_sMessage *msg)
return
;
// Check that this id not already inserted
ItemAlarm
*
item
;
if
(
id_to_item
(
&
event
->
Info
.
Id
,
(
void
**
)
&
item
))
return
;
}
if
(
type
!=
ev_eType_HistList
)
{
// Check that this id not already inserted
if
(
id_to_item
(
&
event
->
Info
.
Id
,
(
void
**
)
&
item
))
return
;
if
(
type
!=
ev_eType_EventList
)
printf
(
"New ala %d,%d
\n
"
,
event
->
Info
.
Id
.
Nix
,
event
->
Info
.
Id
.
Idx
);
sts
=
get_destination
(
net_NetTimeToTime
(
&
event
->
Info
.
EventTime
),
(
void
**
)
&
dest
);
if
(
EVEN
(
sts
))
{
dest_code
=
flow_eDest_IntoLast
;
...
...
@@ -952,7 +960,7 @@ void EvList::event_alarm( mh_sMessage *msg)
dest_node
=
NULL
;
}
ItemAlarm
*
item
=
new
ItemAlarm
(
this
,
"Alarm"
,
item
=
new
ItemAlarm
(
this
,
"Alarm"
,
net_NetTimeToTime
(
&
event
->
Info
.
EventTime
),
event
->
Msg
.
EventText
,
event
->
Msg
.
EventName
,
event
->
Info
.
EventType
,
event
->
Info
.
EventFlags
,
event
->
Info
.
EventPrio
,
event
->
Info
.
Id
,
...
...
@@ -1129,11 +1137,17 @@ void EvList::event_ack( mh_sAck *msg)
ala_uEvent
*
event
=
(
ala_uEvent
*
)
msg
;
int
sts
;
ItemAlarm
*
dest
;
ItemAlarm
*
item
;
flow_eDest
dest_code
;
brow_tNode
dest_node
;
if
(
type
==
ev_eType_EventList
||
type
==
ev_eType_HistList
)
{
if
(
type
==
ev_eType_EventList
)
{
// Check that this id not already inserted
if
(
id_to_item
(
&
event
->
Info
.
Id
,
(
void
**
)
&
item
))
return
;
printf
(
"New ack %d,%d
\n
"
,
event
->
Info
.
Id
.
Nix
,
event
->
Info
.
Id
.
Idx
);
sts
=
get_destination
(
net_NetTimeToTime
(
&
event
->
Info
.
EventTime
),
(
void
**
)
&
dest
);
if
(
EVEN
(
sts
))
{
dest_code
=
flow_eDest_IntoLast
;
...
...
@@ -1217,11 +1231,17 @@ void EvList::event_return( mh_sReturn *msg)
ala_uEvent
*
event
=
(
ala_uEvent
*
)
msg
;
int
sts
;
ItemAlarm
*
dest
;
ItemAlarm
*
item
;
flow_eDest
dest_code
;
brow_tNode
dest_node
;
if
(
type
==
ev_eType_EventList
||
type
==
ev_eType_HistList
)
{
if
(
type
==
ev_eType_EventList
)
{
// Check that this id not already inserted
if
(
id_to_item
(
&
event
->
Info
.
Id
,
(
void
**
)
&
item
))
return
;
printf
(
"New ret %d,%d
\n
"
,
event
->
Info
.
Id
.
Nix
,
event
->
Info
.
Id
.
Idx
);
sts
=
get_destination
(
net_NetTimeToTime
(
&
event
->
Info
.
EventTime
),
(
void
**
)
&
dest
);
if
(
EVEN
(
sts
))
{
dest_code
=
flow_eDest_IntoLast
;
...
...
@@ -1920,17 +1940,21 @@ ItemAlarm::ItemAlarm( EvList *item_evlist, const char *item_name, pwr_tTime item
sts
=
brow_GetLast
(
evlist
->
browbase
->
ctx
,
&
last_node
);
if
(
ODD
(
sts
))
{
if
(
node
==
last_node
)
// I'm deleting myself
*
rsts
=
0
;
brow_GetUserData
(
last_node
,
(
void
**
)
&
item
);
brow_tNode
tree_node
=
item
->
tree_node
;
evlist_eItemType
item_type
=
item
->
type
;
brow_DeleteNode
(
evlist
->
browbase
->
ctx
,
last_node
);
if
(
item
->
type
==
evlist_eItemType_Alarm
&&
evlist
->
browtree
)
{
if
(
item
->
tree_node
)
brow_DeleteNode
(
evlist
->
browtree
->
ctx
,
item
->
tree_node
);
evlist
->
view_configure
();
if
(
item
_type
==
evlist_eItemType_Alarm
&&
item_
evlist
->
browtree
)
{
if
(
tree_node
)
brow_DeleteNode
(
item_evlist
->
browtree
->
ctx
,
tree_node
);
item_
evlist
->
view_configure
();
}
// Note! This ItemAlarm might be deleted by now if node == last_node
...
...
@@ -2784,8 +2808,7 @@ int EvList::id_to_item( mh_sEventId *id, void **item)
brow_GetUserData
(
object_list
[
i
],
(
void
**
)
&
object_item
);
switch
(
object_item
->
type
)
{
case
evlist_eItemType_Alarm
:
if
(
memcmp
(
&
object_item
->
eventid
,
id
,
sizeof
(
object_item
->
eventid
))
==
0
)
{
if
(
object_item
->
eventid
.
Idx
==
id
->
Idx
&&
object_item
->
eventid
.
Nix
==
id
->
Nix
)
{
*
item
=
(
void
*
)
object_item
;
return
1
;
}
...
...
xtt/lib/xtt/src/xtt_xnav_tables.cpp
View file @
309323a4
...
...
@@ -295,8 +295,19 @@ int XNav::show_nethandler()
t
.
elem_cnt
=
0
;
// Node name
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
np
->
name
);
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
//strcpy( t.elem[t.elem_cnt].fix_str, np->name);
//t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
if
(
np
==
gdbroot
->
my_node
)
{
// Local node
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
np
->
name
);
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
}
else
{
t
.
elem
[
t
.
elem_cnt
].
value_p
=
np
->
name
;
t
.
elem
[
t
.
elem_cnt
].
type_id
=
pwr_eType_String
;
t
.
elem
[
t
.
elem_cnt
].
size
=
sizeof
(
np
->
name
);
strcpy
(
t
.
elem
[
t
.
elem_cnt
++
].
format
,
"%s"
);
}
// Os
switch
(
np
->
hw
)
{
...
...
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