#ifndef FLOWTEMPLARTEDATAMODEL_H #define FLOWTEMPLARTEDATAMODEL_H #include #include #include #include #include #include using QtNodes::NodeData; using QtNodes::NodeDataType; using QtNodes::NodeDelegateModel; using QtNodes::PortIndex; using QtNodes::PortType; class FlowTemplateData : public NodeData { public: NodeDataType type() const override { return NodeDataType { "FlowTemplateData", "" }; } }; class FlowTemplateDataModel : public NodeDelegateModel { Q_OBJECT public: FlowTemplateDataModel(); ~FlowTemplateDataModel() = 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("FlowTemplateData"); } unsigned int nPorts(PortType const /*portType*/) const override { return 1; } NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override { return FlowTemplateData().type(); } std::shared_ptr outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, 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("构建指标体系"); } bool captionVisible() const override { return false; } 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("FlowIndexData"); } unsigned int nPorts(PortType const portType) const override { if (portType == PortType::In) { return 0; } return 1; } NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override { return FlowIndexData().type(); } std::shared_ptr outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, PortIndex const) override { } QWidget *embeddedWidget() override; }; class FlowSampleData : public NodeData { public: NodeDataType type() const override { return NodeDataType { "FlowSampleData", "" }; } }; class FlowSampleDataModel : public NodeDelegateModel { Q_OBJECT public: FlowSampleDataModel() : NodeDelegateModel() { } ~FlowSampleDataModel() = 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("FlowSampleData"); } unsigned int nPorts(PortType const /*portType*/) const override { return 1; } NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override { return FlowSampleData().type(); } std::shared_ptr outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, 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 outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, PortIndex const) override { } QWidget *embeddedWidget() override; }; class FlowWeightData : public NodeData { public: 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 outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, 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 outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, 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 outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, 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 captionVisible() const override { return false; } 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 outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, 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 pt) const override { if (pt == PortType::In) { return 1; } return 0; } NodeDataType dataType(PortType const portType, PortIndex const portIndex) const override { return FlowReportData().type(); } std::shared_ptr outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, 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 outData(PortIndex const port) override { return std::make_shared(); } void setInData(std::shared_ptr, PortIndex const) override { } QWidget *embeddedWidget() override; }; class FlowCommonData : public NodeData { public: NodeDataType type() const override { return NodeDataType { "FlowCommonData", "" }; } }; class FlowCommonDataModel : public NodeDelegateModel { Q_OBJECT public: FlowCommonDataModel() : NodeDelegateModel() {}; ~FlowCommonDataModel() = default; QString caption() const override { return QString(""); } bool captionVisible() const override { return true; } bool portCaptionVisible(PortType, PortIndex) const override { return false; } QString portCaption(PortType, PortIndex) const override { return ""; } QString name() const override { return QString("FlowCommonData"); } unsigned int nPorts(PortType const) const override { return 0; } NodeDataType dataType(PortType const, PortIndex const) const override { return FlowCommonData().type(); } std::shared_ptr outData(PortIndex const) override { return std::make_shared(); } void setInData(std::shared_ptr, PortIndex const) override { } QWidget *embeddedWidget() override { return nullptr; }; }; #endif // FLOWTEMPLARTEDATAMODEL_H