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
19ddf10b
Commit
19ddf10b
authored
Feb 03, 2017
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge xy-curve and trend. Dynamic horizontal and vertical marker added in java
parent
e39f8995
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
383 additions
and
7 deletions
+383
-7
java/jpwr/jopg/src/Dyn.java
java/jpwr/jopg/src/Dyn.java
+256
-7
java/jpwr/jopg/src/GrowTrend.java
java/jpwr/jopg/src/GrowTrend.java
+105
-0
java/jpwr/jopg/src/GrowXYCurve.java
java/jpwr/jopg/src/GrowXYCurve.java
+22
-0
No files found.
java/jpwr/jopg/src/Dyn.java
View file @
19ddf10b
This diff is collapsed.
Click to expand it.
java/jpwr/jopg/src/GrowTrend.java
View file @
19ddf10b
...
...
@@ -66,6 +66,16 @@ public class GrowTrend extends GrowRect {
int
curve_cnt
=
1
;
TraceData
trace
=
new
TraceData
();
Object
userdata
;
int
display_x_mark1
=
0
;
int
display_x_mark2
=
0
;
int
display_y_mark1
=
0
;
int
display_y_mark2
=
0
;
double
x_mark1
;
double
x_mark2
;
double
y_mark1
;
double
y_mark2
;
int
mark1_color
;
int
mark2_color
;
public
GrowTrend
(
GrowCmn
cmn
)
{
super
(
cmn
);
...
...
@@ -361,6 +371,60 @@ public class GrowTrend extends GrowRect {
curve
[
i
].
fill
=
1
;
}
}
if
(
display_x_mark1
!=
0
)
{
int
xm
;
if
(
t
==
null
)
xm
=
(
int
)(
trf
.
x
(
x_mark1
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_x
)
-
cmn
.
mw
.
offset_x
;
else
xm
=
(
int
)(
trf
.
x
(
t
,
x_mark1
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_x
)
-
cmn
.
mw
.
offset_x
;
if
(
xm
>=
ll_x
&&
xm
<=
ur_x
)
{
drawtype
=
mark1_color
;
if
(
drawtype
==
Glow
.
eDrawType_Inherit
)
drawtype
=
Glow
.
eDrawType_ColorYellow
;
cmn
.
gdraw
.
line
(
xm
,
ll_y
,
xm
,
ur_y
,
drawtype
,
idx
,
0
);
}
}
if
(
display_x_mark2
!=
0
)
{
int
xm
;
if
(
t
==
null
)
xm
=
(
int
)(
trf
.
x
(
x_mark2
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_x
)
-
cmn
.
mw
.
offset_x
;
else
xm
=
(
int
)(
trf
.
x
(
t
,
x_mark2
,
ll
.
y
)
*
cmn
.
mw
.
zoom_factor_x
)
-
cmn
.
mw
.
offset_x
;
if
(
xm
>=
ll_x
&&
xm
<=
ur_x
)
{
drawtype
=
mark2_color
;
if
(
drawtype
==
Glow
.
eDrawType_Inherit
)
drawtype
=
Glow
.
eDrawType_ColorYellow
;
cmn
.
gdraw
.
line
(
xm
,
ll_y
,
xm
,
ur_y
,
drawtype
,
idx
,
0
);
}
}
if
(
display_y_mark1
!=
0
)
{
int
ym
;
if
(
t
==
null
)
ym
=
(
int
)(
trf
.
y
(
ll
.
x
,
y_mark1
)
*
cmn
.
mw
.
zoom_factor_y
)
-
cmn
.
mw
.
offset_y
;
else
ym
=
(
int
)(
trf
.
y
(
t
,
ll
.
x
,
y_mark1
)
*
cmn
.
mw
.
zoom_factor_y
)
-
cmn
.
mw
.
offset_y
;
if
(
ym
>=
ll_y
&&
ym
<=
ur_y
)
{
drawtype
=
mark1_color
;
if
(
drawtype
==
Glow
.
eDrawType_Inherit
)
drawtype
=
Glow
.
eDrawType_ColorYellow
;
cmn
.
gdraw
.
line
(
ll_x
,
ym
,
ur_x
,
ym
,
drawtype
,
idx
,
0
);
}
}
if
(
display_y_mark2
!=
0
)
{
int
ym
;
if
(
t
==
null
)
ym
=
(
int
)(
trf
.
y
(
ll
.
x
,
y_mark2
)
*
cmn
.
mw
.
zoom_factor_y
)
-
cmn
.
mw
.
offset_y
;
else
ym
=
(
int
)(
trf
.
y
(
t
,
ll
.
x
,
y_mark2
)
*
cmn
.
mw
.
zoom_factor_y
)
-
cmn
.
mw
.
offset_y
;
if
(
ym
>=
ll_y
&&
ym
<=
ur_y
)
{
drawtype
=
mark2_color
;
if
(
drawtype
==
Glow
.
eDrawType_Inherit
)
drawtype
=
Glow
.
eDrawType_ColorYellow
;
cmn
.
gdraw
.
line
(
ll_x
,
ym
,
ur_x
,
ym
,
drawtype
,
idx
,
0
);
}
}
if
(
border
!=
0
)
{
cmn
.
gdraw
.
rect
(
ll_x
,
ll_y
,
ur_x
-
ll_x
,
ur_y
-
ll_y
,
drawtype
,
idx
,
0
);
}
...
...
@@ -441,6 +505,18 @@ public class GrowTrend extends GrowRect {
public
void
set_range_y
(
int
curve
,
double
min
,
double
max
)
{
if
(
!(
curve
==
0
||
curve
==
1
))
return
;
if
(
curve
==
0
)
{
if
(
display_y_mark1
!=
0
)
{
double
mark
=
y_min_value
[
0
]
-
(
y_mark1
-
ur
.
y
)
*(
y_max_value
[
0
]
-
y_min_value
[
0
])
/
(
ur
.
y
-
ll
.
y
);
y_mark1
=
ur
.
y
-
(
mark
-
min
)
/
(
max
-
min
)
*
(
ur
.
y
-
ll
.
y
);
}
if
(
display_y_mark2
!=
0
)
{
double
mark
=
y_min_value
[
0
]
-
(
y_mark2
-
ur
.
y
)
*(
y_max_value
[
0
]
-
y_min_value
[
0
])
/
(
ur
.
y
-
ll
.
y
);
y_mark2
=
ur
.
y
-
(
mark
-
min
)
/
(
max
-
min
)
*
(
ur
.
y
-
ll
.
y
);
}
}
y_max_value
[
curve
]
=
max
;
y_min_value
[
curve
]
=
min
;
configure_curves
();
...
...
@@ -474,4 +550,33 @@ public class GrowTrend extends GrowRect {
public
int
get_no_of_points
()
{
return
no_of_points
;
}
public
void
set_x_mark1
(
double
mark
)
{
display_x_mark1
=
1
;
x_mark1
=
ll
.
x
+
(
mark
-
x_min_value
[
0
])
/
(
x_max_value
[
0
]
-
x_min_value
[
0
])
*
(
ur
.
x
-
ll
.
x
);
draw
();
}
public
void
set_x_mark2
(
double
mark
)
{
display_x_mark2
=
1
;
x_mark2
=
ll
.
x
+
(
mark
-
x_min_value
[
0
])
/
(
x_max_value
[
0
]
-
x_min_value
[
0
])
*
(
ur
.
x
-
ll
.
x
);
draw
();
}
public
void
set_y_mark1
(
double
mark
)
{
display_y_mark1
=
1
;
y_mark1
=
ur
.
y
-
(
mark
-
y_min_value
[
0
])
/
(
y_max_value
[
0
]
-
y_min_value
[
0
])
*
(
ur
.
y
-
ll
.
y
);
draw
();
}
public
void
set_y_mark2
(
double
mark
)
{
display_y_mark2
=
1
;
y_mark2
=
ur
.
y
-
(
mark
-
y_min_value
[
0
])
/
(
y_max_value
[
0
]
-
y_min_value
[
0
])
*
(
ur
.
y
-
ll
.
y
);
draw
();
}
public
void
set_mark_color
(
int
m1color
,
int
m2color
){
mark1_color
=
m1color
;
mark2_color
=
m2color
;
}
}
java/jpwr/jopg/src/GrowXYCurve.java
View file @
19ddf10b
...
...
@@ -97,6 +97,16 @@ public class GrowXYCurve extends GrowTrend {
public
void
set_xy_range_x
(
int
curve
,
double
min
,
double
max
)
{
if
(
curve
>
Glow
.
TREND_MAX_CURVES
||
curve
<
0
)
return
;
if
(
curve
==
0
)
{
if
(
display_x_mark1
!=
0
)
{
double
mark
=
(
x_mark1
-
ll
.
x
)
*
(
x_max_value
[
0
]
-
x_min_value
[
0
])
/
(
ur
.
x
-
ll
.
x
)
+
x_min_value
[
0
];
x_mark1
=
ll
.
x
+
(
mark
-
min
)
/
(
max
-
min
)
*
(
ur
.
x
-
ll
.
x
);
}
if
(
display_x_mark2
!=
0
)
{
double
mark
=
(
x_mark2
-
ll
.
x
)
*
(
x_max_value
[
0
]
-
x_min_value
[
0
])
/
(
ur
.
x
-
ll
.
x
)
+
x_min_value
[
0
];
x_mark2
=
ll
.
x
+
(
mark
-
min
)
/
(
max
-
min
)
*
(
ur
.
x
-
ll
.
x
);
}
}
x_max_value
[
curve
]
=
max
;
x_min_value
[
curve
]
=
min
;
}
...
...
@@ -104,6 +114,18 @@ public class GrowXYCurve extends GrowTrend {
public
void
set_xy_range_y
(
int
curve
,
double
min
,
double
max
)
{
if
(
curve
>
Glow
.
TREND_MAX_CURVES
||
curve
<
0
)
return
;
if
(
curve
==
0
)
{
if
(
display_y_mark1
!=
0
)
{
double
mark
=
y_min_value
[
0
]
-
(
y_mark1
-
ur
.
y
)
*(
y_max_value
[
0
]
-
y_min_value
[
0
])
/
(
ur
.
y
-
ll
.
y
);
y_mark1
=
ur
.
y
-
(
mark
-
min
)
/
(
max
-
min
)
*
(
ur
.
y
-
ll
.
y
);
}
if
(
display_y_mark2
!=
0
)
{
double
mark
=
y_min_value
[
0
]
-
(
y_mark2
-
ur
.
y
)
*(
y_max_value
[
0
]
-
y_min_value
[
0
])
/
(
ur
.
y
-
ll
.
y
);
y_mark2
=
ur
.
y
-
(
mark
-
min
)
/
(
max
-
min
)
*
(
ur
.
y
-
ll
.
y
);
}
}
y_max_value
[
curve
]
=
max
;
y_min_value
[
curve
]
=
min
;
}
...
...
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