Commit 6587a816 authored by claes's avatar claes

Opwindow popped for new alarm

parent 24028756
/* /*
* Proview $Id: xtt_op_gtk.cpp,v 1.7 2007-10-30 07:45:55 claes Exp $ * Proview $Id: xtt_op_gtk.cpp,v 1.8 2008-01-24 09:35:26 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -371,7 +371,12 @@ OpGtk::~OpGtk() ...@@ -371,7 +371,12 @@ OpGtk::~OpGtk()
void OpGtk::map() void OpGtk::map()
{ {
if ( poptimer.disabled())
return;
gtk_window_present( GTK_WINDOW(toplevel)); gtk_window_present( GTK_WINDOW(toplevel));
poptimer.disable( 1000);
} }
void OpGtk::add_close_button() void OpGtk::add_close_button()
......
/* /*
* Proview $Id: xtt_op_gtk.h,v 1.2 2007-05-16 12:37:39 claes Exp $ * Proview $Id: xtt_op_gtk.h,v 1.3 2008-01-24 09:35:26 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
# include "xtt_op.h" # include "xtt_op.h"
#endif #endif
#ifndef co_wow_gtk_h
# include "co_wow_gtk.h"
#endif
class OpGtk : public Op { class OpGtk : public Op {
public: public:
...@@ -56,6 +59,7 @@ class OpGtk : public Op { ...@@ -56,6 +59,7 @@ class OpGtk : public Op {
int a_exist[5]; int a_exist[5];
int a_active[5]; int a_active[5];
int text_size; int text_size;
CoWowFocusTimerGtk poptimer;
void map(); void map();
int configure( char *opplace_str); int configure( char *opplace_str);
......
/* /*
* Proview $Id: xtt_ev.cpp,v 1.9 2007-01-04 08:22:46 claes Exp $ * Proview $Id: xtt_ev.cpp,v 1.10 2008-01-24 09:36:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -389,6 +389,9 @@ pwr_tStatus Ev::mh_alarm_bc( mh_sMessage *MsgP) ...@@ -389,6 +389,9 @@ pwr_tStatus Ev::mh_alarm_bc( mh_sMessage *MsgP)
ev->ala->event_alarm( MsgP); ev->ala->event_alarm( MsgP);
if ( ev->update_info_cb) if ( ev->update_info_cb)
ev->update_info_cb( ev->parent_ctx); ev->update_info_cb( ev->parent_ctx);
if ( ev->pop_cb)
ev->pop_cb( ev->parent_ctx);
return 1; return 1;
} }
......
/* /*
* Proview $Id: xtt_ev.h,v 1.8 2007-01-04 08:22:46 claes Exp $ * Proview $Id: xtt_ev.h,v 1.9 2008-01-24 09:36:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -64,6 +64,7 @@ class Ev { ...@@ -64,6 +64,7 @@ class Ev {
void (*popup_menu_cb)( void *, pwr_tAttrRef, unsigned long, void (*popup_menu_cb)( void *, pwr_tAttrRef, unsigned long,
unsigned long, char *, int x, int y); unsigned long, char *, int x, int y);
int (*sound_cb)( void *, pwr_tAttrRef *); int (*sound_cb)( void *, pwr_tAttrRef *);
void (*pop_cb)( void *);
EvList *eve; EvList *eve;
EvList *ala; EvList *ala;
EvList *blk; EvList *blk;
......
/* /*
* Proview $Id: xtt_evlist.cpp,v 1.18 2007-10-24 15:11:30 claes Exp $ * Proview $Id: xtt_evlist.cpp,v 1.19 2008-01-24 09:36:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -315,6 +315,8 @@ void EvListBrow::brow_setup() ...@@ -315,6 +315,8 @@ void EvListBrow::brow_setup()
EvList::brow_cb); EvList::brow_cb);
brow_EnableEvent( ctx, flow_eEvent_ScrollDown, flow_eEventType_CallBack, brow_EnableEvent( ctx, flow_eEvent_ScrollDown, flow_eEventType_CallBack,
EvList::brow_cb); EvList::brow_cb);
brow_EnableEvent( ctx, flow_eEvent_TipText, flow_eEventType_CallBack,
EvList::brow_cb);
} }
// //
...@@ -430,7 +432,8 @@ void EvList::event_info( mh_sMessage *msg) ...@@ -430,7 +432,8 @@ void EvList::event_info( mh_sMessage *msg)
event->Info.EventTime, event->Msg.EventText, event->Info.EventTime, event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags, event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id, event->Info.EventPrio, event->Info.Id,
event->Info.Object, &event->Msg.EventSound, msg->Status, event->Info.Object, &event->Msg.EventSound,
event->Msg.EventMoreText, msg->Status,
evlist_eEventType_Info, dest_node, dest_code); evlist_eEventType_Info, dest_node, dest_code);
size++; size++;
} }
...@@ -474,7 +477,8 @@ void EvList::event_alarm( mh_sMessage *msg) ...@@ -474,7 +477,8 @@ void EvList::event_alarm( mh_sMessage *msg)
event->Info.EventTime, event->Msg.EventText, event->Info.EventTime, event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags, event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id, event->Info.EventPrio, event->Info.Id,
event->Info.Object, &event->Msg.EventSound, msg->Status, event->Info.Object, &event->Msg.EventSound,
event->Msg.EventMoreText, msg->Status,
evlist_eEventType_Alarm, dest_node, dest_code); evlist_eEventType_Alarm, dest_node, dest_code);
size++; size++;
} }
...@@ -522,7 +526,7 @@ void EvList::event_block( mh_sBlock *msg) ...@@ -522,7 +526,7 @@ void EvList::event_block( mh_sBlock *msg)
event->Info.EventTime, event->Info.EventName, event->Info.EventTime, event->Info.EventName,
text, event->Info.EventFlags, text, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id, event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, evlist_eEventType_Block, event->Info.Object, 0, 0, 0, evlist_eEventType_Block,
dest_node, dest_code); dest_node, dest_code);
size++; size++;
break; break;
...@@ -578,7 +582,7 @@ void EvList::event_block( mh_sBlock *msg) ...@@ -578,7 +582,7 @@ void EvList::event_block( mh_sBlock *msg)
event->Info.EventTime, text, event->Info.EventTime, text,
event->Info.EventName, event->Info.EventFlags, event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id, event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, evlist_eEventType_Block, event->Info.Object, 0, 0, 0, evlist_eEventType_Block,
dest_node, dest_code); dest_node, dest_code);
switch( msg->Info.EventType) { switch( msg->Info.EventType) {
...@@ -663,7 +667,7 @@ void EvList::event_ack( mh_sAck *msg) ...@@ -663,7 +667,7 @@ void EvList::event_ack( mh_sAck *msg)
event->Info.EventTime, "", event->Info.EventTime, "",
event->Info.EventName, event->Info.EventFlags, event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id, event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, evlist_eEventType_Ack, event->Info.Object, 0, 0, 0, evlist_eEventType_Ack,
dest_node, dest_code); dest_node, dest_code);
size++; size++;
} }
...@@ -726,7 +730,7 @@ void EvList::event_return( mh_sReturn *msg) ...@@ -726,7 +730,7 @@ void EvList::event_return( mh_sReturn *msg)
event->Info.EventTime, event->Msg.EventText, event->Info.EventTime, event->Msg.EventText,
event->Info.EventName, event->Info.EventFlags, event->Info.EventName, event->Info.EventFlags,
event->Info.EventPrio, event->Info.Id, event->Info.EventPrio, event->Info.Id,
event->Info.Object, 0, 0, evlist_eEventType_Return, event->Info.Object, 0, 0, 0, evlist_eEventType_Return,
dest_node, dest_code); dest_node, dest_code);
size++; size++;
} }
...@@ -1177,6 +1181,20 @@ int EvList::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1177,6 +1181,20 @@ int EvList::brow_cb( FlowCtx *ctx, flow_tEvent event)
; ;
} }
break; break;
case flow_eEvent_TipText: {
brow_GetUserData( event->object.object, (void **)&item);
switch( item->type) {
case evlist_eItemType_Alarm:
if ( strcmp( ((ItemAlarm *)item)->eventmoretext, "") != 0) {
brow_SetTipText( evlist->brow->ctx, event->object.object, ((ItemAlarm *)item)->eventmoretext,
event->any.x_pixel, event->any.y_pixel);
}
break;
default:
;
}
break;
}
default: default:
; ;
} }
...@@ -1186,7 +1204,7 @@ int EvList::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1186,7 +1204,7 @@ int EvList::brow_cb( FlowCtx *ctx, flow_tEvent event)
ItemAlarm::ItemAlarm( EvList *item_evlist, char *item_name, pwr_tTime item_time, ItemAlarm::ItemAlarm( EvList *item_evlist, char *item_name, pwr_tTime item_time,
char *item_eventtext, char *item_eventname, int item_eventflags, char *item_eventtext, char *item_eventname, int item_eventflags,
unsigned long item_eventprio, mh_sEventId item_eventid, unsigned long item_eventprio, mh_sEventId item_eventid,
pwr_tObjid item_object, pwr_tAttrRef *item_eventsound, pwr_tObjid item_object, pwr_tAttrRef *item_eventsound, char *item_eventmoretext,
unsigned long item_status, evlist_eEventType item_event_type, unsigned long item_status, evlist_eEventType item_event_type,
brow_tNode dest, flow_eDest dest_code): brow_tNode dest, flow_eDest dest_code):
event_type(item_event_type), evlist(item_evlist), time(item_time), event_type(item_event_type), evlist(item_evlist), time(item_time),
...@@ -1207,7 +1225,10 @@ ItemAlarm::ItemAlarm( EvList *item_evlist, char *item_name, pwr_tTime item_time, ...@@ -1207,7 +1225,10 @@ ItemAlarm::ItemAlarm( EvList *item_evlist, char *item_name, pwr_tTime item_time,
strcpy( alias, ""); strcpy( alias, "");
if ( item_eventsound) if ( item_eventsound)
eventsound = *item_eventsound; eventsound = *item_eventsound;
if ( eventmoretext)
strncpy( eventmoretext, item_eventmoretext, sizeof(eventmoretext));
else
strcpy( eventmoretext, "");
switch ( event_type) { switch ( event_type) {
case evlist_eEventType_Alarm: case evlist_eEventType_Alarm:
......
/* /*
* Proview $Id: xtt_evlist.h,v 1.11 2007-01-04 08:22:46 claes Exp $ * Proview $Id: xtt_evlist.h,v 1.12 2008-01-24 09:36:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -203,7 +203,8 @@ class ItemAlarm { ...@@ -203,7 +203,8 @@ class ItemAlarm {
ItemAlarm( EvList *evlist, char *item_name, pwr_tTime item_time, ItemAlarm( EvList *evlist, char *item_name, pwr_tTime item_time,
char *item_eventtext, char *item_eventname, int item_eventflags, char *item_eventtext, char *item_eventname, int item_eventflags,
unsigned long item_eventprio, mh_sEventId item_eventid, unsigned long item_eventprio, mh_sEventId item_eventid,
pwr_tObjid item_object, pwr_tAttrRef *item_eventsound, unsigned long item_status, pwr_tObjid item_object, pwr_tAttrRef *item_eventsound,
char *item_eventmoretext,unsigned long item_status,
evlist_eEventType item_event_type, evlist_eEventType item_event_type,
brow_tNode dest, flow_eDest dest_code); brow_tNode dest, flow_eDest dest_code);
evlist_eItemType type; evlist_eItemType type;
...@@ -221,6 +222,7 @@ class ItemAlarm { ...@@ -221,6 +222,7 @@ class ItemAlarm {
unsigned long status; unsigned long status;
char alias[40]; char alias[40];
pwr_tAttrRef eventsound; pwr_tAttrRef eventsound;
pwr_tText256 eventmoretext;
void update_text(); void update_text();
}; };
......
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