Commit bddb110e authored by Claes Sjofors's avatar Claes Sjofors

Ge analog color, dynamics for border color added

parent a2cb97c5
......@@ -4725,6 +4725,11 @@ void GeAnalogColor::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo[i].type = glow_eType_String;
attrinfo[i++].size = sizeof( attribute);
strcpy( attrinfo[i].name, "AnalogColor.Border");
attrinfo[i].value = &border;
attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( border);
strcpy( attrinfo[i].name, "AnalogColor.Instances");
attrinfo[i].value = &instance_mask;
attrinfo[i].type = ge_eAttrType_InstanceMask;
......@@ -4753,6 +4758,11 @@ void GeAnalogColor::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo[i].value = &limit_type;
attrinfo[i].type = ge_eAttrType_LimitType;
attrinfo[i++].size = sizeof( limit_type);
sprintf( attrinfo[i].name, "AnalogColor%d.Border", inst);
attrinfo[i].value = &border;
attrinfo[i].type = glow_eType_Boolean;
attrinfo[i++].size = sizeof( border);
}
}
*item_count = i;
......@@ -4835,6 +4845,7 @@ void GeAnalogColor::save( ofstream& fp)
fp << int(ge_eSave_AnalogColor_color) << FSPACE << (int)color << endl;
fp << int(ge_eSave_AnalogColor_instance) << FSPACE << int(instance) << endl;
fp << int(ge_eSave_AnalogColor_instance_mask) << FSPACE << int(instance_mask) << endl;
fp << int(ge_eSave_AnalogColor_border) << FSPACE << border << endl;
fp << int(ge_eSave_End) << endl;
}
......@@ -4866,6 +4877,7 @@ void GeAnalogColor::open( ifstream& fp)
case ge_eSave_AnalogColor_color: fp >> tmp; color = (glow_eDrawType)tmp; break;
case ge_eSave_AnalogColor_instance: fp >> tmp; instance = (ge_mInstance)tmp; break;
case ge_eSave_AnalogColor_instance_mask: fp >> tmp; instance_mask = (ge_mInstance)tmp; break;
case ge_eSave_AnalogColor_border: fp >> tmp; border = (int)tmp; break;
case ge_eSave_End: end_found = 1; break;
default:
cout << "GeAnalogColor:open syntax error" << endl;
......@@ -5045,26 +5057,40 @@ int GeAnalogColor::scan( grow_tObject object)
}
if ( dyn->total_dyn_type1 & ge_mDynType1_Tone) {
if ( set_color) {
if ( color >= (glow_eDrawType) glow_eDrawTone__)
grow_SetObjectFillColor( object, color);
if ( color >= (glow_eDrawType) glow_eDrawTone__) {
if ( !border)
grow_SetObjectFillColor( object, color);
else
grow_SetObjectBorderColor( object, color);
}
else
grow_SetObjectColorTone( object, (glow_eDrawTone) color);
dyn->ignore_color = true;
}
else {
if ( color >= (glow_eDrawType) glow_eDrawTone__)
grow_ResetObjectFillColor( object);
if ( color >= (glow_eDrawType) glow_eDrawTone__) {
if ( !border)
grow_ResetObjectFillColor( object);
else
grow_ResetObjectBorderColor( object);
}
grow_ResetObjectColorTone( object);
dyn->reset_color = true;
}
}
else {
if ( set_color) {
grow_SetObjectFillColor( object, color);
if ( !border)
grow_SetObjectFillColor( object, color);
else
grow_SetObjectBorderColor( object, color);
dyn->ignore_color = true;
}
else {
grow_ResetObjectFillColor( object);
if ( !border)
grow_ResetObjectFillColor( object);
else
grow_ResetObjectBorderColor( object);
dyn->reset_color = true;
}
}
......
......@@ -549,6 +549,7 @@
ge_eSave_AnalogColor_color = 6103,
ge_eSave_AnalogColor_instance = 6104,
ge_eSave_AnalogColor_instance_mask = 6105,
ge_eSave_AnalogColor_border = 6106,
ge_eSave_TipText_text = 6200,
ge_eSave_Help_topic = 6300,
ge_eSave_Help_bookmark = 6400,
......@@ -1332,6 +1333,7 @@ class GeAnalogColor : public GeDynElem {
double limit; //!< Limit value.
ge_eLimitType limit_type; //!< Type of limit.
glow_eDrawType color; //!< Color to set when limit value is exceeded.
int border;
bool old_state;
pwr_tFloat32 *p;
......@@ -1345,12 +1347,12 @@ class GeAnalogColor : public GeDynElem {
GeAnalogColor( GeDyn *e_dyn, ge_mInstance e_instance = ge_mInstance_1) :
GeDynElem(e_dyn, ge_mDynType1_AnalogColor, ge_mDynType2_No, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_AnalogColor),
limit(0), limit_type(ge_eLimitType_Gt), color(glow_eDrawType_Inherit),
limit(0), limit_type(ge_eLimitType_Gt), color(glow_eDrawType_Inherit), border(0),
old_state(false), p(0), old_value(FLT_INI), e(0)
{ strcpy( attribute, ""); instance = e_instance;}
GeAnalogColor( const GeAnalogColor& x) :
GeDynElem(x.dyn,x.dyn_type1,x.dyn_type2,x.action_type1,x.action_type2,x.prio), limit(x.limit),
limit_type(x.limit_type), color(x.color), old_state(false), p(0),
limit_type(x.limit_type), color(x.color), border(x.border), old_state(false), p(0),
old_value(FLT_INI), e(0)
{ strcpy( attribute, x.attribute);
instance = x.instance; instance_mask = x.instance_mask;}
......
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