|
260 | 260 | - Mapped save function to Control-S for easier g-code saving
|
261 | 261 |
|
262 | 262 | 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. |
263 | 267 | """
|
264 | 268 |
|
265 |
| -version = '1.65' |
| 269 | +version = '1.66' |
266 | 270 | #Setting QUIET to True will stop almost all console messages
|
267 | 271 | QUIET = False
|
268 | 272 |
|
@@ -295,6 +299,7 @@ def next(item):
|
295 | 299 | if PIL == True:
|
296 | 300 | try:
|
297 | 301 | from PIL import Image
|
| 302 | + Image.MAX_IMAGE_PIXELS = None |
298 | 303 | except:
|
299 | 304 | PIL = False
|
300 | 305 |
|
@@ -1559,7 +1564,7 @@ def DXF_COORDS_GET(self,new_origin=True):
|
1559 | 1564 | '''
|
1560 | 1565 | http://tkinter.unpythonic.net/wiki/ToolTip
|
1561 | 1566 |
|
1562 |
| -Michael Lange <klappnase (at) freakmail (dot) de> |
| 1567 | +ichael Lange <klappnase (at) freakmail (dot) de> |
1563 | 1568 | The ToolTip class provides a flexible tooltip widget for Tkinter; it is based on IDLE's ToolTip
|
1564 | 1569 | module which unfortunately seems to be broken (at least the version I saw).
|
1565 | 1570 | INITIALIZATION OPTIONS:
|
@@ -2873,7 +2878,10 @@ def WriteGCode(self,config_file=False):
|
2873 | 2878 | loopa_old = loopa
|
2874 | 2879 | else:
|
2875 | 2880 | loop = loop + 1
|
2876 |
| - Depth = float(self.maxcut.get()) |
| 2881 | + try: |
| 2882 | + Depth = float(self.maxcut.get()) |
| 2883 | + except: |
| 2884 | + Depth = 0.0 |
2877 | 2885 | if (rough_stock > 0):
|
2878 | 2886 | rough_again = True
|
2879 | 2887 | if ((rough_stock > 0) and(-maxDZ < rough_stock)):
|
@@ -3200,7 +3208,10 @@ def WRITE_CLEAN_UP(self,bit_type="straight"):
|
3200 | 3208 | BitDia = float(self.clean_dia.get())
|
3201 | 3209 |
|
3202 | 3210 | self.calc_depth_limit()
|
3203 |
| - Depth = float(self.maxcut.get()) |
| 3211 | + try: |
| 3212 | + Depth = float(self.maxcut.get()) |
| 3213 | + except: |
| 3214 | + Depth = 0.0 |
3204 | 3215 | if self.inlay.get():
|
3205 | 3216 | Depth = Depth + float(self.allowance.get())
|
3206 | 3217 |
|
@@ -3899,7 +3910,10 @@ def calc_r_inlay_top(self):
|
3899 | 3910 | return r_inlay_top
|
3900 | 3911 |
|
3901 | 3912 | 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 |
3903 | 3917 | return inlay_depth
|
3904 | 3918 |
|
3905 | 3919 |
|
@@ -6519,29 +6533,31 @@ def DoIt(self):
|
6519 | 6533 | miny = 99994.0
|
6520 | 6534 | minx = 99995.0
|
6521 | 6535 |
|
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 |
6545 | 6561 |
|
6546 | 6562 | maxr2 = 0.0
|
6547 | 6563 | for line in self.coords:
|
@@ -6800,6 +6816,7 @@ def get_flop_staus(self,CLEAN_FLAG=False):
|
6800 | 6816 |
|
6801 | 6817 | def V_Carve_It(self,clean_flag=0,DXF_FLAG = False):
|
6802 | 6818 | global STOP_CALC
|
| 6819 | + timestamp = 0 |
6803 | 6820 | self.master.unbind("<Configure>")
|
6804 | 6821 | STOP_CALC=0
|
6805 | 6822 |
|
@@ -7098,18 +7115,24 @@ def V_Carve_It(self,clean_flag=0,DXF_FLAG = False):
|
7098 | 7115 | break
|
7099 | 7116 | else:
|
7100 | 7117 | 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 | + |
7109 | 7119 | 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() |
7113 | 7136 |
|
7114 | 7137 | if STOP_CALC != 0:
|
7115 | 7138 | STOP_CALC=0
|
@@ -7512,11 +7535,19 @@ def sort_for_v_carve(self,sort_coords,LN_START=0):
|
7512 | 7535 | #####################################################
|
7513 | 7536 | # For each loop determine if other loops are inside #
|
7514 | 7537 | #####################################################
|
| 7538 | + timestamp = 0 |
| 7539 | + global STOP_CALC |
| 7540 | + STOP_CALC = 0 |
7515 | 7541 | for iloop in range(Nloops):
|
7516 | 7542 | CUR_PCT=float(iloop)/Nloops*100.0
|
7517 | 7543 | 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 [] |
7520 | 7551 | ipoly = ecoords[Lbeg[iloop]:Lend[iloop]]
|
7521 | 7552 |
|
7522 | 7553 | ## Check points in other loops (could just check one) ##
|
@@ -9419,7 +9450,10 @@ def temp_icon(icon_file_name):
|
9419 | 9450 |
|
9420 | 9451 |
|
9421 | 9452 | try:
|
9422 |
| - app.master.iconbitmap(bitmap="@emblem64") |
| 9453 | + try: |
| 9454 | + app.master.iconbitmap(r'emblem') |
| 9455 | + except: |
| 9456 | + app.master.iconbitmap(bitmap="@emblem64") |
9423 | 9457 | except:
|
9424 | 9458 | try: #Attempt to create temporary icon bitmap file
|
9425 | 9459 | temp_icon("f_engrave_icon")
|
|
0 commit comments