Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r3a528c6f3fce8132de2791b55d3227e715d68898 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 3a528c6f3fce8132de2791b55d3227e715d68898) @@ -7,7 +7,7 @@ * * \file StorageGlobals.cpp * \author (last) Behrouz NematiPour - * \date (last) 11-Nov-2021 + * \date (last) 24-Feb-2022 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * @@ -40,7 +40,18 @@ const char *USB_File_System = "vfat"; // SD-CARD - const short Available_Space_Percent = 15; + const short Log_Min_Available_Total_Space_Percent = 15; // Min free : 15 // always has to be 15 percent free space available, less than this triggers the log cleanup. + const short Log_Max_Allowable_Event_Space_Percent = 25; + const short Log_Max_Allowable_Datum_Space_Percent = 25; + const short Log_Max_Allowable_AppED_Space_Percent = Log_Max_Allowable_Event_Space_Percent + Log_Max_Allowable_Datum_Space_Percent; // 50 + const short Log_Max_Allowable_Debug_Space_Percent = 15; + const short Log_Max_Allowable_Trtmt_Space_Percent = 10; + // // Max Usage : 75 = 25 + 25 + 15 + 10 + // // Max Used : 85 = 100 - 15 + // // Min Buffer : 10 = 85 - 75 + // IMPORTANT: we have to keep 10% buffer otherwise competition between filling and deleting logs will cause application to crash eventually. + short Log_Min_Available_Total_Space_IsLow(short vPercent) { return vPercent < Log_Min_Available_Total_Space_Percent; } + #ifdef BUILD_FOR_TARGET const char *SDCard_Base_Path_Name = "/media/sd-card/"; #else @@ -59,6 +70,21 @@ const char *Settings_Path_Name = "/home/denali/Projects/application/resources/settings/"; #endif + // CloudSync credentials +#ifdef BUILD_FOR_TARGET + const char *CloudSync_Base_Path_Name = "/home/root/.cloudSync/"; +#else + // on VM it is a temporary file which is not being tracked + const char *CloudSync_Base_Path_Name = "/home/denali/Desktop/cloudsync/"; +#endif + +#ifdef BUILD_FOR_TARGET + const char *CloudSync_Credentials_Folder_Name = "credentials/"; +#else + // on VM it is a temporary file which is not being tracked + const char *CloudSync_Credentials_Folder_Name = "credentials/"; +#endif + // Scripts #ifdef BUILD_FOR_TARGET const char *Scripts_Path_Name = "/home/root/scripts/"; @@ -67,10 +93,13 @@ const char *Scripts_Path_Name = "/home/denali/Projects/application/scripts/"; #endif - // Treatment + // Please notice that is the folder not the path // and it needs to be concatenated after SDCard_Base_Path_Name for each build configuration - const char *Treatment_Log_Folder = "treatment/"; + const char *Log_Folder_Event = "log/" ; // Event Log + const char *Log_Folder_Data = "log/" ; // Data Log + const char *Log_Folder_Service = "service/" ; // Service Log + const char *Log_Folder_Treatment = "treatment/"; // Treatment // FIXME : Not sure having global settings object is a good idea.