Index: main.cpp =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- main.cpp (.../main.cpp) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ main.cpp (.../main.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/applicationcontroller.cpp =================================================================== diff -u -rc933552983a659ca4cc351ff4d43d07319adab1e -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision c933552983a659ca4cc351ff4d43d07319adab1e) +++ sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -20,50 +20,124 @@ #include "maintimer.h" #include "guicontroller.h" #include "messagedispatcher.h" +#include "logger.h" +#include "usbwatcher.h" +#include "filehandler.h" -// Singleton -SINGLETON_INIT(ApplicationController) - /*! * \brief ApplicationController Constructor * \param parent */ ApplicationController::ApplicationController(QObject *parent) : QObject(parent) { - _fileHandler = new Storage::FileHandler (this); _applicationPost = new ApplicationPost(this); - } /*! * \brief ApplicationController initializer */ bool ApplicationController::init() { - if (!_fileHandler ->init()) return false; - if (!_applicationPost->init()) return false; + if ( _init ) return false; + _init = true; + initConnections(); + if (!_applicationPost->init()) return false; + + LOG_EVENT(QObject::tr("%1 Initialized").arg(metaObject()->className())); + return true; } /*! - * \brief GUI Controller connections definition + * \brief ApplicationController::init + * \details Initialized the Class by calling the init() method first + * And initializes the thread vThread by calling initThread + * on success init(). + * \param vThread - the thread + * \return returns the return value of the init() method */ -void ApplicationController::initConnections() +bool ApplicationController::init(QThread &vThread) { + if ( ! init() ) return false; + initThread(vThread); + return true; +} - connect(_MainTimer , SIGNAL( didTimeout()), - this , SLOT(onMainTimerTimeout())); +/*! + * \brief ApplicationController::quit + * \details quits the class + * Calls quitThread + */ +void ApplicationController::quit() +{ + quitThread(); +} +/*! + * \brief ApplicationController::initConnections + * \details Initializes the required signal/slot connection between this class and other objects + * to be able to communicate. + */ +void ApplicationController::initConnections() +{ + connect(&_MainTimer , SIGNAL( didTimeout()), + this , SLOT(onMainTimerTimeout())); + // From GUI - connect(_GuiController , SIGNAL(didActionTransmit(GuiActionType, const QVariantList &)), - this , SLOT( onActionTransmit(GuiActionType, const QVariantList &))); + connect(&_GuiController , SIGNAL(didActionTransmit(GuiActionType, const QVariantList &)), + this , SLOT( onActionTransmit(GuiActionType, const QVariantList &))); + // From HD/DG - connect(_MessageDispatcher, SIGNAL(didActionReceive(GuiActionType, const QVariantList &)), - this , SLOT( onActionReceive(GuiActionType, const QVariantList &))); + connect(&_MessageDispatcher, SIGNAL(didActionReceive(GuiActionType, const QVariantList &)), + this , SLOT( onActionReceive(GuiActionType, const QVariantList &))); + + connect(&_GuiController , SIGNAL(didUSBDriveUmount()), + this , SLOT( onUSBDriveUmount())); + connect(&_USBWatcher , SIGNAL(didUSBDriveMount ()), + this , SLOT( onUSBDriveMount ())); + connect(&_USBWatcher , SIGNAL(didUSBDriveRemove()), + this , SLOT( onUSBDriveRemove())); + + connect(&_GuiController , SIGNAL(didExportLog()), + this , SLOT( onExportLog())); + + connect(&_Logger , SIGNAL(didExport()), + this , SLOT( onExport())); } /*! + * \brief ApplicationController::initThread + * \details Moves this object into the thread vThread. + * And checks that this method is called from main thread. + * Also connects quitThread to application aboutToQuit. + * \param vThread - the thread + */ +void ApplicationController::initThread(QThread &vThread) +{ + // runs in main thread + Q_ASSERT_X(QThread::currentThread() == qApp->thread() , __func__, "The Class initialization must be done in Main Thread" ); + _thread = &vThread; + _thread->setObjectName(QString("%1_Thread").arg(metaObject()->className())); + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quit())); + _thread->start(); + moveToThread(_thread); +} + +/*! + * \brief ApplicationController::quitThread + * \details Moves this object to main thread to be handled by QApplicaiton + * And to be destroyed there. + */ +void ApplicationController::quitThread() +{ + if ( ! _thread ) return; + + // runs in thread + moveToThread(qApp->thread()); +} + +/*! * \brief Process the requested action * \details Processes the requested action * \param vAction - User requested Action @@ -96,6 +170,54 @@ } /*! + * \brief ApplicationController::onUSBDriveMount + * \details This is the slot which connects to the _USBWatcher didUSBDriveMount signal + * and notifies the other classes (GuiController) by emitting its signal didUSBDriveMount + */ +void ApplicationController::onUSBDriveMount () +{ + emit didUSBDriveMount(); +} + +/*! + * \brief ApplicationController::onUSBDriveRemove + * \details This is the slot which connects to the _GuiController didUSBDriveUmount signal + * and notifies the other classes (USBWatcher) by emitting its signal didUSBDriveUmount + */ +void ApplicationController::onUSBDriveUmount() +{ + emit didUSBDriveUmount(); +} + +/*! + * \brief ApplicationController::onUSBDriveRemove + * \details This is the slot which connects to the _USBWatcher didUSBDriveRemove signal + * and notifies the other classes (GuiController) by emitting its signal didUSBDriveRemove + */ +void ApplicationController::onUSBDriveRemove() +{ + emit didUSBDriveRemove(); +} + +/*! + * \brief ApplicationController::onExportLog + * \details the slot which will be called by UI to so the log export. + */ +void ApplicationController::onExportLog() +{ + LOG_EXPORT; +} + +/*! + * \brief ApplicationController::onExport + * \details the slot which will be called by logger is done exporting. + */ +void ApplicationController::onExport() +{ + emit didExport(); +} + +/*! * \brief ApplicationController::keepAlive * \details This is the message which has to be send over the CANBUS * as an monitor for other nodes on the bus to notify UI is alive Index: sources/applicationcontroller.h =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/canbus/caninterface.cpp =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/canbus/caninterface.h =================================================================== diff -u -rc933552983a659ca4cc351ff4d43d07319adab1e -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/caninterface.h (.../caninterface.h) (revision c933552983a659ca4cc351ff4d43d07319adab1e) +++ sources/canbus/caninterface.h (.../caninterface.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -21,7 +21,7 @@ #include "main.h" // Define -#define _CanInterface CanInterface::I() +#define _CanInterface Can::CanInterface::I() // forward declarations class tst_canbus; @@ -56,17 +56,33 @@ QString _canStatus = ""; bool _enableConsoleOut = false; - // Singleton - SINGLETON_DECL(CanInterface) -public: + QThread *_thread = nullptr; + bool _init = false; + +// Singleton +SINGLETON(CanInterface) + +public slots: bool init(); + bool init(QThread &vThread); + +private slots: void quit(); +public: QString status() const; void enableConsoleOut(bool vEnabled) { _enableConsoleOut = vEnabled; } + + void quitDevice(); private: void initConnections(); + void initThread(QThread &vThread); + void quitThread(); + + bool initDevice(); + bool testDevice(); + void status (const QString &vDescription, QString vError = ""); bool transmit (const QCanBusFrame &vFrame); void consoleOut (const QCanBusFrame &vFrame); @@ -80,13 +96,15 @@ * \param vFrame - The Frame which has been received */ void didFrameReceive (const QCanBusFrame &vFrame ); + /*! * \brief didFrameError * \details If and error occurs on CanDevice after the error is processed * this signal can be used as a notifier. * \param vStatus - CanDevice status with some extra information. */ void didFrameError (const QString &vStatus); + /*! * \brief didFrameTransmit * \details After the frame has been transmitted this signal can be used as a notifier. Index: sources/canbus/frameinterface.cpp =================================================================== diff -u -r862dc0590b73c618fac73dce2c976e3526e0404a -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/frameinterface.cpp (.../frameinterface.cpp) (revision 862dc0590b73c618fac73dce2c976e3526e0404a) +++ sources/canbus/frameinterface.cpp (.../frameinterface.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/frameinterface.h =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/frameinterface.h (.../frameinterface.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/frameinterface.h (.../frameinterface.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/messagebuilder.cpp =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/messagebuilder.cpp (.../messagebuilder.cpp) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/messagebuilder.cpp (.../messagebuilder.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/messagebuilder.h =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/messagebuilder.h (.../messagebuilder.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/messagebuilder.h (.../messagebuilder.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/messagedispatcher.cpp =================================================================== diff -u -r862dc0590b73c618fac73dce2c976e3526e0404a -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision 862dc0590b73c618fac73dce2c976e3526e0404a) +++ sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/messagedispatcher.h =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/messageglobals.h =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/canbus/messageinterpreter.h =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/gui/guicontroller.cpp =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/guicontroller.h =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/guicontroller.h (.../guicontroller.h) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/guiglobals.cpp =================================================================== diff -u -rfeb3423b373dc2a2c4267ef9fcb4d924d738423d -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision feb3423b373dc2a2c4267ef9fcb4d924d738423d) +++ sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/gui/guiglobals.h =================================================================== diff -u -rfeb3423b373dc2a2c4267ef9fcb4d924d738423d -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision feb3423b373dc2a2c4267ef9fcb4d924d738423d) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, Index: sources/gui/guiview.cpp =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/guiview.cpp (.../guiview.cpp) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/gui/guiview.cpp (.../guiview.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/guiview.h =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/guiview.h (.../guiview.h) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/gui/guiview.h (.../guiview.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -rfbeafa0714f065bce0403e2e8ce68f6d8fbea6bd -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision fbeafa0714f065bce0403e2e8ce68f6d8fbea6bd) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -rfbeafa0714f065bce0403e2e8ce68f6d8fbea6bd -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision fbeafa0714f065bce0403e2e8ce68f6d8fbea6bd) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -rfbeafa0714f065bce0403e2e8ce68f6d8fbea6bd -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision fbeafa0714f065bce0403e2e8ce68f6d8fbea6bd) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/qml/main.qml =================================================================== diff -u -rfeb3423b373dc2a2c4267ef9fcb4d924d738423d -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/qml/main.qml (.../main.qml) (revision feb3423b373dc2a2c4267ef9fcb4d924d738423d) +++ sources/gui/qml/main.qml (.../main.qml) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -rfbeafa0714f065bce0403e2e8ce68f6d8fbea6bd -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision fbeafa0714f065bce0403e2e8ce68f6d8fbea6bd) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/gui/qml/pages/TreatmentHome.qml =================================================================== diff -u -r62efc6d8ead9b39b47859fdc9c0661f30b5941d0 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/qml/pages/TreatmentHome.qml (.../TreatmentHome.qml) (revision 62efc6d8ead9b39b47859fdc9c0661f30b5941d0) +++ sources/gui/qml/pages/TreatmentHome.qml (.../TreatmentHome.qml) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -33,8 +33,6 @@ property alias createTreatmentButton: _createTreatmentRect.button // exported properties - // - TreatmentStart { id : _treatmentStart onBackPressed: { _treatmentStack.pop() Index: sources/gui/qml/pages/TreatmentStart.qml =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/gui/qml/pages/TreatmentStart.qml (.../TreatmentStart.qml) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/gui/qml/pages/TreatmentStart.qml (.../TreatmentStart.qml) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/main.h =================================================================== diff -u -r62efc6d8ead9b39b47859fdc9c0661f30b5941d0 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/main.h (.../main.h) (revision 62efc6d8ead9b39b47859fdc9c0661f30b5941d0) +++ sources/main.h (.../main.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -22,16 +22,21 @@ // Project -#define SINGLETON_DECL(vCLASS) \ +// TODO : A singleton parent class needs to be created +// to taking care of the Threading, init, quit, and so + +// TODO : +// - We still need to work on threading on other classes +// - We need to have a singleton parent class +// - Some code has been added to debug can interface (We still have swap frames) +#define SINGLETON(vCLASS) \ private: \ - static vCLASS *_instance; \ explicit vCLASS(QObject *parent = nullptr); \ + virtual ~vCLASS() { } \ + vCLASS(vCLASS const &) = delete; \ + vCLASS & operator = (vCLASS const &) = delete; \ public: \ - static vCLASS *I() { \ - if (!_instance) \ - _instance = new vCLASS(); \ - return _instance; \ + static vCLASS &I() { \ + static vCLASS _instance; \ + return _instance; \ } - -#define SINGLETON_INIT(vCLASS) \ - vCLASS *vCLASS::_instance = nullptr; Index: sources/maintimer.cpp =================================================================== diff -u -r56d00a82669a7a2c00ab90109a89dbec8db27527 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/maintimer.cpp (.../maintimer.cpp) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) +++ sources/maintimer.cpp (.../maintimer.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/maintimer.h =================================================================== diff -u -re1605219ac2baf49ef21d0889f845ac53d59c3c1 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/maintimer.h (.../maintimer.h) (revision e1605219ac2baf49ef21d0889f845ac53d59c3c1) +++ sources/maintimer.h (.../maintimer.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 Index: sources/storage/filehandler.cpp =================================================================== diff -u -r62efc6d8ead9b39b47859fdc9c0661f30b5941d0 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/storage/filehandler.cpp (.../filehandler.cpp) (revision 62efc6d8ead9b39b47859fdc9c0661f30b5941d0) +++ sources/storage/filehandler.cpp (.../filehandler.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -14,32 +14,83 @@ #include "filehandler.h" //Qt -#include #include +#include +#include +#include // Project +#include "storageglobals.h" +#include "logger.h" +#include "threads.h" +// namespace using namespace Storage; -FileHandler::FileHandler(QObject *parent) : QObject(parent) -{ - connect(&fsWatcher, SIGNAL(directoryChanged(QString)), - this , SLOT(directoryChanged(QString))); -} -bool FileHandler::init() +/*! + * \brief FileHandler::write + * \details Writes the content of vContent into the file vFileName. + * \param vFileName - Source file name + * \param vContent - The content which is going to be written in the file. + * \param vAppend - if set to true the content will be appended at the end of the file. + * \return false if file can't be opened. + */ +bool FileHandler::write(const QString &vFileName, const QString &vContent, bool vAppend) { - fsWatcher.addPath("/dev/"); + QFile file(vFileName); + QIODevice::OpenMode openMode = vAppend ? + QFile::Text | QFile::Append : + QFile::Text | QFile::WriteOnly; + if (! file.open(openMode)) { + LOG_ERROR(QObject::tr("Can't open file for write (%1)").arg(vFileName)); + return false; + } + QTextStream out(&file); + out << vContent; + out.flush(); return true; } -void FileHandler::directoryChanged(const QString &vPath) +/*! + * \brief FileHandler::read + * \details reads file vFilename content into vContent variable. + * \param vFileName - Source file name + * \param vContent - The content of the file which will be set when done. + * \return false if file can't be opened. + */ +bool FileHandler::read(const QString &vFileName, QString &vContent) { - Q_UNUSED(vPath) - // qDebug() << QFileInfo::exists("/dev/sda"); + QFile file(vFileName); + if (! file.open(QFile::Text | QFile::ReadOnly)) { + LOG_ERROR(QObject::tr("Can't open file for read (%1)").arg(vFileName)); + return false; + } + QTextStream in(&file); + vContent = in.readAll(); + return true; } -bool FileHandler::mountUsb() +/*! + * \brief FileHandler::copyFolder + * \details Copies all the file and folders recursively. + * \param vSource - The source folder + * \param vDestination - The destination folder + * \return Tue on successful execution. + * \note This method uses the Linux "cp -r vSource vDestination" command + * Not a Thread-Safe. + * + */ +int FileHandler::copyFolder(const QString &vSource, const QString &vDestination ) { - return true; + QString cp = "cp"; + QStringList arguments; + arguments << "-r" << vSource << vDestination; + int result = QProcess::execute(cp, arguments); + + cp = "sync;sync;sync;"; + arguments.clear(); + QProcess::execute(cp, arguments); + + return result; } Index: sources/storage/filehandler.h =================================================================== diff -u -r62efc6d8ead9b39b47859fdc9c0661f30b5941d0 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/storage/filehandler.h (.../filehandler.h) (revision 62efc6d8ead9b39b47859fdc9c0661f30b5941d0) +++ sources/storage/filehandler.h (.../filehandler.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -14,33 +14,24 @@ #pragma once // Qt -#include -#include -// Project +#include namespace Storage { -class FileHandler : public QObject +/*! + * \brief The FileHandler class + * This class is suppose to be the static class + * which contains methods to manipulate files and folders + * Since it is static it doesn't have thread so needs to be used with care + * and the class(es) which is using it needs to be taking care of the threading + */ +class FileHandler { - Q_OBJECT - - const char *_usbMount = "/media"; - - QFileSystemWatcher fsWatcher; - public: - explicit FileHandler(QObject *parent = nullptr); + static bool write(const QString &vFileName, const QString &vContent, bool vAppend = true); + static bool read (const QString &vFileName, QString &vContent); - bool init(); - bool doExport(); - bool doImport(); - -signals: - void usbStatusChanged(bool available); - -private slots: - void directoryChanged(const QString &vPath); - bool mountUsb(); + static int copyFolder(const QString &vSource, const QString &vDestination); }; } Index: sources/storage/logger.cpp =================================================================== diff -u -r62efc6d8ead9b39b47859fdc9c0661f30b5941d0 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/storage/logger.cpp (.../logger.cpp) (revision 62efc6d8ead9b39b47859fdc9c0661f30b5941d0) +++ sources/storage/logger.cpp (.../logger.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -13,9 +13,234 @@ */ #include "logger.h" +// Qt +#include +#include +#include +#include +#include +#include + +// Project +#include "storageglobals.h" +#include "filehandler.h" +#include "threads.h" + using namespace Storage; -Logger::Logger(QObject *parent) : QObject(parent) +Logger::Logger(QObject *parent) : QObject(parent) { } + +/*! + * \brief Logger::init + * \details Initializes the Class. + * \return False if it has been called before. + */ +bool Logger::init() { + if ( _init ) return false; + _init = true; + // runs in thread + checkLogPath(); + initConnections(); + + LOG_EVENT(QObject::tr("%1 Initialized").arg(metaObject()->className())); + + return true; } + +/*! + * \brief Logger::init + * \details Initialized the Class by calling the init() method first + * And initializes the thread vThread by calling initThread + * on success init(). + * \param vThread - the thread + * \return returns the return value of the init() method + */ +bool Logger::init(QThread &vThread) +{ + if ( ! init() ) return false; + initThread(vThread); + return true; +} + +/*! + * \brief Logger quit + * \details quits the class + * Calls quitThread + */ +void Logger::quit() +{ + quitThread(); +} + +void Logger::onLog(const QString &vContent, LogType vLogType) +{ + log(vContent,vLogType); +} + +/*! + * \brief Logger::initConnections + * \details Initializes the required signal/slot connection between this class and other objects + * to be able to communicate. + * \note No connection has been defined yet. + */ +void Logger::initConnections() +{ + connect(&_exportWatcher, SIGNAL(finished()), + this , SLOT(onExport())); + + connect(this, SIGNAL(didLog(QString,LogType)), + this, SLOT( onLog(QString,LogType))); +} + +/*! + * \brief Logger::initThread + * \details Moves this object into the thread vThread. + * And checks that this method is called from main thread. + * Also connects quitThread to application aboutToQuit. + * \param vThread - the thread + */ +void Logger::initThread(QThread &vThread) +{ + // runs in main thread + Q_ASSERT_X(QThread::currentThread() == qApp->thread() , __func__, "The Class initialization must be done in Main Thread" ); + _thread = &vThread; + _thread->setObjectName(QString("%1_Thread").arg(metaObject()->className())); + connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quit())); + _thread->start(); + moveToThread(_thread); +} + +/*! + * \brief Logger::quitThread + * \details Moves this object to main thread to be handled by QApplicaiton + * And to be destroyed there. + */ +void Logger::quitThread() +{ + if (! _thread) return; + + // runs in thread + moveToThread(qApp->thread()); +} + +/*! + * \brief Logger::checkLogPath + * \details Sets the log paths and creates them if didn't exist. + */ +void Logger::checkLogPath() +{ + setLogBasePath(); // try to use /media/sd_card on device + if (! setLogPath()) { // check and create log folders & if unsuccessful then + setLogBasePath(true); // try to use application folder + setLogPath ( ); // check and create log folders // Note: it may require to check for write access regarding device setup + } +} + +/*! + * \brief Logger::setLogBasePath + * \details Tries to the set the log path to the default log path (Log_Base_Path_Name) + * Will set the application folder as the base log path if can't set the log path to the default. + * Will log the event in that case. + * \param vUseApplicationDirPath + */ +void Logger::setLogBasePath(bool vUseApplicationDirPath) +{ + if (vUseApplicationDirPath) { + _dir.setPath(qApp->applicationDirPath()); + LOG_EVENT(tr("Application Dir Path used for events logging (%1)").arg(_dir.path())); + } else { + _dir.setPath(Log_Base_Path_Name); + } +} + +/*! + * \brief Logger::setLogPath + * \details set the log path for each of the Datum, Event, Error log types + * \return False if can not st the log paths. + */ +bool Logger::setLogPath() +{ + bool ok = true; + ok = ok && setLogPath(LogType::eLogEvent); + ok = ok && setLogPath(LogType::eLogError); + ok = ok && setLogPath(LogType::eLogDatum); + return ok; +} + +/*! + * \brief Logger::setLogPath + * \details Sets the log path for the log type vLogType + * Creates the folder if not exists. + * \param vLogType - log type + * \return returns false if the path doesn't exist and folder can't be created. + */ +bool Logger::setLogPath(LogType vLogType) +{ + _logPathNames[vLogType] = _dir.path() + "/" + _logBasePathNames[vLogType]; + if ( ! _dir.exists(_logBasePathNames[vLogType]) ) { + if ( ! _dir.mkpath(_logBasePathNames[vLogType]) ) { + LOG_ERROR(tr("Can't create %1 log path (%2)") + .arg(_logPrefix[vLogType]) + .arg(_logPathNames[vLogType]) + ); + return false; + } + } + return true; +} + +/*! + * \brief Logger::log + * \details Logs the content vContent in log type of vLogType. + * \param vContent - Log content + * \param vLogType - Log type + * \note This method is not thread-safe so is private and needs to be called by concurrentLog + * Which uses QtConcurrent::run to run in thread and thread-safe. + */ +void Logger::log(const QString &vContent, Logger::LogType vLogType) +{ + QString date = QDate::currentDate().toString(_dateFormat); + QString mContent; + + switch (vLogType) { + case eLogEvent: + case eLogError: + case eLogDatum: + break; + default: + LOG_ERROR(tr("Incorrect type of logging").arg(vLogType)); + } + mContent += _logPrefix[vLogType]; + mContent += _prefixSeparator; + mContent += QTime::currentTime().toString(_timeFormat); + mContent += _timeSeparator + vContent; + QString fileName = date + _dateSeparator + Log_File_Name; + _logFileName = _logPathNames[vLogType] + fileName; + FileHandler::write(_logFileName, mContent + "\r\n", true); + if (vLogType == eLogError) { + qDebug().noquote() << mContent; + } +} + +/*! + * \brief Logger::concurrentExport + * \details Exports the log files from log folder (Storage::Log_Base_Path_Name_Location) + * into USB drive folder (Storage::USB_Mount_Point) + * \return always returns true for now. + * \note This method uses QtConcurrent run to execute the FileHandler copyFolder method. + */ +bool Logger::concurrentExport() +{ + QString mSource = Storage::Log_Base_Path_Name_Location; + QString mDestination = Storage::USB_Mount_Point; + QFuture future = QtConcurrent::run(&FileHandler::copyFolder, mSource, mDestination); + _exportWatcher.setFuture(future); + return true; +} + +void Logger::onExport() +{ + emit didExport(); +} Index: sources/storage/logger.h =================================================================== diff -u -r62efc6d8ead9b39b47859fdc9c0661f30b5941d0 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/storage/logger.h (.../logger.h) (revision 62efc6d8ead9b39b47859fdc9c0661f30b5941d0) +++ sources/storage/logger.h (.../logger.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -13,19 +13,132 @@ */ #pragma once +// Qt #include +#include +#include +// Project +#include "main.h" +#include "storageglobals.h" + + +// Define +#define _Logger Storage::Logger::I() +#define LOG_EVENT(vCONTENT) emit Storage::Logger::I().didLog(vCONTENT, Storage::Logger::LogType::eLogEvent) +#define LOG_ERROR(vCONTENT) emit Storage::Logger::I().didLog(vCONTENT, Storage::Logger::LogType::eLogError) +#define LOG_DATUM(vCONTENT) emit Storage::Logger::I().didLog(vCONTENT, Storage::Logger::LogType::eLogDatum) +#define LOG_EXPORT _Logger.concurrentExport() + +// forward declarations +class tst_logging; + namespace Storage { +/*! + * \brief The Logger class + * \details Main logger class that has all the required implementation for logging. + * The provided interface is the LOG_DATUM, LOG_EVENT, LOG_ERROR, LOG_EXPORT defines + * and no other methods. + * This should have it's own thread. + * \note + * PLEASE BE CAREFUL THIS CLASS IS USING QtConcurrent::run FOR THE EXPORT LOG FILES. + * AND ONLY PRIVATE VOID LOG (,) IS CALLING IN POOLED THREAD + * PLEASE BE VERY CAREFUL. + * ALL THE OTHER CLASSES TO USE THIS CLASS SHOULD ONLY USE LOG_DATUM, LOG_EVENT, LOG_ERROR + * TO DO THE LOGGING + */ class Logger : public QObject { Q_OBJECT + + // friends + friend class ::tst_logging; + public: - explicit Logger(QObject *parent = nullptr); + enum LogType { + eLogEvent, + eLogError, + eLogDatum, + }; -signals: +private: + QDir _dir; + QHash _logPathNames; + QHash _logBasePathNames { + { eLogEvent, "log/event/" }, + { eLogError, "log/error/" }, + { eLogDatum, "log/event/" }, // "log/datum/" + }; + QHash _logPrefix { + { eLogEvent, "Event" }, + { eLogError, "Error" }, + { eLogDatum, "Datum" }, + }; + const char *_dateFormat = "yyyy_MM_dd"; + const char *_timeFormat = "HH:mm:ss"; + + const char *_prefixSeparator = ": " ; + const char *_dateSeparator = "_" ; + const char *_timeSeparator = " , "; + + QString _logFileName = ""; + + QFutureWatcher _exportWatcher; + + QThread *_thread = nullptr; + bool _init = false; + +// Singleton +SINGLETON(Logger) + public slots: + bool init(); + bool init(QThread &vThread); + +private slots: + void quit(); + +private: + void initConnections(); + + void initThread(QThread &vThread); + void quitThread(); + +private: +// ----- setting up + void checkLogPath (); + void setLogBasePath (bool vUseApplicationDirPath = false); + bool setLogPath (); + bool setLogPath (LogType vLogType); + +// ----- Export structure +public slots: + bool concurrentExport(); +private slots: + void onExport(); +signals: + /*! + * \brief didExport + * \details notifies the UI when the export is done. + */ + void didExport(); + +// ----- logging structure +private slots: + void onLog(const QString &vContent, LogType vLogType); +private: + void log (const QString &vContent, LogType vLogType); +signals: + /*! + * \brief didLog + * \details Notifies the logger on a request for log + * \param vContent - content as type of string to be logged + * \param vLogType - the type of logging of type Storage::Logger::LogType + */ + void didLog (const QString &vContent, LogType vLogType); }; } + Index: sources/utility/format.cpp =================================================================== diff -u -rfeb3423b373dc2a2c4267ef9fcb4d924d738423d -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/utility/format.cpp (.../format.cpp) (revision feb3423b373dc2a2c4267ef9fcb4d924d738423d) +++ sources/utility/format.cpp (.../format.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/utility/format.h =================================================================== diff -u -rfeb3423b373dc2a2c4267ef9fcb4d924d738423d -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/utility/format.h (.../format.h) (revision feb3423b373dc2a2c4267ef9fcb4d924d738423d) +++ sources/utility/format.h (.../format.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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, Index: sources/utility/types.h =================================================================== diff -u -re02b2d465b145702dc41965b2e7da154857eea75 -rc6a09899d2e46dc0bda5a6b994aa257953626f97 --- sources/utility/types.h (.../types.h) (revision e02b2d465b145702dc41965b2e7da154857eea75) +++ sources/utility/types.h (.../types.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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,