Skip to content

Commit

Permalink
fix for tool edit index bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptonic authored and yorikvanhavre committed Oct 24, 2016
1 parent b34f58a commit 0dfbfda
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/Mod/Path/PathScripts/PathToolLibraryManager.py
Expand Up @@ -356,35 +356,36 @@ def getFields(self):
pass

def getType(self, tooltype):
print("tooltype: ", tooltype)
"gets a combobox index number for a given type or viceversa"
toolslist = ["Drill", "CenterDrill", "CounterSink", "CounterBore",
"Reamer", "Tap", "EndMill", "SlotCutter", "BallEndMill",
"ChamferMill", "CornerRound", "Engraver"]
if isinstance(tooltype, str):
if tooltype in toolslist:
return toolslist.index(tooltype) + 1
return toolslist.index(tooltype)
else:
return 0
else:
if tooltype == 0:
return "Undefined"
else:
return toolslist[tooltype - 1]
#if tooltype == 0:
# return "Undefined"
#else:
return toolslist[tooltype]

def getMaterial(self, material):
"gets a combobox index number for a given material or viceversa"
matslist = ["HighSpeedSteel", "HighCarbonToolSteel", "CastAlloy",
"Carbide", "Ceramics", "Diamond", "Sialon"]
if isinstance(material, str):
if material in matslist:
return matslist.index(material) + 1
return matslist.index(material)
else:
return 0
else:
if material == 0:
return "Undefined"
else:
return matslist[material - 1]
#if material == 0:
# return "Undefined"
#else:
return matslist[material]

def addTool(self):
t = Path.Tool()
Expand Down

0 comments on commit 0dfbfda

Please sign in to comment.