Commit d415a21f authored by claes's avatar claes

Possibility to choose displayed curve in fastcurve object

parent 96cc33ee
...@@ -8742,6 +8742,16 @@ void GeFastCurve::get_attributes( attr_sItem *attrinfo, int *item_count) ...@@ -8742,6 +8742,16 @@ void GeFastCurve::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo[i].type = glow_eType_String; attrinfo[i].type = glow_eType_String;
attrinfo[i++].size = sizeof( fast_object); attrinfo[i++].size = sizeof( fast_object);
strcpy( attrinfo[i].name, "FastCurve.CurveIndex1");
attrinfo[i].value = &curve_index1;
attrinfo[i].type = glow_eType_Int;
attrinfo[i++].size = sizeof( curve_index1);
strcpy( attrinfo[i].name, "FastCurve.CurveIndex2");
attrinfo[i].value = &curve_index2;
attrinfo[i].type = glow_eType_Int;
attrinfo[i++].size = sizeof( curve_index2);
*item_count = i; *item_count = i;
} }
...@@ -8769,6 +8779,8 @@ void GeFastCurve::save( ofstream& fp) ...@@ -8769,6 +8779,8 @@ void GeFastCurve::save( ofstream& fp)
{ {
fp << int(ge_eSave_FastCurve) << endl; fp << int(ge_eSave_FastCurve) << endl;
fp << int(ge_eSave_FastCurve_fast_object) << FSPACE << fast_object << endl; fp << int(ge_eSave_FastCurve_fast_object) << FSPACE << fast_object << endl;
fp << int(ge_eSave_FastCurve_curve_index1) << FSPACE << curve_index1 << endl;
fp << int(ge_eSave_FastCurve_curve_index2) << FSPACE << curve_index2 << endl;
fp << int(ge_eSave_End) << endl; fp << int(ge_eSave_End) << endl;
} }
...@@ -8787,6 +8799,8 @@ void GeFastCurve::open( ifstream& fp) ...@@ -8787,6 +8799,8 @@ void GeFastCurve::open( ifstream& fp)
fp.get(); fp.get();
fp.getline( fast_object, sizeof(fast_object)); fp.getline( fast_object, sizeof(fast_object));
break; break;
case ge_eSave_FastCurve_curve_index1: fp >> curve_index1; break;
case ge_eSave_FastCurve_curve_index2: fp >> curve_index2; break;
case ge_eSave_End: end_found = 1; break; case ge_eSave_End: end_found = 1; break;
default: default:
cout << "GeFastCurve:open syntax error" << endl; cout << "GeFastCurve:open syntax error" << endl;
...@@ -8839,8 +8853,28 @@ int GeFastCurve::connect( grow_tObject object, glow_sTraceData *trace_data) ...@@ -8839,8 +8853,28 @@ int GeFastCurve::connect( grow_tObject object, glow_sTraceData *trace_data)
memcpy( &time_buff, &fp.TimeBuffer, sizeof(time_buff)); memcpy( &time_buff, &fp.TimeBuffer, sizeof(time_buff));
fast_cnt = 0; fast_cnt = 0;
for ( i = 0; i < FAST_CURVES; i++) { if ( curve_index1 == 0 && curve_index2 == 0) {
if ( fp.CurveValid[i]) { for ( i = 0; i < FAST_CURVES; i++) {
if ( fp.CurveValid[i]) {
memcpy( &buff[fast_cnt], &fp.Buffers[i], sizeof(buff[0]));
type[fast_cnt] = (pwr_eType) fp.AttributeType[i];
fast_idx[i] = fast_cnt + 1;
curve_idx[fast_cnt + 1] = i;
fast_cnt++;
}
}
}
else {
if ( curve_index1 >= 0 && curve_index1 < FAST_CURVES && fp.CurveValid[curve_index1]) {
i = curve_index1;
memcpy( &buff[fast_cnt], &fp.Buffers[i], sizeof(buff[0]));
type[fast_cnt] = (pwr_eType) fp.AttributeType[i];
fast_idx[i] = fast_cnt + 1;
curve_idx[fast_cnt + 1] = i;
fast_cnt++;
}
if ( curve_index2 >= 1 && curve_index2 < FAST_CURVES && fp.CurveValid[curve_index2]) {
i = curve_index2;
memcpy( &buff[fast_cnt], &fp.Buffers[i], sizeof(buff[0])); memcpy( &buff[fast_cnt], &fp.Buffers[i], sizeof(buff[0]));
type[fast_cnt] = (pwr_eType) fp.AttributeType[i]; type[fast_cnt] = (pwr_eType) fp.AttributeType[i];
fast_idx[i] = fast_cnt + 1; fast_idx[i] = fast_cnt + 1;
......
...@@ -327,6 +327,8 @@ extern "C" { ...@@ -327,6 +327,8 @@ extern "C" {
ge_eSave_FillLevel_min_value = 2703, ge_eSave_FillLevel_min_value = 2703,
ge_eSave_FillLevel_max_value = 2704, ge_eSave_FillLevel_max_value = 2704,
ge_eSave_FastCurve_fast_object = 2800, ge_eSave_FastCurve_fast_object = 2800,
ge_eSave_FastCurve_curve_index1 = 2801,
ge_eSave_FastCurve_curve_index2 = 2802,
ge_eSave_AnalogText_super = 2900, ge_eSave_AnalogText_super = 2900,
ge_eSave_Table_attribute1 = 3000, ge_eSave_Table_attribute1 = 3000,
ge_eSave_Table_format1 = 3001, ge_eSave_Table_format1 = 3001,
...@@ -1889,6 +1891,8 @@ class GeTrend : public GeDynElem { ...@@ -1889,6 +1891,8 @@ class GeTrend : public GeDynElem {
class GeFastCurve : public GeDynElem { class GeFastCurve : public GeDynElem {
public: public:
char fast_object[120]; char fast_object[120];
int curve_index1;
int curve_index2;
pwr_tBoolean *new_p; //!< Pointer to New attribute, which indicates new curve data. pwr_tBoolean *new_p; //!< Pointer to New attribute, which indicates new curve data.
pwr_tRefId subid; //!< Subid of New attribute in DsFastCurve. pwr_tRefId subid; //!< Subid of New attribute in DsFastCurve.
...@@ -1909,10 +1913,11 @@ class GeFastCurve : public GeDynElem { ...@@ -1909,10 +1913,11 @@ class GeFastCurve : public GeDynElem {
GeFastCurve( GeDyn *e_dyn) : GeFastCurve( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType_FastCurve, (ge_mActionType) 0, GeDynElem(e_dyn, ge_mDynType_FastCurve, (ge_mActionType) 0,
ge_eDynPrio_FastCurve) ge_eDynPrio_FastCurve), curve_index1(0), curve_index2(0)
{ strcpy( fast_object, "");} { strcpy( fast_object, "");}
GeFastCurve( const GeFastCurve& x) : GeFastCurve( const GeFastCurve& x) :
GeDynElem(x.dyn,x.dyn_type,x.action_type,x.prio) GeDynElem(x.dyn,x.dyn_type,x.action_type,x.prio),
curve_index1(x.curve_index1), curve_index2(x.curve_index2)
{ strcpy( fast_object, x.fast_object);} { strcpy( fast_object, x.fast_object);}
void get_attributes( attr_sItem *attrinfo, int *item_count); void get_attributes( attr_sItem *attrinfo, int *item_count);
void save( ofstream& fp); void save( ofstream& fp);
......
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