Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
ZhouShuya
OpenXG-RAN
Commits
a1aa6658
Commit
a1aa6658
authored
8 years ago
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flip vertically XY plot, it was plotted the other way around
parent
71b5c59f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
common/utils/T/tracer/gui/xy_plot.c
common/utils/T/tracer/gui/xy_plot.c
+11
-8
No files found.
common/utils/T/tracer/gui/xy_plot.c
View file @
a1aa6658
...
...
@@ -22,10 +22,17 @@ static void paint(gui *_gui, widget *_this)
float
center
;
int
i
;
# define FLIP(v) (-(v) + allocated_plot_height-1)
printf
(
"PAINT xy plot xywh %d %d %d %d
\n
"
,
this
->
common
.
x
,
this
->
common
.
y
,
this
->
common
.
width
,
this
->
common
.
height
);
//x_draw_rectangle(g->x, g->xwin, 1, this->common.x, this->common.y, this->common.width, this->common.height);
wanted_plot_width
=
this
->
wanted_width
;
allocated_plot_width
=
this
->
common
.
width
-
this
->
vrule_width
;
wanted_plot_height
=
this
->
wanted_height
;
allocated_plot_height
=
this
->
common
.
height
-
this
->
label_height
*
2
;
/* plot zone */
/* TODO: refine height - height of hrule text may be != from label */
x_draw_rectangle
(
g
->
x
,
g
->
xwin
,
1
,
...
...
@@ -35,8 +42,6 @@ printf("PAINT xy plot xywh %d %d %d %d\n", this->common.x, this->common.y, this-
this
->
common
.
height
-
this
->
label_height
*
2
);
/* horizontal tics */
wanted_plot_width
=
this
->
wanted_width
;
allocated_plot_width
=
this
->
common
.
width
-
this
->
vrule_width
;
pxsize
=
(
this
->
xmax
-
this
->
xmin
)
/
wanted_plot_width
;
ticdist
=
100
;
tic
=
floor
(
log10
(
ticdist
*
pxsize
));
...
...
@@ -83,8 +88,6 @@ printf("tic k %d val %g x %g\n", k, k * ticstep, x);
}
/* vertical tics */
wanted_plot_height
=
this
->
wanted_height
;
allocated_plot_height
=
this
->
common
.
height
-
this
->
label_height
*
2
;
pxsize
=
(
this
->
ymax
-
this
->
ymin
)
/
wanted_plot_height
;
ticdist
=
30
;
tic
=
floor
(
log10
(
ticdist
*
pxsize
));
...
...
@@ -115,12 +118,12 @@ printf("ymin/max %g %g height wanted allocated %d %d alloc ymin/max %g %g ticste
x_text_get_dimensions
(
g
->
x
,
v
,
&
vwidth
,
&
dummy
,
&
dummy
);
x_draw_line
(
g
->
x
,
g
->
xwin
,
FOREGROUND_COLOR
,
this
->
common
.
x
+
this
->
vrule_width
,
this
->
common
.
y
+
y
,
this
->
common
.
y
+
FLIP
(
y
)
,
this
->
common
.
x
+
this
->
vrule_width
+
5
,
this
->
common
.
y
+
y
);
this
->
common
.
y
+
FLIP
(
y
)
);
x_draw_string
(
g
->
x
,
g
->
xwin
,
FOREGROUND_COLOR
,
this
->
common
.
x
+
this
->
vrule_width
-
vwidth
-
2
,
this
->
common
.
y
+
y
-
this
->
label_height
/
2
+
this
->
label_baseline
,
this
->
common
.
y
+
FLIP
(
y
)
-
this
->
label_height
/
2
+
this
->
label_baseline
,
v
);
}
...
...
@@ -145,7 +148,7 @@ printf("ymin/max %g %g height wanted allocated %d %d alloc ymin/max %g %g ticste
y
>=
0
&&
y
<
allocated_plot_height
)
x_add_point
(
g
->
x
,
this
->
common
.
x
+
this
->
vrule_width
+
x
,
this
->
common
.
y
+
y
);
this
->
common
.
y
+
FLIP
(
y
)
);
}
x_plot_points
(
g
->
x
,
g
->
xwin
,
FOREGROUND_COLOR
);
}
...
...
This diff is collapsed.
Click to expand it.
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