Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
98d2cf8b
Commit
98d2cf8b
authored
8 years ago
by
Cedric Roux
Browse files
Options
Downloads
Patches
Plain Diff
add X functions to plot points
parent
062f7fad
Loading
Loading
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/utils/T/tracer/gui/x.c
+28
-0
28 additions, 0 deletions
common/utils/T/tracer/gui/x.c
common/utils/T/tracer/gui/x.h
+6
-0
6 additions, 0 deletions
common/utils/T/tracer/gui/x.h
common/utils/T/tracer/gui/x_defs.h
+3
-0
3 additions, 0 deletions
common/utils/T/tracer/gui/x_defs.h
with
37 additions
and
0 deletions
common/utils/T/tracer/gui/x.c
+
28
−
0
View file @
98d2cf8b
...
...
@@ -286,3 +286,31 @@ void x_draw(x_connection *_c, x_window *_w)
printf
(
"x_draw XCopyArea w h %d %d display %p window %d pixmap %d
\n
"
,
w
->
width
,
w
->
height
,
c
->
d
,
(
int
)
w
->
w
,
(
int
)
w
->
p
);
XCopyArea
(
c
->
d
,
w
->
p
,
w
->
w
,
c
->
colors
[
1
],
0
,
0
,
w
->
width
,
w
->
height
,
0
,
0
);
}
/* those two special functions are to plot many points
* first call x_add_point many times then x_plot_points once
*/
void
x_add_point
(
x_connection
*
_c
,
int
x
,
int
y
)
{
struct
x_connection
*
c
=
_c
;
if
(
c
->
pts_size
==
c
->
pts_maxsize
)
{
c
->
pts_maxsize
+=
65536
;
c
->
pts
=
realloc
(
c
->
pts
,
c
->
pts_maxsize
*
sizeof
(
XPoint
));
if
(
c
->
pts
==
NULL
)
OOM
;
}
c
->
pts
[
c
->
pts_size
].
x
=
x
;
c
->
pts
[
c
->
pts_size
].
y
=
y
;
c
->
pts_size
++
;
}
void
x_plot_points
(
x_connection
*
_c
,
x_window
*
_w
,
int
color
)
{
struct
x_connection
*
c
=
_c
;
fprintf
(
stderr
,
"x_plot_points %d points
\n
"
,
c
->
pts_size
);
struct
x_window
*
w
=
_w
;
XDrawPoints
(
c
->
d
,
w
->
p
,
c
->
colors
[
color
],
c
->
pts
,
c
->
pts_size
,
CoordModeOrigin
);
c
->
pts_size
=
0
;
}
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/gui/x.h
+
6
−
0
View file @
98d2cf8b
...
...
@@ -41,6 +41,12 @@ void x_fill_rectangle(x_connection *c, x_window *w, int color,
void
x_draw_string
(
x_connection
*
_c
,
x_window
*
_w
,
int
color
,
int
x
,
int
y
,
const
char
*
t
);
/* specials functions to plot many points
* you call several times x_add_point() then x_plot_points()
*/
void
x_add_point
(
x_connection
*
c
,
int
x
,
int
y
);
void
x_plot_points
(
x_connection
*
c
,
x_window
*
w
,
int
color
);
/* this function copies the pixmap to the window */
void
x_draw
(
x_connection
*
c
,
x_window
*
w
);
...
...
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/gui/x_defs.h
+
3
−
0
View file @
98d2cf8b
...
...
@@ -7,6 +7,9 @@ struct x_connection {
Display
*
d
;
GC
*
colors
;
int
ncolors
;
XPoint
*
pts
;
int
pts_size
;
int
pts_maxsize
;
};
struct
x_window
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment