Skip to content

Commit

Permalink
Merge pull request #80 from Carvera-Community/0.5.0
Browse files Browse the repository at this point in the history
0.5.0
  • Loading branch information
SergeBakharev authored Nov 15, 2024
2 parents 8869540 + d4e6772 commit 1648cd0
Show file tree
Hide file tree
Showing 12 changed files with 137 additions and 62 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[0.5.0]
- Change: Replace Makera logos on icons.
- Change: Improved text on Diagnostics screen
- Change: Allow the use of '*' character in MDI
- Change: Use the command 'diagnose' instead of '*' to poll machine status. This makes the Diagnostics screen cross-compatible with Makera and Community firmware
- Fix: Actually use the Carvera-Community URL for loading this change log
- Enhancement: Confirm before entering laser mode
- Fix: Sliders in Diagnostics screen for Spindle Fan and Vacuum. Used to have broken UX requiring enabling and setting value within 2s. Now enable/disable toggles removed leaving slider to exclusively control value.
- Enhancement: Added Clamp and Unclamp buttons to the Tool Changer drop down
- Enhancement: Added bug report button to menu drop down. Please open github issues for any thing not working correctly.

[0.4.0]
- Fix: A axis rotation in the 3d viewer was incorrect. Previously was CW, not matching the machine since this was changed in FW 0.9.6
- Change: Increase the feed rate scaling range from 50-200 to 10-300. The stepping is still in 10% increments
Expand Down
27 changes: 18 additions & 9 deletions carveracontroller/Controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,20 +296,20 @@ def setSpindleSwitch(self, switch, rpm):
else:
self.executeCommand("M5\n")

def setVacuumSwitch(self, switch, power):
if switch:
def setVacuumPower(self, power=0):
if power > 0:
self.executeCommand("M801 S%d\n" % (power))
else:
self.executeCommand("M802\n")

def setSpindlefanSwitch(self, switch, power):
if switch:
def setSpindlefanPower(self, power=0):
if power > 0:
self.executeCommand("M811 S%d\n" % (power))
else:
self.executeCommand("M812\n")

def setLaserSwitch(self, switch, power):
if switch:
def setLaserPower(self, power=0):
if power > 0:
self.executeCommand("M3 S%g\n" % (power * 1.0 / 100))
else:
self.executeCommand("M5\n")
Expand Down Expand Up @@ -367,6 +367,12 @@ def dropToolCommand(self):
def calibrateToolCommand(self):
self.executeCommand("M491\n")

def clampToolCommand(self):
self.executeCommand("M490.1\n")

def unclampToolCommand(self):
self.executeCommand("M490.2\n")

def changeToolCommand(self, tool):
if tool == 'e':
self.executeCommand("M6T0\n")
Expand All @@ -392,7 +398,7 @@ def bufferChangeToolCommand(self, tool):
# escape special characters
# ------------------------------------------------------------------------------
def escape(self, value):
return value.replace('?', '\x02').replace('*', '\x03').replace('!', '\x04').replace('~', '\x05')
return value.replace('?', '\x02').replace('&', '\x03').replace('!', '\x04').replace('~', '\x05')

def lsCommand(self, ls_dir):
ls_command = "ls -e -s %s\n" % ls_dir.replace(' ', '\x01')
Expand Down Expand Up @@ -495,6 +501,10 @@ def estopCommand(self):
if self.stream:
self.stream.send(b'\x18')

def sendbugreport(self):
webbrowser.open('https://github.com/Carvera-Community/Carvera_Controller/issues')
webbrowser.open('https://github.com/Carvera-Community/Carvera_Community_Firmware/issues')

# ----------------------------------------------------------------------
def hardResetPre(self):
self.stream.send(b"reset\n")
Expand Down Expand Up @@ -712,8 +722,7 @@ def viewStatusReport(self, sio_status):

def viewDiagnoseReport(self, sio_diagnose):
if self.loadNUM == 0 and self.sendNUM == 0:
# self.stream.send(b"diagnose\n")
self.stream.send(b"*")
self.stream.send(b"diagnose\n")
self.sio_diagnose = sio_diagnose

# ----------------------------------------------------------------------
Expand Down
24 changes: 24 additions & 0 deletions carveracontroller/data/open_iconic_UI/ICON-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
All Open Iconic UI elements found in this folder are being used under the MIT License


The MIT License (MIT)

