|
@@ -15,8 +15,6 @@ using QtNodes::NodeDelegateModel;
|
|
|
using QtNodes::PortIndex;
|
|
|
using QtNodes::PortType;
|
|
|
|
|
|
-class FlowGraphNodeWidget;
|
|
|
-
|
|
|
class FlowTemplateData : public NodeData
|
|
|
{
|
|
|
public:
|
|
@@ -36,7 +34,15 @@ public:
|
|
|
|
|
|
bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
|
|
|
- QString portCaption(PortType, PortIndex) const override { return "hello"; }
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
|
|
|
QString name() const override { return QString("FlowTemplateData"); }
|
|
|
|
|
@@ -52,56 +58,411 @@ public:
|
|
|
void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
|
|
|
QWidget *embeddedWidget() override;
|
|
|
+};
|
|
|
+
|
|
|
+class FlowIndexData : public NodeData
|
|
|
+{
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowIndexData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowIndexDataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowIndexDataModel();
|
|
|
+
|
|
|
+ ~FlowIndexDataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("构建指标体系"); }
|
|
|
|
|
|
- void setEmbeddedWidget(FlowGraphNodeWidget *w);
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
|
|
|
-private:
|
|
|
- FlowGraphNodeWidget *m_widget = nullptr;
|
|
|
+ QString name() const override { return QString("FlowIndexData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowIndexData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowIndexData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
};
|
|
|
|
|
|
-enum FlowDataType
|
|
|
+class FlowSampleData : public NodeData
|
|
|
{
|
|
|
- FlowDataTypeLabel,
|
|
|
- FlowDataTypeCheckBox,
|
|
|
- FlowDataTypeCombox,
|
|
|
- FlowDataTypeDoubleComboBox,
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowSampleData", "" }; }
|
|
|
};
|
|
|
|
|
|
-class FlowTextDataModel : public NodeDelegateModel
|
|
|
+class FlowSampleDataModel : public NodeDelegateModel
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
- FlowTextDataModel();
|
|
|
+ FlowSampleDataModel() : NodeDelegateModel() { }
|
|
|
|
|
|
- ~FlowTextDataModel() = default;
|
|
|
+ ~FlowSampleDataModel() = default;
|
|
|
|
|
|
- QString caption() const override { return QString("流程样板模型"); }
|
|
|
+ QString caption() const override { return QString("收集数据"); }
|
|
|
|
|
|
bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
|
|
|
- QString portCaption(PortType, PortIndex) const override { return "hello"; }
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
|
|
|
- QString name() const override { return QString("FlowTextData"); }
|
|
|
+ QString name() const override { return QString("FlowSampleData"); }
|
|
|
|
|
|
unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
|
|
|
NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
{
|
|
|
- return FlowTemplateData().type();
|
|
|
+ return FlowSampleData().type();
|
|
|
}
|
|
|
|
|
|
- std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowTemplateData>(); }
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowSampleData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
+};
|
|
|
+
|
|
|
+class FlowPCAData : public NodeData
|
|
|
+{
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowPCAData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowPCADataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowPCADataModel() : NodeDelegateModel() { }
|
|
|
+
|
|
|
+ ~FlowPCADataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("主成分分析法"); }
|
|
|
+
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ QString name() const override { return QString("FlowPCAData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowPCAData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowPCAData>(); }
|
|
|
|
|
|
void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
|
|
|
QWidget *embeddedWidget() override;
|
|
|
};
|
|
|
|
|
|
-class FlowTextData : public NodeData
|
|
|
+class FlowWeightData : public NodeData
|
|
|
{
|
|
|
public:
|
|
|
- NodeDataType type() const override { return NodeDataType { "FlowTextData", "" }; }
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowWeightData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowWeightDataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowWeightDataModel() : NodeDelegateModel() { }
|
|
|
+
|
|
|
+ ~FlowWeightDataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("权重计算"); }
|
|
|
+
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ QString name() const override { return QString("FlowWeightData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowWeightData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowWeightData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
+};
|
|
|
+
|
|
|
+class FlowSchemeData : public NodeData
|
|
|
+{
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowSchemeData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowSchemeDataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowSchemeDataModel() : NodeDelegateModel() { }
|
|
|
+
|
|
|
+ ~FlowSchemeDataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("算法"); }
|
|
|
+
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ QString name() const override { return QString("FlowSchemeData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowSchemeData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowSchemeData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
+};
|
|
|
+
|
|
|
+class FlowEffiData : public NodeData
|
|
|
+{
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowEffiData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowEffiDataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowEffiDataModel() : NodeDelegateModel() { }
|
|
|
+
|
|
|
+ ~FlowEffiDataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("算法"); }
|
|
|
+
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ QString name() const override { return QString("FlowEffiData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowEffiData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowEffiData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
+};
|
|
|
+
|
|
|
+class FlowResultData : public NodeData
|
|
|
+{
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowResultData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowResultDataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowResultDataModel() : NodeDelegateModel() { }
|
|
|
+
|
|
|
+ ~FlowResultDataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("结果展示"); }
|
|
|
+
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ QString name() const override { return QString("FlowResultData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowResultData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowResultData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
+};
|
|
|
+
|
|
|
+class FlowReportData : public NodeData
|
|
|
+{
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowReportData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowReportDataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowReportDataModel() : NodeDelegateModel() { }
|
|
|
+
|
|
|
+ ~FlowReportDataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("生成报告"); }
|
|
|
+
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ QString name() const override { return QString("FlowReportData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowReportData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowReportData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
+};
|
|
|
+
|
|
|
+class FlowEffiLevData : public NodeData
|
|
|
+{
|
|
|
+public:
|
|
|
+ NodeDataType type() const override { return NodeDataType { "FlowEffiLevData", "" }; }
|
|
|
+};
|
|
|
+
|
|
|
+class FlowEffiLevDataModel : public NodeDelegateModel
|
|
|
+{
|
|
|
+ Q_OBJECT
|
|
|
+
|
|
|
+public:
|
|
|
+ FlowEffiLevDataModel() : NodeDelegateModel() { }
|
|
|
+
|
|
|
+ ~FlowEffiLevDataModel() = default;
|
|
|
+
|
|
|
+ QString caption() const override { return QString("效能分级"); }
|
|
|
+
|
|
|
+ bool portCaptionVisible(PortType, PortIndex) const override { return false; }
|
|
|
+
|
|
|
+ QString portCaption(PortType pt, PortIndex) const override
|
|
|
+ {
|
|
|
+ if (pt == PortType::In) {
|
|
|
+ return "输入";
|
|
|
+ } else if (pt == PortType::Out) {
|
|
|
+ return "输出";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ QString name() const override { return QString("FlowEffiLevData"); }
|
|
|
+
|
|
|
+ unsigned int nPorts(PortType const /*portType*/) const override { return 1; }
|
|
|
+
|
|
|
+ NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override
|
|
|
+ {
|
|
|
+ return FlowEffiLevData().type();
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowEffiLevData>(); }
|
|
|
+
|
|
|
+ void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
|
|
|
+
|
|
|
+ QWidget *embeddedWidget() override;
|
|
|
};
|
|
|
|
|
|
#endif // FLOWTEMPLARTEDATAMODEL_H
|