From 81fd4f9d44506dbbb0d2ad828c66458f5ca0f9fe Mon Sep 17 00:00:00 2001 From: Ricardo Sanz Date: Fri, 6 Jan 2023 20:32:08 +0100 Subject: [PATCH] Add 0.61 and 0.62 changeset --- Change_Log.txt | 11 ++++++++++- egv.py | 8 +++++--- nano_library.py | 31 ++++++++++++++++++++----------- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/Change_Log.txt b/Change_Log.txt index 7480db8..3726a1d 100644 --- a/Change_Log.txt +++ b/Change_Log.txt @@ -301,4 +301,13 @@ Version 0.59: Version 0.60: - Fixed scaling problem when loading an SVG file with 'Reduced Memory Use' enabled. - The problem only occurred if the user was prompted for additional scaling information. \ No newline at end of file + The problem only occurred if the user was prompted for additional scaling information. + +Version 0.61: +- Added option in the General Settings to disable waiting for the laser to finish the job after the last data has been sent to the laser. This can be used to allow the user to start loading the next design as the laser finishes executing the the final data. + +Version 0.62: +- Fixed problem when using M3 Nano board, new job finished code is now detected. +- Fixed problem when using M3 Nano board, laser no longer remains on while moving back to starting position after raster engraving. +- Fixed registration issue between raster and vector operations when custom rapid speed was used. +- Added Option in the Tools menu that may unfreeze the controller after a job is improperly terminated (will not always work) \ No newline at end of file diff --git a/egv.py b/egv.py index 070845a..85cd829 100644 --- a/egv.py +++ b/egv.py @@ -2,7 +2,7 @@ ''' This script reads/writes egv format -Copyright (C) 2017-2020 Scorch www.scorchworks.com +Copyright (C) 2017-2022 Scorch www.scorchworks.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -682,6 +682,7 @@ def change_speed(self,Feed,board_name,laser_on=False,Raster_step=0,pad=True): self.write(ord("S")) self.write(ord("1")) self.write(ord("E")) + self.write(ord("U")) if pad: self.make_dir_dist(cspad,cspad) @@ -695,10 +696,11 @@ def strip_redundant_codes(self, EGV_data): new_data=[] modal_value = -1 for code in EGV_data: - if code == modal_value: + if code == modal_value and modal_value != E: continue elif (code == self.RIGHT) or (code == self.LEFT) or \ - (code == self.UP ) or (code == self.DOWN) or (code == E): + (code == self.UP ) or (code == self.DOWN) or \ + (code == self.ANGLE) or (code == E): modal_value = code new_data.append(code) return new_data diff --git a/nano_library.py b/nano_library.py index d86107f..414b566 100644 --- a/nano_library.py +++ b/nano_library.py @@ -2,7 +2,7 @@ ''' This script comunicated with the K40 Laser Cutter. -Copyright (C) 2017-2021 Scorch www.scorchworks.com +Copyright (C) 2017-2022 Scorch www.scorchworks.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,11 +45,12 @@ def __init__(self): self.read_length= 168 #### RESPONSE CODES #### - self.OK = 206 - self.BUFFER_FULL = 238 - self.CRC_ERROR = 207 - self.TASK_COMPLETE = 236 - self.UNKNOWN_2 = 239 #after failed initialization followed by succesful initialization + self.OK = 206 + self.BUFFER_FULL = 238 + self.CRC_ERROR = 207 + self.TASK_COMPLETE = 236 + self.UNKNOWN_2 = 239 #after failed initialization followed by succesful initialization + self.TASK_COMPLETE_M3 = 204 ####################### self.hello = [160] self.unlock = [166,0,73,83,50,80,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,166,15] @@ -98,10 +99,11 @@ def say_hello(self): else: print (".",) - if response[1]==self.OK or \ - response[1]==self.BUFFER_FULL or \ - response[1]==self.CRC_ERROR or \ - response[1]==self.TASK_COMPLETE or \ + if response[1]==self.OK or \ + response[1]==self.BUFFER_FULL or \ + response[1]==self.CRC_ERROR or \ + response[1]==self.TASK_COMPLETE or \ + response[1]==self.TASK_COMPLETE_M3 or \ response[1]==self.UNKNOWN_2: return response[1] else: @@ -132,6 +134,13 @@ def pause_un_pause(self): self.send_data([ord('P'),ord('N')]) except: pass + + def unfreeze(self): + try: + self.send_data([ord('F'),ord('N'),ord('S'),ord('E')]) + print("unfreeze sent") + except: + pass ####################################################################### @@ -287,7 +296,7 @@ def wait_for_laser_to_finish(self,update_gui=None,stop_calc=None): FINISHED = False while not FINISHED: response = self.say_hello() - if response == self.TASK_COMPLETE: + if response == self.TASK_COMPLETE or response == self.TASK_COMPLETE_M3: FINISHED = True break elif response == None: