|
1 | | -VERSION = '1.236.297' |
| 1 | +VERSION = '1.236.298' |
2 | 2 |
|
3 | 3 | ''' |
4 | 4 | qtplasmac_handler.py |
|
24 | 24 | import os |
25 | 25 | import sys |
26 | 26 | from shutil import copy as COPY |
27 | | -from shutil import move as MOVE |
28 | 27 | from subprocess import Popen, PIPE |
29 | 28 | from subprocess import run as RUN |
30 | 29 | from subprocess import call as CALL |
|
33 | 32 | import tarfile |
34 | 33 | import math |
35 | 34 | import glob |
36 | | -import webbrowser |
37 | 35 | import linuxcnc |
38 | 36 | import hal |
39 | 37 | from OpenGL.GL import glTranslatef |
|
64 | 62 | from qtvcp.widgets.stylesheeteditor import StyleSheetEditor as SSE |
65 | 63 | from qtvcp.lib.aux_program_loader import Aux_program_loader |
66 | 64 | from plasmac import run_from_line as RFL |
67 | | -from rs274.glcanon import GlCanonDraw |
| 65 | +from rs274.glcanon import GlCanonDraw as DRAW |
68 | 66 | from qt5_graphics import Lcnc_3dGraphics as DRO |
69 | 67 |
|
70 | 68 | LOG = logger.getLogger(__name__) |
@@ -463,6 +461,7 @@ def class_patch__(self): |
463 | 461 | self.offset_table_patch() |
464 | 462 | self.qt5_graphics_patch() |
465 | 463 | self.screen_options_patch() |
| 464 | + self.glcanon_patch() |
466 | 465 |
|
467 | 466 | # patched file manager functions |
468 | 467 | def file_manager_patch(self): |
@@ -724,6 +723,18 @@ def new_process_error(self, w, kind, text): |
724 | 723 | STATUS.emit('play-sound', 'SPEAK %s ' % text) |
725 | 724 | STATUS.emit('update-machine-log', text, 'TIME') |
726 | 725 |
|
| 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) |
727 | 738 |
|
728 | 739 | ######################################################################################################################### |
729 | 740 | # SPECIAL FUNCTIONS SECTION # |
@@ -2044,7 +2055,7 @@ def view_t_pressed(self): |
2044 | 2055 | while time.time() < t: |
2045 | 2056 | QApplication.processEvents() |
2046 | 2057 | self.w.gcodegraphics.set_view('Z') |
2047 | | - mid, size = GlCanonDraw.extents_info(self.w.gcodegraphics) |
| 2058 | + mid, size = DRAW.extents_info(self.w.gcodegraphics) |
2048 | 2059 | if self.gcodeProps: |
2049 | 2060 | mult = 1 |
2050 | 2061 | if self.units == 'in' and self.gcodeProps['gcode_units'] == 'mm': |
@@ -5322,7 +5333,7 @@ def pmx485_check(self, port, periodic=False): |
5322 | 5333 | return False |
5323 | 5334 | else: |
5324 | 5335 | if not periodic: |
5325 | | - msg0 = _translate('cannot be found') |
| 5336 | + msg0 = _translate('HandlerClass', 'cannot be found') |
5326 | 5337 | STATUS.emit('error', linuxcnc.OPERATOR_ERROR, '{}:\n{} {}\n{}'.format(head, port, msg0, msg1)) |
5327 | 5338 | return False |
5328 | 5339 | except: |
|
0 commit comments