Copyright (c) 2014 Waybury

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Binary file added carveracontroller/data/open_iconic_UI/oi--bug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed carveracontroller/icon.ico
Binary file not shown.
Binary file added carveracontroller/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed carveracontroller/icon_square.ico
Binary file not shown.
70 changes: 35 additions & 35 deletions carveracontroller/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,9 +1253,7 @@ class Makera(RelativeLayout):
'laser_test': [0.0, 0],
'spindle_switch': [0.0, 0],
'spindle_slider': [0.0, 0],
'spindlefan_switch': [0.0, 0],
'spindlefan_slider': [0.0, 0],
'vacuum_switch': [0.0, 0],
'vacuum_slider': [0.0, 0],
'laser_switch': [0.0, 0],
'laser_slider': [0.0, 0],
Expand Down Expand Up @@ -2904,7 +2902,10 @@ def updateStatus(self, *args):
elapsed = now - self.control_list['laser_mode'][0]
if elapsed < 2:
if elapsed > 0.5:
self.controller.setLaserMode(self.control_list['laser_mode'][1])
if self.control_list['laser_mode'][1]:
self.enable_laser_mode_confirm_popup()
else:
self.controller.setLaserMode(False)
self.control_list['laser_mode'][0] = now - 2
elif elapsed > 3:
if self.laser_drop_down.switch.active != CNC.vars["lasermode"]:
Expand Down Expand Up @@ -3024,63 +3025,48 @@ def updateDiagnose(self, *args):
self.diagnose_popup.sl_spindle.slider.value = CNC.vars["sl_spindle"]

# control spindle fan
elapsed = now - self.control_list['spindlefan_switch'][0]
if elapsed < 2:
if elapsed > 0.5:
self.controller.setSpindlefanSwitch(self.control_list['spindlefan_switch'][1], self.diagnose_popup.sl_spindlefan.slider.value)
self.control_list['spindlefan_switch'][0] = now - 2
elif elapsed > 3:
if self.diagnose_popup.sw_spindlefan.switch.active != CNC.vars["sw_spindlefan"]:
self.diagnose_popup.sw_spindlefan.set_flag = True
self.diagnose_popup.sw_spindlefan.switch.active = CNC.vars["sw_spindlefan"]
self.diagnose_popup.sl_spindlefan.disabled = CNC.vars['lasermode']
elapsed = now - self.control_list['spindlefan_slider'][0]
if elapsed < 2:
if elapsed > 0.5:
self.controller.setSpindlefanSwitch(self.diagnose_popup.sw_spindlefan.switch.active, self.control_list['spindlefan_slider'][1])
self.controller.setSpindlefanPower(self.control_list['spindlefan_slider'][1])
self.control_list['spindlefan_slider'][0] = now - 2
elif elapsed > 3:
if self.diagnose_popup.sl_spindlefan.slider.value != CNC.vars["sl_spindlefan"]:
self.diagnose_popup.sl_spindlefan.set_flag = True
self.diagnose_popup.sl_spindlefan.slider.value = CNC.vars["sl_spindlefan"]

# control vacuum
elapsed = now - self.control_list['vacuum_switch'][0]
if elapsed < 2:
if elapsed > 0.5:
self.controller.setVacuumSwitch(self.control_list['vacuum_switch'][1],
self.diagnose_popup.sl_vacuum.slider.value)
self.control_list['vacuum_switch'][0] = now - 2
elif elapsed > 3:
if self.diagnose_popup.sw_vacuum.switch.active != CNC.vars["sw_vacuum"]:
self.diagnose_popup.sw_vacuum.set_flag = True
self.diagnose_popup.sw_vacuum.switch.active = CNC.vars["sw_vacuum"]
elapsed = now - self.control_list['vacuum_slider'][0]
if elapsed < 2:
if elapsed > 0.5:
self.controller.setVacuumSwitch(self.diagnose_popup.sw_vacuum.switch.active,
self.control_list['vacuum_slider'][1])
self.controller.setVacuumPower(self.control_list['vacuum_slider'][1])
self.control_list['vacuum_slider'][0] = now - 2
elif elapsed > 3:
if self.diagnose_popup.sl_vacuum.slider.value != CNC.vars["sl_vacuum"]:
self.diagnose_popup.sl_vacuum.set_flag = True
self.diagnose_popup.sl_vacuum.slider.value = CNC.vars["sl_vacuum"]

