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

Redundance communication 3

parent ab6bf4ff
......@@ -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
......
This diff is collapsed.
......@@ -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
......
This diff is collapsed.
......@@ -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;
......
......@@ -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)
......
......@@ -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);
}
}
......
......@@ -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;
}
......@@ -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);
......
......@@ -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
!
! 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 @@
24 PROC
25 SEV
26 SIM
27 REDU
50 HD
100 CDH
101 NDC
......
......@@ -184,7 +184,7 @@ SObject pwrb:Class
!/**
! Disable.
!*/
Object Disable $Attribute 14
Object Disable $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
!/**
......
......@@ -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-$Float32"
Attr TypeRef = "pwrs:Type-$Int32"
Attr GraphName = "val"
EndBody
EndObject
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
......
......@@ -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
......
......@@ -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--;
......
......@@ -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;
}
......
......@@ -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) {
......
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