From ca0f3155e4d877a58da4ef84d9a0d06c401295b7 Mon Sep 17 00:00:00 2001 From: jriegel Date: Sun, 14 Jul 2013 21:14:38 +0200 Subject: [PATCH] Add Job Control Dialog --- src/Mod/Machining_Distortion/CMakeLists.txt | 1 + src/Mod/Machining_Distortion/InitGui.py | 2 +- src/Mod/Machining_Distortion/JobControl.ui | 356 ++++++++++++++++++ .../Machining_Distortion/MachDistAnalysis.py | 56 ++- 4 files changed, 413 insertions(+), 2 deletions(-) create mode 100644 src/Mod/Machining_Distortion/JobControl.ui diff --git a/src/Mod/Machining_Distortion/CMakeLists.txt b/src/Mod/Machining_Distortion/CMakeLists.txt index e3274df0f..71136bf05 100755 --- a/src/Mod/Machining_Distortion/CMakeLists.txt +++ b/src/Mod/Machining_Distortion/CMakeLists.txt @@ -24,6 +24,7 @@ SET(MachDist_SRCS Parameter.ui Material.ui Aligment.ui + JobControl.ui ) SOURCE_GROUP("" FILES ${MachDist_SRCS}) diff --git a/src/Mod/Machining_Distortion/InitGui.py b/src/Mod/Machining_Distortion/InitGui.py index 3ab75b28a..6a584f807 100755 --- a/src/Mod/Machining_Distortion/InitGui.py +++ b/src/Mod/Machining_Distortion/InitGui.py @@ -163,7 +163,7 @@ class MachiningDistortionWorkbench ( Workbench ): CmdList = ["MachiningDistortion_StartGUI","MachiningDistortion_StartPostprocess"] self.appendToolbar("MachiningDistortionTools",CmdList) self.appendMenu("Machining Distortion",CmdList) - CmdList2 = ["MachDist_Analysis","Separator","MachDist_Mesh","MachDist_Alignment","MachDist_Material","MachDist_Isostatic"] + CmdList2 = ["MachDist_Analysis","Separator","MachDist_Mesh","MachDist_Alignment","MachDist_Material","MachDist_Isostatic","Separator","MachDist_JobControl"] self.appendToolbar("MachiningDistortionTools2",CmdList2) self.appendMenu("Machining Distortion2",CmdList2) diff --git a/src/Mod/Machining_Distortion/JobControl.ui b/src/Mod/Machining_Distortion/JobControl.ui new file mode 100644 index 000000000..29516383a --- /dev/null +++ b/src/Mod/Machining_Distortion/JobControl.ui @@ -0,0 +1,356 @@ + + + JobControl + + + + 0 + 0 + 258 + 366 + + + + Job Control + + + + + + + + From + + + Qt::AlignCenter + + + + + + + To + + + Qt::AlignCenter + + + + + + + Intervall + + + Qt::AlignCenter + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + A + + + Qt::AlignCenter + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + B + + + Qt::AlignCenter + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + C + + + Qt::AlignCenter + + + + + + + + 60 + 20 + + + + Qt::LeftToRight + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + + + + + Z + + + Qt::AlignCenter + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + 1 + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + 1 + + + + + + + + 60 + 20 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + 1 + + + + + + + + 60 + 0 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + -99 + + + 1 + + + + + + + + + + + Generate + + + + + + + Delete + + + + + + + + + + 0 + 0 + + + + + 240 + 120 + + + + + 640 + 16777215 + + + + 0 + + + 2 + + + false + + + false + + + + + + + + + + diff --git a/src/Mod/Machining_Distortion/MachDistAnalysis.py b/src/Mod/Machining_Distortion/MachDistAnalysis.py index 4b73989b9..6d6aaa980 100644 --- a/src/Mod/Machining_Distortion/MachDistAnalysis.py +++ b/src/Mod/Machining_Distortion/MachDistAnalysis.py @@ -23,10 +23,11 @@ import FreeCAD, Fem if FreeCAD.GuiUp: - import FreeCADGui + import FreeCADGui,FemGui from FreeCAD import Vector from PyQt4 import QtCore, QtGui from pivy import coin + import PyQt4.uic as uic __title__="Machine-Distortion Analysis managment" __author__ = "Juergen Riegel" @@ -68,5 +69,58 @@ class _CommandAnalysis: import FemGui return FreeCADGui.ActiveDocument != None and FemGui.getActiveAnalysis() == None +class _CommandJobControl: + "the MachDist JobControl command definition" + def GetResources(self): + return {'Pixmap' : 'MachDist_NewAnalysis', + 'MenuText': QtCore.QT_TRANSLATE_NOOP("MachDist_JobControl","Machine-Distortion JobControl"), + 'Accel': "A", + 'ToolTip': QtCore.QT_TRANSLATE_NOOP("MachDist_Analysis","Open the JobControl dialog")} + + def Activated(self): + taskd = _JobControlTaskPanel() + #taskd.obj = vobj.Object + taskd.update() + FreeCADGui.Control.showDialog(taskd) + + + def IsActive(self): + import FemGui + return FreeCADGui.ActiveDocument != None and FemGui.getActiveAnalysis() == None + +class _JobControlTaskPanel: + '''The editmode TaskPanel for Material objects''' + def __init__(self): + # the panel has a tree widget that contains categories + # for the subcomponents, such as additions, subtractions. + # the categories are shown only if they are not empty. + form_class, base_class = uic.loadUiType(FreeCAD.getHomePath() + "Mod/Machining_Distortion/JobControl.ui") + + #self.obj = object + self.formUi = form_class() + self.form = QtGui.QWidget() + self.formUi.setupUi(self.form) + + #Connect Signals and Slots + #QtCore.QObject.connect(self.formUi.pushButton_FlipX, QtCore.SIGNAL("clicked()"), self.flipX) + + self.update() + + + + def getStandardButtons(self): + return int(QtGui.QDialogButtonBox.Close) + + def update(self): + 'fills the widgets' + return + + def accept(self): + FreeCADGui.Control.closeDialog() + + + def reject(self): + FreeCADGui.Control.closeDialog() FreeCADGui.addCommand('MachDist_Analysis',_CommandAnalysis()) +FreeCADGui.addCommand('MachDist_JobControl',_CommandJobControl())