Commit c98ed0cc authored by Claes Sjofors's avatar Claes Sjofors

Ge axis dynamic implemeted

parent 0f2786af
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
//! Type of attributes. Should not collide with glow_eType //! Type of attributes. Should not collide with glow_eType
typedef enum { typedef enum {
ge_eAttrType_DynType = glow_eType_DynType, //!< DynType. ge_eAttrType_DynType1 = glow_eType_DynType1, //!< DynType.
ge_eAttrType_DynTypeTone = 1001, //!< DynType with color tone. ge_eAttrType_DynTypeTone = 1001, //!< DynType with color tone.
ge_eAttrType_ActionType = glow_eType_ActionType, //!< ActionType. ge_eAttrType_ActionType1 = glow_eType_ActionType1, //!< ActionType.
ge_eAttrType_AnimSequence = 1003, //!< Animation sequence. ge_eAttrType_AnimSequence = 1003, //!< Animation sequence.
ge_eAttrType_LimitType = 1004, //!< Limit type (Gt or Lt). ge_eAttrType_LimitType = 1004, //!< Limit type (Gt or Lt).
ge_eAttrType_InstanceMask = 1005, //!< Instance mask. ge_eAttrType_InstanceMask = 1005, //!< Instance mask.
...@@ -100,7 +100,9 @@ typedef enum { ...@@ -100,7 +100,9 @@ typedef enum {
ge_eAttrType_Dyn = 1007, //!< Dynamic data. ge_eAttrType_Dyn = 1007, //!< Dynamic data.
ge_eAttrType_ScaleType = 1008, //!< Scale type. ge_eAttrType_ScaleType = 1008, //!< Scale type.
ge_eAttrType_CurveDataType = 1009, //!< Data type for XY_Curve. ge_eAttrType_CurveDataType = 1009, //!< Data type for XY_Curve.
ge_eAttrType_OptionMenuType = 1010 //!< OptionMenu type. ge_eAttrType_OptionMenuType = 1010, //!< OptionMenu type.
ge_eAttrType_DynType2 = glow_eType_DynType2, //!< DynType mask 2.
ge_eAttrType_ActionType2 = glow_eType_ActionType2, //!< ActionType mask 2.
} ge_eAttrType; } ge_eAttrType;
//! Graph mode. //! Graph mode.
...@@ -1293,8 +1295,8 @@ class Graph { ...@@ -1293,8 +1295,8 @@ class Graph {
\param x x coordinate for object. \param x x coordinate for object.
\param y y coordinate for object. \param y y coordinate for object.
*/ */
void create_axis( grow_tObject *object, double x, double y); void create_axis( grow_tObject *object, double x, double y, int dynamic);
void create_axisarc( grow_tObject *object, double x, double y); void create_axisarc( grow_tObject *object, double x, double y, int dynamic);
void create_pie( grow_tObject *object, double x, double y); void create_pie( grow_tObject *object, double x, double y);
void create_barchart( grow_tObject *object, double x, double y); void create_barchart( grow_tObject *object, double x, double y);
......
...@@ -1030,7 +1030,7 @@ static int graph_set_func( void *client_data, ...@@ -1030,7 +1030,7 @@ static int graph_set_func( void *client_data,
{ {
case glow_eType_Int: case glow_eType_Int:
case glow_eType_TraceColor: case glow_eType_TraceColor:
case glow_eType_DynType: case glow_eType_DynType1:
case glow_eType_Access: case glow_eType_Access:
case glow_eType_Boolean: case glow_eType_Boolean:
case glow_eType_Direction: case glow_eType_Direction:
...@@ -1218,7 +1218,7 @@ static int graph_set_func( void *client_data, ...@@ -1218,7 +1218,7 @@ static int graph_set_func( void *client_data,
{ {
case glow_eType_Int: case glow_eType_Int:
case glow_eType_TraceColor: case glow_eType_TraceColor:
case glow_eType_DynType: case glow_eType_DynType1:
case glow_eType_Access: case glow_eType_Access:
case glow_eType_Boolean: case glow_eType_Boolean:
case glow_eType_Direction: case glow_eType_Direction:
......
...@@ -69,8 +69,10 @@ int Graph::export_javabean( char *filename, char *bean_name) ...@@ -69,8 +69,10 @@ int Graph::export_javabean( char *filename, char *bean_name)
char beaninfo_filename[120]; char beaninfo_filename[120];
char *s; char *s;
double x0, x1, y0, y1; double x0, x1, y0, y1;
int trace_type; int trace_type1;
int dyn_action_type; int trace_type2;
int dyn_action_type1;
int dyn_action_type2;
glow_eDrawType trace_color; glow_eDrawType trace_color;
glow_eDrawType trace_color2; glow_eDrawType trace_color2;
char low_bean_name[80]; char low_bean_name[80];
...@@ -80,10 +82,10 @@ int Graph::export_javabean( char *filename, char *bean_name) ...@@ -80,10 +82,10 @@ int Graph::export_javabean( char *filename, char *bean_name)
cdh_ToLower( low_bean_name, bean_name); cdh_ToLower( low_bean_name, bean_name);
grow_GetSubGraphDynType( grow->ctx, &trace_type, &dyn_action_type); grow_GetSubGraphDynType( grow->ctx, &trace_type1, &trace_type2, &dyn_action_type1, &dyn_action_type2);
grow_GetSubGraphTraceColor( grow->ctx, &trace_color, &trace_color2); grow_GetSubGraphTraceColor( grow->ctx, &trace_color, &trace_color2);
if ( grow_IsSlider( grow->ctx)) if ( grow_IsSlider( grow->ctx))
trace_type = graph_eTrace_Slider; trace_type1 = graph_eTrace_Slider;
grow_GetSubgraphAnnotNumbers( grow->ctx, &numbers, &annot_cnt); grow_GetSubgraphAnnotNumbers( grow->ctx, &numbers, &annot_cnt);
...@@ -96,7 +98,7 @@ int Graph::export_javabean( char *filename, char *bean_name) ...@@ -96,7 +98,7 @@ int Graph::export_javabean( char *filename, char *bean_name)
} }
fp.open( fname); fp.open( fname);
switch ( trace_type) switch ( trace_type1)
{ {
case graph_eTrace_SetDig: case graph_eTrace_SetDig:
case graph_eTrace_ResetDig: case graph_eTrace_ResetDig:
...@@ -126,7 +128,7 @@ int Graph::export_javabean( char *filename, char *bean_name) ...@@ -126,7 +128,7 @@ int Graph::export_javabean( char *filename, char *bean_name)
" Dimension size;" << endl << " Dimension size;" << endl <<
" Object root;" << endl << " Object root;" << endl <<
" JopEngine en;" << endl; " JopEngine en;" << endl;
switch ( trace_type) switch ( trace_type1)
{ {
case graph_eTrace_SetDig: case graph_eTrace_SetDig:
case graph_eTrace_SetDigWithTone: case graph_eTrace_SetDigWithTone:
...@@ -282,7 +284,7 @@ endl << ...@@ -282,7 +284,7 @@ endl <<
fp << fp <<
" public Dimension getPreferredSize() { return size;}" << endl << " public Dimension getPreferredSize() { return size;}" << endl <<
" public Dimension getMinimumSize() { return size;}" << endl; " public Dimension getMinimumSize() { return size;}" << endl;
switch ( trace_type) switch ( trace_type1)
{ {
case graph_eTrace_SetDig: case graph_eTrace_SetDig:
case graph_eTrace_ResetDig: case graph_eTrace_ResetDig:
...@@ -376,7 +378,7 @@ endl << ...@@ -376,7 +378,7 @@ endl <<
" }" << endl << " }" << endl <<
" valueTextOld = valueText;" << endl << " valueTextOld = valueText;" << endl <<
" }" << endl; " }" << endl;
switch ( trace_type) switch ( trace_type1)
{ {
case graph_eTrace_SetDig: case graph_eTrace_SetDig:
case graph_eTrace_ResetDig: case graph_eTrace_ResetDig:
...@@ -521,7 +523,7 @@ endl << ...@@ -521,7 +523,7 @@ endl <<
" public Dimension getPreferredSize() { return size;}" << endl << " public Dimension getPreferredSize() { return size;}" << endl <<
" public Dimension getMinimumSize() { return size;}" << endl; " public Dimension getMinimumSize() { return size;}" << endl;
switch ( trace_type) switch ( trace_type1)
{ {
case graph_eTrace_DigWithError: case graph_eTrace_DigWithError:
{ {
...@@ -968,7 +970,7 @@ endl << ...@@ -968,7 +970,7 @@ endl <<
" _rotate.setDisplayName(\"rotate\");" << endl << " _rotate.setDisplayName(\"rotate\");" << endl <<
" _rotate.setShortDescription(\"rotate\");" << endl; " _rotate.setShortDescription(\"rotate\");" << endl;
switch ( trace_type) switch ( trace_type1)
{ {
case graph_eTrace_SetDig: case graph_eTrace_SetDig:
case graph_eTrace_ResetDig: case graph_eTrace_ResetDig:
...@@ -1386,20 +1388,22 @@ int Graph::export_gejava_nodeclass( ofstream& fp, grow_tNodeClass nodeclass) ...@@ -1386,20 +1388,22 @@ int Graph::export_gejava_nodeclass( ofstream& fp, grow_tNodeClass nodeclass)
{ {
char bean_name[40]; char bean_name[40];
double x0, x1, y0, y1; double x0, x1, y0, y1;
int dyn_type; int dyn_type1;
int dyn_action_type; int dyn_type2;
int dyn_action_type1;
int dyn_action_type2;
int pages; int pages;
grow_tObject *objectlist, *object_p; grow_tObject *objectlist, *object_p;
int object_cnt; int object_cnt;
int i; int i;
grow_GetNodeClassJavaName( nodeclass, bean_name); grow_GetNodeClassJavaName( nodeclass, bean_name);
grow_GetNodeClassDynType( nodeclass, &dyn_type, &dyn_action_type); grow_GetNodeClassDynType( nodeclass, &dyn_type1, &dyn_type2, &dyn_action_type1, &dyn_action_type2);
grow_MeasureNodeClassJavaBean( nodeclass, &x1, &x0, &y1, &y0); grow_MeasureNodeClassJavaBean( nodeclass, &x1, &x0, &y1, &y0);
pages = grow_GetNodeClassPages( nodeclass); pages = grow_GetNodeClassPages( nodeclass);
if ( dyn_action_type & ge_mActionType_ValueInput) { if ( dyn_action_type1 & ge_mActionType1_ValueInput) {
glow_eDrawType annot_background = (glow_eDrawType) 31; glow_eDrawType annot_background = (glow_eDrawType) 31;
grow_GetNodeClassAnnotBackground( nodeclass, &annot_background); grow_GetNodeClassAnnotBackground( nodeclass, &annot_background);
...@@ -2034,8 +2038,10 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html) ...@@ -2034,8 +2038,10 @@ int Graph::export_gejava( char *filename, char *bean_name, int applet, int html)
int Graph::export_ObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt) int Graph::export_ObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt)
{ {
int dyn_type; int dyn_type1;
int dyn_action_type; int dyn_type2;
int dyn_action_type1;
int dyn_action_type2;
glow_sTraceData *trace_data; glow_sTraceData *trace_data;
glow_eDrawType trace_color; glow_eDrawType trace_color;
glow_eDrawType trace_color2; glow_eDrawType trace_color2;
...@@ -2055,9 +2061,9 @@ int Graph::export_ObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2055,9 +2061,9 @@ int Graph::export_ObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt)
sprintf( &var_name[strlen(var_name)], "%d", cnt); sprintf( &var_name[strlen(var_name)], "%d", cnt);
// todo // todo
dyn_type = (graph_eTrace) trace_data->attr_type; dyn_type1 = (graph_eTrace) trace_data->attr_type;
if ( dyn_type == graph_eTrace_Inherit) if ( dyn_type1 == graph_eTrace_Inherit)
grow_GetObjectClassDynType( object, &dyn_type, &dyn_action_type); grow_GetObjectClassDynType( object, &dyn_type1, &dyn_type2, &dyn_action_type1, &dyn_action_type2);
trace_color = trace_data->color; trace_color = trace_data->color;
if ( trace_color == glow_eDrawType_Inherit) if ( trace_color == glow_eDrawType_Inherit)
...@@ -2067,10 +2073,10 @@ int Graph::export_ObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2067,10 +2073,10 @@ int Graph::export_ObjectTraceAttr( ofstream& fp, grow_tObject object, int cnt)
grow_GetObjectClassTraceColor( object, &color, &trace_color2); grow_GetObjectClassTraceColor( object, &color, &trace_color2);
// dyn_type No equals Inherit from class // dyn_type No equals Inherit from class
if ( dyn_type == graph_eTrace_No) if ( dyn_type1 == graph_eTrace_No)
dyn_type = graph_eTrace_Inherit; dyn_type1 = graph_eTrace_Inherit;
switch ( dyn_type) switch ( dyn_type1)
{ {
case graph_eTrace_Dig: case graph_eTrace_Dig:
case graph_eTrace_DigWithCommand: case graph_eTrace_DigWithCommand:
...@@ -2207,12 +2213,14 @@ int Graph::export_GejavaObjectTraceAttr( ofstream& fp, grow_tObject object, int ...@@ -2207,12 +2213,14 @@ int Graph::export_GejavaObjectTraceAttr( ofstream& fp, grow_tObject object, int
int *numbers; int *numbers;
char annot_str[200]; char annot_str[200];
GeDyn *dyn; GeDyn *dyn;
int dyn_type; int dyn_type1;
int dyn_action_type; int dyn_type2;
int dyn_action_type1;
int dyn_action_type2;
grow_GetUserData( object, (void **)&dyn); grow_GetUserData( object, (void **)&dyn);
grow_GetObjectClassJavaName( object, class_name); grow_GetObjectClassJavaName( object, class_name);
grow_GetObjectClassDynType( object, &dyn_type, &dyn_action_type); grow_GetObjectClassDynType( object, &dyn_type1, &dyn_type2, &dyn_action_type1, &dyn_action_type2);
strcpy( var_name, class_name); strcpy( var_name, class_name);
var_name[0] = _tolower(var_name[0]); var_name[0] = _tolower(var_name[0]);
...@@ -2229,7 +2237,7 @@ int Graph::export_GejavaObjectTraceAttr( ofstream& fp, grow_tObject object, int ...@@ -2229,7 +2237,7 @@ int Graph::export_GejavaObjectTraceAttr( ofstream& fp, grow_tObject object, int
fp << fp <<
" " << var_name << ".setAnnot" << numbers[i] << "(\"" << annot_str << "\");" << endl; " " << var_name << ".setAnnot" << numbers[i] << "(\"" << annot_str << "\");" << endl;
} }
if ( dyn_action_type & ge_mActionType_ValueInput) { if ( dyn_action_type1 & ge_mActionType1_ValueInput) {
// Set text size of GeTextField // Set text size of GeTextField
double tsize; double tsize;
int sts; int sts;
...@@ -2275,7 +2283,7 @@ int Graph::export_BarTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2275,7 +2283,7 @@ int Graph::export_BarTraceAttr( ofstream& fp, grow_tObject object, int cnt)
sprintf( &var_name[strlen(var_name)], "%d", cnt); sprintf( &var_name[strlen(var_name)], "%d", cnt);
for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) { for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) {
if ( elem->dyn_type == ge_mDynType_Bar) { if ( elem->dyn_type1 == ge_mDynType1_Bar) {
if ( strcmp( ((GeBar *)elem)->attribute, "") != 0) if ( strcmp( ((GeBar *)elem)->attribute, "") != 0)
fp << fp <<
" " << var_name << ".setPwrAttribute(\"" << ((GeBar *)elem)->attribute << "\");" << endl; " " << var_name << ".setPwrAttribute(\"" << ((GeBar *)elem)->attribute << "\");" << endl;
...@@ -2288,9 +2296,9 @@ int Graph::export_BarTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2288,9 +2296,9 @@ int Graph::export_BarTraceAttr( ofstream& fp, grow_tObject object, int cnt)
} }
break; break;
} }
if ( dyn->total_action_type & ~ge_mActionType_Inherit) { if ( dyn->total_action_type1 & ~ge_mActionType1_Inherit) {
fp << fp <<
" " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type << ");" << endl << " " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type1 << ");" << endl <<
" " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl; " " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl;
dyn->export_java( object, fp, var_name); dyn->export_java( object, fp, var_name);
...@@ -2313,7 +2321,7 @@ int Graph::export_TrendTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2313,7 +2321,7 @@ int Graph::export_TrendTraceAttr( ofstream& fp, grow_tObject object, int cnt)
for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) { for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) {
if ( elem->dyn_type == ge_mDynType_Trend) { if ( elem->dyn_type1 == ge_mDynType1_Trend) {
if ( strcmp( ((GeTrend *)elem)->attribute1, "") != 0) if ( strcmp( ((GeTrend *)elem)->attribute1, "") != 0)
fp << fp <<
" " << var_name << ".setPwrAttribute1(\"" << ((GeTrend *)elem)->attribute1 << "\");" << endl; " " << var_name << ".setPwrAttribute1(\"" << ((GeTrend *)elem)->attribute1 << "\");" << endl;
...@@ -2335,9 +2343,9 @@ int Graph::export_TrendTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2335,9 +2343,9 @@ int Graph::export_TrendTraceAttr( ofstream& fp, grow_tObject object, int cnt)
} }
break; break;
} }
if ( dyn->total_action_type & ~ge_mActionType_Inherit) { if ( dyn->total_action_type1 & ~ge_mActionType1_Inherit) {
fp << fp <<
" " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type << ");" << endl << " " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type1 << ");" << endl <<
" " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl; " " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl;
dyn->export_java( object, fp, var_name); dyn->export_java( object, fp, var_name);
...@@ -2359,7 +2367,7 @@ int Graph::export_PieTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2359,7 +2367,7 @@ int Graph::export_PieTraceAttr( ofstream& fp, grow_tObject object, int cnt)
sprintf( &var_name[strlen(var_name)], "%d", cnt); sprintf( &var_name[strlen(var_name)], "%d", cnt);
for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) { for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) {
if ( elem->dyn_type == ge_mDynType_Pie) { if ( elem->dyn_type1 == ge_mDynType1_Pie) {
fp << fp <<
" " << var_name << ".setPwrAttribute(new String[]{"; " " << var_name << ".setPwrAttribute(new String[]{";
...@@ -2376,9 +2384,9 @@ int Graph::export_PieTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2376,9 +2384,9 @@ int Graph::export_PieTraceAttr( ofstream& fp, grow_tObject object, int cnt)
} }
break; break;
} }
if ( dyn->total_action_type & ~ge_mActionType_Inherit) { if ( dyn->total_action_type1 & ~ge_mActionType1_Inherit) {
fp << fp <<
" " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type << ");" << endl << " " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type1 << ");" << endl <<
" " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl; " " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl;
dyn->export_java( object, fp, var_name); dyn->export_java( object, fp, var_name);
...@@ -2400,7 +2408,7 @@ int Graph::export_BarChartTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2400,7 +2408,7 @@ int Graph::export_BarChartTraceAttr( ofstream& fp, grow_tObject object, int cnt)
sprintf( &var_name[strlen(var_name)], "%d", cnt); sprintf( &var_name[strlen(var_name)], "%d", cnt);
for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) { for ( GeDynElem *elem = dyn->elements; elem; elem = elem->next) {
if ( elem->dyn_type == ge_mDynType_BarChart) { if ( elem->dyn_type1 == ge_mDynType1_BarChart) {
fp << fp <<
" " << var_name << ".setPwrAttribute(new String[]{"; " " << var_name << ".setPwrAttribute(new String[]{";
...@@ -2416,9 +2424,9 @@ int Graph::export_BarChartTraceAttr( ofstream& fp, grow_tObject object, int cnt) ...@@ -2416,9 +2424,9 @@ int Graph::export_BarChartTraceAttr( ofstream& fp, grow_tObject object, int cnt)
} }
break; break;
} }
if ( dyn->total_action_type & ~ge_mActionType_Inherit) { if ( dyn->total_action_type1 & ~ge_mActionType1_Inherit) {
fp << fp <<
" " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type << ");" << endl << " " << var_name << ".dd.setActionType(" << (int)dyn->total_action_type1 << ");" << endl <<
" " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl; " " << var_name << ".dd.setAccess(" << (int)dyn->access << ");" << endl;
dyn->export_java( object, fp, var_name); dyn->export_java( object, fp, var_name);
......
...@@ -1315,7 +1315,7 @@ static int graph_object_collect_build( Graph *graph, pwr_sAttrRef *attrref) ...@@ -1315,7 +1315,7 @@ static int graph_object_collect_build( Graph *graph, pwr_sAttrRef *attrref)
dyn = new GeDyn( graph); dyn = new GeDyn( graph);
grow_SetUserData( scantime_button, (void *)dyn); grow_SetUserData( scantime_button, (void *)dyn);
dyn->set_dyn( ge_mDynType_Value, ge_mActionType_ValueInput); dyn->set_dyn( ge_mDynType1_Value, ge_mDynType2_No, ge_mActionType1_ValueInput, ge_mActionType2_No);
dyn->update_elements(); dyn->update_elements();
dyn->set_access( (glow_mAccess) 65535); dyn->set_access( (glow_mAccess) 65535);
dyn->set_attribute( scantime_button, "$local.ScanTime##Float32", 0); dyn->set_attribute( scantime_button, "$local.ScanTime##Float32", 0);
...@@ -1336,7 +1336,7 @@ static int graph_object_collect_build( Graph *graph, pwr_sAttrRef *attrref) ...@@ -1336,7 +1336,7 @@ static int graph_object_collect_build( Graph *graph, pwr_sAttrRef *attrref)
grow_SetSelectOrigColorTone( graph->grow->ctx, glow_eDrawTone_Gray); grow_SetSelectOrigColorTone( graph->grow->ctx, glow_eDrawTone_Gray);
grow_SelectRemove( graph->grow->ctx, hold_button); grow_SelectRemove( graph->grow->ctx, hold_button);
dyn->set_dyn( ge_mDynType_No, ge_mActionType_SetDig); dyn->set_dyn( ge_mDynType1_No, ge_mDynType2_No, ge_mActionType1_SetDig, ge_mActionType2_No);
dyn->update_elements(); dyn->update_elements();
dyn->set_access( (glow_mAccess) 65535); dyn->set_access( (glow_mAccess) 65535);
dyn->set_attribute( hold_button, "$local.TrendHold##Boolean", 0); dyn->set_attribute( hold_button, "$local.TrendHold##Boolean", 0);
...@@ -1373,7 +1373,7 @@ static int graph_object_collect_build( Graph *graph, pwr_sAttrRef *attrref) ...@@ -1373,7 +1373,7 @@ static int graph_object_collect_build( Graph *graph, pwr_sAttrRef *attrref)
glow_eDrawType_Color40, NULL, glow_eDrawType_Color40, NULL,
&od->trend_objects[od->trend_cnt]); &od->trend_objects[od->trend_cnt]);
dyn = new GeDyn( graph); dyn = new GeDyn( graph);
dyn->dyn_type = ge_mDynType_Trend; dyn->dyn_type1 = ge_mDynType1_Trend;
dyn->update_elements(); dyn->update_elements();
grow_SetUserData( od->trend_objects[od->trend_cnt], (void *)dyn); grow_SetUserData( od->trend_objects[od->trend_cnt], (void *)dyn);
......
...@@ -672,10 +672,12 @@ int SubGraphs::edit_attributes( void *object) ...@@ -672,10 +672,12 @@ int SubGraphs::edit_attributes( void *object)
Attr *attr; Attr *attr;
subgraphs_tAttr attrlist_p; subgraphs_tAttr attrlist_p;
int trace_type; int trace_type;
int dyn_action_type; int dyn_type2;
int dyn_action_type1;
int dyn_action_type2;
grow_GetObjectAttrInfo( (grow_tObject)object, NULL, &grow_info, &grow_info_cnt); grow_GetObjectAttrInfo( (grow_tObject)object, NULL, &grow_info, &grow_info_cnt);
grow_GetNodeClassDynType( object, &trace_type, &dyn_action_type); grow_GetNodeClassDynType( object, &trace_type, &dyn_type2, &dyn_action_type1, &dyn_action_type2);
grow_info_p = grow_info; grow_info_p = grow_info;
for ( i = 0; i < grow_info_cnt; i++) for ( i = 0; i < grow_info_cnt; i++)
......
...@@ -21,7 +21,9 @@ menu Analog ...@@ -21,7 +21,9 @@ menu Analog
subgraph XYCurve pwr_xycurve.component 25 subgraph XYCurve pwr_xycurve.component 25
subgraph Bar pwr_bar.component 26 subgraph Bar pwr_bar.component 26
subgraph Axis pwr_axis.component 27 subgraph Axis pwr_axis.component 27
subgraph DynamicAxis pwr_dynamicaxis.component 27
subgraph AxisArc pwr_axisarc.component 250 subgraph AxisArc pwr_axisarc.component 250
subgraph DynamicAxisArc pwr_dynamicaxisarc.component 250
subgraph Pie pwr_pie.component 6 subgraph Pie pwr_pie.component 6
subgraph BarChart pwr_barchart.component 25 subgraph BarChart pwr_barchart.component 25
} }
......
...@@ -82,8 +82,8 @@ typedef enum { ...@@ -82,8 +82,8 @@ typedef enum {
glow_eType_Int, //!< Type is an integer glow_eType_Int, //!< Type is an integer
glow_eType_Double, //!< Type is a double glow_eType_Double, //!< Type is a double
glow_eType_String, //!< Type is a string glow_eType_String, //!< Type is a string
glow_eType_DynType, //!< Type of dynamics glow_eType_DynType1, //!< Type of dynamics mask 1
glow_eType_ActionType, //!< Type of action glow_eType_ActionType1, //!< Type of action mask 1
glow_eType_Direction, //!< Type is glow_eDirection glow_eType_Direction, //!< Type is glow_eDirection
glow_eType_Color, //!< Type is a drawtype (glow_eDrawType) glow_eType_Color, //!< Type is a drawtype (glow_eDrawType)
glow_eType_Tone, //!< Type is a colortone ( glow_eDrawTone) glow_eType_Tone, //!< Type is a colortone ( glow_eDrawTone)
...@@ -99,7 +99,9 @@ typedef enum { ...@@ -99,7 +99,9 @@ typedef enum {
glow_eType_Font, //!< Type is glow_eFont glow_eType_Font, //!< Type is glow_eFont
glow_eType_Gradient, //!< Type is glow_eGradient glow_eType_Gradient, //!< Type is glow_eGradient
glow_eType_HotIndication, //!< Type is glow_eHotIndication glow_eType_HotIndication, //!< Type is glow_eHotIndication
glow_eType_AnnotType //!< Type is glow_eAnnotType glow_eType_AnnotType, //!< Type is glow_eAnnotType
glow_eType_DynType2, //!< Type of dynamics mask 2
glow_eType_ActionType2 //!< Type of action mask 2
} glow_eType; } glow_eType;
//! Type of Ctx class //! Type of Ctx class
...@@ -1130,7 +1132,7 @@ typedef enum { ...@@ -1130,7 +1132,7 @@ typedef enum {
glow_eSave_NodeClass_arg_cnt = 305, glow_eSave_NodeClass_arg_cnt = 305,
glow_eSave_NodeClass_argname = 306, glow_eSave_NodeClass_argname = 306,
glow_eSave_NodeClass_argtype = 307, glow_eSave_NodeClass_argtype = 307,
glow_eSave_NodeClass_dyn_type = 308, glow_eSave_NodeClass_dyn_type1 = 308,
glow_eSave_NodeClass_dyn_color1 = 309, glow_eSave_NodeClass_dyn_color1 = 309,
glow_eSave_NodeClass_no_con_obstacle = 310, glow_eSave_NodeClass_no_con_obstacle = 310,
glow_eSave_NodeClass_slider = 311, glow_eSave_NodeClass_slider = 311,
...@@ -1143,7 +1145,7 @@ typedef enum { ...@@ -1143,7 +1145,7 @@ typedef enum {
glow_eSave_NodeClass_y1 = 318, glow_eSave_NodeClass_y1 = 318,
glow_eSave_NodeClass_x0 = 319, glow_eSave_NodeClass_x0 = 319,
glow_eSave_NodeClass_x1 = 320, glow_eSave_NodeClass_x1 = 320,
glow_eSave_NodeClass_dyn_action_type = 321, glow_eSave_NodeClass_dyn_action_type1 = 321,
glow_eSave_NodeClass_dyn_color3 = 322, glow_eSave_NodeClass_dyn_color3 = 322,
glow_eSave_NodeClass_dyn_color4 = 323, glow_eSave_NodeClass_dyn_color4 = 323,
glow_eSave_NodeClass_dyn_attr1 = 324, glow_eSave_NodeClass_dyn_attr1 = 324,
...@@ -1152,6 +1154,8 @@ typedef enum { ...@@ -1152,6 +1154,8 @@ typedef enum {
glow_eSave_NodeClass_dyn_attr4 = 327, glow_eSave_NodeClass_dyn_attr4 = 327,
glow_eSave_NodeClass_input_focus_mark = 328, glow_eSave_NodeClass_input_focus_mark = 328,
glow_eSave_NodeClass_userdata_cb = 329, glow_eSave_NodeClass_userdata_cb = 329,
glow_eSave_NodeClass_dyn_type2 = 330,
glow_eSave_NodeClass_dyn_action_type2 = 331,
glow_eSave_ConClass_cc_name = 400, glow_eSave_ConClass_cc_name = 400,
glow_eSave_ConClass_con_type = 401, glow_eSave_ConClass_con_type = 401,
glow_eSave_ConClass_corner = 402, glow_eSave_ConClass_corner = 402,
...@@ -1324,7 +1328,7 @@ typedef enum { ...@@ -1324,7 +1328,7 @@ typedef enum {
glow_eSave_GrowCtx_y1 = 2212, glow_eSave_GrowCtx_y1 = 2212,
glow_eSave_GrowCtx_path_cnt = 2213, glow_eSave_GrowCtx_path_cnt = 2213,
glow_eSave_GrowCtx_path = 2214, glow_eSave_GrowCtx_path = 2214,
glow_eSave_GrowCtx_dyn_type = 2215, glow_eSave_GrowCtx_dyn_type1 = 2215,
glow_eSave_GrowCtx_dyn_color1 = 2216, glow_eSave_GrowCtx_dyn_color1 = 2216,
glow_eSave_GrowCtx_no_con_obstacle = 2217, glow_eSave_GrowCtx_no_con_obstacle = 2217,
glow_eSave_GrowCtx_slider = 2218, glow_eSave_GrowCtx_slider = 2218,
...@@ -1345,7 +1349,7 @@ typedef enum { ...@@ -1345,7 +1349,7 @@ typedef enum {
glow_eSave_GrowCtx_cycle = 2233, glow_eSave_GrowCtx_cycle = 2233,
glow_eSave_GrowCtx_mb3_action = 2234, glow_eSave_GrowCtx_mb3_action = 2234,
glow_eSave_GrowCtx_translate_on = 2235, glow_eSave_GrowCtx_translate_on = 2235,
glow_eSave_GrowCtx_dyn_action_type = 2236, glow_eSave_GrowCtx_dyn_action_type1 = 2236,
glow_eSave_GrowCtx_dyn_color3 = 2237, glow_eSave_GrowCtx_dyn_color3 = 2237,
glow_eSave_GrowCtx_dyn_color4 = 2238, glow_eSave_GrowCtx_dyn_color4 = 2238,
glow_eSave_GrowCtx_dyn_attr1 = 2239, glow_eSave_GrowCtx_dyn_attr1 = 2239,
...@@ -1355,6 +1359,8 @@ typedef enum { ...@@ -1355,6 +1359,8 @@ typedef enum {
glow_eSave_GrowCtx_input_focus_mark = 2243, glow_eSave_GrowCtx_input_focus_mark = 2243,
glow_eSave_GrowCtx_userdata_cb = 2244, glow_eSave_GrowCtx_userdata_cb = 2244,
glow_eSave_GrowCtx_bitmap_fonts = 2245, glow_eSave_GrowCtx_bitmap_fonts = 2245,
glow_eSave_GrowCtx_dyn_type2 = 2246,
glow_eSave_GrowCtx_dyn_action_type2 = 2247,
glow_eSave_GrowSubAnnot_x_right = 2300, glow_eSave_GrowSubAnnot_x_right = 2300,
glow_eSave_GrowSubAnnot_x_left = 2301, glow_eSave_GrowSubAnnot_x_left = 2301,
glow_eSave_GrowSubAnnot_y_high = 2302, glow_eSave_GrowSubAnnot_y_high = 2302,
...@@ -1567,6 +1573,7 @@ typedef enum { ...@@ -1567,6 +1573,7 @@ typedef enum {
glow_eSave_GrowAxis_text_size = 3707, glow_eSave_GrowAxis_text_size = 3707,
glow_eSave_GrowAxis_text_drawtype = 3708, glow_eSave_GrowAxis_text_drawtype = 3708,
glow_eSave_GrowAxis_text_color_drawtype = 3709, glow_eSave_GrowAxis_text_color_drawtype = 3709,
glow_eSave_GrowAxis_userdata_cb = 3710,
glow_eSave_GrowRectRounded_x_right = 3800, glow_eSave_GrowRectRounded_x_right = 3800,
glow_eSave_GrowRectRounded_x_left = 3801, glow_eSave_GrowRectRounded_x_left = 3801,
glow_eSave_GrowRectRounded_y_high = 3802, glow_eSave_GrowRectRounded_y_high = 3802,
...@@ -1758,6 +1765,7 @@ typedef enum { ...@@ -1758,6 +1765,7 @@ typedef enum {
glow_eSave_GrowAxisArc_text_size = 4408, glow_eSave_GrowAxisArc_text_size = 4408,
glow_eSave_GrowAxisArc_text_drawtype = 4409, glow_eSave_GrowAxisArc_text_drawtype = 4409,
glow_eSave_GrowAxisArc_text_color_drawtype = 4410, glow_eSave_GrowAxisArc_text_color_drawtype = 4410,
glow_eSave_GrowAxisArc_userdata_cb = 4411,
glow_eSave_GrowPie_arc_part = 4500, glow_eSave_GrowPie_arc_part = 4500,
glow_eSave_GrowPie_sectors = 4501, glow_eSave_GrowPie_sectors = 4501,
glow_eSave_GrowPie_min_value = 4502, glow_eSave_GrowPie_min_value = 4502,
......
...@@ -2954,15 +2954,20 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab, ...@@ -2954,15 +2954,20 @@ int grow_GetObjectAttrInfo( grow_tObject object, char *transtab,
attrinfo[i].type = glow_eType_Int; attrinfo[i].type = glow_eType_Int;
attrinfo[i++].size = sizeof( op->dyn_attr[0]); attrinfo[i++].size = sizeof( op->dyn_attr[0]);
strcpy( attrinfo[i].name, "DynType"); strcpy( attrinfo[i].name, "DynType1");
attrinfo[i].value_p = &op->dyn_type; attrinfo[i].value_p = &op->dyn_type1;
attrinfo[i].type = glow_eType_DynType; attrinfo[i].type = glow_eType_DynType1;
attrinfo[i++].size = sizeof( op->dyn_type); attrinfo[i++].size = sizeof( op->dyn_type1);
strcpy( attrinfo[i].name, "Action"); strcpy( attrinfo[i].name, "DynType2");
attrinfo[i].value_p = &op->dyn_action_type; attrinfo[i].value_p = &op->dyn_type2;
attrinfo[i].type = glow_eType_ActionType; attrinfo[i].type = glow_eType_DynType2;
attrinfo[i++].size = sizeof( op->dyn_action_type); attrinfo[i++].size = sizeof( op->dyn_type2);
strcpy( attrinfo[i].name, "Action1");
attrinfo[i].value_p = &op->dyn_action_type1;
attrinfo[i].type = glow_eType_ActionType1;
attrinfo[i++].size = sizeof( op->dyn_action_type1);
strcpy( attrinfo[i].name, "Cycle"); strcpy( attrinfo[i].name, "Cycle");
attrinfo[i].value_p = &op->cycle; attrinfo[i].value_p = &op->cycle;
...@@ -3000,17 +3005,23 @@ int grow_GetSubGraphAttrInfo( grow_tCtx ctx, char *transtab, grow_sAttrInfo **in ...@@ -3000,17 +3005,23 @@ int grow_GetSubGraphAttrInfo( grow_tCtx ctx, char *transtab, grow_sAttrInfo **in
i = 0; i = 0;
if ( (name = growapi_translate( transtab, "DynType"))) { if ( (name = growapi_translate( transtab, "DynType1"))) {
strcpy( attrinfo[i].name, name);
attrinfo[i].value_p = &ctx->dyn_type1;
attrinfo[i].type = glow_eType_DynType1;
attrinfo[i++].size = sizeof( ctx->dyn_type1);
}
if ( (name = growapi_translate( transtab, "DynType2"))) {
strcpy( attrinfo[i].name, name); strcpy( attrinfo[i].name, name);
attrinfo[i].value_p = &ctx->dyn_type; attrinfo[i].value_p = &ctx->dyn_type2;
attrinfo[i].type = glow_eType_DynType; attrinfo[i].type = glow_eType_DynType2;
attrinfo[i++].size = sizeof( ctx->dyn_type); attrinfo[i++].size = sizeof( ctx->dyn_type2);
} }
if ( (name = growapi_translate( transtab, "DynActionType"))) { if ( (name = growapi_translate( transtab, "DynActionType1"))) {
strcpy( attrinfo[i].name, name); strcpy( attrinfo[i].name, name);
attrinfo[i].value_p = &ctx->dyn_action_type; attrinfo[i].value_p = &ctx->dyn_action_type1;
attrinfo[i].type = glow_eType_ActionType; attrinfo[i].type = glow_eType_ActionType1;
attrinfo[i++].size = sizeof( ctx->dyn_action_type); attrinfo[i++].size = sizeof( ctx->dyn_action_type1);
} }
if ( (name = growapi_translate( transtab, "DynColor1"))) { if ( (name = growapi_translate( transtab, "DynColor1"))) {
strcpy( attrinfo[i].name, name); strcpy( attrinfo[i].name, name);
...@@ -4218,20 +4229,24 @@ void grow_SetPath( grow_tCtx ctx, int path_cnt, const char *path) ...@@ -4218,20 +4229,24 @@ void grow_SetPath( grow_tCtx ctx, int path_cnt, const char *path)
ctx->set_path( path_cnt, path); ctx->set_path( path_cnt, path);
} }
void grow_GetObjectClassDynType( grow_tObject object, int *dyn_type, void grow_GetObjectClassDynType( grow_tObject object, int *dyn_type1, int *dyn_type2,
int *dyn_action_type) int *dyn_action_type1, int *dyn_action_type2)
{ {
if ( ((GlowArrayElem *)object)->type() == glow_eObjectType_GrowNode || if ( ((GlowArrayElem *)object)->type() == glow_eObjectType_GrowNode ||
((GlowArrayElem *)object)->type() == glow_eObjectType_GrowSlider || ((GlowArrayElem *)object)->type() == glow_eObjectType_GrowSlider ||
((GlowArrayElem *)object)->type() == glow_eObjectType_GrowGroup) { ((GlowArrayElem *)object)->type() == glow_eObjectType_GrowGroup) {
GlowNodeClass *base_nc = ((GrowNode *)object)->nc->get_base_nc(); GlowNodeClass *base_nc = ((GrowNode *)object)->nc->get_base_nc();
*dyn_type = base_nc->dyn_type; *dyn_type1 = base_nc->dyn_type1;
*dyn_action_type = base_nc->dyn_action_type; *dyn_type2 = base_nc->dyn_type2;
*dyn_action_type1 = base_nc->dyn_action_type1;
*dyn_action_type2 = base_nc->dyn_action_type2;
} }
else { else {
*dyn_type = 0; *dyn_type1 = 0;
*dyn_action_type = 0; *dyn_type2 = 0;
*dyn_action_type1 = 0;
*dyn_action_type2 = 0;
} }
} }
...@@ -4241,12 +4256,14 @@ void grow_GetObjectClassCycle( grow_tObject object, glow_eCycle *cycle) ...@@ -4241,12 +4256,14 @@ void grow_GetObjectClassCycle( grow_tObject object, glow_eCycle *cycle)
*cycle = base_nc->cycle; *cycle = base_nc->cycle;
} }
void grow_GetNodeClassDynType( grow_tNodeClass nodeclass, int *dyn_type, void grow_GetNodeClassDynType( grow_tNodeClass nodeclass, int *dyn_type1, int *dyn_type2,
int *dyn_action_type) int *dyn_action_type1, int *dyn_action_type2)
{ {
GlowNodeClass *base_nc = ((GlowNodeClass *)nodeclass)->get_base_nc(); GlowNodeClass *base_nc = ((GlowNodeClass *)nodeclass)->get_base_nc();
*dyn_type = base_nc->dyn_type; *dyn_type1 = base_nc->dyn_type1;
*dyn_action_type = base_nc->dyn_action_type; *dyn_type2 = base_nc->dyn_type2;
*dyn_action_type1 = base_nc->dyn_action_type1;
*dyn_action_type2 = base_nc->dyn_action_type2;
} }
void grow_GetObjectClassUserData( grow_tObject object, void **user_data) void grow_GetObjectClassUserData( grow_tObject object, void **user_data)
...@@ -4255,10 +4272,12 @@ void grow_GetObjectClassUserData( grow_tObject object, void **user_data) ...@@ -4255,10 +4272,12 @@ void grow_GetObjectClassUserData( grow_tObject object, void **user_data)
base_nc->get_user_data( user_data); base_nc->get_user_data( user_data);
} }
void grow_GetSubGraphDynType( grow_tCtx ctx, int *dyn_type, int *dyn_action_type) void grow_GetSubGraphDynType( grow_tCtx ctx, int *dyn_type1, int *dyn_type2, int *dyn_action_type1, int *dyn_action_type2)
{ {
*dyn_type = ctx->dyn_type; *dyn_type1 = ctx->dyn_type1;
*dyn_action_type = ctx->dyn_action_type; *dyn_type2 = ctx->dyn_type2;
*dyn_action_type1 = ctx->dyn_action_type1;
*dyn_action_type2 = ctx->dyn_action_type2;
} }
void grow_GetSubGraphTraceColor( grow_tCtx ctx, glow_eDrawType *color, void grow_GetSubGraphTraceColor( grow_tCtx ctx, glow_eDrawType *color,
...@@ -4558,6 +4577,14 @@ void grow_SetAxisConf( grow_tObject object, double max_val, double min_val, ...@@ -4558,6 +4577,14 @@ void grow_SetAxisConf( grow_tObject object, double max_val, double min_val,
long_quot, value_quot, rot, format); long_quot, value_quot, rot, format);
} }
void grow_SetAxisRange( grow_tObject object, double minval, double maxval)
{
if ( ((GlowArrayElem *)object)->type() == glow_eObjectType_GrowAxis)
((GrowAxis *)object)->set_range( minval, maxval);
else if ( ((GlowArrayElem *)object)->type() == glow_eObjectType_GrowAxisArc)
((GrowAxisArc *)object)->set_range( minval, maxval);
}
void grow_SetModified( grow_tCtx ctx, int modified) void grow_SetModified( grow_tCtx ctx, int modified)
{ {
ctx->set_modified( modified); ctx->set_modified( modified);
......
...@@ -1892,10 +1892,13 @@ extern "C" { ...@@ -1892,10 +1892,13 @@ extern "C" {
//! Get dyntype and actiontype for the nodeclass of an object. //! Get dyntype and actiontype for the nodeclass of an object.
/*! /*!
\param object Object. \param object Object.
\param dyn_type Dyntype of the object's nodeclass. \param dyn_type1 Dyntype of the object's nodeclass mask 1.
\param dyn_action_type Actiontype of the object's nodeclass. \param dyn_type2 Dyntype of the object's nodeclass mask 2.
\param dyn_action_type1 Actiontype of the object's nodeclass mask 1.
\param dyn_action_type2 Actiontype of the object's nodeclass mask 2.
*/ */
void grow_GetObjectClassDynType( grow_tObject object, int *dyn_type, int *dyn_action_type); void grow_GetObjectClassDynType( grow_tObject object, int *dyn_type1, int *dyn_type2,
int *dyn_action_type1, int *dyn_action_type2);
//! Get cycle for the nodeclass of an object. //! Get cycle for the nodeclass of an object.
/*! /*!
...@@ -1914,18 +1917,23 @@ extern "C" { ...@@ -1914,18 +1917,23 @@ extern "C" {
//! Get nodeclass dyntype and actiontype. //! Get nodeclass dyntype and actiontype.
/*! /*!
\param nodeclass Nodeclass. \param nodeclass Nodeclass.
\param dyn_type Dyntype of the nodeclass. \param dyn_type1 Dyntype of the nodeclass mask 1.
\param dyn_action_type Actiontype of the nodeclass. \param dyn_type2 Dyntype of the nodeclass mask 2.
\param dyn_action_type1 Actiontype of the nodeclass mask 1.
\param dyn_action_type2 Actiontype of the nodeclass mask 2.
*/ */
void grow_GetNodeClassDynType( grow_tNodeClass nodeclass, int *dyn_type, int *dyn_action_type); void grow_GetNodeClassDynType( grow_tNodeClass nodeclass, int *dyn_type1, int *dyn_type2,
int *dyn_action_type1, int *dyn_action_type2);
//! Get the dyntype and actiontype of a grow subgraph context. //! Get the dyntype and actiontype of a grow subgraph context.
/*! /*!
\param ctx Grow subgraph context. \param ctx Grow subgraph context.
\param dyn_type Dyntype of the subgraph context. \param dyn_type1 Dyntype of the subgraph context.
\param dyn_action_type Actiontype of the subgraph context. \param dyn_type2 Dyntype of the subgraph context.
\param dyn_action_type1 Actiontype of the subgraph context.
\param dyn_action_type2 Actiontype of the subgraph context.
*/ */
void grow_GetSubGraphDynType( grow_tCtx ctx, int *dyn_type, int *dyn_action_type); void grow_GetSubGraphDynType( grow_tCtx ctx, int *dyn_type1, int *dyn_type2, int *dyn_action_type1, int *dyn_action_type2);
//! Get the dynamic colors of a grow subgraph context. //! Get the dynamic colors of a grow subgraph context.
/*! /*!
...@@ -2322,6 +2330,9 @@ extern "C" { ...@@ -2322,6 +2330,9 @@ extern "C" {
int no_of_lines, int long_quot, int value_quot, double rot, int no_of_lines, int long_quot, int value_quot, double rot,
const char *format); const char *format);
void grow_SetAxisRange( grow_tObject object, double minval, double maxval);
//! Set that graph is modified or not since last save. //! Set that graph is modified or not since last save.
/*! /*!
\param ctx Grow context. \param ctx Grow context.
......
...@@ -52,6 +52,15 @@ ...@@ -52,6 +52,15 @@
# define nearbyint rint # define nearbyint rint
#endif #endif
typedef struct {
int lines;
int longq;
int vvalq;
int hvalq;
char format[10];
} sRange;
GrowAxis::GrowAxis( GrowCtx *glow_ctx, const char *name, double x1, double y1, GrowAxis::GrowAxis( GrowCtx *glow_ctx, const char *name, double x1, double y1,
double x2, double y2, glow_eDrawType border_d_type, double x2, double y2, glow_eDrawType border_d_type,
int line_w, int t_size, glow_eDrawType t_drawtype, int line_w, int t_size, glow_eDrawType t_drawtype,
...@@ -104,6 +113,10 @@ void GrowAxis::save( ofstream& fp, glow_eSaveMode mode) ...@@ -104,6 +113,10 @@ void GrowAxis::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowAxis_text_size) << FSPACE << text_size << endl; fp << int(glow_eSave_GrowAxis_text_size) << FSPACE << text_size << endl;
fp << int(glow_eSave_GrowAxis_text_drawtype) << FSPACE << int(text_drawtype) << endl; fp << int(glow_eSave_GrowAxis_text_drawtype) << FSPACE << int(text_drawtype) << endl;
fp << int(glow_eSave_GrowAxis_text_color_drawtype) << FSPACE << int(text_color_drawtype) << endl; fp << int(glow_eSave_GrowAxis_text_color_drawtype) << FSPACE << int(text_color_drawtype) << endl;
if ( user_data && ctx->userdata_save_callback) {
fp << int(glow_eSave_GrowAxis_userdata_cb) << endl;
(ctx->userdata_save_callback)(&fp, this, glow_eUserdataCbType_Node);
}
fp << int(glow_eSave_End) << endl; fp << int(glow_eSave_End) << endl;
} }
...@@ -140,6 +153,10 @@ void GrowAxis::open( ifstream& fp) ...@@ -140,6 +153,10 @@ void GrowAxis::open( ifstream& fp)
case glow_eSave_GrowAxis_text_size: fp >> text_size; break; case glow_eSave_GrowAxis_text_size: fp >> text_size; break;
case glow_eSave_GrowAxis_text_drawtype: fp >> tmp; text_drawtype = (glow_eDrawType)tmp; break; case glow_eSave_GrowAxis_text_drawtype: fp >> tmp; text_drawtype = (glow_eDrawType)tmp; break;
case glow_eSave_GrowAxis_text_color_drawtype: fp >> tmp; text_color_drawtype = (glow_eDrawType)tmp; break; case glow_eSave_GrowAxis_text_color_drawtype: fp >> tmp; text_color_drawtype = (glow_eDrawType)tmp; break;
case glow_eSave_GrowAxis_userdata_cb:
if ( ctx->userdata_open_callback)
(ctx->userdata_open_callback)(&fp, this, glow_eUserdataCbType_Node);
break;
case glow_eSave_End: end_found = 1; break; case glow_eSave_End: end_found = 1; break;
default: default:
cout << "GrowAxis:open syntax error" << endl; cout << "GrowAxis:open syntax error" << endl;
...@@ -501,6 +518,7 @@ void GrowAxis::erase( GlowWind *w, GlowTransform *t, int hot, void *node) ...@@ -501,6 +518,7 @@ void GrowAxis::erase( GlowWind *w, GlowTransform *t, int hot, void *node)
return; return;
hot = 0; hot = 0;
} }
int hotw = 2;
int x1, y1, x2, y2, ll_x, ll_y, ur_x, ur_y; int x1, y1, x2, y2, ll_x, ll_y, ur_x, ur_y;
if (!t) { if (!t) {
...@@ -516,10 +534,10 @@ void GrowAxis::erase( GlowWind *w, GlowTransform *t, int hot, void *node) ...@@ -516,10 +534,10 @@ void GrowAxis::erase( GlowWind *w, GlowTransform *t, int hot, void *node)
y2 = int( trf.y( t, ur.x, ur.y) * w->zoom_factor_y) - w->offset_y; y2 = int( trf.y( t, ur.x, ur.y) * w->zoom_factor_y) - w->offset_y;
} }
ll_x = min( x1, x2); ll_x = min( x1, x2) - hotw;
ur_x = max( x1, x2); ur_x = max( x1, x2) + hotw;
ll_y = min( y1, y2); ll_y = min( y1, y2) - hotw;
ur_y = max( y1, y2); ur_y = max( y1, y2) + hotw;
w->set_draw_buffer_only(); w->set_draw_buffer_only();
ctx->gdraw->fill_rect( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, glow_eDrawType_LineErase); ctx->gdraw->fill_rect( w, ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, glow_eDrawType_LineErase);
...@@ -611,11 +629,154 @@ void GrowAxis::set_textbold( int bold) ...@@ -611,11 +629,154 @@ void GrowAxis::set_textbold( int bold)
draw(); draw();
} }
void GrowAxis::set_range( double min, double max) void GrowAxis::set_range( double minval, double maxval)
{ {
max_value = max; static sRange rdata[2][25] = {
min_value = min; {{ 26, 5, 5, 10, "%3.1f"}, // 1
{ 21, 5, 5, 10, "%3.1f"}, // 2
{ 31, 5, 10, 10, "%3.1f"}, // 3
{ 41, 5, 10, 20, "%3.1f"}, // 4
{ 26, 5, 5, 10, "%1.0f"}, // 5
{ 31, 5, 10, 10, "%1.0f"}, // 6
{ 36, 5, 10, 10, "%1.0f"}, // 7
{ 17, 2, 4, 4, "%1.0f"}, // 8
{ 19, 2, 4, 4, "%1.0f"}, // 9
{ 21, 2, 4, 8, "%2.0f"}, // 10
{ 23, 2, 4, 8, "%2.0f"}, // 11
{ 13, 4, 4, 4, "%2.0f"}, // 12
{ 14, 4, 4, 4, "%2.0f"}, // 13
{ 15, 4, 4, 4, "%2.0f"}, // 14
{ 16, 5, 5, 5, "%2.0f"}, // 15
{ 17, 5, 5, 5, "%2.0f"}, // 16
{ 18, 5, 5, 5, "%2.0f"}, // 17
{ 19, 5, 5, 5, "%2.0f"}, // 18
{ 20, 5, 5, 5, "%2.0f"}, // 19
{ 21, 5, 5, 5, "%2.0f"}, // 20
{ 22, 5, 5, 5, "%2.0f"}, // 21
{ 23, 5, 5, 5, "%2.0f"}, // 22
{ 24, 5, 5, 5, "%2.0f"}, // 23
{ 25, 5, 5, 5, "%2.0f"}, // 24
{ 26, 5, 5, 10, "%2.0f"}},// 25
{{ 101, 5, 10, 20, "%3.1f"}, // 1
{ 101, 5, 10, 20, "%3.1f"}, // 2
{ 61, 10, 10, 20, "%3.1f"}, // 3
{ 81, 10, 10, 20, "%3.1f"}, // 4
{ 101, 10, 20, 20, "%1.0f"}, // 5
{ 61, 5, 10, 20, "%1.0f"}, // 6
{ 71, 5, 10, 20, "%1.0f"}, // 7
{ 81, 5, 10, 20, "%1.0f"}, // 8
{ 91, 5, 10, 20, "%1.0f"}, // 9
{ 101, 5, 10, 20, "%2.0f"}, // 10
{ 56, 5, 5, 5, "%2.0f"}, // 11
{ 61, 5, 10, 10, "%2.0f"}, // 12
{ 66, 5, 10, 20, "%2.0f"}, // 13
{ 71, 5, 10, 20, "%2.0f"}, // 14
{ 76, 5, 10, 20, "%2.0f"}, // 15
{ 81, 5, 10, 20, "%2.0f"}, // 16
{ 86, 5, 10, 20, "%2.0f"}, // 17
{ 91, 5, 10, 20, "%2.0f"}, // 18
{ 96, 5, 10, 20, "%2.0f"}, // 19
{ 101, 5, 10, 25, "%2.0f"}, // 20
{ 43, 2, 6, 6, "%2.0f"}, // 21
{ 45, 2, 4, 8, "%2.0f"}, // 22
{ 47, 2, 4, 8, "%2.0f"}, // 23
{ 49, 2, 4, 8, "%2.0f"}, // 24
{ 26, 5, 5, 5, "%2.0f"}}}; // 25
erase( &ctx->mw);
erase( &ctx->navw);
max_value = maxval;
min_value = minval;
GlowWind *w = &ctx->mw;
// double tsize = w->zoom_factor_y / w->base_zoom_factor * (8+2*text_size);
int x1 = int( trf.x( ll.x, ll.y) * w->zoom_factor_x) - w->offset_x;
int y1 = int( trf.y( ll.x, ll.y) * w->zoom_factor_y) - w->offset_y;
int x2 = int( trf.x( ur.x, ur.y) * w->zoom_factor_x) - w->offset_x;
int y2 = int( trf.y( ur.x, ur.y) * w->zoom_factor_y) - w->offset_y;
double rotation = (trf.rot() / 360 - floor( trf.rot() / 360)) * 360;
int len;
int lix;
int di;
int horizontal = ( rotation < 45 || (rotation > 135 && rotation < 225) || rotation > 315) ? 0 : 1;
if ( horizontal)
len = abs( x2 - x1);
else
len = abs( y2 - y1);
if ( len < 150)
lix = 0;
else
lix = 1;
double d = fabs( maxval - minval);
if ( d < 5)
d = 1000 * d;
di = (int) (d + 0.5);
while ( di >= 25)
di /= 10;
if ( di > 0 && di <= 25) {
lines = rdata[lix][di-1].lines;
longquotient = rdata[lix][di-1].longq;
if ( horizontal)
valuequotient = rdata[lix][di-1].hvalq;
else
valuequotient = rdata[lix][di-1].vvalq;
}
double m = max(fabs(maxval),fabs(minval));
switch ( lix) {
case 0: {
if ( m < 0.01)
strcpy( format, "%g");
else if ( m < 0.1)
strcpy( format, "%5.3f");
else if ( m < 1)
strcpy( format, "%4.2f");
else if ( m < 3)
strcpy( format, "%3.1f");
else if ( m <= 20)
strcpy( format, "%2.0f");
else if ( m <= 200)
strcpy( format, "%3.0f");
else if ( m < 2000)
strcpy( format, "%4.0f");
else if ( m < 20000)
strcpy( format, "%5.0f");
else
strcpy( format, "%g");
break;
}
case 1: {
if ( m < 0.01)
strcpy( format, "%g");
else if ( m < 0.1)
strcpy( format, "%5.3f");
else if ( m < 1)
strcpy( format, "%4.2f");
else if ( m <= 4)
strcpy( format, "%3.1f");
else if ( m <= 20)
strcpy( format, "%2.0f");
else if ( m <= 200)
strcpy( format, "%3.0f");
else if ( m < 2000)
strcpy( format, "%4.0f");
else if ( m < 20000)
strcpy( format, "%5.0f");
else
strcpy( format, "%g");
break;
}
default: ;
}
configure(); configure();
draw();
} }
void GrowAxis::export_javabean( GlowTransform *t, void *node, void GrowAxis::export_javabean( GlowTransform *t, void *node,
...@@ -732,6 +893,32 @@ void GrowAxis::export_javabean( GlowTransform *t, void *node, ...@@ -732,6 +893,32 @@ void GrowAxis::export_javabean( GlowTransform *t, void *node,
pass, shape_cnt, node_cnt, fp); pass, shape_cnt, node_cnt, fp);
} }
void GrowAxis::trace_scan()
{
if ( !trace.p)
return;
if ( ctx->trace_scan_func)
{
ctx->trace_scan_func( (void *) this, trace.p);
return;
}
}
int GrowAxis::trace_init()
{
int sts;
sts = ctx->trace_connect_func( (void *) this, &trace);
return sts;
}
void GrowAxis::trace_close()
{
if ( trace.p)
ctx->trace_disconnect_func( (void *) this);
}
void GrowAxis::set_conf( double max_val, double min_val, int no_of_lines, void GrowAxis::set_conf( double max_val, double min_val, int no_of_lines,
int long_quot, int value_quot, double rot, const char *value_format) int long_quot, int value_quot, double rot, const char *value_format)
{ {
...@@ -753,9 +940,13 @@ void GrowAxis::set_axis_info( glow_sAxisInfo *info) ...@@ -753,9 +940,13 @@ void GrowAxis::set_axis_info( glow_sAxisInfo *info)
{ {
max_value = info->max_value; max_value = info->max_value;
min_value = info->min_value; min_value = info->min_value;
if ( info->lines)
lines = info->lines; lines = info->lines;
if ( info->longquotient)
longquotient = info->longquotient; longquotient = info->longquotient;
if ( info->valuequotient)
valuequotient = info->valuequotient; valuequotient = info->valuequotient;
if ( strcmp( info->format, "") != 0)
strcpy( format, info->format); strcpy( format, info->format);
} }
...@@ -806,8 +997,11 @@ void GrowAxis::format_text( char *text, char *fmt, double value) ...@@ -806,8 +997,11 @@ void GrowAxis::format_text( char *text, char *fmt, double value)
timstr[16] = 0; timstr[16] = 0;
strcpy( text, timstr); strcpy( text, timstr);
} }
else else {
if ( fabs(value) < FLT_EPSILON)
value = 0;
sprintf( text, fmt, value); sprintf( text, fmt, value);
}
} }
void GrowAxis::convert( glow_eConvert version) void GrowAxis::convert( glow_eConvert version)
......
...@@ -141,6 +141,7 @@ class GrowAxis : public GrowRect { ...@@ -141,6 +141,7 @@ class GrowAxis : public GrowRect {
int valuequotient; //!< Quotient of lines that displays a value. int valuequotient; //!< Quotient of lines that displays a value.
double increment; //!< Value difference between two lines. double increment; //!< Value difference between two lines.
char format[20]; //!< Format of displayed values. char format[20]; //!< Format of displayed values.
GlowTraceData trace; //!< Obsolete
//! Erase the object. //! Erase the object.
/*! /*!
...@@ -224,6 +225,21 @@ class GrowAxis : public GrowRect { ...@@ -224,6 +225,21 @@ class GrowAxis : public GrowRect {
void set_conf( double max_val, double min_val, int no_of_lines, void set_conf( double max_val, double min_val, int no_of_lines,
int long_quot, int value_quot, double rot, const char *format); int long_quot, int value_quot, double rot, const char *format);
//! Scan trace
/*! Calls the trace scan callback for the object.
*/
void trace_scan();
//! Init trace
/*! Calls the trace connect callback for the object.
*/
int trace_init();
//! Close trace
/*! Calls the trace disconnect callback for the object.
*/
void trace_close();
//! Conversion between different versions of Glow //! Conversion between different versions of Glow
/*! /*!
\param version Version to convert to. \param version Version to convert to.
......
This diff is collapsed.
...@@ -141,6 +141,7 @@ class GrowAxisArc : public GrowArc { ...@@ -141,6 +141,7 @@ class GrowAxisArc : public GrowArc {
int valuequotient; //!< Quotient of lines that displays a value. int valuequotient; //!< Quotient of lines that displays a value.
double increment; //!< Value difference between two lines. double increment; //!< Value difference between two lines.
char format[20]; //!< Format of displayed values. char format[20]; //!< Format of displayed values.
GlowTraceData trace; //!< Obsolete
//! Erase the object. //! Erase the object.
/*! /*!
...@@ -224,6 +225,21 @@ class GrowAxisArc : public GrowArc { ...@@ -224,6 +225,21 @@ class GrowAxisArc : public GrowArc {
void set_conf( double max_val, double min_val, int no_of_lines, void set_conf( double max_val, double min_val, int no_of_lines,
int long_quot, int value_quot, double rot, const char *format); int long_quot, int value_quot, double rot, const char *format);
//! Scan trace
/*! Calls the trace scan callback for the object.
*/
void trace_scan();
//! Init trace
/*! Calls the trace connect callback for the object.
*/
int trace_init();
//! Close trace
/*! Calls the trace disconnect callback for the object.
*/
void trace_close();
//! Conversion between different versions of Glow //! Conversion between different versions of Glow
/*! /*!
\param version Version to convert to. \param version Version to convert to.
......
...@@ -1932,8 +1932,10 @@ void GrowCtx::save_grow( ofstream& fp, glow_eSaveMode mode) ...@@ -1932,8 +1932,10 @@ void GrowCtx::save_grow( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_GrowCtx_path) << endl; fp << int(glow_eSave_GrowCtx_path) << endl;
for ( i = 0; i < path_cnt; i++) for ( i = 0; i < path_cnt; i++)
fp << path[i] << endl; fp << path[i] << endl;
fp << int(glow_eSave_GrowCtx_dyn_type) << FSPACE << dyn_type << endl; fp << int(glow_eSave_GrowCtx_dyn_type1) << FSPACE << dyn_type1 << endl;
fp << int(glow_eSave_GrowCtx_dyn_action_type) << FSPACE << dyn_action_type << endl; fp << int(glow_eSave_GrowCtx_dyn_type2) << FSPACE << dyn_type2 << endl;
fp << int(glow_eSave_GrowCtx_dyn_action_type1) << FSPACE << dyn_action_type1 << endl;
fp << int(glow_eSave_GrowCtx_dyn_action_type2) << FSPACE << dyn_action_type2 << endl;
fp << int(glow_eSave_GrowCtx_dyn_color1) << FSPACE << int(dyn_color[0]) << endl; fp << int(glow_eSave_GrowCtx_dyn_color1) << FSPACE << int(dyn_color[0]) << endl;
fp << int(glow_eSave_GrowCtx_dyn_color2) << FSPACE << int(dyn_color[1]) << endl; fp << int(glow_eSave_GrowCtx_dyn_color2) << FSPACE << int(dyn_color[1]) << endl;
fp << int(glow_eSave_GrowCtx_dyn_color3) << FSPACE << int(dyn_color[2]) << endl; fp << int(glow_eSave_GrowCtx_dyn_color3) << FSPACE << int(dyn_color[2]) << endl;
...@@ -2096,8 +2098,10 @@ void GrowCtx::open_grow( ifstream& fp) ...@@ -2096,8 +2098,10 @@ void GrowCtx::open_grow( ifstream& fp)
fp.getline( path[i], sizeof(path[0])); fp.getline( path[i], sizeof(path[0]));
} }
break; break;
case glow_eSave_GrowCtx_dyn_type: fp >> dyn_type; break; case glow_eSave_GrowCtx_dyn_type1: fp >> dyn_type1; break;
case glow_eSave_GrowCtx_dyn_action_type: fp >> dyn_action_type; break; case glow_eSave_GrowCtx_dyn_type2: fp >> dyn_type2; break;
case glow_eSave_GrowCtx_dyn_action_type1: fp >> dyn_action_type1; break;
case glow_eSave_GrowCtx_dyn_action_type2: fp >> dyn_action_type2; break;
case glow_eSave_GrowCtx_dyn_color1: case glow_eSave_GrowCtx_dyn_color1:
fp >> tmp; fp >> tmp;
dyn_color[0] = (glow_eDrawType)tmp; dyn_color[0] = (glow_eDrawType)tmp;
...@@ -2246,8 +2250,10 @@ int GrowCtx::save_subgraph( char *filename, glow_eSaveMode mode) ...@@ -2246,8 +2250,10 @@ int GrowCtx::save_subgraph( char *filename, glow_eSaveMode mode)
} }
fp << "\"" << endl; fp << "\"" << endl;
} }
fp << int(glow_eSave_NodeClass_dyn_type) << FSPACE << dyn_type << endl; fp << int(glow_eSave_NodeClass_dyn_type1) << FSPACE << dyn_type1 << endl;
fp << int(glow_eSave_NodeClass_dyn_action_type) << FSPACE << dyn_action_type << endl; fp << int(glow_eSave_NodeClass_dyn_type2) << FSPACE << dyn_type2 << endl;
fp << int(glow_eSave_NodeClass_dyn_action_type1) << FSPACE << dyn_action_type1 << endl;
fp << int(glow_eSave_NodeClass_dyn_action_type2) << FSPACE << dyn_action_type2 << endl;
fp << int(glow_eSave_NodeClass_dyn_color1) << FSPACE << int(dyn_color[0]) << endl; fp << int(glow_eSave_NodeClass_dyn_color1) << FSPACE << int(dyn_color[0]) << endl;
fp << int(glow_eSave_NodeClass_dyn_color2) << FSPACE << int(dyn_color[1]) << endl; fp << int(glow_eSave_NodeClass_dyn_color2) << FSPACE << int(dyn_color[1]) << endl;
fp << int(glow_eSave_NodeClass_dyn_color3) << FSPACE << int(dyn_color[2]) << endl; fp << int(glow_eSave_NodeClass_dyn_color3) << FSPACE << int(dyn_color[2]) << endl;
...@@ -4009,7 +4015,7 @@ void GrowCtx::convert( glow_eConvert version) ...@@ -4009,7 +4015,7 @@ void GrowCtx::convert( glow_eConvert version)
// Conversion of colors // Conversion of colors
background_color = GlowColor::convert( version, background_color); background_color = GlowColor::convert( version, background_color);
set_background( background_color); set_background( background_color);
if ( dyn_type == 3 || dyn_type == 4 || dyn_type == 12) { if ( dyn_type1 == 3 || dyn_type1 == 4 || dyn_type1 == 12) {
if ( (glow_eDrawTone) dyn_color[0] == glow_eDrawTone_YellowGreen) if ( (glow_eDrawTone) dyn_color[0] == glow_eDrawTone_YellowGreen)
dyn_color[0] = (glow_eDrawType) glow_eDrawTone_Yellow; dyn_color[0] = (glow_eDrawType) glow_eDrawTone_Yellow;
if ( (glow_eDrawTone) dyn_color[1] == glow_eDrawTone_YellowGreen) if ( (glow_eDrawTone) dyn_color[1] == glow_eDrawTone_YellowGreen)
......
...@@ -86,7 +86,7 @@ class GrowCtx : public GlowCtx { ...@@ -86,7 +86,7 @@ class GrowCtx : public GlowCtx {
background_color(glow_eDrawType_LineErase), highlight_disabled(0), background_color(glow_eDrawType_LineErase), highlight_disabled(0),
dynamic(0), dynamicsize(0), arg_cnt(0), x0(0), y0(0), x1(0), y1(0), dynamic(0), dynamicsize(0), arg_cnt(0), x0(0), y0(0), x1(0), y1(0),
path_cnt(0), path_cnt(0),
dyn_type(0), dyn_action_type(0), dyn_type1(0), dyn_type2(0), dyn_action_type1(0), dyn_action_type2(0),
no_con_obstacle(0), slider(0), slider_cursor_offset(0), no_con_obstacle(0), slider(0), slider_cursor_offset(0),
move_restriction(glow_eMoveRestriction_No), restriction_max_limit(0), move_restriction(glow_eMoveRestriction_No), restriction_max_limit(0),
restriction_min_limit(0), restriction_object(0), subgraph(0), restriction_min_limit(0), restriction_object(0), subgraph(0),
...@@ -888,8 +888,10 @@ class GrowCtx : public GlowCtx { ...@@ -888,8 +888,10 @@ class GrowCtx : public GlowCtx {
double y1; //!< High border of graph. double y1; //!< High border of graph.
int path_cnt; //!< Number of paths in searchpath int path_cnt; //!< Number of paths in searchpath
char path[10][80]; //!< Search paths where subgraphs and imagefiles are searched for. char path[10][80]; //!< Search paths where subgraphs and imagefiles are searched for.
int dyn_type; //!< Dyntype for a subgraph. int dyn_type1; //!< Dyntype for a subgraph mask 1.
int dyn_action_type; //!< Action type for a subgraph. int dyn_type2; //!< Dyntype for a subgraph mask 2.
int dyn_action_type1; //!< Action type for a subgraph mask 1.
int dyn_action_type2; //!< Action type for a subgraph mask 2.
glow_eDrawType dyn_color[4]; //!< Dynamic colors for a subgraph. glow_eDrawType dyn_color[4]; //!< Dynamic colors for a subgraph.
int dyn_attr[4]; //!< Dynamic attributes for a subgraph. int dyn_attr[4]; //!< Dynamic attributes for a subgraph.
int no_con_obstacle; //!< Subgraph is not an obstacle for a connection. int no_con_obstacle; //!< Subgraph is not an obstacle for a connection.
......
...@@ -1793,7 +1793,7 @@ int GrowNode::get_background_object_limits(GlowTransform *t, ...@@ -1793,7 +1793,7 @@ int GrowNode::get_background_object_limits(GlowTransform *t,
{ {
int dyn_type; int dyn_type;
GlowNodeClass *base_nc = nc->get_base_nc(); GlowNodeClass *base_nc = nc->get_base_nc();
dyn_type = base_nc->dyn_type; dyn_type = base_nc->dyn_type1;
if ( !( (int) type & dyn_type)) if ( !( (int) type & dyn_type))
return 0; return 0;
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
GlowNodeClass::GlowNodeClass( GrowCtx *glow_ctx, const char *name, GlowNodeClass::GlowNodeClass( GrowCtx *glow_ctx, const char *name,
glow_eNodeGroup grp) glow_eNodeGroup grp)
: ctx(glow_ctx), a(10,10), group(grp), dynamic(0), dynamicsize(0), : ctx(glow_ctx), a(10,10), group(grp), dynamic(0), dynamicsize(0),
arg_cnt(0), nc_extern(0), dyn_type(0), dyn_action_type(0), arg_cnt(0), nc_extern(0), dyn_type1(0), dyn_type2(0), dyn_action_type1(0), dyn_action_type2(0),
no_con_obstacle(0), slider(0), animation_count(1), no_con_obstacle(0), slider(0), animation_count(1),
y0(0), y1(0), x0(0), x1(0), y0(0), y1(0), x0(0), x1(0),
next_nc(0), prev_nc(0), cycle(glow_eCycle_Slow), user_data(0) next_nc(0), prev_nc(0), cycle(glow_eCycle_Slow), user_data(0)
...@@ -141,8 +141,10 @@ void GlowNodeClass::save( ofstream& fp, glow_eSaveMode mode) ...@@ -141,8 +141,10 @@ void GlowNodeClass::save( ofstream& fp, glow_eSaveMode mode)
fp << int(glow_eSave_NodeClass_argtype) << endl; fp << int(glow_eSave_NodeClass_argtype) << endl;
for ( i = 0; i < arg_cnt; i++) for ( i = 0; i < arg_cnt; i++)
fp << argtype[i] << endl; fp << argtype[i] << endl;
fp << int(glow_eSave_NodeClass_dyn_type) << FSPACE << dyn_type << endl; fp << int(glow_eSave_NodeClass_dyn_type1) << FSPACE << dyn_type1 << endl;
fp << int(glow_eSave_NodeClass_dyn_action_type) << FSPACE << dyn_action_type << endl; fp << int(glow_eSave_NodeClass_dyn_type2) << FSPACE << dyn_type2 << endl;
fp << int(glow_eSave_NodeClass_dyn_action_type1) << FSPACE << dyn_action_type1 << endl;
fp << int(glow_eSave_NodeClass_dyn_action_type2) << FSPACE << dyn_action_type2 << endl;
fp << int(glow_eSave_NodeClass_dyn_color1) << FSPACE << int(dyn_color[0]) << endl; fp << int(glow_eSave_NodeClass_dyn_color1) << FSPACE << int(dyn_color[0]) << endl;
fp << int(glow_eSave_NodeClass_dyn_color2) << FSPACE << int(dyn_color[1]) << endl; fp << int(glow_eSave_NodeClass_dyn_color2) << FSPACE << int(dyn_color[1]) << endl;
fp << int(glow_eSave_NodeClass_dyn_color3) << FSPACE << int(dyn_color[2]) << endl; fp << int(glow_eSave_NodeClass_dyn_color3) << FSPACE << int(dyn_color[2]) << endl;
...@@ -232,8 +234,10 @@ void GlowNodeClass::open( ifstream& fp) ...@@ -232,8 +234,10 @@ void GlowNodeClass::open( ifstream& fp)
for ( i = 0; i < arg_cnt; i++) for ( i = 0; i < arg_cnt; i++)
fp >> argtype[i]; fp >> argtype[i];
break; break;
case glow_eSave_NodeClass_dyn_type: fp >> dyn_type; break; case glow_eSave_NodeClass_dyn_type1: fp >> dyn_type1; break;
case glow_eSave_NodeClass_dyn_action_type: fp >> dyn_action_type; break; case glow_eSave_NodeClass_dyn_type2: fp >> dyn_type2; break;
case glow_eSave_NodeClass_dyn_action_type1: fp >> dyn_action_type1; break;
case glow_eSave_NodeClass_dyn_action_type2: fp >> dyn_action_type2; break;
case glow_eSave_NodeClass_dyn_color1: case glow_eSave_NodeClass_dyn_color1:
fp >> tmp; fp >> tmp;
dyn_color[0] = (glow_eDrawType)tmp; dyn_color[0] = (glow_eDrawType)tmp;
...@@ -724,7 +728,7 @@ void GlowNodeClass::get_origo( GlowTransform *t, double *x, ...@@ -724,7 +728,7 @@ void GlowNodeClass::get_origo( GlowTransform *t, double *x,
void GlowNodeClass::convert( glow_eConvert version) void GlowNodeClass::convert( glow_eConvert version)
{ {
a.convert( version); a.convert( version);
if ( dyn_type == 3 || dyn_type == 4 || dyn_type == 12) { if ( dyn_type1 == 3 || dyn_type1 == 4 || dyn_type1 == 12) {
if ( (glow_eDrawTone) dyn_color[0] == glow_eDrawTone_YellowGreen) if ( (glow_eDrawTone) dyn_color[0] == glow_eDrawTone_YellowGreen)
dyn_color[0] = (glow_eDrawType) glow_eDrawTone_Yellow; dyn_color[0] = (glow_eDrawType) glow_eDrawTone_Yellow;
if ( (glow_eDrawTone) dyn_color[1] == glow_eDrawTone_YellowGreen) if ( (glow_eDrawTone) dyn_color[1] == glow_eDrawTone_YellowGreen)
......
...@@ -398,8 +398,10 @@ class GlowNodeClass : public GlowArrayElem { ...@@ -398,8 +398,10 @@ class GlowNodeClass : public GlowArrayElem {
char argname[20][32]; //!< Arguments to dynamic code. char argname[20][32]; //!< Arguments to dynamic code.
int argtype[20]; //!< Type of arguments to dynamic code. int argtype[20]; //!< Type of arguments to dynamic code.
int nc_extern; //!< Nodeclass is extern, i.e loaded from pwsg file. int nc_extern; //!< Nodeclass is extern, i.e loaded from pwsg file.
int dyn_type; //!< Dynamic type. int dyn_type1; //!< Dynamic type mask 1.
int dyn_action_type; //!< Action type. int dyn_type2; //!< Dynamic type mask 2.
int dyn_action_type1; //!< Action type mask 1.
int dyn_action_type2; //!< Action type mask 2.
glow_eDrawType dyn_color[4]; //!< Dynamic colors. glow_eDrawType dyn_color[4]; //!< Dynamic colors.
int dyn_attr[4]; //!< Dynamic attributes. int dyn_attr[4]; //!< Dynamic attributes.
int no_con_obstacle; //!< Node of this nodeclass are not obstacles for routed connections. int no_con_obstacle; //!< Node of this nodeclass are not obstacles for routed connections.
......
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