new_case.set_name(str(fichier.split('/')[-1]))
salomeStudyId = datassimGuiHelper.getActiveStudyId()
salomeStudyItem = datassimStudyEditor.addInStudy(salomeStudyId, new_case)
- case_key = (salomeStudyId, salomeStudyItem.GetName())
+ case_key = (salomeStudyId, salomeStudyItem.GetID())
__cases__[case_key] = new_case
# Open file in Eficas
global __cases__
salomeStudyId = datassimGuiHelper.getActiveStudyId()
salomeStudyItem = datassimGuiHelper.getSelectedItem(salomeStudyId)
- case_key = (salomeStudyId, salomeStudyItem.GetName())
+ case_key = (salomeStudyId, salomeStudyItem.GetID())
try:
case = __cases__[case_key]
if case.get_filename() is not None and case.get_name() != "new_case":
new_case = DatassimCase()
salomeStudyId = datassimGuiHelper.getActiveStudyId()
salomeStudyItem = datassimStudyEditor.addInStudy(salomeStudyId, new_case)
- case_key = (salomeStudyId, salomeStudyItem.GetName())
+ case_key = (salomeStudyId, salomeStudyItem.GetID())
__cases__[case_key] = new_case
datassimGuiHelper.refreshObjectBrowser()
callbackId = [salomeStudyId, salomeStudyItem]
new_case = DatassimCase()
salomeStudyId = datassimGuiHelper.getActiveStudyId()
salomeStudyItem = datassimStudyEditor.addInStudy(salomeStudyId, new_case)
- case_key = (salomeStudyId, salomeStudyItem.GetName())
+ case_key = (salomeStudyId, salomeStudyItem.GetID())
__cases__[case_key] = new_case
# Connexion du nouveau cas
file_case_name = eficasWrapper.getFileCaseName()
if case_name != "" :
# Get case
- old_case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetName())
+ old_case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetID())
case =__cases__[old_case_key]
# Set new informations
- case.set_name(case_name)
case.set_filename(file_case_name)
+ case.set_name(case_name)
datassimStudyEditor.updateItem(targetSalomeStudyId, targetSalomeStudyItem, case)
# Case key changed !
- new_case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetName())
+ #new_case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetID())
# A ne pas inverser !!!
- __cases__.pop(old_case_key)
- __cases__[new_case_key] = case
+ #__cases__.pop(old_case_key)
+ #__cases__[new_case_key] = case
datassimGuiHelper.refreshObjectBrowser()
if ( targetSalomeStudyId is None ) or ( targetSalomeStudyItem is None ):
raise DevelException("the parameters targetSalomeStudyId and targetSalomeStudyItem should not be None")
- case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetName())
+ case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetID())
__cases__.pop(case_key)
datassimStudyEditor.removeItem(targetSalomeStudyId, targetSalomeStudyItem)
datassimGuiHelper.refreshObjectBrowser()
componentName = datassimModuleHelper.componentUserName())
itemName = datassimCase.get_name()
- itemValue = ""
+ itemValue = str(datassimCase.get_filename())
itemType = DATASSIM_ITEM_TYPES.DATASSIM_CASE
salomeStudyItem = studyEditor.createItem(
studyEditor = studyedit.getStudyEditor(salomeStudyId)
- itemName = datassimCase.get_name()
- itemValue = ""
+ if salomeStudyItem.GetName()[:-2] != datassimCase.get_name():
+ itemName = datassimCase.get_name()
+ itemValue = datassimCase.get_filename()
+ else:
+ itemName = salomeStudyItem.GetName()
+ itemValue = datassimCase.get_filename()
studyEditor.setItem(salomeStudyItem,
name = itemName,