From 11166f971e9b72d29c79409174515745b181142d Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Thu, 2 Mar 2017 21:05:20 +0100 Subject: [PATCH] FEM: result show command, make name fit in FEM name system --- src/Mod/Fem/App/CMakeLists.txt | 6 +++--- src/Mod/Fem/App/FemVTKTools.cpp | 2 +- src/Mod/Fem/CMakeLists.txt | 6 +++--- src/Mod/Fem/Gui/ViewProviderResult.cpp | 2 +- src/Mod/Fem/Gui/Workbench.cpp | 4 ++-- src/Mod/Fem/InitGui.py | 2 +- ...skPanelShowResult.ui => TaskPanelResultShow.ui} | 0 ..._CommandShowResult.py => _CommandResultShow.py} | 14 +++++++------- ...kPanelShowResult.py => _TaskPanelResultShow.py} | 6 +++--- .../Fem/PyGui/_ViewProviderFemResultMechanical.py | 4 ++-- 10 files changed, 23 insertions(+), 23 deletions(-) rename src/Mod/Fem/PyGui/{TaskPanelShowResult.ui => TaskPanelResultShow.ui} (100%) rename src/Mod/Fem/PyGui/{_CommandShowResult.py => _CommandResultShow.py} (88%) rename src/Mod/Fem/PyGui/{_TaskPanelShowResult.py => _TaskPanelResultShow.py} (99%) diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt index 9dcaa6412..ed836ff57 100644 --- a/src/Mod/Fem/App/CMakeLists.txt +++ b/src/Mod/Fem/App/CMakeLists.txt @@ -120,9 +120,9 @@ SET(FemGuiScripts_SRCS PyGui/_CommandMeshGroup.py PyGui/_CommandMeshRegion.py PyGui/_CommandPrintMeshInfo.py + PyGui/_CommandResultShow.py PyGui/_CommandResultsPurge.py PyGui/_CommandShellThickness.py - PyGui/_CommandShowResult.py PyGui/_CommandSolverCalculix.py PyGui/_CommandSolverControl.py PyGui/_CommandSolverRun.py @@ -135,7 +135,7 @@ SET(FemGuiScripts_SRCS PyGui/_TaskPanelFemShellThickness.py PyGui/_TaskPanelFemSolverCalculix.py PyGui/_TaskPanelFemMaterial.py - PyGui/_TaskPanelShowResult.py + PyGui/_TaskPanelResultShow.py PyGui/_ViewProviderFemBeamSection.py PyGui/_ViewProviderFemConstraintSelfWeight.py PyGui/_ViewProviderFemFluidSection.py @@ -156,7 +156,7 @@ SET(FemGuiScripts_SRCS PyGui/TaskPanelFemShellThickness.ui PyGui/TaskPanelFemSolverCalculix.ui PyGui/TaskPanelFemMaterial.ui - PyGui/TaskPanelShowResult.ui + PyGui/TaskPanelResultShow.ui ) SET(FemTests_SRCS diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 1e6d90db2..09090d9a2 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -919,7 +919,7 @@ void FemVTKTools::importMechanicalResult(vtkSmartPointer dataset, Ap //scalers["DisplacementLengths"] = ""; // not yet exported in exportMechanicalResult() std::map varids; - // id sequence must agree with definition in get_result_stats() of Fem/_TaskPanelShowResult.py + // id sequence must agree with definition in get_result_stats() of Fem/_TaskPanelResultShow.py varids["U1"] = 0; // U1, displacement x axis varids["U2"] = 1; varids["U3"] = 2; diff --git a/src/Mod/Fem/CMakeLists.txt b/src/Mod/Fem/CMakeLists.txt index 15da3107d..4b8f12db3 100755 --- a/src/Mod/Fem/CMakeLists.txt +++ b/src/Mod/Fem/CMakeLists.txt @@ -81,9 +81,9 @@ INSTALL( PyGui/_CommandMeshGroup.py PyGui/_CommandMeshRegion.py PyGui/_CommandPrintMeshInfo.py + PyGui/_CommandResultShow.py PyGui/_CommandResultsPurge.py PyGui/_CommandShellThickness.py - PyGui/_CommandShowResult.py PyGui/_CommandSolverCalculix.py PyGui/_CommandSolverControl.py PyGui/_CommandSolverRun.py @@ -96,7 +96,7 @@ INSTALL( PyGui/_TaskPanelFemShellThickness.py PyGui/_TaskPanelFemSolverCalculix.py PyGui/_TaskPanelFemMaterial.py - PyGui/_TaskPanelShowResult.py + PyGui/_TaskPanelResultShow.py PyGui/_ViewProviderFemBeamSection.py PyGui/_ViewProviderFemConstraintSelfWeight.py PyGui/_ViewProviderFemFluidSection.py @@ -117,7 +117,7 @@ INSTALL( PyGui/TaskPanelFemMeshRegion.ui PyGui/TaskPanelFemShellThickness.ui PyGui/TaskPanelFemSolverCalculix.ui - PyGui/TaskPanelShowResult.ui + PyGui/TaskPanelResultShow.ui DESTINATION Mod/Fem/PyGui ) diff --git a/src/Mod/Fem/Gui/ViewProviderResult.cpp b/src/Mod/Fem/Gui/ViewProviderResult.cpp index 9296363c8..d221282ab 100644 --- a/src/Mod/Fem/Gui/ViewProviderResult.cpp +++ b/src/Mod/Fem/Gui/ViewProviderResult.cpp @@ -48,7 +48,7 @@ ViewProviderResult::~ViewProviderResult() /* not needed since _ViewProviderFemResult.py is made bool ViewProviderResult::doubleClicked(void) { - Gui::Command::runCommand(Gui::Command::Gui, "Gui.runCommand('Fem_ShowResult')"); + Gui::Command::runCommand(Gui::Command::Gui, "Gui.runCommand('Fem_ResultShow')"); return true; } */ diff --git a/src/Mod/Fem/Gui/Workbench.cpp b/src/Mod/Fem/Gui/Workbench.cpp index 902275e48..be825d808 100755 --- a/src/Mod/Fem/Gui/Workbench.cpp +++ b/src/Mod/Fem/Gui/Workbench.cpp @@ -104,7 +104,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const << "FEM_SolverRun" << "Separator" << "FEM_ResultsPurge" - << "FEM_ShowResult"; + << "FEM_ResultShow"; #ifdef FC_USE_VTK Gui::ToolBarItem* post = new Gui::ToolBarItem(root); @@ -180,7 +180,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const << "FEM_SolverRun" << "Separator" << "FEM_ResultsPurge" - << "FEM_ShowResult"; + << "FEM_ResultShow"; return root; } diff --git a/src/Mod/Fem/InitGui.py b/src/Mod/Fem/InitGui.py index fe6726951..72c7808aa 100644 --- a/src/Mod/Fem/InitGui.py +++ b/src/Mod/Fem/InitGui.py @@ -45,7 +45,6 @@ class FemWorkbench (Workbench): import Fem import FemGui - import PyGui._CommandShowResult import PyGui._CommandClearMesh import PyGui._CommandPrintMeshInfo import PyGui._CommandFEMMesh2Mesh @@ -60,6 +59,7 @@ class FemWorkbench (Workbench): import PyGui._CommandMaterialSolid import PyGui._CommandMaterialFluid import PyGui._CommandMaterialMechanicalNonlinear + import PyGui._CommandResultShow import PyGui._CommandResultsPurge import PyGui._CommandSolverCalculix import PyGui._CommandSolverControl diff --git a/src/Mod/Fem/PyGui/TaskPanelShowResult.ui b/src/Mod/Fem/PyGui/TaskPanelResultShow.ui similarity index 100% rename from src/Mod/Fem/PyGui/TaskPanelShowResult.ui rename to src/Mod/Fem/PyGui/TaskPanelResultShow.ui diff --git a/src/Mod/Fem/PyGui/_CommandShowResult.py b/src/Mod/Fem/PyGui/_CommandResultShow.py similarity index 88% rename from src/Mod/Fem/PyGui/_CommandShowResult.py rename to src/Mod/Fem/PyGui/_CommandResultShow.py index bcac393a3..1de3c3ab5 100644 --- a/src/Mod/Fem/PyGui/_CommandShowResult.py +++ b/src/Mod/Fem/PyGui/_CommandResultShow.py @@ -24,7 +24,7 @@ __title__ = "Command Show Result" __author__ = "Juergen Riegel, Bernd Hahnebach" __url__ = "http://www.freecadweb.org" -## @package CommandShowResult +## @package CommandResultShow # \ingroup FEM # \brief FreeCAD Command show results for FEM workbench @@ -33,14 +33,14 @@ import FreeCADGui from PySide import QtCore -class _CommandShowResult(FemCommands): - "the FEM_show reslult command definition" +class _CommandResultShow(FemCommands): + "the FEM_ResultShow command definition" def __init__(self): - super(_CommandShowResult, self).__init__() + super(_CommandResultShow, self).__init__() self.resources = {'Pixmap': 'fem-result', - 'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_ShowResult", "Show result"), + 'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_ResultShow", "Show result"), 'Accel': "S, R", - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("FEM_ShowResult", "Shows and visualizes selected result data")} + 'ToolTip': QtCore.QT_TRANSLATE_NOOP("FEM_ResultShow", "Shows and visualizes selected result data")} self.is_active = 'with_selresult' def Activated(self): @@ -51,4 +51,4 @@ class _CommandShowResult(FemCommands): result_object.ViewObject.startEditing() -FreeCADGui.addCommand('FEM_ShowResult', _CommandShowResult()) +FreeCADGui.addCommand('FEM_ResultShow', _CommandResultShow()) diff --git a/src/Mod/Fem/PyGui/_TaskPanelShowResult.py b/src/Mod/Fem/PyGui/_TaskPanelResultShow.py similarity index 99% rename from src/Mod/Fem/PyGui/_TaskPanelShowResult.py rename to src/Mod/Fem/PyGui/_TaskPanelResultShow.py index 6c5d835d1..028902635 100644 --- a/src/Mod/Fem/PyGui/_TaskPanelShowResult.py +++ b/src/Mod/Fem/PyGui/_TaskPanelResultShow.py @@ -24,7 +24,7 @@ __title__ = "Result Control Task Panel" __author__ = "Juergen Riegel, Michael Hindley" __url__ = "http://www.freecadweb.org" -## @package TaskPanelShowResult +## @package TaskPanelResultShow # \ingroup FEM import FreeCAD @@ -37,7 +37,7 @@ from PySide.QtCore import Qt from PySide.QtGui import QApplication -class _TaskPanelShowResult: +class _TaskPanelResultShow: '''The task panel for the post-processing''' def __init__(self, obj): self.result_obj = obj @@ -45,7 +45,7 @@ class _TaskPanelShowResult: # task panel should be started by use of setEdit of view provider # in view provider checks: Mesh, active analysis and if Mesh and result are in active analysis - self.form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/PyGui/TaskPanelShowResult.ui") + self.form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/PyGui/TaskPanelResultShow.ui") self.fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/General") self.restore_result_settings_in_dialog = self.fem_prefs.GetBool("RestoreResultDialog", True) diff --git a/src/Mod/Fem/PyGui/_ViewProviderFemResultMechanical.py b/src/Mod/Fem/PyGui/_ViewProviderFemResultMechanical.py index 316cd9c7b..2b1f82944 100644 --- a/src/Mod/Fem/PyGui/_ViewProviderFemResultMechanical.py +++ b/src/Mod/Fem/PyGui/_ViewProviderFemResultMechanical.py @@ -72,8 +72,8 @@ class _ViewProviderFemResultMechanical: mem = FemGui.getActiveAnalysis().Member if self.Object in mem: if self.Object.Mesh in mem: - import PyGui._TaskPanelShowResult - taskd = PyGui._TaskPanelShowResult._TaskPanelShowResult(self.Object) + import PyGui._TaskPanelResultShow + taskd = PyGui._TaskPanelResultShow._TaskPanelResultShow(self.Object) taskd.obj = vobj.Object FreeCADGui.Control.showDialog(taskd) return True