Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
taskbus
提交
7dcbde6a
taskbus
项目概览
colorEagleStdio
/
taskbus
通知
162
Star
11
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
taskbus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7dcbde6a
编写于
5月 01, 2022
作者:
D
dev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
长时间测试后,解决删除已经消失的标记的问题。
上级
6bb350bf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
10 deletion
+33
-10
module_templates/stdio/recv_adsb/recv_adsb.c
module_templates/stdio/recv_adsb/recv_adsb.c
+33
-10
module_templates/stdio/recv_adsb/recv_adsb.exe
module_templates/stdio/recv_adsb/recv_adsb.exe
+0
-0
未找到文件。
module_templates/stdio/recv_adsb/recv_adsb.c
浏览文件 @
7dcbde6a
...
...
@@ -1319,14 +1319,13 @@ good_preamble:
/* Show the currently captured interactive data on screen. */
void
interactiveShowData
(
void
)
{
struct
aircraft
*
a
=
Modes
.
aircrafts
;
struct
aircraft
*
before_a
=
0
,
*
after_a
=
0
;
time_t
now
=
time
(
NULL
);
int
count
=
0
;
//printf("\x1b[H\x1b[2J"); /* Clear the screen */
/* printf(
"Hex Flight Altitude Speed Lat Lon Track Messages Seen %s\n"
"--------------------------------------------------------------------------------\n",
progress);
*/
static
time_t
lastClearTime
=
0
;
static
const
int
timeKeep
=
60
;
if
(
lastClearTime
==
0
)
lastClearTime
=
time
(
0
);
while
(
a
)
{
if
(
a
->
need_display
)
{
...
...
@@ -1339,13 +1338,12 @@ void interactiveShowData(void) {
speed
*=
1
.
852
;
}
fprintf
(
stdout
,
"source=adsb;destin=geomarker;function=update_icon;icon=flight;name=%s;lat=%f;lon=%f;rotate=%d;smooth=1;scale=%f
\n
"
,
a
->
hexaddr
,
a
->
lat
,
a
->
lon
,
a
->
track
,
(
altitude
/
30000
.
0
+
1
),
(
int
)(
now
-
a
->
seen
));
a
->
hexaddr
,
a
->
lat
,
a
->
lon
,
a
->
track
,
(
altitude
/
30000
.
0
+
1
));
fprintf
(
stdout
,
"source=adsb;destin=geomarker;function=update_props;name=%s;LABEL=%s;Alt=%d;Speed=%d;lat=%f;lon=%f;track=%d;msgs=%ld;time=%d;
\n
"
,
a
->
hexaddr
,
a
->
flight
,
altitude
,
speed
,
a
->
lat
,
a
->
lon
,
a
->
track
,
a
->
messages
,
(
int
)(
now
-
a
->
seen
));
(
int
)(
now
));
fflush
(
stdout
);
fprintf
(
stderr
,
"%-6s %-8s %-9d %-7d %-7.03f %-7.03f %-3d %-9ld %d sec
\n
"
,
a
->
hexaddr
,
a
->
flight
,
altitude
,
speed
,
...
...
@@ -1356,6 +1354,32 @@ void interactiveShowData(void) {
a
=
a
->
next
;
count
++
;
}
if
(
lastClearTime
+
timeKeep
<
now
)
{
lastClearTime
=
now
;
a
=
Modes
.
aircrafts
;
before_a
=
0
;
while
(
a
)
{
after_a
=
a
->
next
;
if
(
a
->
seen
+
timeKeep
<
now
)
{
printf
(
"source=adsb;destin=geomarker;function=delete_marks;name0=%s;
\n
"
,
a
->
hexaddr
);
//delete node
if
(
before_a
)
before_a
->
next
=
after_a
;
else
Modes
.
aircrafts
=
after_a
;
free
(
a
);
a
=
after_a
;
}
if
(
a
)
{
before_a
=
a
;
a
=
a
->
next
;
}
}
}
}
/* When a new message is available, because it was decoded from the
* RTL device, file, or received in the TCP input port, or any other
...
...
@@ -1571,7 +1595,6 @@ struct aircraft *interactiveReceiveData(struct modesMessage *mm) {
aux
=
Modes
.
aircrafts
;
while
(
aux
->
next
!=
a
)
aux
=
aux
->
next
;
/* Now we are a node before the aircraft to remove. */
printf
(
"function=delete_marks;name0=%s;
\n
"
,
a
->
hexaddr
);
aux
->
next
=
aux
->
next
->
next
;
/* removed. */
/* Add on head */
a
->
next
=
Modes
.
aircrafts
;
...
...
module_templates/stdio/recv_adsb/recv_adsb.exe
浏览文件 @
7dcbde6a
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录