/*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file guicontroller.h * \author (last) Peter Lucia * \date (last) 25-Jun-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 * */ #pragma once // Qt #include // Project #include "main.h" #include "guiglobals.h" #include "MModel.h" #include "messageglobals.h" // define #define _GuiController GuiController::I() using namespace Can; // 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 void didFailedTransmit(Sequence seq); 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 (); // ---- Signal/Slots ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_PUBLIC ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS }; }