Skip to content

Commit

Permalink
Merge pull request #57 from dubstar-04/FreeCAD-1.0
Browse files Browse the repository at this point in the history
Update addon to support FreeCAD 1.0
  • Loading branch information
dubstar-04 authored Dec 12, 2024
2 parents b2cc013 + a134d0d commit c851c21
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 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.5, 3.6, 3.7, 3.8, 3.9]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions PathFeedsAndSpeedsGui.py → CAMFeedsAndSpeedsGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from importFCMat import read
import MaterialEditor

import PathFeedsAndSpeeds
import CAMFeedsAndSpeeds

dir = os.path.dirname(__file__)
ui_name = "PathFeedsAndSpeedsGui.ui"
ui_name = "CAMFeedsAndSpeedsGui.ui"
path_to_ui = os.path.join(dir, ui_name)
material_dir = os.path.join(dir, 'Materials')
iconPath = os.path.join(dir, 'Icons')
Expand All @@ -31,7 +31,7 @@ def __init__(self):
self.material = {} # selected material

# Init
self.calculation = PathFeedsAndSpeeds.FSCalculation()
self.calculation = CAMFeedsAndSpeeds.FSCalculation()
self.load_materials()
self.setup_ui()
self.calculate()
Expand Down Expand Up @@ -215,7 +215,7 @@ def calculate(self):
if not self.validate_input():
return

tool = PathFeedsAndSpeeds.Tool()
tool = CAMFeedsAndSpeeds.Tool()

self.calculation.rpm_overide = self.form.rpm_LE.text()
surfaceSpeed = float(self.form.ss_LE.text())
Expand Down
2 changes: 1 addition & 1 deletion PathFeedsAndSpeedsGui.ui → CAMFeedsAndSpeedsGui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</size>
</property>
<property name="windowTitle">
<string>Path Feeds and Speeds</string>
<string>Feeds and Speeds</string>
</property>
<property name="statusTip">
<string/>
Expand Down
File renamed without changes
20 changes: 10 additions & 10 deletions InitFeedsAndSpeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ***************************************************************************
# * *
# * Copyright (c) 2020 Daniel Wood <[email protected]> *
# * Copyright (c) 2020-2024 Daniel Wood <[email protected]> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
Expand All @@ -24,7 +24,7 @@

import FreeCADGui
from PySide import QtGui
import PathFeedsAndSpeedsGui
import CAMFeedsAndSpeedsGui
import os

__dir__ = os.path.dirname(__file__)
Expand All @@ -35,38 +35,38 @@ def getIcon(iconName):

def updateMenu(workbench):

if workbench == 'PathWorkbench':
if workbench == 'CAMWorkbench':

print('Feeds and Speeds Addon loaded:', workbench)

mw = FreeCADGui.getMainWindow()
addonMenu = None

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

for menu in pathMenu.actions():
if menu.text() == "Path Addons":
if menu.text() == "CAM Addons":
# create a new addon menu
addonMenu = menu.menu()
break

if addonMenu is None:
addonMenu = QtGui.QMenu("Path Addons")
addonMenu.setObjectName("Path_Addons")
addonMenu = QtGui.QMenu("CAM Addons")
addonMenu.setObjectName("CAM_Addons")

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

#addonMenu.setTitle("Path Addons")
#addonMenu.setTitle("CAM Addons")
pathMenu.insertMenu(dressupMenu.menuAction(), addonMenu)

# create an action for this addon
action = QtGui.QAction(addonMenu)
action.setText("Feeds and Speeds")
action.setIcon(QtGui.QPixmap(getIcon('Path_FeedsAndSpeeds.svg')))
action.setIcon(QtGui.QPixmap(getIcon('CAM_FeedsAndSpeeds.svg')))
action.setStatusTip("Check Feeds and Speeds")
action.triggered.connect(PathFeedsAndSpeedsGui.Show)
action.triggered.connect(CAMFeedsAndSpeedsGui.Show)

# append this addon to addon menu
addonMenu.addAction(action)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# FreeCAD Feeds and Speeds Calculator
A FreeCAD Path Addon to help generate basic feeds and speeds for machining.
A FreeCAD CAM Addon to help generate basic feeds and speeds for machining.

## Description
This addon when installed will appear in the Path Workbench toolbar menu, the purpose of the addon is to define initial machining parameters
This addon when installed will appear in the CAM Workbench toolbar menu, the purpose of the addon is to define initial machining parameters
for the spindle speed and feedrate. This can be done by Spindle RPM or chipload (Feed Per Tooth).

## Features
* Select path tool controller
* Select tool controller
* Select workpiece material
* Select Tool Material
* Select tool material
* Set machining parameters
* write calculated feedrate and spindle speed to the selected tool controller
* Write calculated feedrate and spindle speed to the selected tool controller

## Requirements
* FreeCAD v0.20 or later
* Path Toolbit (Legacy tools not supported)
* FreeCAD v 1.0 or later
* CAM Toolbit (Legacy tools not supported)
* Python3
* Qt5

Expand All @@ -23,7 +23,7 @@ for the spindle speed and feedrate. This can be done by Spindle RPM or chipload
2. Restart FreeCAD

## Feedback
If you have feedback or need to report bugs please participate on the related [Path Forum](https://forum.freecadweb.org/viewforum.php?f=15).
If you have feedback or need to report bugs please participate on the related [CAM Forum](https://forum.freecadweb.org/viewforum.php?f=15).

## Disclaimer
This is an experimental tool and must be used at your own risk. Machine tools are dangerous and the author of this tool will not be responsible for any
Expand Down
8 changes: 4 additions & 4 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1">
<name>FeedsAndSpeeds</name>
<description>A FreeCAD Path Addon to help generate basic feeds and speeds for machining.</description>
<version>0.5</version>
<description>A FreeCAD CAM Addon to help generate basic feeds and speeds for machining.</description>
<version>0.6</version>
<maintainer email="[email protected]">Daniel Wood</maintainer>
<license file="LICENSE">LGPL-2.1</license>
<url type="repository" branch="master">https://github.com/dubstar-04/FeedsAndSpeeds</url>
Expand All @@ -12,8 +12,8 @@
<workbench>
<classname>FeedsAndSpeeds</classname>
<subdirectory>./</subdirectory>
<icon>Icons/Path_FeedsAndSpeeds.svg</icon>
<freecadmin>0.20.0</freecadmin>
<icon>Icons/CAM_FeedsAndSpeeds.svg</icon>
<freecadmin>1.0.0</freecadmin>
</workbench>
</content>

Expand Down

0 comments on commit c851c21

Please sign in to comment.