Skip to content

Commit 88491c7

Browse files
committed
qtplasmac: rework versioning due to master branch diverging
1 parent 35d90df commit 88491c7

4 files changed

Lines changed: 422 additions & 412 deletions

File tree

docs/src/plasma/qtplasmac.adoc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,28 @@ It is possible to install and run LinuxCNC on a variety of Linux distributions h
6060

6161
Installation instructions are available from link:../getting-started/getting-linuxcnc.html[here].
6262

63-
Following these instructions will yield a machine with the current stable branch (v2.8) of LinuxCNC on Debian Buster.
63+
Following these instructions will yield a machine with the current stable branch of LinuxCNC (v2.9) on Debian 12 (Bookworm).
6464

65-
=== Package Installation (Buildbot) If The User Has Linux with LinuxCNC v2.8
65+
=== Package Installation (Buildbot) If The User Has Linux on Debian 12 (Bookworm)
6666

67-
A package installation (Buildbot) uses prebuilt packages from the LinuxCNC Buildbot, instructions for upgrading from 2.8 to 2.9 or later are available at: http://buildbot.linuxcnc.org
67+
Follow the instructions from the Updating LinuxCNC on Debian Bookworm section from link:../getting-started/getting-linuxcnc.html[here].
6868

69-
Following these instructions by using the below stanzas will upgrade the machine to the last LinuxCNC Buildbot build of LinuxCNC v2.9. This may not always be the latest version though, as from time to time the LinuxCNC Buildbot may stop due to errors.
69+
=== Package Installation (Buildbot) If The User Has Linux on Debian 11 (Bullseye) or Debian 10 (Buster)
70+
71+
A package installation (Buildbot) uses prebuilt packages from the http://buildbot2.highlab.com[LinuxCNC Buildbot].
72+
73+
Add the GPG keys and add the repository to the sources list to suit the Debian version.
74+
75+
The below stanza would add the 2.9 Bullseye repository.
7076

7177
----
72-
deb http://buildbot.linuxcnc.org/ buster 2.9-rtpreempt
73-
deb-src http://buildbot.linuxcnc.org/ buster 2.9-rtpreempt
78+
deb http://buildbot2.highlab.com/ bookworm 2.9-uspace
7479
----
7580

76-
=== Run In Place Installation If The User Has Linux with LinuxCNC v2.8
81+
=== Run In Place Installation If The User Has Linux Installed
7782

7883
A run in place installation runs LinuxCNC from a locally compiled version usually located at ~/linuxcnc-dev, instructions for building a run in place installation are available from link:../code/building-linuxcnc.html[here].
7984

80-
Following these instructions will install the latest master branch (v2.10) of LinuxCNC.
81-
8285
== Creating A QtPlasmaC Configuration
8386

8487
Prior to creating a QtPlasmaC configuration, it is important that the user has a firm understanding of the operating modes available, as well as the I/O's that are required for successful plasma operation.

lib/python/qtvcp/lib/qtplasmac/updater.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from shutil import copy as COPY
2424

2525
###########################################################################################################
26-
# move default material from prefs file to material 0 in materials file (pre V1.236.278 2023/07/07) #
26+
# move default material from prefs file to material 0 in materials file (pre V2.9-236.278 2023/07/07) #
2727
###########################################################################################################
2828
def move_default_material(prefs, materials, unitsPerMm):
2929
if os.path.isfile(materials):
@@ -60,23 +60,23 @@ def move_default_material(prefs, materials, unitsPerMm):
6060
f_out.write(line)
6161
prefs.remove_section('DEFAULT MATERIAL')
6262
prefs.write(open(prefs.fn, 'w'))
63-
return(False, False, 'Updated to V1.236.278')
63+
return(False, False, 'Updated to V2.9-236.278')
6464

6565

6666
###########################################################################################################
67-
# move port info from [GUI_OPTIONS] section (if it was moved via V1.227.219 update) to [POWERMAX] section #
67+
# move port info from [GUI_OPTIONS] section (if it was moved via V2.9-227.219 update) to [POWERMAX] section #
6868
###########################################################################################################
6969
def move_port(prefs):
7070
if not prefs.has_option('POWERMAX', 'Port'):
7171
data = prefs.getpref('Port', '', str, 'GUI_OPTIONS')
7272
prefs.putpref('Port', data, str, 'POWERMAX')
7373
prefs.removepref('Port', 'GUI_OPTIONS')
7474
prefs.write(open(prefs.fn, 'w'))
75-
return(False, False, 'Updated to V1.232.240')
75+
return(False, False, 'Updated to V2.9-232.240')
7676

7777

7878
###########################################################################################################
79-
# move qtplasmac options from INI file to prefs file (pre V1.227.219 2022/07/14) #
79+
# move qtplasmac options from INI file to prefs file (pre V2.9-227.219 2022/07/14) #
8080
###########################################################################################################
8181
def move_options_to_prefs_file(inifile, prefs):
8282
try:
@@ -193,7 +193,7 @@ def get_offsets(data, oType):
193193

