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
2e7ab60d
Commit
2e7ab60d
authored
8 years ago
by
Cedric Roux
Browse files
Options
Downloads
Patches
Plain Diff
zoom in/out in timeline
parent
7d1665fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/utils/T/tracer/gui/gui.h
+2
-0
2 additions, 0 deletions
common/utils/T/tracer/gui/gui.h
common/utils/T/tracer/gui/timeline.c
+16
-0
16 additions, 0 deletions
common/utils/T/tracer/gui/timeline.c
common/utils/T/tracer/view/time.c
+26
-1
26 additions, 1 deletion
common/utils/T/tracer/view/time.c
with
44 additions
and
1 deletion
common/utils/T/tracer/gui/gui.h
+
2
−
0
View file @
2e7ab60d
...
...
@@ -81,6 +81,8 @@ int new_color(gui *gui, char *color);
* - click { int: button } (if enabled)
* - timeline
* - resize { int: width }
* - scrollup { void *: NULL }
* - scrolldown { void *: NULL }
*/
/* same type as in gui_defs.h */
...
...
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/gui/timeline.c
+
16
−
0
View file @
2e7ab60d
...
...
@@ -54,6 +54,21 @@ static void allocate(gui *_gui, widget *_this,
gui_notify
(
_gui
,
"resize"
,
_this
,
&
width
);
}
static
void
button
(
gui
*
_g
,
widget
*
_this
,
int
x
,
int
y
,
int
button
,
int
up
)
{
struct
gui
*
g
=
_g
;
struct
timeline_widget
*
this
=
_this
;
LOGD
(
"BUTTON timeline %p xy %d %d button %d up %d
\n
"
,
_this
,
x
,
y
,
button
,
up
);
/* scroll up */
if
(
button
==
4
&&
up
==
0
)
{
gui_notify
(
g
,
"scrollup"
,
_this
,
NULL
);
}
/* scroll down */
if
(
button
==
5
&&
up
==
0
)
{
gui_notify
(
g
,
"scrolldown"
,
_this
,
NULL
);
}
}
/*************************************************************************/
/* creation function */
/*************************************************************************/
...
...
@@ -87,6 +102,7 @@ widget *new_timeline(gui *_gui, int width, int number_of_sublines,
w
->
common
.
paint
=
paint
;
w
->
common
.
hints
=
hints
;
w
->
common
.
allocate
=
allocate
;
w
->
common
.
button
=
button
;
gunlock
(
g
);
...
...
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/view/time.c
+
26
−
1
View file @
2e7ab60d
...
...
@@ -3,6 +3,7 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
<pthread.h>
#include
<string.h>
/****************************************************************************/
/* timeview */
...
...
@@ -37,7 +38,7 @@ struct time {
time_t
tstart_time
;
/* timestamp (in seconds) of starting in t */
int
subcount
;
/* number of subviews */
struct
timespec
latest_time
;
/* time of latest received tick */
int64_t
pixel_length
;
/* unit: nanosecond (maximum 1 hour/pixel) */
double
pixel_length
;
/* unit: nanosecond (maximum 1 hour/pixel) */
};
/* TODO: put that function somewhere else (utils.c) */
...
...
@@ -150,6 +151,27 @@ gotit:
return
0
;
}
static
void
scroll
(
void
*
private
,
gui
*
g
,
char
*
notification
,
widget
*
w
,
void
*
notification_data
)
{
struct
time
*
this
=
private
;
double
mul
=
1
.
2
;
double
pixel_length
;
if
(
pthread_mutex_lock
(
&
this
->
lock
))
abort
();
if
(
!
strcmp
(
notification
,
"scrollup"
))
mul
=
1
/
mul
;
pixel_length
=
this
->
pixel_length
*
mul
;
if
(
pixel_length
<
1
)
pixel_length
=
1
;
if
(
pixel_length
>
(
double
)
3600
*
1000000000
)
pixel_length
=
(
double
)
3600
*
1000000000
;
this
->
pixel_length
=
pixel_length
;
if
(
pthread_mutex_unlock
(
&
this
->
lock
))
abort
();
}
view
*
new_view_time
(
int
number_of_seconds
,
float
refresh_rate
,
gui
*
g
,
widget
*
w
)
{
...
...
@@ -168,6 +190,9 @@ view *new_view_time(int number_of_seconds, float refresh_rate,
ret
->
subcount
=
0
;
ret
->
pixel_length
=
10
*
1000000
;
/* 10ms */
register_notifier
(
g
,
"scrollup"
,
w
,
scroll
,
ret
);
register_notifier
(
g
,
"scrolldown"
,
w
,
scroll
,
ret
);
if
(
pthread_mutex_init
(
&
ret
->
lock
,
NULL
))
abort
();
new_thread
(
time_thread
,
ret
);
...
...
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