geopro/src/app/AnomalySaveDialog.hpp

57 lines
2.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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