Commit 0a57b45c authored by Claes Sjöfors's avatar Claes Sjöfors

Xtt, Unit shown in trend, Description added in curve window, Save scale added,...

Xtt, Unit shown in trend, Description added in curve window, Save scale added, Export all attributes in sevhist
parent 7906800c
......@@ -89,6 +89,46 @@ SObject pwrb:Type
Attr Value = 3
EndBody
EndObject
!/**
! Event list.
!*/
Object EventList $Value
Body SysBody
Attr PgmName = "EventList"
Attr Text = "EventList"
Attr Value = 4
EndBody
EndObject
!/**
! Trend curve.
!*/
Object TrendCurve $Value
Body SysBody
Attr PgmName = "TrendCurve"
Attr Text = "TrendCurve"
Attr Value = 5
EndBody
EndObject
!/**
! Fast curve.
!*/
Object FastCurve $Value
Body SysBody
Attr PgmName = "FastCurve"
Attr Text = "FastCurve"
Attr Value = 6
EndBody
EndObject
!/**
! Sev History.
!*/
Object SevHistory $Value
Body SysBody
Attr PgmName = "SevHistory"
Attr Text = "SevHistory"
Attr Value = 7
EndBody
EndObject
EndObject
EndSObject
......
......@@ -138,7 +138,8 @@ void GeCurveGtk::activate_exit( GtkWidget *w, gpointer data)
{
GeCurve *curve = (GeCurve *)data;
curve->activate_exit();
if ( !(curve->options & curve_mOptions_Embedded))
curve->activate_exit();
}
void GeCurveGtk::activate_configure( GtkWidget *w, gpointer data)
......@@ -511,6 +512,17 @@ void GeCurveGtk::enable( unsigned int mask)
g_object_set( sea_timebox, "visible", TRUE, NULL);
}
void GeCurveGtk::setup( unsigned int mask)
{
g_object_set( menu_new, "visible", mask & curve_mEnable_New ? TRUE : FALSE, NULL);
g_object_set( menu_save, "visible", mask & curve_mEnable_Save ? TRUE : FALSE, NULL);
g_object_set( menu_open, "visible", mask & curve_mEnable_Open ? TRUE : FALSE, NULL);
g_object_set( menu_snapshot, "visible", mask & curve_mEnable_Snapshot ? TRUE : FALSE, NULL);
g_object_set( tools_snapshot, "visible", mask & curve_mEnable_Snapshot ? TRUE : FALSE, NULL);
g_object_set( menu_export, "visible", mask & curve_mEnable_Export ? TRUE : FALSE, NULL);
g_object_set( sea_timebox, "visible", mask & curve_mEnable_Timebox ? TRUE : FALSE, NULL);
}
void GeCurveGtk::pop()
{
......@@ -668,12 +680,21 @@ void GeCurveGtk::reset_cursor()
gdk_window_set_cursor( toplevel->window, NULL);
}
void *GeCurveGtk::get_widget()
{
if ( options & curve_mOptions_Embedded)
return vbox;
else
return toplevel;
}
GeCurveGtk::~GeCurveGtk()
{
delete wow;
if ( minmax_widget)
gtk_widget_destroy( minmax_widget);
gtk_widget_destroy( toplevel);
if ( !(options & curve_mOptions_Embedded))
gtk_widget_destroy( toplevel);
}
static gboolean delete_event( GtkWidget *w, GdkEvent *event, gpointer data)
......@@ -705,34 +726,48 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
char *curve_name,
char *filename,
GeCurveData *curve_data,
int pos_right) :
GeCurve( gc_parent_ctx, curve_name, filename, curve_data, pos_right),
int pos_right,
int gc_width,
int gc_height,
unsigned int gc_options) :
GeCurve( gc_parent_ctx, curve_name, filename, curve_data, pos_right,
gc_width, gc_height, gc_options),
minmax_widget(0), export_widget(0), disable_timecombo_callback(0), clock_cursor(0)
{
const int window_width = 900;
const int window_height = 700;
int window_width = 900;
int window_height = 700;
const int names_height = 150;
const int nav_height = 120;
pwr_tFileName fname;
float height_scale = 1;
if ( !cd)
return;
if ( gc_width != 0)
window_width = gc_width;
if ( gc_height != 0) {
height_scale = (float)gc_height / window_height;
window_height = gc_height;
}
cdh_StrncpyCutOff( title, curve_name, sizeof(title), 1);
// Gtk
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", window_height,
"default-width", window_width,
"title", CoWowGtk::convert_utf8(title),
NULL);
g_signal_connect( toplevel, "delete_event", G_CALLBACK(delete_event), this);
g_signal_connect( toplevel, "destroy", G_CALLBACK(destroy_event), this);
g_signal_connect( toplevel, "focus-in-event", G_CALLBACK(action_inputfocus), this);
CoWowGtk::SetWindowIcon( toplevel);
if ( !(options & curve_mOptions_Embedded)) {
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", window_height,
"default-width", window_width,
"title", CoWowGtk::convert_utf8(title),
NULL);
g_signal_connect( toplevel, "delete_event", G_CALLBACK(delete_event), this);
g_signal_connect( toplevel, "destroy", G_CALLBACK(destroy_event), this);
g_signal_connect( toplevel, "focus-in-event", G_CALLBACK(action_inputfocus), this);
CoWowGtk::SetWindowIcon( toplevel);
}
else {
toplevel = parent_widget;
}
GtkAccelGroup *accel_g = (GtkAccelGroup *) g_object_new(GTK_TYPE_ACCEL_GROUP, NULL);
gtk_window_add_accel_group(GTK_WINDOW(toplevel), accel_g);
......@@ -1057,18 +1092,22 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
gtk_box_pack_start( GTK_BOX(tools_box), GTK_WIDGET(tools), FALSE, FALSE, 0);
// gtk_box_pack_start( GTK_BOX(tools_box), GTK_WIDGET(sea_timebox), FALSE, FALSE, 0);
GtkWidget *vbox = gtk_vbox_new( FALSE, 0);
vbox = gtk_vbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(menu_bar), FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(tools_box), FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(sea_timebox), FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(vpaned1), TRUE, TRUE, 0);
gtk_container_add( GTK_CONTAINER(toplevel), vbox);
if ( !(options & curve_mOptions_Embedded)) {
gtk_container_add( GTK_CONTAINER(toplevel), vbox);
gtk_widget_show_all( toplevel);
gtk_widget_show_all( toplevel);
}
else
gtk_widget_set_size_request( vbox, window_width, window_height);
gtk_paned_set_position( GTK_PANED(vpaned1), names_height);
gtk_paned_set_position( GTK_PANED(vpaned2), window_height - names_height - nav_height - 50);
gtk_paned_set_position( GTK_PANED(vpaned1), names_height * height_scale);
gtk_paned_set_position( GTK_PANED(vpaned2), (window_height - names_height - nav_height - 50) * height_scale);
g_object_set( sea_timebox, "visible", FALSE, NULL);
g_object_set( menu_new, "visible", FALSE, NULL);
g_object_set( menu_save, "visible", FALSE, NULL);
......@@ -1081,6 +1120,18 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
gtk_combo_box_set_active( GTK_COMBO_BOX(timebox_timecombo), 2);
if ( !(options & curve_mOptions_Embedded)) {
if ( options & curve_mOptions_FullScreen)
gtk_window_fullscreen( GTK_WINDOW(toplevel));
else if ( options & curve_mOptions_Maximize)
gtk_window_maximize( GTK_WINDOW(toplevel)); // TODO
else if ( options & curve_mOptions_FullMaximize)
gtk_window_maximize( GTK_WINDOW(toplevel));
else if ( options & curve_mOptions_Iconify)
gtk_window_iconify( GTK_WINDOW(toplevel));
else if ( options & curve_mOptions_Invisible)
g_object_set( toplevel, "visible", FALSE, NULL);
}
}
static gint minmax_delete_event( GtkWidget *w, GdkEvent *event, gpointer curve)
......@@ -1148,6 +1199,7 @@ void GeCurveGtk::create_minmax_dialog()
gtk_container_add( GTK_CONTAINER(minmax_widget), minmax_vbox);
gtk_widget_show_all( minmax_widget);
}
static gint export_delete_event( GtkWidget *w, GdkEvent *event, gpointer curve)
......@@ -1158,6 +1210,9 @@ static gint export_delete_event( GtkWidget *w, GdkEvent *event, gpointer curve)
void GeCurveGtk::create_export_dialog()
{
if ( !cd)
return;
if ( export_widget) {
g_object_set( export_widget, "visible", TRUE, NULL);
return;
......
......@@ -45,19 +45,11 @@
#include "cow_wow_gtk.h"
typedef enum {
curve_mEnable_New = 1 << 0,
curve_mEnable_Save = 1 << 1,
curve_mEnable_Open = 1 << 2,
curve_mEnable_Snapshot = 1 << 3,
curve_mEnable_Export = 1 << 4,
curve_mEnable_Timebox = 1 << 5
} curve_mEnable;
class GeCurveGtk : public GeCurve {
public:
GeCurveGtk( void *gc_parent_ctx, GtkWidget *parent_widget, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right);
char *filename, GeCurveData *curve_data, int pos_right,
int gc_width, int gc_height, unsigned int gc_options);
GtkWidget *parent_wid;
GtkWidget *grow_widget;
GtkWidget *curve_widget;
......@@ -66,6 +58,7 @@ class GeCurveGtk : public GeCurve {
GtkWidget *curveform_widget;
GtkWidget *pane_widget;
GtkWidget *toplevel;
GtkWidget *vbox;
GtkWidget *growcurve_main_widget;
GtkWidget *growaxis_main_widget;
GtkWidget *grownames_main_widget;
......@@ -103,6 +96,7 @@ class GeCurveGtk : public GeCurve {
void create_export_dialog();
void set_inputfocus();
void enable( unsigned int mask);
void setup( unsigned int mask);
void set_times( pwr_tTime *from, pwr_tTime *to);
void set_times_sensitivity( int sensitive);
pwr_tStatus get_times( pwr_tTime *from, pwr_tTime *to);
......@@ -110,6 +104,7 @@ class GeCurveGtk : public GeCurve {
void set_period( time_ePeriod period, int nocallback);
void set_clock_cursor();
void reset_cursor();
void *get_widget();
~GeCurveGtk();
......
......@@ -260,8 +260,11 @@ GeCurveMotif::GeCurveMotif( void *gc_parent_ctx,
char *curve_name,
char *filename,
GeCurveData *curve_data,
int pos_right) :
GeCurve( gc_parent_ctx, curve_name, filename, curve_data, pos_right)
int pos_right,
int gc_width,
int gc_height,
unsigned int gc_options) :
GeCurve( gc_parent_ctx, curve_name, filename, curve_data, pos_right, gc_options)
{
char uid_filename[120] = {"xtt_curve.uid"};
char *uid_filename_p = uid_filename;
......@@ -327,9 +330,14 @@ GeCurveMotif::GeCurveMotif( void *gc_parent_ctx,
MrmCloseHierarchy(s_DRMh);
if ( gc_width == 0)
gc_width = 800;
if ( gc_height == 0)
gc_height = 600;
i = 0;
XtSetArg(args[i],XmNwidth,800);i++;
XtSetArg(args[i],XmNheight,600);i++;
XtSetArg(args[i],XmNwidth,gc_width);i++;
XtSetArg(args[i],XmNheight,gc_height);i++;
XtSetArg(args[i], XmNdeleteResponse, XmDO_NOTHING);i++;
XtSetValues( toplevel ,args,i);
......
......@@ -46,7 +46,8 @@
class GeCurveMotif : public GeCurve {
public:
GeCurveMotif( void *gc_parent_ctx, Widget parent_widget, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right);
char *filename, GeCurveData *curve_data, int pos_right,
int gc_width, int gc_height, unsigned int gc_options);
Widget parent_wid;
Widget grow_widget;
Widget curve_widget;
......
......@@ -798,6 +798,9 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data)
int GeCurve::config_names()
{
if ( !cd)
return 0;
grow_tObject t1;
glow_eDrawType color;
double x;
......@@ -1027,6 +1030,9 @@ int GeCurve::configure_axes()
double x = 0;
int i, idx;
if ( !cd)
return 0;
grow_SetNodraw( growaxis_ctx);
grow_New( growaxis_ctx);
memset( axis_object, 0, sizeof( axis_object));
......@@ -1101,6 +1107,9 @@ int GeCurve::configure_curves()
int max_index, min_index;
double minval, maxval;
if ( !cd)
return 0;
if ( cd->type == curve_eDataType_LogFile ||
cd->type == curve_eDataType_DsTrend) {
gcd.type = glow_eCurveDataType_CommonX;
......@@ -1461,7 +1470,10 @@ GeCurve::GeCurve( void *gc_parent_ctx,
char *curve_name,
char *filename,
GeCurveData *curve_data,
int pos_right) :
int pos_right,
int gc_width,
int gc_height,
unsigned int gc_options) :
parent_ctx(gc_parent_ctx), growcurve_ctx(0), background_dark(glow_eDrawType_Color29),
background_bright(glow_eDrawType_Color21),
border_dark(glow_eDrawType_Color28),
......@@ -1471,7 +1483,7 @@ GeCurve::GeCurve( void *gc_parent_ctx,
prev_period_cb(0), next_period_cb(0), add_cb(0), remove_cb(0), export_cb(0), new_cb(0),
save_cb(0), open_cb(0), snapshot_cb(0),
initial_right_position(pos_right), last_cursor_x(0), last_mark1_x(0), last_mark2_x(0),
deferred_configure_axes(0), center_from_window(0)
deferred_configure_axes(0), center_from_window(0), options(gc_options)
{
pwr_tStatus sts;
......
......@@ -50,6 +50,24 @@
#define CURVE_MAX_COLS 101
typedef enum {
curve_mOptions_FullScreen = 1 << 0,
curve_mOptions_Maximize = 1 << 1,
curve_mOptions_FullMaximize = 1 << 2,
curve_mOptions_Iconify = 1 << 3,
curve_mOptions_Invisible = 1 << 4,
curve_mOptions_Embedded = 1 << 5
} curve_mOptions;
typedef enum {
curve_mEnable_New = 1 << 0,
curve_mEnable_Save = 1 << 1,
curve_mEnable_Open = 1 << 2,
curve_mEnable_Snapshot = 1 << 3,
curve_mEnable_Export = 1 << 4,
curve_mEnable_Timebox = 1 << 5
} curve_mEnable;
typedef enum {
curve_eDataType_LogFile,
curve_eDataType_DsTrend,
......@@ -125,6 +143,7 @@ class GeCurveData {
};
class CoWow;
class CurveCtx;
//! A curve window used for trends and logging curves.
class GeCurve {
......@@ -183,9 +202,11 @@ class GeCurve {
int deferred_configure_axes;
CoWow *wow;
int center_from_window;
unsigned int options;
GeCurve( void *gc_parent_ctx, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right);
char *filename, GeCurveData *curve_data, int pos_right,
int gc_width, int gc_height, unsigned int options);
virtual ~GeCurve();
virtual void write_title( char *str) {}
virtual void pop() {}
......@@ -194,6 +215,7 @@ class GeCurve {
virtual void open_export( pwr_tTime *from, pwr_tTime *to, int rows, char *filename) {}
virtual void axis_set_width( int width) {}
virtual void enable( unsigned int mask) {}
virtual void setup( unsigned int mask) {}
virtual void set_times( pwr_tTime *from, pwr_tTime *to) {}
virtual void set_times_sensitivity( int sensitive) {}
virtual pwr_tStatus get_times( pwr_tTime *from, pwr_tTime *to) {return 0;}
......@@ -201,6 +223,7 @@ class GeCurve {
virtual void set_period( time_ePeriod period, int nocallback) {}
virtual void set_clock_cursor() {}
virtual void reset_cursor() {}
virtual void *get_widget() {return 0;}
void set_inputfocus() {}
int read_file( char *filename);
......
......@@ -885,22 +885,44 @@ EvGtk::~EvGtk()
gtk_widget_destroy( parent_wid_blk);
}
void EvGtk::map_eve()
void EvGtk::map_eve( unsigned int options)
{
gtk_window_present( GTK_WINDOW(parent_wid_eve));
eve_displayed = 1;
if ( options & ev_mAlaOptions_FullScreen)
gtk_window_fullscreen( GTK_WINDOW(parent_wid_eve));
else if ( options & ev_mAlaOptions_Maximize)
gtk_window_maximize( GTK_WINDOW(parent_wid_eve)); // TODO
else if ( options & ev_mAlaOptions_FullMaximize)
gtk_window_maximize( GTK_WINDOW(parent_wid_eve));
}
void EvGtk::map_ala()
void EvGtk::map_ala( unsigned int options)
{
gtk_window_present( GTK_WINDOW(parent_wid_ala));
ala_displayed = 1;
if ( options & ev_mAlaOptions_FullScreen)
gtk_window_fullscreen( GTK_WINDOW(parent_wid_ala));
else if ( options & ev_mAlaOptions_Maximize)
gtk_window_maximize( GTK_WINDOW(parent_wid_ala)); // TODO
else if ( options & ev_mAlaOptions_FullMaximize)
gtk_window_maximize( GTK_WINDOW(parent_wid_ala));
}
void EvGtk::map_blk()
void EvGtk::map_blk( unsigned int options)
{
gtk_window_present( GTK_WINDOW(parent_wid_blk));
blk_displayed = 1;
if ( options & ev_mAlaOptions_FullScreen)
gtk_window_fullscreen( GTK_WINDOW(parent_wid_blk));
else if ( options & ev_mAlaOptions_Maximize)
gtk_window_maximize( GTK_WINDOW(parent_wid_blk)); // TODO
else if ( options & ev_mAlaOptions_FullMaximize)
gtk_window_maximize( GTK_WINDOW(parent_wid_blk));
}
void EvGtk::unmap_eve()
......
......@@ -78,9 +78,9 @@ class EvGtk : public Ev {
GtkWidget *blk_widget;
pwr_tObjid alarm_views[25];
void map_eve();
void map_ala();
void map_blk();
void map_eve( unsigned int options);
void map_ala( unsigned int options);
void map_blk( unsigned int options);
void unmap_eve();
void unmap_ala();
void unmap_blk();
......
......@@ -67,6 +67,9 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
char *name,
GtkWidget **w,
pwr_sAttrRef *fast_arp,
int width,
int height,
unsigned int options,
int *sts) :
XttFast( parent_ctx, name, fast_arp, sts), parent_widget(parent_wid)
{
......@@ -74,7 +77,8 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 0);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 0, width, height,
options);
curve->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb;
......
......@@ -52,6 +52,9 @@ class XttFastGtk : public XttFast {
char *xn_name,
GtkWidget **w,
pwr_sAttrRef *fast_arp,
int width,
int height,
unsigned int xn_options,
int *sts);
~XttFastGtk();
};
......
......@@ -458,8 +458,6 @@ XttGeGtk::XttGeGtk( GtkWidget *xg_parent_wid, void *xg_parent_ctx, const char *x
gtk_window_maximize( GTK_WINDOW(toplevel));
else if ( options & ge_mOptions_Iconify)
gtk_window_iconify( GTK_WINDOW(toplevel));
else if ( options & ge_mOptions_Iconify)
gtk_window_iconify( GTK_WINDOW(toplevel));
else if ( options & ge_mOptions_Invisible)
g_object_set( toplevel, "visible", FALSE, NULL);
}
......
......@@ -56,6 +56,8 @@ typedef void *Widget;
#include "glow_growapi.h"
#include "co_lng.h"
#include "xtt_ge_gtk.h"
#include "xtt_trend_gtk.h"
#include "xtt_sevhist_gtk.h"
#include "xtt_multiview_gtk.h"
#include "ge_graph_gtk.h"
#include "xtt_ev_gtk.h"
......@@ -131,6 +133,15 @@ XttMultiViewGtk::~XttMultiViewGtk()
if ( mvctx[i])
delete mvctx[i];
}
for ( unsigned int i = 0; i < MV_SIZE; i++) {
if ( trend[i])
delete trend[i];
}
for ( unsigned int i = 0; i < MV_SIZE; i++) {
if ( sevhist[i])
delete sevhist[i];
}
// delete widget;
if ( !(options & ge_mOptions_Embedded))
......@@ -174,6 +185,8 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
memset( gectx, 0, sizeof(gectx));
memset( mvctx, 0, sizeof(mvctx));
memset( sala, 0, sizeof(sala));
memset( trend, 0, sizeof(trend));
memset( sevhist, 0, sizeof(sevhist));
memset( comp_widget, 0, sizeof(comp_widget));
memset( exchange_widget, 0, sizeof(exchange_widget));
......@@ -329,6 +342,270 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
appl.insert( applist_eType_MultiView, (void *)mvctx[i*rows + j], &aref, "", NULL);
if ( mv.Action[i*rows+j].Options & pwr_mMultiViewElemOptionsMask_Exchangeable) {
exchange_widget[i*rows+j] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(exchange_widget[i*rows+j]), GTK_WIDGET(comp_widget[i*rows + j]), TRUE, TRUE, 0);
gtk_box_pack_start( GTK_BOX(row_widget), GTK_WIDGET(exchange_widget[i*rows + j]), TRUE, TRUE, 0);
}
else
gtk_box_pack_start( GTK_BOX(row_widget), GTK_WIDGET(comp_widget[i*rows + j]), TRUE, TRUE, 0);
break;
}
case pwr_eMultiViewContentEnum_TrendCurve: {
int plotgroup_found = 0;
pwr_tAttrRef plotgroup;
pwr_tCid classid;
GtkWidget *widget;
pwr_tAttrRef arefv[2];
int skip = 0;
lsts = gdh_GetAttrRefTid( &mv.Action[i*rows+j].Object, &classid);
if (EVEN(lsts)) break;
switch ( classid) {
case pwr_cClass_DsTrend:
case pwr_cClass_DsTrendCurve:
break;
case pwr_cClass_PlotGroup:
plotgroup_found = 1;
plotgroup = mv.Action[i*rows+j].Object;
arefv[0] = plotgroup;
break;
default:
skip = 1;
}
if ( skip)
break;
if ( plotgroup_found) {
trend[i*rows + j] = new XttTrendGtk( this, toplevel, (char *)"No title", &widget,
0, &plotgroup, w, h, (unsigned int)curve_mOptions_Embedded, sts);
}
else {
arefv[0] = mv.Action[i*rows+j].Object;
memset( &arefv[1], 0, sizeof(arefv[0]));
trend[i*rows + j] = new XttTrendGtk( this, toplevel, (char *)"No title", &widget,
arefv, 0, w, h, (unsigned int)curve_mOptions_Embedded, sts);
}
if ( EVEN(*sts)) break;
trend[i*rows + j]->close_cb = multiview_trend_close_cb;
trend[i*rows + j]->command_cb = multiview_trend_command_cb;
trend[i*rows + j]->help_cb = multiview_trend_help_cb;
comp_widget[i*rows + j] = widget;
// recall_buffer[i*rows + j].insert(graph_name, objectname_p);
appl.insert( applist_eType_Trend, (void *)trend[i*rows + j], &arefv[0],
"", NULL);
if ( mv.Action[i*rows+j].Options & pwr_mMultiViewElemOptionsMask_Exchangeable) {
exchange_widget[i*rows+j] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(exchange_widget[i*rows+j]), GTK_WIDGET(comp_widget[i*rows + j]), TRUE, TRUE, 0);
gtk_box_pack_start( GTK_BOX(row_widget), GTK_WIDGET(exchange_widget[i*rows + j]), TRUE, TRUE, 0);
}
else
gtk_box_pack_start( GTK_BOX(row_widget), GTK_WIDGET(comp_widget[i*rows + j]), TRUE, TRUE, 0);
break;
}
case pwr_eMultiViewContentEnum_SevHistory: {
pwr_tOid oidv[11];
pwr_tOName anamev[11];
pwr_tOName onamev[11];
bool sevhistobjectv[11];
pwr_tAttrRef attr_aref, sevhist_aref, histthread_aref;
pwr_tOid histthread_oid;
char server_node[40];
char *s;
pwr_tAName aname;
int plotgroup_found = 0;
int sevHistObjectFound = 0;
int oid_cnt = 0;
pwr_tCid classid;
int skip = 0;
if ( cdh_ObjidIsNull(mv.Action[i*rows+j].Object.Objid))
break;
GtkWidget *widget;
pwr_tAttrRef arefv[2];
pwr_tAttrRef plotgroup;
arefv[0] = mv.Action[i*rows+j].Object;
memset( &arefv[1], 0, sizeof(arefv[0]));
lsts = gdh_GetAttrRefTid( &arefv[0], &classid);
if (EVEN(lsts)) break;;
switch ( classid) {
case pwr_cClass_SevHist:
break;
case pwr_cClass_SevHistObject:
sevHistObjectFound = true;
break;
case pwr_cClass_PlotGroup:
plotgroup = mv.Action[i*rows+j].Object;
plotgroup_found = 1;
break;
default:
skip = 1;
}
if ( skip)
break;
if ( plotgroup_found) {
pwr_sClass_PlotGroup plot;
pwr_tCid cid;
int j;
lsts = gdh_GetObjectInfoAttrref( &plotgroup, &plot, sizeof(plot));
if ( EVEN(lsts)) break;
for ( j = 0; j < 20; j++) {
if ( cdh_ObjidIsNull( plot.YObjectName[j].Objid))
break;
sevhist_aref = plot.YObjectName[j];
lsts = gdh_GetAttrRefTid( &sevhist_aref, &cid);
if ( EVEN(lsts)) break;
if ( cid == pwr_cClass_SevHist) {
lsts = gdh_ArefANameToAref( &sevhist_aref, "Attribute", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) break;
*s = 0;
strcpy( onamev[oid_cnt], aname);
strcpy( anamev[oid_cnt], s+1);
oidv[oid_cnt] = attr_aref.Objid;
sevhistobjectv[oid_cnt] = false;
oid_cnt++;
}
else if ( cid == pwr_cClass_SevHistObject) {
lsts = gdh_ArefANameToAref( &sevhist_aref, "Object", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) {
//It is a complete object
anamev[oid_cnt][0] = '\0';
}
else {
strcpy( anamev[oid_cnt], s+1);
*s = 0;
}
strcpy( onamev[oid_cnt], aname);
oidv[oid_cnt] = attr_aref.Objid;
sevhistobjectv[oid_cnt] = true;
oid_cnt++;
}
}
}
else if ( sevHistObjectFound ) {
lsts = gdh_ArefANameToAref( &mv.Action[i*rows+j].Object, "Object", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) {
//It is a complete object
anamev[oid_cnt][0] = '\0';
}
else {
strcpy( anamev[oid_cnt], s+1);
}
oidv[oid_cnt] = attr_aref.Objid;
sevhistobjectv[oid_cnt] = true;
strcpy( onamev[oid_cnt], "");
sevhist_aref = mv.Action[i*rows+j].Object;
oid_cnt = 1;
}
else {
lsts = gdh_ArefANameToAref( &mv.Action[i*rows+j].Object, "Attribute", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) break;
*s = 0;
strcpy( onamev[0], aname);
strcpy( anamev[0], s+1);
oidv[0] = attr_aref.Objid;
sevhistobjectv[0] = false;
oid_cnt = 1;
sevhist_aref = mv.Action[i*rows+j].Object;
}
oidv[oid_cnt] = pwr_cNOid;
// Get server and connect to server
lsts = gdh_ArefANameToAref( &sevhist_aref, "ThreadObject", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &histthread_oid, sizeof(histthread_oid));
if ( EVEN(lsts)) break;
histthread_aref = cdh_ObjidToAref( histthread_oid);
lsts = gdh_ArefANameToAref( &histthread_aref, "ServerNode", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, server_node, sizeof(server_node));
if ( EVEN(lsts)) break;
if ( !xnav->scctx) {
sevcli_init( &lsts, &xnav->scctx);
if ( EVEN(lsts)) break;
}
sevcli_set_servernode( &lsts, xnav->scctx, server_node);
if ( EVEN(lsts)) break;
sevhist[i*rows + j] = new XttSevHistGtk( this, toplevel, (char *)"No title", &widget,
oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, w, h,
(unsigned int)curve_mOptions_Embedded, sts);
if ( EVEN(*sts)) break;
sevhist[i*rows + j]->help_cb = multiview_trend_help_cb;
sevhist[i*rows + j]->get_select_cb = multiview_sevhist_get_select_cb;
comp_widget[i*rows + j] = widget;
// recall_buffer[i*rows + j].insert(graph_name, objectname_p);
//appl.insert( applist_eType_Trend, (void *)trend[i*rows + j], &arefv[0],
// "", NULL);
if ( mv.Action[i*rows+j].Options & pwr_mMultiViewElemOptionsMask_Exchangeable) {
exchange_widget[i*rows+j] = gtk_hbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX(exchange_widget[i*rows+j]), GTK_WIDGET(comp_widget[i*rows + j]), TRUE, TRUE, 0);
......@@ -375,7 +652,14 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
gtk_window_move( GTK_WINDOW(toplevel), mv.X, mv.Y);
}
for ( int i = 0; i < MV_SIZE; i++) {
if ( trend[i])
trend[i]->setup();
}
for ( int i = 0; i < MV_SIZE; i++) {
if ( sevhist[i])
sevhist[i]->setup();
}
if ( options & ge_mOptions_FullScreen ||
mv.Options & pwr_mMultiViewOptionsMask_FullScreen)
gtk_window_fullscreen( GTK_WINDOW(toplevel));
......@@ -524,6 +808,266 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
appl.insert( applist_eType_MultiView, (void *)mvctx[i*rows + j], &source_aref, "", NULL);
break;
}
case pwr_eMultiViewContentEnum_TrendCurve: {
int plotgroup_found = 0;
pwr_tAttrRef plotgroup;
pwr_tCid classid;
GtkWidget *comp_w;
pwr_tAttrRef arefv[2];
int skip = 0;
pwr_tStatus lsts;
pwr_tAttrRef object_aref;
lsts = gdh_NameToAttrref( pwr_cNObjid, object, &object_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetAttrRefTid( &object_aref, &classid);
if (EVEN(lsts)) break;
switch ( classid) {
case pwr_cClass_DsTrend:
case pwr_cClass_DsTrendCurve:
break;
case pwr_cClass_PlotGroup:
plotgroup_found = 1;
plotgroup = object_aref;
arefv[0] = plotgroup;
break;
default:
skip = 1;
}
if ( skip)
break;
XttTrendGtk *ctx;
if ( plotgroup_found) {
ctx = new XttTrendGtk( this, toplevel, (char *)"No title", &comp_w,
0, &plotgroup, w, h, (unsigned int)curve_mOptions_Embedded, &lsts);
}
else {
arefv[0] = object_aref;
memset( &arefv[1], 0, sizeof(arefv[0]));
ctx = new XttTrendGtk( this, toplevel, (char *)"No title", &comp_w,
arefv, 0, w, h, (unsigned int)curve_mOptions_Embedded, &lsts);
}
if ( EVEN(lsts)) break;
ctx->close_cb = multiview_trend_close_cb;
ctx->command_cb = multiview_trend_command_cb;
ctx->help_cb = multiview_trend_help_cb;
appl.remove( (void *)trend[i*rows+j]);
delete trend[i*rows+j];
gtk_widget_destroy( comp_widget[i*rows+j]);
gtk_box_pack_start( GTK_BOX(exchange_widget[i*rows+j]), GTK_WIDGET(comp_w), TRUE, TRUE, 0);
gtk_widget_show_all( exchange_widget[i*rows + j]);
ctx->setup();
gtk_box_reorder_child( GTK_BOX(exchange_widget[i*rows+j]), comp_w, 0);
comp_widget[i*rows + j] = comp_w;
trend[i*rows+j] = ctx;
if ( insert)
recall_buffer[i*rows + j].insert( source, object);
appl.insert( applist_eType_Trend, (void *)trend[i*rows + j], &arefv[0],
"", NULL);
mv.Action[i*rows+j].Object = object_aref;
break;
}
case pwr_eMultiViewContentEnum_SevHistory: {
pwr_tOid oidv[11];
pwr_tOName anamev[11];
pwr_tOName onamev[11];
bool sevhistobjectv[11];
pwr_tAttrRef attr_aref, sevhist_aref;
char *s;
pwr_tAName aname;
int plotgroup_found = 0;
int sevHistObjectFound = 0;
int oid_cnt = 0;
pwr_tCid classid;
int skip = 0;
pwr_tStatus lsts;
GtkWidget *comp_w;
pwr_tAttrRef arefv[2];
pwr_tAttrRef plotgroup;
pwr_tAttrRef object_aref;
lsts = gdh_NameToAttrref( pwr_cNObjid, object, &object_aref);
if ( EVEN(lsts)) break;
arefv[0] = object_aref;
memset( &arefv[1], 0, sizeof(arefv[0]));
lsts = gdh_GetAttrRefTid( &arefv[0], &classid);
if (EVEN(lsts)) break;;
switch ( classid) {
case pwr_cClass_SevHist:
break;
case pwr_cClass_SevHistObject:
sevHistObjectFound = true;
break;
case pwr_cClass_PlotGroup:
plotgroup = object_aref;
plotgroup_found = 1;
break;
default:
skip = 1;
}
if ( skip)
break;
if ( plotgroup_found) {
pwr_sClass_PlotGroup plot;
pwr_tCid cid;
int j;
lsts = gdh_GetObjectInfoAttrref( &plotgroup, &plot, sizeof(plot));
if ( EVEN(lsts)) break;
for ( j = 0; j < 20; j++) {
if ( cdh_ObjidIsNull( plot.YObjectName[j].Objid))
break;
sevhist_aref = plot.YObjectName[j];
lsts = gdh_GetAttrRefTid( &sevhist_aref, &cid);
if ( EVEN(lsts)) break;
if ( cid == pwr_cClass_SevHist) {
lsts = gdh_ArefANameToAref( &sevhist_aref, "Attribute", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) break;
*s = 0;
strcpy( onamev[oid_cnt], aname);
strcpy( anamev[oid_cnt], s+1);
oidv[oid_cnt] = attr_aref.Objid;
sevhistobjectv[oid_cnt] = false;
oid_cnt++;
}
else if ( cid == pwr_cClass_SevHistObject) {
lsts = gdh_ArefANameToAref( &sevhist_aref, "Object", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) {
//It is a complete object
anamev[oid_cnt][0] = '\0';
}
else {
strcpy( anamev[oid_cnt], s+1);
*s = 0;
}
strcpy( onamev[oid_cnt], aname);
oidv[oid_cnt] = attr_aref.Objid;
sevhistobjectv[oid_cnt] = true;
oid_cnt++;
}
}
}
else if ( sevHistObjectFound ) {
lsts = gdh_ArefANameToAref( &object_aref, "Object", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) {
//It is a complete object
anamev[oid_cnt][0] = '\0';
}
else {
strcpy( anamev[oid_cnt], s+1);
}
oidv[oid_cnt] = attr_aref.Objid;
sevhistobjectv[oid_cnt] = true;
strcpy( onamev[oid_cnt], "");
sevhist_aref = object_aref;
oid_cnt = 1;
}
else {
lsts = gdh_ArefANameToAref( &object_aref, "Attribute", &attr_aref);
if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &attr_aref, &attr_aref, sizeof(attr_aref));
if ( EVEN(lsts)) break;
lsts = gdh_AttrrefToName( &attr_aref, aname, sizeof(aname), cdh_mNName);
if ( EVEN(lsts)) break;
s = strchr( aname, '.');
if ( !s) break;
*s = 0;
strcpy( onamev[0], aname);
strcpy( anamev[0], s+1);
oidv[0] = attr_aref.Objid;
sevhistobjectv[0] = false;
oid_cnt = 1;
sevhist_aref = object_aref;
}
oidv[oid_cnt] = pwr_cNOid;
XNav *xnav = get_xnav();
XttSevHistGtk *ctx;
if ( !xnav->scctx)
break;
ctx = new XttSevHistGtk( this, toplevel, (char *)"No title", &comp_w,
oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, w, h,
(unsigned int)curve_mOptions_Embedded, &lsts);
if ( EVEN(lsts)) break;
ctx->help_cb = multiview_trend_help_cb;
ctx->get_select_cb = multiview_sevhist_get_select_cb;
appl.remove( (void *)trend[i*rows+j]);
delete sevhist[i*rows+j];
gtk_widget_destroy( comp_widget[i*rows+j]);
gtk_box_pack_start( GTK_BOX(exchange_widget[i*rows+j]), GTK_WIDGET(comp_w), TRUE, TRUE, 0);
gtk_widget_show_all( exchange_widget[i*rows + j]);
ctx->setup();
gtk_box_reorder_child( GTK_BOX(exchange_widget[i*rows+j]), comp_w, 0);
comp_widget[i*rows + j] = comp_w;
sevhist[i*rows+j] = ctx;
//if ( insert)
// recall_buffer[i*rows + j].insert( source, object);
//appl.insert( applist_eType_Trend, (void *)trend[i*rows + j], &arefv[0],
// "", NULL);
mv.Action[i*rows+j].Object = object_aref;
}
default: ;
}
}
......
......@@ -48,6 +48,9 @@
# include "xtt_evala_gtk.h"
#endif
class XttTrendGtk;
class XttSevHistGtk;
class XttMultiViewGtk : public XttMultiView {
public:
GtkWidget *parent_wid;
......@@ -58,6 +61,8 @@ class XttMultiViewGtk : public XttMultiView {
XttGeGtk *gectx[MV_SIZE];
XttMultiViewGtk *mvctx[MV_SIZE];
EvAlaGtk *sala[MV_SIZE];
XttTrendGtk *trend[MV_SIZE];
XttSevHistGtk *sevhist[MV_SIZE];
CoWowFocusTimerGtk focustimer;
XttMultiViewGtk( GtkWidget *parent_wid, void *parent_ctx, const char *name, pwr_tAttrRef *aref,
......
......@@ -70,6 +70,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
pwr_tOName *xn_onamev,
bool *sevhistobjectv,
sevcli_tCtx xn_scctx,
int xn_width,
int xn_height,
unsigned int xn_options,
int *sts) :
XttSevHist( parent_ctx, name, xn_oidv, xn_anamev, xn_onamev, sevhistobjectv, xn_scctx, sts),
parent_widget(parent_wid)
......@@ -83,7 +86,8 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1,
xn_width, xn_height, xn_options);
curve->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb;
curve->increase_period_cb = sevhist_increase_period_cb;
......@@ -96,6 +100,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
curve->export_cb = sevhist_export_cb;
curve->enable( curve_mEnable_Timebox | curve_mEnable_Export);
if ( w)
*w = (GtkWidget *)curve->get_widget();
wow = new CoWowGtk( parent_widget);
timerid = wow->timer_new();
......@@ -120,7 +127,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0);
curve->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb;
curve->enable(0);
......
......@@ -56,6 +56,9 @@ class XttSevHistGtk : public XttSevHist {
pwr_tOName *xn_onamev,
bool *sevhistobjectv,
sevcli_tCtx xn_scctx,
int width,
int height,
unsigned int options,
int *sts);
XttSevHistGtk( void *parent_ctx,
GtkWidget *parent_wid,
......
......@@ -62,11 +62,14 @@
XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
GtkWidget *parent_wid,
const char *name,
GtkWidget **w,
pwr_tAttrRef *xn_arefv,
int *sts) :
GtkWidget *parent_wid,
const char *name,
GtkWidget **w,
pwr_tAttrRef *xn_arefv,
int xn_width,
int xn_height,
unsigned int xn_options,
int *sts) :
XttTCurve( parent_ctx, name, xn_arefv, sts),
parent_widget(parent_wid)
{
......@@ -79,7 +82,8 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1,
xn_width, xn_height, xn_options);
curve->close_cb = tcurve_close_cb;
curve->help_cb = tcurve_help_cb;
curve->increase_period_cb = tcurve_increase_period_cb;
......
......@@ -48,11 +48,14 @@ class XttTCurveGtk : public XttTCurve {
GtkWidget *parent_widget; //!< Parent widget.
XttTCurveGtk( void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
const char *xn_name,
GtkWidget **w,
pwr_tAttrRef *xn_arefv,
int *sts);
GtkWidget *xn_parent_wid,
const char *xn_name,
GtkWidget **w,
pwr_tAttrRef *xn_arefv,
int xn_width,
int xn_height,
unsigned int xn_options,
int *sts);
~XttTCurveGtk();
};
......
......@@ -66,6 +66,9 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
GtkWidget **w,
pwr_sAttrRef *trend_list,
pwr_sAttrRef *plotgroup,
int width,
int height,
unsigned int options,
int *sts) :
XttTrend( parent_ctx, name, trend_list, plotgroup, sts), parent_widget(parent_wid)
{
......@@ -73,10 +76,13 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
return;
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, name, NULL, gcd, 1);
curve = new GeCurveGtk( this, parent_widget, name, NULL, gcd, 1, width, height,
options);
curve->close_cb = trend_close_cb;
curve->help_cb = trend_help_cb;
curve->snapshot_cb = trend_snapshot_cb;
if ( w)
*w = (GtkWidget *)curve->get_widget();
if ( trend_tid == pwr_cClass_DsTrendCurve)
curve->enable( curve_mEnable_Snapshot);
......
......@@ -53,6 +53,9 @@ class XttTrendGtk : public XttTrend {
GtkWidget **w,
pwr_sAttrRef *objid,
pwr_sAttrRef *plotgroup,
int width,
int height,
unsigned int options,
int *sts);
~XttTrendGtk();
};
......
......@@ -243,36 +243,38 @@ Op *XNavGtk::op_new( char *opplace, pwr_tStatus *sts)
}
XttTrend *XNavGtk::xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
pwr_tStatus *sts)
int width, int height, unsigned int options, pwr_tStatus *sts)
{
GtkWidget *w;
return new XttTrendGtk( this, parent_wid, name, &w, objar, plotgroup, sts);
return new XttTrendGtk( this, parent_wid, name, &w, objar, plotgroup, width, height, options, sts);
}
XttSevHist *XNavGtk::xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev, pwr_tOName *onamev,
bool *sevhistobjectv, sevcli_tCtx scctx, char *filename, pwr_tStatus *sts)
bool *sevhistobjectv, sevcli_tCtx scctx, char *filename,
int width, int height, unsigned int options, pwr_tStatus *sts)
{
GtkWidget *w;
if ( !filename)
return new XttSevHistGtk( this, parent_wid, name, &w, oidv, anamev, onamev, sevhistobjectv, scctx, sts);
return new XttSevHistGtk( this, parent_wid, name, &w, oidv, anamev, onamev, sevhistobjectv, scctx, width, height, options, sts);
else
return new XttSevHistGtk( this, parent_wid, name, &w, filename, sts);
}
XttTCurve *XNavGtk::xtttcurve_new( char *name, pwr_tAttrRef *arefv, pwr_tStatus *sts)
XttTCurve *XNavGtk::xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, pwr_tStatus *sts)
{
GtkWidget *w;
return new XttTCurveGtk( this, parent_wid, name, &w, arefv, sts);
return new XttTCurveGtk( this, parent_wid, name, &w, arefv, width, height, options, sts);
}
XttFast *XNavGtk::xttfast_new( char *name, pwr_tAttrRef *objar, pwr_tStatus *sts)
XttFast *XNavGtk::xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height,
unsigned int options, pwr_tStatus *sts)
{
GtkWidget *w;
return new XttFastGtk( this, parent_wid, name, &w, objar, sts);
return new XttFastGtk( this, parent_wid, name, &w, objar, width, height, options, sts);
}
XAttOne *XNavGtk::xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
......@@ -313,9 +315,9 @@ XttMultiView *XNavGtk::multiview_new( const char *name, pwr_tAttrRef *aref,
}
GeCurve *XNavGtk::gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right)
int pos_right, unsigned int options)
{
return new GeCurveGtk( this, parent_wid, name, filename, data, pos_right);
return new GeCurveGtk( this, parent_wid, name, filename, data, pos_right, 0, 0, options);
}
XttFileview *XNavGtk::fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
......
......@@ -76,12 +76,12 @@ class XNavGtk : public XNav {
pwr_tStatus *sts);
Op *op_new( char *opplace, pwr_tStatus *sts);
XttTrend *xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
pwr_tStatus *sts);
int width, int height, unsigned int options, pwr_tStatus *sts);
XttSevHist *xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev,
pwr_tOName *onamev, bool *sevhistobjectv, sevcli_tCtx scctx,
char *filename, pwr_tStatus *sts);
XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, pwr_tStatus *sts);
XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, pwr_tStatus *sts);
char *filename, int width, int height, unsigned int options, pwr_tStatus *sts);
XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, pwr_tStatus *sts);
XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options, pwr_tStatus *sts);
XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts);
CLog *clog_new( const char *name, pwr_tStatus *sts);
......@@ -100,7 +100,7 @@ class XNavGtk : public XNav {
int (*get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*is_authorized_cb) (void *, unsigned int));
GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right);
int pos_right, unsigned int options);
XttFileview *fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr, char *filetype);
CoLogin *login_new( const char *wl_name,
......
......@@ -344,7 +344,7 @@ EvMotif::~EvMotif()
ev = NULL;
}
void EvMotif::map_eve()
void EvMotif::map_eve( unsigned int options)
{
if ( !eve_displayed) {
flow_MapWidget( parent_wid_eve);
......@@ -356,7 +356,7 @@ void EvMotif::map_eve()
}
}
void EvMotif::map_ala()
void EvMotif::map_ala( unsigned int options)
{
if ( !ala_displayed) {
flow_MapWidget( parent_wid_ala);
......@@ -368,7 +368,7 @@ void EvMotif::map_ala()
}
}
void EvMotif::map_blk()
void EvMotif::map_blk( unsigned int options)
{
if ( !blk_displayed) {
flow_MapWidget( parent_wid_blk);
......
......@@ -84,9 +84,9 @@ class EvMotif : public Ev {
CoWowFocusTimerMotif ala_focustimer;
CoWowFocusTimerMotif blk_focustimer;
void map_eve();
void map_ala();
void map_blk();
void map_eve( unsigned int options);
void map_ala( unsigned int options);
void map_blk( unsigned int options);
void unmap_eve();
void unmap_ala();
void unmap_blk();
......
......@@ -82,6 +82,9 @@ XttFastMotif::XttFastMotif( void *parent_ctx,
char *name,
Widget *w,
pwr_sAttrRef *fast_arp,
int width,
int height,
unsigned int options,
int *sts) :
XttFast( parent_ctx, name, fast_arp, sts), parent_widget(parent_wid)
{
......@@ -89,7 +92,8 @@ XttFastMotif::XttFastMotif( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveMotif( this, parent_widget, title, NULL, gcd, 0);
curve = new GeCurveMotif( this, parent_widget, title, NULL, gcd, 0,
width, height, options);
curve->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb;
......
......@@ -52,6 +52,9 @@ class XttFastMotif : public XttFast {
char *xn_name,
Widget *w,
pwr_sAttrRef *fast_arp,
int xn_width,
int xn_height,
unsigned int xn_options,
int *sts);
~XttFastMotif();
};
......
......@@ -81,6 +81,9 @@ XttTrendMotif::XttTrendMotif( void *parent_ctx,
Widget *w,
pwr_sAttrRef *trend_list,
pwr_sAttrRef *plotgroup,
int width,
int height,
unsigned int options,
int *sts) :
XttTrend( parent_ctx, name, trend_list, plotgroup, sts), parent_widget(parent_wid)
{
......@@ -88,7 +91,8 @@ XttTrendMotif::XttTrendMotif( void *parent_ctx,
return;
*sts = XNAV__SUCCESS;
curve = new GeCurveMotif( this, parent_widget, name, NULL, gcd, 1);
curve = new GeCurveMotif( this, parent_widget, name, NULL, gcd, 1,
width, height, options);
curve->close_cb = trend_close_cb;
curve->help_cb = trend_help_cb;
......
......@@ -53,6 +53,9 @@ class XttTrendMotif : public XttTrend {
Widget *w,
pwr_sAttrRef *objid,
pwr_sAttrRef *plotgroup,
int width,
int height,
unsigned int options,
int *sts);
~XttTrendMotif();
};
......
......@@ -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_tAttrRef *arp, pwr_tStatus *sts)
Hist *XNavMotif::hist_new( char *title, pwr_tOid oid, pwr_tStatus *sts)
{
return new HistMotif( this, parent_wid, title, arp, sts);
return new HistMotif( this, parent_wid, title, oid, sts);
}
Block *XNavMotif::block_new( pwr_tAttrRef *arp, char *name, unsigned int priv,
......@@ -263,18 +263,18 @@ Op *XNavMotif::op_new( char *opplace, pwr_tStatus *sts)
}
XttTrend *XNavMotif::xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
pwr_tStatus *sts)
int width, int height, unsigned int options, pwr_tStatus *sts)
{
Widget w;
return new XttTrendMotif( this, parent_wid, name, &w, objar, plotgroup, sts);
return new XttTrendMotif( this, parent_wid, name, &w, objar, plotgroup, width, height, options, sts);
}
XttFast *XNavMotif::xttfast_new( char *name, pwr_tAttrRef *objar, pwr_tStatus *sts)
XttFast *XNavMotif::xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options, pwr_tStatus *sts)
{
Widget w;
return new XttFastMotif( this, parent_wid, name, &w, objar, sts);
return new XttFastMotif( this, parent_wid, name, &w, objar, width, height, options, sts);
}
XAttOne *XNavMotif::xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
......@@ -292,8 +292,7 @@ XttGe *XNavMotif::xnav_ge_new( const char *name, const char *filename, int scrol
int navigator, int width, int height, int x, int y,
double scan_time, const char *object_name,
int use_default_access, unsigned int access, unsigned int options,
void *basewidget,
int (*command_cb) (XttGe *, char *, void *),
int (*command_cb) (XttGe *, char *),
int (*get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*is_authorized_cb) (void *, unsigned int))
{
......@@ -303,9 +302,9 @@ XttGe *XNavMotif::xnav_ge_new( const char *name, const char *filename, int scrol
}
GeCurve *XNavMotif::gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right)
int pos_right, unsigned int options)
{
return new GeCurveMotif( this, parent_wid, name, filename, data, pos_right);
return new GeCurveMotif( this, parent_wid, name, filename, data, pos_right, options);
}
CoLogin *XNavMotif::login_new( const char *name,
......
......@@ -69,13 +69,15 @@ 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_tAttrRef *arp, pwr_tStatus *sts);
Hist *hist_new( char *title, pwr_tOid oid, 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);
XttTrend *xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
int width, int height, unsigned int options,
pwr_tStatus *sts);
XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, pwr_tStatus *sts);
XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height,
unsigned int options, pwr_tStatus *sts);
XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts);
CLog *clog_new( const char *name, pwr_tStatus *sts);
......@@ -83,12 +85,11 @@ class XNavMotif : public XNav {
int navigator, int width, int height, int x, int y,
double scan_time, const char *object_name,
int use_default_access, unsigned int access, unsigned int options,
void *basewidget,
int (*xg_command_cb) (XttGe *, char *, void *),
int (*xg_command_cb) (XttGe *, char *),
int (*xg_get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*xg_is_authorized_cb) (void *, unsigned int));
GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right);
unsigned int options, int pos_right);
CoLogin *login_new( const char *wl_name,
const char *wl_groupname,
void (* wl_bc_success)( void *),
......
......@@ -59,7 +59,11 @@ typedef struct {
} ev_sAlias;
typedef enum {
ev_mAlaOptions_Embedded = 1 << 0
ev_mAlaOptions_Embedded = 1 << 0,
ev_mAlaOptions_FullScreen = 1 << 1,
ev_mAlaOptions_Maximize = 1 << 2,
ev_mAlaOptions_FullMaximize = 1 << 3,
ev_mAlaOptions_Iconify = 1 << 4
} ev_mAlaOptions;
class Ev {
......@@ -118,9 +122,9 @@ class Ev {
EvAla *sala[20];
int sala_cnt;
virtual void map_eve() {}
virtual void map_ala() {}
virtual void map_blk() {}
virtual void map_eve( unsigned int options) {}
virtual void map_ala( unsigned int options) {}
virtual void map_blk( unsigned int options) {}
virtual void unmap_eve() {}
virtual void unmap_ala() {}
virtual void unmap_blk() {}
......
......@@ -50,6 +50,7 @@
#include "glow_growapi.h"
#include "co_lng.h"
#include "xtt_ge.h"
#include "xtt_trend.cpp"
#include "xtt_multiview.h"
#include "xtt_log.h"
......@@ -197,6 +198,38 @@ void XttMultiView::multiview_ge_help_cb( void *multiview_ctx, const char *key)
(multiview->help_cb)( multiview->parent_ctx, key);
}
void XttMultiView::multiview_trend_close_cb( void *ctx, XttTrend *trend)
{
}
void XttMultiView::multiview_trend_command_cb( void *ctx, const char *cmd)
{
XttMultiView *multiview = (XttMultiView *) ctx;
int sts;
if ( multiview->command_cb) {
sts = (multiview->command_cb)( multiview->parent_ctx, (char *)cmd, ctx);
return;
}
}
void XttMultiView::multiview_trend_help_cb( void *ctx, const char *key)
{
XttMultiView *multiview = (XttMultiView *)ctx;
if ( multiview->help_cb)
(multiview->help_cb)( multiview->parent_ctx, key);
}
int XttMultiView::multiview_sevhist_get_select_cb( void *ctx, pwr_tOid *oid, char *aname, char *oname)
{
XttMultiView *multiview = (XttMultiView *)ctx;
if ( multiview->get_select_cb)
return (multiview->get_select_cb)( multiview->parent_ctx, oid, aname, oname);
return 0;
}
void XttMultiView::message_cb( void *ctx, char severity, const char *msg)
{
((XttMultiView *)ctx)->message( severity, msg);
......@@ -299,6 +332,7 @@ XttMultiView::XttMultiView( void *mv_parent_ctx, const char *mv_name,
command_cb(mv_command_cb), close_cb(0), help_cb(0), display_in_xnav_cb(0),
is_authorized_cb(mv_is_authorized_cb), popup_menu_cb(0), call_method_cb(0),
get_current_objects_cb(mv_get_current_objects_cb), sound_cb(0), eventlog_cb(0),
get_select_cb(0),
width(mv_width), height(mv_height)
{
strcpy( name, mv_name);
......
......@@ -53,6 +53,7 @@
class Graph;
class XNav;
class XttTrend;
class MVRecall {
public:
......@@ -86,6 +87,7 @@ class XttMultiView {
int (*get_current_objects_cb)(void *, pwr_sAttrRef **, int **);
int (*sound_cb)(void *, pwr_tAttrRef *);
void (*eventlog_cb)(void *, void *, int, void *, unsigned int);
int (*get_select_cb)(void *, pwr_tOid *, char *, char *);
int width;
int height;
int rows;
......@@ -133,6 +135,10 @@ class XttMultiView {
static void multiview_ge_eventlog_cb( void *multiview_ctx, void *gectx, int category,
void *value, unsigned int size);
static void multiview_ge_help_cb( void *multiview_ctx, const char *key);
static void multiview_trend_close_cb( void *ctx, XttTrend *trend);
static void multiview_trend_command_cb( void *ctx, const char *cmd);
static void multiview_trend_help_cb( void *ctx, const char *key);
static int multiview_sevhist_get_select_cb( void *ctx, pwr_tOid *oid, char *aname, char *oname);
static void message_cb( void *ctx, char severity, const char *msg);
static void eventlog_enable( int enable);
};
......
......@@ -694,6 +694,11 @@ void XttSevHist::pop()
curve->pop();
}
void XttSevHist::setup()
{
curve->setup( curve_mEnable_Timebox | curve_mEnable_Export);
}
void XttSevHist::sevhist_close_cb( void *ctx)
{
XttSevHist *sevhist = (XttSevHist *) ctx;
......
......@@ -120,6 +120,7 @@ class XttSevHist {
void curve_add( pwr_tOid oid, pwr_tOName aname, pwr_tOName oname,
bool sevhistobject);
int read_export( char *filename);
void setup();
static void sevhist_close_cb( void *ctx);
static void sevhist_increase_period_cb( void *ctx);
......
......@@ -957,6 +957,7 @@ int XttTCurve::load_data( pwr_tStatus *sts, pwr_tAttrRef *aref)
break;
}
default:
*sts = 0;
return 0;
}
}
......
......@@ -493,6 +493,11 @@ void XttTrend::pop()
curve->pop();
}
void XttTrend::setup()
{
curve->setup( curve_mEnable_Snapshot);
}
void XttTrend::trend_close_cb( void *ctx)
{
XttTrend *trend = (XttTrend *) ctx;
......
......@@ -90,6 +90,7 @@ class XttTrend {
int *sts);
virtual ~XttTrend();
void pop();
void setup();
static void trend_close_cb( void *ctx);
static void trend_help_cb( void *ctx);
......
......@@ -347,12 +347,12 @@ class XNav {
pwr_tStatus *sts) {return 0;}
virtual Op *op_new( char *opplace, pwr_tStatus *sts) {return 0;}
virtual XttTrend *xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
pwr_tStatus *sts) {return 0;}
int width, int height, unsigned int options, pwr_tStatus *sts) {return 0;}
virtual XttSevHist *xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *aname,
pwr_tOName *oname, bool *sevhistobjectv, sevcli_tCtx scctx,
char *filename, pwr_tStatus *sts) {return 0;}
virtual XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, pwr_tStatus *sts) {return 0;}
virtual XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, pwr_tStatus *sts) {return 0;}
char *filename, int width, int height, unsigned int options, pwr_tStatus *sts) {return 0;}
virtual XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, pwr_tStatus *sts) {return 0;}
virtual XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options, pwr_tStatus *sts) {return 0;}
virtual XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts) {return 0;}
virtual CLog *clog_new( const char *name, pwr_tStatus *sts) {return 0;}
......@@ -371,7 +371,7 @@ class XNav {
int (*get_current_objects_cb) (void *, pwr_sAttrRef **, int **),
int (*is_authorized_cb) (void *, unsigned int)) {return 0;}
virtual GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right) {return 0;}
int pos_right, unsigned int options) {return 0;}
virtual XttFileview *fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr,
char *filetype) {return 0;}
......
......@@ -260,6 +260,7 @@ dcli_tCmdTable xnav_command_table[] = {
"/MAXOBJECTS", "/VOLUME", "/ALL", "/TYPE",
"/OPTION", "/ENTRY", "/NEW", "/TITLE", "/WINDOW",
"/ALARMVIEW", "/WIDTH", "/HEIGHT", "/XPOSITION", "/YPOSITION",
"/FULLSCREEN", "/MAXIMIZE", "/FULLMAXIMIZE",
"/SORT", ""}
},
{
......@@ -855,10 +856,8 @@ static int xnav_set_func( void *client_data,
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/SOURCE", source_str, sizeof(source_str)))) {
xnav->message('E',"Syntax error");
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/SOURCE", source_str, sizeof(source_str))))
strcpy( source_str, "");
if ( ODD( dcli_get_qualifier( "/OBJECT", object_str, sizeof(object_str))))
object_p = object_str;
......@@ -871,6 +870,11 @@ static int xnav_set_func( void *client_data,
cont = ODD( dcli_get_qualifier( "/CONTINUE", 0, 0));
if ( xnav->appl.find_graph( graph_str, 0, (void **) &gectx)) {
if ( strcmp( source_str, "") == 0) {
xnav->message('E',"Syntax error");
return XNAV__HOLDCOMMAND;
}
return gectx->set_subwindow_source( name_str, source_str, object_p);
}
else {
......@@ -1897,6 +1901,16 @@ static int xnav_show_func( void *client_data,
}
else if ( cdh_NoCaseStrncmp( arg1_str, "EVENTLIST", strlen( arg1_str)) == 0)
{
unsigned int options = 0;
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= ev_mAlaOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= ev_mAlaOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= ev_mAlaOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= ev_mAlaOptions_Iconify;
if ( !xnav->ev)
{
......@@ -1926,7 +1940,7 @@ static int xnav_show_func( void *client_data,
xnav->ev->is_authorized_cb = xnav->is_authorized_cb;
}
else
xnav->ev->map_eve();
xnav->ev->map_eve( options);
}
/*new code by Jonas Nylund 030122*/
else if ( cdh_NoCaseStrncmp( arg1_str, "HISTLIST", strlen( arg1_str)) == 0)
......@@ -1969,6 +1983,16 @@ static int xnav_show_func( void *client_data,
{
char arg2_str[80];
int arg2_sts;
unsigned int options = 0;
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= ev_mAlaOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= ev_mAlaOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= ev_mAlaOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= ev_mAlaOptions_Iconify;
if ( !xnav->ev) {
char alarm_title[40], event_title[40], block_title[40];
......@@ -2068,11 +2092,21 @@ static int xnav_show_func( void *client_data,
}
}
else {
xnav->ev->map_ala();
xnav->ev->map_ala( options);
}
}
else if ( cdh_NoCaseStrncmp( arg1_str, "BLOCKLIST", strlen( arg1_str)) == 0)
{
unsigned int options = 0;
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= ev_mAlaOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= ev_mAlaOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= ev_mAlaOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= ev_mAlaOptions_Iconify;
if ( !xnav->ev)
{
......@@ -2102,7 +2136,7 @@ static int xnav_show_func( void *client_data,
xnav->ev->is_authorized_cb = xnav->is_authorized_cb;
}
else
xnav->ev->map_blk();
xnav->ev->map_blk( options);
}
else if ( cdh_NoCaseStrncmp( arg1_str, "USER", strlen( arg1_str)) == 0)
{
......@@ -3213,6 +3247,7 @@ static int xnav_open_func( void *client_data,
mvctx->call_method_cb = xnav_call_method_cb;
mvctx->sound_cb = xnav_ge_sound_cb;
mvctx->eventlog_cb = xnav_ge_eventlog_cb;
mvctx->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_MultiView, (void *)mvctx, &aref, "",
NULL);
......@@ -3399,9 +3434,43 @@ static int xnav_open_func( void *client_data,
pwr_tObjid node_objid;
pwr_tAName trend_name;
XttTrend *trend;
unsigned int options = 0;
int width, height, nr;
char tmp_str[40];
// Command is "OPEN TREND"
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= curve_mOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= curve_mOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= curve_mOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= curve_mOptions_Iconify;
if ( ODD( dcli_get_qualifier( "/HIDE", 0, 0)))
options |= curve_mOptions_Invisible;
if ( ODD( dcli_get_qualifier( "/WIDTH", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &width);
if ( nr != 1) {
xnav->message('E', "Syntax error in width");
return XNAV__HOLDCOMMAND;
}
}
else
width = 0;
if ( ODD( dcli_get_qualifier( "/HEIGHT", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &height);
if ( nr != 1) {
xnav->message('E', "Syntax error in height");
return XNAV__HOLDCOMMAND;
}
}
else
height = 0;
/* Get the name qualifier */
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str, sizeof(name_str)))) {
if ( name_str[0] != '/')
......@@ -3494,7 +3563,7 @@ static int xnav_open_func( void *client_data,
trend->pop();
}
else {
trend = xnav->xtttrend_new( title_str, NULL, &plotgroup, &sts);
trend = xnav->xtttrend_new( title_str, NULL, &plotgroup, width, height, options, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in trend configuration");
else {
......@@ -3513,7 +3582,7 @@ static int xnav_open_func( void *client_data,
trend->pop();
}
else {
trend = xnav->xtttrend_new( title_str, aref_vect, 0, &sts);
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in trend configuration");
else {
......@@ -3526,7 +3595,7 @@ static int xnav_open_func( void *client_data,
}
}
else {
trend = xnav->xtttrend_new( title_str, aref_vect, 0, &sts);
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, &sts);
if ( ODD(sts)) {
trend->close_cb = xnav_trend_close_cb;
trend->command_cb = xnav_trend_command_cb;
......@@ -3608,13 +3677,48 @@ static int xnav_open_func( void *client_data,
pwr_tAttrRef aref_vect[2];
pwr_tStatus sts;
char title_str[80];
unsigned int options = 0;
int width, height, nr;
char tmp_str[40];
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= curve_mOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= curve_mOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= curve_mOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= curve_mOptions_Iconify;
if ( ODD( dcli_get_qualifier( "/HIDE", 0, 0)))
options |= curve_mOptions_Invisible;
if ( ODD( dcli_get_qualifier( "/WIDTH", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &width);
if ( nr != 1) {
xnav->message('E', "Syntax error in width");
return XNAV__HOLDCOMMAND;
}
}
else
width = 0;
if ( ODD( dcli_get_qualifier( "/HEIGHT", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &height);
if ( nr != 1) {
xnav->message('E', "Syntax error in height");
return XNAV__HOLDCOMMAND;
}
}
else
height = 0;
if ( EVEN( dcli_get_qualifier( "/TITLE", title_str, sizeof(title_str)))) {
strcpy( title_str, "Trend");
}
if ( ODD( dcli_get_qualifier( "/NEW", 0, 0))) {
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, 0, &sts);
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, 0, width, height,
options, &sts);
if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb;
......@@ -3654,7 +3758,8 @@ static int xnav_open_func( void *client_data,
xnav->message('E', "Object not found");
return XNAV__HOLDCOMMAND;
}
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, aref_vect, &sts);
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, aref_vect,
width, height, options, &sts);
if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb;
......@@ -3690,12 +3795,47 @@ static int xnav_open_func( void *client_data,
char *s;
bool sevHistObjectFound = false;
pwr_tFileName file_str;
unsigned int options = 0;
int width, height, nr;
char tmp_str[40];
// Command is "OPEN HISTORY"
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= curve_mOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= curve_mOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= curve_mOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= curve_mOptions_Iconify;
if ( ODD( dcli_get_qualifier( "/HIDE", 0, 0)))
options |= curve_mOptions_Invisible;
if ( ODD( dcli_get_qualifier( "/WIDTH", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &width);
if ( nr != 1) {
xnav->message('E', "Syntax error in width");
return XNAV__HOLDCOMMAND;
}
}
else
width = 0;
if ( ODD( dcli_get_qualifier( "/HEIGHT", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &height);
if ( nr != 1) {
xnav->message('E', "Syntax error in height");
return XNAV__HOLDCOMMAND;
}
}
else
height = 0;
if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) {
// Open exported history file
hist = xnav->xttsevhist_new( title_str, 0, 0, 0, 0, 0, file_str, &sts);
hist = xnav->xttsevhist_new( title_str, 0, 0, 0, 0, 0, file_str,
width, height, options, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
......@@ -3941,21 +4081,24 @@ static int xnav_open_func( void *client_data,
}
if ( plotgroup_found) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv, xnav->scctx, 0, &sts);
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
}
}
else if( sevHistObjectFound ) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv, xnav->scctx, 0, &sts);
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
}
}
else {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv, xnav->scctx, 0, &sts);
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
......@@ -3970,9 +4113,43 @@ static int xnav_open_func( void *client_data,
pwr_sAttrRef aref;
int sts;
pwr_tClassId classid;
unsigned int options = 0;
int width, height, nr;
char tmp_str[40];
// Command is "OPEN FAST"
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= curve_mOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= curve_mOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= curve_mOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= curve_mOptions_Iconify;
if ( ODD( dcli_get_qualifier( "/HIDE", 0, 0)))
options |= curve_mOptions_Invisible;
if ( ODD( dcli_get_qualifier( "/WIDTH", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &width);
if ( nr != 1) {
xnav->message('E', "Syntax error in width");
return XNAV__HOLDCOMMAND;
}
}
else
width = 0;
if ( ODD( dcli_get_qualifier( "/HEIGHT", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &height);
if ( nr != 1) {
xnav->message('E', "Syntax error in height");
return XNAV__HOLDCOMMAND;
}
}
else
height = 0;
/* Get the name qualifier */
if ( ODD( dcli_get_qualifier( "dcli_arg2", name_str, sizeof(name_str))))
{
......@@ -4028,7 +4205,7 @@ static int xnav_open_func( void *client_data,
fast->pop();
}
else {
fast = xnav->xttfast_new( title_str, &aref, &sts);
fast = xnav->xttfast_new( title_str, &aref, width, height, options, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in fast configuration");
else {
......@@ -8255,7 +8432,7 @@ int XNav::set_parameter( char *name_str, char *value_str, int bypass)
void XNav::open_rttlog( char *name, char *filename)
{
gecurve_new( name, filename, NULL, 0);
gecurve_new( name, filename, NULL, 0, 0);
}
......
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