Commit 4799be55 authored by Claes Sjofors's avatar Claes Sjofors

Xtt methods menu, hist event for attribute objects added (refs #136)

parent d0e98683
......@@ -92,9 +92,9 @@ static void destroy_event( GtkWidget *w, gpointer data)
HistGtk::HistGtk( void *hist_parent_ctx,
GtkWidget *hist_parent_wid,
char *hist_name, pwr_tObjid objid,
char *hist_name, pwr_tAttrRef *arp,
pwr_tStatus *status) :
Hist( hist_parent_ctx, hist_name, objid, status),
Hist( hist_parent_ctx, hist_name, arp, status),
parent_wid(hist_parent_wid), parent_wid_hist(NULL)
{
const int hist_width = 800;
......@@ -438,20 +438,22 @@ HistGtk::HistGtk( void *hist_parent_ctx,
// Init start and stop time
pwr_tStatus sts;
pwr_tOName name_str;
pwr_tAName name_str;
gint pos = 0;
((Hist *)this)->all_cb();
// If objid is applied, search for this object
pos = 0;
sts = gdh_ObjidToName( objid, name_str, sizeof(name_str), cdh_mName_pathStrict);
if ( arp && cdh_ObjidIsNotNull(arp->Objid)) {
sts = gdh_AttrrefToName( arp, name_str, sizeof(name_str), cdh_mName_pathStrict);
if (ODD(sts)) {
gtk_editable_insert_text( GTK_EDITABLE(event_name_entry_w), name_str,
strlen(name_str), &pos);
this->eventName_str = name_str;
get_hist_list();
}
}
wow = new CoWowGtk( parent_wid_hist);
......
......@@ -49,7 +49,7 @@ class HistGtk : public Hist {
public:
HistGtk( void *hist_parent_ctx,
GtkWidget *hist_parent_wid,
char *hist_name, pwr_tObjid objid,
char *hist_name, pwr_tAttrRef *arp,
pwr_tStatus *status);
~HistGtk();
......
......@@ -226,9 +226,9 @@ Ev *XNavGtk::ev_new( char *eve_name, char *ala_name, char *blk_name,
status);
}
Hist *XNavGtk::hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts)
Hist *XNavGtk::hist_new( char *title, pwr_tAttrRef *arp, pwr_tStatus *sts)
{
return new HistGtk( this, parent_wid, title, oid, sts);
return new HistGtk( this, parent_wid, title, arp, sts);
}
Block *XNavGtk::block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
......
......@@ -71,7 +71,7 @@ class XNavGtk : public XNav {
pwr_tObjid ev_user, int display_ala, int display_eve,
int display_blk, int display_return, int display_ack,
int ev_beep, pwr_tMask ev_pop_mask, int ev_eventname_seg, pwr_tStatus *status);
Hist *hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts);
Hist *hist_new( char *title, pwr_tAttrRef *arp, pwr_tStatus *sts);
Block *block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
pwr_tStatus *sts);
Op *op_new( char *opplace, pwr_tStatus *sts);
......
......@@ -92,9 +92,9 @@ extern "C" {
HistMotif::HistMotif( void *hist_parent_ctx,
Widget hist_parent_wid,
char *hist_name, pwr_tObjid objid,
char *hist_name, pwr_tAttrRef *arp,
pwr_tStatus *status) :
Hist( hist_parent_ctx, hist_name, objid, status),
Hist( hist_parent_ctx, hist_name, arp, status),
parent_wid(hist_parent_wid), parent_wid_hist(NULL)
{
char uid_filename[120] = {"xtt_hist.uid"};
......@@ -252,17 +252,18 @@ HistMotif::HistMotif( void *hist_parent_ctx,
flow_AddCloseVMProtocolCb( parent_wid_hist,
(XtCallbackProc)activate_exit, this);
char name_str[80];
sts = gdh_ObjidToName ( objid, name_str, sizeof(name_str), cdh_mName_pathStrict);
if (ODD(sts))
{
if(this->event_name_entry_w != NULL)
{
pwr_tAName name_str;
if ( arp && cdh_ObjidIsNotNull(arp->Objid)) {
sts = gdh_AttrrefToName( arp, name_str, sizeof(name_str), cdh_mName_pathStrict);
if (ODD(sts)) {
if(this->event_name_entry_w != NULL) {
XmTextSetString(this->event_name_entry_w, name_str);
this->eventName_str = name_str;
this->get_hist_list();
}
}
}
wow = new CoWowMotif( parent_wid_hist);
......
......@@ -53,7 +53,7 @@ class HistMotif : public Hist {
public:
HistMotif( void *hist_parent_ctx,
Widget hist_parent_wid,
char *hist_name, pwr_tObjid objid,
char *hist_name, pwr_tAttrRef *arp,
pwr_tStatus *status);
~HistMotif();
......
......@@ -246,9 +246,9 @@ Ev *XNavMotif::ev_new( char *eve_name, char *ala_name, char *blk_name,
display_return, display_ack, ev_beep, ev_pop_mask, ev_eventname_seg, status);
}
Hist *XNavMotif::hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts)
Hist *XNavMotif::hist_new( char *title, pwr_tAttrRef *arp, pwr_tStatus *sts)
{
return new HistMotif( this, parent_wid, title, oid, sts);
return new HistMotif( this, parent_wid, title, arp, sts);
}
Block *XNavMotif::block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
......
......@@ -69,7 +69,7 @@ class XNavMotif : public XNav {
pwr_tObjid ev_user, int display_ala, int display_eve,
int display_blk, int display_return, int display_ack,
int ev_beep, pwr_tMask ev_pop_mask, int ev_eventname_seg, pwr_tStatus *status);
Hist *hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts);
Hist *hist_new( char *title, pwr_tAttrRef *arp, pwr_tStatus *sts);
Block *block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
pwr_tStatus *sts);
Op *op_new( char *opplace, pwr_tStatus *sts);
......
......@@ -167,7 +167,7 @@ static pwr_tStatus HistEventFilter( xmenu_sMenuCall *ip)
else
objar = &ip->ItemList[ip->ChosenItem].CurrentObject;
if ( objar->Flags.b.Object)
if ( objar->Flags.b.Object || objar->Flags.b.ObjectAttr)
return 1;
return 0;
}
......
......@@ -83,7 +83,7 @@ pwr_tStatus mh_clear_alarmlist_bc( pwr_tNodeIndex nix);
bool compDate(sEvent ev1, sEvent ev2);
Hist::Hist( void *hist_parent_ctx,
char *hist_name, pwr_tObjid objid,
char *hist_name, pwr_tAttrRef *arp,
pwr_tStatus *status) :
parent_ctx(hist_parent_ctx),
start_trace_cb(NULL), display_in_xnav_cb(NULL), update_info_cb(NULL),
......
......@@ -61,7 +61,7 @@ class CoWow;
class Hist {
public:
Hist( void *hist_parent_ctx,
char *hist_name, pwr_tObjid objid,
char *hist_name, pwr_tAttrRef *arp,
pwr_tStatus *status);
virtual ~Hist();
......
......@@ -342,7 +342,7 @@ class XNav {
pwr_tObjid ev_user, int display_ala, int display_eve,
int display_blk, int display_return, int display_ack,
int ev_beep, pwr_tMask ev_pop_mask, int ev_eventname_seg, pwr_tStatus *status) { return 0;}
virtual Hist *hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts) {return 0;}
virtual Hist *hist_new( char *title, pwr_tAttrRef *arp, pwr_tStatus *sts) {return 0;}
virtual Block *block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
pwr_tStatus *sts) {return 0;}
virtual Op *op_new( char *opplace, pwr_tStatus *sts) {return 0;}
......
......@@ -1932,22 +1932,23 @@ static int xnav_show_func( void *client_data,
else if ( cdh_NoCaseStrncmp( arg1_str, "HISTLIST", strlen( arg1_str)) == 0)
{
char hist_title[40];
pwr_tOName name_str;
pwr_tObjid objid = pwr_cNObjid;
pwr_tAName name_str;
pwr_tAttrRef *arp = 0;
pwr_tAttrRef aref;
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str, sizeof(name_str))))
{
sts = gdh_NameToObjid ( name_str, &objid);
if (EVEN(sts))
{
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str, sizeof(name_str)))) {
sts = gdh_NameToAttrref( pwr_cNOid, name_str, &aref);
if (EVEN(sts)) {
xnav->message('E', "Object not found");
return XNAV__HOLDCOMMAND;
}
arp = &aref;
}
strcpy( hist_title, Lng::translate( "Hist list"));
Hist *hist;
hist = xnav->hist_new( hist_title, objid, &sts);
hist = xnav->hist_new( hist_title, arp, &sts);
if ( EVEN(sts))
{
delete hist;
......
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