Commit 256ae378 authored by claes's avatar claes

Enum and Mask displayed in xtt, and alarm blocking implemented

parent 9f068076
/* rt_xtt.cpp -- Display plant and node hiererachy
/* rt_xtt.cpp -- Display plant and node hierarchy
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
......@@ -388,7 +388,7 @@ int xnav_attr_string_to_value( int type_id, char *value_str,
//
// Convert attribute value to string
//
void xnav_attrvalue_to_string( int type_id, void *value_ptr,
void xnav_attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
char *str, int size, int *len, char *format)
{
char hiername[120];
......@@ -479,14 +479,41 @@ void xnav_attrvalue_to_string( int type_id, void *value_ptr,
}
case pwr_eType_UInt32:
case pwr_eType_Mask:
{
if ( !format)
*len = sprintf( str, "%d", *(unsigned int *)value_ptr);
else
*len = sprintf( str, format, *(unsigned int *)value_ptr);
break;
}
case pwr_eType_Enum:
{
gdh_sValueDef *valuedef;
int rows;
bool converted = false;
sts = gdh_GetEnumValueDef( tid, &valuedef, &rows);
if ( ODD(sts)) {
for ( int i = 0; i < rows; i++) {
if ( valuedef[i].Value->Value == *(pwr_tInt32 *)value_ptr) {
strcpy( str, valuedef[i].Value->Text);
*len = strlen(str);
converted = true;
break;
}
}
free( (char *)valuedef);
}
if ( !converted) {
if ( !format)
*len = sprintf( str, "%d", *(unsigned int *)value_ptr);
else
*len = sprintf( str, format, *(unsigned int *)value_ptr);
break;
}
break;
}
case pwr_eType_String:
{
strncpy( str, (char *)value_ptr, size);
......@@ -638,6 +665,7 @@ int XNav::collect_insert( pwr_sAttrRef *arp)
unsigned int a_size;
unsigned int a_offset;
unsigned int a_dim;
pwr_tTid a_tid;
sts = gdh_AttrrefToName ( arp, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
......@@ -650,6 +678,9 @@ int XNav::collect_insert( pwr_sAttrRef *arp)
sts = gdh_GetAttributeCharAttrref( arp, &a_type_id, &a_size, &a_offset,
&a_dim);
if ( EVEN(sts)) return sts;
sts = gdh_GetAttrRefTid( arp, &a_tid);
if ( EVEN(sts)) return sts;
}
else {
sts = xnav_get_trace_attr( arp, attr);
......@@ -665,10 +696,13 @@ int XNav::collect_insert( pwr_sAttrRef *arp)
sts = gdh_GetAttributeCharAttrref( &ar, &a_type_id, &a_size, &a_offset,
&a_dim);
if ( EVEN(sts)) return sts;
sts = gdh_GetAttrRefTid( arp, &a_tid);
if ( EVEN(sts)) return sts;
}
item = new ItemCollect( collect_brow, arp->Objid, attr, NULL,
flow_eDest_IntoLast, a_type_id, a_size, 0);
flow_eDest_IntoLast, a_type_id, a_tid, a_size, 0);
message( 'I', "Object inserted");
return 1;
}
......@@ -1718,9 +1752,20 @@ static int xnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
case xnav_eItemType_Collect:
case xnav_eItemType_Local:
case xnav_eItemType_ObjectStruct:
sts = item->open_children( xnav->brow, 0, 0);
if (ODD(sts)) break;
if ( xnav->gbl.advanced_user && xnav->change_value_cb)
(xnav->change_value_cb)( xnav->parent_ctx);
break;
case xnav_eItemType_Enum:
if ( xnav->gbl.advanced_user)
((ItemEnum *)item)->set_value();
break;
case xnav_eItemType_Mask:
if ( xnav->gbl.advanced_user)
((ItemMask *)item)->toggle_value();
break;
default:
sts = item->open_children( xnav->brow, 0, 0);
if ( sts == XNAV__NOCHILD && xnav->gbl.advanced_user)
......@@ -1910,6 +1955,29 @@ static int xnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
brow_SelectClear( xnav->brow->ctx);
}
break;
case flow_eEvent_Radiobutton:
{
switch ( event->object.object_type)
{
case flow_eObjectType_Node:
brow_GetUserData( event->object.object, (void **)&item);
switch( item->type) {
case xnav_eItemType_Enum:
if ( !event->radiobutton.value)
((ItemEnum *)item)->set_value();
break;
case xnav_eItemType_Mask:
((ItemMask *)item)->set_value( !event->radiobutton.value);
break;
default:
;
}
break;
default:
;
}
break;
}
case flow_eEvent_MB3Press:
{
// Popup menu
......@@ -2039,6 +2107,8 @@ static void xnav_trace_scan( XNav *xnav)
XtWidgetToApplicationContext(xnav->brow_widget) , time,
(XtTimerCallbackProc)xnav_trace_scan, xnav);
}
xnav->update_alarminfo();
if ( xnav->ev)
xnav->ev->update( xnav->gbl.scantime);
if ( xnav->op)
......@@ -2082,11 +2152,49 @@ static int xnav_trace_scan_bc( brow_tObject object, void *p)
else
item->first_scan = 0;
xnav_attrvalue_to_string( item->type_id, p, buf, sizeof(buf), &len, NULL);
xnav_attrvalue_to_string( item->type_id, item->tid, p, buf, sizeof(buf), &len, NULL);
brow_SetAnnotation( object, 1, buf, len);
memcpy( item->old_value, p, min(item->size, (int) sizeof(item->old_value)));
break;
}
case xnav_eItemType_Enum: {
ItemEnum *item;
item = (ItemEnum *)base_item;
if ( !item->first_scan) {
if ( memcmp( item->old_value, p, sizeof(pwr_tEnum)) == 0)
// No change since last time
return 1;
}
else
item->first_scan = 0;
if ( *(pwr_tEnum *)p == item->num)
brow_SetRadiobutton( object, 0, 1);
else
brow_SetRadiobutton( object, 0, 0);
memcpy( item->old_value, p, sizeof(pwr_tEnum));
break;
}
case xnav_eItemType_Mask: {
ItemMask *item;
item = (ItemMask *)base_item;
if ( !item->first_scan) {
if ( memcmp( item->old_value, p, sizeof(pwr_tMask)) == 0)
// No change since last time
return 1;
}
else
item->first_scan = 0;
if ( *(pwr_tMask *)p & item->num)
brow_SetRadiobutton( object, 0, 1);
else
brow_SetRadiobutton( object, 0, 0);
memcpy( item->old_value, p, sizeof(pwr_tMask));
break;
}
case xnav_eItemType_Local:
{
ItemLocal *item;
......@@ -2107,7 +2215,7 @@ static int xnav_trace_scan_bc( brow_tObject object, void *p)
else
item->first_scan = 0;
xnav_attrvalue_to_string( item->type_id, p, buf, sizeof(buf), &len, NULL);
xnav_attrvalue_to_string( item->type_id, 0, p, buf, sizeof(buf), &len, NULL);
brow_SetAnnotation( object, 1, buf, len);
memcpy( item->old_value, p, min(item->size, (int) sizeof(item->old_value)));
break;
......@@ -2132,7 +2240,7 @@ static int xnav_trace_scan_bc( brow_tObject object, void *p)
else
item->first_scan = 0;
xnav_attrvalue_to_string( item->type_id, p, buf, sizeof(buf), &len, NULL);
xnav_attrvalue_to_string( item->type_id, 0, p, buf, sizeof(buf), &len, NULL);
brow_SetAnnotation( object, 1, buf, len);
memcpy( item->old_value, p, min(item->size, (int) sizeof(item->old_value)));
break;
......@@ -2196,7 +2304,7 @@ static int xnav_trace_scan_bc( brow_tObject object, void *p)
if ( !nochange)
{
xnav_attrvalue_to_string( item->col.elem[i].type_id,
xnav_attrvalue_to_string( item->col.elem[i].type_id, 0,
item->col.elem[i].value_p, buf, sizeof(buf), &len,
item->col.elem[i].format);
brow_SetAnnotation( object, i, buf, len);
......@@ -2231,6 +2339,8 @@ static int xnav_trace_connect_bc( brow_tObject object, char *name, char *attr,
switch( base_item->type)
{
case xnav_eItemType_Attr:
case xnav_eItemType_Enum:
case xnav_eItemType_Mask:
case xnav_eItemType_AttrArrayElem:
case xnav_eItemType_Collect:
{
......@@ -2328,6 +2438,64 @@ static int xnav_trace_disconnect_bc( brow_tObject object)
return 1;
}
int XNav::update_alarminfo()
{
flow_tObject *object_list;
int object_cnt;
Item *item;
int i;
pwr_tStatus sts;
brow_GetObjectList( brow->ctx, &object_list, &object_cnt);
for ( i = 0; i < object_cnt; i++) {
brow_GetUserData( object_list[i], (void **)&item);
switch ( item->type) {
case xnav_eItemType_Object: {
pwr_tUInt32 alarm_level, max_alarm_level;
pwr_tUInt32 block_level, max_block_level, visibility;
ItemObject *oitem = (ItemObject *)item;
sts = gdh_GetAlarmInfo( oitem->objid, &alarm_level, &max_alarm_level,
&block_level, &max_block_level, &visibility);
if ( EVEN(sts)) break;
// Update alarm pixmap
if ( alarm_level != oitem->alarm_level ||
max_alarm_level != oitem->max_alarm_level) {
if ( alarm_level && max_alarm_level)
brow_SetAnnotPixmap( object_list[i], 2, brow->pixmap_alarm2);
else if ( alarm_level)
brow_SetAnnotPixmap( object_list[i], 2, brow->pixmap_arrowright);
else if ( max_alarm_level)
brow_SetAnnotPixmap( object_list[i], 2, brow->pixmap_arrowdown);
else
brow_RemoveAnnotPixmap( object_list[i], 2);
oitem->alarm_level = alarm_level;
oitem->max_alarm_level = max_alarm_level;
}
// Update block pixmap
if ( block_level != oitem->block_level ||
max_block_level != oitem->max_block_level) {
if ( block_level && max_block_level)
brow_SetAnnotPixmap( object_list[i], 3, brow->pixmap_block2);
else if ( block_level)
brow_SetAnnotPixmap( object_list[i], 3, brow->pixmap_blockr);
else if ( max_block_level)
brow_SetAnnotPixmap( object_list[i], 3, brow->pixmap_blockd);
else
brow_RemoveAnnotPixmap( object_list[i], 3);
oitem->block_level = block_level;
oitem->max_block_level = max_block_level;
}
break;
}
default: ;
}
}
return 1;
}
int XNav::display_object( pwr_tObjid objid, int open)
{
......@@ -3176,6 +3344,8 @@ void XNav::enable_events( XNavBrow *brow)
xnav_brow_cb);
brow_EnableEvent( brow->ctx, flow_eEvent_Resized, flow_eEventType_CallBack,
xnav_brow_cb);
brow_EnableEvent( brow->ctx, flow_eEvent_Radiobutton, flow_eEventType_CallBack,
xnav_brow_cb);
}
//
......
......@@ -152,6 +152,7 @@ typedef enum {
applist_eType_Trace,
applist_eType_Graph,
applist_eType_Attr,
applist_eType_AttrOne,
applist_eType_Trend,
applist_eType_Crossref,
applist_eType_Hist,
......@@ -351,10 +352,12 @@ class XNav {
int open_object( pwr_sAttrRef *arp);
int open_crossref( pwr_sAttrRef *arp);
void swap( int mode);
int update_alarminfo();
// Command module member functions
int command( char *cmd);
pwr_tStatus get_command_sts();
int readcmdfile( char *incommand);
int show_database();
int get_current_object(
......@@ -428,7 +431,7 @@ int xnav_cut_segments (
int xnav_attr_string_to_value( int type_id, char *value_str,
void *buffer_ptr, int buff_size, int attr_size);
void xnav_attrvalue_to_string( int type_id, void *value_ptr,
void xnav_attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
char *str, int size, int *len, char *format);
Widget xnav_create_popup_menu( XNav *xnav, pwr_sAttrRef attrref,
......@@ -440,6 +443,15 @@ int xnav_call_method( XNav *xnav, char *method, char *filter,
xmenu_eItemType item_type,
xmenu_mUtility caller,
unsigned int priv, char *arg);
int xnav_call_object_method( XNav *xnav, pwr_sAttrRef attrref,
xmenu_eItemType item_type,
xmenu_mUtility caller,
unsigned int priv, char *method_name);
int xnav_check_object_methodfilter( XNav *xnav, pwr_sAttrRef attrref,
xmenu_eItemType item_type,
xmenu_mUtility caller,
unsigned int priv, char *method_name);
void xnav_popup_menu_cb( void *xnav, pwr_sAttrRef attrref,
unsigned long item_type,
unsigned long utility, char *arg, Widget *popup);
......
......@@ -130,6 +130,56 @@ extern "C" {
#include "xnav_bitmap_object18.h"
#include "xnav_bitmap_object20.h"
#include "xnav_bitmap_object24.h"
#include "xnav_bitmap_attrenum12.h"
#include "xnav_bitmap_attrmask12.h"
#include "xnav_bitmap_block2_8.h"
#include "xnav_bitmap_block2_10.h"
#include "xnav_bitmap_block2_12.h"
#include "xnav_bitmap_block2_14.h"
#include "xnav_bitmap_block2_16.h"
#include "xnav_bitmap_block2_18.h"
#include "xnav_bitmap_block2_20.h"
#include "xnav_bitmap_block2_24.h"
#include "xnav_bitmap_blockr_8.h"
#include "xnav_bitmap_blockr_10.h"
#include "xnav_bitmap_blockr_12.h"
#include "xnav_bitmap_blockr_14.h"
#include "xnav_bitmap_blockr_16.h"
#include "xnav_bitmap_blockr_18.h"
#include "xnav_bitmap_blockr_20.h"
#include "xnav_bitmap_blockr_24.h"
#include "xnav_bitmap_blockd_8.h"
#include "xnav_bitmap_blockd_10.h"
#include "xnav_bitmap_blockd_12.h"
#include "xnav_bitmap_blockd_14.h"
#include "xnav_bitmap_blockd_16.h"
#include "xnav_bitmap_blockd_18.h"
#include "xnav_bitmap_blockd_20.h"
#include "xnav_bitmap_blockd_24.h"
#include "xnav_bitmap_alarm2_8.h"
#include "xnav_bitmap_alarm2_10.h"
#include "xnav_bitmap_alarm2_12.h"
#include "xnav_bitmap_alarm2_14.h"
#include "xnav_bitmap_alarm2_16.h"
#include "xnav_bitmap_alarm2_18.h"
#include "xnav_bitmap_alarm2_20.h"
#include "xnav_bitmap_alarm2_24.h"
#include "xnav_bitmap_arrowdown8.h"
#include "xnav_bitmap_arrowdown10.h"
#include "xnav_bitmap_arrowdown12.h"
#include "xnav_bitmap_arrowdown14.h"
#include "xnav_bitmap_arrowdown16.h"
#include "xnav_bitmap_arrowdown18.h"
#include "xnav_bitmap_arrowdown20.h"
#include "xnav_bitmap_arrowdown24.h"
#include "xnav_bitmap_arrowright8.h"
#include "xnav_bitmap_arrowright10.h"
#include "xnav_bitmap_arrowright12.h"
#include "xnav_bitmap_arrowright14.h"
#include "xnav_bitmap_arrowright16.h"
#include "xnav_bitmap_arrowright18.h"
#include "xnav_bitmap_arrowright20.h"
#include "xnav_bitmap_arrowright24.h"
#if 0
......@@ -169,6 +219,14 @@ void XNavBrow::free_pixmaps()
brow_FreeAnnotPixmap( ctx, pixmap_morehelp);
brow_FreeAnnotPixmap( ctx, pixmap_closehelp);
brow_FreeAnnotPixmap( ctx, pixmap_object);
brow_FreeAnnotPixmap( ctx, pixmap_attrenum);
brow_FreeAnnotPixmap( ctx, pixmap_attrmask);
brow_FreeAnnotPixmap( ctx, pixmap_block2);
brow_FreeAnnotPixmap( ctx, pixmap_blockr);
brow_FreeAnnotPixmap( ctx, pixmap_blockd);
brow_FreeAnnotPixmap( ctx, pixmap_alarm2);
brow_FreeAnnotPixmap( ctx, pixmap_arrowdown);
brow_FreeAnnotPixmap( ctx, pixmap_arrowright);
}
//
......@@ -611,6 +669,205 @@ void XNavBrow::allocate_pixmaps()
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_object);
for ( i = 0; i < 9; i++) {
pixmap_data[i].width =xnav_bitmap_attrenum12_width;
pixmap_data[i].height =xnav_bitmap_attrenum12_height;
pixmap_data[i].bits = (char *)xnav_bitmap_attrenum12_bits;
}
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_attrenum);
for ( i = 0; i < 9; i++) {
pixmap_data[i].width =xnav_bitmap_attrmask12_width;
pixmap_data[i].height =xnav_bitmap_attrmask12_height;
pixmap_data[i].bits = (char *)xnav_bitmap_attrmask12_bits;
}
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_attrmask);
i = 0;
pixmap_data[i].width =xnav_bitmap_block2_8_width;
pixmap_data[i].height =xnav_bitmap_block2_8_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_8_bits;
pixmap_data[i].width =xnav_bitmap_block2_10_width;
pixmap_data[i].height =xnav_bitmap_block2_10_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_10_bits;
pixmap_data[i].width =xnav_bitmap_block2_12_width;
pixmap_data[i].height =xnav_bitmap_block2_12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_12_bits;
pixmap_data[i].width =xnav_bitmap_block2_14_width;
pixmap_data[i].height =xnav_bitmap_block2_14_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_14_bits;
pixmap_data[i].width =xnav_bitmap_block2_16_width;
pixmap_data[i].height =xnav_bitmap_block2_16_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_16_bits;
pixmap_data[i].width =xnav_bitmap_block2_18_width;
pixmap_data[i].height =xnav_bitmap_block2_18_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_18_bits;
pixmap_data[i].width =xnav_bitmap_block2_20_width;
pixmap_data[i].height =xnav_bitmap_block2_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_20_bits;
pixmap_data[i].width =xnav_bitmap_block2_20_width;
pixmap_data[i].height =xnav_bitmap_block2_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_20_bits;
pixmap_data[i].width =xnav_bitmap_block2_24_width;
pixmap_data[i].height =xnav_bitmap_block2_24_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_block2_24_bits;
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_block2);
i = 0;
pixmap_data[i].width =xnav_bitmap_blockd_8_width;
pixmap_data[i].height =xnav_bitmap_blockd_8_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_8_bits;
pixmap_data[i].width =xnav_bitmap_blockd_10_width;
pixmap_data[i].height =xnav_bitmap_blockd_10_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_10_bits;
pixmap_data[i].width =xnav_bitmap_blockd_12_width;
pixmap_data[i].height =xnav_bitmap_blockd_12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_12_bits;
pixmap_data[i].width =xnav_bitmap_blockd_14_width;
pixmap_data[i].height =xnav_bitmap_blockd_14_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_14_bits;
pixmap_data[i].width =xnav_bitmap_blockd_16_width;
pixmap_data[i].height =xnav_bitmap_blockd_16_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_16_bits;
pixmap_data[i].width =xnav_bitmap_blockd_18_width;
pixmap_data[i].height =xnav_bitmap_blockd_18_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_18_bits;
pixmap_data[i].width =xnav_bitmap_blockd_20_width;
pixmap_data[i].height =xnav_bitmap_blockd_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_20_bits;
pixmap_data[i].width =xnav_bitmap_blockd_20_width;
pixmap_data[i].height =xnav_bitmap_blockd_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_20_bits;
pixmap_data[i].width =xnav_bitmap_blockd_24_width;
pixmap_data[i].height =xnav_bitmap_blockd_24_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockd_24_bits;
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_blockd);
i = 0;
pixmap_data[i].width =xnav_bitmap_blockr_8_width;
pixmap_data[i].height =xnav_bitmap_blockr_8_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_8_bits;
pixmap_data[i].width =xnav_bitmap_blockr_10_width;
pixmap_data[i].height =xnav_bitmap_blockr_10_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_10_bits;
pixmap_data[i].width =xnav_bitmap_blockr_12_width;
pixmap_data[i].height =xnav_bitmap_blockr_12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_12_bits;
pixmap_data[i].width =xnav_bitmap_blockr_14_width;
pixmap_data[i].height =xnav_bitmap_blockr_14_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_14_bits;
pixmap_data[i].width =xnav_bitmap_blockr_16_width;
pixmap_data[i].height =xnav_bitmap_blockr_16_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_16_bits;
pixmap_data[i].width =xnav_bitmap_blockr_18_width;
pixmap_data[i].height =xnav_bitmap_blockr_18_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_18_bits;
pixmap_data[i].width =xnav_bitmap_blockr_20_width;
pixmap_data[i].height =xnav_bitmap_blockr_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_20_bits;
pixmap_data[i].width =xnav_bitmap_blockr_20_width;
pixmap_data[i].height =xnav_bitmap_blockr_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_20_bits;
pixmap_data[i].width =xnav_bitmap_blockr_24_width;
pixmap_data[i].height =xnav_bitmap_blockr_24_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_blockr_24_bits;
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_blockr);
i = 0;
pixmap_data[i].width =xnav_bitmap_alarm2_8_width;
pixmap_data[i].height =xnav_bitmap_alarm2_8_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_8_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_10_width;
pixmap_data[i].height =xnav_bitmap_alarm2_10_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_10_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_12_width;
pixmap_data[i].height =xnav_bitmap_alarm2_12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_12_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_14_width;
pixmap_data[i].height =xnav_bitmap_alarm2_14_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_14_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_16_width;
pixmap_data[i].height =xnav_bitmap_alarm2_16_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_16_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_18_width;
pixmap_data[i].height =xnav_bitmap_alarm2_18_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_18_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_20_width;
pixmap_data[i].height =xnav_bitmap_alarm2_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_20_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_20_width;
pixmap_data[i].height =xnav_bitmap_alarm2_20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_20_bits;
pixmap_data[i].width =xnav_bitmap_alarm2_24_width;
pixmap_data[i].height =xnav_bitmap_alarm2_24_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_alarm2_24_bits;
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_alarm2);
i = 0;
pixmap_data[i].width =xnav_bitmap_arrowdown8_width;
pixmap_data[i].height =xnav_bitmap_arrowdown8_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown8_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown10_width;
pixmap_data[i].height =xnav_bitmap_arrowdown10_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown10_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown12_width;
pixmap_data[i].height =xnav_bitmap_arrowdown12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown12_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown14_width;
pixmap_data[i].height =xnav_bitmap_arrowdown14_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown14_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown16_width;
pixmap_data[i].height =xnav_bitmap_arrowdown16_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown16_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown18_width;
pixmap_data[i].height =xnav_bitmap_arrowdown18_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown18_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown20_width;
pixmap_data[i].height =xnav_bitmap_arrowdown20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown20_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown20_width;
pixmap_data[i].height =xnav_bitmap_arrowdown20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown20_bits;
pixmap_data[i].width =xnav_bitmap_arrowdown24_width;
pixmap_data[i].height =xnav_bitmap_arrowdown24_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowdown24_bits;
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_arrowdown);
i = 0;
pixmap_data[i].width =xnav_bitmap_arrowright8_width;
pixmap_data[i].height =xnav_bitmap_arrowright8_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright8_bits;
pixmap_data[i].width =xnav_bitmap_arrowright10_width;
pixmap_data[i].height =xnav_bitmap_arrowright10_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright10_bits;
pixmap_data[i].width =xnav_bitmap_arrowright12_width;
pixmap_data[i].height =xnav_bitmap_arrowright12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright12_bits;
pixmap_data[i].width =xnav_bitmap_arrowright14_width;
pixmap_data[i].height =xnav_bitmap_arrowright14_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright14_bits;
pixmap_data[i].width =xnav_bitmap_arrowright16_width;
pixmap_data[i].height =xnav_bitmap_arrowright16_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright16_bits;
pixmap_data[i].width =xnav_bitmap_arrowright18_width;
pixmap_data[i].height =xnav_bitmap_arrowright18_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright18_bits;
pixmap_data[i].width =xnav_bitmap_arrowright20_width;
pixmap_data[i].height =xnav_bitmap_arrowright20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright20_bits;
pixmap_data[i].width =xnav_bitmap_arrowright20_width;
pixmap_data[i].height =xnav_bitmap_arrowright20_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright20_bits;
pixmap_data[i].width =xnav_bitmap_arrowright24_width;
pixmap_data[i].height =xnav_bitmap_arrowright24_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_arrowright24_bits;
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_arrowright);
}
//
......@@ -627,13 +884,15 @@ void XNavBrow::create_nodeclasses()
brow_AddFrame( nc_object, 0, 0, 20, 0.8, flow_eDrawType_Line, -1, 1);
brow_AddAnnotPixmap( nc_object, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_object, 1, 1.1, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_object, 2, 0.6, 0,
brow_AddAnnotPixmap( nc_object, 2, 1.1, 0.1, flow_eDrawType_LineRed, 2, 0);
brow_AddAnnotPixmap( nc_object, 3, 1.8, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_object, 2.9, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_object, 7, 0.6, 1,
brow_AddAnnot( nc_object, 7.9, 0.6, 1,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_object, 11, 0.6, 2,
brow_AddAnnot( nc_object, 11.9, 0.6, 2,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
......@@ -643,10 +902,10 @@ void XNavBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_attr);
brow_AddFrame( nc_attr, 0, 0, 20, 0.8, flow_eDrawType_Line, -1, 1);
brow_AddAnnotPixmap( nc_attr, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_attr, 2, 0.6, 0,
brow_AddAnnot( nc_attr, 2.9, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_attr, 8, 0.6, 1,
brow_AddAnnot( nc_attr, 8.9, 0.6, 1,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
......@@ -657,34 +916,34 @@ void XNavBrow::create_nodeclasses()
brow_AddFrame( nc_table, 0, 0, 20, 0.8, flow_eDrawType_Line, -1, 1);
brow_AddAnnotPixmap( nc_table, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_table, 1, 1.1, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_table, 2, 0.6, 0,
brow_AddAnnot( nc_table, 2.9, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table, 8, 0.6, 1,
brow_AddAnnot( nc_table, 8.9, 0.6, 1,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 12, 0.6, 2,
brow_AddAnnot( nc_table, 12.9, 0.6, 2,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 16, 0.6, 3,
brow_AddAnnot( nc_table, 16.9, 0.6, 3,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 20, 0.6, 4,
brow_AddAnnot( nc_table, 20.9, 0.6, 4,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 24, 0.6, 5,
brow_AddAnnot( nc_table, 24.9, 0.6, 5,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 28, 0.6, 6,
brow_AddAnnot( nc_table, 28.9, 0.6, 6,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 32, 0.6, 7,
brow_AddAnnot( nc_table, 32.9, 0.6, 7,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 35, 0.6, 8,
brow_AddAnnot( nc_table, 35.9, 0.6, 8,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_table, 38, 0.6, 9,
brow_AddAnnot( nc_table, 38.9, 0.6, 9,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
......@@ -695,13 +954,13 @@ void XNavBrow::create_nodeclasses()
brow_AddFrame( nc_text, 0, 0, 20, 0.8, flow_eDrawType_Line, -1, 1);
brow_AddAnnotPixmap( nc_text, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_text, 1, 1.1, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_text, 2, 0.6, 0,
brow_AddAnnot( nc_text, 2.9, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_text, 7, 0.6, 1,
brow_AddAnnot( nc_text, 7.9, 0.6, 1,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine,
1);
brow_AddAnnot( nc_text, 11, 0.6, 2,
brow_AddAnnot( nc_text, 11.9, 0.6, 2,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine,
1);
......@@ -711,10 +970,10 @@ void XNavBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_header);
brow_AddFrame( nc_header, 0, 0, 20, 0.8, flow_eDrawType_LineGray, 2, 1);
brow_AddAnnotPixmap( nc_header, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_header, 2, 0.6, 0,
brow_AddAnnot( nc_header, 2.9, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_header, 8, 0.6, 1,
brow_AddAnnot( nc_header, 8.9, 0.6, 1,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
1);
......@@ -724,10 +983,10 @@ void XNavBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_headerlarge);
brow_AddFrame( nc_headerlarge, 0, 0, 20, 1.4, flow_eDrawType_Line, -1, 1);
brow_AddAnnotPixmap( nc_headerlarge, 0, 0.5, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_headerlarge, 2, 1.0, 0,
brow_AddAnnot( nc_headerlarge, 2.9, 1.0, 0,
flow_eDrawType_TextHelveticaBold, 4, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_headerlarge, 8, 1.0, 1,
brow_AddAnnot( nc_headerlarge, 8.9, 1.0, 1,
flow_eDrawType_TextHelveticaBold, 4, flow_eAnnotType_OneLine,
1);
......@@ -737,36 +996,47 @@ void XNavBrow::create_nodeclasses()
flow_eNodeGroup_Common, &nc_table_header);
brow_AddFrame( nc_table_header, 0, 0, 20, 0.8, flow_eDrawType_LineGray, 2, 1);
brow_AddAnnotPixmap( nc_table_header, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_table_header, 2, 0.6, 0,
brow_AddAnnot( nc_table_header, 2.9, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 8, 0.6, 1,
brow_AddAnnot( nc_table_header, 8.9, 0.6, 1,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 12, 0.6, 2,
brow_AddAnnot( nc_table_header, 12.9, 0.6, 2,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 16, 0.6, 3,
brow_AddAnnot( nc_table_header, 16.9, 0.6, 3,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 20, 0.6, 4,
brow_AddAnnot( nc_table_header, 20.9, 0.6, 4,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 24, 0.6, 5,
brow_AddAnnot( nc_table_header, 24.9, 0.6, 5,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 28, 0.6, 6,
brow_AddAnnot( nc_table_header, 28.9, 0.6, 6,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 32, 0.6, 7,
brow_AddAnnot( nc_table_header, 32.9, 0.6, 7,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 35, 0.6, 8,
brow_AddAnnot( nc_table_header, 35.9, 0.6, 8,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_table_header, 38, 0.6, 9,
brow_AddAnnot( nc_table_header, 38.9, 0.6, 9,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_CreateNodeClass( ctx, "NavigatorEnum",
flow_eNodeGroup_Common, &nc_enum);
brow_AddRadiobutton( nc_enum, 12, 0.1, 0.7, 0.7, 0, flow_eDrawType_Line, 1);
brow_AddFrame( nc_enum, 0, 0, 20, 0.8, flow_eDrawType_Line, -1, 1);
brow_AddAnnotPixmap( nc_enum, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_enum, 1, 1.1, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_enum, 2.9, 0.6, 0,
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
}
void XNavBrow::brow_setup()
......
......@@ -36,6 +36,7 @@ class XNavBrow {
brow_tNodeClass nc_header;
brow_tNodeClass nc_headerlarge;
brow_tNodeClass nc_table_header;
brow_tNodeClass nc_enum;
flow_sAnnotPixmap *pixmap_leaf;
flow_sAnnotPixmap *pixmap_map;
flow_sAnnotPixmap *pixmap_openmap;
......@@ -57,6 +58,14 @@ class XNavBrow {
flow_sAnnotPixmap *pixmap_morehelp;
flow_sAnnotPixmap *pixmap_closehelp;
flow_sAnnotPixmap *pixmap_object;
flow_sAnnotPixmap *pixmap_attrenum;
flow_sAnnotPixmap *pixmap_attrmask;
flow_sAnnotPixmap *pixmap_block2;
flow_sAnnotPixmap *pixmap_blockd;
flow_sAnnotPixmap *pixmap_blockr;
flow_sAnnotPixmap *pixmap_alarm2;
flow_sAnnotPixmap *pixmap_arrowdown;
flow_sAnnotPixmap *pixmap_arrowright;
char push_command[200];
void free_pixmaps();
......
......@@ -54,6 +54,7 @@ extern "C" {
#include "xtt_ge.h"
#include "xtt_item.h"
#include "xtt_xnav_crr.h"
#include "xtt_xattone.h"
#include "co_dcli_msg.h"
#include "rt_xnav_msg.h"
#include "co_xhelp.h"
......@@ -66,6 +67,7 @@ extern "C" {
#include "xtt_xcrr.h"
#include "xtt_menu.h"
#include "xtt_url.h"
#include "xtt_block.h"
#define IF_NOGDH_RETURN \
if ( !xnav->gbl.gdh_started)\
......@@ -80,6 +82,7 @@ if ( !xnav->gbl.gdh_started)\
static char null_str[] = "";
static char xtt_version[] = "V3.3a";
static XNav *current_xnav;
static pwr_tStatus command_sts = 1;
static void xnav_ev_help_cb( void *xnav, char *key);
static void xnav_ev_display_in_xnav_cb( void *xnav, pwr_sAttrRef *arp);
......@@ -105,6 +108,7 @@ static int xnav_op_get_alarm_info_cb( void *xnav, evlist_sAlarmInfo *info);
static void xnav_op_ack_last_cb( void *xnav, unsigned long type, unsigned long prio);
static void xnav_trend_close_cb( void *ctx, XttTrend *trend);
static void xnav_fast_close_cb( void *ctx, XttFast *fast);
static void xnav_xao_close_cb( void *ctx, XAttOne *xao);
static void xnav_clog_close_cb( void *ctx);
static int xnav_help_func( void *client_data,
......@@ -147,6 +151,10 @@ static int xnav_test_func( void *client_data,
void *client_flag);
static int xnav_logging_func( void *client_data,
void *client_flag);
static int xnav_call_func( void *client_data,
void *client_flag);
static int xnav_check_func( void *client_data,
void *client_flag);
dcli_tCmdTable xnav_command_table[] = {
{
......@@ -165,7 +173,8 @@ dcli_tCmdTable xnav_command_table[] = {
"/SCROLLBAR", "/WIDTH", "/HEIGHT", "/MENU",
"/NAVIGATOR", "/CENTER", "/OBJECT", "/NEW",
"/INSTANCE", "/COLLECT", "/FOCUS", "/INPUTEMPTY",
"/ENTRY", "/TITLE", "/ACCESS", "/CLASSGRAPH", ""}
"/ENTRY", "/TITLE", "/ACCESS", "/CLASSGRAPH", "/BYPASS",
""}
},
{
"CLOSE",
......@@ -261,7 +270,7 @@ dcli_tCmdTable xnav_command_table[] = {
{
"EVENTLIST",
&xnav_eventlist_func,
{"dcli_arg1", "/PRIORITY", "",}
{"dcli_arg1", "/PRIORITY", "/NAME", "",}
},
{
"TEST",
......@@ -277,6 +286,16 @@ dcli_tCmdTable xnav_command_table[] = {
"/CREATE", "/ALL", "/LINE_SIZE", "/SHORTNAME",
"/NOSHORTNAME", ""}
},
{
"CALL",
&xnav_call_func,
{ "dcli_arg1", "/METHOD", "/OBJECT", ""}
},
{
"CHECK",
&xnav_check_func,
{ "dcli_arg1", "/METHOD", "/OBJECT", ""}
},
{"",}};
......@@ -1464,12 +1483,14 @@ static int xnav_show_func( void *client_data,
if ( !xnav->ev)
{
char alarm_title[40], event_title[40];
char alarm_title[40], event_title[40], block_title[40];
strcpy( alarm_title, Lng::translate( "Alarm list"));
strcpy( event_title, Lng::translate( "Event list"));
xnav->ev = new Ev( xnav, xnav->parent_wid, event_title, alarm_title,
xnav->gbl.UserObject, 0, 1, xnav->gbl.AlarmReturn,
strcpy( alarm_title, Lng::translate( "Alarm List"));
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = new Ev( xnav, xnav->parent_wid,
event_title, alarm_title, block_title,
xnav->gbl.UserObject, 0, 1, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
if ( EVEN(sts))
{
......@@ -1528,12 +1549,14 @@ static int xnav_show_func( void *client_data,
if ( !xnav->ev)
{
char alarm_title[40], event_title[40];
char alarm_title[40], event_title[40], block_title[40];
strcpy( alarm_title, Lng::translate( "Alarm list"));
strcpy( event_title, Lng::translate( "Event list"));
xnav->ev = new Ev( xnav, xnav->parent_wid, event_title, alarm_title,
xnav->gbl.UserObject, 1, 0, xnav->gbl.AlarmReturn,
strcpy( alarm_title, Lng::translate( "Alarm List"));
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = new Ev( xnav, xnav->parent_wid,
event_title, alarm_title, block_title,
xnav->gbl.UserObject, 1, 0, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
if ( EVEN(sts))
{
......@@ -1551,6 +1574,36 @@ static int xnav_show_func( void *client_data,
else
xnav->ev->map_ala();
}
else if ( strncmp( arg1_str, "BLOCKLIST", strlen( arg1_str)) == 0)
{
if ( !xnav->ev)
{
char alarm_title[40], event_title[40], block_title[40];
strcpy( alarm_title, Lng::translate( "Alarm List"));
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = new Ev( xnav, xnav->parent_wid,
event_title, alarm_title, block_title,
xnav->gbl.UserObject, 0, 0, 1, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
if ( EVEN(sts))
{
delete xnav->ev;
xnav->ev = NULL;
xnav->message('E', "Unable to load eventlist");
return XNAV__SUCCESS;
}
xnav->ev->start_trace_cb = xnav_start_trace_cb;
xnav->ev->help_cb = xnav_ev_help_cb;
xnav->ev->display_in_xnav_cb = xnav_ev_display_in_xnav_cb;
xnav->ev->update_info_cb = xnav_ev_update_info_cb;
xnav->ev->popup_menu_cb = xnav_popup_menu_cb;
}
else
xnav->ev->map_blk();
}
else if ( strncmp( arg1_str, "USER", strlen( arg1_str)) == 0)
{
char msg[120];
......@@ -1710,12 +1763,14 @@ static int xnav_eventlist_func( void *client_data,
// Command is "EVENTLIST LOAD"
if ( !xnav->ev)
{
char alarm_title[40], event_title[40];
char alarm_title[40], event_title[40], block_title[40];
strcpy( alarm_title, Lng::translate( "Alarm list"));
strcpy( event_title, Lng::translate( "Event list"));
xnav->ev = new Ev( xnav, xnav->parent_wid, event_title, alarm_title,
xnav->gbl.UserObject, 0, 0, xnav->gbl.AlarmReturn,
strcpy( alarm_title, Lng::translate( "Alarm List"));
strcpy( event_title, Lng::translate( "Event List"));
strcpy( block_title, Lng::translate( "Blocked Alarms"));
xnav->ev = new Ev( xnav, xnav->parent_wid,
event_title, alarm_title, block_title,
xnav->gbl.UserObject, 0, 0, 0, xnav->gbl.AlarmReturn,
xnav->gbl.AlarmAck, xnav->gbl.AlarmBeep, &sts);
if ( EVEN(sts))
{
......@@ -1792,6 +1847,99 @@ static int xnav_eventlist_func( void *client_data,
else
xnav->message('I', "Eventlist is not loaded");
}
else if ( strncmp( arg1_str, "BLOCK", strlen( arg1_str)) == 0)
{
// Command is "EVENTLIST BLOCK"
char prio_str[80];
char name_str[80];
pwr_tObjid objid;
mh_eEventPrio prio;
if ( !xnav->ev) {
xnav->message('E', "Eventlist is not loaded");
return XNAV__SUCCESS;
}
if ( ODD( dcli_get_qualifier( "/NAME", name_str))) {
sts = gdh_NameToObjid( name_str, &objid);
if ( EVEN(sts)) {
xnav->message('E', "Object not found");
return XNAV__SUCCESS;
}
}
else
{
// Get the selected object
sts = xnav->get_current_object( &objid,
name_str, sizeof( name_str), cdh_mName_volumeStrict);
if ( EVEN(sts)) {
xnav->message('E', "Enter name or select an object");
return XNAV__HOLDCOMMAND;
}
}
if ( ODD( dcli_get_qualifier( "/PRIORITY", prio_str))) {
cdh_ToUpper( prio_str, prio_str);
switch ( prio_str[0]) {
case 'A':
prio = mh_eEventPrio_A;
break;
case 'B':
prio = mh_eEventPrio_B;
break;
case 'C':
prio = mh_eEventPrio_C;
break;
case 'D':
prio = mh_eEventPrio_D;
break;
default:
xnav->message('E', "Unknown priority");
return XNAV__HOLDCOMMAND;
}
sts = mh_OutunitBlock( objid, prio);
if ( EVEN(sts))
xnav->message(' ', XNav::get_message(sts));
}
else {
pwr_sAttrRef oar = cdh_ObjidToAref( objid);
new Block( xnav, xnav->parent_wid, &oar,
Lng::translate( "Alarm Blocking"), xnav->priv, &sts);
xnav->message('E', "Enter priority");
return XNAV__HOLDCOMMAND;
}
}
else if ( strncmp( arg1_str, "UNBLOCK", strlen( arg1_str)) == 0)
{
// Command is "EVENTLIST UNBLOCK"
char name_str[80];
pwr_tObjid objid;
if ( ODD( dcli_get_qualifier( "/NAME", name_str))) {
sts = gdh_NameToObjid( name_str, &objid);
if ( EVEN(sts)) {
xnav->message('E', "Object not found");
return XNAV__SUCCESS;
}
}
else
{
// Get the selected object
sts = xnav->get_current_object( &objid,
name_str, sizeof( name_str), cdh_mName_volumeStrict);
if ( EVEN(sts)) {
xnav->message('E', "Enter name or select an object");
return XNAV__HOLDCOMMAND;
}
}
sts = mh_OutunitBlock( objid, (mh_eEventPrio) 0);
if ( EVEN(sts))
xnav->message(' ', XNav::get_message(sts));
}
else
{
xnav->message('E', "Unknown qualifier");
......@@ -2602,6 +2750,78 @@ static int xnav_open_func( void *client_data,
}
}
}
else if ( strncmp( arg1_str, "ATTRIBUTE", strlen( arg1_str)) == 0)
{
char name_str[80];
char *name_ptr;
char title_str[80];
pwr_sAttrRef aref;
int sts;
pwr_tClassId classid;
int bypass;
// Command is "OPEN ATTRIBUTE"
bypass = ODD( dcli_get_qualifier( "/BYPASS", name_str));
/* Get the name qualifier */
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str)))
{
if ( name_str[0] != '/')
/* Assume that this is the namestring */
name_ptr = name_str;
else
{
xnav->message('E', "Syntax error");
return XNAV__HOLDCOMMAND;
}
}
else
{
if ( ODD( dcli_get_qualifier( "/NAME", name_str)))
name_ptr = name_str;
else
{
/* Get the selected object */
sts = xnav->get_current_aref( &aref, name_str,
sizeof( name_str), cdh_mName_path | cdh_mName_object | cdh_mName_attribute);
if ( EVEN(sts))
{
xnav->message('E', "Enter name or select an object");
return XNAV__SUCCESS;
}
name_ptr = name_str;
}
}
sts = gdh_NameToAttrref( pwr_cNObjid, name_str, &aref);
if (EVEN(sts)) {
xnav->message('E', "Attribute not found");
return XNAV__HOLDCOMMAND;
}
sts = gdh_GetAttrRefTid( &aref, &classid);
if (EVEN(sts)) return sts;
if ( EVEN( dcli_get_qualifier( "/TITLE", title_str))) {
strcpy( title_str, "Attribute");
}
XAttOne *xao;
if ( xnav->appl.find( applist_eType_AttrOne, &aref, (void **) &xao)) {
xao->pop();
}
else {
xao = new XAttOne( xnav->parent_wid, xnav, &aref, title_str,
bypass ? pwr_mPrv_RtWrite : xnav->priv, &sts);
if ( EVEN(sts))
xnav->message('E',"Unable to open attribute");
else {
xao->close_cb = xnav_xao_close_cb;
xnav->appl.insert( applist_eType_AttrOne, (void *)xao, &aref, "",
NULL);
}
}
}
else if ( strncmp( arg1_str, "URL", strlen( arg1_str)) == 0)
{
char arg2_str[80];
......@@ -2973,7 +3193,8 @@ static void xnav_ge_help_cb( ge_tCtx gectx, char *key)
static int xnav_ge_command_cb( ge_tCtx gectx, char *command)
{
return ((XNav *)gectx->parent_ctx)->command( command);
((XNav *)gectx->parent_ctx)->command( command);
return ((XNav *)gectx->parent_ctx)->get_command_sts();
}
static void xnav_ge_close_cb( ge_tCtx gectx)
......@@ -3005,6 +3226,14 @@ static void xnav_fast_close_cb( void *ctx, XttFast *fast)
delete fast;
}
static void xnav_xao_close_cb( void *ctx, XAttOne *xao)
{
XNav *xnav = (XNav *) ctx;
xnav->appl.remove( (void *)xao);
delete xao;
}
static int xnav_create_func( void *client_data,
void *client_flag)
{
......@@ -3902,6 +4131,108 @@ static int xnav_logging_func( void *client_data,
// return XNAV__SUCCESS;
}
static int xnav_call_func( void *client_data,
void *client_flag)
{
XNav *xnav = (XNav *)client_data;
char arg1_str[80];
int arg1_sts;
arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str);
if ( strncmp( arg1_str, "METHOD", strlen( arg1_str)) == 0)
{
// Command is "CALL METHOD"
char method_str[80];
char object_str[80];
int sts;
xmenu_eItemType menu_type;
pwr_sAttrRef aref;
if ( EVEN( dcli_get_qualifier( "/METHOD", method_str))) {
xnav->message('E', "Enter method");
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/OBJECT", object_str))) {
xnav->message('E', "Enter object");
return XNAV__HOLDCOMMAND;
}
sts = gdh_NameToAttrref( pwr_cNObjid, object_str, &aref);
if ( EVEN(sts)) {
xnav->message('E', "No such object");
return XNAV__HOLDCOMMAND;
}
if ( aref.Flags.b.Object)
menu_type = xmenu_eItemType_Object;
else if ( aref.Flags.b.ObjectAttr)
menu_type = xmenu_eItemType_AttrObject;
else
menu_type = xmenu_eItemType_Attribute;
sts = xnav_call_object_method( xnav, aref, menu_type, xmenu_mUtility_XNav,
xnav->priv, method_str);
if ( EVEN(sts)) {
xnav->message('E',"Unable to call method");
return XNAV__HOLDCOMMAND;
}
else
return sts;
}
else
xnav->message('E',"Syntax error");
return 1;
}
static int xnav_check_func( void *client_data,
void *client_flag)
{
XNav *xnav = (XNav *)client_data;
char arg1_str[80];
int arg1_sts;
arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str);
if ( strncmp( arg1_str, "METHOD", strlen( arg1_str)) == 0)
{
// Command is "CHECK METHOD"
char method_str[80];
char object_str[80];
int sts;
xmenu_eItemType menu_type;
pwr_sAttrRef aref;
if ( EVEN( dcli_get_qualifier( "/METHOD", method_str))) {
xnav->message('E', "Enter method");
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/OBJECT", object_str))) {
xnav->message('E', "Enter object");
return XNAV__HOLDCOMMAND;
}
sts = gdh_NameToAttrref( pwr_cNObjid, object_str, &aref);
if ( EVEN(sts)) {
xnav->message('E', "No such object");
return XNAV__HOLDCOMMAND;
}
if ( aref.Flags.b.Object)
menu_type = xmenu_eItemType_Object;
else if ( aref.Flags.b.ObjectAttr)
menu_type = xmenu_eItemType_AttrObject;
else
menu_type = xmenu_eItemType_Attribute;
sts = xnav_check_object_methodfilter( xnav, aref, menu_type, xmenu_mUtility_XNav,
xnav->priv, method_str);
return sts;
}
else
xnav->message('E',"Syntax error");
return 1;
}
int XNav::show_database()
......@@ -3949,6 +4280,11 @@ int XNav::show_database()
return 1;
}
pwr_tStatus XNav::get_command_sts()
{
return command_sts;
}
int XNav::command( char* input_str)
{
char command[200];
......@@ -4005,6 +4341,7 @@ int XNav::command( char* input_str)
else if (sts == DCLI__QUAL_NODEF) message('E',"Undefined qualifier");
else if (sts == DCLI__SYMBOL_AMBIG) message('E', "Ambiguous symbol abbrevation");
command_sts = sts;
return DCLI__SUCCESS;
}
......
......@@ -76,6 +76,7 @@ void *xnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
switch ( item_type) {
case navh_eItemType_Help:
case navh_eItemType_HelpCode:
{
ItemHelp *item = new ItemHelp( xnav->brow, "help", text1, text2, text3,
link, bookmark, file_name, file_type, help_index,
......
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