Skip to content

Commit df652b3

Browse files
committed
qtplasmac: fix translation error in pmx485_check
allow grid in P view
1 parent 79189a0 commit df652b3

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '1.236.297'
1+
VERSION = '1.236.298'
22

33
'''
44
qtplasmac_handler.py
@@ -24,7 +24,6 @@
2424
import os
2525
import sys
2626
from shutil import copy as COPY
27-
from shutil import move as MOVE
2827
from subprocess import Popen, PIPE
2928
from subprocess import run as RUN
3029
from subprocess import call as CALL
@@ -33,7 +32,6 @@
3332
import tarfile
3433
import math
3534
import glob
36-
import webbrowser
3735
import linuxcnc
3836
import hal
3937
from OpenGL.GL import glTranslatef
@@ -64,7 +62,7 @@
6462
from qtvcp.widgets.stylesheeteditor import StyleSheetEditor as SSE
6563
from qtvcp.lib.aux_program_loader import Aux_program_loader
6664
from plasmac import run_from_line as RFL
67-
from rs274.glcanon import GlCanonDraw
65+
from rs274.glcanon import GlCanonDraw as DRAW
6866
from qt5_graphics import Lcnc_3dGraphics as DRO
6967

7068
LOG = logger.getLogger(__name__)
@@ -463,6 +461,7 @@ def class_patch__(self):
463461
self.offset_table_patch()
464462
self.qt5_graphics_patch()
465463
self.screen_options_patch()
464+
self.glcanon_patch()
466465

467466
# patched file manager functions
468467
def file_manager_patch(self):
@@ -724,6 +723,18 @@ def new_process_error(self, w, kind, text):
724723
STATUS.emit('play-sound', 'SPEAK %s ' % text)
725724
STATUS.emit('update-machine-log', text, 'TIME')
726725

726+
# patched glcanon functions
727+
def glcanon_patch(self):
728+
self.old_draw_grid = DRAW.draw_grid
729+
DRAW.draw_grid = self.new_draw_grid
730+
731+
# allows grid to be drawn in P view
732+
def new_draw_grid(self):
733+
rotation = math.radians(STATUS.stat.rotation_xy % 90)
734+
permutation = lambda x_y_z2: (x_y_z2[0], x_y_z2[1], x_y_z2[2]) # XY Z
735+
inverse_permutation = lambda x_y_z3: (x_y_z3[0], x_y_z3[1], x_y_z3[2]) # XY Z
736+
self.w.gcodegraphics.draw_grid_permuted(rotation, permutation,
737+
inverse_permutation)
727738

728739
#########################################################################################################################
729740
# SPECIAL FUNCTIONS SECTION #
@@ -2044,7 +2055,7 @@ def view_t_pressed(self):
20442055
while time.time() < t:
20452056
QApplication.processEvents()
20462057
self.w.gcodegraphics.set_view('Z')
2047-
mid, size = GlCanonDraw.extents_info(self.w.gcodegraphics)
2058+
mid, size = DRAW.extents_info(self.w.gcodegraphics)
20482059
if self.gcodeProps:
20492060
mult = 1
20502061
if self.units == 'in' and self.gcodeProps['gcode_units'] == 'mm':
@@ -5322,7 +5333,7 @@ def pmx485_check(self, port, periodic=False):
53225333
return False
53235334
else:
53245335
if not periodic:
5325-
msg0 = _translate('cannot be found')
5336+
msg0 = _translate('HandlerClass', 'cannot be found')
53265337
STATUS.emit('error', linuxcnc.OPERATOR_ERROR, '{}:\n{} {}\n{}'.format(head, port, msg0, msg1))
53275338
return False
53285339
except:

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ <h2>QtPlasmaC Version History</h2>
3030
</table>
3131
<br>
3232
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
33+
<br><b><u>v1.236.298 2023 Nov 4</u></b>
34+
<ul style="margin:0;">
35+
<li>fix translation in pmx485_check</li>
36+
<li>allow grid in P view</li>
37+
</ul>
38+
<i>Changes submitted by snowgoer540 (Greg Carl)</i><br>
39+
3340
<br><b><u>v1.236.297 2023 Oct 31</u></b>
3441
<ul style="margin:0;">
3542
<li>prevent extra temporary material addition from conversational</li>

0 commit comments

Comments
 (0)