PD: remove trailing whitespace
This commit is contained in:
@@ -32,7 +32,7 @@ __title__="PartDesign InvoluteGearObject management"
|
||||
__author__ = "Juergen Riegel"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
|
||||
|
||||
def makeInvoluteGear(name):
|
||||
'''makeInvoluteGear(name): makes an InvoluteGear'''
|
||||
@@ -57,21 +57,21 @@ class _CommandInvoluteGear:
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("PartDesign_InvoluteGear","Involute gear..."),
|
||||
'Accel': "",
|
||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("PartDesign_InvoluteGear","Creates or edit the involute gear definition.")}
|
||||
|
||||
|
||||
def Activated(self):
|
||||
|
||||
FreeCAD.ActiveDocument.openTransaction("Create involute gear")
|
||||
FreeCADGui.addModule("InvoluteGearFeature")
|
||||
FreeCADGui.doCommand("InvoluteGearFeature.makeInvoluteGear('InvoluteGear')")
|
||||
FreeCADGui.doCommand("Gui.activeDocument().setEdit(App.ActiveDocument.ActiveObject.Name,0)")
|
||||
|
||||
|
||||
def IsActive(self):
|
||||
if FreeCAD.ActiveDocument:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
class _InvoluteGear:
|
||||
"The InvoluteGear object"
|
||||
def __init__(self,obj):
|
||||
@@ -81,16 +81,16 @@ class _InvoluteGear:
|
||||
obj.addProperty("App::PropertyAngle","PressureAngle","Gear","Pressure angle of gear teeth")
|
||||
obj.addProperty("App::PropertyBool","HighPrecision","Gear","True=2 curves with each 3 control points False=1 curve with 4 control points ")
|
||||
obj.addProperty("App::PropertyBool","ExternalGear","Gear","True=external Gear False=internal Gear ")
|
||||
|
||||
|
||||
obj.NumberOfTeeth = 26
|
||||
obj.Modules = "2.5 mm"
|
||||
obj.PressureAngle = "20 deg"
|
||||
obj.HighPrecision = True
|
||||
obj.ExternalGear = True
|
||||
|
||||
obj.Modules = "2.5 mm"
|
||||
obj.PressureAngle = "20 deg"
|
||||
obj.HighPrecision = True
|
||||
obj.ExternalGear = True
|
||||
|
||||
obj.Proxy = self
|
||||
|
||||
|
||||
|
||||
|
||||
def execute(self,obj):
|
||||
#print "_InvoluteGear.execute()"
|
||||
w = fcgear.FCWireBuilder()
|
||||
@@ -102,14 +102,14 @@ class _InvoluteGear:
|
||||
obj.Shape = gearw
|
||||
obj.positionBySupport();
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
class _ViewProviderInvoluteGear:
|
||||
"A View Provider for the InvoluteGear object"
|
||||
|
||||
def __init__(self,vobj):
|
||||
vobj.Proxy = self
|
||||
|
||||
|
||||
def getIcon(self):
|
||||
return ":/icons/PartDesign_InternalExternalGear.svg"
|
||||
|
||||
@@ -117,14 +117,14 @@ class _ViewProviderInvoluteGear:
|
||||
self.ViewObject = vobj
|
||||
self.Object = vobj.Object
|
||||
|
||||
|
||||
|
||||
def setEdit(self,vobj,mode):
|
||||
taskd = _InvoluteGearTaskPanel(self.Object,mode)
|
||||
taskd.obj = vobj.Object
|
||||
taskd.update()
|
||||
FreeCADGui.Control.showDialog(taskd)
|
||||
return True
|
||||
|
||||
|
||||
def unsetEdit(self,vobj,mode):
|
||||
FreeCADGui.Control.closeDialog()
|
||||
return
|
||||
@@ -140,10 +140,10 @@ class _InvoluteGearTaskPanel:
|
||||
'''The editmode TaskPanel for InvoluteGear objects'''
|
||||
def __init__(self,obj,mode):
|
||||
self.obj = obj
|
||||
|
||||
|
||||
self.form=FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/PartDesign/InvoluteGearFeature.ui")
|
||||
self.form.setWindowIcon(QtGui.QIcon(":/icons/PartDesign_InternalExternalGear.svg"))
|
||||
|
||||
|
||||
QtCore.QObject.connect(self.form.Quantity_Modules, QtCore.SIGNAL("valueChanged(double)"), self.modulesChanged)
|
||||
QtCore.QObject.connect(self.form.Quantity_PressureAngle, QtCore.SIGNAL("valueChanged(double)"), self.angleChanged)
|
||||
QtCore.QObject.connect(self.form.spinBox_NumberOfTeeth, QtCore.SIGNAL("valueChanged(int)"), self.numTeethChanged)
|
||||
@@ -151,15 +151,15 @@ class _InvoluteGearTaskPanel:
|
||||
#QtCore.QObject.connect(self.form.comboBox_ExternalGear, QtCore.SIGNAL("activated(QString)"), self.externalGearChanged)
|
||||
#QtCore.QObject.connect(self.form.comboBox_ExternalGear, QtCore.SIGNAL("currentIndexChanged(int)"), self.externalGearChanged)
|
||||
QtCore.QObject.connect(self.form.comboBox_ExternalGear, QtCore.SIGNAL("currentIndexChanged(int)"), self.externalGearChanged)
|
||||
|
||||
|
||||
self.update()
|
||||
|
||||
|
||||
if mode == 0: # fresh created
|
||||
self.obj.Proxy.execute(self.obj) # calculate once
|
||||
self.obj.Proxy.execute(self.obj) # calculate once
|
||||
FreeCAD.Gui.SendMsgToActiveView("ViewFit")
|
||||
|
||||
|
||||
def transferTo(self):
|
||||
"Transfer from the dialog to the object"
|
||||
"Transfer from the dialog to the object"
|
||||
self.obj.NumberOfTeeth = self.form.spinBox_NumberOfTeeth.value()
|
||||
self.obj.Modules = self.form.Quantity_Modules.text()
|
||||
self.obj.PressureAngle = self.form.Quantity_PressureAngle.text()
|
||||
@@ -173,8 +173,8 @@ class _InvoluteGearTaskPanel:
|
||||
else:
|
||||
self.obj.ExternalGear = False
|
||||
#self.obj.ExternalGear = self.form.comboBox_ExternalGear.currentIndex()
|
||||
|
||||
|
||||
|
||||
|
||||
def transferFrom(self):
|
||||
"Transfer from the object to the dialog"
|
||||
self.form.spinBox_NumberOfTeeth.setValue(self.obj.NumberOfTeeth)
|
||||
@@ -190,13 +190,13 @@ class _InvoluteGearTaskPanel:
|
||||
else:
|
||||
self.form.comboBox_ExternalGear.setCurrentIndex(1)
|
||||
#self.form.comboBox_ExternalGear.setCurrentIndex(self.obj.ExternalGear)
|
||||
|
||||
|
||||
def modulesChanged(self, value):
|
||||
#print value
|
||||
self.obj.Modules = value
|
||||
self.obj.Proxy.execute(self.obj)
|
||||
FreeCAD.Gui.SendMsgToActiveView("ViewFit")
|
||||
|
||||
|
||||
def angleChanged(self, value):
|
||||
#print value
|
||||
self.obj.PressureAngle = value
|
||||
@@ -207,7 +207,7 @@ class _InvoluteGearTaskPanel:
|
||||
self.obj.NumberOfTeeth = value
|
||||
self.obj.Proxy.execute(self.obj)
|
||||
FreeCAD.Gui.SendMsgToActiveView("ViewFit")
|
||||
|
||||
|
||||
def numCurvesChanged(self, value):
|
||||
#print value
|
||||
if value == 0:
|
||||
@@ -216,7 +216,7 @@ class _InvoluteGearTaskPanel:
|
||||
v=False
|
||||
self.obj.HighPrecision = v
|
||||
self.obj.Proxy.execute(self.obj)
|
||||
|
||||
|
||||
def externalGearChanged(self, value):
|
||||
#print value
|
||||
if value == 0:
|
||||
@@ -225,27 +225,27 @@ class _InvoluteGearTaskPanel:
|
||||
v=False
|
||||
self.obj.ExternalGear = v
|
||||
self.obj.Proxy.execute(self.obj)
|
||||
|
||||
|
||||
def getStandardButtons(self):
|
||||
return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Cancel)| int(QtGui.QDialogButtonBox.Apply)
|
||||
|
||||
|
||||
def clicked(self,button):
|
||||
if button == QtGui.QDialogButtonBox.Apply:
|
||||
#print "Apply"
|
||||
self.transferTo()
|
||||
self.obj.Proxy.execute(self.obj)
|
||||
|
||||
self.obj.Proxy.execute(self.obj)
|
||||
|
||||
def update(self):
|
||||
'fills the widgets'
|
||||
self.transferFrom()
|
||||
|
||||
|
||||
def accept(self):
|
||||
#print 'accept(self)'
|
||||
self.transferTo()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
FreeCADGui.ActiveDocument.resetEdit()
|
||||
|
||||
|
||||
|
||||
|
||||
def reject(self):
|
||||
#print 'reject(self)'
|
||||
FreeCADGui.ActiveDocument.resetEdit()
|
||||
|
||||
Reference in New Issue
Block a user