# control laser
self.diagnose_popup.sw_laser.disabled = not CNC.vars['lasermode']
self.diagnose_popup.sl_laser.disabled = not CNC.vars['lasermode']
# control laser mode
elapsed = now - self.control_list['laser_switch'][0]
if elapsed < 2:
if elapsed > 0.5:
self.controller.setLaserSwitch(self.control_list['laser_switch'][1], self.diagnose_popup.sl_laser.slider.value)
if self.diagnose_popup.sw_laser.switch.active:
self.enable_laser_mode_confirm_popup()
else:
self.controller.setLaserMode(False)
self.control_list['laser_switch'][0] = now - 2
elif elapsed > 3:
if self.diagnose_popup.sw_laser.switch.active != CNC.vars["sw_laser"]:
self.diagnose_popup.sw_laser.set_flag = True
self.diagnose_popup.sw_laser.switch.active = CNC.vars["sw_laser"]
if self.laser_drop_down.switch.active != CNC.vars["lasermode"]:
self.laser_drop_down.switch.set_flag = True
self.laser_drop_down.switch.active = CNC.vars["lasermode"]

# control laser slider
self.diagnose_popup.sl_laser.disabled = not CNC.vars['lasermode']
elapsed = now - self.control_list['laser_slider'][0]
if elapsed < 2:
if elapsed > 0.5:
self.controller.setLaserSwitch(self.diagnose_popup.sw_laser.switch.active, self.control_list['laser_slider'][1])
self.controller.setLaserPower(self.control_list['laser_slider'][1])
self.control_list['laser_slider'][0] = now - 2
elif elapsed > 3:
if self.diagnose_popup.sl_laser.slider.value != CNC.vars["sl_laser"]:
Expand Down Expand Up @@ -3178,6 +3164,7 @@ def openWIFI(self, address):
try:
self.controller.open(CONN_WIFI, address)
self.controller.connection_type = CONN_WIFI
self.store_machine_address(address.split(':')[0])
except:
print(sys.exc_info()[1])
self.updateStatus()
Expand Down Expand Up @@ -3325,6 +3312,9 @@ def open_setting_restore_confirm_popup(self):
def restoreSettings(self):
self.controller.restoreConfigCommand()

def enter_laser_mode(self):
self.controller.setLaserMode(True)

# -----------------------------------------------------------------------
def open_setting_default_confirm_popup(self):
self.confirm_popup.lb_title.text = tr._('Save As Default')
Expand All @@ -3333,6 +3323,16 @@ def open_setting_default_confirm_popup(self):
self.confirm_popup.cancel = None
self.confirm_popup.open(self)

def enable_laser_mode_confirm_popup(self):
self.confirm_popup.size_hint = (0.6, 0.7)
self.confirm_popup.pos_hint={'center_x': 0.5, 'center_y': 0.5}
self.confirm_popup.lb_title.text = tr._('Entering Laser Mode')
self.confirm_popup.lb_title.size_hint_y = None
self.confirm_popup.lb_content.text = tr._('You are about to enable laser mode. \n\nWhen enabled the current tool will be dropped, the spindle fan locked to 90%, \nand the empty spindle nose will be set as the tool and length probed.\n\n It\'s recommended to remove the laser dust cap, and put on safety glasses now.\n\nAre you read to proceed ?')
self.confirm_popup.confirm = partial(self.enter_laser_mode)
self.confirm_popup.cancel = None
self.confirm_popup.open(self)

# -----------------------------------------------------------------------
def defaultSettings(self):
self.controller.defaultConfigCommand()
Expand Down Expand Up @@ -3645,6 +3645,7 @@ def build(self):
self.settings_cls = SettingsWithSidebar
self.use_kivy_settings = True
self.title = tr._('Carvera Controller Community')
self.icon = os.path.join(os.path.dirname(__file__), 'icon.png')

return Makera(ctl_version=__version__)

Expand Down Expand Up @@ -3720,8 +3721,7 @@ def load_constants():
global LANGS

FW_UPD_ADDRESS = 'https://raw.githubusercontent.com/carvera-community/carvera_community_firmware/master/version.txt'
# CTL_UPD_ADDRESS = 'https://raw.githubusercontent.com/carvera-community/carvera_controller/main/CHANGELOG.md'
CTL_UPD_ADDRESS = 'https://raw.githubusercontent.com/MakeraInc/CarveraController/main/version.txt'
CTL_UPD_ADDRESS = 'https://raw.githubusercontent.com/carvera-community/carvera_controller/main/CHANGELOG.md'
DOWNLOAD_ADDRESS = 'https://github.com/carvera-community/carvera_controller/releases/latest'


Expand Down
Loading

0 comments on commit 1648cd0

Please sign in to comment.