There is still a bug in the SetValue() method of the SMESHGUI_SpinBox (value is not set).
* Maximal size of memory to be used by the algorithm (in Megabytes).
* Negative value means not to use this option
*/
- void SetMaximumMemory(in long MB) raises (SALOME::SALOME_Exception);
- long GetMaximumMemory();
+ void SetMaximumMemory(in double MB) raises (SALOME::SALOME_Exception);
+ double GetMaximumMemory();
/*!
* Initial size of memory to be used by the algorithm (in Megabytes) in
* automatic memory adjustment mode. Default is zero.
* Negative value means not to use this option
*/
- void SetInitialMemory(in long MB) raises (SALOME::SALOME_Exception);
- long GetInitialMemory();
+ void SetInitialMemory(in double MB) raises (SALOME::SALOME_Exception);
+ double GetInitialMemory();
/*!
* Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
*/
//function : SetMaximumMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis::SetMaximumMemory(int MB)
+void GHS3DPlugin_Hypothesis::SetMaximumMemory(double MB)
{
if ( myMaximumMemory != MB ) {
myMaximumMemory = MB;
// * automatic memory adjustment mode. Default is zero
//=======================================================================
-int GHS3DPlugin_Hypothesis::GetMaximumMemory() const
+double GHS3DPlugin_Hypothesis::GetMaximumMemory() const
{
return myMaximumMemory;
}
//function : SetInitialMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis::SetInitialMemory(int MB)
+void GHS3DPlugin_Hypothesis::SetInitialMemory(double MB)
{
if ( myInitialMemory != MB ) {
myInitialMemory = MB;
//function : GetInitialMemory
//=======================================================================
-int GHS3DPlugin_Hypothesis::GetInitialMemory() const
+double GHS3DPlugin_Hypothesis::GetInitialMemory() const
{
return myInitialMemory;
}
#include <windows.h>
#endif
-int GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
+double GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
{
#ifndef WIN32
struct sysinfo si;
int err = sysinfo( &si );
if ( err == 0 ) {
int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
- return (int) ( 0.7 * ramMB );
+ return ( 0.7 * ramMB );
}
#else
// See http://msdn.microsoft.com/en-us/library/aa366589.aspx
statex.ullTotalPhys / 1024 / 1024 +
statex.ullTotalPageFile / 1024 / 1024 +
statex.ullTotalVirtual / 1024 / 1024;
- return (int) ( 0.7 * totMB );
+ return ( 0.7 * totMB );
}
#endif
return 1024;
//function : DefaultInitialMemory
//=======================================================================
-int GHS3DPlugin_Hypothesis::DefaultInitialMemory()
+double GHS3DPlugin_Hypothesis::DefaultInitialMemory()
{
return DefaultMaximumMemory();
}
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> i);
+ isOK = (load >> d);
if (isOK)
- myMaximumMemory = i;
+ myMaximumMemory = d;
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> i);
+ isOK = (load >> d);
if (isOK)
- myInitialMemory = i;
+ myInitialMemory = d;
else
load.clear(ios::badbit | load.rdstate());
// Default memory is defined at ghs3d installation but it may be not enough,
// so allow to use about all available memory
if ( m ) {
- int aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
+ double aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
cmd += " -m ";
if ( aMaximumMemory < 0 )
cmd += DefaultMaximumMemory();
cmd += aMaximumMemory;
}
if ( M && !useBndRecovery ) {
- int aInitialMemory = hyp ? hyp->myInitialMemory : -1;
+ double aInitialMemory = hyp ? hyp->myInitialMemory : -1;
cmd += " -M ";
if ( aInitialMemory > 0 )
cmd += aInitialMemory;
/*!
* Maximal size of memory to be used by the algorithm (in Megabytes)
*/
- void SetMaximumMemory(int MB);
- int GetMaximumMemory() const;
+ void SetMaximumMemory(double MB);
+ double GetMaximumMemory() const;
/*!
* Initial size of memory to be used by the algorithm (in Megabytes) in
* automatic memory adjustment mode. Default is zero
*/
- void SetInitialMemory(int MB);
- int GetInitialMemory() const;
+ void SetInitialMemory(double MB);
+ double GetInitialMemory() const;
/*!
* Optimization level: 0-none, 1-light, 2-medium, 3-standard+, 4-strong. Default is medium
*/
static bool DefaultMeshHoles();
static bool DefaultToMakeGroupsOfDomains();
- static int DefaultMaximumMemory();
- static int DefaultInitialMemory();
+ static double DefaultMaximumMemory();
+ static double DefaultInitialMemory();
static short DefaultOptimizationLevel();
static std::string DefaultWorkingDirectory();
static bool DefaultKeepFiles();
bool myToMeshHoles;
bool myToMakeGroupsOfDomains;
- int myMaximumMemory;
- int myInitialMemory;
+ double myMaximumMemory;
+ double myInitialMemory;
short myOptimizationLevel;
bool myKeepFiles;
std::string myWorkingDirectory;
//function : SetMaximumMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Long MB)
+void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Double MB)
throw ( SALOME::SALOME_Exception )
{
if ( MB == 0 )
//function : GetMaximumMemory
//=======================================================================
-CORBA::Long GHS3DPlugin_Hypothesis_i::GetMaximumMemory()
+CORBA::Double GHS3DPlugin_Hypothesis_i::GetMaximumMemory()
{
ASSERT(myBaseImpl);
return this->GetImpl()->GetMaximumMemory();
//function : SetInitialMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Long MB)
+void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Double MB)
throw ( SALOME::SALOME_Exception )
{
if ( MB == 0 )
//function : GetInitialMemory
//=======================================================================
-CORBA::Long GHS3DPlugin_Hypothesis_i::GetInitialMemory()
+CORBA::Double GHS3DPlugin_Hypothesis_i::GetInitialMemory()
{
ASSERT(myBaseImpl);
return this->GetImpl()->GetInitialMemory();
/*!
* Maximal size of memory to be used by the algorithm (in Megabytes)
*/
- void SetMaximumMemory(CORBA::Long MB) throw ( SALOME::SALOME_Exception );
- CORBA::Long GetMaximumMemory();
+ void SetMaximumMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
+ CORBA::Double GetMaximumMemory();
/*!
* Initial size of memory to be used by the algorithm (in Megabytes) in
* automatic memory adjustment mode. Default is zero
*/
- void SetInitialMemory(CORBA::Long MB) throw ( SALOME::SALOME_Exception );
- CORBA::Long GetInitialMemory();
+ void SetInitialMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
+ CORBA::Double GetInitialMemory();
/*!
* Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
*/
</property>
</widget>
</item>
- <item row="3" column="2" colspan="2">
- <widget class="QSpinBox" name="maxMemorySpin">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
<item row="3" column="0">
<widget class="QCheckBox" name="maxMemoryCheck">
<property name="text">
</property>
</widget>
</item>
+ <item row="0" column="4">
+ <widget class="QLabel" name="initialMemoryLabel">
+ <property name="text">
+ <string>MB</string>
+ </property>
+ </widget>
+ </item>
<item row="0" column="2" colspan="2">
- <widget class="QSpinBox" name="initialMemorySpin">
+ <widget class="SMESHGUI_SpinBox" name="initialMemorySpin">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
</property>
</widget>
</item>
- <item row="0" column="4">
- <widget class="QLabel" name="initialMemoryLabel">
- <property name="text">
- <string>MB</string>
+ <item row="3" column="2" colspan="2">
+ <widget class="SMESHGUI_SpinBox" name="maxMemorySpin">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
</widget>
</item>
myAdvWidget->maxMemoryCheck->setText(tr( "MAX_MEMORY_SIZE" ));
myAdvWidget->initialMemoryCheck->setText(tr( "INIT_MEMORY_SIZE" ));
- myAdvWidget->maxMemorySpin ->setMinimum( 1 );
- myAdvWidget->maxMemorySpin ->setMaximum( maxAvailableMemory() );
- myAdvWidget->maxMemorySpin ->setSingleStep( 10 );
-
- myAdvWidget->initialMemorySpin->setMinimum( 1 );
- myAdvWidget->initialMemorySpin->setMaximum( maxAvailableMemory() );
- myAdvWidget->initialMemorySpin->setSingleStep( 10 );
+ myAdvWidget->maxMemorySpin->RangeStepAndValidator(20.0, 1e6, 10.0);
+ myAdvWidget->maxMemorySpin->setValue( 128.0 );
+
+ myAdvWidget->initialMemorySpin->RangeStepAndValidator(0.0, 1e6, 10.0);
+ myAdvWidget->initialMemorySpin->setValue( 100.0 );
myAdvWidget->initialMemoryLabel ->setText (tr( "MEGABYTE" ));
myAdvWidget->maxMemoryLabel ->setText (tr( "MEGABYTE" ));
{
bool myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint,
myLogInStandardOutput, myRemoveLogOnSuccess;
- int myMaximumMemory,myInitialMemory,myOptimizationLevel;
+ double myMaximumMemory,myInitialMemory;
+ int myOptimizationLevel;
QString myName,myWorkingDir,myTextOption;
double myGradation;
short myVerboseLevel;