Commit 9c928b59 authored by Claes Sjofors's avatar Claes Sjofors

Emon, only info messages with InfoWindow is displayed in op window and alarm list

parent c06cda96
......@@ -1119,7 +1119,7 @@ applReturn (
updateAlarm(ap, ep);
break;
case mh_eEvent_Info:
if ((aap->link.eventFlags & mh_mEventFlags_InfoWindow) != 0)
if (aap->link.eventFlags & mh_mEventFlags_InfoWindow)
updateAlarm(ap, ep);
break;
default:
......@@ -1282,8 +1282,14 @@ sendAlarmStatus( sOutunit *op)
ep = ap->detect_etp->ep;
if ( ap->detect_etp->event == mh_eEvent_Info && !(ep->msg.info.EventFlags & mh_mEventFlags_Ack))
break;
if ( ap->detect_etp->event == mh_eEvent_Info) {
if ( !(ep->msg.info.EventFlags & mh_mEventFlags_InfoWindow))
break;
if ( ep->msg.info.EventFlags & mh_mEventFlags_InfoWindow &&
( !(ep->msg.info.EventFlags & mh_mEventFlags_Ack) ||
!(ep->msg.info.EventFlags & mh_mEventFlags_Return)))
break;
}
if ( ep)
is_for_outunit = isForOutunit(op, ep->outunit, ep->object.Objid, ep->objName, ep->msg.info.EventFlags,
......@@ -1319,8 +1325,14 @@ sendAlarmStatus( sOutunit *op)
ep = ap->detect_etp->ep;
if ( ap->detect_etp->event == mh_eEvent_Info && !(ep->msg.info.EventFlags & mh_mEventFlags_Ack))
break;
if ( ap->detect_etp->event == mh_eEvent_Info) {
if ( !(ep->msg.info.EventFlags & mh_mEventFlags_InfoWindow))
break;
if ( ep->msg.info.EventFlags & mh_mEventFlags_InfoWindow &&
( !(ep->msg.info.EventFlags & mh_mEventFlags_Ack) ||
!(ep->msg.info.EventFlags & mh_mEventFlags_Return)))
break;
}
if ( ep)
is_for_outunit = isForOutunit(op, ep->outunit, ep->object.Objid, ep->objName, ep->msg.info.EventFlags,
......@@ -2478,8 +2490,13 @@ handleInfo (
{
sEvent *ep;
if (sp->link.eventFlags & mh_mEventFlags_InfoWindow) {
sp->link.eventFlags |= mh_mEventFlags_Ack;
sp->link.eventFlags |= mh_mEventFlags_Return;
}
ep = eventListInsert(mh_eEvent_Info, NULL, (sActive*) sp);
if ((sp->link.eventFlags & mh_mEventFlags_InfoWindow) != 0) {
if (sp->link.eventFlags & mh_mEventFlags_InfoWindow) {
activeListInsert((sActive *) sp, ep, mh_eSource_Scanner);
updateAlarm((sActive *) sp, ep);
}
......@@ -2531,30 +2548,6 @@ handleReturn (
{
sEvent *ep;
if ( sp->link.event == mh_eEvent_Info &&
!(sp->link.eventFlags & mh_mEventFlags_Ack) &&
!(sp->link.eventFlags & mh_mEventFlags_Return)) {
/* Remove without adding event */
sActive *ap = (sActive *)sp;
ap->status.All = 0;
updateAlarmInfo(ap);
if (ap->source == mh_eSource_Scanner) {
sp->sup->DetectCheck = TRUE; /* Activate detection */
sp->sup->AlarmCheck = TRUE; /* Activate alarm supervision */
sp->sup->AlarmStatus.All = ap->status.All;
if (sp->supType == mh_eSupType_Cycle) {
pwr_sClass_CycleSup *cp = (pwr_sClass_CycleSup *) sp->op;
cp->DelayNoted = FALSE;
cp->Delayed = FALSE;
}
}
activeListRemove(ap);
return;
}
ep = eventListInsert(mh_eEvent_Return, NULL, (sActive*) sp);
switch (sp->link.event) {
case mh_eEvent_Alarm:
case mh_eEvent_MaintenanceAlarm:
......@@ -2563,12 +2556,16 @@ handleReturn (
case mh_eEvent_UserAlarm2:
case mh_eEvent_UserAlarm3:
case mh_eEvent_UserAlarm4:
ep = eventListInsert(mh_eEvent_Return, NULL, (sActive*) sp);
updateAlarm((sActive *) sp, ep);
break;
case mh_eEvent_Info:
if ((sp->link.eventFlags & mh_mEventFlags_InfoWindow) != 0) {
if (sp->link.eventFlags & mh_mEventFlags_InfoWindow) {
ep = eventListInsert(mh_eEvent_Return, NULL, (sActive*) sp);
updateAlarm((sActive *) sp, ep);
} else {
if ( sp->link.eventFlags & mh_mEventFlags_Return)
ep = eventListInsert(mh_eEvent_Return, NULL, (sActive*) sp);
sp->sup->DetectCheck = TRUE; /* Activate detection */
sp->sup->AlarmCheck = TRUE; /* Activate alarm supervision */
}
......@@ -4556,13 +4553,13 @@ updateAlarm (
if (ap->source == mh_eSource_Scanner) {
ap->status.Event.Prio = sp->sup->EventPriority;
if (sp->sup->EventFlags & mh_mEventFlags_Returned)
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
} else {
ap->status.Event.Prio = aap->message.EventPrio;
if (aap->message.EventFlags & mh_mEventFlags_Returned)
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
}
ep->msg.message.Status = ap->status.All;
break;
case mh_eEvent_Info:
......@@ -4571,11 +4568,11 @@ updateAlarm (
if (ap->source == mh_eSource_Scanner) {
ap->status.Event.Prio = 0;
if (sp->sup->EventFlags & mh_mEventFlags_Returned)
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
} else {
ap->status.Event.Prio = 0;
if (aap->message.EventFlags & mh_mEventFlags_Returned)
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
ap->status.Event.Status &= ~mh_mEventStatus_NotRet;
}
ep->msg.message.Status = ap->status.All;
break;
......@@ -4586,7 +4583,7 @@ updateAlarm (
if (ap->idx >= l.event_l->oldIdx) {
/* Alarm message still in event list, update status */
l.event_l->list[ap->idx % l.event_l->size].msg.message.Status =
ap->status.All;
ap->status.All;
}
break;
case mh_eEvent_Return:
......@@ -4594,7 +4591,7 @@ updateAlarm (
if (ap->idx >= l.event_l->oldIdx) {
/* Alarm message still in event list, update status */
l.event_l->list[ap->idx % l.event_l->size].msg.message.Status =
ap->status.All;
ap->status.All;
}
break;
default:
......@@ -4602,9 +4599,7 @@ updateAlarm (
}
if (((ap->status.Event.Status &
(mh_mEventStatus_NotRet | mh_mEventStatus_NotAck)) == 0) ||
(ap->event == mh_eEvent_Info && ep->event == mh_eEvent_Return &&
!(aap->message.EventFlags & mh_mEventFlags_Ack))
(mh_mEventStatus_NotRet | mh_mEventStatus_NotAck)) == 0)
) { /* The alarm is acked and unactive, remove it from alarm list */
ap->status.All = 0;
updateAlarmInfo(ap);
......
......@@ -332,7 +332,12 @@ static GdkColor flow_allocate_color( FlowDrawGtk *draw_ctx, const char *named_co
return draw_ctx->color_vect[0];
}
if ( !gdk_color_parse( named_color, &color))
if ( strcmp( named_color, "yellow") == 0) {
color.red = 61952;
color.green = 58880;
color.blue = 0;
}
else if ( !gdk_color_parse( named_color, &color))
gdk_color_parse( "black", &color);
gdk_colormap_alloc_color( draw_ctx->colormap, &color, FALSE, TRUE);
......
......@@ -512,8 +512,8 @@ void EvListBrow::create_nodeclasses()
// Nodeclass for A-alarm
brow_CreateNodeClass( ctx, "A_Alarm",
flow_eNodeGroup_Common, &nc_a_alarm);
brow_AddFilledRect( nc_a_alarm, 0.2, 0.15, 0.4, 0.4, flow_eDrawType_LineRed);
brow_AddRect( nc_a_alarm, 0.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_a_alarm, 0.05, 0.05, 0.6, 0.6, flow_eDrawType_LineRed);
brow_AddRect( nc_a_alarm, 0.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_a_alarm, 0.8, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnotPixmap( nc_a_alarm, 0, 1.6, 0.1, flow_eDrawType_Line, 2, 0);
......@@ -533,8 +533,8 @@ void EvListBrow::create_nodeclasses()
// Nodeclass for B-alarm
brow_CreateNodeClass( ctx, "B_Alarm",
flow_eNodeGroup_Common, &nc_b_alarm);
brow_AddFilledRect( nc_b_alarm, 0.2, 0.15, 0.4, 0.4, flow_eDrawType_Yellow);
brow_AddRect( nc_b_alarm, 0.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_b_alarm, 0.05, 0.05, 0.6, 0.6, flow_eDrawType_Yellow);
brow_AddRect( nc_b_alarm, 0.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_b_alarm, 0.8, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnotPixmap( nc_b_alarm, 0, 1.6, 0.1, flow_eDrawType_Line, 2, 0);
......@@ -554,8 +554,8 @@ void EvListBrow::create_nodeclasses()
// Nodeclass for Info
brow_CreateNodeClass( ctx, "Info",
flow_eNodeGroup_Common, &nc_info);
brow_AddFilledRect( nc_info, 0.2, 0.15, 0.4, 0.4, flow_eDrawType_Green);
brow_AddRect( nc_info, 0.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_info, 0.05, 0.05, 0.6, 0.6, flow_eDrawType_Green);
brow_AddRect( nc_info, 0.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_info, 0.8, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnotPixmap( nc_info, 0, 1.6, 0.1, flow_eDrawType_Line, 2, 0);
......@@ -576,7 +576,7 @@ void EvListBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_category);
brow_AddAnnotPixmap( nc_category, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_category, 1, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddRect( nc_category, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_LineGray, 0, 0);
brow_AddRect( nc_category, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_LineGray, 0, 0);
brow_AddAnnot( nc_category, 2.5, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnot( nc_category, 4.8, 0.6, 1,
......@@ -590,8 +590,8 @@ void EvListBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_category_a);
brow_AddAnnotPixmap( nc_category_a, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_category_a, 1, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddFilledRect( nc_category_a, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_LineRed);
brow_AddRect( nc_category_a, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_category_a, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_LineRed);
brow_AddRect( nc_category_a, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_category_a, 2.5, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnot( nc_category_a, 4.8, 0.6, 1,
......@@ -605,8 +605,8 @@ void EvListBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_category_b);
brow_AddAnnotPixmap( nc_category_b, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_category_b, 1, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddFilledRect( nc_category_b, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Yellow);
brow_AddRect( nc_category_b, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_category_b, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Yellow);
brow_AddRect( nc_category_b, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_category_b, 2.5, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnot( nc_category_b, 4.8, 0.6, 1,
......@@ -620,8 +620,8 @@ void EvListBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_category_c);
brow_AddAnnotPixmap( nc_category_c, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_category_c, 1, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddFilledRect( nc_category_c, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_LineGray);
brow_AddRect( nc_category_c, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_category_c, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_LineGray);
brow_AddRect( nc_category_c, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_category_c, 2.5, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnot( nc_category_c, 4.8, 0.6, 1,
......@@ -635,8 +635,8 @@ void EvListBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_category_d);
brow_AddAnnotPixmap( nc_category_d, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_category_d, 1, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddFilledRect( nc_category_d, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_LineGray);
brow_AddRect( nc_category_d, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_category_d, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_LineGray);
brow_AddRect( nc_category_d, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_category_d, 2.5, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnot( nc_category_d, 4.8, 0.6, 1,
......@@ -650,8 +650,8 @@ void EvListBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_category_i);
brow_AddAnnotPixmap( nc_category_i, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_category_i, 1, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddFilledRect( nc_category_i, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Green);
brow_AddRect( nc_category_i, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_category_i, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Green);
brow_AddRect( nc_category_i, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_category_i, 2.5, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnot( nc_category_i, 4.8, 0.6, 1,
......@@ -665,8 +665,8 @@ void EvListBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_category_flash);
brow_AddAnnotPixmap( nc_category_flash, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_category_flash, 1, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddFilledRect( nc_category_flash, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Line);
brow_AddRect( nc_category_flash, 1.2, 0.15, 0.4, 0.4, flow_eDrawType_Line, 0, 0);
brow_AddFilledRect( nc_category_flash, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Line);
brow_AddRect( nc_category_flash, 1.05, 0.05, 0.6, 0.6, flow_eDrawType_Line, 0, 0);
brow_AddAnnot( nc_category_flash, 2.5, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine, 0);
brow_AddAnnot( nc_category_flash, 4.8, 0.6, 1,
......@@ -1156,13 +1156,21 @@ void EvList::event_ack( mh_sAck *msg)
break;
case evlist_eEventType_Info:
if ( item->eventflags & mh_mEventFlags_InfoWindow) {
brow_DeleteNode( browbase->ctx, item->node);
if ( browtree) {
if ( item->status & mh_mEventStatus_NotRet) {
item->status &= ~mh_mEventStatus_NotAck;
item->update_text(0);
if ( item->tree_node)
brow_DeleteNode( browtree->ctx, item->tree_node);
view_configure();
item->update_text(1);
}
else {
brow_DeleteNode( browbase->ctx, item->node);
if ( browtree) {
if ( item->tree_node)
brow_DeleteNode( browtree->ctx, item->tree_node);
view_configure();
}
size--;
}
size--;
}
break;
default:
......
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