Skip to content

Commit

Permalink
qtplasmac: fix table view position for all machine coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
phillc54 committed Mar 6, 2024
1 parent 8b88e0e commit db761ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
30 changes: 9 additions & 21 deletions share/qtvcp/screens/qtplasmac/qtplasmac_handler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = '237.308'
VERSION = '237.309'
LCNCVER = '2.9'
DOCSVER = LCNCVER

Expand Down Expand Up @@ -2072,26 +2072,14 @@ def view_t_pressed(self):
QApplication.processEvents()
self.w.gcodegraphics.set_view('Z')
mid, size = DRAW.extents_info(self.w.gcodegraphics)
if self.gcodeProps:
mult = 1
if self.units == 'in' and self.gcodeProps['gcode_units'] == 'mm':
mult = 0.03937
elif self.units == 'mm' and self.gcodeProps['gcode_units'] == 'in':
mult = 25.4
x = (round(float(self.gcodeProps['x'].split()[0]) * mult, 4))
y = (round(float(self.gcodeProps['y'].split()[0]) * mult, 4))
xl = (round(float(self.gcodeProps['x'].split('=')[1].split()[0]) * mult, 4))
yl = (round(float(self.gcodeProps['y'].split('=')[1].split()[0]) * mult, 4))
else:
x = y = xl = yl = 0
if (mid[0] == 0 and mid[1] == 0) or mid[0] > self.xLen or mid[1] > self.yLen or \
self.w.view_t.isChecked() or self.w.view_t.isDown() or self.fileClear:
mult = 1 if self.units == 'in' else 25.4
zoomScale = (self.w.table_zoom_scale.value() * 2)
mid = [(self.xLen - (x * 2) - xl) / mult / 2, (self.yLen - (y * 2) - yl) / mult / 2, 0]
size = [self.xLen / mult / zoomScale, self.yLen / mult / zoomScale, 0]
glTranslatef(-mid[0], -mid[1], -mid[2])
self.w.gcodegraphics.set_eyepoint_from_extents(size[0], size[1])
mult = 1 if self.units == 'in' else 25.4
zoomScale = (self.w.table_zoom_scale.value() * 2)
xTableCenter = (self.xMin + self.xLen / 2) / mult - mid[0]
yTableCenter = (self.yMin + self.yLen / 2) / mult - mid[1]
xSize = self.xLen / mult / zoomScale
ySize = self.yLen / mult / zoomScale
glTranslatef(-xTableCenter, -yTableCenter, 0)
self.w.gcodegraphics.set_eyepoint_from_extents(xSize, ySize)
self.w.gcodegraphics.perspective = False
self.w.gcodegraphics.lat = self.w.gcodegraphics.lon = 0
self.w.gcodegraphics.updateGL()
Expand Down
7 changes: 6 additions & 1 deletion share/qtvcp/screens/qtplasmac/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ <h2>QtPlasmaC Version History - LinuxCNC 2.9</h2>
</table>
<br>
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
<br><b><u>237.309 2024 Mar 05</u></b>
<ul style="margin:0;">
<li>fix table view position for all machine coordinates</li>
</ul>

<br><b><u>237.308 2024 Feb 28</u></b>
<ul style="margin:0;">
<li>fix matl overlay for locales that use a comma as a decimal</li>
<li>fix material overlay for locales that use a comma as a decimal</li>
</ul>

<br><b><u>237.307 2024 Feb 25</u></b>
Expand Down

0 comments on commit db761ea

Please sign in to comment.