2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbwxFreeMemoryAlert.h"
5 #include "bbwxPackage.h"
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,FreeMemoryAlert)
12 BBTK_BLACK_BOX_IMPLEMENTATION(FreeMemoryAlert,bbtk::AtomicBlackBox);
14 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
16 void FreeMemoryAlert::Process()
19 // THE MAIN PROCESSING METHOD BODY
20 // Here we simply set the input 'In' value to the output 'Out'
21 // And print out the output value
22 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
23 // void bbSet{Input|Output}NAME(const TYPE&)
24 // const TYPE& bbGet{Input|Output}NAME() const
26 // * NAME is the name of the input/output
27 // (the one provided in the attribute 'name' of the tag 'input')
28 // * TYPE is the C++ type of the input/output
29 // (the one provided in the attribute 'type' of the tag 'input')
31 double memfreeGB = (double) (wxGetFreeMemory().ToLong()/1000000000.0);
32 if ( memfreeGB < bbGetInputFreeMemoryLimit() )
34 wxMessageBox(wxString::Format( "This application needs minimum %4.1f Gb to be executed correctly. \nTry to close somes applications you don't need. \n\n Actual free memory = %4.1f Gb\n",bbGetInputFreeMemoryLimit(),
37 wxOK | wxICON_INFORMATION,
45 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
47 void FreeMemoryAlert::bbUserSetDefaultValues()
50 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
51 // Here we initialize the input 'In' to 0
52 bbSetInputFreeMemoryLimit(1);
56 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
58 void FreeMemoryAlert::bbUserInitializeProcessing()
61 // THE INITIALIZATION METHOD BODY :
63 // but this is where you should allocate the internal/output pointers
69 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
71 void FreeMemoryAlert::bbUserFinalizeProcessing()
74 // THE FINALIZATION METHOD BODY :
76 // but this is where you should desallocate the internal/output pointers