57 lines
2.4 KiB
C++
57 lines
2.4 KiB
C++
#pragma once
|
||
#include <QDialog>
|
||
#include <QString>
|
||
|
||
class QLineEdit;
|
||
class QComboBox;
|
||
class QPlainTextEdit;
|
||
class QLabel;
|
||
|
||
namespace geopro::data {
|
||
class IDatasetCommandRepository;
|
||
}
|
||
|
||
namespace geopro::app {
|
||
|
||
// 异常保存对话框(#4b,需求 R50):名称 + 异常类型 + 备注 + 截图预览/大小。
|
||
// 异常类型从平台按标注形态(remarkSourceType)异步拉取,与平台保持一致。accept 后取 name/typeName/typeId/remark。
|
||
class AnomalySaveDialog : public QDialog {
|
||
Q_OBJECT
|
||
public:
|
||
// screenshotPath:圈定结束截图的本地路径(为空则不显示预览);w/h:截图像素尺寸(R50「确定截图大小」)。
|
||
// cmdRepo/projectId:异步拉取平台异常类型填充下拉(与平台一致);remarkSourceType:标注形态 1点/2线/3面,
|
||
// 决定查询哪一类平台异常类型。cmdRepo 为空则下拉留空(空态由 EmptyAwareComboBox 提示)。
|
||
AnomalySaveDialog(const QString& screenshotPath, int shotW, int shotH,
|
||
geopro::data::IDatasetCommandRepository* cmdRepo, const QString& projectId,
|
||
int remarkSourceType, QWidget* parent = nullptr);
|
||
|
||
QString anomalyName() const;
|
||
QString typeName() const;
|
||
QString typeId() const;
|
||
QString remark() const;
|
||
|
||
// 选中类型的平台样式(从 legend 按形态派生,与平台一致)。styleColor 空 = 未取到,调用方用默认样式。
|
||
QString styleColor() const { return styleColor_; }
|
||
double styleWidth() const { return styleWidth_; }
|
||
bool styleDashed() const { return styleDashed_; }
|
||
|
||
private:
|
||
// 异步拉平台异常类型(label→显示, value→id)填充下拉;空/失败时下拉留空(EmptyAwareComboBox 提示)。
|
||
void loadTypes(geopro::data::IDatasetCommandRepository* cmdRepo, const QString& projectId,
|
||
int remarkSourceType);
|
||
// 拉当前选中类型的详情 legend → 按形态(点/线/面)派生 styleColor/Width/Dashed。
|
||
void loadStyleForCurrent();
|
||
|
||
geopro::data::IDatasetCommandRepository* cmdRepo_ = nullptr;
|
||
int remarkSourceType_ = 3;
|
||
QString styleColor_; // legend 派生线/点色(空=未取到)
|
||
double styleWidth_ = 0.0; // legend.polylineWidth
|
||
bool styleDashed_ = false; // legend.polylineShape 含 "dash"
|
||
|
||
QLineEdit* name_ = nullptr;
|
||
QComboBox* type_ = nullptr;
|
||
QPlainTextEdit* remark_ = nullptr;
|
||
};
|
||
|
||
} // namespace geopro::app
|