Commit 697825c4 authored by Claes Sjofors's avatar Claes Sjofors

Xtt, satellite alarm list delete alarm fix

parent 1a0e4470
...@@ -631,6 +631,15 @@ pwr_tStatus Ev::mh_ack_bc( mh_sAck *MsgP) ...@@ -631,6 +631,15 @@ pwr_tStatus Ev::mh_ack_bc( mh_sAck *MsgP)
pwr_tStatus Ev::mh_return_bc( mh_sReturn *MsgP) pwr_tStatus Ev::mh_return_bc( mh_sReturn *MsgP)
{ {
// Test
static int test = 0;
if ( test == 11) {
test = 0;
return 1;
}
test++;
// End test
if ( ev->eve_display_return) if ( ev->eve_display_return)
{ {
// Insert in eve // Insert in eve
...@@ -651,6 +660,15 @@ pwr_tStatus Ev::mh_return_bc( mh_sReturn *MsgP) ...@@ -651,6 +660,15 @@ pwr_tStatus Ev::mh_return_bc( mh_sReturn *MsgP)
pwr_tStatus Ev::mh_alarm_bc( mh_sMessage *MsgP) pwr_tStatus Ev::mh_alarm_bc( mh_sMessage *MsgP)
{ {
// Test
static int test = 0;
if ( test == 9) {
test = 0;
return 1;
}
test++;
// End test
ev->eve->event_alarm( MsgP); ev->eve->event_alarm( MsgP);
for ( int i = 0; i < ev->seve_cnt; i++) for ( int i = 0; i < ev->seve_cnt; i++)
ev->seve[i]->mh_alarm( MsgP); ev->seve[i]->mh_alarm( MsgP);
...@@ -839,9 +857,12 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP) ...@@ -839,9 +857,12 @@ pwr_tStatus Ev::mh_alarmstatus_bc( mh_sAlarmStatus *MsgP)
switch( item->type) { switch( item->type) {
case evlist_eItemType_Alarm: case evlist_eItemType_Alarm:
if ( MsgP->Nix == item->eventid.Nix && !item->check) { if ( MsgP->Nix == item->eventid.Nix && !item->check) {
mh_sEventId eventid = item->eventid;
ev->ala->event_delete( &item->eventid); ev->ala->event_delete( &item->eventid);
// Note, item is now deleted
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( &eventid);
i--; i--;
object_cnt--; object_cnt--;
modified = 1; modified = 1;
...@@ -928,4 +949,4 @@ void Ev::view_shift() ...@@ -928,4 +949,4 @@ void Ev::view_shift()
} }
} }
} }
} }
\ No newline at end of file
...@@ -1314,21 +1314,18 @@ int EvList::event_delete( mh_sEventId *id) ...@@ -1314,21 +1314,18 @@ int EvList::event_delete( mh_sEventId *id)
if ( type == ev_eType_AlarmList) { if ( type == ev_eType_AlarmList) {
// Alarmlist // Alarmlist
ItemAlarm *item; ItemAlarm *item;
brow_tObject item_tree_node;
if ( !id_to_item( id, (void **)&item)) if ( !id_to_item( id, (void **)&item))
return 0; return 0;
item_tree_node = item->tree_node;
brow_DeleteNode( browbase->ctx, item->node);
// Note, item is deleted now
if ( browtree) { if ( browtree) {
if ( item_tree_node) if ( item->tree_node)
brow_DeleteNode( browtree->ctx, item_tree_node); brow_DeleteNode( browtree->ctx, item->tree_node);
view_configure(); view_configure();
} }
brow_DeleteNode( browbase->ctx, item->node);
size--; size--;
} }
return 1; return 1;
...@@ -1558,10 +1555,10 @@ int EvList::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1558,10 +1555,10 @@ int EvList::brow_cb( FlowCtx *ctx, flow_tEvent event)
EvList *evlist; EvList *evlist;
ItemAlarm *item; ItemAlarm *item;
if ( event->event == flow_eEvent_ObjectDeleted) if ( event->event == flow_eEvent_ObjectDeleted) {
{ ItemEvBase *ditem;
brow_GetUserData( event->object.object, (void **)&item); brow_GetUserData( event->object.object, (void **)&ditem);
delete item; delete ditem;
return 1; return 1;
} }
...@@ -3290,4 +3287,4 @@ static unsigned int prio_enum_to_mask( unsigned int prio) ...@@ -3290,4 +3287,4 @@ static unsigned int prio_enum_to_mask( unsigned int prio)
return pwr_mEventPrioMask_D; return pwr_mEventPrioMask_D;
} }
return 0; return 0;
} }
\ No newline at end of file
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