Skip to content

Commit 85dc78a

Browse files
committed
Update to v1.66
1 parent ea0c40b commit 85dc78a

File tree

5 files changed

+82
-47
lines changed

5 files changed

+82
-47
lines changed

build.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ rem This file executes the build command for the windows executable file.
33
rem It is here because I am lazy
44
rem ---------------------------------------------------------------------
55

6-
set PATH=C:\Python25;%PATH%
6+
set PATH=C:\Python26;%PATH%
77
python py2exe_setup.py py2exe
88
rmdir /S build
99

f-engrave.py

+76-42
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,13 @@
260260
- Mapped save function to Control-S for easier g-code saving
261261
262262
Version 1.65 - Fixed bug in sort_for_v_carve that resulted in an error for certain designs.
263+
264+
Version 1.66 - Fixed a problem with the origin when wrapping text in some cases.
265+
- Decreased number of updates while doing computations which increases overall calculation speed.
266+
- Fixed problem that can cause the program to freeze if the saved settings contain errors.
263267
"""
264268

265-
version = '1.65'
269+
version = '1.66'
266270
#Setting QUIET to True will stop almost all console messages
267271
QUIET = False
268272

@@ -295,6 +299,7 @@ def next(item):
295299
if PIL == True:
296300
try:
297301
from PIL import Image
302+
Image.MAX_IMAGE_PIXELS = None
298303
except:
299304
PIL = False
300305

@@ -1559,7 +1564,7 @@ def DXF_COORDS_GET(self,new_origin=True):
15591564
'''
15601565
http://tkinter.unpythonic.net/wiki/ToolTip
15611566
1562-
Michael Lange <klappnase (at) freakmail (dot) de>
1567+
ichael Lange <klappnase (at) freakmail (dot) de>
15631568
The ToolTip class provides a flexible tooltip widget for Tkinter; it is based on IDLE's ToolTip
15641569
module which unfortunately seems to be broken (at least the version I saw).
15651570
INITIALIZATION OPTIONS:
@@ -2873,7 +2878,10 @@ def WriteGCode(self,config_file=False):
28732878
loopa_old = loopa
28742879
else:
28752880
loop = loop + 1
2876-
Depth = float(self.maxcut.get())
2881+
try:
2882+
Depth = float(self.maxcut.get())
2883+
except:
2884+
Depth = 0.0
28772885
if (rough_stock > 0):
28782886
rough_again = True
28792887
if ((rough_stock > 0) and(-maxDZ < rough_stock)):
@@ -3200,7 +3208,10 @@ def WRITE_CLEAN_UP(self,bit_type="straight"):
32003208
BitDia = float(self.clean_dia.get())
32013209

32023210
self.calc_depth_limit()
3203-
Depth = float(self.maxcut.get())
3211+
try:
3212+
Depth = float(self.maxcut.get())
3213+
except:
3214+
Depth = 0.0
32043215
if self.inlay.get():
32053216
Depth = Depth + float(self.allowance.get())
32063217

@@ -3899,7 +3910,10 @@ def calc_r_inlay_top(self):
38993910
return r_inlay_top
39003911

39013912
def calc_r_inlay_depth(self):
3902-
inlay_depth = float(self.maxcut.get())
3913+
try:
3914+
inlay_depth = float(self.maxcut.get())
3915+
except:
3916+
inlay_depth = 0.0
39033917
return inlay_depth
39043918

39053919

@@ -6519,29 +6533,31 @@ def DoIt(self):
65196533
miny = 99994.0
65206534
minx = 99995.0
65216535

6522-
if Angle == 0.0:
6523-
if flip_flag:
6524-
miny = -font_line_height*YScale
6525-
else:
6526-
maxy = font_line_height*YScale
6527-
6528-
elif (Angle == 90.0) or (Angle == -270.0):
6529-
if not mirror_flag:
6530-
minx = -font_line_height*YScale
6531-
else:
6532-
maxx = font_line_height*YScale
6533-
6534-
elif (Angle == 270.0) or (Angle == -90.0):
6535-
if not mirror_flag:
6536-
maxx = font_line_height*YScale
6537-
else:
6538-
minx = -font_line_height*YScale
6539-
6540-
elif (Angle == 180.0) or (Angle == -180.0):
6541-
if flip_flag:
6542-
maxy = font_line_height*YScale
6543-
else:
6544-
miny = -font_line_height*YScale
6536+
## ## Commented this section out in Version 1.66
6537+
## if Radius == 0.0:
6538+
## if Angle == 0.0:
6539+
## if flip_flag:
6540+
## miny = -font_line_height*YScale
6541+
## else:
6542+
## maxy = font_line_height*YScale
6543+
##
6544+
## elif (Angle == 90.0) or (Angle == -270.0):
6545+
## if not mirror_flag:
6546+
## minx = -font_line_height*YScale
6547+
## else:
6548+
## maxx = font_line_height*YScale
6549+
##
6550+
## elif (Angle == 270.0) or (Angle == -90.0):
6551+
## if not mirror_flag:
6552+
## maxx = font_line_height*YScale
6553+
## else:
6554+
## minx = -font_line_height*YScale
6555+
##
6556+
## elif (Angle == 180.0) or (Angle == -180.0):
6557+
## if flip_flag:
6558+
## maxy = font_line_height*YScale
6559+
## else:
6560+
## miny = -font_line_height*YScale
65456561

65466562
maxr2 = 0.0
65476563
for line in self.coords:
@@ -6800,6 +6816,7 @@ def get_flop_staus(self,CLEAN_FLAG=False):
68006816

68016817
def V_Carve_It(self,clean_flag=0,DXF_FLAG = False):
68026818
global STOP_CALC
6819+
timestamp = 0
68036820
self.master.unbind("<Configure>")
68046821
STOP_CALC=0
68056822

@@ -7098,18 +7115,24 @@ def V_Carve_It(self,clean_flag=0,DXF_FLAG = False):
70987115
break
70997116
else:
71007117
calc_flag = self.clean_segment[CUR_CNT]
7101-
####################################################
7102-
CUR_PCT=float(CUR_LENGTH)/TOT_LENGTH*100.0
7103-
if CUR_PCT > 0.0:
7104-
MIN_REMAIN =( time()-START_TIME )/60 * (100-CUR_PCT)/CUR_PCT
7105-
MIN_TOTAL = 100.0/CUR_PCT * ( time()-START_TIME )/60
7106-
else:
7107-
MIN_REMAIN = -1
7108-
MIN_TOTAL = -1
7118+
71097119
if (not self.batch.get()):
7110-
self.statusMessage.set('%.1f %% ( %.1f Minutes Remaining | %.1f Minutes Total )' %( CUR_PCT, MIN_REMAIN, MIN_TOTAL ) )
7111-
self.statusbar.configure( bg = 'yellow' )
7112-
self.PreviewCanvas.update()
7120+
stamp=int(3*time()) #update every 1/3 of a second
7121+
if (stamp != timestamp):
7122+
timestamp=stamp #interlock
7123+
7124+
####################################################
7125+
CUR_PCT=float(CUR_LENGTH)/TOT_LENGTH*100.0
7126+
if CUR_PCT > 0.0:
7127+
MIN_REMAIN =( time()-START_TIME )/60 * (100-CUR_PCT)/CUR_PCT
7128+
MIN_TOTAL = 100.0/CUR_PCT * ( time()-START_TIME )/60
7129+
else:
7130+
MIN_REMAIN = -1
7131+
MIN_TOTAL = -1
7132+
7133+
self.statusMessage.set('%.1f %% ( %.1f Minutes Remaining | %.1f Minutes Total )' %( CUR_PCT, MIN_REMAIN, MIN_TOTAL ) )
7134+
self.statusbar.configure( bg = 'yellow' )
7135+
self.PreviewCanvas.update()
71137136

71147137
if STOP_CALC != 0:
71157138
STOP_CALC=0
@@ -7512,11 +7535,19 @@ def sort_for_v_carve(self,sort_coords,LN_START=0):
75127535
#####################################################
75137536
# For each loop determine if other loops are inside #
75147537
#####################################################
7538+
timestamp = 0
7539+
global STOP_CALC
7540+
STOP_CALC = 0
75157541
for iloop in range(Nloops):
75167542
CUR_PCT=float(iloop)/Nloops*100.0
75177543
if (not self.batch.get()):
7518-
self.statusMessage.set('Determining Which Side of Loop to Cut: %d of %d' %(iloop+1,Nloops))
7519-
self.master.update()
7544+
stamp=int(3*time()) #update every 1/3 of a second
7545+
if (stamp != timestamp):
7546+
timestamp=stamp #interlock
7547+
self.statusMessage.set('Determining Which Side of Loop to Cut: %d of %d' %(iloop+1,Nloops))
7548+
self.master.update()
7549+
if STOP_CALC != 0:
7550+
return []
75207551
ipoly = ecoords[Lbeg[iloop]:Lend[iloop]]
75217552

75227553
## Check points in other loops (could just check one) ##
@@ -9419,7 +9450,10 @@ def temp_icon(icon_file_name):
94199450

94209451

94219452
try:
9422-
app.master.iconbitmap(bitmap="@emblem64")
9453+
try:
9454+
app.master.iconbitmap(r'emblem')
9455+
except:
9456+
app.master.iconbitmap(bitmap="@emblem64")
94239457
except:
94249458
try: #Attempt to create temporary icon bitmap file
94259459
temp_icon("f_engrave_icon")

fengrave.ico

126 KB
Binary file not shown.

py2exe_setup.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import shutil
66
import py2exe
77

8-
script_name = "f-engrave-165.py"
8+
script_name = "f-engrave.py"
9+
icon_name = "fengrave.ico"
910

1011
fileName, fileExtension = os.path.splitext(script_name)
1112
console_name = fileName+"_c"+fileExtension
@@ -17,7 +18,7 @@
1718
windows = [
1819
{
1920
"script": script_name,
20-
"icon_resources":[(0,"fengrave.ico"),(0,"fengrave.ico")]
21+
"icon_resources":[(0,icon_name),(0,icon_name)]
2122
}
2223
],
2324
)
@@ -28,7 +29,7 @@
2829
console=[
2930
{
3031
"script":console_name,
31-
"icon_resources":[(0,"fengrave.ico"),(0,"fengrave.ico")]
32+
"icon_resources":[(0,icon_name),(0,icon_name)]
3233
}
3334
]
3435
)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from setuptools import setup
1212

1313
mainscript = 'f-engrave.py'
14-
version = "1.65"
14+
version = "1.66"
1515
url = "https://github.com/stephenhouser/f-engrave"
1616

1717
if sys.platform == 'darwin':

0 commit comments

Comments
 (0)