Skip to content

Commit 7d26ce5

Browse files
committed
continue comments
1 parent a08c40d commit 7d26ce5

10 files changed

+293
-367
lines changed

Actions/holeyCalibration.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ def ValidateMeasurement(self, Meas, idx):
8787

8888
def CutTestPattern(self):
8989
oldUnits = self.data.units
90-
#self.data.units = "MM"
91-
if oldUnits != "MM":
92-
self.data.actions.updateSetting("toMM", 0, True)
9390
self.data.console_queue.put('Cutting Holey Calibration Test Pattern')
9491
self.InitializeIdealXyCoordinates()
9592
self.data.gcode_queue.put("G21")
@@ -106,8 +103,8 @@ def CutTestPattern(self):
106103

107104
self.data.gcode_queue.put("G0 X0 Y0")
108105
self.data.gcode_queue.put("M5")
109-
if oldUnits != "MM":
110-
self.data.actions.updateSetting("toInches", 0, True)
106+
if oldUnits == "INCHES":
107+
self.data.gcode_queue.put("G20")
111108
return True
112109

113110
def CalculateMeasurements(self, HolePositions):

Actions/triangularCalibration.py

+16-49
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ class TriangularCalibration(MakesmithInitFuncs):
99
rotationRadiusEst = 0
1010

1111
def cutTriangularCalibrationPattern(self):
12+
'''
13+
Sends command to controller to cut the calibration pattern.
14+
:return:
15+
'''
1216

1317
workspaceHeight = float(
1418
self.data.config.getValue("Maslow Settings", "bedHeight")
1519
)
1620
workspaceWidth = float(self.data.config.getValue("Maslow Settings", "bedWidth"))
17-
oldUnits = self.data.units
1821

19-
#self.data.units = "MM"
20-
if oldUnits != "MM":
21-
self.data.actions.updateSetting("toMM", 0, True)
22+
# keep track of the units the machine is currently using to revert back if needed.
23+
oldUnits = self.data.units
2224

2325
self.data.gcode_queue.put("G21 ")
2426
self.data.gcode_queue.put("G90 ") # Switch to absolute mode
@@ -70,6 +72,11 @@ def cutTriangularCalibrationPattern(self):
7072

7173
self.data.gcode_queue.put("G90 ") # Switch back to absolute mode
7274
self.data.gcode_queue.put("G0 X0 Y0 ") # Move to home location
75+
76+
if oldUnits == "INCHES":
77+
# switch back to inches
78+
self.data.gcode_queue.put("G20 ") # Switch back to inches
79+
7380
return True
7481

7582

@@ -121,26 +128,6 @@ def calculate(self, result):
121128
)
122129
return False
123130

