Commit b597a164 authored by Claes Sjofors's avatar Claes Sjofors

Ge, local database added for min and max values in trend, bar, and slider

parent 2801f10d
...@@ -7925,21 +7925,39 @@ int GeBar::connect( grow_tObject object, glow_sTraceData *trace_data) ...@@ -7925,21 +7925,39 @@ int GeBar::connect( grow_tObject object, glow_sTraceData *trace_data)
} }
min_value_p = 0; min_value_p = 0;
dyn->parse_attr_name( minvalue_attr, parsed_name, min_value_db = dyn->parse_attr_name( minvalue_attr, parsed_name,
&inverted, &attr_type, &attr_size); &inverted, &attr_type, &attr_size);
if ( strcmp(parsed_name, "") != 0 && if ( strcmp(parsed_name, "") != 0 &&
attr_type == pwr_eType_Float32) { attr_type == pwr_eType_Float32) {
switch ( min_value_db) {
case graph_eDatabase_Gdh:
sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&min_value_p, sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&min_value_p,
&min_value_subid, attr_size, object); &min_value_subid, attr_size, object);
break;
case graph_eDatabase_Local:
min_value_p = (pwr_tFloat32 *) dyn->graph->localdb_ref_or_create( parsed_name, attr_type);
break;
default:
;
}
} }
max_value_p = 0; max_value_p = 0;
dyn->parse_attr_name( maxvalue_attr, parsed_name, max_value_db = dyn->parse_attr_name( maxvalue_attr, parsed_name,
&inverted, &attr_type, &attr_size); &inverted, &attr_type, &attr_size);
if ( strcmp(parsed_name, "") != 0 && if ( strcmp(parsed_name, "") != 0 &&
attr_type == pwr_eType_Float32) { attr_type == pwr_eType_Float32) {
switch ( min_value_db) {
case graph_eDatabase_Gdh:
sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&max_value_p, sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&max_value_p,
&max_value_subid, attr_size, object); &max_value_subid, attr_size, object);
break;
case graph_eDatabase_Local:
max_value_p = (pwr_tFloat32 *) dyn->graph->localdb_ref_or_create( parsed_name, attr_type);
break;
default:
;
}
} }
trace_data->p = &pdummy; trace_data->p = &pdummy;
...@@ -7953,11 +7971,11 @@ int GeBar::disconnect( grow_tObject object) ...@@ -7953,11 +7971,11 @@ int GeBar::disconnect( grow_tObject object)
gdh_UnrefObjectInfo( subid); gdh_UnrefObjectInfo( subid);
p = 0; p = 0;
if ( min_value_p) { if ( min_value_p && min_value_db == graph_eDatabase_Gdh) {
gdh_UnrefObjectInfo( min_value_subid); gdh_UnrefObjectInfo( min_value_subid);
min_value_p = 0; min_value_p = 0;
} }
if ( max_value_p) { if ( max_value_p && max_value_db == graph_eDatabase_Gdh) {
gdh_UnrefObjectInfo( max_value_subid); gdh_UnrefObjectInfo( max_value_subid);
max_value_p = 0; max_value_p = 0;
} }
...@@ -8232,20 +8250,38 @@ int GeTrend::connect( grow_tObject object, glow_sTraceData *trace_data) ...@@ -8232,20 +8250,38 @@ int GeTrend::connect( grow_tObject object, glow_sTraceData *trace_data)
trend_hold = 0; trend_hold = 0;
min_value1_p = 0; min_value1_p = 0;
dyn->parse_attr_name( minvalue_attr1, parsed_name, min_value1_db = dyn->parse_attr_name( minvalue_attr1, parsed_name,
&inverted, &attr_type, &attr_size); &inverted, &attr_type, &attr_size);
if ( strcmp(parsed_name, "") != 0 && if ( strcmp(parsed_name, "") != 0 &&
attr_type == pwr_eType_Float32) { attr_type == pwr_eType_Float32) {
switch ( min_value1_db) {
case graph_eDatabase_Gdh:
sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&min_value1_p, sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&min_value1_p,
&min_value_subid1, attr_size, object); &min_value_subid1, attr_size, object);
break;
case graph_eDatabase_Local:
min_value1_p = (pwr_tFloat32 *) dyn->graph->localdb_ref_or_create( parsed_name, attr_type);
break;
default:
;
}
} }
max_value1_p = 0; max_value1_p = 0;
dyn->parse_attr_name( maxvalue_attr1, parsed_name, max_value1_db = dyn->parse_attr_name( maxvalue_attr1, parsed_name,
&inverted, &attr_type, &attr_size); &inverted, &attr_type, &attr_size);
if ( strcmp(parsed_name, "") != 0 && if ( strcmp(parsed_name, "") != 0 &&
attr_type == pwr_eType_Float32) { attr_type == pwr_eType_Float32) {
switch ( max_value1_db) {
case graph_eDatabase_Gdh:
sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&max_value1_p, sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&max_value1_p,
&max_value_subid1, attr_size, object); &max_value_subid1, attr_size, object);
break;
case graph_eDatabase_Local:
max_value1_p = (pwr_tFloat32 *) dyn->graph->localdb_ref_or_create( parsed_name, attr_type);
break;
default:
;
}
} }
min_value2_p = 0; min_value2_p = 0;
dyn->parse_attr_name( minvalue_attr2, parsed_name, dyn->parse_attr_name( minvalue_attr2, parsed_name,
...@@ -8319,11 +8355,11 @@ int GeTrend::disconnect( grow_tObject object) ...@@ -8319,11 +8355,11 @@ int GeTrend::disconnect( grow_tObject object)
if ( p2 && db2 == graph_eDatabase_Gdh) if ( p2 && db2 == graph_eDatabase_Gdh)
gdh_UnrefObjectInfo( subid2); gdh_UnrefObjectInfo( subid2);
p2 = 0; p2 = 0;
if ( min_value1_p) { if ( min_value1_p && min_value1_db == graph_eDatabase_Gdh) {
gdh_UnrefObjectInfo( min_value_subid1); gdh_UnrefObjectInfo( min_value_subid1);
min_value1_p = 0; min_value1_p = 0;
} }
if ( max_value1_p) { if ( max_value1_p && max_value1_db == graph_eDatabase_Gdh) {
gdh_UnrefObjectInfo( max_value_subid1); gdh_UnrefObjectInfo( max_value_subid1);
max_value1_p = 0; max_value1_p = 0;
} }
...@@ -15595,21 +15631,39 @@ int GeSlider::connect( grow_tObject object, glow_sTraceData *trace_data) ...@@ -15595,21 +15631,39 @@ int GeSlider::connect( grow_tObject object, glow_sTraceData *trace_data)
} }
min_value_p = 0; min_value_p = 0;
dyn->parse_attr_name( minvalue_attr, parsed_name, min_value_db = dyn->parse_attr_name( minvalue_attr, parsed_name,
&inverted, &a_type, &a_size); &inverted, &a_type, &a_size);
if ( strcmp(parsed_name, "") != 0 && if ( strcmp(parsed_name, "") != 0 &&
a_type == pwr_eType_Float32) { a_type == pwr_eType_Float32) {
switch ( min_value_db) {
case graph_eDatabase_Gdh:
sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&min_value_p, sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&min_value_p,
&min_value_subid, a_size, object); &min_value_subid, a_size, object);
break;
case graph_eDatabase_Local:
min_value_p = (pwr_tFloat32 *) dyn->graph->localdb_ref_or_create( parsed_name, a_type);
break;
default:
;
}
} }
max_value_p = 0; max_value_p = 0;
dyn->parse_attr_name( maxvalue_attr, parsed_name, max_value_db = dyn->parse_attr_name( maxvalue_attr, parsed_name,
&inverted, &a_type, &a_size); &inverted, &a_type, &a_size);
if ( strcmp(parsed_name, "") != 0 && if ( strcmp(parsed_name, "") != 0 &&
a_type == pwr_eType_Float32) { a_type == pwr_eType_Float32) {
switch ( max_value_db) {
case graph_eDatabase_Gdh:
sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&max_value_p, sts = dyn->graph->ref_object_info( dyn->cycle, parsed_name, (void **)&max_value_p,
&max_value_subid, a_size, object); &max_value_subid, a_size, object);
break;
case graph_eDatabase_Local:
max_value_p = (pwr_tFloat32 *) dyn->graph->localdb_ref_or_create( parsed_name, a_type);
break;
default:
;
}
} }
insensitive_p = 0; insensitive_p = 0;
...@@ -15637,11 +15691,11 @@ int GeSlider::disconnect( grow_tObject object) ...@@ -15637,11 +15691,11 @@ int GeSlider::disconnect( grow_tObject object)
gdh_UnrefObjectInfo( subid); gdh_UnrefObjectInfo( subid);
p = 0; p = 0;
if ( min_value_p) { if ( min_value_p && min_value_db == graph_eDatabase_Gdh) {
gdh_UnrefObjectInfo( min_value_subid); gdh_UnrefObjectInfo( min_value_subid);
min_value_p = 0; min_value_p = 0;
} }
if ( max_value_p) { if ( max_value_p && max_value_db == graph_eDatabase_Gdh) {
gdh_UnrefObjectInfo( max_value_subid); gdh_UnrefObjectInfo( max_value_subid);
max_value_p = 0; max_value_p = 0;
} }
......
...@@ -2472,6 +2472,8 @@ class GeSlider : public GeDynElem { ...@@ -2472,6 +2472,8 @@ class GeSlider : public GeDynElem {
pwr_tFloat32 old_max_value; pwr_tFloat32 old_max_value;
pwr_tSubid min_value_subid; pwr_tSubid min_value_subid;
pwr_tSubid max_value_subid; pwr_tSubid max_value_subid;
graph_eDatabase min_value_db;
graph_eDatabase max_value_db;
pwr_tBoolean *insensitive_p; pwr_tBoolean *insensitive_p;
pwr_tSubid insensitive_subid; pwr_tSubid insensitive_subid;
int insensitive_inverted; int insensitive_inverted;
...@@ -2521,6 +2523,8 @@ class GeBar : public GeDynElem { ...@@ -2521,6 +2523,8 @@ class GeBar : public GeDynElem {
pwr_tFloat32 old_max_value; pwr_tFloat32 old_max_value;
pwr_tSubid min_value_subid; pwr_tSubid min_value_subid;
pwr_tSubid max_value_subid; pwr_tSubid max_value_subid;
graph_eDatabase min_value_db;
graph_eDatabase max_value_db;
GeBar( GeDyn *e_dyn) : GeBar( GeDyn *e_dyn) :
GeDynElem(e_dyn, ge_mDynType1_Bar, ge_mDynType2_No, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Bar), GeDynElem(e_dyn, ge_mDynType1_Bar, ge_mDynType2_No, ge_mActionType1_No, ge_mActionType2_No, ge_eDynPrio_Bar),
...@@ -2577,6 +2581,8 @@ class GeTrend : public GeDynElem { ...@@ -2577,6 +2581,8 @@ class GeTrend : public GeDynElem {
pwr_tSubid max_value_subid1; pwr_tSubid max_value_subid1;
pwr_tFloat32 *min_value2_p; pwr_tFloat32 *min_value2_p;
pwr_tFloat32 *max_value2_p; pwr_tFloat32 *max_value2_p;
graph_eDatabase min_value1_db;
graph_eDatabase max_value1_db;
pwr_tFloat32 old_min_value2; pwr_tFloat32 old_min_value2;
pwr_tFloat32 old_max_value2; pwr_tFloat32 old_max_value2;
pwr_tSubid min_value_subid2; pwr_tSubid min_value_subid2;
......
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