Index: sources/storage/Logger.h =================================================================== diff -u -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 -rabd0e958420f25e5b8dd8ce6e21131f8561b99e0 --- sources/storage/Logger.h (.../Logger.h) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) +++ sources/storage/Logger.h (.../Logger.h) (revision abd0e958420f25e5b8dd8ce6e21131f8561b99e0) @@ -43,6 +43,8 @@ // forward declarations class tst_logging; +using namespace Gui; + namespace Storage { /*! @@ -101,7 +103,29 @@ const char *_headerA = "TimeStamp,ID,SubSys,Name,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40"; const char *_headerD = "TimeStamp,Description"; QDir _dir; - QString _logFileNamePrefix; + + // The HSSerial is going to be the HD Serial always, + // but while booting the logger is initialized first before the HD sends its serial number. + // therefore during the bootup and POST that we don't have the serial, will use BootPOST. + QString _logFileNameHDSN = "BootPOST" ; + + // The Mode is the device main states comming from HD_OpMode + // this is not exactly the HD_OpModes and will be interpreted in desired cycles. + // At the moment we decided to have Standby, Treatment, Disinfection, and I am adding Initial as well. + // Initially + // Treatment + // Disinfect + // DisinfectHeat // later: the UI message needs to get updated and not using SubMode + // DisinfectChem // later: the UI message needs to get updated and not using SubMode + // DisinfectChemFlsh // later: the UI message needs to get updated and not using SubMode + // DisinfectFlsh // later: the UI message needs to get updated and not using SubMode + // "Disinfect" + // "Treatment" + const char *_logFileNameMode_init = "NotRunnig"; + QString _logFileNameMode = "" ; + QString _logFileNameDate = "" ; + QString _logFileNameTime = "" ; + QHash _logPathNames; const QHash _logBasePathNames { { LogType::eLogAppED, Storage::Log_Folder_Application}, @@ -134,12 +158,14 @@ { LogType::eLogTrtmt, Storage::Txr_Max_Allowable_Trtmt_Space_Percent }, }; - const char *_dateFormat = "yyyy_MM_dd" ; // date used in the file name - const char *_timeFormat = "HH:mm:ss.zzz"; // timestamp in the file + const char *_fileDateFormat = "yyyyMMdd" ; // date used in the file name + const char *_fileTimeFormat = "HHmmss" ; // timestamp in the file - const char *_dateSeparator = "_"; // used in filename - const char *_separator = ","; + const char *_timeFormat = "HH:mm:ss.zzz"; // timestamp in the file + const char *_fileSeparator = "_"; // used in filename + const char *_separator = ","; + bool _enableConsoleOut = false; QString _logFileName = ""; @@ -184,16 +210,18 @@ // ----- Export structure private : - bool exportList(const Gui::GuiStringIndexMap &vExportList, LogType vLogType); - bool exportLogs(const Gui::GuiStringIndexMap &vExportList); - bool exportErrs(const Gui::GuiStringIndexMap &vExportList); - bool exportTrts(const Gui::GuiStringIndexMap &vExportList); + bool exportList (const GuiStringIndexMap &vExportList, LogType vLogType); + bool exportLogs (const GuiStringIndexMap &vExportList); + bool exportErrs (const GuiStringIndexMap &vExportList); + bool exportTrts (const GuiStringIndexMap &vExportList); + public slots: // this slot is thread safe and can be called from outside by LOG_EXPORT. bool concurrentExportIsOk (); - bool concurrentExportLogs (const Gui::GuiStringIndexMap &vExportList); - bool concurrentExportErrs (const Gui::GuiStringIndexMap &vExportList); - bool concurrentExportTrts (const Gui::GuiStringIndexMap &vExportList); + bool concurrentExportLogs (const GuiStringIndexMap &vExportList); + bool concurrentExportErrs (const GuiStringIndexMap &vExportList); + bool concurrentExportTrts (const GuiStringIndexMap &vExportList); void onExportLogs (); + signals: void didExportLogs(); void didExportStat(quint32 vIndex, const QString &vFileName, quint8 vPercent); @@ -205,6 +233,7 @@ bool concurrentRemoveLogs(LogType vLogType = eLogFiles); void onRemoveLogs(); void onCryptSetupMount (bool vPass); + void onActionReceive (GuiActionType vAction, const QVariantList &vData); signals: /*!