Commit 06b046df authored by claes's avatar claes

Changes fetched from 3.9

parent 145b2825
This diff is collapsed.
......@@ -36,6 +36,7 @@ extern "C" {
#include "ge_attr.h"
#include "ge_attrnav.h"
#include "ge_dyn.h"
#include "ge_msg.h"
......@@ -44,7 +45,12 @@ char Attr::value_recall[30][160];
static int attr_get_subgraph_info_cb( void *attr_ctx, char *name,
attr_sItem **itemlist, int *item_cnt);
static int attr_get_dyn_info_cb( void *attr_ctx, GeDyn *dyn,
attr_sItem **itemlist, int *item_cnt);
static void attr_valchanged_cmd_input( Widget w, XEvent *event);
static int attr_get_plant_select_cb( void *attr_ctx, char *value);
static int attr_get_current_colors_cb( void *attr_ctx, glow_eDrawType *fill_color,
glow_eDrawType *border_color, glow_eDrawType *text_color);
static void attr_message( void *attr, char severity, char *message)
{
......@@ -163,13 +169,37 @@ static int attr_reconfigure_attr_cb( void *attr_ctx)
((AttrNav *)attr->attrnav)->change_value_cb = &attr_change_value_cb;
((AttrNav *)attr->attrnav)->get_subgraph_info_cb =
&attr_get_subgraph_info_cb;
((AttrNav *)attr->attrnav)->get_dyn_info_cb =
&attr_get_dyn_info_cb;
((AttrNav *)attr->attrnav)->reconfigure_attr_cb =
&attr_reconfigure_attr_cb;
((AttrNav *)attr->attrnav)->set_inputfocus();
((AttrNav *)attr->attrnav)->get_plant_select_cb =
&attr_get_plant_select_cb;
((AttrNav *)attr->attrnav)->get_current_colors_cb =
&attr_get_current_colors_cb;
return 1;
}
static int attr_get_plant_select_cb( void *attr_ctx, char *value)
{
Attr *attr = (Attr *) attr_ctx;
if ( attr->get_plant_select_cb)
return attr->get_plant_select_cb( attr->parent_ctx, value);
return 0;
}
static int attr_get_current_colors_cb( void *attr_ctx, glow_eDrawType *fill_color,
glow_eDrawType *border_color, glow_eDrawType *text_color)
{
Attr *attr = (Attr *) attr_ctx;
if ( attr->get_current_colors_cb)
return attr->get_current_colors_cb( attr->parent_ctx, fill_color, border_color, text_color);
return 0;
}
static int attr_get_subgraph_info_cb( void *attr_ctx, char *name,
attr_sItem **itemlist, int *item_cnt)
{
......@@ -180,6 +210,16 @@ static int attr_get_subgraph_info_cb( void *attr_ctx, char *name,
return 0;
}
static int attr_get_dyn_info_cb( void *attr_ctx, GeDyn *dyn,
attr_sItem **itemlist, int *item_cnt)
{
Attr *attr = (Attr *) attr_ctx;
if ( attr->get_dyn_info_cb)
return attr->get_dyn_info_cb( attr->parent_ctx, dyn, itemlist,
item_cnt);
return 0;
}
//
// Callbackfunctions from menu entries
//
......@@ -197,7 +237,7 @@ static void attr_activate_store( Widget w, Attr *attr, XmAnyCallbackStruct *data
static void attr_activate_recall_next( Widget w, Attr *attr, XmAnyCallbackStruct *data)
{
int sts;
glow_sTraceData *old_data;
GeDyn *old_data;
int idx;
if ( attr->recall_idx == -1)
......@@ -210,8 +250,8 @@ static void attr_activate_recall_next( Widget w, Attr *attr, XmAnyCallbackStruct
idx, &old_data);
if ( ODD(sts))
{
if ( attr->recall_idx == -1) {
attr->original_data = *old_data;
if ( attr->recall_idx == -1 && !attr->original_data) {
attr->original_data = old_data;
attr->recall_idx = 0;
}
attr->recall_idx = idx;
......@@ -222,7 +262,7 @@ static void attr_activate_recall_next( Widget w, Attr *attr, XmAnyCallbackStruct
static void attr_activate_recall_prev( Widget w, Attr *attr, XmAnyCallbackStruct *data)
{
int sts;
glow_sTraceData *old_p;
GeDyn *old_p;
if ( attr->recall_idx < 0)
return;
......@@ -231,16 +271,19 @@ static void attr_activate_recall_prev( Widget w, Attr *attr, XmAnyCallbackStruct
// Get original data
if ( attr->set_data_cb) {
(attr->set_data_cb)( attr->parent_ctx, attr->object,
&attr->original_data);
attr->original_data);
attr_reconfigure_attr_cb((void *)attr);
attr->original_data = 0;
}
}
else {
if ( attr->recall_cb) {
sts = (attr->recall_cb)( attr->parent_ctx, attr->object,
attr->recall_idx, &old_p);
if ( ODD(sts))
if ( ODD(sts)) {
attr_reconfigure_attr_cb((void *)attr);
delete old_p;
}
else
attr->recall_idx++;
}
......@@ -397,6 +440,8 @@ static void attr_activate_cmd_scrolled_ca( Widget w, Attr *attr, XmAnyCallbackSt
Attr::~Attr()
{
if ( original_data)
delete original_data;
delete (AttrNav *)attrnav;
XtDestroyWidget( parent_wid);
}
......@@ -407,9 +452,10 @@ Attr::Attr( Widget a_parent_wid,
attr_sItem *itemlist,
int item_cnt ) :
parent_ctx(a_parent_ctx), input_open(0), object(a_object),
close_cb(0), redraw_cb(0), get_subgraph_info_cb(0), reconfigure_attr_cb(0),
close_cb(0), redraw_cb(0), get_subgraph_info_cb(0), get_dyn_info_cb(0),
reconfigure_attr_cb(0),
store_cb(0), recall_cb(0), set_data_cb(0), client_data(0), recall_idx(-1),
value_current_recall(0)
original_data(0), value_current_recall(0)
{
char uid_filename[120] = {"pwr_exe:ge_attr.uid"};
char *uid_filename_p = uid_filename;
......@@ -515,8 +561,14 @@ Attr::Attr( Widget a_parent_wid,
((AttrNav *)attrnav)->change_value_cb = &attr_change_value_cb;
((AttrNav *)attrnav)->get_subgraph_info_cb =
&attr_get_subgraph_info_cb;
((AttrNav *)attrnav)->get_dyn_info_cb =
&attr_get_dyn_info_cb;
((AttrNav *)attrnav)->reconfigure_attr_cb =
&attr_reconfigure_attr_cb;
((AttrNav *)attrnav)->get_plant_select_cb =
&attr_get_plant_select_cb;
((AttrNav *)attrnav)->get_current_colors_cb =
&attr_get_current_colors_cb;
XtPopup( parent_wid, XtGrabNone);
......
......@@ -12,6 +12,13 @@
extern "C" {
#endif
/*! \file ge_attr.h
\brief Contains the Attr class. */
/*! \addtogroup Ge */
/*@{*/
class GeDyn;
typedef struct {
void *value;
char name[80];
......@@ -21,8 +28,11 @@ typedef struct {
double maxlimit;
int noedit;
int multiline;
int mask;
} attr_sItem;
//! Attribute editor.
/*! Displays grow attributes and dynamic attributes for an object or graph. */
class Attr {
public:
Attr(
......@@ -53,14 +63,19 @@ class Attr {
void (*redraw_cb) (Attr *);
int (*get_subgraph_info_cb)( void *, char *, attr_sItem **,
int *);
int (*get_dyn_info_cb)( void *, GeDyn *, attr_sItem **,
int *);
int (*reconfigure_attr_cb)( void *, void *,
attr_sItem **, int *, void **);
void (*store_cb) (void *, void *);
int (*recall_cb) (void *, void *, int, glow_sTraceData **);
int (*set_data_cb) (void *, void *, glow_sTraceData *);
int (*recall_cb) (void *, void *, int, GeDyn **);
int (*set_data_cb) (void *, void *, GeDyn *);
int (*get_plant_select_cb) (void *, char *);
int (*get_current_colors_cb)( void *, glow_eDrawType *, glow_eDrawType *,
glow_eDrawType *);
void *client_data;
int recall_idx;
glow_sTraceData original_data;
GeDyn *original_data;
static char value_recall[30][160];
int value_current_recall;
......@@ -72,9 +87,16 @@ class Attr {
};
/*@}*/
#if defined __cplusplus
}
#endif
#endif
This diff is collapsed.
......@@ -40,6 +40,11 @@ extern "C" {
#include "ge_graph.h"
#endif
/*! \file ge_attrnav.h
\brief Contains the AttrNav class and related classes. */
/*! \addtogroup Ge */
/*@{*/
#define attrnav_cVersion "X3.0b"
#define ATTRNAV_BROW_MAX 25
......@@ -74,6 +79,7 @@ typedef struct {
} attrnav_sEnum;
//! Class for handling of brow.
class AttrNavBrow {
public:
AttrNavBrow( BrowCtx *brow_ctx, void *xn) : ctx(brow_ctx), attrnav(xn) {};
......@@ -101,6 +107,7 @@ class AttrNavBrow {
};
//! The navigation area of the attribute editor.
class AttrNav {
public:
AttrNav(
......@@ -127,7 +134,11 @@ class AttrNav {
void (*message_cb)( void *, char, char *);
void (*change_value_cb)( void *);
int (*get_subgraph_info_cb)( void *, char *, attr_sItem **, int *);
int (*get_dyn_info_cb)( void *, GeDyn *, attr_sItem **, int *);
int (*reconfigure_attr_cb)( void *);
int (*get_plant_select_cb)( void *, char *);
int (*get_current_colors_cb)( void *, glow_eDrawType *, glow_eDrawType *,
glow_eDrawType *);
void start_trace( pwr_tObjid Objid, char *object_str);
int set_attr_value( char *value_str);
......@@ -140,12 +151,13 @@ class AttrNav {
};
//! Item for a normal attribute.
class ItemLocal {
public:
ItemLocal( AttrNav *attrnav, char *item_name, char *attr,
int attr_type, int attr_size, double attr_min_limit,
double attr_max_limit, void *attr_value_p, int attr_multiline,
int attr_noedit,
int attr_noedit, int attr_mask,
brow_tNode dest, flow_eDest dest_code);
attrnav_eItemType type;
brow_tNode node;
......@@ -159,6 +171,7 @@ class ItemLocal {
double max_limit;
int multiline;
int noedit;
int mask;
int parent;
int subgraph;
......@@ -166,6 +179,7 @@ class ItemLocal {
int close( AttrNav *attrnav, double x, double y);
};
//! Item for an enum attribute.
class ItemEnum {
public:
ItemEnum( AttrNav *attrnav, char *item_name, int item_num,
......@@ -181,6 +195,7 @@ class ItemEnum {
int first_scan;
};
//! Item for a mask attribute.
class ItemMask {
public:
ItemMask( AttrNav *attrnav, char *item_name, unsigned int item_mask,
......@@ -196,6 +211,7 @@ class ItemMask {
int first_scan;
};
/*@}*/
#if defined __cplusplus
}
#endif
......
This diff is collapsed.
......@@ -25,6 +25,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "rt_load.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
......@@ -39,7 +40,6 @@
extern "C" {
#include "rt_gdh.h"
#include "rt_load.h"
#include "rt_gdh_msg.h"
#include "co_cdh.h"
#include "co_time.h"
......@@ -96,6 +96,8 @@ static void gec_activate_background( Widget w, GeCurve *curve, XmAnyCallbackStru
}
grow_SetObjectFillColor( curve->curve_object, curve->curve_color);
grow_SetObjectBorderColor( curve->curve_object, curve->curve_border);
curve->cd->select_color( curve->curve_color == curve->background_dark);
curve->configure_curves();
}
static void gec_activate_showname( Widget w, GeCurve *curve,
......@@ -491,7 +493,7 @@ static int ge_init_grownames_cb( GlowCtx *fctx, void *client_data)
for ( int i = 1; i < curve->cd->cols; i++) {
grow_CreateGrowRect( curve->grownames_ctx, "", 0, (i-1), 1, 1,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 1,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 1, 1,
curve->cd->color[i], NULL, &curve->name_rect[i]);
if ( curve->hide[i])
......@@ -500,11 +502,11 @@ static int ge_init_grownames_cb( GlowCtx *fctx, void *client_data)
color = glow_eDrawType_Line;
grow_CreateGrowRect( curve->grownames_ctx, "", 0.25, (i-1)+0.25, 0.5, 0.5,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 0,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 0, 0,
color, NULL, &curve->hide_rect[i]);
grow_CreateGrowText( curve->grownames_ctx, "", curve->cd->name[i],
1.3, (i-1) + 0.85, glow_eDrawType_TextHelveticaBold, 2,
glow_mDisplayLevel_1, NULL, &t1);
1.3, (i-1) + 0.85, glow_eDrawType_TextHelveticaBold,
glow_eDrawType_Line, 2, glow_mDisplayLevel_1, NULL, &t1);
}
return 1;
......@@ -524,8 +526,8 @@ int GeCurve::configure_axes()
!hide[i]) {
grow_CreateGrowRect( growaxis_ctx, "", x, 0,
cd->axis_width[i], 30,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 0,
cd->color[i], NULL,
glow_eDrawType_Line, 1, 0, glow_mDisplayLevel_1, 1, 0, 0,
cd->axiscolor[i], NULL,
&axis_rect[i]);
x += cd->axis_width[i];
}
......@@ -805,6 +807,31 @@ void GeCurve::pop()
flow_MapWidget( toplevel);
}
void GeCurve::set_time( pwr_tTime time)
{
char time_str[40];
char full_title[200];
time_AtoAscii( &time, time_eFormat_DateAndTime, time_str, sizeof(time_str));
sprintf( full_title, "%s %s", title, time_str);
write_title( full_title);
}
void GeCurve::set_title( char *str)
{
strcpy( title, str);
write_title( str);
}
void GeCurve::write_title( char *str)
{
Arg args[1];
XtSetArg(args[0],XmNtitle, str);
XtSetValues( toplevel, args, 1);
}
GeCurve::~GeCurve()
{
XtDestroyWidget( toplevel);
......@@ -816,10 +843,10 @@ GeCurve::GeCurve( void *gc_parent_ctx,
char *filename,
GeCurveData *curve_data,
int pos_right) :
parent_ctx(gc_parent_ctx), background_dark(glow_eDrawType_Color9),
background_bright(glow_eDrawType_Color11),
border_dark(glow_eDrawType_Color15),
border_bright(glow_eDrawType_Color12),
parent_ctx(gc_parent_ctx), background_dark(glow_eDrawType_Color29),
background_bright(glow_eDrawType_Color21),
border_dark(glow_eDrawType_Color28),
border_bright(glow_eDrawType_Color22),
cd(0), axis_window_width(0), auto_refresh(1), axis_displayed(1),
minmax_idx(0), close_cb(0), initial_right_position(pos_right)
{
......@@ -827,7 +854,6 @@ GeCurve::GeCurve( void *gc_parent_ctx,
char *uid_filename_p = uid_filename;
Arg args[20];
pwr_tStatus sts;
char title[80];
int i;
MrmHierarchy s_DRMh;
MrmType dclass;
......@@ -872,10 +898,11 @@ GeCurve::GeCurve( void *gc_parent_ctx,
cd->get_borders();
cd->get_default_axis();
cd->select_color();
cd->select_color( curve_color == background_dark);
}
else if ( curve_data) {
cd = curve_data;
cd->select_color( curve_color == background_dark);
}
// Motif
......@@ -967,6 +994,8 @@ GeCurveData::GeCurveData( curve_eDataType datatype) :
min_value[i] = 0;
min_value_axis[i] = 0;
max_value_axis[i] = 0;
lines[i] = 0;
axis_width[i] = 0;
}
}
......@@ -1009,13 +1038,106 @@ void GeCurveData::get_default_axis()
}
}
void GeCurveData::select_color()
void GeCurveData::select_color( bool dark_bg)
{
int j;
for ( int i = 0; i < cols; i++) {
j = i % 16;
j = i % 9;
switch( j) {
case 0:
// Seablue
color[i] = glow_eDrawType_Color265;
axiscolor[i] = glow_eDrawType_Color255;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color257;
else
fillcolor[i] = glow_eDrawType_Color254;
break;
case 1:
// Orange
if ( dark_bg)
color[i] = glow_eDrawType_Color144;
else
color[i] = glow_eDrawType_Color146;
axiscolor[i] = glow_eDrawType_Color135;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color137;
else
fillcolor[i] = glow_eDrawType_Color133;
break;
case 2:
// YellowGreen
if ( dark_bg)
color[i] = glow_eDrawType_Color85;
else
color[i] = glow_eDrawType_Color87;
axiscolor[i] = glow_eDrawType_Color75;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color67;
else
fillcolor[i] = glow_eDrawType_Color64;
break;
case 3:
// Yellow
if ( dark_bg)
color[i] = glow_eDrawType_Color115;
else
color[i] = glow_eDrawType_Color117;
axiscolor[i] = glow_eDrawType_Color105;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color107;
else
fillcolor[i] = glow_eDrawType_Color104;
break;
case 4:
// Blue
color[i] = glow_eDrawType_Color235;
axiscolor[i] = glow_eDrawType_Color225;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color227;
else
fillcolor[i] = glow_eDrawType_Color214;
break;
case 5:
// Violet
color[i] = glow_eDrawType_Color205;
axiscolor[i] = glow_eDrawType_Color195;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color197;
else
fillcolor[i] = glow_eDrawType_Color184;
break;
case 6:
// Red
color[i] = glow_eDrawType_Color175;
axiscolor[i] = glow_eDrawType_Color165;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color167;
else
fillcolor[i] = glow_eDrawType_Color154;
break;
case 7:
// Green
color[i] = glow_eDrawType_Color295;
axiscolor[i] = glow_eDrawType_Color285;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color287;
else
fillcolor[i] = glow_eDrawType_Color274;
break;
case 8:
// Gray
color[i] = glow_eDrawType_Color35;
axiscolor[i] = glow_eDrawType_Color35;
if ( dark_bg)
fillcolor[i] = glow_eDrawType_Color37;
else
fillcolor[i] = glow_eDrawType_Color34;
break;
}
#if 0
if ( j < 4)
color[i] = (glow_eDrawType) (j * 20 + 27);
else if ( j >= 4 && j < 8)
......@@ -1026,6 +1148,7 @@ void GeCurveData::select_color()
color[i] = (glow_eDrawType) ((j - 12) * 20 + 32);
fillcolor[i] = (glow_eDrawType)(color[i] + 1);
#endif
}
}
......
......@@ -16,6 +16,10 @@ extern "C" {
#include "glow_growapi.h"
#endif
/*! \file ge_curve.h
\brief Contains the GeCurve class. */
/*! \addtogroup Ge */
/*@{*/
#define CURVE_MAX_COLS 101
......@@ -31,6 +35,7 @@ typedef enum {
curve_eAxis_y
} curve_eAxis;
//! Contains data for the curves.
class GeCurveData {
public:
GeCurveData( curve_eDataType datatype);
......@@ -46,6 +51,7 @@ class GeCurveData {
int lines[CURVE_MAX_COLS];
glow_eDrawType color[CURVE_MAX_COLS];
glow_eDrawType fillcolor[CURVE_MAX_COLS];
glow_eDrawType axiscolor[CURVE_MAX_COLS];
pwr_eType value_type[CURVE_MAX_COLS];
curve_eAxis axis_type[CURVE_MAX_COLS];
double axis_width[CURVE_MAX_COLS];
......@@ -53,7 +59,7 @@ class GeCurveData {
int x_reverse;
void get_borders();
void get_default_axis();
void select_color();
void select_color( bool dark_bg);
void scale( int axis_type, int value_type,
double min_value, double max_value,
double *min_value_axis, double *max_value_axis,
......@@ -62,7 +68,11 @@ class GeCurveData {
~GeCurveData();
};
//! A curve window used for trends and logging curves.
class GeCurve {
private:
void write_title( char *str);
public:
GeCurve( void *gc_parent_ctx, Widget parent_widget, char *curve_name,
char *filename, GeCurveData *curve_data, int pos_right);
......@@ -106,15 +116,19 @@ class GeCurve {
int minmax_idx;
void (*close_cb)( void *);
int initial_right_position;
char title[120];
int read_file( char *filename);
int configure_curves();
int configure_axes();
void points_added();
void pop();
void set_title( char *str);
void set_time( pwr_tTime time);
~GeCurve();
};
/*@}*/
#if defined __cplusplus
}
#endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -49,7 +49,6 @@ extern "C" {
#endif
}
static char ge_version[] = "V3.4.0";
static Graph *current_graph;
static void graph_group_replace_attr( grow_tObject group, char *from_str, char *to_str,
......@@ -73,6 +72,8 @@ static int graph_replace_func( void *client_data,
void *client_flag);
static int graph_rotate_func( void *client_data,
void *client_flag);
static int graph_flip_func( void *client_data,
void *client_flag);
static int graph_scale_func( void *client_data,
void *client_flag);
static int graph_move_func( void *client_data,
......@@ -89,6 +90,8 @@ static int graph_export_func( void *client_data,
void *client_flag);
static int graph_replace_func( void *client_data,
void *client_flag);
static int graph_convert_func( void *client_data,
void *client_flag);
dcli_tCmdTable graph_command_table[] = {
{
......@@ -133,6 +136,12 @@ dcli_tCmdTable graph_command_table[] = {
{ "dcli_arg1", "/ANGEL",
""}
},
{
"FLIP",
&graph_flip_func,
{ "dcli_arg1",
""}
},
{
"SCALE",
&graph_scale_func,
......@@ -159,6 +168,12 @@ dcli_tCmdTable graph_command_table[] = {
{ "dcli_arg1", "/FROM", "/TO", "/STRICT",
""}
},
{
"CONVERT",
&graph_convert_func,
{ "dcli_arg1",
""}
},
{
"EXIT",
&graph_exit_func,
......@@ -209,10 +224,14 @@ static int graph_show_func(void *client_data,
if ( strncmp( arg1_str, "VERSION", strlen( arg1_str)) == 0)
{
// Command is "SHOW VERSION"
char message_str[80];
strcpy( message_str, "Ge version ");
strcat( message_str, ge_version);
char message_str[80];
int grow_version, graph_version;
grow_GetVersion( graph->grow->ctx, &grow_version, &graph_version);
sprintf( message_str, "Current graph: V%d.%03d, Grow: V%d.%03d",
int(graph_version/1000), graph_version % 1000,
int(grow_version/1000), grow_version % 1000);
graph->message('I', message_str);
}
else
......@@ -483,7 +502,7 @@ static int graph_set_func( void *client_data,
else if ( strncmp( arg1_str, "FILLCOLOR", strlen( arg1_str)) == 0)
{
char arg2_str[80];
glow_eDrawType fill_color, border_color;
glow_eDrawType fill_color, border_color, text_color;
int value;
int sts;
......@@ -504,14 +523,14 @@ static int graph_set_func( void *client_data,
graph->message('E', "Syntax error");
return GE__SYNTAX;
}
(graph->get_current_colors_cb)( graph->parent_ctx, &fill_color, &border_color);
(graph->get_current_colors_cb)( graph->parent_ctx, &fill_color, &border_color, &text_color);
fill_color = (glow_eDrawType) value;
(graph->set_current_colors_cb)( graph->parent_ctx, fill_color, border_color);
(graph->set_current_colors_cb)( graph->parent_ctx, fill_color, border_color, text_color);
}
else if ( strncmp( arg1_str, "BORDERCOLOR", strlen( arg1_str)) == 0)
{
char arg2_str[80];
glow_eDrawType fill_color, border_color;
glow_eDrawType fill_color, border_color, text_color;
int value;
int sts;
......@@ -532,9 +551,37 @@ static int graph_set_func( void *client_data,
graph->message('E', "Syntax error");
return GE__SYNTAX;
}
(graph->get_current_colors_cb)( graph->parent_ctx, &fill_color, &border_color);
(graph->get_current_colors_cb)( graph->parent_ctx, &fill_color, &border_color, &text_color);
border_color = (glow_eDrawType) value;
(graph->set_current_colors_cb)( graph->parent_ctx, fill_color, border_color);
(graph->set_current_colors_cb)( graph->parent_ctx, fill_color, border_color, text_color);
}
else if ( strncmp( arg1_str, "TEXTCOLOR", strlen( arg1_str)) == 0)
{
char arg2_str[80];
glow_eDrawType fill_color, border_color, text_color;
int value;
int sts;
if ( EVEN( dcli_get_qualifier( "dcli_arg2", arg2_str)))
{
graph->message('E', "Syntax error");
return GE__SYNTAX;
}
sts = sscanf( arg2_str, "%d", &value);
if ( sts != 1)
{
graph->message('E', "Syntax error");
return GE__SYNTAX;
}
if ( value < 0 || value > 99)
{
graph->message('E', "Syntax error");
return GE__SYNTAX;
}
(graph->get_current_colors_cb)( graph->parent_ctx, &fill_color, &border_color, &text_color);
text_color = (glow_eDrawType) value;
(graph->set_current_colors_cb)( graph->parent_ctx, fill_color, border_color, text_color);
}
else if ( strncmp( arg1_str, "CURRENTOBJECT", strlen( arg1_str)) == 0)
{
......@@ -945,7 +992,7 @@ static int graph_set_func( void *client_data,
{
case glow_eType_Int:
case glow_eType_TraceColor:
case glow_eType_TraceType:
case glow_eType_DynType:
case glow_eType_Access:
case glow_eType_Boolean:
case glow_eType_Direction:
......@@ -1067,6 +1114,19 @@ static int graph_set_func( void *client_data,
double d_value;
int sts;
int found;
char transtab[][32] = { "DynType", "DynType",
"DynActionType", "Action",
"DynColor1", "Color1",
"DynColor2", "Color2",
"DynColor3", "Color3",
"DynColor4", "Color4",
"DynAttr1", "AnimSequence",
"DynAttr2", "",
"DynAttr3", "",
"DynAttr4", "",
"Dynamic", "",
""};
if ( EVEN( dcli_get_qualifier( "dcli_arg2", arg2_str)))
{
......@@ -1085,7 +1145,8 @@ static int graph_set_func( void *client_data,
{
if ( j == 0)
{
grow_GetSubGraphAttrInfo( graph->grow->ctx, &grow_info_sub, &grow_info_cnt);
grow_GetSubGraphAttrInfo( graph->grow->ctx, (char *)transtab, &grow_info_sub,
&grow_info_cnt);
grow_info_p = grow_info_sub;
}
else
......@@ -1118,7 +1179,7 @@ static int graph_set_func( void *client_data,
{
case glow_eType_Int:
case glow_eType_TraceColor:
case glow_eType_TraceType:
case glow_eType_DynType:
case glow_eType_Access:
case glow_eType_Boolean:
case glow_eType_Direction:
......@@ -1324,6 +1385,35 @@ static int graph_rotate_func( void *client_data,
}
static int graph_flip_func( void *client_data,
void *client_flag)
{
Graph *graph = (Graph *)client_data;
char arg1_str[80];
int arg1_sts;
arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str);
if ( strncmp( arg1_str, "HORIZONTAL", strlen( arg1_str)) == 0)
{
grow_FlipSelectedObjects( graph->grow->ctx, glow_eFlipDirection_Horizontal);
grow_SetModified( graph->grow->ctx, 1);
}
else if ( strncmp( arg1_str, "VERTICAL", strlen( arg1_str)) == 0)
{
grow_FlipSelectedObjects( graph->grow->ctx, glow_eFlipDirection_Vertical);
grow_SetModified( graph->grow->ctx, 1);
}
else
{
graph->message('E', "Syntax error");
return GE__SYNTAX;
}
return GE__SUCCESS;
}
static int graph_select_func( void *client_data,
void *client_flag)
{
......@@ -1727,7 +1817,7 @@ static int graph_create_func( void *client_data,
grow_CreateGrowRect( graph->grow->ctx, "",
x, y, width, height,
graph->get_border_drawtype(), graph->linewidth, 0,
glow_mDisplayLevel_1, graph->fill, graph->border,
glow_mDisplayLevel_1, graph->fill, graph->border, graph->shadow,
graph->get_fill_drawtype(), NULL, &graph->current_cmd_object);
grow_SetModified( graph->grow->ctx, 1);
}
......@@ -1818,7 +1908,7 @@ static int graph_create_func( void *client_data,
grow_CreateGrowArc( graph->grow->ctx, "",
x1, y1, x2, y2, angel1, angel2,
graph->get_border_drawtype(), graph->linewidth,
graph->fill, graph->border, graph->get_fill_drawtype(), NULL,
graph->fill, graph->border, graph->shadow, graph->get_fill_drawtype(), NULL,
&graph->current_cmd_object);
grow_SetModified( graph->grow->ctx, 1);
}
......@@ -1957,14 +2047,14 @@ static int graph_create_func( void *client_data,
grow_CreateGrowPolyLine( graph->grow->ctx, "",
(glow_sPoint *)&points, point_cnt,
graph->get_border_drawtype(), graph->linewidth, 0,
0, graph->border,
0, graph->border, graph->shadow,
graph->get_fill_drawtype(), 0, NULL,
&graph->current_cmd_object);
else
grow_CreateGrowPolyLine( graph->grow->ctx, "",
(glow_sPoint *)&points, point_cnt,
graph->get_border_drawtype(), graph->linewidth, 0,
graph->fill, graph->border,
graph->fill, graph->border, graph->shadow,
graph->get_fill_drawtype(), 0, NULL,
&graph->current_cmd_object);
......@@ -2029,7 +2119,7 @@ static int graph_create_func( void *client_data,
}
grow_CreateGrowText( graph->grow->ctx, "", text_str,
x1, y1,
drawtype, textsize, glow_mDisplayLevel_1,
drawtype, glow_eDrawType_Line, textsize, glow_mDisplayLevel_1,
NULL, &graph->current_cmd_object);
grow_SetModified( graph->grow->ctx, 1);
}
......@@ -2168,6 +2258,41 @@ static int graph_create_func( void *client_data,
return GE__SUCCESS;
}
static int graph_convert_func( void *client_data,
void *client_flag)
{
Graph *graph = (Graph *)client_data;
char arg1_str[80];
int arg1_sts;
arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str);
if ( strncmp( arg1_str, "V40", strlen( arg1_str)) == 0) {
char name[40];
char msg[80];
int sts;
sts = graph->convert();
if ( EVEN(sts)) {
grow_GetName( graph->grow->ctx, name);
sprintf( msg, "Conversion failed, graph %s", name);
graph->message('E', msg);
return sts;
}
grow_GetName( graph->grow->ctx, name);
sprintf( msg, "Graph %s converted", name);
graph->message('I', msg);
grow_UpdateVersion( graph->grow->ctx);
grow_SetModified( graph->grow->ctx, 1);
}
else {
graph->message('E', "Syntax error");
return GE__SYNTAX;
}
return GE__SUCCESS;
}
static int graph_replace_func( void *client_data,
void *client_flag)
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -12,6 +12,11 @@
extern "C" {
#endif
/*! \file ge_plant.h
\brief API to the Nav class which displayes the plant hierarchy. */
/*! \addtogroup Ge */
/*@{*/
void *plant_new(
void *parent_ctx,
Widget parent_wid,
......@@ -25,6 +30,7 @@ void *plant_new(
void plant_del( void *plantctx);
int plant_get_select( void *plantctx, pwr_sAttrRef *attrref, int *is_attr);
/*@}*/
#if defined __cplusplus
}
#endif
......
......@@ -788,10 +788,11 @@ int SubGraphs::edit_attributes( void *object)
int grow_info_cnt;
Attr *attr;
subgraphs_tAttr attrlist_p;
graph_eTrace trace_type;
int trace_type;
int dyn_action_type;
grow_GetObjectAttrInfo( (grow_tObject)object, NULL, &grow_info, &grow_info_cnt);
grow_GetNodeClassTraceType( object, (glow_eTraceType *) &trace_type);
grow_GetNodeClassDynType( object, &trace_type, &dyn_action_type);
grow_info_p = grow_info;
for ( i = 0; i < grow_info_cnt; i++)
......
......@@ -27,6 +27,11 @@ extern "C" {
#include "ge_attr.h"
#endif
/*! \file ge_subgraphs.h
\brief Contains the SubGraphs class and related classes. */
/*! \addtogroup Ge */
/*@{*/
#define subgraphs_cVersion "X3.0b"
typedef enum {
......@@ -69,6 +74,7 @@ class SubGraphsBrow {
};
//! Display loaded subgraphs.
class SubGraphs {
public:
SubGraphs(
......@@ -104,6 +110,7 @@ class SubGraphs {
~SubGraphs();
};
//! Base item class.
class SubGraphBaseItem {
public:
SubGraphBaseItem( subgraphs_eItemType item_type) :
......@@ -111,6 +118,7 @@ class SubGraphBaseItem {
subgraphs_eItemType type;
};
//! Item for a subgraph.
class ItemSubGraph : public SubGraphBaseItem {
public:
ItemSubGraph( SubGraphs *subgraphs, char *item_name, int *item_extern_p,
......@@ -126,6 +134,7 @@ class ItemSubGraph : public SubGraphBaseItem {
void set_extern( int value) { *extern_p = value;};
};
/*@}*/
#if defined __cplusplus
}
#endif
......
......@@ -23,6 +23,11 @@ extern "C" {
#include "flow_browapi.h"
#endif
/*! \file ge_subpalette.h
\brief Contains the SubPalette class and related classes. */
/*! \addtogroup Ge */
/*@{*/
#define subpalette_cVersion "X3.0b"
#define SUBP_PIXMAPS_SIZE 40
......@@ -74,6 +79,7 @@ class SubPaletteBrow {
};
//! Display the subgraph palette.
class SubPalette {
public:
SubPalette(
......@@ -165,3 +171,9 @@ class ItemMenu : public Item {
}
#endif
#endif
......@@ -8,10 +8,15 @@
<Description>. */
/*! \file ge_util.h
\brief Ge utility functions. */
/*! \addtogroup Ge */
/*@{*/
int ge_get_systemname(
char *systemname
);
/*@}*/
#endif
This diff is collapsed.
......@@ -82,6 +82,10 @@
2609 2
2610 2
2611 1
2616 0
2614 5
2617 2
2615 0
2607 0
2606
2612
......@@ -104,9 +108,25 @@
304 0
303
308 0
321 0
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
99
99
99
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -14,6 +14,10 @@
1909 2
1910 2
1911 1
1915 0
1913 5
1916 2
1914 0
1907 0
1906
1905
......@@ -51,14 +55,26 @@
307
304 0
303
308 1026
308 32768
321 16
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314 pwr_checkbox__p2
315 1
316 1
317 0
318 0
319 0
320 0
99
99
99
This diff is collapsed.
......@@ -14,6 +14,10 @@
1909 2
1910 2
1911 1
1915 0
1913 5
1916 2
1914 0
1907 0
1906
1905
......@@ -88,6 +92,10 @@
2609 2
2610 2
2611 1
2616 0
2614 5
2617 2
2615 0
2607 0
2606
2612
......@@ -110,13 +118,25 @@
304 0
303
308 0
321 0
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
99
99
99
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment