Skip to content

Commit

Permalink
[PD] sort entries in sprocket feature
Browse files Browse the repository at this point in the history
as the title says.

(The other UI file changes were made by Qt's designer.)
  • Loading branch information
donovaly authored and wwmayer committed Apr 7, 2021
1 parent 1e36b60 commit cadbacb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 79 deletions.
23 changes: 11 additions & 12 deletions src/Mod/PartDesign/SprocketFeature.py
Expand Up @@ -209,13 +209,6 @@ def sprocketReferenceChanged(self, size):
"ANSI 180":[2.250, 1.460, 1.301],
"ANSI 200":[2.500, 1.562, 1.389],
"ANSI 240":[3.000, 1.875, 1.738],
"Motorcycle 420":[0.500, 0.3125, 0.227],
"Motorcycle 425":[0.500, 0.3125, 0.284],
"Motorcycle 428":[0.500, 0.335, 0.284],
"Motorcycle 520":[0.625, 0.400, 0.227],
"Motorcycle 525":[0.625, 0.400, 0.284],
"Motorcycle 530":[0.625, 0.400, 0.343],
"Motorcycle 630":[0.75, 0.400, 0.343],
"Bicycle with Derailleur":[0.500, 0.3125, 0.11],
"Bicycle without Derailleur":[0.500, 0.3125, 0.084],
"ISO 606 06B":[0.375, 5.72/25.4, 5.2/25.4],
Expand All @@ -224,11 +217,18 @@ def sprocketReferenceChanged(self, size):
"ISO 606 12B":[0.750, 11.68/25.4, 11.1/25.4],
"ISO 606 16B":[1.000, 17.02/25.4, 16.2/25.4],
"ISO 606 20B":[1.250, 19.56/25.4, 18.5/25.4],
"ISO 606 24B":[1.5, 25.4/25.4, 24.1/25.4]}
"ISO 606 24B":[1.500, 25.4/25.4, 24.1/25.4],
"Motorcycle 420":[0.500, 0.3125, 0.227],
"Motorcycle 425":[0.500, 0.3125, 0.284],
"Motorcycle 428":[0.500, 0.335, 0.284],
"Motorcycle 520":[0.625, 0.400, 0.227],
"Motorcycle 525":[0.625, 0.400, 0.284],
"Motorcycle 530":[0.625, 0.400, 0.343],
"Motorcycle 630":[0.750, 0.400, 0.343],}

self.obj.Pitch = str(SprocketReferenceRollerTable[size][0]) + " in"
self.obj.RollerDiameter = str(SprocketReferenceRollerTable[size][1]) + " in"
self.obj.Thickness = str(SprocketReferenceRollerTable[size][2]) + " in"
self.obj.Pitch = str(SprocketReferenceRollerTable[size][0]) + " in"
self.obj.RollerDiameter = str(SprocketReferenceRollerTable[size][1]) + " in"
self.obj.Thickness = str(SprocketReferenceRollerTable[size][2]) + " in"
self.form.Quantity_Pitch.setText(self.obj.Pitch.UserString)
self.form.Quantity_RollerDiameter.setText(self.obj.RollerDiameter.UserString)
self.form.Quantity_Thickness.setText(self.obj.Thickness.UserString)
Expand Down Expand Up @@ -270,6 +270,5 @@ def reject(self):
FreeCAD.ActiveDocument.abortTransaction()



if FreeCAD.GuiUp:
FreeCADGui.addCommand('PartDesign_Sprocket', CommandSprocket())
119 changes: 52 additions & 67 deletions src/Mod/PartDesign/SprocketFeature.ui
Expand Up @@ -6,15 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>195</width>
<width>264</width>
<height>142</height>
</rect>
</property>
<property name="windowTitle">
<string>Sprocket parameter</string>
</property>
<layout class="QFormLayout" name="formLayout">

<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
Expand All @@ -35,7 +34,6 @@
</property>
</widget>
</item>

<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
Expand All @@ -44,21 +42,20 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_SprocketReference">

