/** * @RDE_HEADER@ * ParticipantManagement - ParticipantBiteDialog * $Id$ * $HeadURL$ * $Author$ * Created by Patric Karwat, SLSE, 2016-06-13 */ #pragma once //Lts #include #include //ParticipantManagement #include #include #include #include //Qt #include #include #include namespace Ui { class ParticipantBiteDialog; } namespace ParticipantManagement { //enum class? enum LabelType { Normal = 1, Ok, Error }; // -------------------------------------------------------- // ParticipantBiteDialog // -------------------------------------------------------- class ParticipantBiteDialog : public LtsWidgets::LtsDialog , protected Interface::Ftc::CallBiteReplyHandler { Q_OBJECT public: explicit ParticipantBiteDialog(int ddsId, QWidget *parent = nullptr); ~ParticipantBiteDialog(); bool init(const std::shared_ptr &dtc, const std::shared_ptr &ftc, const std::shared_ptr &pdmDtc, bool bBiteWithSelfTest, const QJsonObject &detailData = QJsonObject()); void onCallBiteReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: void retranslate() override; void addLabel(const QString &text, int row, int column, LabelType labelType = LabelType::Normal); int checkArguments(bool available, bool statusOk, qint64 bitValue, int i); int checkArgument(bool bError, const QString &name, int i); private Q_SLOTS : void onBiteChanged(const ParticipantManagement::Bite &bite); private: QString getErrorString(const ParticipantManagement::BiteError &error) const; QString getCanDeviceName(int id) const; QString getSubDeviceName(int id) const; int m_ddsId; int m_eqipNr; bool m_fromDetailData; std::shared_ptr m_dtc; std::shared_ptr m_ftc; std::shared_ptr m_pdmDtc; LtsUtils::RequestHelper *m_requestHelper; QGridLayout *m_layout; QVector m_internalWidgets; Ui::ParticipantBiteDialog *m_ui; LOGGER_T m_logger; QMap m_ccsMap; QMap m_bctMap; }; } // namespace ParticipantInfo