124-
"""
125-
if self.unitsBtnT.text == 'Units: inches':
126-
if (((distBetweenCuts12*25.4) > workspaceWidth) or ((distBetweenCuts12*25.4) < (workspaceWidth / 2))):
127-
self.data.message_queue.put('Message: The measurement between cut 1 and cut 2 of ' + str(distBetweenCuts12) + ' inches seems wrong.\n\nPlease check the number and enter it again.')
128-
return
129-
if (((distBetweenCuts34*25.4) > workspaceWidth) or ((distBetweenCuts34*25.4) < (workspaceWidth / 2))):
130-
self.data.message_queue.put('Message: The measurement between cut 3 and cut 4 of ' + str(distBetweenCuts34) + ' inches seems wrong.\n\nPlease check the number and enter it again.')
131-
return
132-
if (((distWorkareaTopToCut5*25.4) > (workspaceHeight/2)) or (distWorkareaTopToCut5 < 0)):
133-
self.data.message_queue.put('Message: The measurement between the top edge of the work area and cut 5 of ' + str(distWorkareaTopToCut5) + ' inches seems wrong.\n\nPlease check the number and enter it again.')
134-
return
135-
if ((bitDiameter > 1) or (bitDiameter < 0)):
136-
self.data.message_queue.put('Message: The bit diameter value of ' + str(bitDiameter) + ' inches seems wrong.\n\nPlease check the number and enter it again.')
137-
return
138-
distBetweenCuts12 *= 25.4
139-
distBetweenCuts34 *= 25.4
140-
distWorkareaTopToCut5 *= 25.4
141-
bitDiameter *= 25.4
142-
else:
143-
"""
144131
if True:
145132
if (distBetweenCuts12 > workspaceWidth) or (
146133
distBetweenCuts12 < (workspaceWidth / 2)
@@ -599,11 +586,6 @@ def calculate(self, result):
599586

600587
return False
601588

602-
# self.horzMeasureT1.disabled = True
603-
# self.horzMeasureT2.disabled = True
604-
# self.vertMeasureT1.disabled = True
605-
# self.enterValuesT.disabled = True
606-
607589
self.data.console_queue.put("Machine parameters found:")
608590

609591
motorYoffsetEst = (
@@ -628,19 +610,7 @@ def calculate(self, result):
628610
self.motorYoffsetEst = motorYoffsetEst
629611
self.rotationRadiusEst = rotationRadiusEst
630612
self.chainSagCorrectionEst = chainSagCorrectionEst
631-
# Update machine parameters
632-
"""
633-
self.data.config.setValue('Maslow Settings', 'motorOffsetY', str(motorYoffsetEst))
634-
self.data.config.setValue('Advanced Settings', 'rotationRadius', str(rotationRadiusEst))
635-
self.data.config.setValue('Advanced Settings', 'chainSagCorrection', str(chainSagCorrectionEst))
636613

637-
# With new calibration parameters return sled to workspace center
638-
639-
self.data.gcode_queue.put("G21 ")
640-
self.data.gcode_queue.put("G90 ")
641-
self.data.gcode_queue.put("G40 ")
642-
self.data.gcode_queue.put("G0 X0 Y0 ")
643-
"""
644614
return (
645615
motorYoffsetEst,
646616
rotationRadiusEst,
@@ -649,6 +619,10 @@ def calculate(self, result):
649619
)
650620

651621
def acceptTriangularCalibrationResults(self):
622+
'''
623+
Saves the values that were calculated.
624+
:return:
625+
'''
652626
self.data.config.setValue('Maslow Settings', 'motorOffsetY', str(self.motorYoffsetEst))
653627
self.data.config.setValue('Advanced Settings', 'rotationRadius', str(self.rotationRadiusEst))
654628
self.data.config.setValue('Advanced Settings', 'chainSagCorrection', str(self.chainSagCorrectionEst))
@@ -658,11 +632,4 @@ def acceptTriangularCalibrationResults(self):
658632
self.data.gcode_queue.put("G40 ")
659633
self.data.gcode_queue.put("G0 X0 Y0 ")
660634
return True
661-
662-
"""
663-
def switchUnitsT(self):
664-
if self.unitsBtnT.text == 'Units: mm':
665-
self.unitsBtnT.text = 'Units: inches'
666-
else:
667-
self.unitsBtnT.text = 'Units: mm'
668-
"""
635+

Background/LogStreamer.py

+2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ def start(self, _app):
2222
time.sleep(0.001)
2323
while (
2424
not self.app.data.alog_streamer_queue.empty() or not self.app.data.log_streamer_queue.empty()): # if there is new data to be read
25+
# process a line from the alog queue
2526
if not self.app.data.alog_streamer_queue.empty():
2627
message = self.app.data.alog_streamer_queue.get()
2728
if message != "":
2829
socketio.emit("message", {"log": "alog", "data": message, "dataFormat": "text"},
2930
namespace="/MaslowCNCLogs", )
31+
# process a line from the log queue
3032
if not self.app.data.log_streamer_queue.empty():
3133
message = self.app.data.log_streamer_queue.get()
3234
if message != "":

Background/WebMCPProcessor.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import time
55

66
class WebMCPProcessor(MakesmithInitFuncs):
7+
'''
8+
This class is deprecated as shifting away from WebMCP.
9+
'''
710

811
app = None
912

Background/controllerTask.py

-187
This file was deleted.

0 commit comments

Comments
 (0)