forked from IPKM/nmreval
249-asciireader (#250)
Co-authored-by: Dominik Demuth <dominik.demuth@physik.tu-darmstadt.de> Reviewed-on: IPKM/nmreval#250
This commit is contained in:
parent
ffba4900a1
commit
04d384363a
@ -38,7 +38,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader):
|
|||||||
self.changestaggeredrange(0)
|
self.changestaggeredrange(0)
|
||||||
|
|
||||||
self.ascii_table.contextMenuEvent = self.ctx_table
|
self.ascii_table.contextMenuEvent = self.ctx_table
|
||||||
self.ascii_table.horizontalHeader().setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
self.ascii_table.horizontalHeader().setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
||||||
self.ascii_table.horizontalHeader().customContextMenuRequested.connect(self.ctx_table)
|
self.ascii_table.horizontalHeader().customContextMenuRequested.connect(self.ctx_table)
|
||||||
|
|
||||||
self.skip = False
|
self.skip = False
|
||||||
@ -65,7 +65,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader):
|
|||||||
self.set_column_names(1)
|
self.set_column_names(1)
|
||||||
|
|
||||||
self.skippy_checkbox.blockSignals(True)
|
self.skippy_checkbox.blockSignals(True)
|
||||||
self.skippy_checkbox.setCheckState(QtCore.Qt.Unchecked)
|
self.skippy_checkbox.setCheckState(QtCore.Qt.CheckState.Unchecked)
|
||||||
self.skippy_checkbox.blockSignals(False)
|
self.skippy_checkbox.blockSignals(False)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@ -232,7 +232,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader):
|
|||||||
|
|
||||||
@QtCore.pyqtSlot(int, name='on_buttonGroup_buttonClicked')
|
@QtCore.pyqtSlot(int, name='on_buttonGroup_buttonClicked')
|
||||||
def show_error(self, val: int):
|
def show_error(self, val: int):
|
||||||
self.deltay_lineEdit.setEnabled(val == -3)
|
self.deltay_lineEdit.setEnabled(val == -2)
|
||||||
|
|
||||||
@QtCore.pyqtSlot(int, name='on_skippy_checkbox_stateChanged')
|
@QtCore.pyqtSlot(int, name='on_skippy_checkbox_stateChanged')
|
||||||
def skip_next_dial(self, _: int):
|
def skip_next_dial(self, _: int):
|
||||||
|
@ -49,7 +49,7 @@ class AsciiReader:
|
|||||||
with self.fname.open('r') as f:
|
with self.fname.open('r') as f:
|
||||||
for i, line in enumerate(islice(f, len(self.header)+len(self.lines), num_lines)):
|
for i, line in enumerate(islice(f, len(self.header)+len(self.lines), num_lines)):
|
||||||
line = line.strip('\n\t\r, ')
|
line = line.strip('\n\t\r, ')
|
||||||
line = re.sub(r'[\t ;,] *', ';', line)
|
line = re.sub(r'[\t ;,]+', ';', line)
|
||||||
line = line.split(';')
|
line = line.split(';')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user