194194

195195
###########################################################################################################
196-
# remove the qtplasmac link from the config directory (pre V1.225.208 2022/06/29) #
196+
# remove the qtplasmac link from the config directory (pre V2.9-225.208 2022/06/29) #
197197
###########################################################################################################
198198
def remove_qtplasmac_link_iniwrite(inifile):
199199
try:
@@ -215,11 +215,11 @@ def remove_qtplasmac_link_iniwrite(inifile):
215215
os.remove(tmpFile)
216216
except Exception as e:
217217
return(False, True, e)
218-
return(True, False, 'Updated to V1.225.208')
218+
return(True, False, 'Updated to V2.9-225.208')
219219

220220

221221
###########################################################################################################
222-
# change startup parameters from a subroutine (pre V1.224.207 2022/06/22) #
222+
# change startup parameters from a subroutine (pre V2.9-225.207 2022/06/22) #
223223
###########################################################################################################
224224
def rs274ngc_startup_code_iniwrite(inifile):
225225
try:
@@ -236,11 +236,11 @@ def rs274ngc_startup_code_iniwrite(inifile):
236236
os.remove(tmpFile)
237237
except Exception as e:
238238
return(False, True, e)
239-
return(True, False, 'Updated to V1.225.207')
239+
return(True, False, 'Updated to V2.9-225.207')
240240

241241

242242
###########################################################################################################
243-
# move [CONVERSATIONAL] prefs from qtvcp.prefs to <machine_name>.prefs (pre V1.222.187 2022/05/03) #
243+
# move [CONVERSATIONAL] prefs from qtvcp.prefs to <machine_name>.prefs (pre V2.9-222.187 2022/05/03) #
244244
###########################################################################################################
245245
def move_prefs(qtvcp, machine):
246246
try:
@@ -270,11 +270,11 @@ def move_prefs(qtvcp, machine):
270270
qtvcpFile.write(line)
271271
except Exception as e:
272272
return(False, True, e)
273-
return(False, False, 'Updated to V1.222.187')
273+
return(False, False, 'Updated to V2.9-222.187')
274274

275275

276276
###########################################################################################################
277-
# split out qtplasmac.prefs into <machine_name>.prefs and qtvcp.prefs (pre V1.222.170 2022/03/08) #
277+
# split out qtplasmac.prefs into <machine_name>.prefs and qtvcp.prefs (pre V2.9-222.170 2022/03/08) #
278278
###########################################################################################################
279279
def split_prefs_file(old, new, prefs):
280280
try:
@@ -312,11 +312,11 @@ def split_prefs_file(old, new, prefs):
312312
os.remove(old)
313313
except Exception as e:
314314
return(False, True, e)
315-
return(False, False, 'Updated to V1.222.170')
315+
return(False, False, 'Updated to V2.9-222.170')
316316

317317

318318
###########################################################################################################
319-
# use qtplasmac_comp.hal for component connections (pre V1.221.154 2022/01/18) #
319+
# use qtplasmac_comp.hal for component connections (pre V2.9-221.154 2022/01/18) #
320320
###########################################################################################################
321321
def add_component_hal_file(path, halfiles):
322322
try:
@@ -401,4 +401,4 @@ def add_component_hal_file_iniwrite(inifile):
401401
os.remove(tmpFile)
402402
except Exception as e:
403403
return(False, True, e)
404-
return(True, False, 'Updated to V1.221.154')
404+
return(True, False, 'Updated to V2.9-221.154')

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
VERSION = '1.236.298'
1+
VERSION = '236.299'
2+
LCNCVER = '2.9'
3+
DOCSVER = LCNCVER
24

