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