Commit 8e2c4152 authored by claes's avatar claes

Another color added to Flash dynamic

parent 2e3f017c
/*
* Proview $Id: ge_dyn.cpp,v 1.31 2005-09-20 13:25:38 claes Exp $
* Proview $Id: ge_dyn.cpp,v 1.32 2005-10-12 12:58:22 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2139,6 +2139,11 @@ void GeDigFlash::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo[i].value = &color;
attrinfo[i].type = glow_eType_ToneOrColor;
attrinfo[i++].size = sizeof( color);
strcpy( attrinfo[i].name, "DigFlash.Tone2");
attrinfo[i].value = &color2;
attrinfo[i].type = glow_eType_ToneOrColor;
attrinfo[i++].size = sizeof( color2);
}
else {
strcpy( attrinfo[i].name, "DigFlash.Attribute");
......@@ -2150,6 +2155,11 @@ void GeDigFlash::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo[i].value = &color;
attrinfo[i].type = glow_eType_Color;
attrinfo[i++].size = sizeof( color);
strcpy( attrinfo[i].name, "DigFlash.Color2");
attrinfo[i].value = &color2;
attrinfo[i].type = glow_eType_Color;
attrinfo[i++].size = sizeof( color2);
}
*item_count = i;
}
......@@ -2192,6 +2202,7 @@ void GeDigFlash::save( ofstream& fp)
fp << int(ge_eSave_DigFlash) << endl;
fp << int(ge_eSave_DigFlash_attribute) << FSPACE << attribute << endl;
fp << int(ge_eSave_DigFlash_color) << FSPACE << int(color) << endl;
fp << int(ge_eSave_DigFlash_color2) << FSPACE << int(color2) << endl;
fp << int(ge_eSave_End) << endl;
}
......@@ -2212,6 +2223,7 @@ void GeDigFlash::open( ifstream& fp)
fp.getline( attribute, sizeof(attribute));
break;
case ge_eSave_DigFlash_color: fp >> tmp; color = (glow_eDrawType)tmp; break;
case ge_eSave_DigFlash_color2: fp >> tmp; color2 = (glow_eDrawType)tmp; break;
case ge_eSave_End: end_found = 1; break;
default:
cout << "GeDigFlash:open syntax error" << endl;
......@@ -2283,10 +2295,19 @@ int GeDigFlash::scan( grow_tObject object)
dyn->ignore_color = true;
}
else {
if ( color >= (glow_eDrawType) glow_eDrawTone__)
grow_ResetObjectFillColor( object);
grow_ResetObjectColorTone( object);
dyn->reset_color = true;
if ( color2 == glow_eDrawType_Inherit) {
if ( color >= (glow_eDrawType) glow_eDrawTone__)
grow_ResetObjectFillColor( object);
grow_ResetObjectColorTone( object);
dyn->reset_color = true;
}
else {
if ( color >= (glow_eDrawType) glow_eDrawTone__)
grow_SetObjectFillColor( object, color2);
else
grow_SetObjectColorTone( object, (glow_eDrawTone) color2);
dyn->ignore_color = true;
}
}
on = on ? false : true;
}
......@@ -2304,8 +2325,14 @@ int GeDigFlash::scan( grow_tObject object)
dyn->ignore_color = true;
}
else {
grow_ResetObjectFillColor( object);
dyn->reset_color = true;
if ( color2 == glow_eDrawType_Inherit) {
grow_ResetObjectFillColor( object);
dyn->reset_color = true;
}
else {
grow_SetObjectFillColor( object, color2);
dyn->ignore_color = true;
}
}
on = on ? false : true;
}
......@@ -3728,7 +3755,7 @@ void GeAnalogColor::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo[i].type = glow_eType_Double;
attrinfo[i++].size = sizeof( limit);
sprintf( attrinfo[i].name, "AnalogColor%d.Tone", inst);
sprintf( attrinfo[i].name, "AnalogColor%d.Color", inst);
attrinfo[i].value = &color;
attrinfo[i].type = glow_eType_Color;
attrinfo[i++].size = sizeof( limit_type);
......
/*
* Proview $Id: ge_dyn.h,v 1.22 2005-09-01 14:57:53 claes Exp $
* Proview $Id: ge_dyn.h,v 1.23 2005-10-12 12:58:22 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -351,6 +351,7 @@ extern "C" {
ge_eSave_Trend_maxvalue_attr2 = 2305,
ge_eSave_DigFlash_attribute = 2600,
ge_eSave_DigFlash_color = 2601,
ge_eSave_DigFlash_color2 = 2602,
ge_eSave_FillLevel_attribute = 2700,
ge_eSave_FillLevel_color = 2701,
ge_eSave_FillLevel_direction = 2702,
......@@ -945,7 +946,8 @@ class GeDigError : public GeDynElem {
class GeDigFlash : public GeDynElem {
public:
char attribute[120]; //!< Database reference to digital attribute.
glow_eDrawType color; //!< Flash color when the signal is high.
glow_eDrawType color; //!< First flash color when the signal is high.
glow_eDrawType color2; //!< Second flash color when the signal is high.
pwr_tBoolean *p;
pwr_tSubid subid;
......@@ -958,10 +960,11 @@ class GeDigFlash : public GeDynElem {
GeDigFlash( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType_DigFlash, (ge_mActionType) 0, ge_eDynPrio_DigFlash),
color(glow_eDrawType_Inherit), on(true)
color(glow_eDrawType_Inherit), color2(glow_eDrawType_Inherit), on(true)
{ strcpy( attribute, "");}
GeDigFlash( const GeDigFlash& x) :
GeDynElem(x.dyn,x.dyn_type,x.action_type,x.prio), color(x.color), on(x.on)
GeDynElem(x.dyn,x.dyn_type,x.action_type,x.prio), color(x.color),
color2(x.color2), on(x.on)
{ strcpy( attribute, x.attribute);}
void get_attributes( attr_sItem *attrinfo, int *item_count);
void save( ofstream& fp);
......@@ -1179,7 +1182,7 @@ class GeAnalogColor : public GeDynElem {
{ strcpy( attribute, ""); instance = e_instance;}
GeAnalogColor( const GeAnalogColor& x) :
GeDynElem(x.dyn,x.dyn_type,x.action_type,x.prio), limit(x.limit),
limit_type(x.limit_type), color(x.color)
limit_type(x.limit_type), color(x.color), p(0)
{ strcpy( attribute, x.attribute);
instance = x.instance; instance_mask = x.instance_mask;}
void get_attributes( attr_sItem *attrinfo, int *item_count);
......
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