<widget class="QComboBox" name="comboBox_SprocketReference">
<item>
<property name="text">
<string>ANSI 25</string>
<string>ANSI 25</string>
</property>
</item>
<item>
<property name="text">
<string>ANSI 35</string>
<string>ANSI 35</string>
</property>
</item>
<item>
<property name="text">
<string>ANSI 41</string>
<string>ANSI 41</string>
</property>
</item>
<item>
Expand Down Expand Up @@ -118,98 +115,94 @@
</item>
<item>
<property name="text">
<string>Motorcycle 420</string>
<string>Bicycle with Derailleur</string>
</property>
</item>
<item>
<property name="text">
<string>Motorcycle 425</string>
<string>Bicycle without Derailleur</string>
</property>
</item>
<item>
<property name="text">
<string>Motorcycle 428</string>
<string>ISO 606 06B</string>
</property>
</item>
<item>
<property name="text">
<string>Motorcycle 520</string>
<string>ISO 606 08B</string>
</property>
</item>
<item>
<property name="text">
<string>Motorcycle 525</string>
<string>ISO 606 10B</string>
</property>
</item>
<item>
<property name="text">
<string>Motorcycle 530</string>
<string>ISO 606 12B</string>
</property>
</item>
<item>
<property name="text">
<string>Motorcycle 630</string>
<string>ISO 606 16B</string>
</property>
</item>
<item>
<property name="text">
<string>Bicycle with Derailleur</string>
<string>ISO 606 20B</string>
</property>
</item>
<item>
<property name="text">
<string>Bicycle without Derailleur</string>
<string>ISO 606 24B</string>
</property>
</item>
<item>
<property name="text">
<string>ISO 606 06B</string>
<string>Motorcycle 420</string>
</property>
</item>
<item>
<property name="text">
<string>ISO 606 08B</string>
<string>Motorcycle 425</string>
</property>
</item>
<item>
<property name="text">
<string>ISO 606 10B</string>
<string>Motorcycle 428</string>
</property>
</item>
<item>
<property name="text">
<string>ISO 606 12B</string>
<string>Motorcycle 520</string>
</property>
</item>
<item>
<property name="text">
<string>ISO 606 16B</string>
<string>Motorcycle 525</string>
</property>
</item>
<item>
<property name="text">
<string>ISO 606 20B</string>
<string>Motorcycle 530</string>
</property>
</item>
<item>
<property name="text">
<string>ISO 606 24B</string>
<string>Motorcycle 630</string>
</property>
</item>
</widget>
</item>

<item row="2" column="0">

<widget class="QLabel" name="label_8">
<property name="text">
<string>Chain Pitch:</string>
</property>
</widget>
</item>

<item row="2" column="1">

<widget class="Gui::InputField" name="Quantity_Pitch">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
Expand All @@ -224,35 +217,32 @@
</size>
</property>
<property name="text">
<string/>
<string>0 in</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="singleStep">
<double>0.001000000000000</double>
</property>
<property name="maximum">
<double>2000.000000000000000</double>
</property>
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="unit" stdset="0">
<string notr="true">in</string>
</property>
<property name="decimals" stdset="0">
<number>3</number>
</property>
<property name="maximum" stdset="0">
<double>2000.000000000000000</double>
</property>
<property name="minimum" stdset="0">
<double>0.01</double>
</property>

<property name="singleStep" stdset="0">
<double>0.001</double>
</property>
<property name="value" stdset="0">
<double>0.375</double>
<double>0.375000000000000</double>
</property>
</widget>
</item>

<item row="3" column="0">

<widget class="QLabel" name="label_6">
<property name="text">
<string>Roller Diameter:</string>
Expand All @@ -276,30 +266,27 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="maximum">
<double>50.000000000000000</double>
</property>
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="unit" stdset="0">
<string notr="true">in</string>
</property>
<property name="decimals" stdset="0">
<number>3</number>
</property>
<property name="maximum" stdset="0">
<double>50.000000000000000</double>
</property>
<property name="minimum" stdset="0">
<double>0.01</double>
</property>

<property name="singleStep" stdset="0">
<double>0.01</double>
</property>
<property name="value" stdset="0">
<double>0.20</double>
<double>0.200000000000000</double>
</property>
</widget>
</item>

<item row="4" column="0">

<widget class="QLabel" name="label_7">
<property name="text">
<string>Thickness:</string>
Expand All @@ -323,28 +310,26 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="maximum">
<double>50.000000000000000</double>
</property>
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="unit" stdset="0">
<string notr="true">in</string>
</property>
<property name="decimals" stdset="0">
<number>3</number>
</property>
<property name="maximum" stdset="0">
<double>50.000000000000000</double>
</property>
<property name="minimum" stdset="0">
<double>0.01</double>
</property>

<property name="singleStep" stdset="0">
<double>0.01</double>
</property>
<property name="value" stdset="0">
<double>0.20</double>
<double>0.200000000000000</double>
</property>
</widget>
</item>

</layout>
</widget>
<customwidgets>
Expand Down

0 comments on commit cadbacb

Please sign in to comment.