Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Admin message
Maintenance operation of our GitLab server is scheduled for Wednesday, April 16, 2025, at 2PM.
Show more breadcrumbs
Kun
openairinterface5G
Commits
db488285
Commit
db488285
authored
8 years ago
by
Cédric Roux
Browse files
Options
Downloads
Patches
Plain Diff
TTI view
parent
43f99ff6
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/view/Makefile
+1
-1
1 addition, 1 deletion
common/utils/T/tracer/view/Makefile
common/utils/T/tracer/view/tti.c
+121
-0
121 additions, 0 deletions
common/utils/T/tracer/view/tti.c
common/utils/T/tracer/view/view.h
+2
-0
2 additions, 0 deletions
common/utils/T/tracer/view/view.h
with
124 additions
and
1 deletion
common/utils/T/tracer/view/Makefile
+
1
−
1
View file @
db488285
CC
=
gcc
CC
=
gcc
CFLAGS
=
-Wall
-g
-pthread
-I
..
CFLAGS
=
-Wall
-g
-pthread
-I
..
OBJS
=
stdout.o textlist.o xy.o
OBJS
=
stdout.o textlist.o xy.o
tti.o
view.a
:
$(OBJS)
view.a
:
$(OBJS)
ar cr view.a
$(
OBJS
)
ar cr view.a
$(
OBJS
)
...
...
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/view/tti.c
0 → 100644
+
121
−
0
View file @
db488285
#include
"view.h"
#include
"../utils.h"
#include
<stdio.h>
#include
<stdlib.h>
#include
<pthread.h>
#include
<stdarg.h>
#include
<string.h>
struct
tti
{
view
common
;
gui
*
g
;
widget
*
w
;
int
plot
;
float
refresh_rate
;
pthread_mutex_t
lock
;
float
data
[
1024
*
10
];
int
valid
[
1024
*
10
];
float
xout
[
1024
*
10
];
float
yout
[
1024
*
10
];
int
last_insert_point
;
};
static
int
far_enough
(
int
i
,
int
last_insert
,
int
plot_width
)
{
int
p1
;
int
p2
;
int
hole_size_px
;
int
hole_size_tti
;
hole_size_px
=
10
;
hole_size_tti
=
10240
*
hole_size_px
/
plot_width
;
p1
=
last_insert
;
p2
=
(
last_insert
+
hole_size_tti
)
%
(
1024
*
10
);
if
(
p1
<
p2
)
{
return
!
(
i
>
p1
&&
i
<
p2
);
}
return
i
>
p2
&&
i
<=
p1
;
}
static
void
*
tti_thread
(
void
*
_this
)
{
struct
tti
*
this
=
_this
;
int
i
;
int
length
;
int
plot_width
;
int
plot_height
;
while
(
1
)
{
if
(
pthread_mutex_lock
(
&
this
->
lock
))
abort
();
xy_plot_get_dimensions
(
this
->
g
,
this
->
w
,
&
plot_width
,
&
plot_height
);
length
=
0
;
/* TODO: optimize */
for
(
i
=
0
;
i
<
1024
*
10
;
i
++
)
/* do not take points too close after last insertion point */
if
(
this
->
valid
[
i
]
&&
far_enough
(
i
,
this
->
last_insert_point
,
plot_width
))
{
this
->
xout
[
length
]
=
i
;
this
->
yout
[
length
]
=
this
->
data
[
i
];
length
++
;
}
xy_plot_set_points
(
this
->
g
,
this
->
w
,
this
->
plot
,
length
,
this
->
xout
,
this
->
yout
);
if
(
pthread_mutex_unlock
(
&
this
->
lock
))
abort
();
sleepms
(
1000
/
this
->
refresh_rate
);
}
return
0
;
}
static
void
clear
(
view
*
this
)
{
/* TODO */
}
static
void
append
(
view
*
_this
,
int
frame
,
int
subframe
,
double
value
)
{
struct
tti
*
this
=
(
struct
tti
*
)
_this
;
int
i
;
int
index
=
frame
*
10
+
subframe
;
if
(
pthread_mutex_lock
(
&
this
->
lock
))
abort
();
/* TODO: optimize */
/* clear all between last insert point and current one
* this may be wrong if delay between two append is
* greater than 1024 frames (something like that)
*/
i
=
(
this
->
last_insert_point
+
1
)
%
(
1024
*
10
);
while
(
i
!=
index
)
{
this
->
valid
[
i
]
=
0
;
i
=
(
i
+
1
)
%
(
1024
*
10
);
}
this
->
data
[
index
]
=
value
;
this
->
valid
[
index
]
=
1
;
this
->
last_insert_point
=
index
;
if
(
pthread_mutex_unlock
(
&
this
->
lock
))
abort
();
}
view
*
new_view_tti
(
float
refresh_rate
,
gui
*
g
,
widget
*
w
,
int
color
)
{
struct
tti
*
ret
=
calloc
(
1
,
sizeof
(
struct
tti
));
if
(
ret
==
NULL
)
abort
();
ret
->
common
.
clear
=
clear
;
ret
->
common
.
append
=
(
void
(
*
)(
view
*
,
...))
append
;
ret
->
refresh_rate
=
refresh_rate
;
ret
->
g
=
g
;
ret
->
w
=
w
;
ret
->
plot
=
xy_plot_new_plot
(
g
,
w
,
color
);
ret
->
last_insert_point
=
0
;
if
(
pthread_mutex_init
(
&
ret
->
lock
,
NULL
))
abort
();
new_thread
(
tti_thread
,
ret
);
return
(
view
*
)
ret
;
}
This diff is collapsed.
Click to expand it.
common/utils/T/tracer/view/view.h
+
2
−
0
View file @
db488285
...
@@ -15,5 +15,7 @@ view *new_view_stdout(void);
...
@@ -15,5 +15,7 @@ view *new_view_stdout(void);
view
*
new_view_textlist
(
int
maxsize
,
float
refresh_rate
,
gui
*
g
,
widget
*
w
);
view
*
new_view_textlist
(
int
maxsize
,
float
refresh_rate
,
gui
*
g
,
widget
*
w
);
view
*
new_view_xy
(
int
length
,
float
refresh_rate
,
gui
*
g
,
widget
*
w
,
view
*
new_view_xy
(
int
length
,
float
refresh_rate
,
gui
*
g
,
widget
*
w
,
int
color
);
int
color
);
view
*
new_view_tti
(
float
refresh_rate
,
gui
*
g
,
widget
*
w
,
int
color
);
#endif
/* _VIEW_H_ */
#endif
/* _VIEW_H_ */
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