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

Alarm window, button to ack all alarms, and xtt command 'eventlist ack/all' (refs #78)

parent bb31c7b4
...@@ -1536,10 +1536,11 @@ close navigator <t>Close the navigator <LINK> close navigator ...@@ -1536,10 +1536,11 @@ close navigator <t>Close the navigator <LINK> close navigator
create item <t>Create a menu item in the Xtt menu <LINK> create item create item <t>Create a menu item in the Xtt menu <LINK> create item
create opmenuitem <t>Create a menu item in the operator window menu <LINK> create opmenuitem create opmenuitem <t>Create a menu item in the operator window menu <LINK> create opmenuitem
crossreference<t>Show crossreferenses <LINK> crossreference crossreference<t>Show crossreferenses <LINK> crossreference
exit <t>close xtt <LINK> exit
define <t>Define a symbol <LINK> define define <t>Define a symbol <LINK> define
delete item <t>Delete a menu item in the Xtt menu <LINK> delete item delete item <t>Delete a menu item in the Xtt menu <LINK> delete item
delete opmenuitem <t>Delete a menu item in the operator window menu <LINK> delete opmenuitem delete opmenuitem <t>Delete a menu item in the operator window menu <LINK> delete opmenuitem
eventlist <t>Handle the eventlist <LINK> eventlist
exit <t>close xtt <LINK> exit
help <t>Display help <LINK> help help <t>Display help <LINK> help
login <t>User login <LINK> login login <t>User login <LINK> login
logout <t>User logout <LINK> logout logout <t>User logout <LINK> logout
...@@ -1953,6 +1954,34 @@ add menu <LINK> add menu ...@@ -1953,6 +1954,34 @@ add menu <LINK> add menu
create item <LINK> create item create item <LINK> create item
</TOPIC> </TOPIC>
<TOPIC> eventlist <style> function
Command eventlist
Handle the eventlist
<b>xtt> eventlist load
Load the eventlist.
<b>xtt> eventlist unload
Unload the eventlist.
<b>xtt> eventlist acknowledge /priority=
Acknowledge last alarm of specified priority. Priority can be A, B, C, D, I or NOA.
NOA acknowleges the last not A alarm.
<b>xtt> eventlist acknowledge /all
Acknowledge all alarms.
<H2>related subjects
show alarmlist <LINK> show alarmlist
show eventlist <LINK> show eventlist
</TOPIC>
<TOPIC> help <style> function <TOPIC> help <style> function
Command help Command help
......
...@@ -1545,10 +1545,11 @@ close navigator <t>St ...@@ -1545,10 +1545,11 @@ close navigator <t>St
create opmenuitem <t>Skapa ett menyalternativ i operatörsfönstret <LINK> create opmenuitem create opmenuitem <t>Skapa ett menyalternativ i operatörsfönstret <LINK> create opmenuitem
create item <t>Skapa ett xtt menyalternativ <LINK> create item create item <t>Skapa ett xtt menyalternativ <LINK> create item
crossreference<t>Visa korsreferenser <LINK> crossreference crossreference<t>Visa korsreferenser <LINK> crossreference
exit <t>Stäng xtt <LINK> exit
define <t>Definiera en symbol <LINK> define define <t>Definiera en symbol <LINK> define
delete opmenuitem <t>Ta bort ett xtt menyalternativ <LINK> delete item delete opmenuitem <t>Ta bort ett xtt menyalternativ <LINK> delete item
delete item <t>Ta bort ett menyalternativ i operatörsfönstret <LINK> delete item delete item <t>Ta bort ett menyalternativ i operatörsfönstret <LINK> delete item
eventlist <t>Hantera händlselistan <LINK> eventlist
exit <t>Stäng xtt <LINK> exit
help <t>Visa hjälp <LINK> help help <t>Visa hjälp <LINK> help
login <t>Inloggning av användare <LINK> login login <t>Inloggning av användare <LINK> login
logout <t>Utloggning av änvändare <LINK> logout logout <t>Utloggning av änvändare <LINK> logout
...@@ -1916,6 +1917,34 @@ add menu <LINK> add menu ...@@ -1916,6 +1917,34 @@ add menu <LINK> add menu
create item <LINK> create item create item <LINK> create item
</TOPIC> </TOPIC>
<TOPIC> eventlist <style> function
Kommando eventlist
Hantera händelselistan
<b>xtt> eventlist load
Ladda händelselistan.
<b>xtt> eventlist unload
Ta bort händelselistan.
<b>xtt> eventlist acknowledge /priority=
Kvittera det sista larmet med angiven priritet. Prioriteten kan vara A, B, C, D, I
eller NOA. NOA kvitterar det sista larmet som inte är ett A larm.
<b>xtt> eventlist acknowledge /all
Kvittera alla larm.
<H2>Se även
show alarmlist <LINK> show alarmlist
show eventlist <LINK> show eventlist
</TOPIC>
<TOPIC> help <style> function <TOPIC> help <style> function
Kommando help Kommando help
......
...@@ -406,6 +406,11 @@ EvGtk::EvGtk( void *ev_parent_ctx, ...@@ -406,6 +406,11 @@ EvGtk::EvGtk( void *ev_parent_ctx,
'k', GdkModifierType(GDK_CONTROL_MASK), 'k', GdkModifierType(GDK_CONTROL_MASK),
GTK_ACCEL_VISIBLE); GTK_ACCEL_VISIBLE);
GtkWidget *functions_ack_all = gtk_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("A_cknowledge All"));
g_signal_connect( functions_ack_all, "activate",
G_CALLBACK(ala_activate_ack_all), this);
GtkWidget *functions_open_plc = gtk_menu_item_new_with_mnemonic( GtkWidget *functions_open_plc = gtk_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("Open _Program")); CoWowGtk::translate_utf8("Open _Program"));
g_signal_connect( functions_open_plc, "activate", g_signal_connect( functions_open_plc, "activate",
...@@ -424,6 +429,7 @@ EvGtk::EvGtk( void *ev_parent_ctx, ...@@ -424,6 +429,7 @@ EvGtk::EvGtk( void *ev_parent_ctx,
GtkMenu *func_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL); GtkMenu *func_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(func_menu), functions_ack_last); gtk_menu_shell_append(GTK_MENU_SHELL(func_menu), functions_ack_last);
gtk_menu_shell_append(GTK_MENU_SHELL(func_menu), functions_ack_all);
gtk_menu_shell_append(GTK_MENU_SHELL(func_menu), functions_open_plc); gtk_menu_shell_append(GTK_MENU_SHELL(func_menu), functions_open_plc);
gtk_menu_shell_append(GTK_MENU_SHELL(func_menu), functions_display_object); gtk_menu_shell_append(GTK_MENU_SHELL(func_menu), functions_display_object);
...@@ -914,6 +920,13 @@ void EvGtk::ala_activate_ack_last( GtkWidget *w, gpointer data) ...@@ -914,6 +920,13 @@ void EvGtk::ala_activate_ack_last( GtkWidget *w, gpointer data)
eve_activate_ack_last( w, data); eve_activate_ack_last( w, data);
} }
void EvGtk::ala_activate_ack_all( GtkWidget *w, gpointer data)
{
Ev *ev = (Ev *)data;
ev->eve_activate_ack_all();
}
void EvGtk::eve_activate_zoom_in( GtkWidget *w, gpointer data) void EvGtk::eve_activate_zoom_in( GtkWidget *w, gpointer data)
{ {
Ev *ev = (Ev *)data; Ev *ev = (Ev *)data;
......
...@@ -95,6 +95,7 @@ class EvGtk : public Ev { ...@@ -95,6 +95,7 @@ class EvGtk : public Ev {
static void blk_activate_print( GtkWidget *w, gpointer data); static void blk_activate_print( GtkWidget *w, gpointer data);
static void eve_activate_ack_last( GtkWidget *w, gpointer data); static void eve_activate_ack_last( GtkWidget *w, gpointer data);
static void ala_activate_ack_last( GtkWidget *w, gpointer data); static void ala_activate_ack_last( GtkWidget *w, gpointer data);
static void ala_activate_ack_all( GtkWidget *w, gpointer data);
static void eve_activate_zoom_in( GtkWidget *w, gpointer data); static void eve_activate_zoom_in( GtkWidget *w, gpointer data);
static void ala_activate_zoom_in( GtkWidget *w, gpointer data); static void ala_activate_zoom_in( GtkWidget *w, gpointer data);
static void blk_activate_zoom_in( GtkWidget *w, gpointer data); static void blk_activate_zoom_in( GtkWidget *w, gpointer data);
......
...@@ -211,6 +211,11 @@ void Ev::eve_activate_ack_last() ...@@ -211,6 +211,11 @@ void Ev::eve_activate_ack_last()
mh_OutunitAck( &lid); mh_OutunitAck( &lid);
} }
void Ev::eve_activate_ack_all()
{
ack_all();
}
void Ev::eve_activate_help() void Ev::eve_activate_help()
{ {
if ( help_cb) if ( help_cb)
...@@ -329,6 +334,22 @@ void Ev::ack_last_prio( unsigned long type, unsigned long prio) ...@@ -329,6 +334,22 @@ void Ev::ack_last_prio( unsigned long type, unsigned long prio)
} }
} }
void Ev::ack_all()
{
mh_sEventId *id;
int sts;
sts = ala->get_last_not_acked( &id);
while ( ODD(sts)) {
mh_sEventId lid = *id;
ala->ack( id);
eve->ack( id);
mh_OutunitAck( &lid);
sts = ala->get_last_not_acked( &id);
}
}
int Ev::get_last_not_acked_prio( mh_sEventId **id, unsigned long type, int Ev::get_last_not_acked_prio( mh_sEventId **id, unsigned long type,
unsigned long prio) unsigned long prio)
{ {
......
...@@ -122,6 +122,7 @@ class Ev { ...@@ -122,6 +122,7 @@ class Ev {
int is_mapped_blk() { return blk_displayed;}; int is_mapped_blk() { return blk_displayed;};
int get_alarm_info( evlist_sAlarmInfo *info); int get_alarm_info( evlist_sAlarmInfo *info);
void ack_last_prio( unsigned long type, unsigned long prio); void ack_last_prio( unsigned long type, unsigned long prio);
void ack_all();
int get_last_not_acked_prio( mh_sEventId **id, unsigned long type, int get_last_not_acked_prio( mh_sEventId **id, unsigned long type,
unsigned long prio); unsigned long prio);
void create_aliaslist( void *up); void create_aliaslist( void *up);
...@@ -131,6 +132,7 @@ class Ev { ...@@ -131,6 +132,7 @@ class Ev {
void ala_activate_print(); void ala_activate_print();
void blk_activate_print(); void blk_activate_print();
void eve_activate_ack_last(); void eve_activate_ack_last();
void eve_activate_ack_all();
void eve_activate_help(); void eve_activate_help();
void eve_activate_helpevent(); void eve_activate_helpevent();
void ala_activate_help(); void ala_activate_help();
......
...@@ -361,7 +361,7 @@ dcli_tCmdTable xnav_command_table[] = { ...@@ -361,7 +361,7 @@ dcli_tCmdTable xnav_command_table[] = {
{ {
"EVENTLIST", "EVENTLIST",
&xnav_eventlist_func, &xnav_eventlist_func,
{"dcli_arg1", "/PRIORITY", "/NAME", "",} {"dcli_arg1", "/PRIORITY", "/NAME", "/ALL", "",}
}, },
{ {
"TEST", "TEST",
...@@ -2151,11 +2151,17 @@ static int xnav_eventlist_func( void *client_data, ...@@ -2151,11 +2151,17 @@ static int xnav_eventlist_func( void *client_data,
// Command is "EVENTLIST ACKNOWLEDGE" // Command is "EVENTLIST ACKNOWLEDGE"
char prio_str[80]; char prio_str[80];
mh_sEventId *id; mh_sEventId *id;
int all;
if ( xnav->ev) all = ODD( dcli_get_qualifier( "/ALL", 0, 0));
{ if ( all) {
if ( ODD( dcli_get_qualifier( "/PRIORITY", prio_str, sizeof(prio_str)))) if ( xnav->ev)
{ xnav->ev->ack_all();
return XNAV__SUCCESS;
}
if ( xnav->ev) {
if ( ODD( dcli_get_qualifier( "/PRIORITY", prio_str, sizeof(prio_str)))) {
cdh_ToUpper( prio_str, prio_str); cdh_ToUpper( prio_str, prio_str);
if ( strcmp( prio_str, "A") == 0) if ( strcmp( prio_str, "A") == 0)
xnav->ev->ack_last_prio( evlist_eEventType_Alarm, mh_eEventPrio_A); xnav->ev->ack_last_prio( evlist_eEventType_Alarm, mh_eEventPrio_A);
...@@ -2167,8 +2173,7 @@ static int xnav_eventlist_func( void *client_data, ...@@ -2167,8 +2173,7 @@ static int xnav_eventlist_func( void *client_data,
xnav->ev->ack_last_prio( evlist_eEventType_Alarm, mh_eEventPrio_D); xnav->ev->ack_last_prio( evlist_eEventType_Alarm, mh_eEventPrio_D);
else if ( strncmp( prio_str, "I", 1) == 0) else if ( strncmp( prio_str, "I", 1) == 0)
xnav->ev->ack_last_prio( evlist_eEventType_Info, 0); xnav->ev->ack_last_prio( evlist_eEventType_Info, 0);
else if ( strcmp( prio_str, "NOA") == 0) else if ( strcmp( prio_str, "NOA") == 0) {
{
if ( ODD( xnav->ev->get_last_not_acked_prio( &id, if ( ODD( xnav->ev->get_last_not_acked_prio( &id,
evlist_eEventType_Alarm, mh_eEventPrio_B))) evlist_eEventType_Alarm, mh_eEventPrio_B)))
xnav->ev->ack_last_prio( evlist_eEventType_Alarm, mh_eEventPrio_B); xnav->ev->ack_last_prio( evlist_eEventType_Alarm, mh_eEventPrio_B);
......
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