Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
d640e350
Commit
d640e350
authored
Oct 30, 2018
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge dynamics, only one of the min/max attributes need to be set in axis, bar and trend
parent
b2db246e
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
184 additions
and
17 deletions
+184
-17
xtt/lib/ge/src/ge_dyn.cpp
xtt/lib/ge/src/ge_dyn.cpp
+83
-17
xtt/lib/glow/src/glow_growapi.cpp
xtt/lib/glow/src/glow_growapi.cpp
+18
-0
xtt/lib/glow/src/glow_growapi.h
xtt/lib/glow/src/glow_growapi.h
+25
-0
xtt/lib/glow/src/glow_growaxis.cpp
xtt/lib/glow/src/glow_growaxis.cpp
+10
-0
xtt/lib/glow/src/glow_growaxis.h
xtt/lib/glow/src/glow_growaxis.h
+6
-0
xtt/lib/glow/src/glow_growaxisarc.cpp
xtt/lib/glow/src/glow_growaxisarc.cpp
+10
-0
xtt/lib/glow/src/glow_growaxisarc.h
xtt/lib/glow/src/glow_growaxisarc.h
+6
-0
xtt/lib/glow/src/glow_growbar.cpp
xtt/lib/glow/src/glow_growbar.cpp
+6
-0
xtt/lib/glow/src/glow_growbar.h
xtt/lib/glow/src/glow_growbar.h
+7
-0
xtt/lib/glow/src/glow_growtrend.cpp
xtt/lib/glow/src/glow_growtrend.cpp
+12
-0
xtt/lib/glow/src/glow_growtrend.h
xtt/lib/glow/src/glow_growtrend.h
+1
-0
No files found.
xtt/lib/ge/src/ge_dyn.cpp
View file @
d640e350
...
...
@@ -9746,13 +9746,32 @@ int GeBar::scan(grow_tObject object)
if
(
!
p
)
return
1
;
if
(
max_value_p
&&
min_value_p
)
{
pwr_tFloat32
maxval
=
*
max_value_p
;
pwr_tFloat32
minval
=
*
min_value_p
;
if
(
max_value_p
||
min_value_p
)
{
bool
update
=
false
;
pwr_tFloat32
maxval
;
pwr_tFloat32
minval
;
if
(
max_value_p
)
{
maxval
=
*
max_value_p
;
if
(
!
feqf
(
maxval
,
old_max_value
))
update
=
true
;
}
if
(
min_value_p
)
{
minval
=
*
min_value_p
;
if
(
!
feqf
(
minval
,
old_min_value
))
update
=
true
;
}
if
(
update
)
{
double
minvald
,
maxvald
;
grow_GetBarRange
(
object
,
&
minvald
,
&
maxvald
);
if
(
!
min_value_p
)
minval
=
minvald
;
if
(
!
max_value_p
)
maxval
=
maxvald
;
if
(
!
feqf
(
maxval
,
old_max_value
)
||
!
feqf
(
minval
,
old_min_value
))
{
if
(
fabsf
(
maxval
-
minval
)
>
FLT_EPSILON
)
{
grow_SetBarRange
(
object
,
double
(
minval
),
double
(
maxval
)
);
grow_SetBarRange
(
object
,
minval
,
maxval
);
}
old_min_value
=
minval
;
old_max_value
=
maxval
;
...
...
@@ -10275,24 +10294,64 @@ int GeTrend::scan(grow_tObject object)
if
(
trend_hold
)
return
1
;
if
(
max_value1_p
&&
min_value1_p
)
{
pwr_tFloat32
maxval
=
*
max_value1_p
;
pwr_tFloat32
minval
=
*
min_value1_p
;
if
(
!
feqf
(
maxval
,
old_max_value1
)
||
!
feqf
(
minval
,
old_min_value1
))
{
if
(
max_value1_p
||
min_value1_p
)
{
bool
update
=
false
;
pwr_tFloat32
maxval
;
pwr_tFloat32
minval
;
if
(
max_value1_p
)
{
maxval
=
*
max_value1_p
;
if
(
!
feqf
(
maxval
,
old_max_value1
))
update
=
true
;
}
if
(
min_value1_p
)
{
minval
=
*
min_value1_p
;
if
(
!
feqf
(
minval
,
old_min_value1
))
update
=
true
;
}
if
(
update
)
{
double
minvald
,
maxvald
;
grow_GetTrendRangeY
(
object
,
0
,
&
minvald
,
&
maxvald
);
if
(
!
min_value1_p
)
minval
=
minvald
;
if
(
!
max_value1_p
)
maxval
=
maxvald
;
if
(
fabsf
(
maxval
-
minval
)
>
FLT_EPSILON
)
{
grow_SetTrendRangeY
(
object
,
0
,
double
(
minval
),
double
(
maxval
)
);
grow_SetTrendRangeY
(
object
,
0
,
minval
,
maxval
);
}
old_min_value1
=
minval
;
old_max_value1
=
maxval
;
}
}
if
(
max_value2_p
&&
min_value2_p
)
{
pwr_tFloat32
maxval
=
*
max_value2_p
;
pwr_tFloat32
minval
=
*
min_value2_p
;
if
(
!
feqf
(
maxval
,
old_max_value2
)
||
!
feqf
(
minval
,
old_min_value2
))
{
if
(
max_value2_p
||
min_value2_p
)
{
bool
update
=
false
;
pwr_tFloat32
maxval
;
pwr_tFloat32
minval
;
if
(
max_value2_p
)
{
maxval
=
*
max_value2_p
;
if
(
!
feqf
(
maxval
,
old_max_value2
))
update
=
true
;
}
if
(
min_value2_p
)
{
minval
=
*
min_value2_p
;
if
(
!
feqf
(
minval
,
old_min_value2
))
update
=
true
;
}
if
(
update
)
{
double
minvald
,
maxvald
;
grow_GetTrendRangeY
(
object
,
1
,
&
minvald
,
&
maxvald
);
if
(
!
min_value2_p
)
minval
=
minvald
;
if
(
!
max_value2_p
)
maxval
=
maxvald
;
if
(
fabsf
(
maxval
-
minval
)
>
FLT_EPSILON
)
{
grow_SetTrendRangeY
(
object
,
1
,
double
(
minval
),
double
(
maxval
)
);
grow_SetTrendRangeY
(
object
,
1
,
minval
,
maxval
);
}
old_min_value2
=
minval
;
old_max_value2
=
maxval
;
...
...
@@ -13709,6 +13768,11 @@ int GeAxis::connect(grow_tObject object, glow_sTraceData* trace_data, bool now)
int
min_found
=
0
;
int
max_found
=
0
;
int
db
;
glow_sAxisInfo
info
;
grow_GetAxisInfo
(
object
,
&
info
);
min_value
=
info
.
min_value
;
max_value
=
info
.
max_value
;
imin_value
=
(
int
)(
min_value
+
(
min_value
>=
0
?
1
:
-
1
)
*
0.5
);
imax_value
=
(
int
)(
max_value
+
(
max_value
>=
0
?
1
:
-
1
)
*
0.5
);
...
...
@@ -15002,9 +15066,11 @@ int GeFillLevel::scan(grow_tObject object)
if
(
!
p
)
return
1
;
if
(
max_value_p
&&
min_value_p
&&
(
!
feqf
(
*
max_value_p
,
max_value
)
||
!
feqf
(
*
min_value_p
,
min_value
)))
{
if
(
min_value_p
&&
!
feqf
(
*
min_value_p
,
min_value
))
{
min_value
=
*
min_value_p
;
first_scan
=
1
;
}
if
(
max_value_p
&&
!
feqf
(
*
max_value_p
,
max_value
))
{
max_value
=
*
max_value_p
;
first_scan
=
1
;
}
...
...
xtt/lib/glow/src/glow_growapi.cpp
View file @
d640e350
...
...
@@ -4693,11 +4693,21 @@ void grow_SetSliderRange(grow_tObject object, double min, double max)
((
GrowSlider
*
)
object
)
->
set_range
(
min
,
max
);
}
void
grow_GetBarRange
(
grow_tObject
object
,
double
*
min
,
double
*
max
)
{
((
GrowBar
*
)
object
)
->
get_range
(
min
,
max
);
}
void
grow_SetBarRange
(
grow_tObject
object
,
double
min
,
double
max
)
{
((
GrowBar
*
)
object
)
->
set_range
(
min
,
max
);
}
void
grow_GetTrendRangeY
(
grow_tObject
object
,
int
curve
,
double
*
min
,
double
*
max
)
{
((
GrowTrend
*
)
object
)
->
get_range_y
(
curve
,
min
,
max
);
}
void
grow_SetTrendRangeY
(
grow_tObject
object
,
int
curve
,
double
min
,
double
max
)
{
((
GrowTrend
*
)
object
)
->
set_range_y
(
curve
,
min
,
max
);
...
...
@@ -5209,6 +5219,14 @@ void grow_SetAxisInfo(grow_tObject object, glow_sAxisInfo* info)
((
GrowAxisArc
*
)
object
)
->
set_axis_info
(
info
);
}
void
grow_GetAxisInfo
(
grow_tObject
object
,
glow_sAxisInfo
*
info
)
{
if
(((
GlowArrayElem
*
)
object
)
->
type
()
==
glow_eObjectType_GrowAxis
)
((
GrowAxis
*
)
object
)
->
get_axis_info
(
info
);
else
if
(((
GlowArrayElem
*
)
object
)
->
type
()
==
glow_eObjectType_GrowAxisArc
)
((
GrowAxisArc
*
)
object
)
->
get_axis_info
(
info
);
}
void
grow_SetTableInfo
(
grow_tObject
object
,
glow_sTableInfo
*
info
)
{
((
GrowTable
*
)
object
)
->
set_table_info
(
info
);
...
...
xtt/lib/glow/src/glow_growapi.h
View file @
d640e350
...
...
@@ -2311,6 +2311,14 @@ int grow_IsSubGraph(grow_tCtx ctx);
*/
void
grow_SetSliderRange
(
grow_tObject
object
,
double
min
,
double
max
);
//! Get the range of a bar object.
/*!
\param object Bar object.
\param min Minimum value of range.
\param max Maximum value of range.
*/
void
grow_GetBarRange
(
grow_tObject
object
,
double
*
min
,
double
*
max
);
//! Set the range of a bar object.
/*!
\param object Bar object.
...
...
@@ -2326,6 +2334,16 @@ void grow_SetBarRange(grow_tObject object, double min, double max);
*/
void
grow_SetTrendFillCurve
(
grow_tObject
object
,
int
fill
);
//! Get the range of a trend object.
/*!
\param object Trend object.
\param curve Curve number.
\param min Minimum value of range.
\param max Maximum value of range.
*/
void
grow_GetTrendRangeY
(
grow_tObject
object
,
int
curve
,
double
*
min
,
double
*
max
);
//! Set the range of a trend object.
/*!
\param object Trend object.
...
...
@@ -3059,6 +3077,13 @@ void grow_GetBarInfo(grow_tObject object, glow_sBarInfo* info);
*/
void
grow_SetAxisInfo
(
grow_tObject
object
,
glow_sAxisInfo
*
info
);
//! Get parameters for an axis object.
/*!
\param object Axis object.
\param info Info struct.
*/
void
grow_GetAxisInfo
(
grow_tObject
object
,
glow_sAxisInfo
*
info
);
//! Conversion between different versions of Glow
/*!
\param ctx Grow context.
...
...
xtt/lib/glow/src/glow_growaxis.cpp
View file @
d640e350
...
...
@@ -952,6 +952,16 @@ void GrowAxis::set_axis_info(glow_sAxisInfo* info)
strcpy
(
format
,
info
->
format
);
}
void
GrowAxis
::
get_axis_info
(
glow_sAxisInfo
*
info
)
{
info
->
max_value
=
max_value
;
info
->
min_value
=
min_value
;
info
->
lines
=
lines
;
info
->
longquotient
=
longquotient
;
info
->
valuequotient
=
valuequotient
;
strcpy
(
info
->
format
,
format
);
}
void
GrowAxis
::
format_text
(
char
*
text
,
char
*
fmt
,
double
value
)
{
if
(
streq
(
fmt
,
"%1t"
))
{
...
...
xtt/lib/glow/src/glow_growaxis.h
View file @
d640e350
...
...
@@ -215,6 +215,12 @@ public:
*/
void
set_axis_info
(
glow_sAxisInfo
*
info
);
//! Get parameters for the axis.
/*!
\param info Info struct.
*/
void
get_axis_info
(
glow_sAxisInfo
*
info
);
//! Export the object as a javabean.
/*!
\param t Transform of parent node. Can be zero.
...
...
xtt/lib/glow/src/glow_growaxisarc.cpp
View file @
d640e350
...
...
@@ -770,6 +770,16 @@ void GrowAxisArc::set_axis_info(glow_sAxisInfo* info)
strcpy
(
format
,
info
->
format
);
}
void
GrowAxisArc
::
get_axis_info
(
glow_sAxisInfo
*
info
)
{
info
->
max_value
=
max_value
;
info
->
min_value
=
min_value
;
info
->
lines
=
lines
;
info
->
longquotient
=
longquotient
;
info
->
valuequotient
=
valuequotient
;
strcpy
(
info
->
format
,
format
);
}
void
GrowAxisArc
::
format_text
(
char
*
text
,
char
*
fmt
,
double
value
)
{
if
(
streq
(
fmt
,
"%1t"
))
{
...
...
xtt/lib/glow/src/glow_growaxisarc.h
View file @
d640e350
...
...
@@ -215,6 +215,12 @@ public:
*/
void
set_axis_info
(
glow_sAxisInfo
*
info
);
//! Get parameters for the axis.
/*!
\param info Info struct.
*/
void
get_axis_info
(
glow_sAxisInfo
*
info
);
//! Export the object as a javabean.
/*!
\param t Transform of parent node. Can be zero.
...
...
xtt/lib/glow/src/glow_growbar.cpp
View file @
d640e350
...
...
@@ -559,6 +559,12 @@ void GrowBar::get_trace_attr(GlowTraceData** attr)
*
attr
=
&
trace
;
}
void
GrowBar
::
get_range
(
double
*
min
,
double
*
max
)
{
*
max
=
max_value
;
*
min
=
min_value
;
}
void
GrowBar
::
set_range
(
double
min
,
double
max
)
{
max_value
=
max
;
...
...
xtt/lib/glow/src/glow_growbar.h
View file @
d640e350
...
...
@@ -217,6 +217,13 @@ public:
*/
void
align
(
double
x
,
double
y
,
glow_eAlignDirection
direction
);
//! Get the range for the bar value
/*!
\param min Min value.
\param max Max value.
*/
void
get_range
(
double
*
min
,
double
*
max
);
//! Set the range for the bar value
/*!
\param min Min value.
...
...
xtt/lib/glow/src/glow_growtrend.cpp
View file @
d640e350
...
...
@@ -949,6 +949,18 @@ void GrowTrend::set_scan_time(double time)
configure_curves
();
}
//! Get the range for the specified trend in y direction.
/*!
\param curve Number of curve.
\param min Min value.
\param max Max value.
*/
void
GrowTrend
::
get_range_y
(
int
curve
,
double
*
min
,
double
*
max
)
{
*
max
=
y_max_value
[
curve
];
*
min
=
y_min_value
[
curve
];
}
//! Set the range for the specified trend in y direction.
/*!
\param curve Number of curve.
...
...
xtt/lib/glow/src/glow_growtrend.h
View file @
d640e350
...
...
@@ -167,6 +167,7 @@ public:
*
time
=
scan_time
;
}
void
get_range_y
(
int
curve
,
double
*
min
,
double
*
max
);
void
set_range_y
(
int
curve
,
double
min
,
double
max
);
//! Set fill for curves.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment