Skip to content

Commit

Permalink
Merge pull request #46 from dubstar-04/FreeCAD-1.0
Browse files Browse the repository at this point in the history
Update to work with FreeCAD 1.0
  • Loading branch information
dubstar-04 authored Dec 12, 2024
2 parents 2a362df + 3d32fe1 commit 1526308
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions InitTurningAddon.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ def getIcon(iconName):


def updateMenu(workbench):
if workbench == 'PathWorkbench':
if workbench == 'CAMWorkbench':

print('FreeCAD Turning Addon loaded:', workbench)

mw = FreeCADGui.getMainWindow()
addonMenu = None

# Find the main path menu
pathMenu = mw.findChild(QtGui.QMenu, "&Path")
CAMMenu = mw.findChild(QtGui.QMenu, "&CAM")

for menu in pathMenu.actions():
for menu in CAMMenu.actions():
if menu.text() == "Turning Addon":
# create a new addon menu
addonMenu = menu.menu()
Expand All @@ -62,12 +62,12 @@ def updateMenu(workbench):
if addonMenu is None:
addonMenu = QtGui.QMenu("Turning Addon")
addonMenu.setObjectName("Turning_Addons")
addonMenu.setIcon(QtGui.QPixmap(getIcon('Path-TurningAddon.svg')))
addonMenu.setIcon(QtGui.QPixmap(getIcon('CAM-TurningAddon.svg')))

# Find the dressup menu entry
dressupMenu = mw.findChild(QtGui.QMenu, "Path Dressup")

pathMenu.insertMenu(dressupMenu.menuAction(), addonMenu)
CAMMenu.insertMenu(dressupMenu.menuAction(), addonMenu)

# list of commands to add to the menu, add new commands here:
commands = ['TurnFace', 'TurnProfile', 'TurnPartoff', 'TurnRough', 'TurnToolHelper']
Expand All @@ -84,13 +84,13 @@ def updateMenu(workbench):
def createAction(menu, actionName):
# space the actionName at caps
text = re.sub(r"(\w)([A-Z])", r"\1 \2", actionName)
command = "Path_" + actionName
icon = "Path-" + actionName + ".svg"
command = "CAM_" + actionName
icon = "CAM-" + actionName + ".svg"

action = QtGui.QAction(menu)
action.setText(text)
action.setIcon(QtGui.QPixmap(getIcon(icon)))
action.setStatusTip("Path " + actionName + " Operation")
action.setStatusTip("CAM " + actionName + " Operation")
action.triggered.connect(lambda: FreeCADGui.runCommand(command, 0))

return action
Expand Down
2 changes: 1 addition & 1 deletion PathTurnScripts/PathTurnFaceGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def setOpFields(self, obj):
Command = PathOpGui.SetupOperation('TurnFace',
PathTurnFace.Create,
TaskPanelOpPage,
'Path-TurnFace',
'CAM-TurnFace',
QtCore.QT_TRANSLATE_NOOP("PathTurnFace", "Turn Face"),
QtCore.QT_TRANSLATE_NOOP("PathTurnFace",
"Creates a Turning Facing object from a features of a base object"),
Expand Down
2 changes: 1 addition & 1 deletion PathTurnScripts/PathTurnPartoffGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def setOpFields(self, obj):
Command = PathOpGui.SetupOperation('TurnPartoff',
PathTurnPartoff.Create,
TaskPanelOpPage,
'Path-TurnPartoff',
'CAM-TurnPartoff',
QtCore.QT_TRANSLATE_NOOP("PathTurnPartoff", "Turn Part"),
QtCore.QT_TRANSLATE_NOOP("PathTurnPartoff",
"Creates a Path Turning Part object from a features of a base object"),
Expand Down
2 changes: 1 addition & 1 deletion PathTurnScripts/PathTurnProfileGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def setOpFields(self, obj):
Command = PathOpGui.SetupOperation('TurnProfile',
PathTurnProfile.Create,
TaskPanelOpPage,
'Path-TurnProfile',
'CAM-TurnProfile',
QtCore.QT_TRANSLATE_NOOP("PathTurnProfile", "Turn Profile"),
QtCore.QT_TRANSLATE_NOOP("PathTurnProfile",
"Creates a Path Turning Profile object from a features of a base object"),
Expand Down
2 changes: 1 addition & 1 deletion PathTurnScripts/PathTurnRoughGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def setOpFields(self, obj):
Command = PathOpGui.SetupOperation('TurnRough',
PathTurnRough.Create,
TaskPanelOpPage,
'Path-TurnRough',
'CAM-TurnRough',
QtCore.QT_TRANSLATE_NOOP("PathTurnRough", "Turn Rough"),
QtCore.QT_TRANSLATE_NOOP("PathTurnRough",
"Creates a Path Turning Roughing object from a features of a base object"),
Expand Down
8 changes: 4 additions & 4 deletions PathTurnScripts/PathTurnToolHelperGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def reset(self):
class CommandPathTurnToolHelper:

def GetResources(self):
return {'Pixmap': 'Path-TurnToolHelper',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Path", "Derive toolbit parameters from isocode"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Path", "Derive toolbit parameters from isocode")}
return {'Pixmap': 'CAM-TurnToolHelper',
'MenuText': QtCore.QT_TRANSLATE_NOOP("CAM", "Derive toolbit parameters from isocode"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("CAM", "Derive toolbit parameters from isocode")}

def Activated(self):
panel = TurnToolHelperPanel()
Expand All @@ -212,7 +212,7 @@ def Activated(self):

if FreeCAD.GuiUp:
# register the FreeCAD command
FreeCADGui.addCommand('Path_TurnToolHelper', CommandPathTurnToolHelper())
FreeCADGui.addCommand('CAM_TurnToolHelper', CommandPathTurnToolHelper())



8 changes: 4 additions & 4 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1">
<name>Turning Addon</name>
<description>A FreeCAD Path Addon to encourage the development of CNC turning functionality for the PATH workbench</description>
<version>0.2</version>
<description>A FreeCAD CAM Addon to encourage the development of CNC turning functionality for the CAM workbench</description>
<version>0.3</version>
<maintainer email="s.d.wood.82@googlemail.com">Daniel Wood</maintainer>
<license file="LICENSE">LGPL-2.1</license>
<url type="repository" branch="master">https://github.com/dubstar-04/TurningAddon</url>
<url type="readme">https://github.com/dubstar-04/TurningAddon/blob/master/README.md</url>

<content>
<workbench>
<icon>Gui/Resources/Icons/Path-TurningAddon.svg</icon>
<freecadmin>0.21.0</freecadmin>
<icon>Gui/Resources/Icons/CAM-TurningAddon.svg</icon>
<freecadmin>1.0.0</freecadmin>
</workbench>
</content>

Expand Down

0 comments on commit 1526308

Please sign in to comment.