* Maximal size of memory to be used by the algorithm (in Megabytes).
* Negative value means not to use this option
*/
- void SetMaximumMemory(in double MB) raises (SALOME::SALOME_Exception);
- double GetMaximumMemory();
+ void SetMaximumMemory(in long MB) raises (SALOME::SALOME_Exception);
+ long 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 double MB) raises (SALOME::SALOME_Exception);
- double GetInitialMemory();
+ void SetInitialMemory(in long MB) raises (SALOME::SALOME_Exception);
+ long GetInitialMemory();
/*!
* Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
*/
//function : SetMaximumMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis::SetMaximumMemory(double MB)
+void GHS3DPlugin_Hypothesis::SetMaximumMemory(long MB)
{
if ( myMaximumMemory != MB ) {
myMaximumMemory = MB;
// * automatic memory adjustment mode. Default is zero
//=======================================================================
-double GHS3DPlugin_Hypothesis::GetMaximumMemory() const
+long GHS3DPlugin_Hypothesis::GetMaximumMemory() const
{
return myMaximumMemory;
}
//function : SetInitialMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis::SetInitialMemory(double MB)
+void GHS3DPlugin_Hypothesis::SetInitialMemory(long MB)
{
if ( myInitialMemory != MB ) {
myInitialMemory = MB;
//function : GetInitialMemory
//=======================================================================
-double GHS3DPlugin_Hypothesis::GetInitialMemory() const
+long GHS3DPlugin_Hypothesis::GetInitialMemory() const
{
return myInitialMemory;
}
#include <windows.h>
#endif
-double GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
+long GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
{
#ifndef WIN32
struct sysinfo si;
- int err = sysinfo( &si );
+ long err = sysinfo( &si );
if ( err == 0 ) {
- int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
+ long ramMB = si.totalram * si.mem_unit / 1024 / 1024;
return ( 0.7 * ramMB );
}
#else
// See http://msdn.microsoft.com/en-us/library/aa366589.aspx
MEMORYSTATUSEX statex;
statex.dwLength = sizeof (statex);
- int err = GlobalMemoryStatusEx (&statex);
+ long err = GlobalMemoryStatusEx (&statex);
if (err != 0) {
- int totMB =
+ long totMB =
statex.ullTotalPhys / 1024 / 1024 +
statex.ullTotalPageFile / 1024 / 1024 +
statex.ullTotalVirtual / 1024 / 1024;
//function : DefaultInitialMemory
//=======================================================================
-double GHS3DPlugin_Hypothesis::DefaultInitialMemory()
+long GHS3DPlugin_Hypothesis::DefaultInitialMemory()
{
return DefaultMaximumMemory();
}
// Default memory is defined at MG-Tetra installation but it may be not enough,
// so allow to use about all available memory
if ( m ) {
- double aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
+ long aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
ostringstream tmpMaximumMemory;
cmd += " -m ";
if ( aMaximumMemory < 0 )
- tmpMaximumMemory << std::fixed << std::setprecision(0) << DefaultMaximumMemory();
+ tmpMaximumMemory << DefaultMaximumMemory();
else
- tmpMaximumMemory << std::fixed << std::setprecision(0) << aMaximumMemory;
+ tmpMaximumMemory << aMaximumMemory;
cmd += tmpMaximumMemory.str().c_str();
}
if ( M && !useBndRecovery ) {
- double aInitialMemory = hyp ? hyp->myInitialMemory : -1;
+ long aInitialMemory = hyp ? hyp->myInitialMemory : -1;
cmd += " -M ";
if ( aInitialMemory > 0 )
- cmd += aInitialMemory;
+ cmd += (int)aInitialMemory;
else
cmd += "100";
}
/*!
* Maximal size of memory to be used by the algorithm (in Megabytes)
*/
- void SetMaximumMemory(double MB);
- double GetMaximumMemory() const;
+ void SetMaximumMemory(long MB);
+ long GetMaximumMemory() const;
/*!
* Initial size of memory to be used by the algorithm (in Megabytes) in
* automatic memory adjustment mode. Default is zero
*/
- void SetInitialMemory(double MB);
- double GetInitialMemory() const;
+ void SetInitialMemory(long MB);
+ long GetInitialMemory() const;
/*!
* Optimization level: 0-none, 1-light, 2-medium, 3-standard+, 4-strong. Default is medium
*/
static bool DefaultMeshHoles();
static bool DefaultToMakeGroupsOfDomains();
- static double DefaultMaximumMemory();
- static double DefaultInitialMemory();
+ static long DefaultMaximumMemory();
+ static long DefaultInitialMemory();
static short DefaultOptimizationLevel();
static std::string DefaultWorkingDirectory();
static bool DefaultKeepFiles();
bool myToMeshHoles;
bool myToMakeGroupsOfDomains;
- double myMaximumMemory;
- double myInitialMemory;
+ long myMaximumMemory;
+ long myInitialMemory;
short myOptimizationLevel;
bool myKeepFiles;
std::string myWorkingDirectory;
//function : SetMaximumMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Double MB)
+void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Long MB)
throw ( SALOME::SALOME_Exception )
{
if ( MB == 0 )
//function : GetMaximumMemory
//=======================================================================
-CORBA::Double GHS3DPlugin_Hypothesis_i::GetMaximumMemory()
+CORBA::Long GHS3DPlugin_Hypothesis_i::GetMaximumMemory()
{
ASSERT(myBaseImpl);
return this->GetImpl()->GetMaximumMemory();
//function : SetInitialMemory
//=======================================================================
-void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Double MB)
+void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Long MB)
throw ( SALOME::SALOME_Exception )
{
if ( MB == 0 )
//function : GetInitialMemory
//=======================================================================
-CORBA::Double GHS3DPlugin_Hypothesis_i::GetInitialMemory()
+CORBA::Long 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::Double MB) throw ( SALOME::SALOME_Exception );
- CORBA::Double GetMaximumMemory();
+ void SetMaximumMemory(CORBA::Long MB) throw ( SALOME::SALOME_Exception );
+ CORBA::Long GetMaximumMemory();
/*!
* Initial size of memory to be used by the algorithm (in Megabytes) in
* automatic memory adjustment mode. Default is zero
*/
- void SetInitialMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
- CORBA::Double GetInitialMemory();
+ void SetInitialMemory(CORBA::Long MB) throw ( SALOME::SALOME_Exception );
+ CORBA::Long GetInitialMemory();
/*!
* Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
*/
<rect>
<x>0</x>
<y>0</y>
- <width>465</width>
+ <width>485</width>
<height>477</height>
</rect>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2">
- <widget class="SMESHGUI_SpinBox" name="initialMemorySpin">
+ <widget class="SalomeApp_IntSpinBox" name="initialMemorySpin">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="maximum">
+ <number>999999999</number>
+ </property>
</widget>
</item>
<item row="3" column="2" colspan="2">
- <widget class="SMESHGUI_SpinBox" name="maxMemorySpin">
+ <widget class="SalomeApp_IntSpinBox" name="maxMemorySpin">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="maximum">
+ <number>999999999</number>
+ </property>
</widget>
</item>
</layout>
<extends>QSpinBox</extends>
<header>SMESHGUI_SpinBox.h</header>
</customwidget>
+ <customwidget>
+ <class>SalomeApp_IntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>SalomeApp_IntSpinBox.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
#include <sys/sysinfo.h>
#endif
- int maxAvailableMemory()
+ long maxAvailableMemory()
{
#ifdef WIN32
// See http://msdn.microsoft.com/en-us/library/aa366589.aspx
MEMORYSTATUSEX statex;
statex.dwLength = sizeof (statex);
- int err = GlobalMemoryStatusEx (&statex);
+ long err = GlobalMemoryStatusEx (&statex);
if (err != 0) {
- int totMB =
+ long totMB =
statex.ullTotalPhys / 1024 / 1024 +
statex.ullTotalPageFile / 1024 / 1024 +
statex.ullTotalVirtual / 1024 / 1024;
- return (int) ( 0.7 * totMB );
+ return (long) ( 0.7 * totMB );
}
#else
struct sysinfo si;
- int err = sysinfo( &si );
+ long err = sysinfo( &si );
if ( err == 0 ) {
- int totMB =
+ long totMB =
si.totalram * si.mem_unit / 1024 / 1024 +
si.totalswap * si.mem_unit / 1024 / 1024 ;
- return (int) ( 0.7 * totMB );
+ return (long) ( 0.7 * totMB );
}
#endif
return 0;
myAdvWidget->maxMemoryCheck->setText(tr( "MAX_MEMORY_SIZE" ));
myAdvWidget->initialMemoryCheck->setText(tr( "INIT_MEMORY_SIZE" ));
- myAdvWidget->maxMemorySpin->RangeStepAndValidator(20.0, 1e6, 10.0);
- myAdvWidget->maxMemorySpin->setValue( 128.0 );
+ myAdvWidget->maxMemorySpin->stepBy(10);
+ myAdvWidget->maxMemorySpin->setValue( 128 );
- myAdvWidget->initialMemorySpin->RangeStepAndValidator(0.0, 1e6, 10.0);
- myAdvWidget->initialMemorySpin->setValue( 100.0 );
+ myAdvWidget->initialMemorySpin->stepBy(10);
+ myAdvWidget->initialMemorySpin->setValue( 100 );
myAdvWidget->initialMemoryLabel ->setText (tr( "MEGABYTE" ));
myAdvWidget->maxMemoryLabel ->setText (tr( "MEGABYTE" ));
myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains );
myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel );
myAdvWidget->maxMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
- myAdvWidget->maxMemorySpin ->setValue ( qMax( data.myMaximumMemory,
+ myAdvWidget->maxMemorySpin ->setValue ( qMax( (int)data.myMaximumMemory,
myAdvWidget->maxMemorySpin->minimum() ));
myAdvWidget->initialMemoryCheck ->setChecked ( data.myInitialMemory > 0 );
- myAdvWidget->initialMemorySpin ->setValue ( qMax( data.myInitialMemory,
+ myAdvWidget->initialMemorySpin ->setValue ( qMax( (int)data.myInitialMemory,
myAdvWidget->initialMemorySpin->minimum() ));
myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir );
myAdvWidget->keepWorkingFilesCheck ->setChecked ( data.myKeepFiles );
{
bool myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint,
myLogInStandardOutput, myRemoveLogOnSuccess;
- double myMaximumMemory,myInitialMemory;
+ long myMaximumMemory;
+ long myInitialMemory;
int myOptimizationLevel;
QString myName,myWorkingDir,myTextOption;
double myGradation;