only alpha numerical characters to protein and prefix fields - removes wrong data path bug

This commit is contained in:
John Henry Beale committed 2026-08-24 12:26:26 +02:00
1 parent 678b5990ea
commit 8dfd022d73
1 file changed
+10 -1
+10 -1
View File
@@ -8,7 +8,8 @@
import logging
_log = logging.getLogger(__name__)
from PyQt5.QtCore import QSettings
from PyQt5.QtCore import QSettings, QRegularExpression
from PyQt5.QtGui import QRegularExpressionValidator
from PyQt5.QtWidgets import QApplication, QMainWindow
import json,re
import numpy as np
@@ -558,6 +559,14 @@ verbose bits:
self._paramTree=pt=ParameterTree(parent=self)
pt.setParameters(p, showTop=True)
# restrict prefix/protein fields to alphanumeric characters and underscores,
# since these feed directly into DAQ file/directory naming
alnum_underscore=QRegularExpressionValidator(QRegularExpression(r'^[A-Za-z0-9_]*$'))
for param in (p.param('data acquisition',AppCfg.DAQ_RUN,'prefix'), p.param('data acquisition',AppCfg.DAQ_SAMPLE,'protein')):
for item in param.items:
item.widget.setValidator(alnum_underscore)
pt.setWindowTitle('SwissMX parameters')
#t.resize(600, 800)
self.setCentralWidget(pt)