diff --git a/CellFrameDashboardGUI/DapServiceController.cpp b/CellFrameDashboardGUI/DapServiceController.cpp index b3658964d40830b899fafe982458107660fccb69..f5ef4b132ac8bcbd6139a62448fe82c032c44245 100644 --- a/CellFrameDashboardGUI/DapServiceController.cpp +++ b/CellFrameDashboardGUI/DapServiceController.cpp @@ -1,5 +1,7 @@ #include "DapServiceController.h" +/// Standard constructor. +/// @param apParent Parent. DapServiceController::DapServiceController(QObject *apParent) : QObject(apParent) { @@ -40,6 +42,8 @@ DapServiceController &DapServiceController::getInstance() } /// Send request to service. +/// @details In this case, a request is sent to the service to which it is obliged to respond. Expect an answer. +/// @param asServiceName Service name. /// @param arg1...arg10 Parametrs. void DapServiceController::requestToService(const QString &asServiceName, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, @@ -52,6 +56,10 @@ void DapServiceController::requestToService(const QString &asServiceName, const transceiver->requestToService(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); } +/// Notify service. +/// @details In this case, only a notification is sent to the service, the answer should not be expected. +/// @param asServiceName Service name. +/// @param arg1...arg10 Parametrs. void DapServiceController::notifyService(const QString &asServiceName, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, @@ -67,11 +75,14 @@ void DapServiceController::notifyService(const QString &asServiceName, const QVa /// Register command. void DapServiceController::registerCommand() { - m_transceivers.append(qMakePair(dynamic_cast<DapAbstractCommand*>(m_DAPRpcSocket->addService(new DapQuitApplicationCommand("DapQuitApplicationCommand", m_DAPRpcSocket))), QString())); - m_transceivers.append(qMakePair(dynamic_cast<DapAbstractCommand*>(m_DAPRpcSocket->addService(new DapActivateClientCommand("DapActivateClientCommand", m_DAPRpcSocket))), QString("clientActivated"))); - m_transceivers.append(qMakePair(dynamic_cast<DapAbstractCommand*>(m_DAPRpcSocket->addService(new DapUpdateLogsCommand("DapUpdateLogsCommand", m_DAPRpcSocket))), QString("logUpdated"))); - - registerEmmitedSignal(); + // Application shutdown team + m_transceivers.append(qMakePair(dynamic_cast<DapAbstractCommand*>(m_DAPRpcSocket->addService(new DapQuitApplicationCommand("DapQuitApplicationCommand", m_DAPRpcSocket))), QString())); + // GUI client activation command in case it is minimized/expanded + m_transceivers.append(qMakePair(dynamic_cast<DapAbstractCommand*>(m_DAPRpcSocket->addService(new DapActivateClientCommand("DapActivateClientCommand", m_DAPRpcSocket))), QString("clientActivated"))); + // Log update command on the Logs tab + m_transceivers.append(qMakePair(dynamic_cast<DapAbstractCommand*>(m_DAPRpcSocket->addService(new DapUpdateLogsCommand("DapUpdateLogsCommand", m_DAPRpcSocket))), QString("logUpdated"))); + + registerEmmitedSignal(); } /// Find the emitted signal. @@ -96,6 +107,7 @@ void DapServiceController::findEmittedSignal(const QVariant &aValue) } } +/// Register a signal handler for notification results. void DapServiceController::registerEmmitedSignal() { foreach (auto command, m_transceivers) diff --git a/CellFrameDashboardGUI/DapServiceController.h b/CellFrameDashboardGUI/DapServiceController.h index 4eab17b52e7b4a36090bdda385b2c32970757039..080fa9778ea1c5e5d3b6c3a46e1da0565a065892 100644 --- a/CellFrameDashboardGUI/DapServiceController.h +++ b/CellFrameDashboardGUI/DapServiceController.h @@ -28,7 +28,8 @@ class DapServiceController : public QObject QVector<QPair<DapAbstractCommand*, QString>> m_transceivers; /// RPC socket. DapRpcSocket * m_DAPRpcSocket {nullptr}; - /// Standard constructor + /// Standard constructor. + /// @param apParent Parent. explicit DapServiceController(QObject *apParent = nullptr); public: @@ -36,6 +37,8 @@ public: /// @return Instance of a class. Q_INVOKABLE static DapServiceController &getInstance(); /// Send request to service. + /// @details In this case, a request is sent to the service to which it is obliged to respond. Expect an answer. + /// @param asServiceName Service name. /// @param arg1...arg10 Parametrs. Q_INVOKABLE void requestToService(const QString& asServiceName, const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -43,6 +46,10 @@ public: const QVariant &arg6 = QVariant(), const QVariant &arg7 = QVariant(), const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); + /// Notify service. + /// @details In this case, only a notification is sent to the service, the answer should not be expected. + /// @param asServiceName Service name. + /// @param arg1...arg10 Parametrs. Q_INVOKABLE void notifyService(const QString& asServiceName, const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), const QVariant &arg4 = QVariant(), const QVariant &arg5 = QVariant(), @@ -50,18 +57,10 @@ public: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); - ///******************************************** - /// Property - /// ******************************************* - /// Brand company. Q_PROPERTY(QString Brand MEMBER m_sBrand READ getBrand NOTIFY brandChanged) /// Application version. Q_PROPERTY(QString Version MEMBER m_sVersion READ getVersion NOTIFY versionChanged) - - ///******************************************** - /// Interface - /// ******************************************* /// Client controller initialization. /// @param apDapServiceClient Network connection controller. @@ -80,11 +79,9 @@ signals: /// The signal is emitted when the Application version property changes. /// @param version Version void versionChanged(const QString &version); - + /// The signal is emitted when a command to activate a client is received. void clientActivated(); - - void addWalletResponded(const QVariant& wallet); - ///A signal that is used to transmit data to the log model. + /// A signal that is used to transmit data to the log model. /// @param historyString QStringList void logUpdated(const QVariant& logs); @@ -94,7 +91,7 @@ private slots: /// Find the emitted signal. /// @param aValue Transmitted parameter. void findEmittedSignal(const QVariant& aValue); - + /// Register a signal handler for notification results. void registerEmmitedSignal(); }; diff --git a/CellFrameDashboardService/DapServiceController.cpp b/CellFrameDashboardService/DapServiceController.cpp index 69540365890c642bca1c9bff89bf8f91e0166e58..2ce411568fb8473f5685a9ee95d01587661106e9 100755 --- a/CellFrameDashboardService/DapServiceController.cpp +++ b/CellFrameDashboardService/DapServiceController.cpp @@ -9,6 +9,7 @@ DapServiceController::DapServiceController(QObject *parent) : QObject(parent) }); } +/// Destructor. DapServiceController::~DapServiceController() { delete m_pToolTipWidget; @@ -26,8 +27,9 @@ bool DapServiceController::start() if(m_pServer->listen(DAP_BRAND)) { connect(m_pServer, SIGNAL(onClientConnected()), SIGNAL(onNewClientConnected())); - // Register command to cellframenode + // Register command registerCommand(); + // Initialize system tray initSystemTrayIcon(); } else @@ -42,11 +44,15 @@ bool DapServiceController::start() /// Register command. void DapServiceController::registerCommand() { + // Application shutdown team m_pServer->addService(new DapQuitApplicationCommand("DapQuitApplicationCommand", m_pServer)); + // GUI client activation command in case it is minimized/expanded m_pServer->addService(new DapActivateClientCommand("DapActivateClientCommand", m_pServer)); + // Log update command on the Logs tab m_pServer->addService(new DapUpdateLogsCommand("DapUpdateLogsCommand", m_pServer, LOG_FILE)); } +/// Initialize system tray. void DapServiceController::initSystemTrayIcon() { m_pToolTipWidget = new DapToolTipWidget(); @@ -59,7 +65,7 @@ void DapServiceController::initSystemTrayIcon() m_pSystemTrayIcon->setContextMenu(menuSystemTrayIcon); m_pSystemTrayIcon->show(); - // If the "Exit" menu item is selected, then we shut down the service, + // If the "Quit" menu item is selected, then we shut down the service, // and also send a command to shut down the client. connect(quitAction, &QAction::triggered, this, [=] { diff --git a/CellFrameDashboardService/DapServiceController.h b/CellFrameDashboardService/DapServiceController.h index 9e9cf999b3bd39dc9a05c3819037e4762e945362..8a3c98961fc02aa593ef4bcd29550dd9ffcedb27 100755 --- a/CellFrameDashboardService/DapServiceController.h +++ b/CellFrameDashboardService/DapServiceController.h @@ -43,17 +43,18 @@ class DapServiceController : public QObject /// Service core. DapUiService * m_pServer {nullptr}; - + /// System tray widget in tray. DapSystemTrayIcon * m_pSystemTrayIcon {nullptr}; - + /// ToolTip pop-up widget. DapToolTipWidget * m_pToolTipWidget {nullptr}; - + /// The context menu of the widget in the system tray. QMenu * menuSystemTrayIcon {nullptr}; public: /// Standard constructor. /// @param parent Parent. explicit DapServiceController(QObject * parent = nullptr); + /// Destructor. ~DapServiceController(); /// Start service: creating server and socket. /// @return Returns true if the service starts successfully, otherwise false. @@ -66,7 +67,7 @@ signals: private slots: /// Register command. void registerCommand(); - + /// Initialize system tray. void initSystemTrayIcon(); }; diff --git a/CellFrameDashboardService/DapToolTipWidget.cpp b/CellFrameDashboardService/DapToolTipWidget.cpp index 8358e3715b0cf3ea024efeafedaa7c633af38060..21efb838b01f70b3c1a00c2ee13b7f24294fba04 100644 --- a/CellFrameDashboardService/DapToolTipWidget.cpp +++ b/CellFrameDashboardService/DapToolTipWidget.cpp @@ -1,20 +1,25 @@ #include "DapToolTipWidget.h" +/// Standart constructor. +/// @param parent Parent. DapToolTipWidget::DapToolTipWidget(QWidget *parent) : QWidget(parent) { + // Turn off the border of the standard window setWindowFlags(Qt::FramelessWindowHint); + // Set tooltip message size setFixedSize(140, 45); - m_pLabel = new QLabel(this); QFont font("Times", 28, QFont::Bold); m_pLabel->setFont(font); m_pLabel->setText(QTime::currentTime().toString("hh:mm:ss")); - + // We initialize and start the timer for updating information in tooltip m_pTimer = new QTimer(this); + // Signal-slot connection updating information in tooltip connect(m_pTimer, SIGNAL(timeout()), this, SLOT(slotTimerAlarm())); m_pTimer->start(1000); } +/// Update displayed time in tooltip. void DapToolTipWidget::slotTimerAlarm() { m_pLabel->setText(QTime::currentTime().toString("hh:mm:ss")); diff --git a/CellFrameDashboardService/DapToolTipWidget.h b/CellFrameDashboardService/DapToolTipWidget.h index eec8258d34f1bf66898be39b5fefd49079bc9761..bd429ba328c856f62767a487cfd6c0584346a29a 100644 --- a/CellFrameDashboardService/DapToolTipWidget.h +++ b/CellFrameDashboardService/DapToolTipWidget.h @@ -1,3 +1,12 @@ +/**************************************************************************** +** +** This file is part of the CellFrameDashboardService application. +** +** The class implements a toolTip popup message widget that appears +** when you hover over the CellFrameDashboardService icon in the tray. +** +****************************************************************************/ + #ifndef DAPTOOLTIPWIDGET_H #define DAPTOOLTIPWIDGET_H @@ -10,15 +19,18 @@ class DapToolTipWidget : public QWidget { Q_OBJECT + /// Display update timer. QTimer * m_pTimer {nullptr}; + /// Central widget. QLabel * m_pLabel {nullptr}; public: + /// Standart constructor. + /// @param parent Parent. explicit DapToolTipWidget(QWidget *parent = nullptr); -signals: - private slots: + /// Update displayed time in tooltip. void slotTimerAlarm(); }; diff --git a/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.cpp b/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.cpp index a19ca7d6b5384760917ff04f7616986c38385bab..ce4185bd718c52bad0b0088c16a20e0609945ab2 100644 --- a/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.cpp +++ b/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.cpp @@ -2,14 +2,17 @@ /// Overloaded constructor. /// @param asServiceName Service name. -/// @param apSocket Client connection socket with service. /// @param parent Parent. +/// @details The parent must be either DapRPCSocket or DapRPCLocalServer. DapAbstractCommand::DapAbstractCommand(const QString &asServiceName, QObject *parent) : DapCommand(asServiceName, parent), m_parent(parent) { } +/// Send a notification to the client. At the same time, you should not expect a response from the client. +/// @details Performed on the service side. +/// @param arg1...arg10 Parameters. void DapAbstractCommand::notifyToClient(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, @@ -35,6 +38,9 @@ void DapAbstractCommand::notifyToClient(const QVariant &arg1, const QVariant &ar server->notifyConnectedClients(request); } +/// Process the notification from the service on the client side. +/// @details Performed on the client side. +/// @param arg1...arg10 Parameters. void DapAbstractCommand::notifedFromService(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, @@ -55,6 +61,7 @@ void DapAbstractCommand::notifedFromService(const QVariant &arg1, const QVariant } /// Send request to client. +/// @details Performed on the service side. /// @param arg1...arg10 Parameters. void DapAbstractCommand::requestToClient(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, @@ -83,6 +90,7 @@ void DapAbstractCommand::requestToClient(const QVariant &arg1, const QVariant &a } /// Send a response to the service. +/// @details Performed on the client side. /// @param arg1...arg10 Parameters. /// @return Reply to service. QVariant DapAbstractCommand::respondToService(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, @@ -105,6 +113,7 @@ QVariant DapAbstractCommand::respondToService(const QVariant &arg1, const QVaria } /// Reply from client. +/// @details Performed on the service side. /// @return Client reply. QVariant DapAbstractCommand::replyFromClient() { @@ -113,6 +122,9 @@ QVariant DapAbstractCommand::replyFromClient() return QVariant(); } +/// Send a notification to the service. At the same time, you should not expect a response from the service. +/// @details Performed on the client side. +/// @param arg1...arg10 Parameters. void DapAbstractCommand::notifyToService(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, @@ -138,6 +150,9 @@ void DapAbstractCommand::notifyToService(const QVariant &arg1, const QVariant &a socket->notify(notify); } +/// Process the notification from the client on the service side. +/// @details Performed on the service side. +/// @param arg1...arg10 Parameters. void DapAbstractCommand::notifedFromClient(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, const QVariant &arg10) { Q_UNUSED(arg1); @@ -155,6 +170,7 @@ void DapAbstractCommand::notifedFromClient(const QVariant &arg1, const QVariant } /// Send request to service. +/// @details Performed on the client side. /// @param arg1...arg10 Parameters. void DapAbstractCommand::requestToService(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, @@ -180,6 +196,7 @@ void DapAbstractCommand::requestToService(const QVariant &arg1, const QVariant & } /// Send a response to the client. +/// @details Performed on the service side. /// @param arg1...arg10 Parameters. /// @return Reply to client. QVariant DapAbstractCommand::respondToClient(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, @@ -202,6 +219,7 @@ QVariant DapAbstractCommand::respondToClient(const QVariant &arg1, const QVarian } /// Reply from service. +/// @details Performed on the service side. /// @return Service reply. void DapAbstractCommand::replyFromService() { diff --git a/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.h b/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.h index b7149548261431d562de9866861be5f47b221005..aabd1cccc8f887212d7e3d44a780dde1aa6de23f 100644 --- a/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.h +++ b/libCellFrameDashboardCommon/Handlers/DapAbstractCommand.h @@ -22,28 +22,35 @@ class DapAbstractCommand : public DapCommand Q_OBJECT protected: + /// Parent. QObject * m_parent {nullptr}; public: /// Overloaded constructor. /// @param asServiceName Service name. - /// @param apSocket Client connection socket with service. /// @param parent Parent. + /// @details The parent must be either DapRPCSocket or DapRPCLocalServer. explicit DapAbstractCommand(const QString &asServiceName, QObject *parent = nullptr); signals: + /// The signal is emitted in case of successful notification of the client by the service. + /// @param aNotify Notification. void clientNotifed(const QVariant& aNotify); - /// The signal is emitted if a response from the client is successfully received. + /// The signal is emitted if the client has successfully received + /// a request from the service and responded to the service. /// @param asRespond Client response. void clientResponded(const QVariant& aRespond); - + /// The signal is emitted if the client successfully notifies the service. + /// @param aNotify Notification. void serviceNotifed(const QVariant& aNotify); - /// The signal is emitted in case of a successful response from the service. + /// The signal is emitted if the service has successfully received + /// a request from the client and responded to the client /// @param asRespond Service response. void serviceResponded(const QVariant& aRespond); public slots: - /// Send noify to client. + /// Send a notification to the client. At the same time, you should not expect a response from the client. + /// @details Performed on the service side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifyToClient(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -51,7 +58,8 @@ public slots: const QVariant &arg6 = QVariant(), const QVariant &arg7 = QVariant(), const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); - /// Send noify to client. + /// Process the notification from the service on the client side. + /// @details Performed on the client side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifedFromService(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -60,6 +68,7 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Send request to client. + /// @details Performed on the service side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void requestToClient(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -68,6 +77,7 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Send a response to the service. + /// @details Performed on the client side. /// @param arg1...arg10 Parameters. /// @return Reply to service. virtual QVariant respondToService(const QVariant &arg1 = QVariant(), @@ -77,10 +87,12 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Reply from client. + /// @details Performed on the service side. /// @return Client reply. virtual QVariant replyFromClient(); - /// Send noify to service. + /// Send a notification to the service. At the same time, you should not expect a response from the service. + /// @details Performed on the client side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifyToService(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -88,7 +100,8 @@ public slots: const QVariant &arg6 = QVariant(), const QVariant &arg7 = QVariant(), const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); - /// Send noify to client. + /// Process the notification from the client on the service side. + /// @details Performed on the service side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifedFromClient(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -97,6 +110,7 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Send request to service. + /// @details Performed on the client side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void requestToService(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -105,6 +119,7 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Send a response to the client. + /// @details Performed on the service side. /// @param arg1...arg10 Parameters. /// @return Reply to client. virtual QVariant respondToClient(const QVariant &arg1 = QVariant(), @@ -114,6 +129,7 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Reply from service. + /// @details Performed on the service side. /// @return Service reply. virtual void replyFromService(); }; diff --git a/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.cpp b/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.cpp index bdc3955398597811fcb2cc6bab204546186b95f8..9c1a2fa9c1b5569725a66486deba392ad637912a 100644 --- a/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.cpp +++ b/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.cpp @@ -1,5 +1,9 @@ #include "DapActivateClientCommand.h" +/// Overloaded constructor. +/// @param asServiceName Service name. +/// @param parent Parent. +/// @details The parent must be either DapRPCSocket or DapRPCLocalServer. DapActivateClientCommand::DapActivateClientCommand(const QString &asServicename, QObject *parent) : DapAbstractCommand(asServicename, parent) { diff --git a/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.h b/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.h index 3c89ad83910f055b1c5541c99cd9edea9ec69e50..9ff28743d158c43e37c6dd299406b6b7b6f46343 100644 --- a/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.h +++ b/libCellFrameDashboardCommon/Handlers/DapActivateClientCommand.h @@ -1,8 +1,17 @@ +/**************************************************************************** +** +** This file is part of the libCellFrameDashboardClient library. +** +** The class implements the command to activate the GUI client. That is, +** by clicking on the icon in the system tray, the main window of the GUI +** client is minimized / expanded. +** +****************************************************************************/ + #ifndef DAPACTIVATECLIENTCOMMAND_H #define DAPACTIVATECLIENTCOMMAND_H #include <QObject> -#include <QSystemTrayIcon> #include "DapAbstractCommand.h" @@ -12,10 +21,8 @@ public: /// Overloaded constructor. /// @param asServiceName Service name. /// @param parent Parent. + /// @details The parent must be either DapRPCSocket or DapRPCLocalServer. DapActivateClientCommand(const QString &asServicename, QObject *parent = nullptr); - -public slots: - }; #endif // DAPACTIVATECLIENTCOMMAND_H diff --git a/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.cpp b/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.cpp index 31e6df6245f7ada532043b671fb44941bacc8d1d..c5147bd5ed97d8b10b3c5e6b445a31ffc6406d18 100644 --- a/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.cpp +++ b/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.cpp @@ -3,12 +3,16 @@ /// Overloaded constructor. /// @param asServiceName Service name. /// @param parent Parent. +/// @details The parent must be either DapRPCSocket or DapRPCLocalServer. DapQuitApplicationCommand::DapQuitApplicationCommand(const QString &asServicename, QObject *parent) : DapAbstractCommand(asServicename, parent) { } +/// Send a notification to the client. At the same time, you should not expect a response from the client. +/// @details Performed on the service side. +/// @param arg1...arg10 Parameters. void DapQuitApplicationCommand::notifyToClient(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, @@ -23,6 +27,9 @@ void DapQuitApplicationCommand::notifyToClient(const QVariant &arg1, const QVari connect(server, SIGNAL(onClientDisconnected()), qApp, SLOT(quit())); } +/// Process the notification from the service on the client side. +/// @details Performed on the client side. +/// @param arg1...arg10 Parameters. void DapQuitApplicationCommand::notifedFromService(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, diff --git a/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.h b/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.h index 53db68b33f3de8e3b2f6eca2858c1f9630f6427b..c40ae937f79d7ea8d27010ca7f5269078bd22083 100644 --- a/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.h +++ b/libCellFrameDashboardCommon/Handlers/DapQuitApplicationCommand.h @@ -1,3 +1,12 @@ +/**************************************************************************** +** +** This file is part of the libCellFrameDashboardClient library. +** +** The class implements the exit command of the application. Both the +** GUI client and the service complete the work. +** +****************************************************************************/ + #ifndef DAPQUITAPPLICATIONCOMMAND_H #define DAPQUITAPPLICATIONCOMMAND_H @@ -9,29 +18,33 @@ class DapQuitApplicationCommand : public DapAbstractCommand { Q_OBJECT + public: /// Overloaded constructor. /// @param asServiceName Service name. /// @param parent Parent. + /// @details The parent must be either DapRPCSocket or DapRPCLocalServer. explicit DapQuitApplicationCommand(const QString &asServicename, QObject *parent = nullptr); public slots: - /// Send noify to client. + /// Send a notification to the client. At the same time, you should not expect a response from the client. + /// @details Performed on the service side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifyToClient(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), const QVariant &arg4 = QVariant(), const QVariant &arg5 = QVariant(), const QVariant &arg6 = QVariant(), const QVariant &arg7 = QVariant(), const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), - const QVariant &arg10 = QVariant()); - /// Send noify to client. + const QVariant &arg10 = QVariant()) override; + /// Process the notification from the service on the client side. + /// @details Performed on the client side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifedFromService(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), const QVariant &arg4 = QVariant(), const QVariant &arg5 = QVariant(), const QVariant &arg6 = QVariant(), const QVariant &arg7 = QVariant(), const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), - const QVariant &arg10 = QVariant()); + const QVariant &arg10 = QVariant()) override; }; #endif // DAPQUITAPPLICATIONCOMMAND_H diff --git a/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.cpp b/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.cpp index caf7ee345c8f7a006548656071b676a2681fe340..e4ffd9a3c644e602ad9d038fd5f1d8923fb9bc41 100644 --- a/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.cpp +++ b/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.cpp @@ -25,6 +25,9 @@ DapUpdateLogsCommand::DapUpdateLogsCommand(const QString &asServiceName, QObject } } +/// Send a notification to the client. At the same time, you should not expect a response from the client. +/// @details Performed on the service side. +/// @param arg1...arg10 Parameters. void DapUpdateLogsCommand::notifyToClient(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, @@ -40,6 +43,9 @@ void DapUpdateLogsCommand::notifyToClient(const QVariant &arg1, const QVariant & DapAbstractCommand::notifyToClient(m_bufLog, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); } +/// Process the notification from the service on the client side. +/// @details Performed on the client side. +/// @param arg1...arg10 Parameters. void DapUpdateLogsCommand::notifedFromService(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8, const QVariant &arg9, @@ -59,7 +65,8 @@ void DapUpdateLogsCommand::notifedFromService(const QVariant &arg1, const QVaria emit clientNotifed(arg1); } -/// The log file is being read. +/// Send a response to the client. +/// @details Performed on the service side. /// @param arg1...arg10 Parameters. /// @return Reply to client. QVariant DapUpdateLogsCommand::respondToClient(const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, @@ -116,6 +123,7 @@ void DapUpdateLogsCommand::dapGetLog() } /// Reply from service. +/// @details Performed on the service side. /// @return Service reply. void DapUpdateLogsCommand::replyFromService() { diff --git a/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.h b/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.h index f3a92a3ee5560ea90a8cc16529e59b7ac7b5fd08..37d93fa8ea35c7796f5e6b378d0d37569e993951 100644 --- a/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.h +++ b/libCellFrameDashboardCommon/Handlers/DapUpdateLogsCommand.h @@ -32,7 +32,8 @@ protected slots: void dapGetLog(); public slots: - /// Send noify to client. + /// Send a notification to the client. At the same time, you should not expect a response from the client. + /// @details Performed on the service side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifyToClient(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -40,7 +41,8 @@ public slots: const QVariant &arg6 = QVariant(), const QVariant &arg7 = QVariant(), const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); - /// Send noify to client. + /// Process the notification from the service on the client side. + /// @details Performed on the client side. /// @param arg1...arg10 Parameters. Q_INVOKABLE virtual void notifedFromService(const QVariant &arg1 = QVariant(), const QVariant &arg2 = QVariant(), const QVariant &arg3 = QVariant(), @@ -49,6 +51,7 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Send a response to the client. + /// @details Performed on the service side. /// @param arg1...arg10 Parameters. /// @return Reply to client. virtual QVariant respondToClient(const QVariant &arg1 = QVariant(), @@ -58,6 +61,7 @@ public slots: const QVariant &arg8 = QVariant(), const QVariant &arg9 = QVariant(), const QVariant &arg10 = QVariant()); /// Reply from service. + /// @details Performed on the service side. /// @return Service reply. virtual void replyFromService(); };