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,6 +138,7 @@ void GeCurveGtk::activate_exit( GtkWidget *w, gpointer data)
{
GeCurve *curve = (GeCurve *)data;
if ( !(curve->options & curve_mOptions_Embedded))
curve->activate_exit();
}
......@@ -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,11 +680,20 @@ 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);
if ( !(options & curve_mOptions_Embedded))
gtk_widget_destroy( toplevel);
}
......@@ -705,23 +726,33 @@ 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
if ( !(options & curve_mOptions_Embedded)) {
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", window_height,
"default-width", window_width,
......@@ -733,6 +764,10 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
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);
if ( !(options & curve_mOptions_Embedded)) {
gtk_container_add( GTK_CONTAINER(toplevel), vbox);
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);
}
......
This diff is collapsed.
......@@ -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,
......
......@@ -66,6 +66,9 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
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;
......
......@@ -52,6 +52,9 @@ class XttTCurveGtk : public XttTCurve {
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;}
......
This diff is collapsed.
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