35
'''
46
qtplasmac_handler.py
@@ -128,6 +130,7 @@ def __init__(self, halcomp, widgets, paths):
128130
if os.path.realpath(m190Path) != os.path.realpath(self.PATHS.CONFIGPATH):
129131
COPY(os.path.join(m190Path, 'M190'), os.path.join(self.PATHS.CONFIGPATH, 'M190'))
130132
self.machineName = self.iniFile.find('EMC', 'MACHINE')
133+
self.machineTitle = '{} - QtPlasmaC v{}-{}, powered by QtVCP and LinuxCNC'.format(self.machineName, LCNCVER, VERSION)
131134
self.prefsFile = os.path.join(self.PATHS.CONFIGPATH, self.machineName + '.prefs')
132135
self.materialFile = os.path.join(self.PATHS.CONFIGPATH, self.machineName + '_material.cfg')
133136
self.unitsPerMm = 1
@@ -153,14 +156,7 @@ def __init__(self, halcomp, widgets, paths):
153156
if os.path.basename(self.PATHS.XML) == 'qtplasmac_9x16.ui':
154157
self.landscape = False
155158
self.upFile = os.path.join(self.PATHS.CONFIGPATH, 'user_periodic.py')
156-
major = linuxcnc.version.split('.')[0]
157-
minor = linuxcnc.version.split('.')[1]
158-
# this will need changing whenever the development branch changes versions
159-
if major == '2' and minor == '10':
160-
umVer = 'devel'
161-
else:
162-
umVer = '{}.{}'.format(major, minor)
163-
self.umUrl = QUrl('http://linuxcnc.org/docs/{}/html/plasma/qtplasmac.html'.format(umVer))
159+
self.umUrl = QUrl('http://linuxcnc.org/docs/{}/html/plasma/qtplasmac.html'.format(DOCSVER))
164160
KEYBIND.add_call('Key_F12','on_keycall_F12')
165161
KEYBIND.add_call('Key_F9','on_keycall_F9')
166162
KEYBIND.add_call('Key_Plus', 'on_keycall_PLUS')
@@ -328,13 +324,18 @@ def __init__(self, halcomp, widgets, paths):
328324

329325
# called by qtvcp.py
330326
def initialized__(self):
327+
if linuxcnc.version.rsplit('.', 1)[0] != LCNCVER:
328+
msg0 = _translate('HandlerClass', 'LinuxCNC version should be')
329+
msg1 = _translate('HandlerClass', 'The detected version is')
330+
STATUS.emit('error', linuxcnc.OPERATOR_ERROR, '{} {}\n{} {}'.format(msg0, LCNCVER, msg1, linuxcnc.version.rsplit('.', 1)[0]))
331+
quit()
331332
ucFile = os.path.join(self.PATHS.CONFIGPATH, 'qtplasmac_custom.py')
332333
if os.path.isfile(ucFile):
333334
exec(compile(open(ucFile, 'rb').read(), ucFile, 'exec'))
334335
# ensure we get all startup errors
335336
STATUS.connect('error', self.error_update)
336337
STATUS.connect('graphics-gcode-error', lambda o, e:self.error_update(o, linuxcnc.OPERATOR_ERROR, e))
337-
STATUS.emit('update-machine-log', '--- {} - QtPlasmaC v{}, powered by QtVCP on LinuxCNC v{} ---'.format(self.machineName, VERSION, linuxcnc.version.split(':')[0]), None)
338+
STATUS.emit('update-machine-log', '--- {} ---'.format(self.machineTitle), None)
338339
self.make_hal_pins()
339340
self.init_preferences()
340341
self.hide_widgets()
@@ -438,12 +439,12 @@ def initialized__(self):
438439

439440
if not os.path.isfile(updateLog):
440441
with open(updateLog, 'w') as f:
441-
f.write('{} Initial V{}\n'.format(time.strftime('%y-%m-%d'), VERSION))
442+
f.write('{} Initial V{}-{}\n'.format(time.strftime('%y-%m-%d'), LCNCVER, VERSION))
442443
self.startupTimer.start(250)
443444

444445
# called by qtvcp.py, can override qtvcp settings or qtvcp allowed user options (via INI)
445446
def before_loop__(self):
446-
self.w.setWindowTitle('{} - QtPlasmaC v{}, powered by QtVCP on LinuxCNC v{}'.format(self.machineName, VERSION, linuxcnc.version.split(':')[0]))
447+
self.w.setWindowTitle(self.machineTitle)
447448
self.iconPath = 'share/icons/hicolor/scalable/apps/linuxcnc_alt/linuxcncicon_plasma.svg'
448449
appPath = os.path.realpath(os.path.dirname(sys.argv[0]))
449450
self.iconBase = '/usr' if appPath == '/usr/bin' else appPath.replace('/bin', '/debian/extras/usr')
@@ -1992,7 +1993,7 @@ def reload_plasma_clicked(self):
19921993
def backup_clicked(self):
19931994
self.save_logfile(6)
19941995
bkpPath = '{}'.format(os.path.expanduser('~'))
1995-
bkpName = '{}_V{}_{}.tar.gz'.format(self.machineName, VERSION, time.strftime('%y-%m-%d_%H-%M-%S'))
1996+
bkpName = '{}_V{}-{}_{}.tar.gz'.format(self.machineName, LCNCVER, VERSION, time.strftime('%y-%m-%d_%H-%M-%S'))
19961997
tmpFile = os.path.join(self.PATHS.CONFIGPATH, 'config_info.txt')
19971998
lcncInfo = (Popen('linuxcnc_info -s', stdout=PIPE, stderr=PIPE, shell=True).communicate()[0]).decode('utf-8')
19981999
network = (Popen('lspci | grep -i net', stdout=PIPE, stderr=PIPE, shell=True).communicate()[0]).decode('utf-8')

0 commit comments

Comments
 (0)