Commit 309323a4 authored by Claes Sjofors's avatar Claes Sjofors

Redundance communication 3

parent ab6bf4ff
...@@ -2822,6 +2822,8 @@ ODD() <LINK> ODD() ...@@ -2822,6 +2822,8 @@ ODD() <LINK> ODD()
get_language() <LINK> get_language() get_language() <LINK> get_language()
GetUser() <LINK> getuser() GetUser() <LINK> getuser()
GetPrivileges() <LINK> getprivileges() GetPrivileges() <LINK> getprivileges()
GetGraphInstance() <LINK> getgraphinstance()
GetGraphInstanceNext() <LINK> getgraphinstancenext()
<h2>xtt-commands <h2>xtt-commands
xtt-commands <LINK> xtt-commands xtt-commands <LINK> xtt-commands
...@@ -4044,6 +4046,8 @@ ODD() <t>Check if value is odd. <LINK> ODD() ...@@ -4044,6 +4046,8 @@ ODD() <t>Check if value is odd. <LINK> ODD()
get_language() <t>Get the current language <LINK> get_language() get_language() <t>Get the current language <LINK> get_language()
GetUser() <t>Get the current user. <LINK> getuser() GetUser() <t>Get the current user. <LINK> getuser()
GetPrivileges() <t>Get the privileges for the current user. <LINK> getprivileges() 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> </TOPIC>
<headerlevel> <headerlevel>
...@@ -4287,6 +4291,58 @@ Get the privileges for the current user. ...@@ -4287,6 +4291,58 @@ Get the privileges for the current user.
<c> endif <c> endif
</TOPIC> </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> </headerlevel>
<TOPIC> xtt-commands <style> function <TOPIC> xtt-commands <style> function
......
This diff is collapsed.
...@@ -204,6 +204,7 @@ struct sLink { ...@@ -204,6 +204,7 @@ struct sLink {
pwr_tDeltaTime ack_delay; pwr_tDeltaTime ack_delay;
unsigned int exp_buf_quota; unsigned int exp_buf_quota;
sIseg tmo; sIseg tmo;
thread_sMutex eseg_mutex;
}; };
...@@ -588,6 +589,7 @@ clean_insert ( ...@@ -588,6 +589,7 @@ clean_insert (
if ((!pending) && (esp->head.flags.b.first)) { if ((!pending) && (esp->head.flags.b.first)) {
thread_MutexLock(&esp->lp->eseg_mutex);
for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) { for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) {
li = se; li = se;
nsp = lst_Succ(NULL, se, &se); nsp = lst_Succ(NULL, se, &se);
...@@ -609,12 +611,14 @@ clean_insert ( ...@@ -609,12 +611,14 @@ clean_insert (
break; break;
} }
} }
thread_MutexUnlock(&esp->lp->eseg_mutex);
if (!esp->head.flags.b.last && first) ret_pend = TRUE; if (!esp->head.flags.b.last && first) ret_pend = TRUE;
if (!first) li = le; if (!first) li = le;
} }
else if (pending) { else if (pending) {
thread_MutexLock(&esp->lp->eseg_mutex);
for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) { for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) {
li = se; li = se;
nsp = lst_Succ(NULL, se, &se); nsp = lst_Succ(NULL, se, &se);
...@@ -631,6 +635,7 @@ clean_insert ( ...@@ -631,6 +635,7 @@ clean_insert (
break; break;
} }
} }
thread_MutexUnlock(&esp->lp->eseg_mutex);
if (!first) li = le; if (!first) li = le;
ret_pend = !esp->head.flags.b.last; ret_pend = !esp->head.flags.b.last;
...@@ -651,7 +656,9 @@ clean_insert ( ...@@ -651,7 +656,9 @@ clean_insert (
} }
} }
#endif #endif
thread_MutexLock(&esp->lp->eseg_mutex);
lst_InsertPred(NULL, li, &esp->c.le, esp); lst_InsertPred(NULL, li, &esp->c.le, esp);
thread_MutexUnlock(&esp->lp->eseg_mutex);
return ret_pend; return ret_pend;
...@@ -1016,17 +1023,19 @@ export_thread () ...@@ -1016,17 +1023,19 @@ export_thread ()
thread_MutexLock(&l.bcast); thread_MutexLock(&l.bcast);
esp = sp; thread_MutexLock(&sp->lp->eseg_mutex);
esp = sp;
do {
ssp = esp;
do { do {
ssp = esp; ssp->c.action = eAction_export;
do { que_Put(NULL, &ssp->lp->q_in, &ssp->c.le, ssp);
ssp->c.action = eAction_export; ssp = lst_Succ(NULL, &ssp->le_seg, NULL) ;
que_Put(NULL, &ssp->lp->q_in, &ssp->c.le, ssp); } while (ssp != esp);
ssp = lst_Succ(NULL, &ssp->le_seg, NULL) ; esp = lst_Succ(NULL, &ssp->le_bcast, NULL) ;
} while (ssp != esp); } while (esp != sp);
esp = lst_Succ(NULL, &ssp->le_bcast, NULL) ; thread_MutexUnlock(&sp->lp->eseg_mutex);
} while (esp != sp);
thread_MutexUnlock(&l.bcast); thread_MutexUnlock(&l.bcast);
} }
...@@ -1312,6 +1321,7 @@ lack ( ...@@ -1312,6 +1321,7 @@ lack (
lst_sEntry *se; lst_sEntry *se;
int diff; int diff;
sEseg *sp, *nsp; sEseg *sp, *nsp;
thread_sMutex *mx;
for (sp = lst_Succ(NULL, &lp->lh_win, &se); se != &lp->lh_win; sp = nsp) { for (sp = lst_Succ(NULL, &lp->lh_win, &se); se != &lp->lh_win; sp = nsp) {
nsp = lst_Succ(NULL, se, &se); nsp = lst_Succ(NULL, se, &se);
...@@ -1327,7 +1337,10 @@ lack ( ...@@ -1327,7 +1337,10 @@ lack (
window_remove(lp, sp); window_remove(lp, sp);
mx = &sp->lp->eseg_mutex;
thread_MutexLock(mx);
eseg_free(sp); eseg_free(sp);
thread_MutexUnlock(mx);
} else { } else {
/* This is the oldest not acked segment. */ /* This is the oldest not acked segment. */
lp->np->link[lp->lix].lack = sp->head.lack; lp->np->link[lp->lix].lack = sp->head.lack;
...@@ -1437,6 +1450,7 @@ link_disconnect ( ...@@ -1437,6 +1450,7 @@ link_disconnect (
/* Empty window list */ /* Empty window list */
thread_MutexLock(&lp->eseg_mutex);
for ( for (
sp = lst_Succ(NULL, &lp->lh_win, NULL); sp = lst_Succ(NULL, &lp->lh_win, NULL);
sp != NULL; sp != NULL;
...@@ -1445,6 +1459,7 @@ link_disconnect ( ...@@ -1445,6 +1459,7 @@ link_disconnect (
lst_Remove(NULL, &sp->c.le); lst_Remove(NULL, &sp->c.le);
eseg_free(sp); eseg_free(sp);
} }
thread_MutexUnlock(&lp->eseg_mutex);
lp->np->link[lp->lix].win_count = 0; lp->np->link[lp->lix].win_count = 0;
...@@ -1544,6 +1559,7 @@ link_purge ( ...@@ -1544,6 +1559,7 @@ link_purge (
/* Purge send list */ /* Purge send list */
int i = 0; int i = 0;
thread_MutexUnlock(&lp->eseg_mutex);
for ( for (
sp = lst_Succ(NULL, &lp->lh_send, NULL); sp = lst_Succ(NULL, &lp->lh_send, NULL);
sp != NULL; sp != NULL;
...@@ -1560,6 +1576,7 @@ link_purge ( ...@@ -1560,6 +1576,7 @@ link_purge (
alloc_cnt += sp->size; alloc_cnt += sp->size;
i++; 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); 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_alloc_cnt = alloc_cnt;
lp->np->link[lp->lix].export_purge_cnt++; lp->np->link[lp->lix].export_purge_cnt++;
...@@ -1825,6 +1842,7 @@ new_link ( ...@@ -1825,6 +1842,7 @@ new_link (
lp->np->link[lp->lix].rtt_rxmax = rtt_rxmax; lp->np->link[lp->lix].rtt_rxmax = rtt_rxmax;
lp->np->link[lp->lix].rtt_rxmin = rtt_rxmin; lp->np->link[lp->lix].rtt_rxmin = rtt_rxmin;
lp->tmo.c.action = eAction_tmo; lp->tmo.c.action = eAction_tmo;
sts = thread_MutexInit(&lp->eseg_mutex);
if (mp != NULL) { if (mp != NULL) {
#if defined OS_VMS #if defined OS_VMS
...@@ -1901,11 +1919,15 @@ pending_send ( ...@@ -1901,11 +1919,15 @@ pending_send (
sLink *lp sLink *lp
) )
{ {
sEseg *sp;
if (lp->np->link[lp->lix].win_count >= lp->np->link[lp->lix].win_max) if (lp->np->link[lp->lix].win_count >= lp->np->link[lp->lix].win_max)
return NULL; 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 static void
......
This diff is collapsed.
...@@ -643,7 +643,8 @@ typedef pwr_tEnum pwr_tRedundancyStateEnum; ...@@ -643,7 +643,8 @@ typedef pwr_tEnum pwr_tRedundancyStateEnum;
typedef enum { typedef enum {
pwr_eRedundancyState_Off, pwr_eRedundancyState_Off,
pwr_eRedundancyState_Passive, pwr_eRedundancyState_Passive,
pwr_eRedundancyState_Active pwr_eRedundancyState_Active,
pwr_eRedundancyState_Init
} pwr_eRedundancyState; } pwr_eRedundancyState;
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
(p)->pre = (void *)(&(o)->e)) (p)->pre = (void *)(&(o)->e))
#define LstRem(p) ((p)->nex->pre = (p)->pre,(p)->pre->nex = (p)->nex) #define LstRem(p) ((p)->nex->pre = (p)->pre,(p)->pre->nex = (p)->nex)
#define LstNul(p) ((p)->nex = (p)->pre = NULL) #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 LstInl(p) ((p)->nex != NULL && (p)->pre != NULL)
#define LstIni(h) ((h)->nex = (h)->pre = (h)) #define LstIni(h) ((h)->nex = (h)->pre = (h))
#define LstObj(p) ((p)->obj) #define LstObj(p) ((p)->obj)
......
...@@ -113,10 +113,10 @@ static pwr_tStatus plc_redu_init( plc_sThread *tp) ...@@ -113,10 +113,10 @@ static pwr_tStatus plc_redu_init( plc_sThread *tp)
sts = redu_init( &tp->redu, tp->pp->Node, p); sts = redu_init( &tp->redu, tp->pp->Node, p);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
break; return PLC__SUCCESS;
} }
} }
return PLC__SUCCESS; return PLC__REDUCONFIG;
} }
static pwr_tStatus plc_redu_receive( plc_sThread *tp) static pwr_tStatus plc_redu_receive( plc_sThread *tp)
...@@ -138,8 +138,11 @@ 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); redu_free_table( tp->redu);
sts = redu_receive_table( tp->redu, msg); sts = redu_receive_table( tp->redu, msg);
if ( tp->redu->packetp)
tp->redu->packetp->TableStatus = sts;
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
tp->redu->table_sent = 1;
break; break;
case redu_eMsgType_Cyclic: case redu_eMsgType_Cyclic:
if ( tp->redu->packetp) if ( tp->redu->packetp)
...@@ -147,6 +150,69 @@ static pwr_tStatus plc_redu_receive( plc_sThread *tp) ...@@ -147,6 +150,69 @@ static pwr_tStatus plc_redu_receive( plc_sThread *tp)
sts = redu_unpack_message( tp->redu, msg); sts = redu_unpack_message( tp->redu, msg);
if ( EVEN(sts)) return sts; 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; break;
default: default:
printf( "Redu: Unknown message type\n"); printf( "Redu: Unknown message type\n");
...@@ -164,9 +230,13 @@ static pwr_tStatus plc_redu_send( plc_sThread *tp) ...@@ -164,9 +230,13 @@ static pwr_tStatus plc_redu_send( plc_sThread *tp)
void *table_msg; void *table_msg;
sts = redu_create_table( tp->redu); sts = redu_create_table( tp->redu);
if ( tp->redu->packetp)
tp->redu->packetp->TableStatus = sts;
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = redu_send_table( tp->redu, &table_msg); sts = redu_send_table( tp->redu, &table_msg);
if ( tp->redu->packetp)
tp->redu->packetp->TableStatus = sts;
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = redu_send( tp->redu, table_msg, sts = redu_send( tp->redu, table_msg,
...@@ -190,6 +260,21 @@ static pwr_tStatus plc_redu_send( plc_sThread *tp) ...@@ -190,6 +260,21 @@ static pwr_tStatus plc_redu_send( plc_sThread *tp)
return sts; 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 void
plc_thread ( plc_thread (
...@@ -479,6 +564,10 @@ scan ( ...@@ -479,6 +564,10 @@ scan (
} }
if ( tp->redu && tp->pp->Node->RedundancyState == pwr_eRedundancyState_Passive) { 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_GetTimeMonotonic(&tp->before_scan);
time_GetTime(&tp->before_scan_abs); time_GetTime(&tp->before_scan_abs);
...@@ -503,7 +592,7 @@ scan ( ...@@ -503,7 +592,7 @@ scan (
return; return;
} }
if ( tp->pp->Node->RedundancyState != pwr_eRedundancyState_Passive) { if ( !tp->redu || (tp->pp->Node->RedundancyState != pwr_eRedundancyState_Passive)) {
if (pp->IOHandler->IOReadWriteFlag) { if (pp->IOHandler->IOReadWriteFlag) {
if ( tp->redu_state_old == pwr_eRedundancyState_Passive) if ( tp->redu_state_old == pwr_eRedundancyState_Passive)
...@@ -555,6 +644,7 @@ scan ( ...@@ -555,6 +644,7 @@ scan (
} }
} }
if ( tp->redu && tp->pp->Node->RedundancyState == pwr_eRedundancyState_Active) { if ( tp->redu && tp->pp->Node->RedundancyState == pwr_eRedundancyState_Active) {
sts = plc_redu_receive_active( tp);
sts = plc_redu_send( tp); sts = plc_redu_send( tp);
} }
} }
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "rt_qcom.h" #include "rt_qcom.h"
#include "rt_qcom_msg.h" #include "rt_qcom_msg.h"
#include "rt_redu.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_object( redu_tCtx ctx, pwr_tAttrRef *o);
static pwr_tStatus add_table_attr( redu_tCtx ctx, pwr_tAttrRef *aref, gdh_sAttrDef *bd); 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) ...@@ -80,7 +81,7 @@ pwr_tStatus redu_create_table( redu_tCtx ctx)
} }
#endif #endif
return 1; return REDU__TABLECREATED;
} }
void redu_free( redu_tCtx ctx) void redu_free( redu_tCtx ctx)
...@@ -146,7 +147,7 @@ static pwr_tStatus add_table_object( redu_tCtx ctx, pwr_tAttrRef *o) ...@@ -146,7 +147,7 @@ static pwr_tStatus add_table_object( redu_tCtx ctx, pwr_tAttrRef *o)
o = &maref; o = &maref;
} }
else else
return 1; return REDU__SUCCESS;
sts = gdh_GetAttrRefTid( o, &tid); sts = gdh_GetAttrRefTid( o, &tid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -220,7 +221,7 @@ static pwr_tStatus add_table_object( redu_tCtx ctx, pwr_tAttrRef *o) ...@@ -220,7 +221,7 @@ static pwr_tStatus add_table_object( redu_tCtx ctx, pwr_tAttrRef *o)
if ( EVEN(sts)) return sts; 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) 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 ...@@ -234,7 +235,7 @@ static pwr_tStatus add_table_attr( redu_tCtx ctx, pwr_tAttrRef *aref, gdh_sAttrD
if ( aref->Flags.b.Indirect) { if ( aref->Flags.b.Indirect) {
if ( *(unsigned long *)p == 0) if ( *(unsigned long *)p == 0)
return 1; return REDU__SUCCESS;
p = gdh_TranslateRtdbPointer( *(unsigned long *)p); p = gdh_TranslateRtdbPointer( *(unsigned long *)p);
} }
...@@ -253,7 +254,14 @@ static pwr_tStatus add_table_attr( redu_tCtx ctx, pwr_tAttrRef *aref, gdh_sAttrD ...@@ -253,7 +254,14 @@ static pwr_tStatus add_table_attr( redu_tCtx ctx, pwr_tAttrRef *aref, gdh_sAttrD
ctx->current_offset += t->size; ctx->current_offset += t->size;
ctx->attr_cnt++; 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) pwr_tStatus redu_create_message( redu_tCtx ctx, void **msg)
...@@ -287,7 +295,7 @@ 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; ctx->packetp->PackTime = ctx->msg_time;
} }
*msg = buf; *msg = buf;
return 1; return REDU__SUCCESS;
} }
pwr_tStatus redu_unpack_message( redu_tCtx ctx, void *msg) pwr_tStatus redu_unpack_message( redu_tCtx ctx, void *msg)
...@@ -313,7 +321,7 @@ 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->ReceiveCnt++;
ctx->packetp->UnpackTime = ctx->msg_time; ctx->packetp->UnpackTime = ctx->msg_time;
} }
return 1; return REDU__SUCCESS;
} }
pwr_tStatus redu_send_table( redu_tCtx ctx, void **table_msg) 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) ...@@ -336,10 +344,12 @@ pwr_tStatus redu_send_table( redu_tCtx ctx, void **table_msg)
msgp += sizeof(redu_sTableMsgElement); msgp += sizeof(redu_sTableMsgElement);
} }
ctx->packetp->TablePacketSize = size; if ( ctx->packetp) {
ctx->packetp->Attributes = ctx->attr_cnt; ctx->packetp->TablePacketSize = size;
ctx->packetp->Attributes = ctx->attr_cnt;
}
*table_msg = msg; *table_msg = msg;
return 1; return REDU__TABLESENT;
} }
pwr_tStatus redu_receive_table( redu_tCtx ctx, void *table_msg) 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) ...@@ -386,7 +396,7 @@ pwr_tStatus redu_receive_table( redu_tCtx ctx, void *table_msg)
ctx->attr_cnt++; ctx->attr_cnt++;
msgp += sizeof(redu_sTableMsgElement); msgp += sizeof(redu_sTableMsgElement);
} }
return 1; return REDU__TABLERECEIVED;
} }
void redu_print_table( redu_tCtx ctx) void redu_print_table( redu_tCtx ctx)
...@@ -483,7 +493,7 @@ int redu_init( redu_tCtx *ctx, pwr_sNode *nodep, pwr_sClass_RedcomPacket *packet ...@@ -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.qix = redu_cQixExport;
c->send_qid.nid = 0; c->send_qid.nid = 0;
return 1; return REDU__SUCCESS;
} }
int redu_receive( redu_tCtx ctx, unsigned int timeout, int *size, void **msg) 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) ...@@ -524,7 +534,7 @@ pwr_tStatus redu_get_initial_state( char *nodename, int busid, int *state)
dcli_translate_filename( fname, fname); dcli_translate_filename( fname, fname);
fp = fopen( fname, "r"); fp = fopen( fname, "r");
if ( !fp) if ( !fp)
return 0; return REDU__REDCOMFILE;
while ((s = fgets(buffer, sizeof(buffer) - 1, fp)) != NULL) { 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) ...@@ -539,14 +549,15 @@ pwr_tStatus redu_get_initial_state( char *nodename, int busid, int *state)
if ( strcmp( name, nodename) == 0) { if ( strcmp( name, nodename) == 0) {
local_found = 1; local_found = 1;
*state = atoi(s_state); // *state = atoi(s_state);
*state = pwr_eRedundancyState_Init;
break; break;
} }
} }
fclose( fp); fclose( fp);
if ( !local_found) if ( !local_found)
return 0; return REDU__LOCALNODE;
return 1; return REDU__SUCCESS;
} }
...@@ -66,10 +66,12 @@ extern "C" { ...@@ -66,10 +66,12 @@ extern "C" {
typedef enum { typedef enum {
redu_eMsgType_Table, redu_eMsgType_Table,
redu_eMsgType_Cyclic redu_eMsgType_Cyclic,
redu_eMsgType_TableRequest
} redu_eMsgType; } redu_eMsgType;
typedef enum { typedef enum {
redu_ePrio_0 = 0,
redu_ePrio_1 = 1, redu_ePrio_1 = 1,
redu_ePrio_2 = 2, redu_ePrio_2 = 2,
redu_ePrio_3 = 3, redu_ePrio_3 = 3,
...@@ -136,6 +138,7 @@ pwr_tStatus redu_create_message( redu_tCtx ctx, void **msg); ...@@ -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_unpack_message( redu_tCtx ctx, void *msg);
pwr_tStatus redu_receive_table( redu_tCtx ctx, void *table_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_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_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_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); int redu_receive( redu_tCtx ctx, unsigned int timeout, int *size, void **msg);
......
...@@ -72,5 +72,6 @@ ininstep <initialize init steps> /error ...@@ -72,5 +72,6 @@ ininstep <initialize init steps> /error
iostalled <IO stalled, cyclesup delay detected> /fatal iostalled <IO stalled, cyclesup delay detected> /fatal
ioread <IO stalled, io read error> /fatal ioread <IO stalled, io read error> /fatal
iowrite <IO stalled, io write 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 .end
!
! 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
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
24 PROC 24 PROC
25 SEV 25 SEV
26 SIM 26 SIM
27 REDU
50 HD 50 HD
100 CDH 100 CDH
101 NDC 101 NDC
......
...@@ -184,7 +184,7 @@ SObject pwrb:Class ...@@ -184,7 +184,7 @@ SObject pwrb:Class
!/** !/**
! Disable. ! Disable.
!*/ !*/
Object Disable $Attribute 14 Object Disable $Attribute 15
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
......
...@@ -172,6 +172,7 @@ SObject pwrb:Class ...@@ -172,6 +172,7 @@ SObject pwrb:Class
Attr PgmName = "Action" Attr PgmName = "Action"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "act" Attr GraphName = "act"
EndBody EndBody
...@@ -189,6 +190,7 @@ SObject pwrb:Class ...@@ -189,6 +190,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "ack" Attr GraphName = "ack"
EndBody EndBody
EndObject EndObject
...@@ -209,6 +211,7 @@ SObject pwrb:Class ...@@ -209,6 +211,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "blk" Attr GraphName = "blk"
EndBody EndBody
EndObject EndObject
...@@ -401,6 +404,7 @@ SObject pwrb:Class ...@@ -401,6 +404,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -412,6 +416,7 @@ SObject pwrb:Class ...@@ -412,6 +416,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -425,6 +430,7 @@ SObject pwrb:Class ...@@ -425,6 +430,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -438,6 +444,7 @@ SObject pwrb:Class ...@@ -438,6 +444,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -449,6 +456,7 @@ SObject pwrb:Class ...@@ -449,6 +456,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -462,6 +470,7 @@ SObject pwrb:Class ...@@ -462,6 +470,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -475,6 +484,7 @@ SObject pwrb:Class ...@@ -475,6 +484,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -487,6 +497,7 @@ SObject pwrb:Class ...@@ -487,6 +497,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -499,6 +510,7 @@ SObject pwrb:Class ...@@ -499,6 +510,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -565,6 +577,7 @@ SObject pwrb:Class ...@@ -565,6 +577,7 @@ SObject pwrb:Class
Body SysBody Body SysBody
Attr PgmName = "High" Attr PgmName = "High"
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -590,6 +603,7 @@ SObject pwrb:Class ...@@ -590,6 +603,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag" Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
...@@ -614,6 +628,7 @@ SObject pwrb:Class ...@@ -614,6 +628,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount" Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
EndBody EndBody
EndObject EndObject
......
...@@ -166,6 +166,7 @@ SObject pwrb:Class ...@@ -166,6 +166,7 @@ SObject pwrb:Class
Attr PgmName = "Action" Attr PgmName = "Action"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
...@@ -182,6 +183,7 @@ SObject pwrb:Class ...@@ -182,6 +183,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -201,6 +203,7 @@ SObject pwrb:Class ...@@ -201,6 +203,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
! ++ ! ++
...@@ -228,6 +231,7 @@ SObject pwrb:Class ...@@ -228,6 +231,7 @@ SObject pwrb:Class
Body SysBody Body SysBody
Attr PgmName = "DetectOn" Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -383,6 +387,7 @@ SObject pwrb:Class ...@@ -383,6 +387,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -394,6 +399,7 @@ SObject pwrb:Class ...@@ -394,6 +399,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -407,6 +413,7 @@ SObject pwrb:Class ...@@ -407,6 +413,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -420,6 +427,7 @@ SObject pwrb:Class ...@@ -420,6 +427,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -431,6 +439,7 @@ SObject pwrb:Class ...@@ -431,6 +439,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -444,6 +453,7 @@ SObject pwrb:Class ...@@ -444,6 +453,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -457,6 +467,7 @@ SObject pwrb:Class ...@@ -457,6 +467,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -469,6 +480,7 @@ SObject pwrb:Class ...@@ -469,6 +480,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -481,6 +493,7 @@ SObject pwrb:Class ...@@ -481,6 +493,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -572,6 +585,7 @@ SObject pwrb:Class ...@@ -572,6 +585,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag" Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
...@@ -596,6 +610,7 @@ SObject pwrb:Class ...@@ -596,6 +610,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount" Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
EndBody EndBody
EndObject EndObject
......
...@@ -175,6 +175,7 @@ SObject pwrb:Class ...@@ -175,6 +175,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "act" Attr GraphName = "act"
EndBody EndBody
EndObject EndObject
...@@ -190,6 +191,7 @@ SObject pwrb:Class ...@@ -190,6 +191,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "ack" Attr GraphName = "ack"
EndBody EndBody
EndObject EndObject
...@@ -211,6 +213,7 @@ SObject pwrb:Class ...@@ -211,6 +213,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr GraphName = "blk" Attr GraphName = "blk"
EndBody EndBody
EndObject EndObject
...@@ -239,6 +242,7 @@ SObject pwrb:Class ...@@ -239,6 +242,7 @@ SObject pwrb:Class
Body SysBody Body SysBody
Attr PgmName = "DetectOn" Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -397,6 +401,7 @@ SObject pwrb:Class ...@@ -397,6 +401,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -408,6 +413,7 @@ SObject pwrb:Class ...@@ -408,6 +413,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -421,6 +427,7 @@ SObject pwrb:Class ...@@ -421,6 +427,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -434,6 +441,7 @@ SObject pwrb:Class ...@@ -434,6 +441,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -445,6 +453,7 @@ SObject pwrb:Class ...@@ -445,6 +453,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -458,6 +467,7 @@ SObject pwrb:Class ...@@ -458,6 +467,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -471,6 +481,7 @@ SObject pwrb:Class ...@@ -471,6 +481,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -483,6 +494,7 @@ SObject pwrb:Class ...@@ -483,6 +494,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -495,6 +507,7 @@ SObject pwrb:Class ...@@ -495,6 +507,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -554,6 +567,7 @@ SObject pwrb:Class ...@@ -554,6 +567,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag" Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
...@@ -578,6 +592,7 @@ SObject pwrb:Class ...@@ -578,6 +592,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount" Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
EndBody EndBody
EndObject EndObject
......
...@@ -168,6 +168,7 @@ SObject pwrb:Class ...@@ -168,6 +168,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -182,6 +183,7 @@ SObject pwrb:Class ...@@ -182,6 +183,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -202,6 +204,7 @@ SObject pwrb:Class ...@@ -202,6 +204,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
! ++ ! ++
...@@ -229,6 +232,7 @@ SObject pwrb:Class ...@@ -229,6 +232,7 @@ SObject pwrb:Class
Body SysBody Body SysBody
Attr PgmName = "DetectOn" Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -380,6 +384,7 @@ SObject pwrb:Class ...@@ -380,6 +384,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -391,6 +396,7 @@ SObject pwrb:Class ...@@ -391,6 +396,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -404,6 +410,7 @@ SObject pwrb:Class ...@@ -404,6 +410,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -417,6 +424,7 @@ SObject pwrb:Class ...@@ -417,6 +424,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -428,6 +436,7 @@ SObject pwrb:Class ...@@ -428,6 +436,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -441,6 +450,7 @@ SObject pwrb:Class ...@@ -441,6 +450,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -454,6 +464,7 @@ SObject pwrb:Class ...@@ -454,6 +464,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -466,6 +477,7 @@ SObject pwrb:Class ...@@ -466,6 +477,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -478,6 +490,7 @@ SObject pwrb:Class ...@@ -478,6 +490,7 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Time" Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -537,6 +550,7 @@ SObject pwrb:Class ...@@ -537,6 +550,7 @@ SObject pwrb:Class
Attr PgmName = "TimerFlag" Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
...@@ -561,6 +575,7 @@ SObject pwrb:Class ...@@ -561,6 +575,7 @@ SObject pwrb:Class
Attr PgmName = "TimerCount" Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_REDUTRANSFER
Attr TypeRef = "pwrs:Type-$UInt32" Attr TypeRef = "pwrs:Type-$UInt32"
EndBody EndBody
EndObject EndObject
...@@ -590,6 +605,7 @@ SObject pwrb:Class ...@@ -590,6 +605,7 @@ SObject pwrb:Class
Body SysBody Body SysBody
Attr PgmName = "TimerTime" Attr PgmName = "TimerTime"
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_REDUTRANSFER
EndBody EndBody
EndObject EndObject
!/** !/**
......
...@@ -64,7 +64,7 @@ SObject pwrb:Class ...@@ -64,7 +64,7 @@ SObject pwrb:Class
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_RTVIRTUAL Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_DEVBODYREF Attr Flags |= PWR_MASK_DEVBODYREF
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Int32"
Attr GraphName = "val" Attr GraphName = "val"
EndBody EndBody
EndObject EndObject
......
...@@ -68,33 +68,60 @@ SObject pwrb:Class ...@@ -68,33 +68,60 @@ SObject pwrb:Class
EndBody EndBody
EndObject 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. ! Set redundancy state Active.
!*/ !*/
Object SetActive $Attribute 3 Object SetActive $Attribute 5
Body SysBody Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
!/** !/**
! Set redundancy state Passive. ! Set redundancy state Passive.
!*/ !*/
Object SetPassive $Attribute 4 Object SetPassive $Attribute 6
Body SysBody Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
!/** !/**
! Set redundancy state Off. ! Set redundancy state Off.
!*/ !*/
Object SetOff $Attribute 5 Object SetOff $Attribute 7
Body SysBody Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
!/** !/**
! Link state. ! Link state.
!*/ !*/
Object Link $Attribute 6 Object Link $Attribute 8
Body SysBody Body SysBody
Attr Flags |= PWR_MASK_ARRAY Attr Flags |= PWR_MASK_ARRAY
Attr Flags |= PWR_MASK_CLASS Attr Flags |= PWR_MASK_CLASS
...@@ -106,6 +133,7 @@ SObject pwrb:Class ...@@ -106,6 +133,7 @@ SObject pwrb:Class
Object Template RedcomConfig Object Template RedcomConfig
Body RtBody Body RtBody
Attr CycleTime = 0.005 Attr CycleTime = 0.005
Attr LinkTimeout = 0.200
EndBody EndBody
EndObject EndObject
EndObject EndObject
......
...@@ -118,6 +118,16 @@ SObject pwrb:Class ...@@ -118,6 +118,16 @@ SObject pwrb:Class
EndBody EndBody
EndObject 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. ! Number of attributes.
!*/ !*/
Object Attributes $Attribute 8 Object Attributes $Attribute 8
......
...@@ -76,6 +76,16 @@ SObject pwrs:Type ...@@ -76,6 +76,16 @@ SObject pwrs:Type
Attr Value = 2 Attr Value = 2
EndBody EndBody
EndObject EndObject
!/**
! Initialization.
!*/
Object Init $Value
Body SysBody
Attr PgmName = "Init"
Attr Text = "Init"
Attr Value = 3
EndBody
EndObject
EndObject EndObject
EndSObject EndSObject
......
...@@ -3610,9 +3610,11 @@ int gcg_get_outputstring ( ...@@ -3610,9 +3610,11 @@ int gcg_get_outputstring (
} }
/* Check that the object is not in a library hierarchy */ /* Check that the object is not in a library hierarchy */
if ( gcg_in_libhier( gcgctx, *objdid)) { if ( gcg_in_libhier( gcgctx, *objdid)) {
gcg_error_msg( gcgctx, GSX__LIBREF, output_node); if ( !gcg_in_libhier( gcgctx, output_node->ln.oid)) {
free((char *) objdid); gcg_error_msg( gcgctx, GSX__LIBREF, output_node);
return GSX__NEXTPAR; free((char *) objdid);
return GSX__NEXTPAR;
}
} }
strcpy( parstring, strcpy( parstring,
...@@ -3650,9 +3652,11 @@ int gcg_get_outputstring ( ...@@ -3650,9 +3652,11 @@ int gcg_get_outputstring (
} }
/* Check that object is not in a library hierarchy */ /* Check that object is not in a library hierarchy */
if ( gcg_in_libhier( gcgctx, attrref->Objid)) { if ( gcg_in_libhier( gcgctx, attrref->Objid)) {
gcg_error_msg( gcgctx, GSX__LIBREF, output_node); if ( !gcg_in_libhier( gcgctx, output_node->ln.oid)) {
free((char *) attrref); gcg_error_msg( gcgctx, GSX__LIBREF, output_node);
return GSX__NEXTPAR; free((char *) attrref);
return GSX__NEXTPAR;
}
} }
strcpy( parstring, strcpy( parstring,
...@@ -3780,9 +3784,11 @@ static int gcg_get_outputstring_spec( ...@@ -3780,9 +3784,11 @@ static int gcg_get_outputstring_spec(
} }
/* Check that the object is not in a library hierarchy */ /* Check that the object is not in a library hierarchy */
if ( gcg_in_libhier( gcgctx, attrref->Objid)) { if ( gcg_in_libhier( gcgctx, attrref->Objid)) {
gcg_error_msg( gcgctx, GSX__LIBREF, output_node); if ( !gcg_in_libhier( gcgctx, output_node->ln.oid)) {
free((char *) attrref); gcg_error_msg( gcgctx, GSX__LIBREF, output_node);
return GSX__NEXTPAR; free((char *) attrref);
return GSX__NEXTPAR;
}
} }
/* Get the attribute name of last segment */ /* Get the attribute name of last segment */
...@@ -3842,9 +3848,11 @@ static int gcg_get_outputstring_spec( ...@@ -3842,9 +3848,11 @@ static int gcg_get_outputstring_spec(
} }
/* Check that the object is not in a library hierarchy */ /* Check that the object is not in a library hierarchy */
if ( gcg_in_libhier( gcgctx, attrref->Objid)) { if ( gcg_in_libhier( gcgctx, attrref->Objid)) {
gcg_error_msg( gcgctx, GSX__LIBREF, output_node); if ( !gcg_in_libhier( gcgctx, output_node->ln.oid)) {
free((char *) attrref); gcg_error_msg( gcgctx, GSX__LIBREF, output_node);
return GSX__NEXTPAR; free((char *) attrref);
return GSX__NEXTPAR;
}
} }
strcpy( parstring, strcpy( parstring,
...@@ -3895,9 +3903,11 @@ static int gcg_get_outputstring_spec( ...@@ -3895,9 +3903,11 @@ static int gcg_get_outputstring_spec(
} }
/* Check that the object is not in a library hierarchy */ /* Check that the object is not in a library hierarchy */
if ( gcg_in_libhier( gcgctx, attrref->Objid)) { if ( gcg_in_libhier( gcgctx, attrref->Objid)) {
gcg_error_msg( gcgctx, GSX__LIBREF, output_node); if ( !gcg_in_libhier( gcgctx, output_node->ln.oid)) {
free((char *) attrref); gcg_error_msg( gcgctx, GSX__LIBREF, output_node);
return GSX__NEXTPAR; free((char *) attrref);
return GSX__NEXTPAR;
}
} }
/* Get the attribute name of last segment */ /* Get the attribute name of last segment */
...@@ -3998,9 +4008,11 @@ static int gcg_get_outputstring_spec( ...@@ -3998,9 +4008,11 @@ static int gcg_get_outputstring_spec(
} }
/* Check that the object is not in a library hierarchy */ /* Check that the object is not in a library hierarchy */
if ( gcg_in_libhier( gcgctx, attrref->Objid)) { if ( gcg_in_libhier( gcgctx, attrref->Objid)) {
gcg_error_msg( gcgctx, GSX__LIBREF, output_node); if ( !gcg_in_libhier( gcgctx, output_node->ln.oid)) {
free((char *) attrref); gcg_error_msg( gcgctx, GSX__LIBREF, output_node);
return GSX__NEXTPAR; free((char *) attrref);
return GSX__NEXTPAR;
}
} }
/* Check if DisableAttr is present */ /* Check if DisableAttr is present */
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
117 0 117 0
118 134 118 134
119 112 119 112
120 1 120 0
121 Claes context 121 Claes context
122 0 122 0
126 0.5 126 0.5
...@@ -7391,12 +7391,21 @@ pwr_exe: ...@@ -7391,12 +7391,21 @@ pwr_exe:
102 35454972 102 35454972
103 0 103 0
61 61
6100
6101 3
6102 4
6103 470
6104 2
6105 1
6106 0
99
61
6100 $node.RedundancyState##Int32 6100 $node.RedundancyState##Int32
6101 2 6101 2
6102 4 6102 4
6103 410 6103 410
6104 1 6104 1
6105 1 6105 3
6106 0 6106 0
99 99
12 12
......
...@@ -766,6 +766,7 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP) ...@@ -766,6 +766,7 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP)
brow_GetObjectList( ev->ala->browbase->ctx, &object_list, &object_cnt); brow_GetObjectList( ev->ala->browbase->ctx, &object_list, &object_cnt);
ev->ala->size = object_cnt;
// Reset check to find obsolete items // Reset check to find obsolete items
for ( i = 0; i < object_cnt; i++) { for ( i = 0; i < object_cnt; i++) {
...@@ -839,6 +840,7 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP) ...@@ -839,6 +840,7 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP)
case evlist_eItemType_Alarm: case evlist_eItemType_Alarm:
if ( MsgP->Nix == item->eventid.Nix && !item->check) { if ( MsgP->Nix == item->eventid.Nix && !item->check) {
ev->ala->event_delete( &item->eventid); 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++) for ( int k = 0; k < ev->sala_cnt; k++)
ev->sala[k]->event_delete( &item->eventid); ev->sala[k]->event_delete( &item->eventid);
i--; i--;
......
...@@ -924,6 +924,8 @@ void EvList::event_alarm( mh_sMessage *msg) ...@@ -924,6 +924,8 @@ void EvList::event_alarm( mh_sMessage *msg)
ItemAlarm *dest; ItemAlarm *dest;
flow_eDest dest_code; flow_eDest dest_code;
brow_tNode dest_node; brow_tNode dest_node;
ItemAlarm *item;
if ( type == ev_eType_AlarmList ) { if ( type == ev_eType_AlarmList ) {
if ( !( msg->Status & mh_mEventStatus_NotAck || if ( !( msg->Status & mh_mEventStatus_NotAck ||
...@@ -931,12 +933,18 @@ void EvList::event_alarm( mh_sMessage *msg) ...@@ -931,12 +933,18 @@ void EvList::event_alarm( mh_sMessage *msg)
return; return;
// Check that this id not already inserted // Check that this id not already inserted
ItemAlarm *item;
if ( id_to_item( &event->Info.Id, (void **)&item)) if ( id_to_item( &event->Info.Id, (void **)&item))
return; return;
} }
if ( type != ev_eType_HistList ) { 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); sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) { if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast; dest_code = flow_eDest_IntoLast;
...@@ -952,7 +960,7 @@ void EvList::event_alarm( mh_sMessage *msg) ...@@ -952,7 +960,7 @@ void EvList::event_alarm( mh_sMessage *msg)
dest_node = NULL; dest_node = NULL;
} }
ItemAlarm *item = new ItemAlarm( this, "Alarm", item = new ItemAlarm( this, "Alarm",
net_NetTimeToTime( &event->Info.EventTime), event->Msg.EventText, net_NetTimeToTime( &event->Info.EventTime), event->Msg.EventText,
event->Msg.EventName, event->Info.EventType, event->Info.EventFlags, event->Msg.EventName, event->Info.EventType, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id, event->Info.EventPrio, event->Info.Id,
...@@ -1129,11 +1137,17 @@ void EvList::event_ack( mh_sAck *msg) ...@@ -1129,11 +1137,17 @@ void EvList::event_ack( mh_sAck *msg)
ala_uEvent *event = (ala_uEvent *) msg; ala_uEvent *event = (ala_uEvent *) msg;
int sts; int sts;
ItemAlarm *dest; ItemAlarm *dest;
ItemAlarm *item;
flow_eDest dest_code; flow_eDest dest_code;
brow_tNode dest_node; brow_tNode dest_node;
if ( type == ev_eType_EventList || type == ev_eType_HistList) { if ( type == ev_eType_EventList || type == ev_eType_HistList) {
if(type == ev_eType_EventList) { 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); sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) { if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast; dest_code = flow_eDest_IntoLast;
...@@ -1217,11 +1231,17 @@ void EvList::event_return( mh_sReturn *msg) ...@@ -1217,11 +1231,17 @@ void EvList::event_return( mh_sReturn *msg)
ala_uEvent *event = (ala_uEvent *) msg; ala_uEvent *event = (ala_uEvent *) msg;
int sts; int sts;
ItemAlarm *dest; ItemAlarm *dest;
ItemAlarm *item;
flow_eDest dest_code; flow_eDest dest_code;
brow_tNode dest_node; brow_tNode dest_node;
if ( type == ev_eType_EventList || type == ev_eType_HistList) { if ( type == ev_eType_EventList || type == ev_eType_HistList) {
if(type == ev_eType_EventList) { 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); sts = get_destination( net_NetTimeToTime( &event->Info.EventTime), (void **)&dest);
if ( EVEN(sts)) { if ( EVEN(sts)) {
dest_code = flow_eDest_IntoLast; dest_code = flow_eDest_IntoLast;
...@@ -1920,17 +1940,21 @@ ItemAlarm::ItemAlarm( EvList *item_evlist, const char *item_name, pwr_tTime item ...@@ -1920,17 +1940,21 @@ ItemAlarm::ItemAlarm( EvList *item_evlist, const char *item_name, pwr_tTime item
sts = brow_GetLast( evlist->browbase->ctx, &last_node); sts = brow_GetLast( evlist->browbase->ctx, &last_node);
if ( ODD(sts)) if ( ODD(sts))
{ {
if ( node == last_node) if ( node == last_node)
// I'm deleting myself // I'm deleting myself
*rsts = 0; *rsts = 0;
brow_GetUserData( last_node, (void **)&item); 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); brow_DeleteNode( evlist->browbase->ctx, last_node);
if ( item->type == evlist_eItemType_Alarm && evlist->browtree) { if ( item_type == evlist_eItemType_Alarm && item_evlist->browtree) {
if ( item->tree_node) if ( tree_node)
brow_DeleteNode( evlist->browtree->ctx, item->tree_node); brow_DeleteNode( item_evlist->browtree->ctx, tree_node);
evlist->view_configure(); item_evlist->view_configure();
} }
// Note! This ItemAlarm might be deleted by now if node == last_node // 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) ...@@ -2784,8 +2808,7 @@ int EvList::id_to_item( mh_sEventId *id, void **item)
brow_GetUserData( object_list[i], (void **)&object_item); brow_GetUserData( object_list[i], (void **)&object_item);
switch( object_item->type) { switch( object_item->type) {
case evlist_eItemType_Alarm: case evlist_eItemType_Alarm:
if ( memcmp( &object_item->eventid, id, sizeof(object_item->eventid)) if ( object_item->eventid.Idx == id->Idx && object_item->eventid.Nix == id->Nix) {
== 0) {
*item = (void *)object_item; *item = (void *)object_item;
return 1; return 1;
} }
......
...@@ -295,8 +295,19 @@ int XNav::show_nethandler() ...@@ -295,8 +295,19 @@ int XNav::show_nethandler()
t.elem_cnt = 0; t.elem_cnt = 0;
// Node name // Node name
strcpy( t.elem[t.elem_cnt].fix_str, np->name); //strcpy( t.elem[t.elem_cnt].fix_str, np->name);
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr; //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 // Os
switch ( np->hw) { switch ( np->hw) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment