Path:wip on tl edit dialog and units
This commit is contained in:
parent
df8783833d
commit
c84e7662b7
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>361</width>
|
||||
<height>418</height>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -167,19 +167,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QDoubleSpinBox" name="DiameterField">
|
||||
<property name="suffix">
|
||||
<string>mm</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
|
@ -187,13 +174,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QDoubleSpinBox" name="LengthOffsetField">
|
||||
<property name="suffix">
|
||||
<string>mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
|
@ -201,13 +181,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QDoubleSpinBox" name="FlatRadiusField">
|
||||
<property name="suffix">
|
||||
<string>mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
|
@ -215,13 +188,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="QDoubleSpinBox" name="CornerRadiusField">
|
||||
<property name="suffix">
|
||||
<string>mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
|
@ -243,16 +209,86 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="1">
|
||||
<widget class="QDoubleSpinBox" name="CuttingEdgeHeightField">
|
||||
<property name="suffix">
|
||||
<string>mm</string>
|
||||
<item row="6" column="1">
|
||||
<widget class="Gui::InputField" name="DiameterField">
|
||||
<property name="text">
|
||||
<string>12.7 mm</string>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.125000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.100000000000000</double>
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>10.000000000000000</double>
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="Gui::InputField" name="LengthOffsetField">
|
||||
<property name="text">
|
||||
<string>25.4 mm</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="Gui::InputField" name="FlatRadiusField">
|
||||
<property name="text">
|
||||
<string>0.00 mm</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="Gui::InputField" name="CornerRadiusField">
|
||||
<property name="text">
|
||||
<string>0.00 mm</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="1">
|
||||
<widget class="Gui::InputField" name="CuttingEdgeHeightField">
|
||||
<property name="text">
|
||||
<string>25.4 mm</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -271,6 +307,13 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::InputField</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>Gui/InputField.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
|
|
@ -201,7 +201,7 @@ class ToolLibraryManager():
|
|||
itemName = QtGui.QStandardItem(t.Name)
|
||||
itemToolType = QtGui.QStandardItem(t.ToolType)
|
||||
itemMaterial = QtGui.QStandardItem(t.Material)
|
||||
itemDiameter = QtGui.QStandardItem(str(t.Diameter))
|
||||
itemDiameter = QtGui.QStandardItem(str(t.Diameter))
|
||||
itemLengthOffset = QtGui.QStandardItem(str(t.LengthOffset))
|
||||
itemFlatRadius = QtGui.QStandardItem(str(t.FlatRadius))
|
||||
itmCornerRadius = QtGui.QStandardItem(str(t.CornerRadius))
|
||||
|
@ -397,12 +397,12 @@ class EditorPanel():
|
|||
t.Name = str(editform.NameField.text())
|
||||
t.ToolType = self.getType(editform.TypeField.currentIndex())
|
||||
t.Material = self.getMaterial(editform.MaterialField.currentIndex())
|
||||
t.Diameter = editform.DiameterField.value()
|
||||
t.LengthOffset = editform.LengthOffsetField.value()
|
||||
t.FlatRadius = editform.FlatRadiusField.value()
|
||||
t.CornerRadius = editform.CornerRadiusField.value()
|
||||
t.Diameter = FreeCAD.Units.parseQuantity(editform.DiameterField.text())
|
||||
t.LengthOffset = FreeCAD.Units.parseQuantity(editform.LengthOffsetField.text())
|
||||
t.FlatRadius = FreeCAD.Units.parseQuantity(editform.FlatRadiusField.text())
|
||||
t.CornerRadius = FreeCAD.Units.parseQuantity(editform.CornerRadiusField.text())
|
||||
t.CuttingEdgeAngle = editform.CuttingEdgeAngleField.value()
|
||||
t.CuttingEdgeHeight = editform.CuttingEdgeHeightField.value()
|
||||
t.CuttingEdgeHeight = FreeCAD.Units.parseQuantity(editform.CuttingEdgeHeightField.text())
|
||||
|
||||
listname = self.form.listView.selectedIndexes()[0].data()
|
||||
if self.TLM.addnew(listname, t) is True:
|
||||
|
@ -463,12 +463,12 @@ class EditorPanel():
|
|||
editform.NameField.setText(tool.Name)
|
||||
editform.TypeField.setCurrentIndex(self.getType(tool.ToolType))
|
||||
editform.MaterialField.setCurrentIndex(self.getMaterial(tool.Material))
|
||||
editform.DiameterField.setValue(tool.Diameter)
|
||||
editform.LengthOffsetField.setValue(tool.LengthOffset)
|
||||
editform.FlatRadiusField.setValue(tool.FlatRadius)
|
||||
editform.CornerRadiusField.setValue(tool.CornerRadius)
|
||||
editform.DiameterField.setText(str(tool.Diameter))
|
||||
editform.LengthOffsetField.setText(str(tool.LengthOffset))
|
||||
editform.FlatRadiusField.setText(str(tool.FlatRadius))
|
||||
editform.CornerRadiusField.setText(str(tool.CornerRadius))
|
||||
editform.CuttingEdgeAngleField.setValue(tool.CuttingEdgeAngle)
|
||||
editform.CuttingEdgeHeightField.setValue(tool.CuttingEdgeHeight)
|
||||
editform.CuttingEdgeHeightField.setText(str(tool.CuttingEdgeHeight))
|
||||
|
||||
r = editform.exec_()
|
||||
if r:
|
||||
|
@ -476,12 +476,12 @@ class EditorPanel():
|
|||
tool.Name = str(editform.NameField.text())
|
||||
tool.ToolType = self.getType(editform.TypeField.currentIndex())
|
||||
tool.Material = self.getMaterial(editform.MaterialField.currentIndex())
|
||||
tool.Diameter = editform.DiameterField.value()
|
||||
tool.LengthOffset = editform.LengthOffsetField.value()
|
||||
tool.FlatRadius = editform.FlatRadiusField.value()
|
||||
tool.CornerRadius = editform.CornerRadiusField.value()
|
||||
tool.Diameter = FreeCAD.Units.parseQuantity(editform.DiameterField.text())
|
||||
tool.LengthOffset = FreeCAD.Units.parseQuantity(editform.LengthOffsetField.text())
|
||||
tool.FlatRadius = FreeCAD.Units.parseQuantity(editform.FlatRadiusField.text())
|
||||
tool.CornerRadius = FreeCAD.Units.parseQuantity(editform.CornerRadiusField.text())
|
||||
tool.CuttingEdgeAngle = editform.CuttingEdgeAngleField.value()
|
||||
tool.CuttingEdgeHeight = editform.CuttingEdgeHeightField.value()
|
||||
tool.CuttingEdgeHeight = FreeCAD.Units.parseQuantity(editform.CuttingEdgeHeightField.text())
|
||||
|
||||
if self.TLM.updateTool(listname, toolnum, tool) is True:
|
||||
self.loadTable(self.form.listView.selectedIndexes()[0])
|
||||
|
|
Loading…
Reference in New Issue
Block a user