Add leading plus (+) in hole/shaft fit limit

ISO 286/14405-1 calls for a plus sign if the limit is positive and a
minus sign if the limit is negative. A zero limit should have neither
a plus nor a minus sign. This commit adds the plus sign.
This commit is contained in:
Marco Patzer
2024-03-22 10:42:49 +01:00
committed by WandererFan
parent 730136e3e9
commit 1cfa0426fb

View File

@@ -116,10 +116,20 @@ class TaskHoleShaftFit:
mainFormat = dim.FormatSpec
dim.FormatSpec = mainFormat+' '+selectedField
dim.EqualTolerance = False
dim.FormatSpecOverTolerance = '(%-0.6w)'
dim.FormatSpecUnderTolerance = '(%-0.6w)'
dim.OverTolerance = rangeValues[0]
dim.UnderTolerance = rangeValues[1]
if dim.OverTolerance < 0:
dim.FormatSpecOverTolerance = '(%-0.6w)'
elif dim.OverTolerance > 0:
dim.FormatSpecOverTolerance = '(+%-0.6w)'
else:
dim.FormatSpecOverTolerance = '( %-0.6w)'
if dim.UnderTolerance < 0:
dim.FormatSpecUnderTolerance = '(%-0.6w)'
elif dim.UnderTolerance > 0:
dim.FormatSpecUnderTolerance = '(+%-0.6w)'
else:
dim.FormatSpecUnderTolerance = '( %-0.6w)'
Gui.Control.closeDialog()
def reject(self):