Skip to content

Commit

Permalink
use the surface speed overide value in calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
dubstar-04 committed Jul 11, 2021
1 parent b0ba9d7 commit bfcc8a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions PathFeedsAndSpeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ def get_surface_speed(self):
def set_material(self, material):
self.material = material

def calculate(self, tool):
def calculate(self, tool, surfaceSpeed):

materials = load_materials()
surfaceSpeed = self.get_surface_speed()
# surfaceSpeed = self.get_surface_speed()
Kp = next(item for item in materials if item["material"] == self.material).get("kp")
# C = Power Constant
C = getInterpolatedValue(load_powerConstant(), self.feedPerTooth)
Expand Down
14 changes: 6 additions & 8 deletions PathFeedsAndSpeedsGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ def __init__(self):
self.calculate()

# connect
self.form.material_CB.currentIndexChanged.connect(self.set_surface_speed)
self.form.material_CB.currentIndexChanged.connect(self.set_material)
self.form.hss_RB.toggled.connect(self.calculate)
self.form.cbd_RB.toggled.connect(self.calculate)
self.form.toolDia_LE.textChanged.connect(self.calculate)
self.form.flutes_SB.valueChanged.connect(self.calculate)
self.form.FPT_SB.valueChanged.connect(self.calculate)
self.form.WOC_SP.textChanged.connect(self.calculate)
self.form.DOC_SP.textChanged.connect(self.calculate)
self.form.ss_LE.textChanged.connect(self.calculate)
self.form.rpm_LE.textChanged.connect(self.calculate)
self.form.toolController_CB.currentIndexChanged.connect(self.load_tool_properties)
self.form.update_PB.clicked.connect(self.update_tool_controller)
Expand All @@ -55,7 +56,7 @@ def setup_ui(self):
self.load_tools()
self.load_tool_properties()
self.set_tool_material()
self.set_surface_speed()
self.set_material()

def set_tool_properties(self, dia, flutes, chipload, material):
self.form.toolDia_LE.setText(str(dia))
Expand All @@ -70,14 +71,10 @@ def set_tool_properties(self, dia, flutes, chipload, material):
elif material == "Carbide":
self.form.cbd_RB.setChecked(True)

def set_surface_speed(self):
def set_material(self):
material = self.form.material_CB.currentText()

self.calculation.set_material(material)

ss = self.calculation.get_surface_speed()
print("Surface Speed:", ss, material)

self.form.ss_LE.setText(str(ss))
self.calculate

Expand Down Expand Up @@ -133,6 +130,7 @@ def calculate(self):
tool = PathFeedsAndSpeeds.Tool()

self.calculation.rpm_overide = self.form.rpm_LE.text()
surfaceSpeed = float(self.form.ss_LE.text())

if not self.form.rpm_LE.text() == "":
self.form.rpm_result.setEnabled(False)
Expand All @@ -150,7 +148,7 @@ def calculate(self):
if not self.calculation.feedPerTooth:
return

rpm, hfeed, vfeed, Hp = self.calculation.calculate(tool)
rpm, hfeed, vfeed, Hp = self.calculation.calculate(tool, surfaceSpeed)
watts = Hp * 745.69

self.form.rpm_result.setText(str(rpm))
Expand Down

0 comments on commit bfcc8a2

Please sign in to comment.