From: pkv Date: Mon, 23 Nov 2009 08:35:57 +0000 (+0000) Subject: using new Notebook X-Git-Tag: PHASE_17_Part1_V1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3f7179a2444834a67596f2a8697576371ae9f25c;p=modules%2Fgui.git using new Notebook --- diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx index c784b6a26..f63495e23 100644 --- a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx @@ -25,6 +25,7 @@ #include "SalomeApp_DoubleSpinBox.h" #include "SalomeApp_Application.h" #include "SalomeApp_Study.h" +#include "SalomeApp_Notebook.h" #include @@ -36,6 +37,7 @@ #include + /*! \class SalomeApp_DoubleSpinBox */ @@ -320,14 +322,19 @@ SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( cons { if( SalomeApp_Study* study = dynamic_cast( app->activeStudy() ) ) { - _PTR(Study) studyDS = study->studyDS(); - std::string aName = name.toStdString(); - if( studyDS->IsVariable( aName ) ) + // + SalomeApp_Notebook aNotebook( study ); + bool bisParameter=aNotebook.isParameter(name); + // + if (bisParameter) { - if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) + QVariant aVariant=aNotebook.get(name); + QVariant::Type aType=aVariant.type(); + + if(aType==QVariant::Double || aType==QVariant::Int || aType==QVariant::String) { - if( studyDS->IsString( aName ) ) + if(aType==QVariant::String) { PyConsole_Console* pyConsole = app->pythonConsole(); PyConsole_Interp* pyInterp = pyConsole->getInterp(); @@ -344,7 +351,8 @@ SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( cons return IncorrectType; } } - value = studyDS->GetReal( aName ); + bool bOk; + value = aVariant.toDouble(&bOk); return Found; } return IncorrectType; diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.cxx b/src/SalomeApp/SalomeApp_IntSpinBox.cxx index 27427d2e6..fbae1e297 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_IntSpinBox.cxx @@ -25,6 +25,7 @@ #include "SalomeApp_IntSpinBox.h" #include "SalomeApp_Application.h" #include "SalomeApp_Study.h" +#include "SalomeApp_Notebook.h" #include @@ -278,14 +279,19 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr { if( SalomeApp_Study* study = dynamic_cast( app->activeStudy() ) ) { - _PTR(Study) studyDS = study->studyDS(); - - std::string aName = name.toStdString(); - if( studyDS->IsVariable( aName ) ) + std::string aName = name.toStdString(); + // + SalomeApp_Notebook aNotebook( study ); + bool bisParameter=aNotebook.isParameter(name); + // + if(bisParameter) { - if( studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) + QVariant aVariant=aNotebook.get(name); + QVariant::Type aType=aVariant.type(); + + if(aType==QVariant::Int || aType==QVariant::String) { - if( studyDS->IsString( aName ) ) + if(aType==QVariant::String) { PyConsole_Console* pyConsole = app->pythonConsole(); PyConsole_Interp* pyInterp = pyConsole->getInterp(); @@ -302,7 +308,8 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr return IncorrectType; } } - value = studyDS->GetInteger( aName ); + bool bOk; + value = aVariant.toInt(&bOk); return Found; } return IncorrectType;