/*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright \n * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n * IN PART OR IN WHOLE, \n * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n * * \file guicontroller.h * \date 2019/09/30 * \author Behrouz NematiPour * */ #pragma once // Qt #include // Project #include "main.h" #include "guiglobals.h" #include "mmodel.h" // define #define _GuiController GuiController::I() // namespace namespace Gui { class GuiController : public QObject { Q_OBJECT QThread *_thread = nullptr; bool _init = false; // singleton SINGLETON(GuiController) public slots: bool init(); bool init(QThread &vThread); private slots: void quit(); private: void initConnections(); void initThread(QThread &vThread); void quitThread(); bool handleTransmit(GuiActionType vAction, const QVariantList &vData); public slots: void doActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG void doUSBDriveUmount(); // UI => OS void doExportLog (); // UI => OS private slots: // Should be private for thread safety and is connected internally. void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void onUSBDriveMount (); // OS => UI void onUSBDriveRemove(); // OS => UI void onExport (); // OS => UI ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS signals: void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG void didUSBDriveMount (); void didUSBDriveUmount(); void didUSBDriveRemove(); void didExportLog(); void didExport (); //// ----- Adjust Blood/Dialysate Flows public slots: void doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); signals: void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); //// ----- Adjust Duration public slots: void doAdjustDuration(quint32 vDuration); signals: void didAdjustDuration(quint32 vDuration); }; }