Commit d2f2b499 authored by Claes Sjofors's avatar Claes Sjofors

Opwindow layout options, oldest alarm showed first, and time before ack is allowed

parent d0d3d409
...@@ -121,5 +121,27 @@ SObject pwrb:Type ...@@ -121,5 +121,27 @@ SObject pwrb:Type
Attr Value = 64 Attr Value = 64
EndBody EndBody
EndObject EndObject
!/**
! Show the oldest not acknowledged alarm in the operator window.
! Otherwise the most recent not acknowledged alarm is shown.
!*/
Object ShowOldestNotAckedAlarm $Bit
Body SysBody
Attr PgmName = "ShowOldestNotAckedAlarm"
Attr Text = "ShowOldestNotAckedAlarm"
Attr Value = 128
EndBody
EndObject
!/**
! Check that an alarm has been visible in the operator window
! for some time before it can be acknowledged.
!*/
Object CheckAckAlarmTime $Bit
Body SysBody
Attr PgmName = "CheckAckAlarmTime"
Attr Text = "CheckAckAlarmTime"
Attr Value = 256
EndBody
EndObject
EndObject EndObject
EndSObject EndSObject
...@@ -924,9 +924,10 @@ void OpGtk::update_alarm_info() ...@@ -924,9 +924,10 @@ void OpGtk::update_alarm_info()
int show_time = 0; int show_time = 0;
time_eFormat time_format = time_eFormat_Time; time_eFormat time_format = time_eFormat_Time;
char* s; char* s;
int backward = layout_mask & pwr_mOpWindLayoutMask_ShowOldestNotAckedAlarm ? 1 : 0;
if (get_alarm_info_cb) { if (get_alarm_info_cb) {
sts = (get_alarm_info_cb)(parent_ctx, &info); sts = (get_alarm_info_cb)(parent_ctx, &info, backward, a_height);
if (EVEN(sts)) if (EVEN(sts))
return; return;
......
...@@ -231,7 +231,7 @@ void OpMotif::update_alarm_info() ...@@ -231,7 +231,7 @@ void OpMotif::update_alarm_info()
char text[120]; char text[120];
if (get_alarm_info_cb) { if (get_alarm_info_cb) {
sts = (get_alarm_info_cb)(parent_ctx, &info); sts = (get_alarm_info_cb)(parent_ctx, &info, 0, 5);
if (EVEN(sts)) if (EVEN(sts))
return; return;
......
...@@ -579,9 +579,10 @@ void OpQt::update_alarm_info() ...@@ -579,9 +579,10 @@ void OpQt::update_alarm_info()
int show_time = 0; int show_time = 0;
time_eFormat time_format = time_eFormat_Time; time_eFormat time_format = time_eFormat_Time;
char* s; char* s;
int backward = layout_mask & pwr_mOpWindLayoutMask_ShowOldestNotAckedAlarm ? 1 : 0;
if (get_alarm_info_cb) { if (get_alarm_info_cb) {
sts = (get_alarm_info_cb)(parent_ctx, &info); sts = (get_alarm_info_cb)(parent_ctx, &info, backward, a_height);
if (EVEN(sts)) { if (EVEN(sts)) {
return; return;
} }
......
...@@ -399,9 +399,9 @@ void Ev::blk_activate_help() ...@@ -399,9 +399,9 @@ void Ev::blk_activate_help()
(help_cb)(parent_ctx, "opg_blocklist"); (help_cb)(parent_ctx, "opg_blocklist");
} }
int Ev::get_alarm_info(evlist_sAlarmInfo* info) int Ev::get_alarm_info(evlist_sAlarmInfo* info, int backward, int alarmsize)
{ {
return ala->get_alarm_info(info); return ala->get_alarm_info(info, backward, alarmsize);
} }
int Ev::outunit_connect(pwr_tObjid user) int Ev::outunit_connect(pwr_tObjid user)
...@@ -454,7 +454,7 @@ void Ev::update(double scantime) ...@@ -454,7 +454,7 @@ void Ev::update(double scantime)
ala->beep(scantime); ala->beep(scantime);
} }
void Ev::ack_last_prio(unsigned long type, unsigned long prio) void Ev::ack_last_prio(unsigned long type, unsigned long prio, int backward, int timecheck)
{ {
mh_sEventId* id; mh_sEventId* id;
int sts; int sts;
...@@ -464,7 +464,7 @@ void Ev::ack_last_prio(unsigned long type, unsigned long prio) ...@@ -464,7 +464,7 @@ void Ev::ack_last_prio(unsigned long type, unsigned long prio)
parent_ctx, pwr_mAccess_RtEventsAck | pwr_mAccess_System)) parent_ctx, pwr_mAccess_RtEventsAck | pwr_mAccess_System))
return; return;
sts = ala->get_last_not_acked_prio(&id, type, prio); sts = ala->get_last_not_acked_prio(&id, type, prio, backward, timecheck);
if (ODD(sts)) { if (ODD(sts)) {
mh_sEventId lid = *id; mh_sEventId lid = *id;
...@@ -526,7 +526,7 @@ void Ev::ack_all() ...@@ -526,7 +526,7 @@ void Ev::ack_all()
int Ev::get_last_not_acked_prio( int Ev::get_last_not_acked_prio(
mh_sEventId** id, unsigned long type, unsigned long prio) mh_sEventId** id, unsigned long type, unsigned long prio)
{ {
return ala->get_last_not_acked_prio(id, type, prio); return ala->get_last_not_acked_prio(id, type, prio, 0, 0);
} }
void Ev::create_aliaslist(void* up) void Ev::create_aliaslist(void* up)
......
...@@ -167,8 +167,8 @@ public: ...@@ -167,8 +167,8 @@ public:
{ {
return blk_displayed; return blk_displayed;
} }
int get_alarm_info(evlist_sAlarmInfo* info); int get_alarm_info(evlist_sAlarmInfo* info, int backward, int alarmsize);
void ack_last_prio(unsigned long type, unsigned long prio); void ack_last_prio(unsigned long type, unsigned long prio, int backward, int timecheck);
void ack_all(); void ack_all();
int get_last_not_acked_prio( int get_last_not_acked_prio(
mh_sEventId** id, unsigned long type, unsigned long prio); mh_sEventId** id, unsigned long type, unsigned long prio);
......
...@@ -245,7 +245,7 @@ void EvAla::ack_last_prio(unsigned long type, unsigned long prio) ...@@ -245,7 +245,7 @@ void EvAla::ack_last_prio(unsigned long type, unsigned long prio)
parent_ctx, pwr_mAccess_RtEventsAck | pwr_mAccess_System)) parent_ctx, pwr_mAccess_RtEventsAck | pwr_mAccess_System))
return; return;
sts = ala->get_last_not_acked_prio(&id, type, prio); sts = ala->get_last_not_acked_prio(&id, type, prio, 0, 0);
if (ODD(sts)) { if (ODD(sts)) {
mh_sEventId lid = *id; mh_sEventId lid = *id;
...@@ -277,7 +277,7 @@ void EvAla::ack_all() ...@@ -277,7 +277,7 @@ void EvAla::ack_all()
int EvAla::get_last_not_acked_prio( int EvAla::get_last_not_acked_prio(
mh_sEventId** id, unsigned long type, unsigned long prio) mh_sEventId** id, unsigned long type, unsigned long prio)
{ {
return ala->get_last_not_acked_prio(id, type, prio); return ala->get_last_not_acked_prio(id, type, prio, 0, 0);
} }
pwr_tStatus EvAla::mh_ack(mh_sAck* MsgP) pwr_tStatus EvAla::mh_ack(mh_sAck* MsgP)
......
...@@ -240,7 +240,7 @@ void EvEve::ack_last_prio(unsigned long type, unsigned long prio) ...@@ -240,7 +240,7 @@ void EvEve::ack_last_prio(unsigned long type, unsigned long prio)
parent_ctx, pwr_mAccess_RtEventsAck | pwr_mAccess_System)) parent_ctx, pwr_mAccess_RtEventsAck | pwr_mAccess_System))
return; return;
sts = ala->get_last_not_acked_prio(&id, type, prio); sts = ala->get_last_not_acked_prio(&id, type, prio, 0, 0);
if (ODD(sts)) { if (ODD(sts)) {
mh_sEventId lid = *id; mh_sEventId lid = *id;
...@@ -272,7 +272,7 @@ void EvEve::ack_all() ...@@ -272,7 +272,7 @@ void EvEve::ack_all()
int EvEve::get_last_not_acked_prio( int EvEve::get_last_not_acked_prio(
mh_sEventId** id, unsigned long type, unsigned long prio) mh_sEventId** id, unsigned long type, unsigned long prio)
{ {
return ala->get_last_not_acked_prio(id, type, prio); return ala->get_last_not_acked_prio(id, type, prio, 0, 0);
} }
pwr_tStatus EvEve::mh_ack(mh_sAck* MsgP) pwr_tStatus EvEve::mh_ack(mh_sAck* MsgP)
......
...@@ -1841,7 +1841,7 @@ ItemAlarm::ItemAlarm(EvList* item_evlist, const char* item_name, ...@@ -1841,7 +1841,7 @@ ItemAlarm::ItemAlarm(EvList* item_evlist, const char* item_name,
: event_type(item_event_type), evlist(item_evlist), tree_node(0), : event_type(item_event_type), evlist(item_evlist), tree_node(0),
time(item_time), eventtype(item_eventtype), eventflags(item_eventflags), time(item_time), eventtype(item_eventtype), eventflags(item_eventflags),
eventprio(item_eventprio), eventid(item_eventid), object(*item_object), eventprio(item_eventprio), eventid(item_eventid), object(*item_object),
status(item_status), supobject(*item_supobject), check(0) status(item_status), supobject(*item_supobject), check(0), display_time(pwr_cNTime)
{ {
type = evlist_eItemType_Alarm; type = evlist_eItemType_Alarm;
brow_tNodeClass nc; brow_tNodeClass nc;
...@@ -2493,17 +2493,24 @@ int EvList::get_last_not_acked_beep(mh_sEventId** id) ...@@ -2493,17 +2493,24 @@ int EvList::get_last_not_acked_beep(mh_sEventId** id)
return found; return found;
} }
int EvList::get_last_not_acked_prio( int EvList::get_last_not_acked_prio(mh_sEventId** id, unsigned long type,
mh_sEventId** id, unsigned long type, unsigned long prio) unsigned long prio, int backward, int timecheck)
{ {
int i; int i, j;
brow_tObject* object_list; brow_tObject* object_list;
int object_cnt; int object_cnt;
ItemAlarm* object_item; ItemAlarm* object_item;
pwr_tTime current;
brow_GetObjectList(browbase->ctx, &object_list, &object_cnt); brow_GetObjectList(browbase->ctx, &object_list, &object_cnt);
for (i = 0; i < object_cnt; i++) { for (i = 0; i < object_cnt; i++) {
brow_GetUserData(object_list[i], (void**)&object_item); if ( backward)
j = object_cnt - i - 1;
else
j = i;
brow_GetUserData(object_list[j], (void**)&object_item);
switch (object_item->type) { switch (object_item->type) {
case evlist_eItemType_Alarm: case evlist_eItemType_Alarm:
switch (object_item->event_type) { switch (object_item->event_type) {
...@@ -2512,6 +2519,16 @@ int EvList::get_last_not_acked_prio( ...@@ -2512,6 +2519,16 @@ int EvList::get_last_not_acked_prio(
&& object_item->event_type == (evlist_eEventType)type && object_item->event_type == (evlist_eEventType)type
&& object_item->eventprio == prio) { && object_item->eventprio == prio) {
*id = &object_item->eventid; *id = &object_item->eventid;
if ( timecheck) {
pwr_tDeltaTime diff;
pwr_tFloat32 fdiff;
time_GetTime( &current);
time_Adiff( &diff, &current, &object_item->display_time);
time_DToFloat( &fdiff, &diff);
if ( fdiff < 1)
return 0;
}
return 1; return 1;
} }
break; break;
...@@ -2520,6 +2537,16 @@ int EvList::get_last_not_acked_prio( ...@@ -2520,6 +2537,16 @@ int EvList::get_last_not_acked_prio(
if (object_item->status & mh_mEventStatus_NotAck if (object_item->status & mh_mEventStatus_NotAck
&& object_item->event_type == (evlist_eEventType)type) { && object_item->event_type == (evlist_eEventType)type) {
*id = &object_item->eventid; *id = &object_item->eventid;
if ( timecheck) {
pwr_tDeltaTime diff;
pwr_tFloat32 fdiff;
time_GetTime( &current);
time_Adiff( &diff, &current, &object_item->display_time);
time_DToFloat( &fdiff, &diff);
if ( fdiff < 1)
return 0;
}
return 1; return 1;
} }
break; break;
...@@ -2532,9 +2559,9 @@ int EvList::get_last_not_acked_prio( ...@@ -2532,9 +2559,9 @@ int EvList::get_last_not_acked_prio(
return 0; return 0;
} }
int EvList::get_alarm_info(evlist_sAlarmInfo* info) int EvList::get_alarm_info(evlist_sAlarmInfo* info, int backward, int alarmsize)
{ {
int i; int i, j;
brow_tObject* object_list; brow_tObject* object_list;
int object_cnt; int object_cnt;
ItemAlarm* object_item; ItemAlarm* object_item;
...@@ -2548,7 +2575,11 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info) ...@@ -2548,7 +2575,11 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info)
brow_GetObjectList(browbase->ctx, &object_list, &object_cnt); brow_GetObjectList(browbase->ctx, &object_list, &object_cnt);
for (i = 0; i < object_cnt; i++) { for (i = 0; i < object_cnt; i++) {
brow_GetUserData(object_list[i], (void**)&object_item); if ( backward)
j = object_cnt - i - 1;
else
j = i;
brow_GetUserData(object_list[j], (void**)&object_item);
switch (object_item->type) { switch (object_item->type) {
case evlist_eItemType_Alarm: case evlist_eItemType_Alarm:
switch (object_item->event_type) { switch (object_item->event_type) {
...@@ -2585,6 +2616,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info) ...@@ -2585,6 +2616,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info)
info->a_alarm_active[a_cnt] info->a_alarm_active[a_cnt]
= object_item->status & mh_mEventStatus_NotRet; = object_item->status & mh_mEventStatus_NotRet;
info->a_alarm_exist[a_cnt] = 1; info->a_alarm_exist[a_cnt] = 1;
if ( object_item->display_time.tv_sec == 0 && a_cnt < alarmsize)
time_GetTime( &object_item->display_time);
a_cnt++; a_cnt++;
break; break;
case mh_eEventPrio_B: case mh_eEventPrio_B:
...@@ -2601,6 +2634,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info) ...@@ -2601,6 +2634,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info)
info->b_alarm_active[b_cnt] info->b_alarm_active[b_cnt]
= object_item->status & mh_mEventStatus_NotRet; = object_item->status & mh_mEventStatus_NotRet;
info->b_alarm_exist[b_cnt] = 1; info->b_alarm_exist[b_cnt] = 1;
if ( object_item->display_time.tv_sec == 0)
time_GetTime( &object_item->display_time);
b_cnt++; b_cnt++;
break; break;
case mh_eEventPrio_C: case mh_eEventPrio_C:
...@@ -2617,6 +2652,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info) ...@@ -2617,6 +2652,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info)
info->c_alarm_active[c_cnt] info->c_alarm_active[c_cnt]
= object_item->status & mh_mEventStatus_NotRet; = object_item->status & mh_mEventStatus_NotRet;
info->c_alarm_exist[c_cnt] = 1; info->c_alarm_exist[c_cnt] = 1;
if ( object_item->display_time.tv_sec == 0)
time_GetTime( &object_item->display_time);
c_cnt++; c_cnt++;
break; break;
case mh_eEventPrio_D: case mh_eEventPrio_D:
...@@ -2633,6 +2670,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info) ...@@ -2633,6 +2670,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info)
info->d_alarm_active[d_cnt] info->d_alarm_active[d_cnt]
= object_item->status & mh_mEventStatus_NotRet; = object_item->status & mh_mEventStatus_NotRet;
info->d_alarm_exist[d_cnt] = 1; info->d_alarm_exist[d_cnt] = 1;
if ( object_item->display_time.tv_sec == 0)
time_GetTime( &object_item->display_time);
d_cnt++; d_cnt++;
break; break;
default:; default:;
...@@ -2656,6 +2695,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info) ...@@ -2656,6 +2695,8 @@ int EvList::get_alarm_info(evlist_sAlarmInfo* info)
= object_item->status & mh_mEventStatus_NotRet; = object_item->status & mh_mEventStatus_NotRet;
info->i_alarm_exist[i_cnt] = 1; info->i_alarm_exist[i_cnt] = 1;
info->i_alarm_eventtype[i_cnt] = object_item->event_type; info->i_alarm_eventtype[i_cnt] = object_item->event_type;
if ( object_item->display_time.tv_sec == 0)
time_GetTime( &object_item->display_time);
i_cnt++; i_cnt++;
} }
break; break;
......
...@@ -245,9 +245,9 @@ public: ...@@ -245,9 +245,9 @@ public:
void set_display_hundredth(int value); void set_display_hundredth(int value);
void set_hide_object(int value); void set_hide_object(int value);
void set_hide_text(int value); void set_hide_text(int value);
int get_alarm_info(evlist_sAlarmInfo* info); int get_alarm_info(evlist_sAlarmInfo* info, int backward, int alarmsize);
int get_last_not_acked_prio( int get_last_not_acked_prio(mh_sEventId** id, unsigned long type,
mh_sEventId** id, unsigned long type, unsigned long prio); unsigned long prio, int backward, int timecheck);
int get_selected_event(char* eventname, ItemAlarm** item); int get_selected_event(char* eventname, ItemAlarm** item);
int get_destination(pwr_tTime time, void** dest); int get_destination(pwr_tTime time, void** dest);
void block_remove(); void block_remove();
...@@ -304,6 +304,7 @@ public: ...@@ -304,6 +304,7 @@ public:
pwr_tText256 eventmoretext; pwr_tText256 eventmoretext;
pwr_tAttrRef supobject; pwr_tAttrRef supobject;
int check; int check;
pwr_tTime display_time;
void update_text(int tree_node); void update_text(int tree_node);
}; };
......
...@@ -134,14 +134,20 @@ void Op::activate_exit() ...@@ -134,14 +134,20 @@ void Op::activate_exit()
void Op::activate_aalarm_ack() void Op::activate_aalarm_ack()
{ {
int backward = layout_mask & pwr_mOpWindLayoutMask_ShowOldestNotAckedAlarm ? 1 : 0;
int timecheck = layout_mask & pwr_mOpWindLayoutMask_CheckAckAlarmTime ? 1 : 0;
if (ack_last_cb) if (ack_last_cb)
(ack_last_cb)(parent_ctx, evlist_eEventType_Alarm, mh_eEventPrio_A); (ack_last_cb)(parent_ctx, evlist_eEventType_Alarm, mh_eEventPrio_A, backward, timecheck);
} }
void Op::activate_balarm_ack() void Op::activate_balarm_ack()
{ {
int backward = layout_mask & pwr_mOpWindLayoutMask_ShowOldestNotAckedAlarm ? 1 : 0;
int timecheck = layout_mask & pwr_mOpWindLayoutMask_CheckAckAlarmTime ? 1 : 0;
if (ack_last_cb) if (ack_last_cb)
(ack_last_cb)(parent_ctx, balarm_type, balarm_prio); (ack_last_cb)(parent_ctx, balarm_type, balarm_prio, backward, timecheck);
} }
void Op::activate_alarmlist() void Op::activate_alarmlist()
......
...@@ -97,8 +97,8 @@ public: ...@@ -97,8 +97,8 @@ public:
void (*map_cb)(void*); void (*map_cb)(void*);
void (*help_cb)(void*, const char*); void (*help_cb)(void*, const char*);
void (*close_cb)(void*); void (*close_cb)(void*);
int (*get_alarm_info_cb)(void*, evlist_sAlarmInfo*); int (*get_alarm_info_cb)(void*, evlist_sAlarmInfo*, int, int);
void (*ack_last_cb)(void*, unsigned long, unsigned long); void (*ack_last_cb)(void*, unsigned long, unsigned long, int, int);
int (*is_authorized_cb)(void*, unsigned int); int (*is_authorized_cb)(void*, unsigned int);
CoWow* wow; CoWow* wow;
pwr_tMask layout_mask; pwr_tMask layout_mask;
......
...@@ -153,9 +153,9 @@ static int xnav_op_command_cb(void* xnav, char* command); ...@@ -153,9 +153,9 @@ static int xnav_op_command_cb(void* xnav, char* command);
static void xnav_op_close_cb(void* ctx); static void xnav_op_close_cb(void* ctx);
static void xnav_op_help_cb(void* ctx, const char* key); static void xnav_op_help_cb(void* ctx, const char* key);
static void xnav_op_map_cb(void* ctx); static void xnav_op_map_cb(void* ctx);
static int xnav_op_get_alarm_info_cb(void* xnav, evlist_sAlarmInfo* info); static int xnav_op_get_alarm_info_cb(void* xnav, evlist_sAlarmInfo* info, int backward, int alarmsize);
static void xnav_op_ack_last_cb( static void xnav_op_ack_last_cb(void* xnav, unsigned long type, unsigned long prio, int backward,
void* xnav, unsigned long type, unsigned long prio); int timecheck);
static void xnav_trend_close_cb(void* ctx, XttTrend* trend); static void xnav_trend_close_cb(void* ctx, XttTrend* trend);
static void xnav_trend_command_cb(void* ctx, const char* key); static void xnav_trend_command_cb(void* ctx, const char* key);
static void xnav_trend_help_cb(void* ctx, const char* key); static void xnav_trend_help_cb(void* ctx, const char* key);
...@@ -279,7 +279,8 @@ dcli_tCmdTable xnav_command_table[] = { ...@@ -279,7 +279,8 @@ dcli_tCmdTable xnav_command_table[] = {
{ "dcli_arg1", "/REGULAREXPRESSION", "/NEXT", "" } }, { "dcli_arg1", "/REGULAREXPRESSION", "/NEXT", "" } },
{ "EVENTLIST", &xnav_eventlist_func, { "EVENTLIST", &xnav_eventlist_func,
{ {
"dcli_arg1", "/PRIORITY", "/NAME", "/ALL", "/AUTOACKNOWLEDGE", "", "dcli_arg1", "/PRIORITY", "/NAME", "/ALL", "/AUTOACKNOWLEDGE", "/OLDEST",
"/TIMECHECK", "",
} }, } },
{ "TEST", &xnav_test_func, { "dcli_arg1", "dcli_arg2", "" } }, { "TEST", &xnav_test_func, { "dcli_arg1", "dcli_arg2", "" } },
{ "LOGGING", &xnav_logging_func, { "LOGGING", &xnav_logging_func,
...@@ -2594,6 +2595,11 @@ static int xnav_eventlist_func(void* client_data, void* client_flag) ...@@ -2594,6 +2595,11 @@ static int xnav_eventlist_func(void* client_data, void* client_flag)
char autoack_str[80]; char autoack_str[80];
mh_sEventId* id; mh_sEventId* id;
int all; int all;
int oldest;
int timecheck;
oldest = ODD(dcli_get_qualifier("/OLDEST", 0, 0));
timecheck = ODD(dcli_get_qualifier("/TIMECHECK", 0, 0));
all = ODD(dcli_get_qualifier("/ALL", 0, 0)); all = ODD(dcli_get_qualifier("/ALL", 0, 0));
if (all) { if (all) {
...@@ -2630,28 +2636,28 @@ static int xnav_eventlist_func(void* client_data, void* client_flag) ...@@ -2630,28 +2636,28 @@ static int xnav_eventlist_func(void* client_data, void* client_flag)
if (ODD(dcli_get_qualifier("/PRIORITY", prio_str, sizeof(prio_str)))) { if (ODD(dcli_get_qualifier("/PRIORITY", prio_str, sizeof(prio_str)))) {
str_ToUpper(prio_str, prio_str); str_ToUpper(prio_str, prio_str);
if (streq(prio_str, "A")) if (streq(prio_str, "A"))
xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_A); xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_A, oldest, timecheck);
else if (streq(prio_str, "B")) else if (streq(prio_str, "B"))
xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_B); xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_B, oldest, timecheck);
else if (streq(prio_str, "C")) else if (streq(prio_str, "C"))
xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_C); xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_C, oldest, timecheck);
else if (streq(prio_str, "D")) else if (streq(prio_str, "D"))
xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_D); xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_D, oldest, timecheck);
else if (str_StartsWith(prio_str, "I")) else if (str_StartsWith(prio_str, "I"))
xnav->ev->ack_last_prio(evlist_eEventType_Info, 0); xnav->ev->ack_last_prio(evlist_eEventType_Info, 0, oldest, timecheck);
else if (streq(prio_str, "NOA")) { else if (streq(prio_str, "NOA")) {
if (ODD(xnav->ev->get_last_not_acked_prio( if (ODD(xnav->ev->get_last_not_acked_prio(
&id, evlist_eEventType_Alarm, mh_eEventPrio_B))) &id, 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, oldest, timecheck);
else if (ODD(xnav->ev->get_last_not_acked_prio( else if (ODD(xnav->ev->get_last_not_acked_prio(
&id, evlist_eEventType_Alarm, mh_eEventPrio_C))) &id, evlist_eEventType_Alarm, mh_eEventPrio_C)))
xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_C); xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_C, oldest, timecheck);
else if (ODD(xnav->ev->get_last_not_acked_prio( else if (ODD(xnav->ev->get_last_not_acked_prio(
&id, evlist_eEventType_Alarm, mh_eEventPrio_D))) &id, evlist_eEventType_Alarm, mh_eEventPrio_D)))
xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_D); xnav->ev->ack_last_prio(evlist_eEventType_Alarm, mh_eEventPrio_D, oldest, timecheck);
else if (ODD(xnav->ev->get_last_not_acked_prio( else if (ODD(xnav->ev->get_last_not_acked_prio(
&id, evlist_eEventType_Info, 0))) &id, evlist_eEventType_Info, 0)))
xnav->ev->ack_last_prio(evlist_eEventType_Info, 0); xnav->ev->ack_last_prio(evlist_eEventType_Info, 0, oldest, timecheck);
} else } else
xnav->message('E', "Unknown priority"); xnav->message('E', "Unknown priority");
} else } else
...@@ -9718,19 +9724,19 @@ void XNav::ge_event_exec( ...@@ -9718,19 +9724,19 @@ void XNav::ge_event_exec(
} }
} }
static int xnav_op_get_alarm_info_cb(void* xnav, evlist_sAlarmInfo* info) static int xnav_op_get_alarm_info_cb(void* xnav, evlist_sAlarmInfo* info, int backward, int alarmsize)
{ {
if (((XNav*)xnav)->ev) if (((XNav*)xnav)->ev)
return ((XNav*)xnav)->ev->get_alarm_info(info); return ((XNav*)xnav)->ev->get_alarm_info(info, backward, alarmsize);
else else
return 0; return 0;
} }
static void xnav_op_ack_last_cb( static void xnav_op_ack_last_cb(void* xnav, unsigned long type, unsigned long prio, int backward,
void* xnav, unsigned long type, unsigned long prio) int timecheck)
{ {
if (((XNav*)xnav)->ev) if (((XNav*)xnav)->ev)
((XNav*)xnav)->ev->ack_last_prio(type, prio); ((XNav*)xnav)->ev->ack_last_prio(type, prio, backward, timecheck);
} }
static int xnav_op_command_cb(void* xnav, char* command) static int xnav_op_command_cb(void* xnav, char* command)
......
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