Commit 683a976b authored by Claes Sjofors's avatar Claes Sjofors

Xtt curve window, colortheme added

parent 6cbb72b6
......@@ -749,9 +749,10 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
int pos_right,
int gc_width,
int gc_height,
unsigned int gc_options) :
unsigned int gc_options,
int gc_color_theme) :
GeCurve( gc_parent_ctx, curve_name, filename, curve_data, pos_right,
gc_width, gc_height, gc_options),
gc_width, gc_height, gc_options, gc_color_theme),
minmax_widget(0), export_widget(0), disable_timecombo_callback(0), clock_cursor(0)
{
......
......@@ -49,7 +49,7 @@ class GeCurveGtk : public GeCurve {
public:
GeCurveGtk( void *gc_parent_ctx, GtkWidget *parent_widget, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right,
int gc_width, int gc_height, unsigned int gc_options);
int gc_width, int gc_height, unsigned int gc_options, int gc_color_theme);
GtkWidget *parent_wid;
GtkWidget *grow_widget;
GtkWidget *curve_widget;
......
This diff is collapsed.
......@@ -208,10 +208,11 @@ class GeCurve {
int center_from_window;
unsigned int options;
unsigned int layout_mask;
int color_theme;
GeCurve( void *gc_parent_ctx, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right,
int gc_width, int gc_height, unsigned int options);
int gc_width, int gc_height, unsigned int options, int color_theme);
virtual ~GeCurve();
virtual void write_title( char *str) {}
virtual void pop() {}
......@@ -261,6 +262,7 @@ class GeCurve {
void x_to_points( double x, double *time, double *values);
void set_center_from_window( int val) { center_from_window = val;}
void set_title( const char *str);
void update_color_theme( int ct);
static int growcurve_cb( GlowCtx *ctx, glow_tEvent event);
static int init_growcurve_cb( GlowCtx *fctx, void *client_data);
......
......@@ -637,7 +637,7 @@ GlowDrawGtk::GlowDrawGtk(
original_background = background;
if ( type == glow_eCtxType_Grow) {
if ( type == glow_eCtxType_Grow || type == glow_eCtxType_Curve) {
ctx->customcolors = create_customcolors();
push_customcolors( ctx->customcolors);
}
......
......@@ -1637,6 +1637,7 @@ int GrowCtx::event_handler( glow_eEvent event, int x, int y, int w, int h)
e.any.y = double (y + mw.offset_y) / mw.zoom_factor_y;
e.object.object = restriction_object;
e.object.object_type = restriction_object->type();
if ( event_callback[glow_eEvent_SliderMoveEnd])
event_callback[glow_eEvent_SliderMoveEnd]( this, &e);
}
node_move_last_x = x;
......
......@@ -70,8 +70,9 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
int width,
int height,
unsigned int options,
int xn_color_theme,
int *sts) :
XttFast( parent_ctx, name, fast_arp, sts), parent_widget(parent_wid)
XttFast( parent_ctx, name, fast_arp, xn_color_theme, sts), parent_widget(parent_wid)
{
char title[250];
......@@ -86,7 +87,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
gdh_AttrrefToName( fast_arp, title, sizeof(title), cdh_mNName);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 0, width, height,
options);
options, color_theme);
curve->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb;
curve->export_cb = fast_export_cb;
......@@ -103,8 +104,9 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int *sts) :
XttFast( parent_ctx, name, filename, sts),
XttFast( parent_ctx, name, filename, xn_color_theme, sts),
parent_widget(parent_wid)
{
char title[250];
......@@ -116,7 +118,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0, color_theme);
curve->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb;
curve->enable(0);
......
......@@ -55,12 +55,14 @@ class XttFastGtk : public XttFast {
int width,
int height,
unsigned int xn_options,
int xn_color_theme,
int *sts);
XttFastGtk( void *parent_ctx,
GtkWidget *parent_wid,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int *sts);
~XttFastGtk();
};
......
......@@ -495,13 +495,15 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
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);
0, &plotgroup, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, sts);
}
else {
arefv[0] = mv.Action[i*rows+j].Object[0];
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);
arefv, 0, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, sts);
}
if ( EVEN(*sts)) break;
......@@ -698,7 +700,7 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
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);
(unsigned int)curve_mOptions_Embedded, color_theme, sts);
if ( EVEN(*sts)) break;
sevhist[i*rows + j]->help_cb = multiview_trend_help_cb;
......@@ -1058,13 +1060,15 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
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);
0, &plotgroup, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, &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);
arefv, 0, w, h, (unsigned int)curve_mOptions_Embedded,
color_theme, &lsts);
}
if ( EVEN(lsts)) break;
......@@ -1258,7 +1262,7 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
ctx = new XttSevHistGtk( this, toplevel, (char *)"No title", &comp_w,
oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, w, h,
(unsigned int)curve_mOptions_Embedded, &lsts);
(unsigned int)curve_mOptions_Embedded, color_theme, &lsts);
if ( EVEN(lsts)) break;
ctx->help_cb = multiview_trend_help_cb;
......
......@@ -73,8 +73,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
int xn_width,
int xn_height,
unsigned int xn_options,
int xn_color_theme,
int *sts) :
XttSevHist( parent_ctx, name, xn_oidv, xn_anamev, xn_onamev, sevhistobjectv, xn_scctx, sts),
XttSevHist( parent_ctx, name, xn_oidv, xn_anamev, xn_onamev, sevhistobjectv, xn_scctx, xn_color_theme, sts),
parent_widget(parent_wid)
{
char title[250];
......@@ -87,7 +88,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1,
xn_width, xn_height, xn_options);
xn_width, xn_height, xn_options, color_theme);
curve->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb;
curve->increase_period_cb = sevhist_increase_period_cb;
......@@ -116,8 +117,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int *sts) :
XttSevHist( parent_ctx, name, filename, sts),
XttSevHist( parent_ctx, name, filename, xn_color_theme, sts),
parent_widget(parent_wid)
{
char title[250];
......@@ -129,7 +131,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1, 0, 0, 0, color_theme);
curve->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb;
curve->enable(0);
......
......@@ -59,12 +59,14 @@ class XttSevHistGtk : public XttSevHist {
int width,
int height,
unsigned int options,
int xn_color_theme,
int *sts);
XttSevHistGtk( void *parent_ctx,
GtkWidget *parent_wid,
const char *name,
GtkWidget **w,
char *filename,
int xn_color_theme,
int *sts);
~XttSevHistGtk();
};
......
......@@ -69,8 +69,9 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
int xn_width,
int xn_height,
unsigned int xn_options,
int xn_color_theme,
int *sts) :
XttTCurve( parent_ctx, name, xn_arefv, sts),
XttTCurve( parent_ctx, name, xn_arefv, xn_color_theme, sts),
parent_widget(parent_wid)
{
char title[250];
......@@ -83,7 +84,7 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 1,
xn_width, xn_height, xn_options);
xn_width, xn_height, xn_options, color_theme);
curve->close_cb = tcurve_close_cb;
curve->help_cb = tcurve_help_cb;
curve->increase_period_cb = tcurve_increase_period_cb;
......
......@@ -55,6 +55,7 @@ class XttTCurveGtk : public XttTCurve {
int xn_width,
int xn_height,
unsigned int xn_options,
int xn_color_theme,
int *sts);
~XttTCurveGtk();
};
......
......@@ -69,8 +69,9 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
int width,
int height,
unsigned int x_options,
int x_color_theme,
int *sts) :
XttTrend( parent_ctx, name, trend_list, plotgroup, x_options, sts),
XttTrend( parent_ctx, name, trend_list, plotgroup, x_options, x_color_theme, sts),
parent_widget(parent_wid)
{
if ( EVEN(*sts))
......@@ -78,7 +79,7 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
*sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, name, NULL, gcd, 1, width, height,
options);
options, color_theme);
curve->close_cb = trend_close_cb;
curve->help_cb = trend_help_cb;
curve->snapshot_cb = trend_snapshot_cb;
......
......@@ -56,6 +56,7 @@ class XttTrendGtk : public XttTrend {
int width,
int height,
unsigned int options,
int x_color_theme,
int *sts);
~XttTrendGtk();
};
......
......@@ -275,41 +275,41 @@ Op *XNavGtk::op_new( char *opplace, pwr_tStatus *sts)
}
XttTrend *XNavGtk::xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup,
int width, int height, unsigned int options, pwr_tStatus *sts)
int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts)
{
GtkWidget *w;
return new XttTrendGtk( this, parent_wid, name, &w, objar, plotgroup, width, height, options, sts);
return new XttTrendGtk( this, parent_wid, name, &w, objar, plotgroup, width, height, options, color_theme, sts);
}
XttSevHist *XNavGtk::xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev, pwr_tOName *onamev,
bool *sevhistobjectv, sevcli_tCtx scctx, char *filename,
int width, int height, unsigned int options, pwr_tStatus *sts)
int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts)
{
GtkWidget *w;
if ( !filename)
return new XttSevHistGtk( this, parent_wid, name, &w, oidv, anamev, onamev, sevhistobjectv, scctx, width, height, options, sts);
return new XttSevHistGtk( this, parent_wid, name, &w, oidv, anamev, onamev, sevhistobjectv, scctx, width, height, options, color_theme, sts);
else
return new XttSevHistGtk( this, parent_wid, name, &w, filename, sts);
return new XttSevHistGtk( this, parent_wid, name, &w, filename, color_theme, sts);
}
XttTCurve *XNavGtk::xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, pwr_tStatus *sts)
XttTCurve *XNavGtk::xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts)
{
GtkWidget *w;
return new XttTCurveGtk( this, parent_wid, name, &w, arefv, width, height, options, sts);
return new XttTCurveGtk( this, parent_wid, name, &w, arefv, width, height, options, color_theme, sts);
}
XttFast *XNavGtk::xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height,
unsigned int options, char *filename, pwr_tStatus *sts)
unsigned int options, char *filename, int color_theme, pwr_tStatus *sts)
{
GtkWidget *w;
if ( !filename)
return new XttFastGtk( this, parent_wid, name, &w, objar, width, height, options, sts);
return new XttFastGtk( this, parent_wid, name, &w, objar, width, height, options, color_theme, sts);
else
return new XttFastGtk( this, parent_wid, name, &w, filename, sts);
return new XttFastGtk( this, parent_wid, name, &w, filename, color_theme, sts);
}
XAttOne *XNavGtk::xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
......@@ -359,9 +359,9 @@ XttStream *XNavGtk::stream_new( const char *name, const char *uri,
}
GeCurve *XNavGtk::gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options)
int pos_right, unsigned int options, int color_theme)
{
return new GeCurveGtk( this, parent_wid, name, filename, data, pos_right, 0, 0, options);
return new GeCurveGtk( this, parent_wid, name, filename, data, pos_right, 0, 0, options, color_theme);
}
XttFileview *XNavGtk::fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
......
......@@ -77,13 +77,15 @@ 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,
int width, int height, unsigned int options, pwr_tStatus *sts);
int width, int height, unsigned int options, int color_theme, pwr_tStatus *sts);
XttSevHist *xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev,
pwr_tOName *onamev, bool *sevhistobjectv, sevcli_tCtx scctx,
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);
char *filename, int width, int height, unsigned int options, int color_theme,
pwr_tStatus *sts);
XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options,
int color_theme, pwr_tStatus *sts);
XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options,
char *filename, pwr_tStatus *sts);
char *filename, int color_theme, 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);
......@@ -105,7 +107,7 @@ class XNavGtk : public XNav {
int width, int height, int x, int y, double scan_time,
unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts);
GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options);
int pos_right, unsigned int options, int color_theme);
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,
......
......@@ -49,7 +49,8 @@ typedef enum {
applist_eType_Hist,
applist_eType_Fast,
applist_eType_MultiView,
applist_eType_Stream
applist_eType_Stream,
applist_eType_SevHist
} applist_eType;
......
......@@ -67,9 +67,10 @@
XttFast::XttFast( void *parent_ctx,
char *name,
pwr_sAttrRef *fast_arp,
int xn_color_theme,
int *sts) :
xnav(parent_ctx), fast_cnt(0), timerid(0), close_cb(0), help_cb(0), first_scan(1),
axis_configured(false)
axis_configured(false), color_theme(xn_color_theme)
{
pwr_sAttrRef aref = pwr_cNAttrRef;
pwr_tAName fast_name;
......@@ -216,8 +217,9 @@ XttFast::XttFast( void *parent_ctx,
XttFast::XttFast( void *parent_ctx,
const char *name,
char *filename,
int xn_color_theme,
int *sts) : xnav(parent_ctx), fast_cnt(0), timerid(0), close_cb(0), help_cb(0),
first_scan(1), axis_configured(false)
first_scan(1), axis_configured(false), color_theme(xn_color_theme)
{
*sts = read_export( filename);
......
......@@ -99,15 +99,18 @@ class XttFast {
pwr_sAttrRef trigg_time_attr; //!< Attrref to TriggTime attribute in DsFastCurve object.
char title[250]; //!< Window title
CoWow *wow;
int color_theme;
//! Constructor
XttFast( void *xn_parent_ctx,
char *xn_name,
pwr_sAttrRef *fast_arp,
int color_theme,
int *sts);
XttFast( void *parent_ctx,
const char *name,
char *filename,
int color_theme,
int *sts);
//! Destructor
......@@ -117,6 +120,7 @@ class XttFast {
void pop();
void setup();
int read_export( char *filename);
void update_color_theme( int ct) { curve->update_color_theme(ct);}
static void fast_close_cb( void *ctx);
static void fast_help_cb( void *ctx);
......
......@@ -70,10 +70,11 @@ XttSevHist::XttSevHist( void *parent_ctx,
pwr_tOName *xn_onamev,
bool *xn_sevhistobjectv,
sevcli_tCtx xn_scctx,
int xn_color_theme,
int *sts) :
xnav(parent_ctx), gcd(0), curve(0), rows(0), vsize(0), timerid(0), close_cb(0), help_cb(0),
get_select_cb(0), first_scan(1), scctx(xn_scctx), wow(0), time_low_old(0), time_high_old(0),
initial_period(time_ePeriod_)
initial_period(time_ePeriod_), color_theme(xn_color_theme)
{
pwr_tTime from, to;
......@@ -124,9 +125,11 @@ XttSevHist::XttSevHist( void *parent_ctx,
XttSevHist::XttSevHist( void *parent_ctx,
const char *name,
char *filename,
int xn_color_theme,
int *sts) :
xnav(parent_ctx), gcd(0), curve(0), rows(0), vsize(0), timerid(0), close_cb(0), help_cb(0),
get_select_cb(0), first_scan(1), scctx(0), time_low_old(0), time_high_old(0), initial_period(time_ePeriod_)
get_select_cb(0), first_scan(1), scctx(0), time_low_old(0), time_high_old(0), initial_period(time_ePeriod_),
color_theme(xn_color_theme)
{
strncpy( title, filename, sizeof(title));
......
......@@ -95,6 +95,7 @@ class XttSevHist {
long int time_high_old;
bool sevhistobjectv[XTT_SEVHIST_MAX]; //!< Indicates that it is a SevHistObject
time_ePeriod initial_period;
int color_theme;
//! Constructor
XttSevHist( void *xn_parent_ctx,
......@@ -104,10 +105,12 @@ class XttSevHist {
pwr_tOName *xn_oname,
bool *sevhistobjectv,
sevcli_tCtx xn_scctx,
int xn_color_theme,
int *sts);
XttSevHist( void *parent_ctx,
const char *name,
char *filename,
int xn_color_theme,
int *sts);
//! Destructor
......@@ -122,6 +125,7 @@ class XttSevHist {
bool sevhistobject);
int read_export( char *filename);
void setup();
void update_color_theme( int ct) { curve->update_color_theme(ct);}
static void sevhist_close_cb( void *ctx);
static void sevhist_increase_period_cb( void *ctx);
......
......@@ -67,9 +67,10 @@
XttTCurve::XttTCurve( void *parent_ctx,
const char *name,
pwr_tAttrRef *xn_arefv,
int xn_color_theme,
int *sts) :
xnav(parent_ctx), gcd(0), curve(0), rows(0), vsize(0), timerid(0), close_cb(0), help_cb(0),
get_select_cb(0), first_scan(1), time_low_old(0), time_high_old(0)
get_select_cb(0), first_scan(1), time_low_old(0), time_high_old(0), color_theme(xn_color_theme)
{
pwr_tTime from, to;
......
......@@ -113,11 +113,13 @@ class XttTCurve {
long int time_low_old;
long int time_high_old;
tcurve_sTc tc;
int color_theme;
//! Constructor
XttTCurve( void *xn_parent_ctx,
const char *xn_name,
pwr_tAttrRef* xn_arefv,
int xn_color_theme,
int *sts);
//! Destructor
......@@ -132,6 +134,7 @@ class XttTCurve {
void save( char *filename);
void open( char *filename);
void set_title( const char *str);
void update_color_theme( int ct) { curve->update_color_theme(ct);}
static void tcurve_close_cb( void *ctx);
static void tcurve_new_cb( void *ctx);
......
......@@ -68,9 +68,10 @@ XttTrend::XttTrend( void *parent_ctx,
pwr_sAttrRef *trend_list,
pwr_sAttrRef *plotgroup,
unsigned int x_options,
int xn_color_theme,
int *sts) :
xnav(parent_ctx), trend_cnt(0), update_time(1000), options(x_options),
close_cb(0), help_cb(0), command_cb(0), get_select_cb(0)
close_cb(0), help_cb(0), command_cb(0), get_select_cb(0), color_theme(xn_color_theme)
{
pwr_sAttrRef *aref_list;
pwr_sAttrRef *aref_p;
......
......@@ -84,17 +84,20 @@ class XttTrend {
void (*command_cb)( void *, const char *);
int (*get_select_cb)( void *, pwr_tAttrRef *, int *); //!< Get selected trend object.
CoWow *wow;
int color_theme;
XttTrend( void *xn_parent_ctx,
char *xn_name,
pwr_sAttrRef *objid,
pwr_sAttrRef *plotgroup,
unsigned int options,
int xn_color_theme,
int *sts);
virtual ~XttTrend();
void pop();
void setup();
void curve_add( pwr_tAttrRef *arp, pwr_tAttrRef *trend_arp, pwr_tStatus *sts);
void update_color_theme( int ct) { curve->update_color_theme(ct);}
static void trend_close_cb( void *ctx);
static void trend_help_cb( void *ctx);
......
......@@ -361,13 +361,15 @@ 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,
int width, int height, unsigned int options, pwr_tStatus *sts) {return 0;}
int width, int height, unsigned int options, int color_theme, 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, 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;}
char *filename, int width, int height, unsigned int options,
int color_theme, pwr_tStatus *sts) {return 0;}
virtual XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options,
int color_theme, pwr_tStatus *sts) {return 0;}
virtual XttFast *xttfast_new( char *name, pwr_tAttrRef *objar, int width, int height, unsigned int options,
char *filename, pwr_tStatus *sts) {return 0;}
char *filename, int color_theme, 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;}
......@@ -389,7 +391,7 @@ class XNav {
int width, int height, int x, int y, double scan_time,
unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts) {return 0;}
virtual GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data,
int pos_right, unsigned int options) {return 0;}
int pos_right, unsigned int options, int color_theme) {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;}
......
......@@ -183,6 +183,7 @@ static void xnav_trend_help_cb( void *ctx, const char *key);
static void xnav_tcurve_close_cb( void *ctx, XttTCurve *trend);
static void xnav_tcurve_help_cb( void *ctx, const char *key);
static void xnav_sevhist_help_cb( void *ctx, const char *key);
static void xnav_sevhist_close_cb( void *ctx, XttSevHist *hist);
static int xnav_sevhist_get_select_cb( void *ctx, pwr_tOid *oid, char *aname, char *oname);
static int xnav_get_select_cb( void *ctx, pwr_tAttrRef *aref, int *is_attr);
static void xnav_fast_close_cb( void *ctx, XttFast *fast);
......@@ -1153,6 +1154,12 @@ static int xnav_set_func( void *client_data,
for ( elem = xnav->appl.root; elem; elem = elem->next) {
if ( elem->type == applist_eType_Graph)
((XttGe *)elem->ctx)->update_color_theme( idx);
else if ( elem->type == applist_eType_SevHist)
((XttSevHist *)elem->ctx)->update_color_theme( idx);
else if ( elem->type == applist_eType_Trend)
((XttTrend *)elem->ctx)->update_color_theme( idx);
else if ( elem->type == applist_eType_Fast)
((XttFast *)elem->ctx)->update_color_theme( idx);
}
}
if ( xnav->op)
......@@ -4099,7 +4106,7 @@ static int xnav_open_func( void *client_data,
trend->pop();
}
else {
trend = xnav->xtttrend_new( title_str, NULL, &plotgroup, width, height, options, &sts);
trend = xnav->xtttrend_new( title_str, NULL, &plotgroup, width, height, options, xnav->gbl.color_theme, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in trend configuration");
else {
......@@ -4119,7 +4126,7 @@ static int xnav_open_func( void *client_data,
trend->pop();
}
else {
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, &sts);
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, xnav->gbl.color_theme, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in trend configuration");
else {
......@@ -4133,7 +4140,7 @@ static int xnav_open_func( void *client_data,
}
}
else {
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, &sts);
trend = xnav->xtttrend_new( title_str, aref_vect, 0, width, height, options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) {
trend->close_cb = xnav_trend_close_cb;
trend->command_cb = xnav_trend_command_cb;
......@@ -4257,7 +4264,7 @@ static int xnav_open_func( void *client_data,
if ( ODD( dcli_get_qualifier( "/NEW", 0, 0))) {
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, 0, width, height,
options, &sts);
options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb;
......@@ -4298,7 +4305,7 @@ static int xnav_open_func( void *client_data,
return XNAV__HOLDCOMMAND;
}
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, aref_vect,
width, height, options, &sts);
width, height, options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb;
......@@ -4373,11 +4380,15 @@ static int xnav_open_func( void *client_data,
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,
width, height, options, &sts);
hist = xnav->xttsevhist_new( file_str, 0, 0, 0, 0, 0, file_str,
width, height, options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, pwr_cNOid, "",
NULL);
}
return XNAV__SUCCESS;
}
......@@ -4625,26 +4636,35 @@ static int xnav_open_func( void *client_data,
xnav->set_clock_cursor();
if ( plotgroup_found) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, &sts);
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, oidv[0], "",
NULL);
}
}
else if( sevHistObjectFound ) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, &sts);
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, oidv[0], "",
NULL);
}
}
else {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, 0, width, height, options, &sts);
xnav->scctx, 0, width, height, options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, oidv[0], "",
NULL);
}
}
xnav->reset_cursor();
......@@ -4697,7 +4717,7 @@ static int xnav_open_func( void *client_data,
if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) {
// Open exported fast file
XttFast *fast = xnav->xttfast_new( title_str, 0, width, height, 0, file_str, &sts);
XttFast *fast = xnav->xttfast_new( title_str, 0, width, height, 0, file_str, xnav->gbl.color_theme, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in fast configuration");
else {
......@@ -4762,7 +4782,7 @@ static int xnav_open_func( void *client_data,
fast->pop();
}
else {
fast = xnav->xttfast_new( title_str, &aref, width, height, options, 0, &sts);
fast = xnav->xttfast_new( title_str, &aref, width, height, options, 0, xnav->gbl.color_theme, &sts);
if ( EVEN(sts))
xnav->message('E',"Error in fast configuration");
else {
......@@ -5599,6 +5619,14 @@ static void xnav_sevhist_help_cb( void *ctx, const char *key)
xnav->message( ' ', null_str);
}
static void xnav_sevhist_close_cb( void *ctx, XttSevHist *hist)
{
XNav *xnav = (XNav *) ctx;
xnav->appl.remove( (void *)hist);
delete hist;
}
static int xnav_sevhist_get_select_cb( void *ctx, pwr_tOid *oid, char *aname, char *oname)
{
XNav *xnav = (XNav *) ctx;
......@@ -9549,7 +9577,7 @@ int XNav::set_parameter( char *name_str, char *value_str, int publicwrite)
void XNav::open_rttlog( char *name, char *filename)
{
gecurve_new( name, filename, NULL, 0, 0);
gecurve_new( name, filename, NULL, 0, 0, gbl.color_theme);
}
......@@ -9823,6 +9851,12 @@ static void xnav_colortheme_selector_ok_cb( void *ctx, char *text)
for ( elem = xnav->appl.root; elem; elem = elem->next) {
if ( elem->type == applist_eType_Graph)
((XttGe *)elem->ctx)->update_color_theme( idx);
else if ( elem->type == applist_eType_SevHist)
((XttSevHist *)elem->ctx)->update_color_theme( idx);
else if ( elem->type == applist_eType_Trend)
((XttTrend *)elem->ctx)->update_color_theme( idx);
else if ( elem->type == applist_eType_Fast)
((XttFast *)elem->ctx)->update_color_theme( idx);
}
}
if ( xnav->op)
......
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