Skip to content

Commit

Permalink
update to v0.49
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhouser committed May 8, 2020
1 parent 3273809 commit edfafb1
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 45 deletions.
26 changes: 26 additions & 0 deletions Change_Log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,29 @@ Version 0.42:
- Fixed trace boundary when X and Y scaling is used
- Limited minimum speed entries to prevent unexpected laser movements.
- Fixed trace boundary space so that it scales with units change.

Version 0.43:
- Fixed problem that prevented properly sending EGV file to the laser.

Version 0.44:
- Removed unnecessary commands from data sent to laser. Reduced volume of data sent to laser.
- Improved pause function. Laser not stops immediately rather than waiting for buffer to empty.
- Added code to get around "Backend not found" error in some cases.

Version 0.45:
- Reverted back to egv.py file from Version 0.43 fixing problem with movements introduced in Version 0.44

Version 0.46:
- Fixed error in positioning when using g-code input and the input coordinate system
- Improved display of g-code errors and warnings
- Changed file selection default to g-code if the last file opened was g-code

Version 0.47:
- Updated to work with Inkscape 1.0
- Fixed mirroring when using input axes

Version 0.48:
- Fixed auto convert text to path when using older versions of Inkscape

Version 0.49:
- Added new default Inkscape executable path to the search list. So users don't need to specify the Inkscape location in the settings.
4 changes: 2 additions & 2 deletions build_macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ then

if [ "$PYINSTALLER" = true ]
then
VOLNAME=K40-Whisperer-${VERSION}-pyinstaller
else
VOLNAME=K40-Whisperer-${VERSION}
else
VOLNAME=K40-Whisperer-${VERSION}-pysetup
fi

