-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
* This function adds the specified MED file as a datasource in the
* dataspace. Technically speaking, the engine loads the
* meta-information concerning med data from the file, gives this
- * informations to the GUI, and the GUI creates a tree view of these
+ * information to the GUI, and the GUI creates a tree view of these
* data in the study object browser.
*/
// This function emits a signal that will be caught by workspace to delegate command (datasource creation) to python console.
QString medFilename = dialog.getMedFilepath();
bool autoLoad = dialog.isAutoLoaded();
- std::string ROOT_DIR(getenv("MED_ROOT_DIR"));
- std::string command(ROOT_DIR+"/bin/salome/med/image2med.py");
+ std::string ROOT_DIR(getenv("FIELDS_ROOT_DIR"));
+ std::string command(ROOT_DIR+"/bin/salome/fields/image2med.py");
command += " -i "+QS2S(imageFilename);
command += " -m "+QS2S(medFilename);
int error = system(command.c_str());
void DatasourceController::OnExpandField()
{
+ SALOMEDS::Study_var aStudy = KERNEL::getStudyServant();
+ // check if reference to study is valid
+ if (CORBA::is_nil(aStudy))
+ return;
+
+ // check if reference to use case builder is valid
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = aStudy->GetUseCaseBuilder();
+ if (CORBA::is_nil(useCaseBuilder))
+ return;
+
+
// Get the selected objects in the study (SObject)
SALOME_StudyEditor::SObjectList* listOfSObject = _studyEditor->getSelectedObjects();
- for (int i=0; i<listOfSObject->size(); i++) {
+ for (int i=0; i<(int)listOfSObject->size(); i++) {
SALOMEDS::SObject_var soFieldseries = listOfSObject->at(i);
std::string name(_studyEditor->getName(soFieldseries));
if (soFieldseries->_is_nil() || name == "MEDCalc")
_studyEditor->setName(soField,label.c_str());
_studyEditor->setParameterInt(soField, FIELD_ID, fieldHandler.id);
_studyEditor->setParameterBool(soField,IS_IN_WORKSPACE,false);
+ useCaseBuilder->AppendTo(soField->GetFather(), soField);
}
}
_salomeModule->updateObjBrowser(true);
else {
// In this case, we don't ask the user to specify an alias for
// each item, we just import the whole set of items.
- for (int i=0; i<listOfSObject->size(); i++) {
+ for (int i=0; i<(int)listOfSObject->size(); i++) {
SALOMEDS::SObject_var soField = listOfSObject->at(i);
if (soField->_is_nil())
continue;