refactor: 通道默认不勾选,CSV不加表头保存原始数据
- 所有16个通道复选框默认不勾选 - CSV文件直接写原始数据,不加ch0-ch15表头 - 修复autoRangeY在无可见通道时的逻辑
This commit is contained in:
@@ -67,16 +67,6 @@ void DataManager::appendDataPoint(const QVector<int> &values)
|
||||
{
|
||||
if (!m_recording) return;
|
||||
|
||||
if (!m_headerWritten) {
|
||||
// 写入表头
|
||||
QStringList headers;
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
headers << QString("ch%1").arg(i);
|
||||
}
|
||||
m_stream << headers.join(",") << "\n";
|
||||
m_headerWritten = true;
|
||||
}
|
||||
|
||||
QStringList parts;
|
||||
for (int v : values) {
|
||||
parts << QString::number(v);
|
||||
|
||||
@@ -26,7 +26,7 @@ PlotWidget::PlotWidget(QWidget *parent)
|
||||
, m_dirty(true)
|
||||
{
|
||||
m_data.resize(16);
|
||||
m_channelVisible.fill(true, 16);
|
||||
m_channelVisible.fill(false, 16);
|
||||
m_colors = defaultColors();
|
||||
|
||||
setMouseTracking(true);
|
||||
@@ -149,6 +149,10 @@ void PlotWidget::autoRangeY()
|
||||
}
|
||||
}
|
||||
|
||||
if (globalMax < globalMin) {
|
||||
// 没有可见通道或没有数据
|
||||
return;
|
||||
}
|
||||
if (globalMax - globalMin < 1.0) {
|
||||
globalMin -= 50;
|
||||
globalMax += 50;
|
||||
|
||||
Reference in New Issue
Block a user