Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r0536992850014cee0a949958ce56c0008615da41 -rc2ed4667b513c51c5ee31566c15d2cf5a042ed61 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 0536992850014cee0a949958ce56c0008615da41) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision c2ed4667b513c51c5ee31566c15d2cf5a042ed61) @@ -54,18 +54,25 @@ const char *USB_File_System = "vfat"; // SD-CARD - 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 Usage : 80 = 25 + 25 + 15 + 15 // // Max Used : 85 = 100 - 15 - // // Min Buffer : 10 = 85 - 75 + // // Min Buffer : 5 = 85 - 80 // IMPORTANT: we have to keep 10% buffer otherwise competition between filling and deleting logs will cause application to crash eventually. + 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_AppED_Space_Percent = 50; + const short Log_Max_Allowable_Debug_Space_Percent = 15; + const short Log_Max_Allowable_Cloud_Space_Percent = 15; short Log_Min_Available_Total_Space_IsLow(short vPercent) { return vPercent < Log_Min_Available_Total_Space_Percent; } + // Settings/Encrypted + // the settings are roughly using the 5MB round it to 8MB to be 25% of 32MB of total encrypted partition. + // therefore the Txr shall not use more than 75% to leave the 25 for settings. + // when reaches that percent will be deleted to get total usage of 50% + // 50% percent of 32MB is 16MB which is enough to keep 10K (estimated each txr are 4K rounded to 5K and doubled.) of ~1600 files. + const short Txr_Min_Available_Total_Space_Percent = 25; // min space needed for settings by the current definitions. + const short Txr_Max_Allowable_Trtmt_Space_Percent = 50; // the treatment files are moved to the encrypted partition. + short Txr_Min_Available_Total_Space_IsLow(short vPercent) { return vPercent < Txr_Min_Available_Total_Space_Percent; } + #ifdef BUILD_FOR_TARGET const char *SDCard_Base_Path_Name = "/media/sd-card/"; #else @@ -132,13 +139,18 @@ #endif } - // 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 *Log_Folder_Base = SDCard_Base_Path_Name; // Base Log Folder const char *Log_Folder_Application = "log/" ; // Event/Data Log const char *Log_Folder_Service = "service/" ; // Service Log - const char *Log_Folder_Treatment = "treatment/" ; // Treatment Log + const char *Log_Folder_CloudSync = "cloudsync/log/" ; // CloudSync Log + // Txr_Max_Allowable_Trtmt_Space_Percent notice that is the folder not the path + + const char *Txr_Folder_Base = Settings_Path_Name ; // Base Txr Folder + const char *Txr_Folder_Treatment = "treatment/" ; // Treatment Rep + // TODO : These need to be removed from here because they are only used in their specific classes. // Date and Time const char *Date_Time_Set_Sh = "date_time_set.sh";