Index: denali.pro.user =================================================================== diff -u -rda52c90a17adea2160ac93042e0632a4cda46b1a -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- denali.pro.user (.../denali.pro.user) (revision da52c90a17adea2160ac93042e0632a4cda46b1a) +++ denali.pro.user (.../denali.pro.user) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -1187,7 +1187,7 @@ Qt 5.12.5 (iMX8) Qt 5.12.5 (iMX8) {5d6458ef-f917-4aef-a092-c77bbe106149} - 1 + 0 0 0 @@ -1457,12 +1457,12 @@ 1 - denali (on Generic Linux Device (iMX8)) - RemoteLinuxRunConfiguration:/home/denali/projects/application/denali.pro + denali (on Generic Linux Device (iMX8))2 + RemoteLinuxRunConfiguration:/home/denali/Projects/application/denali.pro 1 false - + -u 3768 false true Index: denali.qrc =================================================================== diff -u -r06d10ee1174f0947a01087554f3da3109b47aef6 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- denali.qrc (.../denali.qrc) (revision 06d10ee1174f0947a01087554f3da3109b47aef6) +++ denali.qrc (.../denali.qrc) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -31,6 +31,7 @@ resources/images/Clock-Plus.png resources/images/Wave-Minus.png resources/images/Wave-Plus.png + resources/images/microsd.png sources/gui/qml/components/MainMenu.qml Index: resources/images/microsd.png =================================================================== diff -u Binary files differ Index: scripts/run.sh =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- scripts/run.sh (.../run.sh) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ scripts/run.sh (.../run.sh) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -71,5 +71,4 @@ #fi #launching denali application, disable keep-alive -$HOME/denali & - +$HOME/denali -u 2>> $HOME/filesystem.err & Index: sources/applicationcontroller.cpp =================================================================== diff -u -r93b6ad6b18c505fedab37d95dc87be61db48641c -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 93b6ad6b18c505fedab37d95dc87be61db48641c) +++ sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -101,13 +101,19 @@ connect(&_MessageDispatcher, SIGNAL(didFailedTransmit(Sequence)), this , SLOT( onFailedTransmit(Sequence))); + // USB drive connect(&_GuiController , SIGNAL(didUSBDriveUmount()), this , SLOT( onUSBDriveUmount())); connect(&_DriveWatcher , SIGNAL(didUSBDriveMount ()), this , SLOT( onUSBDriveMount ())); connect(&_DriveWatcher , SIGNAL(didUSBDriveRemove()), this , SLOT( onUSBDriveRemove())); + // SD Card + connect(&_DriveWatcher , SIGNAL(didSDCardStateChange(bool, bool)), + this , SLOT( onSDCardStateChange(bool, bool))); + + connect(&_GuiController , SIGNAL(didExportLog()), this , SLOT( onExportLog())); @@ -237,6 +243,21 @@ // coco end /*! + * \brief ApplicationController::onSDCardStateChange + * \details This is the slot which connects to the _DriveWatcher didSDCardStateChange signal + * and notifies the other classes (GuiController) by emitting its signal didSDCardStateChange + * \param vIsReady - SdCard is Ready + * \param vIsReadOnly - SdCard is ReadOnly + */ +void ApplicationController::onSDCardStateChange(bool vIsReady, bool vIsReadOnly) +{ + // coco begin validated: This needs user interaction to plug-in SD Card + // has been tested manually + emit didSDCardStateChange(vIsReady, vIsReadOnly); +} +// coco end + +/*! * \brief ApplicationController::onExportLog * \details the slot which will be called by UI to so the log export. */ Index: sources/applicationcontroller.h =================================================================== diff -u -r618891879f5cdc68e37ee68eea005afb76dd4e5b -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision 618891879f5cdc68e37ee68eea005afb76dd4e5b) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -77,6 +77,8 @@ void onUSBDriveUmount(); void onUSBDriveRemove(); + void onSDCardStateChange(bool vIsReady, bool vIsReadOnly); + void onExportLog (); void onExport (); @@ -90,6 +92,8 @@ void didUSBDriveUmount(); void didUSBDriveRemove(); + void didSDCardStateChange(bool vIsReady, bool vIsReadOnly); + void didExport (); void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); Index: sources/gui/guicontroller.cpp =================================================================== diff -u -r618891879f5cdc68e37ee68eea005afb76dd4e5b -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 618891879f5cdc68e37ee68eea005afb76dd4e5b) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -74,16 +74,23 @@ // From OS : USB Drive has been removed physically. + // USB drive connect(&_ApplicationController, SIGNAL(didUSBDriveMount ()), this , SLOT( onUSBDriveMount ())); connect(&_ApplicationController, SIGNAL(didUSBDriveRemove()), this , SLOT( onUSBDriveRemove())); + // SD card + connect(&_ApplicationController, SIGNAL(didSDCardStateChange(bool,bool)), + this , SLOT( onSDCardStateChange(bool,bool))); + + // Export connect(&_ApplicationController, SIGNAL(didExport()), this , SLOT( onExport())); + // transmission fail connect(&_ApplicationController, SIGNAL(didFailedTransmit(Sequence)), - this , SLOT(didFailedTransmit(Sequence))); + this , SLOT( onFailedTransmit(Sequence))); // ---- Signal/Slots ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(_ApplicationController) @@ -257,6 +264,21 @@ // coco end /*! + * \brief GuiController::onSDCardStateChange + * \details emits didSDCardStateChange signal to notify other classes (GuiView) + * , the SD Card state has been changed. + * \param vIsReady - SdCard is Ready + * \param vIsReadOnly - SdCard is ReadOnly + */ +void GuiController::onSDCardStateChange(bool vIsReady, bool vIsReadOnly) +{ + // coco begin validated: This needs user interaction to plug-out the SD Card + // has been tested manually + emit didSDCardStateChange(vIsReady, vIsReadOnly); +} +// coco end + +/*! * \brief GuiController::onExport * \details The slot which will be called to notify the export is done * by emitting the didExport signal. @@ -287,7 +309,7 @@ * Raises an HD communication timeout alarm if communication with HD is lost. * \param seq - Sequence that failed to transmit */ -void GuiController::didFailedTransmit(Sequence seq) +void GuiController::onFailedTransmit(Sequence seq) { Q_UNUSED(seq); AlarmStatusData data; Index: sources/gui/guicontroller.h =================================================================== diff -u -r93b6ad6b18c505fedab37d95dc87be61db48641c -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/gui/guicontroller.h (.../guicontroller.h) (revision 93b6ad6b18c505fedab37d95dc87be61db48641c) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -69,8 +69,10 @@ void onUSBDriveMount (); // OS => UI void onUSBDriveRemove(); // OS => UI + void onSDCardStateChange(bool vIsReady, bool vIsReadOnly); // OS => UI + void onExport (); // OS => UI - void didFailedTransmit(Sequence seq); + void onFailedTransmit(Sequence seq); signals: void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG @@ -80,6 +82,8 @@ void didUSBDriveUmount(); void didUSBDriveRemove(); + void didSDCardStateChange(bool vIsReady, bool vIsReadOnly); + void didExportLog(); void didExport (); Index: sources/gui/guiview.cpp =================================================================== diff -u -r618891879f5cdc68e37ee68eea005afb76dd4e5b -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/gui/guiview.cpp (.../guiview.cpp) (revision 618891879f5cdc68e37ee68eea005afb76dd4e5b) +++ sources/gui/guiview.cpp (.../guiview.cpp) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -57,6 +57,10 @@ connect(&_GuiController, SIGNAL(didUSBDriveRemove()), this , SLOT( doUSBDriveRemove())); + // SD Card + connect(&_GuiController, SIGNAL(didSDCardStateChange(bool,bool)), + this , SLOT( doSDCardStateChange(bool,bool))); + connect(&_GuiController, SIGNAL(didExport()), this , SLOT( doExport())); @@ -116,7 +120,7 @@ /*! * \brief GuiView::doUSBDriveMount - * \details emits didUSBDriveMount signal to notify other classes (GuiController) + * \details emits didUSBDriveMount signal to notify other classes (UI) * , the USB drive has been mounted. */ void GuiView::doUSBDriveMount () @@ -142,7 +146,7 @@ /*! * \brief GuiView::doUSBDriveRemove - * \details emits didUSBDriveRemove signal to notify other classes (GuiController) + * \details emits didUSBDriveRemove signal to notify other classes (UI) * , the USB drive has been removed. */ void GuiView::doUSBDriveRemove() @@ -154,6 +158,22 @@ // coco end /*! + * \brief GuiView::doSDCardStateChange + * \details emits didSDCardStateChange signal to notify other classes (UI) + * , the SD Card Stte has been changed. + * \param vIsReady - SdCard is Ready + * \param vIsReadOnly - SdCard is ReadOnly + */ +void GuiView::doSDCardStateChange(bool vIsReady, bool vIsReadOnly) +{ + // coco begin validated: This needs user interaction to plug-in USB device + // has been tested manually + sdIsReady (vIsReady ); + sdIsReadOnly(vIsReadOnly); +} +// coco end + +/*! * \brief GuiView::onExport * \details The slot which will be called to notify the export is done * by emitting the didExport signal. Index: sources/gui/guiview.h =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/gui/guiview.h (.../guiview.h) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ sources/gui/guiview.h (.../guiview.h) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -1,23 +1,24 @@ /*! - * + * * 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 guiview.h * \author (last) Peter Lucia * \date (last) 29-Jun-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 - * + * */ #pragma once // Qt #include // Project +#include "main.h" #include "guiglobals.h" @@ -31,6 +32,12 @@ { Q_OBJECT + // coco begin validated: This needs user interaction to plug-in/out SD Card + // has been tested manually + PROPERTY(bool, sdIsReady , false); + PROPERTY(bool, sdIsReadOnly, false); + // coco end + public: explicit GuiView(QObject *parent = nullptr); @@ -49,6 +56,9 @@ void doActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG void doActionTransmit(GuiActionType vAction, const QVariant &vData); // UI => HD/DG void doUSBDriveUmount(); + + void doSDCardStateChange(bool vIsReady, bool vIsReadOnly); + void doExportLog (); signals: Index: sources/gui/qml/main.qml =================================================================== diff -u -ree50b509107a743f6133a33371e18646ff9c10b2 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/gui/qml/main.qml (.../main.qml) (revision ee50b509107a743f6133a33371e18646ff9c10b2) +++ sources/gui/qml/main.qml (.../main.qml) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -227,6 +227,24 @@ font.pixelSize: 14 } + Rectangle { // TEST : SD-Card not present should be handled with better indication(s). + color : ! _GuiView.sdIsReady ? "red" : _GuiView.sdIsReadOnly ? "gray" : "green" + anchors { + right : parent.right + bottom : parent.bottom + bottomMargin: 35 + rightMargin: 10 + } + width : 25 + height: 25 + radius: width + Image { id: _imageMicrosd + anchors.fill: parent + source: "qrc:/images/iMicroSD" + } + visible: true // ! _GuiView.sdIsReady || _GuiView.sdIsReadOnly + } + function getRootTextFromAlarmLevel(level) { let root_color = ""; let text_color = ""; Index: sources/gui/qml/pages/ManagerHome.qml =================================================================== diff -u -r06d10ee1174f0947a01087554f3da3109b47aef6 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision 06d10ee1174f0947a01087554f3da3109b47aef6) +++ sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -30,8 +30,8 @@ */ ScreenItem { id: _root - function col(idx, gap = 10) { - return idx * 150 + gap + function col(idx, gap = 0) { + return idx * 155 + gap } function row(idx, gap = 10) { @@ -167,7 +167,7 @@ } DebugDataColumn { id: _HDDialysateInletFlowColumn - x: col(1) + x: col(1.2) y: row(3) title: qsTr(" Dlyst I ") model: [ @@ -183,7 +183,7 @@ } DebugDataColumn { id: _HDDialysateOutletFlowColumn - x: col(2) + x: col(2.4) y: row(3) title: qsTr(" Dlyst O ") model: [ @@ -199,7 +199,7 @@ } DebugDataColumn { id: _HDPressureOcclusionColumn - x: col(3) + x: col(3.6) y: row(3) title: qsTr(" Prsr Oc ") model: [ Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -r06d10ee1174f0947a01087554f3da3109b47aef6 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 06d10ee1174f0947a01087554f3da3109b47aef6) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -28,21 +28,6 @@ * which is the default screen in the "Settings" stack */ ScreenItem { id: _root - - Text { id : _titleText - visible: true - anchors { - top : parent.top - left : parent.horizontalCenter - topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 - horizontalCenter: parent.horizontalCenter - } - text: qsTr("~ HD ~") - horizontalAlignment: Text.horizontalCenter - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - USBButton { id: _usbButton anchors { top : parent.top Index: sources/storage/DriveWatcher.cpp =================================================================== diff -u -r618891879f5cdc68e37ee68eea005afb76dd4e5b -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/storage/DriveWatcher.cpp (.../DriveWatcher.cpp) (revision 618891879f5cdc68e37ee68eea005afb76dd4e5b) +++ sources/storage/DriveWatcher.cpp (.../DriveWatcher.cpp) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -26,6 +26,7 @@ #include "storageglobals.h" #include "logger.h" #include "applicationcontroller.h" +#include "filehandler.h" // namespace using namespace Storage; @@ -162,11 +163,14 @@ * \return - The drive mounted and ready * \note if device ejected manually system assumes it's still ready. */ -bool DriveWatcher::driveSpaceCheck(const QString &vPath, qint64 &vTotalBytes, qint64 &vAvailableBytes) +bool DriveWatcher::driveSpaceCheck(const QString &vPath, qint64 &vTotalBytes, qint64 &vAvailableBytes, bool *vIsReadOnly) { // coco begin validated: Needed User Interaction to make the device not ready so tested manually + bool isReadOnly; + if (! FileHandler::isMounted(vPath, &isReadOnly)) return false; + if (vIsReadOnly) *vIsReadOnly = isReadOnly; QStorageInfo storage(vPath); - bool isReady = storage.isReady(); + bool isReady = storage.isReady(); if (isReady) { vTotalBytes = storage.bytesTotal(); vAvailableBytes = storage.bytesAvailable(); @@ -219,25 +223,28 @@ { // coco begin validated: Needed User Interaction so tested manually - quint8 mPercent ; + // Old Info ; // Current info + static bool mOIsReady ; bool mCIsReady ; + static bool mOIsReadOnly; bool mCIsReadOnly ; + static qint64 mOTotal ; qint64 mCTotal ; + static qint64 mOAvailable ; qint64 mCAvailable ; - // Old Info ; // Current info - static bool mOIsReady ; bool mCIsReady ; - static qint64 mOTotal ; qint64 mCTotal ; - static qint64 mOAvailable; qint64 mCAvailable; + mCIsReady = driveSpaceCheck(Storage::SDCard_Base_Path_Name, mCTotal, mCAvailable, &mCIsReadOnly); - mCIsReady = driveSpaceCheck(Storage::SDCard_Base_Path_Name, mCTotal, mCAvailable); + if (mOIsReadOnly != mCIsReadOnly || mOIsReady != mCIsReady) { + mOIsReadOnly = mCIsReadOnly; + emit didSDCardStateChange(mCIsReady, mCIsReadOnly); + } + if (! mCIsReady ) { - emit didSDCardSpaceRemove(); + mOIsReady = mCIsReady; return; } - mPercent = mCTotal ? ((100 * mCAvailable) / mCTotal) : 0; - - if (mOIsReady == mCIsReady && - mOTotal == mCTotal && + quint8 mPercent = mCTotal ? ((100 * mCAvailable) / mCTotal) : 0; + if (mOTotal == mCTotal && mOAvailable == mCAvailable && - mPercent >= _minRequiredAvailableSpacePercent ) return; + mPercent >= _minRequiredAvailableSpacePercent ) return; mOIsReady = mCIsReady ; mOTotal = mCTotal ; Index: sources/storage/DriveWatcher.h =================================================================== diff -u -r618891879f5cdc68e37ee68eea005afb76dd4e5b -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/storage/DriveWatcher.h (.../DriveWatcher.h) (revision 618891879f5cdc68e37ee68eea005afb76dd4e5b) +++ sources/storage/DriveWatcher.h (.../DriveWatcher.h) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -73,7 +73,7 @@ bool usbSeek(QString &vDevice); - bool driveSpaceCheck(const QString &vPath, qint64 &vTotalBytes, qint64 &vAvailableBytes); + bool driveSpaceCheck(const QString &vPath, qint64 &vTotalBytes, qint64 &vAvailableBytes, bool *vIsReadOnly = nullptr); signals: /*! @@ -110,10 +110,10 @@ void didSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); /*! - * \brief didSDCardSpaceRemove - * \details If sdcard removed or is not present this signal will emit. + * \brief didSDCardStateChange + * \details If sdcard state changes like removed or is not present this signal will emit. */ - void didSDCardSpaceRemove(); + void didSDCardStateChange(bool vIsReady, bool vIsReadOnly); private slots: // ----- usb Index: sources/storage/filehandler.cpp =================================================================== diff -u -rda52c90a17adea2160ac93042e0632a4cda46b1a -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/storage/filehandler.cpp (.../filehandler.cpp) (revision da52c90a17adea2160ac93042e0632a4cda46b1a) +++ sources/storage/filehandler.cpp (.../filehandler.cpp) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -21,6 +21,7 @@ #include #include #include +#include // Project #include "logger.h" @@ -38,9 +39,21 @@ */ void FileHandler::errOut(const QString &vMessage) { - QString mCritical = vMessage; - QTextStream err(stderr); - err << mCritical << endl; + static uint count; + static QString mCritical; + // coco begin validated : This has been manually test. Needs file system access to produce errors for hundred times. + if (mCritical != vMessage || !(count % 1000)) { + // coco end + count = 0; + mCritical = vMessage; + QTextStream err(stderr); + err << "FS" << " " + << QDate::currentDate().toString("yyyy_MM_dd") << " " + << QTime::currentTime().toString("HH:mm:ss" ) << " " + << mCritical + << endl; + } + ++count; } bool FileHandler::write(const QString &vFileName, const QString &vContent, bool vAppend) @@ -52,8 +65,8 @@ // coco begin validated : This has been manually test. Needs file system access to make file the way it can't be opened for writing. if (! file.open(openMode)) { QString msg = QString("Can't open file for write (%1).Possible corrupted file system").arg(vFileName); + // here can't use LOG_XXXX because if the folder can't be created then the log can't be written. errOut (msg); - LOG_DEBUG(msg); return false; } // coco end @@ -75,8 +88,8 @@ QFile file(vFileName); if (! file.open(QFile::Text | QFile::ReadOnly)) { QString msg = QString("Can't open file for read (%1).Possible corrupted file system").arg(vFileName); + // here can't use LOG_XXXX because if the folder can't be created then the log can't be written. errOut (msg); - LOG_DEBUG(msg); return false; } QTextStream in(&file); @@ -130,15 +143,15 @@ if (fileTime.date() <= vDateOlderThan) { if (QFile::remove(fileName)) { ++countRemoved; - LOG_DEBUG(QString("%1 File(s) %2 removed").arg(countRemoved).arg(fileName)); + errOut(QString("%1 File(s) %2 removed").arg(countRemoved).arg(fileName)); } else { - LOG_DEBUG(QString("Can't delete file : ") + fileName); + errOut(QString("Can't delete file : ") + fileName); } } } else { - LOG_DEBUG(QString("Can't get last modified date of file : ") + fileName); + errOut(QString("Can't get last modified date of file : ") + fileName); } // coco end } @@ -159,9 +172,38 @@ if ( ! dir.mkpath(vFolder) ) { QString msg = "Can't create folder " + vFolder; // here can't use LOG_XXXX because if the folder can't be created then the log can't be written. - qDebug() << msg; + errOut(msg); return false; } } return true; } + +/*! + * \brief FileHandler::isMounted + * \param vPath - the rootPath of the device mount point + * \return true - if the given vPath is not empty and is in list of mounted devices + * if so it also has to be ready and valid. + */ +bool FileHandler::isMounted(const QString &vPath, bool *vIsReadOnly) +{ + // coco begin validated: Needed User Interaction to make the device not ready so tested manually + bool mounted = false; + // removing the extra '/' from the vPath if there is to be able to compare to the root path of the storage + QString path = vPath.trimmed(); + if (path.isEmpty()) return false; + int lastIndex = path.size() - 1; + if (path.at(lastIndex) == "/") path.remove(lastIndex, 1); + // check to see if the path in the list of mounted rootPaths + foreach (const QStorageInfo &storage, QStorageInfo::mountedVolumes()) { + if (storage.isValid() && storage.isReady()) { + if ( storage.rootPath() == path ) { + if (vIsReadOnly) *vIsReadOnly = storage.isReadOnly(); + mounted = true; + break; + } + } + } + return mounted; +} +// coco end Index: sources/storage/filehandler.h =================================================================== diff -u -rd2035a8728794afeefaa244bf8d1597926d945f5 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/storage/filehandler.h (.../filehandler.h) (revision d2035a8728794afeefaa244bf8d1597926d945f5) +++ sources/storage/filehandler.h (.../filehandler.h) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -1,16 +1,16 @@ /*! - * + * * 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 filehandler.h * \author (last) Behrouz NematiPour * \date (last) 02-Apr-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 - * + * */ #pragma once @@ -38,6 +38,7 @@ static int copyFolder (const QString &vSource, const QString &vDestination); static int removeFiles(const QStringList &vFolders, const QStringList &vNameFilter, const QDate &vDateOlderThan); static bool makeFolder (const QString &vFolder); + static bool isMounted (const QString &vPath, bool *vIsReadOnly = nullptr); }; } Index: sources/view/valarmstatus.cpp =================================================================== diff -u -r7c2a96774285bb618946f125763bf7bea7acadd8 -r4df19fe88c454bd54abcdaf983be59464c5ef5bc --- sources/view/valarmstatus.cpp (.../valarmstatus.cpp) (revision 7c2a96774285bb618946f125763bf7bea7acadd8) +++ sources/view/valarmstatus.cpp (.../valarmstatus.cpp) (revision 4df19fe88c454bd54abcdaf983be59464c5ef5bc) @@ -38,7 +38,6 @@ } if (acknowledgedAlarms.contains(alarmID)) { - qDebug() << "Alarm ID " << alarmID << " has been acknowledged and is visible. "; LOG_EVENT(tr("Alarm ID %0 has been acknowledged and is visible. ").arg(alarmID)); return; }