Skip to content

Commit

Permalink
plasmac2: fix table view for all coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
phillc54 committed Mar 16, 2024
1 parent c973f5b commit b334df6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
22 changes: 12 additions & 10 deletions configs/sim/axis/plasma/plasmac2/plasmac2.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''

VER = '17'
VER = '18'

##############################################################################
# the next line suppresses undefined variable errors in VSCode #
Expand Down Expand Up @@ -828,7 +828,7 @@ def enable_menus(state):
# TABLE VIEW FUNCTIONS #
##############################################################################
def set_view_t(event=None, scale=None):
zoomScale = scale if scale else float(rE(f"{fsetup}.l.gui.zoom get"))
# set button states
widgets.view_z.configure(relief='link')
widgets.view_z2.configure(relief='link')
widgets.view_x.configure(relief='link')
Expand All @@ -837,17 +837,19 @@ def set_view_t(event=None, scale=None):
widgets.view_t.configure(relief='sunken')
widgets.view_p.configure(relief='link')
vars.view_type.set(5)
mult = 1/25.4 if s.linear_units == 1 else 1
xLen = machineBounds['xLen'] * mult
yLen = machineBounds['yLen'] * mult
size = [xLen / zoomScale * 0.5, yLen / zoomScale * 0.5, 0]
mid = [xLen * 0.5, yLen * 0.5, 0]
# set view
mult = 1 if s.linear_units != 1 else 25.4
zoomScale = scale * 2 if scale else float(rE(f"{fsetup}.l.gui.zoom get")) * 2
xTableLength = machineBounds['xLen'] / mult / zoomScale
yTableLength = machineBounds['yLen'] / mult / zoomScale
xTableCenter = (machineBounds['X-'] + (machineBounds['xLen'] / 2)) / mult
yTableCenter = (machineBounds['Y-'] + (machineBounds['yLen'] / 2)) / mult
o.reset()
glTranslatef(-mid[0], -mid[1], -mid[2])
o.set_eyepoint_from_extents(size[0], size[1])
glTranslatef(-xTableCenter, -yTableCenter, 0)
o.set_eyepoint_from_extents(xTableLength, yTableLength)
o.perspective = False
o.lat = o.lon = 0
glRotateScene(o, 1.0, mid[0], mid[1], mid[2], 0, 0, 0, 0)
glRotateScene(o, 1.0, xTableCenter, yTableCenter, 0, 0, 0, 0, 0)
o._redraw()

def get_view_type():
Expand Down
7 changes: 7 additions & 0 deletions configs/sim/axis/plasma/plasmac2/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ <h2>plasmac2 Version History</h2>
<!--- ****** ADD NEXT VERSION BELOW THESE LINES ****** --->
<!--- ****** THE MAJOR VERSION WILL ALWAYS BE 2 ****** --->
<!--- ------------------------------------------------ --->
<br><b><u>v2.18</b> 2024 Mar 15</u>
<ul style="margin:0;">
<li>fix table view for all coordinates</li>
<li>add materials to conversational preview</li>
<li>add clear program to file menu</li>
</ul>

<br><b><u>v2.17</b> 2024 Feb 05</u>
<ul style="margin:0;">
<li>fix file reload</li>
Expand Down

0 comments on commit b334df6

Please sign in to comment.