Index: sources/ApplicationController.h =================================================================== diff -u -r2bc6542cebc264eb343f791f75223a1ca151465e -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/ApplicationController.h (.../ApplicationController.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) +++ sources/ApplicationController.h (.../ApplicationController.h) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2023 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 ApplicationController.h * \author (last) Behrouz NematiPour - * \date (last) 29-Mar-2021 + * \date (last) 19-Dec-2022 * \author (original) Behrouz NematiPour - * \date (original) 29-Mar-2021 + * \date (original) 26-Aug-2020 * */ #pragma once @@ -18,8 +18,9 @@ #include // Project -#include "main.h" // Doxygen : don't remove +#include "main.h" // Doxygen : do not remove #include "MModel.h" +#include "ApplicationPost.h" #include "GuiGlobals.h" #include "MessageGlobals.h" #include "DeviceGlobals.h" @@ -56,14 +57,14 @@ QFutureWatcher _settingsWatcher; + ApplicationPost _post; // I may need to be put in a concurrent. + public: void initSettings(); public slots: bool init(); bool init(QThread &vThread); - -private slots: void quit(); private: @@ -72,12 +73,15 @@ void initThread(QThread &vThread); void quitThread(); + void initSetttings(); + void keepAlive(); void createFakeSequencedLongMessage (QVariantList &vData, const int vFakeDataLen); void createFakeSeqAtBeginLongMessage(QVariantList &vData, const int vFakeDataLen); - void settingsInit(); + void postDoneRequest(); + void versionsRequest(bool vPass); private slots: // Should be private for thread safety and is connected internally. void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG @@ -88,48 +92,105 @@ void onUSBDriveMount (); void onUSBDriveUmount(); void onUSBDriveRemove(); + void onUSBSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); void onSDCardStateChange(bool vIsReady, bool vIsReadOnly); + void onSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); void onSDCardSpaceTooLow(quint8 vAvailablePercent); - void onExportLog (); - void onExport (); + void onCryptSetupMount (bool vPass); + void onExportLog (const GuiStringIndexMap &vExportList); + void onExportService (const GuiStringIndexMap &vExportList); + void onExportTreatment (const GuiStringIndexMap &vExportList); + void onExport (); + void onExportStat (quint32 vIndex, const QString &vFileName, quint8 vPercent); + void onFailedTransmit(Sequence seq); - void onSettingsInit(); void onSettingsUpdate(); + void onPOSTEthernet (bool vPass); + void onPOSTWiFi (bool vPass); + void onPOSTBluetooth (bool vPass); + void onPOSTCloudSync (bool vPass); + + void onPOSTFail (Gui::GuiAlarmID vAlarmID); + void onPOSTDone (bool vPass); + + void onQuitApplication (); + signals: + void didPOSTEthernet (bool vPass); + void didPOSTWireless (bool vPass); + void didPOSTBluetooth (bool vPass); + void didPOSTCloudSync (bool vPass); + + void didPOSTEthernetData (const QString &vMacAddress); + void didPOSTWirelessData (const QString &vMacAddress); + void didPOSTBluetoothData (const QString &vMacAddress); + void didPOSTCloudSyncData (const QString &vNetAddress); + +signals: void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG void didFailedTransmit(Sequence seq); void didUSBDriveMount (); void didUSBDriveUmount(); void didUSBDriveRemove(); + void didUSBSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); void didSDCardStateChange(bool vIsReady, bool vIsReadOnly); + void didSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); void didSDCardSpaceTooLow(quint8 vAvailablePercent); void didExport (); - + void didExportStat (quint32 vIndex, const QString &vFileName, quint8 vPercent); /*! * \brief didSettingsInit - private signal to start initializing settings * \details This signal used internally to make the read task of the settings happen in Application_Thread * It's because no thread assigned to Settings itself, since this class will be used only once - * and doesn't need a thread by itself + * and does not need a thread by itself */ void didSettingsInit (QPrivateSignal); + /*! + * \brief didSettingsDone + * \details This signal will be emitted when the settings are read and ready to be used. + */ + void didSettingsDone (); + /*! + * \brief didPOSTPass + * \details This signal will be emitted when UI is done with the POST and will let other layers to know the result. + * As an example the Manufacturing will not start if the POST failed since it needs POST info for the Encrypted partition. + * \param vPass - true if passed. + */ + void didPOSTPass (bool vPass); + /*! + * \brief didKeepAliveBegin + * \details this signal will be emitted by ApplicationController + * when it is done with all the messaging and has nothing to say + * just to keep the conversation alive and let HD know UI is alive. + */ + void didKeepAliveBegin (); + /*! + * \brief didQuitApplication + * \details this signal is a placeholder for any farther notification to any class which needs to close itself. + * it will be used to let the other classes to stop and move to main thread. + */ + void didQuitApplication (); - // Device Signal/Slots DEVICE_APP_BRIDGE_DEFINITION_LIST // ---- Signal/Slots ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + ACTION_RECEIVE_PRIVATE_SLOT_NOEMIT(UIPostFinalResultHDRequestData) { + emit didActionReceive(vData); + } + // TODO: do the same for Settings. SAFE_CALL(startPOST) };