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, ...@@ -749,9 +749,10 @@ GeCurveGtk::GeCurveGtk( void *gc_parent_ctx,
int pos_right, int pos_right,
int gc_width, int gc_width,
int gc_height, 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, 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) minmax_widget(0), export_widget(0), disable_timecombo_callback(0), clock_cursor(0)
{ {
......
...@@ -49,7 +49,7 @@ class GeCurveGtk : public GeCurve { ...@@ -49,7 +49,7 @@ class GeCurveGtk : public GeCurve {
public: public:
GeCurveGtk( void *gc_parent_ctx, GtkWidget *parent_widget, char *curve_name, 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); int gc_width, int gc_height, unsigned int gc_options, int gc_color_theme);
GtkWidget *parent_wid; GtkWidget *parent_wid;
GtkWidget *grow_widget; GtkWidget *grow_widget;
GtkWidget *curve_widget; GtkWidget *curve_widget;
......
...@@ -530,6 +530,7 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data) ...@@ -530,6 +530,7 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data)
{ {
grow_sAttributes grow_attr; grow_sAttributes grow_attr;
unsigned long mask; unsigned long mask;
char path[2][80] = {"$pwrp_exe/", "$pwr_exe/"};
GeCurve *curve = (GeCurve *) client_data; GeCurve *curve = (GeCurve *) client_data;
curve->growcurve_ctx = (CurveCtx *) fctx; curve->growcurve_ctx = (CurveCtx *) fctx;
...@@ -545,6 +546,8 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data) ...@@ -545,6 +546,8 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data)
mask |= grow_eAttr_initial_position; mask |= grow_eAttr_initial_position;
grow_attr.initial_position = glow_eDirection_Right; grow_attr.initial_position = glow_eDirection_Right;
} }
mask |= grow_eAttr_color_theme;
strcpy( grow_attr.color_theme, "$default");
grow_SetAttributes( curve->growcurve_ctx, &grow_attr, mask); grow_SetAttributes( curve->growcurve_ctx, &grow_attr, mask);
grow_SetCtxUserData( curve->growcurve_ctx, curve); grow_SetCtxUserData( curve->growcurve_ctx, curve);
...@@ -576,13 +579,23 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data) ...@@ -576,13 +579,23 @@ int GeCurve::init_growcurve_cb( GlowCtx *fctx, void *client_data)
grow_EnableEvent( (GrowCtx *)curve->growcurve_ctx, glow_eEvent_ScrollDown, grow_EnableEvent( (GrowCtx *)curve->growcurve_ctx, glow_eEvent_ScrollDown,
glow_eEventType_CallBack, growcurve_cb); glow_eEventType_CallBack, growcurve_cb);
grow_SetPath( curve->growcurve_ctx, 2, (char *)path);
grow_ReadCustomColorFile( curve->growcurve_ctx, 0);
grow_SetBackgroundColor( curve->growcurve_ctx, glow_eCtColor_Background);
grow_CreateGrowCurve( curve->growcurve_ctx, "curve", NULL, 0, 0, 200, 30, grow_CreateGrowCurve( curve->growcurve_ctx, "curve", NULL, 0, 0, 200, 30,
curve->curve_border, 2, glow_mDisplayLevel_1, 1, 1, curve->curve_border, 2, glow_mDisplayLevel_1, 1, 1,
curve->curve_color, curve, &curve->curve_object); curve->curve_color, curve, &curve->curve_object);
grow_SetObjectOriginalFillColor( curve->curve_object, glow_eCtColor_DiagramFillcolor);
grow_SetObjectOriginalBorderColor( curve->curve_object, glow_eCtColor_DiagramBordercolor);
grow_CreateGrowAxis( curve->growcurve_ctx, "y_axis", 0, 30, 200, 31.85, grow_CreateGrowAxis( curve->growcurve_ctx, "y_axis", 0, 30, 200, 31.85,
glow_eDrawType_Line, 1, 5, glow_eDrawType_Line, 1, 5,
glow_eDrawType_TextHelvetica, curve, glow_eDrawType_TextHelvetica, curve,
&curve->curve_axisobject); &curve->curve_axisobject);
grow_SetObjectOriginalBorderColor( curve->curve_axisobject, glow_eCtColor_AxisBordercolor);
grow_SetObjectOriginalTextColor( curve->curve_axisobject, glow_eCtColor_BackgroundTextAndLines);
grow_tNodeClass nc; grow_tNodeClass nc;
grow_CreateNodeClass( curve->growcurve_ctx, "MarkNc", glow_eNodeGroup_Common, &nc); grow_CreateNodeClass( curve->growcurve_ctx, "MarkNc", glow_eNodeGroup_Common, &nc);
...@@ -698,9 +711,9 @@ int GeCurve::grownames_cb( GlowCtx *ctx, glow_tEvent event) ...@@ -698,9 +711,9 @@ int GeCurve::grownames_cb( GlowCtx *ctx, glow_tEvent event)
} }
curve->hide[i] = !curve->hide[i]; curve->hide[i] = !curve->hide[i];
if ( curve->hide[i]) if ( curve->hide[i])
color = glow_eDrawType_LineErase; color = glow_eCtColor_Background;
else else
color = glow_eDrawType_Line; color = glow_eCtColor_BackgroundTextAndLines;
grow_SetObjectBorderColor( curve->hide_l1[i], color); grow_SetObjectBorderColor( curve->hide_l1[i], color);
grow_SetObjectBorderColor( curve->hide_l2[i], color); grow_SetObjectBorderColor( curve->hide_l2[i], color);
...@@ -792,6 +805,8 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data) ...@@ -792,6 +805,8 @@ int GeCurve::init_grownames_cb( GlowCtx *fctx, void *client_data)
grow_attr.grid_on = 0; grow_attr.grid_on = 0;
mask |= grow_eAttr_hot_mode; mask |= grow_eAttr_hot_mode;
grow_attr.hot_mode = glow_eHotMode_TraceAction; grow_attr.hot_mode = glow_eHotMode_TraceAction;
mask |= grow_eAttr_color_theme;
strcpy( grow_attr.color_theme, "$default");
grow_SetAttributes( curve->grownames_ctx, &grow_attr, mask); grow_SetAttributes( curve->grownames_ctx, &grow_attr, mask);
grow_SetCtxUserData( curve->grownames_ctx, curve); grow_SetCtxUserData( curve->grownames_ctx, curve);
...@@ -814,139 +829,155 @@ int GeCurve::config_names() ...@@ -814,139 +829,155 @@ int GeCurve::config_names()
grow_tObject t1; grow_tObject t1;
glow_eDrawType color; glow_eDrawType color;
double x; double x, y;
grow_sAttributes grow_attr;
unsigned long mask;
char path[2][80] = {"$pwrp_exe/", "$pwr_exe/"};
int date = (strcmp( cd->x_format[0], "%10t") == 0 || int date = (strcmp( cd->x_format[0], "%10t") == 0 ||
strcmp( cd->x_format[0], "%11t") == 0) ? 1 : 0; strcmp( cd->x_format[0], "%11t") == 0) ? 1 : 0;
int time_size; int time_size;
if ( date) if ( date)
time_size = 7; time_size = 9;
else else
time_size = 3; time_size = 3;
// Create nodeclass for mark values // Create nodeclass for mark values
grow_New( grownames_ctx); grow_New( grownames_ctx);
mask = grow_eAttr_color_theme;
strcpy( grow_attr.color_theme, "$default");
grow_SetAttributes( grownames_ctx, &grow_attr, mask);
grow_SetPath( grownames_ctx, 2, (char *)path);
grow_ReadCustomColorFile( grownames_ctx, 0);
grow_SetBackgroundColor( grownames_ctx, glow_eCtColor_Background);
grow_tNodeClass nc; grow_tNodeClass nc;
grow_CreateNodeClass( grownames_ctx, "MarkVal", glow_eNodeGroup_Common, &nc); grow_CreateNodeClass( grownames_ctx, "MarkVal", glow_eNodeGroup_Common, &nc);
grow_AddRect( nc, "", 0, 0, time_size, 0.75, glow_eDrawType_LineGray, 1, 0, grow_AddRect( nc, "", 0, 0, time_size, 0.75, glow_eCtColor_Background, 1, 0,
glow_mDisplayLevel_1, 0, 0, 0, glow_mDisplayLevel_1, 0, 0, 0,
glow_eDrawType_Line, NULL); glow_eDrawType_Line, NULL);
grow_AddAnnot( nc, 0.2, 0.7, 0, glow_eDrawType_TextHelvetica, grow_AddAnnot( nc, 0.2, 0.7, 0, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, glow_eCtColor_BackgroundTextAndLines,
2, glow_eAnnotType_OneLine, 0, glow_mDisplayLevel_1, NULL); 3, glow_eAnnotType_OneLine, 0, glow_mDisplayLevel_1, NULL);
// Draw header // Draw header
grow_tObject o1; grow_tObject o1;
grow_CreateGrowLine( grownames_ctx, "", 0, 0.75, 60, 0.75, // grow_CreateGrowLine( grownames_ctx, "", 0, 0.75, 60, 0.75,
glow_eDrawType_Color34, 2, 0, NULL, &o1); // glow_eDrawType_Color34, 2, 0, NULL, &o1);
grow_CreateGrowRect( grownames_ctx, "", 0, 0, 60, 0.8, y = 0;
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 0, 0, 1, grow_CreateGrowRect( grownames_ctx, "", 0, y, 60, y + 0.9,
glow_eDrawType_Color32, NULL, &o1); glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 0, 0,
glow_eCtColor_AreaDelimiter, NULL, &o1);
x = 0.8; x = 0.8;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("View"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("View"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
x += 1.8; x += 1.8;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Cursor"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Cursor"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
x += time_size + 0.2; x += time_size + 0.2;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Mark 1"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Mark 1"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
// TODO // TODO
x += time_size + 0.2; x += time_size + 0.2;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Mark 2"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Mark 2"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
x += time_size + 0.2; x += time_size + 0.2;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Unit"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Unit"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
x += 2; x += 2;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Scale"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Scale"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
if ( options & curve_mOptions_ShowDescrFirst) { if ( options & curve_mOptions_ShowDescrFirst) {
x += 3; x += 3;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Description"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Description"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
x += 14; x += 14;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Attribute"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Attribute"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
} }
else { else {
x += 3; x += 3;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Attribute"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Attribute"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
x += 14; x += 14;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Description"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Description"),
x, 0.6, glow_eDrawType_TextHelvetica, x, y + 0.6, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_AreaDelimiterTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &o1); glow_mDisplayLevel_1, NULL, &o1);
} }
y += 1;
for ( int i = 0; i < cd->cols; i++) { for ( int i = 0; i < cd->cols; i++) {
// Draw shadowed frame // Draw shadowed frame
grow_CreateGrowRect( grownames_ctx, "", 0, (i+0.8), 60, 1, grow_CreateGrowLine( grownames_ctx, "", 0, y + 1, 60, y + 1,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 0, 0, 1, glow_eCtColor_LineDelimiter, 1, 0, NULL, &o1);
glow_eDrawType_Color32, NULL, &o1);
// Draw color rectangle // Draw color rectangle
grow_CreateGrowRect( grownames_ctx, "", 0.25, (i+0.8)+0.3, 0.75, 0.5, grow_CreateGrowRect( grownames_ctx, "", 0.25, y + 0.3, 0.75, 0.5,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 1, 1, glow_eCtColor_IndicatorBorderColor, 1, 0, glow_mDisplayLevel_1, 1, 1, 0,
cd->color[i], NULL, &name_rect[i]); cd->color[i], NULL, &name_rect[i]);
if ( hide[i]) if ( hide[i])
color = glow_eDrawType_LineErase; color = glow_eCtColor_Background;
else else
color = glow_eDrawType_Line; color = glow_eCtColor_BackgroundTextAndLines;
// Draw checkbox for hide // Draw checkbox for hide
grow_CreateGrowLine( grownames_ctx, "", 1.4, (i+0.8)+0.45, 1.52, (i+0.8)+0.75, grow_CreateGrowLine( grownames_ctx, "", 1.4, y + 0.45, 1.52, y + 0.75,
color, 2, 0, NULL, &hide_l1[i]); color, 2, 0, NULL, &hide_l1[i]);
grow_CreateGrowLine( grownames_ctx, "", 1.50, (i+0.8)+0.75, 1.77, (i+0.8)+0.35, grow_CreateGrowLine( grownames_ctx, "", 1.50, y + 0.75, 1.77, y + 0.35,
color, 2, 0, NULL, &hide_l2[i]); color, 2, 0, NULL, &hide_l2[i]);
grow_CreateGrowRect( grownames_ctx, "", 1.3, (i+0.8)+0.3, 0.5, 0.5, grow_CreateGrowRect( grownames_ctx, "", 1.3, y + 0.3, 0.5, 0.5,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 0, 1, 1, color, 1, 0, glow_mDisplayLevel_1, 0, 1, 0,
glow_eDrawType_Color32, NULL, &hide_rect[i]); glow_eCtColor_Background, NULL, &hide_rect[i]);
// Draw nodes for mark and cursor values // Draw nodes for mark and cursor values
x = 2.2; x = 2.2;
grow_CreateGrowNode( grownames_ctx, "", nc, x, (i+0.8)+0.05, NULL, grow_CreateGrowNode( grownames_ctx, "", nc, x, y + 0.05, NULL,
&cursor_annot[i]); &cursor_annot[i]);
x += time_size + 0.2; x += time_size + 0.2;
grow_CreateGrowNode( grownames_ctx, "", nc, x, (i+0.8)+0.05, NULL, grow_CreateGrowNode( grownames_ctx, "", nc, x, y + 0.05, NULL,
&mark1_annot[i]); &mark1_annot[i]);
// TODO // TODO
x += time_size + 0.2; x += time_size + 0.2;
grow_CreateGrowNode( grownames_ctx, "", nc, x, (i+0.8)+0.05, NULL, grow_CreateGrowNode( grownames_ctx, "", nc, x, y + 0.05, NULL,
&mark2_annot[i]); &mark2_annot[i]);
// Draw unit // Draw unit
x += time_size + 0.6; x += time_size + 0.6;
if ( strcmp( cd->y_unit[i], "") == 0)
strcpy( cd->y_unit[i], " ");
grow_CreateGrowText( grownames_ctx, "", cd->y_unit[i], grow_CreateGrowText( grownames_ctx, "", cd->y_unit[i],
x, (i+0.8) + 0.75, glow_eDrawType_TextHelvetica, x, y + 0.75, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_BackgroundTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &t1); glow_mDisplayLevel_1, NULL, &t1);
// Draw button for scale // Draw button for scale
x += 2; x += 2;
grow_CreateGrowRect( grownames_ctx, "", x, (i+0.8)+0.1, 1.2, 0.7, grow_CreateGrowRect( grownames_ctx, "", x, y + 0.1, 1.2, 0.7,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 1, 1, glow_eCtColor_ButtonBordercolor, 1, 0, glow_mDisplayLevel_1, 1, 1, 1,
glow_eDrawType_Color33, NULL, &scale_rect[i]); glow_eCtColor_ButtonFillcolor, NULL, &scale_rect[i]);
grow_SetObjectShadowWidth( scale_rect[i], 20); grow_SetObjectShadowWidth( scale_rect[i], 20);
// Draw attribute name // Draw attribute name
if ( options & curve_mOptions_ShowDescrFirst) { if ( options & curve_mOptions_ShowDescrFirst) {
...@@ -955,12 +986,12 @@ int GeCurve::config_names() ...@@ -955,12 +986,12 @@ int GeCurve::config_names()
x += 3; x += 3;
if ( strcmp( cd->y_description[i], "") != 0) { if ( strcmp( cd->y_description[i], "") != 0) {
grow_CreateGrowText( grownames_ctx, "", cd->y_description[i], grow_CreateGrowText( grownames_ctx, "", cd->y_description[i],
x, (i+0.8) + 0.75, glow_eDrawType_TextHelvetica, x, y + 0.75, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_BackgroundTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &t1); glow_mDisplayLevel_1, NULL, &t1);
grow_GetTextExtent( grownames_ctx, cd->y_name[i], strlen(cd->y_name[i]), grow_GetTextExtent( grownames_ctx, cd->y_name[i], strlen(cd->y_name[i]),
glow_eDrawType_TextHelvetica, 2, glow_eFont_LucidaSans, &w, &h, &descent); glow_eDrawType_TextHelvetica, 3, glow_eFont_LucidaSans, &w, &h, &descent);
if ( w < 13) if ( w < 13)
x += 14; x += 14;
else else
...@@ -970,30 +1001,30 @@ int GeCurve::config_names() ...@@ -970,30 +1001,30 @@ int GeCurve::config_names()
x += 14; x += 14;
grow_CreateGrowText( grownames_ctx, "", cd->y_name[i], grow_CreateGrowText( grownames_ctx, "", cd->y_name[i],
x, (i+0.8) + 0.75, glow_eDrawType_TextHelvetica, x, y + 0.75, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_BackgroundTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &t1); glow_mDisplayLevel_1, NULL, &t1);
} }
else { else {
x += 3; x += 3;
grow_CreateGrowText( grownames_ctx, "", cd->y_name[i], grow_CreateGrowText( grownames_ctx, "", cd->y_name[i],
x, (i+0.8) + 0.75, glow_eDrawType_TextHelvetica, x, y + 0.75, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_BackgroundTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &t1); glow_mDisplayLevel_1, NULL, &t1);
if ( strcmp( cd->y_description[i], "") != 0) { if ( strcmp( cd->y_description[i], "") != 0) {
double w, h, descent; double w, h, descent;
grow_GetTextExtent( grownames_ctx, cd->y_name[i], strlen(cd->y_name[i]), grow_GetTextExtent( grownames_ctx, cd->y_name[i], strlen(cd->y_name[i]),
glow_eDrawType_TextHelvetica, 2, glow_eFont_LucidaSans, &w, &h, &descent); glow_eDrawType_TextHelvetica, 3, glow_eFont_LucidaSans, &w, &h, &descent);
if ( w < 13) if ( w < 13)
x += 14; x += 14;
else else
x += w + 1; x += w + 1;
grow_CreateGrowText( grownames_ctx, "", cd->y_description[i], grow_CreateGrowText( grownames_ctx, "", cd->y_description[i],
x, (i+0.8) + 0.75, glow_eDrawType_TextHelvetica, x, y + 0.75, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_BackgroundTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &t1); glow_mDisplayLevel_1, NULL, &t1);
} }
} }
...@@ -1001,39 +1032,39 @@ int GeCurve::config_names() ...@@ -1001,39 +1032,39 @@ int GeCurve::config_names()
grow_SetAnnotation( cursor_annot[i], 0, "0", 1); grow_SetAnnotation( cursor_annot[i], 0, "0", 1);
grow_SetAnnotation( mark1_annot[i], 0, "0", 1); grow_SetAnnotation( mark1_annot[i], 0, "0", 1);
grow_SetAnnotation( mark2_annot[i], 0, "0", 1); grow_SetAnnotation( mark2_annot[i], 0, "0", 1);
y += 1;
} }
// Draw nodes for time values // Draw nodes for time values
// Draw shadowed frame // Draw shadowed frame
grow_CreateGrowRect( grownames_ctx, "", 0, (cd->cols+0.8), 60, 1, grow_CreateGrowLine( grownames_ctx, "", 0, y + 1, 60, y + 1,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 0, 0, 1, glow_eCtColor_LineDelimiter, 1, 0, NULL, &o1);
glow_eDrawType_Color32, NULL, &o1);
x = 2.2; x = 2.2;
grow_CreateGrowNode( grownames_ctx, "", nc, x, (cd->cols+0.8)+0.05, NULL, grow_CreateGrowNode( grownames_ctx, "", nc, x, y + 0.05, NULL,
&cursor_annot[cd->cols]); &cursor_annot[cd->cols]);
x += time_size + 0.2; x += time_size + 0.2;
grow_CreateGrowNode( grownames_ctx, "", nc, x, (cd->cols+0.8)+0.05, NULL, grow_CreateGrowNode( grownames_ctx, "", nc, x, y +0.05, NULL,
&mark1_annot[cd->cols]); &mark1_annot[cd->cols]);
// TODO // TODO
x += time_size + 0.2; x += time_size + 0.2;
grow_CreateGrowNode( grownames_ctx, "", nc, x, (cd->cols+0.8)+0.05, NULL, grow_CreateGrowNode( grownames_ctx, "", nc, x, y + 0.05, NULL,
&mark2_annot[cd->cols]); &mark2_annot[cd->cols]);
// Draw unit // Draw unit
x += time_size + 0.6; x += time_size + 0.6;
grow_CreateGrowText( grownames_ctx, "", "s", grow_CreateGrowText( grownames_ctx, "", "s",
x, (cd->cols+0.8) + 0.75, glow_eDrawType_TextHelvetica, x, y + 0.75, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_BackgroundTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &t1); glow_mDisplayLevel_1, NULL, &t1);
// Draw button for scale // Draw button for scale
x += 2; x += 2;
grow_CreateGrowRect( grownames_ctx, "", x, (cd->cols+0.8)+0.1, 1.2, 0.7, grow_CreateGrowRect( grownames_ctx, "", x, y + 0.1, 1.2, 0.7,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 1, 1, glow_eCtColor_ButtonBordercolor, 1, 0, glow_mDisplayLevel_1, 1, 1, 1,
glow_eDrawType_Color33, NULL, &scale_rect[cd->cols]); glow_eCtColor_ButtonFillcolor, NULL, &scale_rect[cd->cols]);
grow_SetObjectShadowWidth( scale_rect[cd->cols], 20); grow_SetObjectShadowWidth( scale_rect[cd->cols], 20);
// Draw attribute name // Draw attribute name
x += 3; x += 3;
grow_CreateGrowText( grownames_ctx, "", Lng::translate("Time axis"), grow_CreateGrowText( grownames_ctx, "", Lng::translate("Time axis"),
x, (cd->cols+0.8) + 0.75, glow_eDrawType_TextHelvetica, x, y + 0.75, glow_eDrawType_TextHelvetica,
glow_eDrawType_Line, 2, glow_eFont_LucidaSans, glow_eCtColor_BackgroundTextAndLines, 3, glow_eFont_LucidaSans,
glow_mDisplayLevel_1, NULL, &t1); glow_mDisplayLevel_1, NULL, &t1);
grow_SetAnnotation( cursor_annot[cd->cols], 0, "0", 1); grow_SetAnnotation( cursor_annot[cd->cols], 0, "0", 1);
grow_SetAnnotation( mark1_annot[cd->cols], 0, "0", 1); grow_SetAnnotation( mark1_annot[cd->cols], 0, "0", 1);
...@@ -1082,12 +1113,25 @@ int GeCurve::configure_axes() ...@@ -1082,12 +1113,25 @@ int GeCurve::configure_axes()
{ {
double x = 0; double x = 0;
int i, idx; int i, idx;
grow_sAttributes grow_attr;
unsigned long mask;
char path[2][80] = {"$pwrp_exe/", "$pwr_exe/"};
if ( !cd) if ( !cd)
return 0; return 0;
grow_SetNodraw( growaxis_ctx); grow_SetNodraw( growaxis_ctx);
grow_New( growaxis_ctx); grow_New( growaxis_ctx);
mask = grow_eAttr_color_theme;
strcpy( grow_attr.color_theme, "$default");
grow_SetAttributes( growaxis_ctx, &grow_attr, mask);
grow_SetPath( growaxis_ctx, 2, (char *)path);
grow_ReadCustomColorFile( growaxis_ctx, 0);
grow_SetBackgroundColor( growaxis_ctx, glow_eCtColor_Background);
memset( axis_object, 0, sizeof( axis_object)); memset( axis_object, 0, sizeof( axis_object));
for ( i = 0; i < cd->cols; i++) { for ( i = 0; i < cd->cols; i++) {
...@@ -1526,17 +1570,19 @@ GeCurve::GeCurve( void *gc_parent_ctx, ...@@ -1526,17 +1570,19 @@ GeCurve::GeCurve( void *gc_parent_ctx,
int pos_right, int pos_right,
int gc_width, int gc_width,
int gc_height, int gc_height,
unsigned int gc_options) : unsigned int gc_options,
parent_ctx(gc_parent_ctx), growcurve_ctx(0), background_dark(glow_eDrawType_Color29), int gc_color_theme) :
parent_ctx(gc_parent_ctx), growcurve_ctx(0), background_dark(glow_eCtColor_DiagramFillcolor),
background_bright(glow_eDrawType_Color21), background_bright(glow_eDrawType_Color21),
border_dark(glow_eDrawType_Color28), border_dark(glow_eCtColor_DiagramBordercolor),
border_bright(glow_eDrawType_Color22), border_bright(glow_eDrawType_Color22),
cd(0), axis_window_width(0), auto_refresh(1), axis_displayed(1), cd(0), axis_window_width(0), auto_refresh(1), axis_displayed(1),
minmax_idx(0), close_cb(0), help_cb(0), increase_period_cb(0), decrease_period_cb(0), reload_cb(0), minmax_idx(0), close_cb(0), help_cb(0), increase_period_cb(0), decrease_period_cb(0), reload_cb(0),
prev_period_cb(0), next_period_cb(0), add_cb(0), madd_cb(0), remove_cb(0), export_cb(0), new_cb(0), prev_period_cb(0), next_period_cb(0), add_cb(0), madd_cb(0), remove_cb(0), export_cb(0), new_cb(0),
save_cb(0), open_cb(0), snapshot_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), 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), options(gc_options), layout_mask(0) deferred_configure_axes(0), center_from_window(0), options(gc_options), layout_mask(0),
color_theme(gc_color_theme)
{ {
pwr_tStatus sts; pwr_tStatus sts;
...@@ -1566,6 +1612,10 @@ GeCurve::GeCurve( void *gc_parent_ctx, ...@@ -1566,6 +1612,10 @@ GeCurve::GeCurve( void *gc_parent_ctx,
cd = curve_data; cd = curve_data;
cd->select_color( curve_color == background_dark); cd->select_color( curve_color == background_dark);
} }
char color_theme_file[80];
sprintf( color_theme_file, "pwr_colortheme%d", color_theme);
grow_SetDefaultColorTheme( color_theme_file);
} }
GeCurveData::GeCurveData( curve_eDataType datatype) : GeCurveData::GeCurveData( curve_eDataType datatype) :
...@@ -2247,3 +2297,25 @@ void GeCurve::x_to_points( double x, double *t, double *values) ...@@ -2247,3 +2297,25 @@ void GeCurve::x_to_points( double x, double *t, double *values)
} }
} }
} }
void GeCurve::update_color_theme( int ct)
{
char color_theme_file[80];
int sts;
sprintf( color_theme_file, "pwr_colortheme%d", ct);
sts = grow_ReadCustomColorFile( grownames_ctx, color_theme_file);
if ( EVEN(sts)) return;
sts = grow_ReadCustomColorFile( growcurve_ctx, color_theme_file);
if ( EVEN(sts)) return;
sts = grow_ReadCustomColorFile( growaxis_ctx, color_theme_file);
if ( EVEN(sts)) return;
grow_SetDefaultColorTheme( color_theme_file);
color_theme = ct;
}
...@@ -208,10 +208,11 @@ class GeCurve { ...@@ -208,10 +208,11 @@ class GeCurve {
int center_from_window; int center_from_window;
unsigned int options; unsigned int options;
unsigned int layout_mask; unsigned int layout_mask;
int color_theme;
GeCurve( void *gc_parent_ctx, char *curve_name, 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); int gc_width, int gc_height, unsigned int options, int color_theme);
virtual ~GeCurve(); virtual ~GeCurve();
virtual void write_title( char *str) {} virtual void write_title( char *str) {}
virtual void pop() {} virtual void pop() {}
...@@ -261,6 +262,7 @@ class GeCurve { ...@@ -261,6 +262,7 @@ class GeCurve {
void x_to_points( double x, double *time, double *values); void x_to_points( double x, double *time, double *values);
void set_center_from_window( int val) { center_from_window = val;} void set_center_from_window( int val) { center_from_window = val;}
void set_title( const char *str); void set_title( const char *str);
void update_color_theme( int ct);
static int growcurve_cb( GlowCtx *ctx, glow_tEvent event); static int growcurve_cb( GlowCtx *ctx, glow_tEvent event);
static int init_growcurve_cb( GlowCtx *fctx, void *client_data); static int init_growcurve_cb( GlowCtx *fctx, void *client_data);
......
...@@ -637,7 +637,7 @@ GlowDrawGtk::GlowDrawGtk( ...@@ -637,7 +637,7 @@ GlowDrawGtk::GlowDrawGtk(
original_background = background; original_background = background;
if ( type == glow_eCtxType_Grow) { if ( type == glow_eCtxType_Grow || type == glow_eCtxType_Curve) {
ctx->customcolors = create_customcolors(); ctx->customcolors = create_customcolors();
push_customcolors( ctx->customcolors); push_customcolors( ctx->customcolors);
} }
......
...@@ -1637,6 +1637,7 @@ int GrowCtx::event_handler( glow_eEvent event, int x, int y, int w, int h) ...@@ -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.any.y = double (y + mw.offset_y) / mw.zoom_factor_y;
e.object.object = restriction_object; e.object.object = restriction_object;
e.object.object_type = restriction_object->type(); e.object.object_type = restriction_object->type();
if ( event_callback[glow_eEvent_SliderMoveEnd])
event_callback[glow_eEvent_SliderMoveEnd]( this, &e); event_callback[glow_eEvent_SliderMoveEnd]( this, &e);
} }
node_move_last_x = x; node_move_last_x = x;
......
...@@ -70,8 +70,9 @@ XttFastGtk::XttFastGtk( void *parent_ctx, ...@@ -70,8 +70,9 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
int width, int width,
int height, int height,
unsigned int options, unsigned int options,
int xn_color_theme,
int *sts) : 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]; char title[250];
...@@ -86,7 +87,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx, ...@@ -86,7 +87,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
gdh_AttrrefToName( fast_arp, title, sizeof(title), cdh_mNName); gdh_AttrrefToName( fast_arp, title, sizeof(title), cdh_mNName);
curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 0, width, height, curve = new GeCurveGtk( this, parent_widget, title, NULL, gcd, 0, width, height,
options); options, color_theme);
curve->close_cb = fast_close_cb; curve->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb; curve->help_cb = fast_help_cb;
curve->export_cb = fast_export_cb; curve->export_cb = fast_export_cb;
...@@ -103,8 +104,9 @@ XttFastGtk::XttFastGtk( void *parent_ctx, ...@@ -103,8 +104,9 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
const char *name, const char *name,
GtkWidget **w, GtkWidget **w,
char *filename, char *filename,
int xn_color_theme,
int *sts) : int *sts) :
XttFast( parent_ctx, name, filename, sts), XttFast( parent_ctx, name, filename, xn_color_theme, sts),
parent_widget(parent_wid) parent_widget(parent_wid)
{ {
char title[250]; char title[250];
...@@ -116,7 +118,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx, ...@@ -116,7 +118,7 @@ XttFastGtk::XttFastGtk( void *parent_ctx,
*sts = XNAV__SUCCESS; *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->close_cb = fast_close_cb;
curve->help_cb = fast_help_cb; curve->help_cb = fast_help_cb;
curve->enable(0); curve->enable(0);
......
...@@ -55,12 +55,14 @@ class XttFastGtk : public XttFast { ...@@ -55,12 +55,14 @@ class XttFastGtk : public XttFast {
int width, int width,
int height, int height,
unsigned int xn_options, unsigned int xn_options,
int xn_color_theme,
int *sts); int *sts);
XttFastGtk( void *parent_ctx, XttFastGtk( void *parent_ctx,
GtkWidget *parent_wid, GtkWidget *parent_wid,
const char *name, const char *name,
GtkWidget **w, GtkWidget **w,
char *filename, char *filename,
int xn_color_theme,
int *sts); int *sts);
~XttFastGtk(); ~XttFastGtk();
}; };
......
...@@ -495,13 +495,15 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx, ...@@ -495,13 +495,15 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
if ( plotgroup_found) { if ( plotgroup_found) {
trend[i*rows + j] = new XttTrendGtk( this, toplevel, (char *)"No title", &widget, 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 { else {
arefv[0] = mv.Action[i*rows+j].Object[0]; arefv[0] = mv.Action[i*rows+j].Object[0];
memset( &arefv[1], 0, sizeof(arefv[0])); memset( &arefv[1], 0, sizeof(arefv[0]));
trend[i*rows + j] = new XttTrendGtk( this, toplevel, (char *)"No title", &widget, 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; if ( EVEN(*sts)) break;
...@@ -698,7 +700,7 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx, ...@@ -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, sevhist[i*rows + j] = new XttSevHistGtk( this, toplevel, (char *)"No title", &widget,
oidv, anamev, onamev, sevhistobjectv, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, w, h, xnav->scctx, w, h,
(unsigned int)curve_mOptions_Embedded, sts); (unsigned int)curve_mOptions_Embedded, color_theme, sts);
if ( EVEN(*sts)) break; if ( EVEN(*sts)) break;
sevhist[i*rows + j]->help_cb = multiview_trend_help_cb; 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 ...@@ -1058,13 +1060,15 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
XttTrendGtk *ctx; XttTrendGtk *ctx;
if ( plotgroup_found) { if ( plotgroup_found) {
ctx = new XttTrendGtk( this, toplevel, (char *)"No title", &comp_w, 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 { else {
arefv[0] = object_aref; arefv[0] = object_aref;
memset( &arefv[1], 0, sizeof(arefv[0])); memset( &arefv[1], 0, sizeof(arefv[0]));
ctx = new XttTrendGtk( this, toplevel, (char *)"No title", &comp_w, 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; if ( EVEN(lsts)) break;
...@@ -1258,7 +1262,7 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char ...@@ -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, ctx = new XttSevHistGtk( this, toplevel, (char *)"No title", &comp_w,
oidv, anamev, onamev, sevhistobjectv, oidv, anamev, onamev, sevhistobjectv,
xnav->scctx, w, h, xnav->scctx, w, h,
(unsigned int)curve_mOptions_Embedded, &lsts); (unsigned int)curve_mOptions_Embedded, color_theme, &lsts);
if ( EVEN(lsts)) break; if ( EVEN(lsts)) break;
ctx->help_cb = multiview_trend_help_cb; ctx->help_cb = multiview_trend_help_cb;
......
...@@ -73,8 +73,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx, ...@@ -73,8 +73,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
int xn_width, int xn_width,
int xn_height, int xn_height,
unsigned int xn_options, unsigned int xn_options,
int xn_color_theme,
int *sts) : 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) parent_widget(parent_wid)
{ {
char title[250]; char title[250];
...@@ -87,7 +88,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx, ...@@ -87,7 +88,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS; *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); xn_width, xn_height, xn_options, color_theme);
curve->close_cb = sevhist_close_cb; curve->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb; curve->help_cb = sevhist_help_cb;
curve->increase_period_cb = sevhist_increase_period_cb; curve->increase_period_cb = sevhist_increase_period_cb;
...@@ -116,8 +117,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx, ...@@ -116,8 +117,9 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
const char *name, const char *name,
GtkWidget **w, GtkWidget **w,
char *filename, char *filename,
int xn_color_theme,
int *sts) : int *sts) :
XttSevHist( parent_ctx, name, filename, sts), XttSevHist( parent_ctx, name, filename, xn_color_theme, sts),
parent_widget(parent_wid) parent_widget(parent_wid)
{ {
char title[250]; char title[250];
...@@ -129,7 +131,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx, ...@@ -129,7 +131,7 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
*sts = XNAV__SUCCESS; *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->close_cb = sevhist_close_cb;
curve->help_cb = sevhist_help_cb; curve->help_cb = sevhist_help_cb;
curve->enable(0); curve->enable(0);
......
...@@ -59,12 +59,14 @@ class XttSevHistGtk : public XttSevHist { ...@@ -59,12 +59,14 @@ class XttSevHistGtk : public XttSevHist {
int width, int width,
int height, int height,
unsigned int options, unsigned int options,
int xn_color_theme,
int *sts); int *sts);
XttSevHistGtk( void *parent_ctx, XttSevHistGtk( void *parent_ctx,
GtkWidget *parent_wid, GtkWidget *parent_wid,
const char *name, const char *name,
GtkWidget **w, GtkWidget **w,
char *filename, char *filename,
int xn_color_theme,
int *sts); int *sts);
~XttSevHistGtk(); ~XttSevHistGtk();
}; };
......
...@@ -69,8 +69,9 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx, ...@@ -69,8 +69,9 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
int xn_width, int xn_width,
int xn_height, int xn_height,
unsigned int xn_options, unsigned int xn_options,
int xn_color_theme,
int *sts) : int *sts) :
XttTCurve( parent_ctx, name, xn_arefv, sts), XttTCurve( parent_ctx, name, xn_arefv, xn_color_theme, sts),
parent_widget(parent_wid) parent_widget(parent_wid)
{ {
char title[250]; char title[250];
...@@ -83,7 +84,7 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx, ...@@ -83,7 +84,7 @@ XttTCurveGtk::XttTCurveGtk( void *parent_ctx,
*sts = XNAV__SUCCESS; *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); xn_width, xn_height, xn_options, color_theme);
curve->close_cb = tcurve_close_cb; curve->close_cb = tcurve_close_cb;
curve->help_cb = tcurve_help_cb; curve->help_cb = tcurve_help_cb;
curve->increase_period_cb = tcurve_increase_period_cb; curve->increase_period_cb = tcurve_increase_period_cb;
......
...@@ -55,6 +55,7 @@ class XttTCurveGtk : public XttTCurve { ...@@ -55,6 +55,7 @@ class XttTCurveGtk : public XttTCurve {
int xn_width, int xn_width,
int xn_height, int xn_height,
unsigned int xn_options, unsigned int xn_options,
int xn_color_theme,
int *sts); int *sts);
~XttTCurveGtk(); ~XttTCurveGtk();
}; };
......
...@@ -69,8 +69,9 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx, ...@@ -69,8 +69,9 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
int width, int width,
int height, int height,
unsigned int x_options, unsigned int x_options,
int x_color_theme,
int *sts) : 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) parent_widget(parent_wid)
{ {
if ( EVEN(*sts)) if ( EVEN(*sts))
...@@ -78,7 +79,7 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx, ...@@ -78,7 +79,7 @@ XttTrendGtk::XttTrendGtk( void *parent_ctx,
*sts = XNAV__SUCCESS; *sts = XNAV__SUCCESS;
curve = new GeCurveGtk( this, parent_widget, name, NULL, gcd, 1, width, height, curve = new GeCurveGtk( this, parent_widget, name, NULL, gcd, 1, width, height,
options); options, color_theme);
curve->close_cb = trend_close_cb; curve->close_cb = trend_close_cb;
curve->help_cb = trend_help_cb; curve->help_cb = trend_help_cb;
curve->snapshot_cb = trend_snapshot_cb; curve->snapshot_cb = trend_snapshot_cb;
......
...@@ -56,6 +56,7 @@ class XttTrendGtk : public XttTrend { ...@@ -56,6 +56,7 @@ class XttTrendGtk : public XttTrend {
int width, int width,
int height, int height,
unsigned int options, unsigned int options,
int x_color_theme,
int *sts); int *sts);
~XttTrendGtk(); ~XttTrendGtk();
}; };
......
...@@ -275,41 +275,41 @@ Op *XNavGtk::op_new( char *opplace, pwr_tStatus *sts) ...@@ -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, 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; 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, XttSevHist *XNavGtk::xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev, pwr_tOName *onamev,
bool *sevhistobjectv, sevcli_tCtx scctx, char *filename, 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; GtkWidget *w;
if ( !filename) 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 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; 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, 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; GtkWidget *w;
if ( !filename) 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 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, 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, ...@@ -359,9 +359,9 @@ XttStream *XNavGtk::stream_new( const char *name, const char *uri,
} }
GeCurve *XNavGtk::gecurve_new( char *name, char *filename, GeCurveData *data, 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, XttFileview *XNavGtk::fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
......
...@@ -77,13 +77,15 @@ class XNavGtk : public XNav { ...@@ -77,13 +77,15 @@ class XNavGtk : public XNav {
pwr_tStatus *sts); pwr_tStatus *sts);
Op *op_new( char *opplace, pwr_tStatus *sts); Op *op_new( char *opplace, pwr_tStatus *sts);
XttTrend *xtttrend_new( char *name, pwr_tAttrRef *objar, pwr_tAttrRef *plotgroup, 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, XttSevHist *xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *anamev,
pwr_tOName *onamev, bool *sevhistobjectv, sevcli_tCtx scctx, pwr_tOName *onamev, bool *sevhistobjectv, sevcli_tCtx scctx,
char *filename, int width, int height, unsigned int options, pwr_tStatus *sts); char *filename, int width, int height, unsigned int options, int color_theme,
XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, pwr_tStatus *sts); 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, 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, XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts); pwr_tStatus *sts);
CLog *clog_new( const char *name, pwr_tStatus *sts); CLog *clog_new( const char *name, pwr_tStatus *sts);
...@@ -105,7 +107,7 @@ class XNavGtk : public XNav { ...@@ -105,7 +107,7 @@ class XNavGtk : public XNav {
int width, int height, int x, int y, double scan_time, int width, int height, int x, int y, double scan_time,
unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts); unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts);
GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data, 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, XttFileview *fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr, char *filetype); int type, char *target_attr, char *trigger_attr, char *filetype);
CoLogin *login_new( const char *wl_name, CoLogin *login_new( const char *wl_name,
......
...@@ -49,7 +49,8 @@ typedef enum { ...@@ -49,7 +49,8 @@ typedef enum {
applist_eType_Hist, applist_eType_Hist,
applist_eType_Fast, applist_eType_Fast,
applist_eType_MultiView, applist_eType_MultiView,
applist_eType_Stream applist_eType_Stream,
applist_eType_SevHist
} applist_eType; } applist_eType;
......
...@@ -67,9 +67,10 @@ ...@@ -67,9 +67,10 @@
XttFast::XttFast( void *parent_ctx, XttFast::XttFast( void *parent_ctx,
char *name, char *name,
pwr_sAttrRef *fast_arp, pwr_sAttrRef *fast_arp,
int xn_color_theme,
int *sts) : int *sts) :
xnav(parent_ctx), fast_cnt(0), timerid(0), close_cb(0), help_cb(0), first_scan(1), 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_sAttrRef aref = pwr_cNAttrRef;
pwr_tAName fast_name; pwr_tAName fast_name;
...@@ -216,8 +217,9 @@ XttFast::XttFast( void *parent_ctx, ...@@ -216,8 +217,9 @@ XttFast::XttFast( void *parent_ctx,
XttFast::XttFast( void *parent_ctx, XttFast::XttFast( void *parent_ctx,
const char *name, const char *name,
char *filename, char *filename,
int xn_color_theme,
int *sts) : xnav(parent_ctx), fast_cnt(0), timerid(0), close_cb(0), help_cb(0), 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); *sts = read_export( filename);
......
...@@ -99,15 +99,18 @@ class XttFast { ...@@ -99,15 +99,18 @@ class XttFast {
pwr_sAttrRef trigg_time_attr; //!< Attrref to TriggTime attribute in DsFastCurve object. pwr_sAttrRef trigg_time_attr; //!< Attrref to TriggTime attribute in DsFastCurve object.
char title[250]; //!< Window title char title[250]; //!< Window title
CoWow *wow; CoWow *wow;
int color_theme;
//! Constructor //! Constructor
XttFast( void *xn_parent_ctx, XttFast( void *xn_parent_ctx,
char *xn_name, char *xn_name,
pwr_sAttrRef *fast_arp, pwr_sAttrRef *fast_arp,
int color_theme,
int *sts); int *sts);
XttFast( void *parent_ctx, XttFast( void *parent_ctx,
const char *name, const char *name,
char *filename, char *filename,
int color_theme,
int *sts); int *sts);
//! Destructor //! Destructor
...@@ -117,6 +120,7 @@ class XttFast { ...@@ -117,6 +120,7 @@ class XttFast {
void pop(); void pop();
void setup(); void setup();
int read_export( char *filename); 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_close_cb( void *ctx);
static void fast_help_cb( void *ctx); static void fast_help_cb( void *ctx);
......
...@@ -70,10 +70,11 @@ XttSevHist::XttSevHist( void *parent_ctx, ...@@ -70,10 +70,11 @@ XttSevHist::XttSevHist( void *parent_ctx,
pwr_tOName *xn_onamev, pwr_tOName *xn_onamev,
bool *xn_sevhistobjectv, bool *xn_sevhistobjectv,
sevcli_tCtx xn_scctx, sevcli_tCtx xn_scctx,
int xn_color_theme,
int *sts) : int *sts) :
xnav(parent_ctx), gcd(0), curve(0), rows(0), vsize(0), timerid(0), close_cb(0), help_cb(0), 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), 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; pwr_tTime from, to;
...@@ -124,9 +125,11 @@ XttSevHist::XttSevHist( void *parent_ctx, ...@@ -124,9 +125,11 @@ XttSevHist::XttSevHist( void *parent_ctx,
XttSevHist::XttSevHist( void *parent_ctx, XttSevHist::XttSevHist( void *parent_ctx,
const char *name, const char *name,
char *filename, char *filename,
int xn_color_theme,
int *sts) : int *sts) :
xnav(parent_ctx), gcd(0), curve(0), rows(0), vsize(0), timerid(0), close_cb(0), help_cb(0), 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)); strncpy( title, filename, sizeof(title));
......
...@@ -95,6 +95,7 @@ class XttSevHist { ...@@ -95,6 +95,7 @@ class XttSevHist {
long int time_high_old; long int time_high_old;
bool sevhistobjectv[XTT_SEVHIST_MAX]; //!< Indicates that it is a SevHistObject bool sevhistobjectv[XTT_SEVHIST_MAX]; //!< Indicates that it is a SevHistObject
time_ePeriod initial_period; time_ePeriod initial_period;
int color_theme;
//! Constructor //! Constructor
XttSevHist( void *xn_parent_ctx, XttSevHist( void *xn_parent_ctx,
...@@ -104,10 +105,12 @@ class XttSevHist { ...@@ -104,10 +105,12 @@ class XttSevHist {
pwr_tOName *xn_oname, pwr_tOName *xn_oname,
bool *sevhistobjectv, bool *sevhistobjectv,
sevcli_tCtx xn_scctx, sevcli_tCtx xn_scctx,
int xn_color_theme,
int *sts); int *sts);
XttSevHist( void *parent_ctx, XttSevHist( void *parent_ctx,
const char *name, const char *name,
char *filename, char *filename,
int xn_color_theme,
int *sts); int *sts);
//! Destructor //! Destructor
...@@ -122,6 +125,7 @@ class XttSevHist { ...@@ -122,6 +125,7 @@ class XttSevHist {
bool sevhistobject); bool sevhistobject);
int read_export( char *filename); int read_export( char *filename);
void setup(); void setup();
void update_color_theme( int ct) { curve->update_color_theme(ct);}
static void sevhist_close_cb( void *ctx); static void sevhist_close_cb( void *ctx);
static void sevhist_increase_period_cb( void *ctx); static void sevhist_increase_period_cb( void *ctx);
......
...@@ -67,9 +67,10 @@ ...@@ -67,9 +67,10 @@
XttTCurve::XttTCurve( void *parent_ctx, XttTCurve::XttTCurve( void *parent_ctx,
const char *name, const char *name,
pwr_tAttrRef *xn_arefv, pwr_tAttrRef *xn_arefv,
int xn_color_theme,
int *sts) : int *sts) :
xnav(parent_ctx), gcd(0), curve(0), rows(0), vsize(0), timerid(0), close_cb(0), help_cb(0), 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; pwr_tTime from, to;
......
...@@ -113,11 +113,13 @@ class XttTCurve { ...@@ -113,11 +113,13 @@ class XttTCurve {
long int time_low_old; long int time_low_old;
long int time_high_old; long int time_high_old;
tcurve_sTc tc; tcurve_sTc tc;
int color_theme;
//! Constructor //! Constructor
XttTCurve( void *xn_parent_ctx, XttTCurve( void *xn_parent_ctx,
const char *xn_name, const char *xn_name,
pwr_tAttrRef* xn_arefv, pwr_tAttrRef* xn_arefv,
int xn_color_theme,
int *sts); int *sts);
//! Destructor //! Destructor
...@@ -132,6 +134,7 @@ class XttTCurve { ...@@ -132,6 +134,7 @@ class XttTCurve {
void save( char *filename); void save( char *filename);
void open( char *filename); void open( char *filename);
void set_title( const char *str); 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_close_cb( void *ctx);
static void tcurve_new_cb( void *ctx); static void tcurve_new_cb( void *ctx);
......
...@@ -68,9 +68,10 @@ XttTrend::XttTrend( void *parent_ctx, ...@@ -68,9 +68,10 @@ XttTrend::XttTrend( void *parent_ctx,
pwr_sAttrRef *trend_list, pwr_sAttrRef *trend_list,
pwr_sAttrRef *plotgroup, pwr_sAttrRef *plotgroup,
unsigned int x_options, unsigned int x_options,
int xn_color_theme,
int *sts) : int *sts) :
xnav(parent_ctx), trend_cnt(0), update_time(1000), options(x_options), 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_list;
pwr_sAttrRef *aref_p; pwr_sAttrRef *aref_p;
......
...@@ -84,17 +84,20 @@ class XttTrend { ...@@ -84,17 +84,20 @@ class XttTrend {
void (*command_cb)( void *, const char *); void (*command_cb)( void *, const char *);
int (*get_select_cb)( void *, pwr_tAttrRef *, int *); //!< Get selected trend object. int (*get_select_cb)( void *, pwr_tAttrRef *, int *); //!< Get selected trend object.
CoWow *wow; CoWow *wow;
int color_theme;
XttTrend( void *xn_parent_ctx, XttTrend( void *xn_parent_ctx,
char *xn_name, char *xn_name,
pwr_sAttrRef *objid, pwr_sAttrRef *objid,
pwr_sAttrRef *plotgroup, pwr_sAttrRef *plotgroup,
unsigned int options, unsigned int options,
int xn_color_theme,
int *sts); int *sts);
virtual ~XttTrend(); virtual ~XttTrend();
void pop(); void pop();
void setup(); void setup();
void curve_add( pwr_tAttrRef *arp, pwr_tAttrRef *trend_arp, pwr_tStatus *sts); 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_close_cb( void *ctx);
static void trend_help_cb( void *ctx); static void trend_help_cb( void *ctx);
......
...@@ -361,13 +361,15 @@ class XNav { ...@@ -361,13 +361,15 @@ class XNav {
pwr_tStatus *sts) {return 0;} pwr_tStatus *sts) {return 0;}
virtual Op *op_new( char *opplace, 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, 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, virtual XttSevHist *xttsevhist_new( char *name, pwr_tOid *oidv, pwr_tOName *aname,
pwr_tOName *oname, bool *sevhistobjectv, sevcli_tCtx scctx, pwr_tOName *oname, bool *sevhistobjectv, sevcli_tCtx scctx,
char *filename, int width, int height, unsigned int options, pwr_tStatus *sts) {return 0;} char *filename, int width, int height, unsigned int options,
virtual XttTCurve *xtttcurve_new( char *name, pwr_tAttrRef *arefv, int width, int height, unsigned int options, pwr_tStatus *sts) {return 0;} 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, 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, virtual XAttOne *xattone_new( pwr_tAttrRef *objar, char *title, unsigned int priv,
pwr_tStatus *sts) {return 0;} pwr_tStatus *sts) {return 0;}
virtual CLog *clog_new( const char *name, pwr_tStatus *sts) {return 0;} virtual CLog *clog_new( const char *name, pwr_tStatus *sts) {return 0;}
...@@ -389,7 +391,7 @@ class XNav { ...@@ -389,7 +391,7 @@ class XNav {
int width, int height, int x, int y, double scan_time, int width, int height, int x, int y, double scan_time,
unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts) {return 0;} unsigned int options, int embedded, pwr_tAttrRef *arp, pwr_tStatus *sts) {return 0;}
virtual GeCurve *gecurve_new( char *name, char *filename, GeCurveData *data, 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, virtual XttFileview *fileview_new( pwr_tOid oid, char *title, char *dir, char *pattern,
int type, char *target_attr, char *trigger_attr, int type, char *target_attr, char *trigger_attr,
char *filetype) {return 0;} char *filetype) {return 0;}
......
...@@ -183,6 +183,7 @@ static void xnav_trend_help_cb( void *ctx, const char *key); ...@@ -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_close_cb( void *ctx, XttTCurve *trend);
static void xnav_tcurve_help_cb( void *ctx, const char *key); 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_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_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 int xnav_get_select_cb( void *ctx, pwr_tAttrRef *aref, int *is_attr);
static void xnav_fast_close_cb( void *ctx, XttFast *fast); static void xnav_fast_close_cb( void *ctx, XttFast *fast);
...@@ -1153,6 +1154,12 @@ static int xnav_set_func( void *client_data, ...@@ -1153,6 +1154,12 @@ static int xnav_set_func( void *client_data,
for ( elem = xnav->appl.root; elem; elem = elem->next) { for ( elem = xnav->appl.root; elem; elem = elem->next) {
if ( elem->type == applist_eType_Graph) if ( elem->type == applist_eType_Graph)
((XttGe *)elem->ctx)->update_color_theme( idx); ((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) if ( xnav->op)
...@@ -4099,7 +4106,7 @@ static int xnav_open_func( void *client_data, ...@@ -4099,7 +4106,7 @@ static int xnav_open_func( void *client_data,
trend->pop(); trend->pop();
} }
else { 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)) if ( EVEN(sts))
xnav->message('E',"Error in trend configuration"); xnav->message('E',"Error in trend configuration");
else { else {
...@@ -4119,7 +4126,7 @@ static int xnav_open_func( void *client_data, ...@@ -4119,7 +4126,7 @@ static int xnav_open_func( void *client_data,
trend->pop(); trend->pop();
} }
else { 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)) if ( EVEN(sts))
xnav->message('E',"Error in trend configuration"); xnav->message('E',"Error in trend configuration");
else { else {
...@@ -4133,7 +4140,7 @@ static int xnav_open_func( void *client_data, ...@@ -4133,7 +4140,7 @@ static int xnav_open_func( void *client_data,
} }
} }
else { 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)) { if ( ODD(sts)) {
trend->close_cb = xnav_trend_close_cb; trend->close_cb = xnav_trend_close_cb;
trend->command_cb = xnav_trend_command_cb; trend->command_cb = xnav_trend_command_cb;
...@@ -4257,7 +4264,7 @@ static int xnav_open_func( void *client_data, ...@@ -4257,7 +4264,7 @@ static int xnav_open_func( void *client_data,
if ( ODD( dcli_get_qualifier( "/NEW", 0, 0))) { if ( ODD( dcli_get_qualifier( "/NEW", 0, 0))) {
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, 0, width, height, XttTCurve *tcurve = xnav->xtttcurve_new( title_str, 0, width, height,
options, &sts); options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) { if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb; tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb; tcurve->command_cb = xnav_trend_command_cb;
...@@ -4298,7 +4305,7 @@ static int xnav_open_func( void *client_data, ...@@ -4298,7 +4305,7 @@ static int xnav_open_func( void *client_data,
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
XttTCurve *tcurve = xnav->xtttcurve_new( title_str, aref_vect, XttTCurve *tcurve = xnav->xtttcurve_new( title_str, aref_vect,
width, height, options, &sts); width, height, options, xnav->gbl.color_theme, &sts);
if ( ODD(sts)) { if ( ODD(sts)) {
tcurve->close_cb = xnav_tcurve_close_cb; tcurve->close_cb = xnav_tcurve_close_cb;
tcurve->command_cb = xnav_trend_command_cb; tcurve->command_cb = xnav_trend_command_cb;
...@@ -4373,11 +4380,15 @@ static int xnav_open_func( void *client_data, ...@@ -4373,11 +4380,15 @@ static int xnav_open_func( void *client_data,
if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) { if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) {
// Open exported history file // 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)) { if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb; hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb; hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, pwr_cNOid, "",
NULL);
} }
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
...@@ -4625,26 +4636,35 @@ static int xnav_open_func( void *client_data, ...@@ -4625,26 +4636,35 @@ static int xnav_open_func( void *client_data,
xnav->set_clock_cursor(); xnav->set_clock_cursor();
if ( plotgroup_found) { if ( plotgroup_found) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv, 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)) { if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb; hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb; hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, oidv[0], "",
NULL);
} }
} }
else if( sevHistObjectFound ) { else if( sevHistObjectFound ) {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv, 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)) { if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb; hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb; hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, oidv[0], "",
NULL);
} }
} }
else { else {
hist = xnav->xttsevhist_new( title_str, oidv, anamev, onamev, sevhistobjectv, 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)) { if ( ODD(sts)) {
hist->help_cb = xnav_sevhist_help_cb; hist->help_cb = xnav_sevhist_help_cb;
hist->close_cb = xnav_sevhist_close_cb;
hist->get_select_cb = xnav_sevhist_get_select_cb; hist->get_select_cb = xnav_sevhist_get_select_cb;
xnav->appl.insert( applist_eType_SevHist, (void *)hist, oidv[0], "",
NULL);
} }
} }
xnav->reset_cursor(); xnav->reset_cursor();
...@@ -4697,7 +4717,7 @@ static int xnav_open_func( void *client_data, ...@@ -4697,7 +4717,7 @@ static int xnav_open_func( void *client_data,
if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) { if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) {
// Open exported fast file // 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)) if ( EVEN(sts))
xnav->message('E',"Error in fast configuration"); xnav->message('E',"Error in fast configuration");
else { else {
...@@ -4762,7 +4782,7 @@ static int xnav_open_func( void *client_data, ...@@ -4762,7 +4782,7 @@ static int xnav_open_func( void *client_data,
fast->pop(); fast->pop();
} }
else { 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)) if ( EVEN(sts))
xnav->message('E',"Error in fast configuration"); xnav->message('E',"Error in fast configuration");
else { else {
...@@ -5599,6 +5619,14 @@ static void xnav_sevhist_help_cb( void *ctx, const char *key) ...@@ -5599,6 +5619,14 @@ static void xnav_sevhist_help_cb( void *ctx, const char *key)
xnav->message( ' ', null_str); 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) static int xnav_sevhist_get_select_cb( void *ctx, pwr_tOid *oid, char *aname, char *oname)
{ {
XNav *xnav = (XNav *) ctx; XNav *xnav = (XNav *) ctx;
...@@ -9549,7 +9577,7 @@ int XNav::set_parameter( char *name_str, char *value_str, int publicwrite) ...@@ -9549,7 +9577,7 @@ int XNav::set_parameter( char *name_str, char *value_str, int publicwrite)
void XNav::open_rttlog( char *name, char *filename) 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) ...@@ -9823,6 +9851,12 @@ static void xnav_colortheme_selector_ok_cb( void *ctx, char *text)
for ( elem = xnav->appl.root; elem; elem = elem->next) { for ( elem = xnav->appl.root; elem; elem = elem->next) {
if ( elem->type == applist_eType_Graph) if ( elem->type == applist_eType_Graph)
((XttGe *)elem->ctx)->update_color_theme( idx); ((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) 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