#include "SalomeApp_DoubleSpinBox.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_Notebook.h"
#include <SUIT_Session.h>
#include <string>
+
/*!
\class SalomeApp_DoubleSpinBox
*/
{
if( SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( 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();
return IncorrectType;
}
}
- value = studyDS->GetReal( aName );
+ bool bOk;
+ value = aVariant.toDouble(&bOk);
return Found;
}
return IncorrectType;
#include "SalomeApp_IntSpinBox.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_Notebook.h"
#include <SUIT_Session.h>
{
if( SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( 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();
return IncorrectType;
}
}
- value = studyDS->GetInteger( aName );
+ bool bOk;
+ value = aVariant.toInt(&bOk);
return Found;
}
return IncorrectType;