Skip to content

Commit da67fbe

Browse files
committed
qtplasmac: fix m_code pathing
Fixes the m_code path for a package install sim. Allows update 001-017 to be applied correctly for configs that were build prior to then.
1 parent 7195aeb commit da67fbe

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

configs/sim/qtplasmac/qtplasmac_imperial_ini.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tap = qtplasmac_gcode
99
RS274NGC_STARTUP_CODE = G20 G40 G49 G80 G90 G92.1 G94 G97 M52P1
1010
PARAMETER_FILE = imperial_parameters.txt
1111
SUBROUTINE_PATH = ./:../../nc_files
12-
USER_M_PATH = ./:../../nc_files/plasmac/m_files
12+
USER_M_PATH = ./:../../nc_files/examples/plasmac/m_files:../../nc_files/plasmac/m_files
1313

1414
[HAL]
1515
TWOPASS = ON

configs/sim/qtplasmac/qtplasmac_metric_ini.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tap = qtplasmac_gcode
99
RS274NGC_STARTUP_CODE = G21 G40 G49 G80 G90 G92.1 G94 G97 M52P1
1010
PARAMETER_FILE = metric_parameters.txt
1111
SUBROUTINE_PATH = ./:../../nc_files
12-
USER_M_PATH = ./:../../nc_files/plasmac/m_files
12+
USER_M_PATH = ./:../../nc_files/examples/plasmac/m_files:../../nc_files/plasmac/m_files
1313

1414
[HAL]
1515
TWOPASS = ON

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '008.049'
1+
VERSION = '008.050'
22
LCNCVER = '2.10'
33
DOCSVER = LCNCVER
44

@@ -352,7 +352,7 @@ def initialized__(self):
352352
STATUS.emit('error', linuxcnc.OPERATOR_ERROR, f'{msg0} {LCNCVER}\n\n{msg1} {linuxcnc.version.split(".")[:2]}\n\n{msg2}')
353353
quit()
354354
# if USER_M_PATH is not valid try to find a valid USER_M_PATH in the possible default locations
355-
if self.mPath != 'valid':
355+
if self.mPath != 'valid' and not self.updateIni:
356356
msg0 = _translate('HandlerClass', 'cannot be found in the path')
357357
msg1 = _translate('HandlerClass', 'Please edit [RS274NGC]USER_M_PATH in the .ini file')
358358
msg2 = _translate('HandlerClass', 'QtPlasmac is closing')
@@ -363,7 +363,8 @@ def initialized__(self):
363363
break
364364
if not mPath:
365365
msg3 = _translate('HandlerClass', 'does not exist in the default locations')
366-
STATUS.emit('error', linuxcnc.OPERATOR_ERROR, f'M190 {msg0}:\n{":".join(self.mPath)}\n\n{msg1}\n\nM190 {msg3}:\n{mPath}\n\n{msg2}')
366+
msg = f'M190 {msg0}:\n{":".join(self.mPath)}\n\n{msg1}\n\nM190 {msg3}:\n{mPath[:-5]}\n\n{msg2}'
367+
STATUS.emit('error', linuxcnc.OPERATOR_ERROR, msg)
367368
quit()
368369
ucFile = os.path.join(self.PATHS.CONFIGPATH, 'qtplasmac_custom.py')
369370
if os.path.isfile(ucFile):
@@ -474,7 +475,7 @@ def initialized__(self):
474475
STATUS.emit('error', msgType, msgText)
475476
if restart:
476477
STATUS.emit('error', linuxcnc.OPERATOR_TEXT, 'Due to configuration changes a restart is required')
477-
478+
quit()
478479
if not os.path.isfile(updateLog):
479480
with open(updateLog, 'w') as f:
480481
f.write(f'{time.strftime("%y-%m-%d")} Initial V{LCNCVER}-{VERSION}\n')
@@ -2587,7 +2588,7 @@ def update_check(self):
25872588
return
25882589
# set user_m_path to include the nc_files directory (pre V2.10-001.017 2024/01/23)
25892590
mPathIni = self.iniFile.find('RS274NGC', 'USER_M_PATH')
2590-
if 'nc_files' not in mPathIni:
2591+
if 'nc_files/plasmac/m_files' not in mPathIni:
25912592
if '/usr' in self.PATHS.BASEDIR:
25922593
mPath = '/usr/share/doc/linuxcnc/examples/nc_files/plasmac/m_files'
25932594
# simPath = os.path.join(self.PATHS.BASEDIR, 'share/doc/linuxcnc/examples/sample-configs/sim/qtplasmac')

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ <h2>QtPlasmaC Version History - LinuxCNC 2.10</h2>
2626
</table>
2727
<br>
2828
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
29+
<br><b><u>008.050 2024 Sept 6</u></b>
30+
<ul style="margin:0;">
31+
<li>fix sim m_code pathing</li>
32+
<li>allow update 001-017 to be correctly applied</li>
33+
</ul>
34+
2935
<br><b><u>008.049 2024 Sept 2</u></b>
3036
<ul style="margin:0;">
3137
<li>process element names for custom stylesheets as well</li>

0 commit comments

Comments
 (0)