update .gitignore
This commit is contained in:
104
.gitignore
vendored
104
.gitignore
vendored
@@ -1,52 +1,52 @@
|
|||||||
.cache/
|
.cache/
|
||||||
.vscode/
|
.vscode/
|
||||||
.vs/
|
.vs/
|
||||||
.idea/
|
.idea/
|
||||||
|
.VSCodeCounter/
|
||||||
cmake-build-*/
|
cmake-build-*/
|
||||||
build/
|
build/
|
||||||
output/
|
output/
|
||||||
AppDir/
|
AppDir/
|
||||||
out/
|
out/
|
||||||
|
|
||||||
CMakeSettings.json
|
CMakeSettings.json
|
||||||
|
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.deb
|
*.deb
|
||||||
*.pkg
|
*.pkg
|
||||||
*.zip
|
*.zip
|
||||||
|
|
||||||
.*
|
.*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.coverage
|
*.coverage
|
||||||
*.egg-info
|
*.egg-info
|
||||||
*.log
|
*.log
|
||||||
*.swp
|
*.swp
|
||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.pyo
|
||||||
*.zip
|
*.zip
|
||||||
*/files/*
|
*/files/*
|
||||||
*/tmp/*
|
*/tmp/*
|
||||||
*.hwm*
|
*.hwm*
|
||||||
*.cfg
|
*.cfg
|
||||||
*.out
|
*.out
|
||||||
.svn
|
.svn
|
||||||
build
|
build
|
||||||
bin
|
bin
|
||||||
lib
|
lib
|
||||||
cpp
|
cpp
|
||||||
*/lib/*
|
*/lib/*
|
||||||
installed
|
installed
|
||||||
patched
|
patched
|
||||||
wiped
|
wiped
|
||||||
msg_gen
|
msg_gen
|
||||||
srv_gen
|
srv_gen
|
||||||
doc/html
|
doc/html
|
||||||
*sublime-workspace
|
*sublime-workspace
|
||||||
*.user
|
*.user
|
||||||
*.suo
|
*.suo
|
||||||
*.sdf
|
*.sdf
|
||||||
*.opensdf
|
*.opensdf
|
||||||
ipch
|
ipch
|
||||||
Debug
|
Debug
|
||||||
Release
|
Release
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ public:
|
|||||||
auto initialize_plot() -> void {
|
auto initialize_plot() -> void {
|
||||||
if (initialized) return;
|
if (initialized) return;
|
||||||
|
|
||||||
// 创建颜色映射
|
QCPColorMap* cpmp = new QCPColorMap(self.xAxis, self.yAxis);
|
||||||
QCPColorMap* cpmp = new QCPColorMap(self.xAxis, self.yAxis);
|
|
||||||
cpmp->data()->setSize(matrix_size.width(), matrix_size.height());
|
cpmp->data()->setSize(matrix_size.width(), matrix_size.height());
|
||||||
cpmp->data()->setRange(QCPRange(0.5, matrix_size.width() - 0.5),
|
cpmp->data()->setRange(QCPRange(0.5, matrix_size.width() - 0.5),
|
||||||
QCPRange(0.5, matrix_size.height() - 0.5));
|
QCPRange(0.5, matrix_size.height() - 0.5));
|
||||||
@@ -109,10 +108,20 @@ public:
|
|||||||
if (!xlabel.isEmpty()) self.xAxis->setLabel(xlabel);
|
if (!xlabel.isEmpty()) self.xAxis->setLabel(xlabel);
|
||||||
if (!ylabel.isEmpty()) self.yAxis->setLabel(ylabel);
|
if (!ylabel.isEmpty()) self.yAxis->setLabel(ylabel);
|
||||||
|
|
||||||
// 添加颜色刻度
|
// 添加/复用颜色刻度(避免重复 addElement 到相同单元格导致告警)
|
||||||
QCPColorScale* color_scale = new QCPColorScale(&self);
|
QCPLayoutElement* occupied = self.plotLayout()->element(1, 0);
|
||||||
color_scale->setType(QCPAxis::atBottom);
|
QCPColorScale* color_scale = occupied ? qobject_cast<QCPColorScale*>(occupied) : nullptr;
|
||||||
self.plotLayout()->addElement(1, 0, color_scale);
|
if (!color_scale) {
|
||||||
|
if (occupied) {
|
||||||
|
// 单元格被其他元素占用,移除并删除后再放入 ColorScale
|
||||||
|
self.plotLayout()->remove(occupied);
|
||||||
|
delete occupied;
|
||||||
|
occupied = nullptr;
|
||||||
|
}
|
||||||
|
color_scale = new QCPColorScale(&self);
|
||||||
|
color_scale->setType(QCPAxis::atBottom);
|
||||||
|
self.plotLayout()->addElement(1, 0, color_scale);
|
||||||
|
}
|
||||||
cpmp->setColorScale(color_scale);
|
cpmp->setColorScale(color_scale);
|
||||||
|
|
||||||
// 设置颜色渐变
|
// 设置颜色渐变
|
||||||
@@ -149,12 +158,10 @@ public:
|
|||||||
initialized = false;
|
initialized = false;
|
||||||
initialize_plot();
|
initialize_plot();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto update_plot_data() -> void {
|
auto update_plot_data() -> void {
|
||||||
if (!initialized || self.plottableCount() == 0) return;
|
if (!initialized || self.plottableCount() == 0) return;
|
||||||
|
|
||||||
auto* cpmp = static_cast<QCPColorMap*>(self.plottable(0));
|
auto* cpmp = static_cast<QCPColorMap*>(self.plottable(0));
|
||||||
|
|
||||||
|
|
||||||
// 设置新数据
|
// 设置新数据
|
||||||
for (const auto& item : data_points) {
|
for (const auto& item : data_points) {
|
||||||
@@ -182,7 +189,7 @@ private:
|
|||||||
QSize matrix_size;
|
QSize matrix_size;
|
||||||
QVector<PointData> data_points;
|
QVector<PointData> data_points;
|
||||||
double color_min = 0.0;
|
double color_min = 0.0;
|
||||||
double color_max = 15.0;
|
double color_max = 800.0;
|
||||||
bool initialized;
|
bool initialized;
|
||||||
BasicPlot& self;
|
BasicPlot& self;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -173,10 +173,6 @@ int cpcodec_close(CPCodecContext *ctx) {
|
|||||||
ctx->codec->close(ctx);
|
ctx->codec->close(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->codec && ctx->codec->close) {
|
|
||||||
ctx->codec->close(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->is_open = false;
|
ctx->is_open = false;
|
||||||
ctx->release_priv_storage();
|
ctx->release_priv_storage();
|
||||||
ctx->codec_type = CPMediaType::Unknow;
|
ctx->codec_type = CPMediaType::Unknow;
|
||||||
@@ -220,4 +216,4 @@ int cpcodec_receive_frame(CPCodecContext *ctx, CPFrame *frame) {
|
|||||||
}
|
}
|
||||||
return ctx->codec->receive_frame(ctx, *frame);
|
return ctx->codec->receive_frame(ctx, *frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user