rm ${VOLNAME}.dmg
Expand Down
15 changes: 12 additions & 3 deletions egv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'''
This script reads/writes egv format
Copyright (C) 2017-2019 Scorch www.scorchworks.com
Copyright (C) 2017-2020 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
Expand Down Expand Up @@ -326,10 +326,19 @@ def make_egv_data(self, ecoords_in,
lastx,lasty,last_loop = self.ecoord_adj(ecoords_in[0],scale,FlipXoffset)
if not Rapid_Feed_Rate:
self.make_dir_dist(lastx-startX,lasty-startY)

self.flush(laser_on=False)
self.write(ord("N"))
self.write(ord("R"))
self.write(ord("B"))
if lasty-startY <= 0:
self.write(self.DOWN)
else:
self.write(self.UP)

if lastx-startX >= 0:
self.write(self.RIGHT)
else:
self.write(self.LEFT)

# Insert "S1E"
self.write(ord("S"))
self.write(ord("1"))
Expand Down
Binary file modified emblem.icns
Binary file not shown.
103 changes: 83 additions & 20 deletions k40_whisperer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
K40 Whisperer
Copyright (C) <2017-2019> <Scorch>
Copyright (C) <2017-2020> <Scorch>
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
the Free Software Foundation, either version 3 of the License, or
Expand All @@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
version = '0.42'
version = '0.49'
title_text = "K40 Whisperer V"+version

import sys
Expand Down Expand Up @@ -100,7 +100,12 @@ def next(item):
except:
print("Unable to load Pyclipper library (Offset trace outline will not work without it)")
PYCLIPPER = False


try:
os.chdir(os.path.dirname(__file__))
except:
pass

QUIET = False

# macOS Patch - Stephen Houser ([email protected])
Expand Down Expand Up @@ -1761,11 +1766,21 @@ def menu_File_Open_Design(self,event=None):
if ( not os.path.isdir(init_dir) ):
init_dir = self.HOME_DIR

fileselect = askopenfilename(filetypes=[("Design Files", ("*.svg","*.dxf")),
("G-Code Files", ("*.ngc","*.gcode","*.g","*.tap")),\
("DXF Files","*.dxf"),\
("SVG Files","*.svg"),\
("All Files","*"),\
design_types = ("Design Files", ("*.svg","*.dxf"))
gcode_types = ("G-Code Files", ("*.ngc","*.gcode","*.g","*.tap"))

Name, fileExtension = os.path.splitext(self.DESIGN_FILE)
TYPE=fileExtension.upper()
if TYPE != '.DXF' and TYPE!='.SVG' and TYPE!='.EGV':
default_types = gcode_types
else:
default_types = design_types

fileselect = askopenfilename(filetypes=[default_types,
("G-Code Files ", ("*.ngc","*.gcode","*.g","*.tap")),\
("DXF Files ","*.dxf"),\
("SVG Files ","*.svg"),\
("All Files ","*"),\
("Design Files ", ("*.svg","*.dxf"))],\
initialdir=init_dir)

Expand Down Expand Up @@ -1848,7 +1863,6 @@ def menu_File_save_EGV(self,operation_type=None,default_name="out.EGV"):


def menu_File_Open_EGV(self):
self.stop[0]=False
init_dir = os.path.dirname(self.DESIGN_FILE)
if ( not os.path.isdir(init_dir) ):
init_dir = self.HOME_DIR
Expand All @@ -1859,11 +1873,9 @@ def menu_File_Open_EGV(self):
self.resetPath()
self.DESIGN_FILE = fileselect
self.EGV_Send_Window(fileselect)
self.stop[0]=True
#self.Finish_Job()

def Open_EGV(self,filemname,n_passes=1):
pass
self.stop[0]=False
EGV_data=[]
value1 = ""
value2 = ""
Expand Down Expand Up @@ -1945,6 +1957,7 @@ def Open_EGV(self,filemname,n_passes=1):
dxmils = -(x_end_mils - x_start_mils)
dymils = y_end_mils - y_start_mils
self.Send_Rapid_Move(dxmils,dxmils)
self.stop[0]=True


def Open_SVG(self,filemname):
Expand Down Expand Up @@ -2279,6 +2292,46 @@ def convert_halftoning(self,image):

#######################################################################

def gcode_error_message(self,message):
error_report = Toplevel(width=525,height=60)
error_report.title("G-Code Reading Errors/Warnings")
error_report.iconname("G-Code Errors")
error_report.grab_set()
return_value = StringVar()
return_value.set("none")

try:
error_report.iconbitmap(bitmap="@emblem64")
except:
debug_message(traceback.format_exc())
pass

def Close_Click(event):
return_value.set("close")
error_report.destroy()

#Text Box
Error_Frame = Frame(error_report)
scrollbar = Scrollbar(Error_Frame, orient=VERTICAL)
Error_Text = Text(Error_Frame, width="80", height="20",yscrollcommand=scrollbar.set,bg='white')
for line in message:
Error_Text.insert(END,line+"\n")
scrollbar.config(command=Error_Text.yview)
scrollbar.pack(side=RIGHT,fill=Y)
#End Text Box

Button_Frame = Frame(error_report)
close_button = Button(Button_Frame,text=" Close ")
close_button.bind("<ButtonRelease-1>", Close_Click)
close_button.pack(side=RIGHT,fill=X)

Error_Text.pack(side=LEFT,fill=BOTH,expand=1)
Button_Frame.pack(side=BOTTOM)
Error_Frame.pack(side=LEFT,fill=BOTH,expand=1)

root.wait_window(error_report)
return return_value.get()

def Open_G_Code(self,filename):
self.resetPath()

Expand All @@ -2287,9 +2340,8 @@ def Open_G_Code(self,filename):
MSG = g_rip.Read_G_Code(filename, XYarc2line = True, arc_angle=2, units="in", Accuracy="")
Error_Text = ""
if MSG!=[]:
for line in MSG:
Error_Text = Error_Text + line + "\n"
message_box("G-Code Messages", Error_Text)
self.gcode_error_message(MSG)

#except StandardError as e:
except Exception as e:
msg1 = "G-Code Load Failed: "
Expand Down Expand Up @@ -3319,7 +3371,12 @@ def mirror_rotate_vector_coords(self,coords):
for i in range(len(coords)):
coords_rotate_mirror.append(coords[i][:])
if self.mirror.get():
coords_rotate_mirror[i][0]=xmin+xmax-coords_rotate_mirror[i][0]
if self.inputCSYS.get() and self.RengData.image == None:
coords_rotate_mirror[i][0]=-coords_rotate_mirror[i][0]
else:
coords_rotate_mirror[i][0]=xmin+xmax-coords_rotate_mirror[i][0]


if self.rotate.get():
x = coords_rotate_mirror[i][0]
y = coords_rotate_mirror[i][1]
Expand Down Expand Up @@ -3691,8 +3748,14 @@ def Stop(self,event=None):
line1 = "Sending data to the laser from K40 Whisperer is currently Paused."
line2 = "Press \"OK\" to abort any jobs currently running."
line3 = "Press \"Cancel\" to resume."
if self.k40 != None:
self.k40.pause_un_pause()

if message_ask_ok_cancel("Stop Laser Job.", "%s\n\n%s\n%s" %(line1,line2,line3)):
self.stop[0]=True
else:
if self.k40 != None:
self.k40.pause_un_pause()

def Hide_Advanced(self,event=None):
self.advanced.set(0)
Expand Down Expand Up @@ -5634,13 +5697,13 @@ def Set_Value(other=None,width=None,height=None):
Title_Text0 = Label(master, text=t0+t1+t2, anchor=W)
Title_Text1 = Label(master, text=t3, anchor=W)

Radio_SVG_pxpi_96 = Radiobutton(master,text=" 96 px/in", value="96")
Radio_SVG_pxpi_96 = Radiobutton(master,text=" 96 units/in", value="96")
Label_SVG_pxpi_96 = Label(master,text="(File saved with Inkscape v0.92 or newer)", anchor=W)

Radio_SVG_pxpi_90 = Radiobutton(master,text=" 90 px/in", value="90")
Radio_SVG_pxpi_90 = Radiobutton(master,text=" 90 units/in", value="90")
Label_SVG_pxpi_90 = Label(master,text="(File saved with Inkscape v0.91 or older)", anchor=W)

Radio_SVG_pxpi_72 = Radiobutton(master,text=" 72 px/in", value="72")
Radio_SVG_pxpi_72 = Radiobutton(master,text=" 72 units/in", value="72")
Label_SVG_pxpi_72 = Label(master,text="(File saved with Adobe Illustrator)", anchor=W)

Radio_Res_Custom = Radiobutton(master,text=" Custom:", value="custom")
Expand All @@ -5649,7 +5712,7 @@ def Set_Value(other=None,width=None,height=None):

Entry_Custom_pxpi = Entry(master,width="10")
Entry_Custom_pxpi.configure(textvariable=self.other)
Label_pxpi_units = Label(master,text="px/in", anchor=W)
Label_pxpi_units = Label(master,text="units/in", anchor=W)
self.trace_id_pxpi = self.other.trace_variable("w", Entry_custom_Callback)

Label_Width = Label(master,text="Width", anchor=W)
Expand Down
26 changes: 13 additions & 13 deletions macOS.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--- K40_Whisperer-0.41_src/k40_whisperer.py 2019-12-06 19:54:12.000000000 -0500
+++ k40_whisperer.py 2019-12-09 18:54:44.000000000 -0500
@@ -102,7 +102,35 @@
PYCLIPPER = False
--- K40_Whisperer-0.49_src/k40_whisperer.py 2020-05-07 21:36:44.000000000 -0400
+++ k40_whisperer.py 2020-05-08 13:18:34.000000000 -0400
@@ -107,7 +107,35 @@
pass

QUIET = False
-
+
Expand Down Expand Up @@ -37,7 +37,7 @@
################################################################################
class Application(Frame):
def __init__(self, master):
@@ -553,6 +581,14 @@
@@ -561,6 +589,14 @@

self.Label_GoToX = Label(self.master,text="X", anchor=CENTER )
self.Label_GoToY = Label(self.master,text="Y", anchor=CENTER )
Expand All @@ -52,7 +52,7 @@
###########################################################################
# End Left Column #

@@ -3742,7 +3778,10 @@
@@ -3849,7 +3885,10 @@
U_display))

self.statusbar.configure( bg = 'white' )
Expand All @@ -64,7 +64,7 @@
def menu_Inside_First_Callback(self, varName, index, mode):
if self.GcodeData.ecoords != []:
if self.VcutData.sorted == True:
@@ -4646,7 +4685,8 @@
@@ -4754,7 +4793,8 @@
xd_label_L = 12

w_label=150
Expand All @@ -74,7 +74,7 @@
w_units=45
xd_entry_L=xd_label_L+w_label+10
xd_units_L=xd_entry_L+w_entry+5
@@ -4876,6 +4916,9 @@
@@ -4984,6 +5024,9 @@
xd_entry_L=xd_label_L+w_label+10
xd_units_L=xd_entry_L+w_entry+5

Expand All @@ -84,7 +84,7 @@


D_Yloc=D_Yloc+D_dY
@@ -5200,7 +5243,8 @@
@@ -5308,7 +5351,8 @@
xd_label_L = 12

w_label=150
Expand All @@ -94,7 +94,7 @@
w_units=35
xd_entry_L=xd_label_L+w_label+10
xd_units_L=xd_entry_L+w_entry+5
@@ -5246,6 +5290,9 @@
@@ -5354,6 +5398,9 @@

self.EGV_Send = Button(egv_send,text="Send EGV Data",command=Close_and_Send_Click)
self.EGV_Send.place(x=Xbut, y=Ybut, width=130, height=30, anchor="w")
Expand All @@ -104,7 +104,7 @@
################################################################################


@@ -5343,6 +5390,8 @@
@@ -5451,6 +5498,8 @@

def apply(self):
self.result = self.uom.get()
Expand All @@ -113,7 +113,7 @@
return


@@ -5670,4 +5719,7 @@
@@ -5778,4 +5827,7 @@
app.master.geometry("480x320")


Expand Down
Loading

0 comments on commit edfafb1

Please sign in to comment.