123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520 |
- #ifndef FLOWTEMPLARTEDATAMODEL_H
- #define FLOWTEMPLARTEDATAMODEL_H
- #include <QtNodes/NodeDelegateModel>
- #include <QObject>
- #include <QLabel>
- #include <QComboBox>
- #include <Widgets/ComboBox.h>
- #include <Widgets/Menu.h>
- 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<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowTemplateData>(); }
- 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("构建指标体系"); }
- 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<NodeData> outData(PortIndex const port) override { return std::make_shared<FlowIndexData>(); }
- void setInData(std::shared_ptr<NodeData>, 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<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 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<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 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<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 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<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;
- };
- 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<NodeData> outData(PortIndex const) override { return std::make_shared<FlowCommonData>(); }
- void setInData(std::shared_ptr<NodeData>, PortIndex const) override { }
- QWidget *embeddedWidget() override { return nullptr; };
- };
- #endif // FLOWTEMPLARTEDATAMODEL_H
|