From: abn Date: Wed, 3 Aug 2016 15:19:03 +0000 (+0200) Subject: [MEDCalc] Parameter widget dynamically updating when scripting. X-Git-Tag: V8_1_0b1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3304fa52c5fddf724af1eafe419d9686454d3f98;p=modules%2Fmed.git [MEDCalc] Parameter widget dynamically updating when scripting. --- diff --git a/idl/MEDEventListener.idl b/idl/MEDEventListener.idl index 60c6b11e7..d53d6b1f3 100644 --- a/idl/MEDEventListener.idl +++ b/idl/MEDEventListener.idl @@ -35,6 +35,7 @@ module MEDCALC EVENT_ADD_DATASOURCE, EVENT_ADD_PRESENTATION, EVENT_REMOVE_PRESENTATION, + EVENT_MODIFY_PRESENTATION, EVENT_PLAY_TEST, EVENT_QUIT_SALOME, EVENT_ERROR, diff --git a/src/MEDCalc/gui/PresentationController.cxx b/src/MEDCalc/gui/PresentationController.cxx index 359ed79ce..44acb921e 100644 --- a/src/MEDCalc/gui/PresentationController.cxx +++ b/src/MEDCalc/gui/PresentationController.cxx @@ -749,6 +749,11 @@ PresentationController::processWorkspaceEvent(const MEDCALC::MedEvent* event) else if ( event->type == MEDCALC::EVENT_REMOVE_PRESENTATION ) { updateTreeViewForPresentationRemoval(event->presentationId); } + else if ( event->type == MEDCALC::EVENT_MODIFY_PRESENTATION ) { + // Update parameter widget if shown: + if(_currentWidgetHelper) + _currentWidgetHelper->udpateWidget(); + } } void diff --git a/src/MEDCalc/gui/WorkspaceController.cxx b/src/MEDCalc/gui/WorkspaceController.cxx index f135d38fc..dd59a2447 100644 --- a/src/MEDCalc/gui/WorkspaceController.cxx +++ b/src/MEDCalc/gui/WorkspaceController.cxx @@ -314,6 +314,9 @@ void WorkspaceController::processMedEvent(const MEDCALC::MedEvent* event) { else if ( event->type == MEDCALC::EVENT_REMOVE_PRESENTATION ) { emit workspaceSignal(event); // forward to PresentationController } + else if ( event->type == MEDCALC::EVENT_MODIFY_PRESENTATION ) { + emit workspaceSignal(event); // forward to PresentationController + } else if ( event->type == MEDCALC::EVENT_PLAY_TEST ) { emit workspaceSignal(event); // forward to TestController } @@ -323,7 +326,9 @@ void WorkspaceController::processMedEvent(const MEDCALC::MedEvent* event) { else if ( event->type == MEDCALC::EVENT_ERROR ) { std::string msg(event->msg); QMessageBox::warning(_salomeModule->getApp()->desktop(), "Error", QString::fromStdString(msg)); - } + } + else + STDLOG("WorkspaceController::processMedEvent(): Unhandled event!!!"); } /*! diff --git a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui index d1c47f0c2..c5557a3da 100644 --- a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui +++ b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui @@ -147,7 +147,14 @@ - + + + 1 + + + 30 + + diff --git a/src/MEDCalc/tui/medevents.py b/src/MEDCalc/tui/medevents.py index 42a3f55c1..2e17a3710 100644 --- a/src/MEDCalc/tui/medevents.py +++ b/src/MEDCalc/tui/medevents.py @@ -126,3 +126,6 @@ def notifyGui_termination(): def notifyGui_error(msg): __notifyGui(MEDCALC.EVENT_ERROR, msg=msg) + +def notifyGui_modifyPresentation(presId): + __notifyGui(MEDCALC.EVENT_MODIFY_PRESENTATION, presentationId=presId) diff --git a/src/MEDCalc/tui/medpresentation.py b/src/MEDCalc/tui/medpresentation.py index 40cad1ece..b85d3d442 100644 --- a/src/MEDCalc/tui/medpresentation.py +++ b/src/MEDCalc/tui/medpresentation.py @@ -19,7 +19,7 @@ import medcalc import MEDCALC, SALOME -from medcalc.medevents import notifyGui_addPresentation, notifyGui_removePresentation, notifyGui_error +from medcalc.medevents import notifyGui_addPresentation, notifyGui_removePresentation, notifyGui_error, notifyGui_modifyPresentation __manager = medcalc.medcorba.factory.getPresentationManager() @@ -156,6 +156,7 @@ GetVectorFieldParameters = lambda pres_id: __GetGENERICParameters("VectorField", def __UpdateGENERIC(tag, presentation_id, params): exec "__manager.update%s(presentation_id, params)" % tag + notifyGui_modifyPresentation(presentation_id) UpdateMeshView = lambda pres_id, params: __UpdateGENERIC("MeshView", pres_id, params) UpdateScalarMap = lambda pres_id, params: __UpdateGENERIC("ScalarMap", pres_id, params)