Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
taskbus
提交
c3b50c3f
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 搜索 >>
提交
c3b50c3f
编写于
6月 26, 2023
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决内存越界导致的崩溃
上级
f8b6233e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
88 addition
and
76 deletion
+88
-76
modules/sinks/sink_plots/dialogplots.cpp
modules/sinks/sink_plots/dialogplots.cpp
+88
-76
未找到文件。
modules/sinks/sink_plots/dialogplots.cpp
浏览文件 @
c3b50c3f
...
...
@@ -301,7 +301,10 @@ void DialogPlots::on_pushButton_reset_clicked()
if
(
min_y
<
new_min_y
)
new_min_y
=
min_y
,
needup_y
=
true
;
if
(
min_y
>
new_min_y
*
1.2
)
new_min_y
=
min_y
,
needup_y
=
true
;
if
(
max_x
>=
1e9
||
max_x
<-
1e9
||
max_y
>
1e9
||
max_y
<
-
1e9
||
max_x
-
min_x
<
1e-8
)
needup_x
=
false
,
needup_y
=
false
;
if
(
min_y
>=
1e9
||
min_y
<-
1e9
||
min_x
>
1e9
||
min_x
<
-
1e9
||
max_y
-
min_y
<
1e-8
)
needup_x
=
false
,
needup_y
=
false
;
if
(
needup_x
==
true
)
ax
->
setRange
(
new_min_x
,
new_max_x
);
...
...
@@ -367,7 +370,7 @@ void DialogPlots::timerEvent(QTimerEvent *event)
for
(
QList
<
QVector
<
double
>
>::
iterator
pit
=
avgList
.
begin
();
pit
!=
avgList
.
end
();
++
pit
)
{
for
(
int
i
=
0
;
i
<
pts
;
++
i
)
fdata
[
i
]
+=
pit
->
at
(
i
)
/
avgsz
;
fdata
[
i
]
+=
pit
->
at
(
i
)
/
(
avgsz
+
1e-14
)
;
}
double
max_x
=
0
,
max_y
=
fdata
[
0
];
...
...
@@ -382,7 +385,7 @@ void DialogPlots::timerEvent(QTimerEvent *event)
{
SpectroWidget
*
ws
=
m_chat_spec
[
subid
];
QVector
<
QPointF
>
vec_points
;
for
(
int
i
=
0
;
i
<
pts
;
i
+=
step
)
for
(
int
i
=
0
;
i
<
pts
/
channels
;
i
+=
step
)
{
double
x
,
y
;
if
(
channels
==
1
)
...
...
@@ -397,6 +400,9 @@ void DialogPlots::timerEvent(QTimerEvent *event)
if
(
y
<
min_y
)
min_y
=
y
;
}
if
(
!
(
max_x
>=
1e9
||
max_x
<-
1e9
||
max_y
>
1e9
||
max_y
<
-
1e9
||
max_x
-
min_x
<
1e-8
)
||
(
min_y
>=
1e9
||
min_y
<-
1e9
||
min_x
>
1e9
||
min_x
<
-
1e9
||
max_y
-
min_y
<
1e-8
))
{
serials
->
replace
(
vec_points
);
if
(
ws
)
{
...
...
@@ -418,6 +424,7 @@ void DialogPlots::timerEvent(QTimerEvent *event)
}
}
}
...
...
@@ -438,7 +445,8 @@ void DialogPlots::timerEvent(QTimerEvent *event)
if
(
y
<
min_y
)
min_y
=
y
;
}
if
(
!
(
max_x
>=
1e9
||
max_x
<-
1e9
||
max_y
>
1e9
||
max_y
<
-
1e9
||
max_x
-
min_x
<
1e-8
)
||
(
min_y
>=
1e9
||
min_y
<-
1e9
||
min_x
>
1e9
||
min_x
<
-
1e9
||
max_y
-
min_y
<
1e-8
))
serials
->
replace
(
lstpts
);
}
...
...
@@ -465,6 +473,10 @@ void DialogPlots::timerEvent(QTimerEvent *event)
if
(
min_y
<
new_min_y
)
new_min_y
=
min_y
,
needup_y
=
true
;
if
(
min_y
>
new_min_y
*
1.2
)
new_min_y
=
min_y
,
needup_y
=
true
;
if
(
max_x
>=
1e9
||
max_x
<-
1e9
||
max_y
>
1e9
||
max_y
<
-
1e9
||
max_x
-
min_x
<
1e-8
)
needup_x
=
false
,
needup_y
=
false
;
if
(
min_y
>=
1e9
||
min_y
<-
1e9
||
min_x
>
1e9
||
min_x
<
-
1e9
||
max_y
-
min_y
<
1e-8
)
needup_x
=
false
,
needup_y
=
false
;
if
(
ui
->
checkBox_auto_reser
->
isChecked
()
||
needup_x
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录