tg dialog clean-up
This commit is contained in:
@ -774,50 +774,36 @@ class UpperManagement(QtCore.QObject):
|
||||
self.newData.emit(new_data, self.current_graph)
|
||||
|
||||
@QtCore.pyqtSlot(dict, str)
|
||||
def addTg(self, dic1: dict, dtype: str):
|
||||
if dtype == 'tg':
|
||||
for k, (tg, lines) in dic1.items():
|
||||
def addTg(self, dic: dict, dtype: str):
|
||||
graph_id = self.current_graph if dtype == 'tg' else dic.pop('graph')
|
||||
|
||||
set_id_list = []
|
||||
|
||||
if dtype == 'hodge':
|
||||
for v in dic.values():
|
||||
set_id_list.append(self.add(v))
|
||||
|
||||
else:
|
||||
for k, (data, lines) in dic.items():
|
||||
p: ExperimentContainer = self[k]
|
||||
col = p.plot_real.linecolor
|
||||
|
||||
tg_data_id = []
|
||||
if data is not None:
|
||||
set_id_list.append(self.add(data, color=col))
|
||||
|
||||
if tg is not None:
|
||||
tg_data_id.append(self.add(tg, color=col))
|
||||
if dtype == 'tnmh':
|
||||
if lines is not None:
|
||||
lines = [lines]
|
||||
else:
|
||||
lines = []
|
||||
|
||||
for line in lines:
|
||||
set_id = self.add(line, color=col)
|
||||
self[set_id].setLine(style=LineStyle.Dashed)
|
||||
self[set_id].setSymbol(symbol=SymbolStyle.No)
|
||||
tg_data_id.append(set_id)
|
||||
set_id_list.append(set_id)
|
||||
|
||||
self.newData.emit(tg_data_id, self.current_graph)
|
||||
|
||||
elif dtype == 'hodge':
|
||||
set_id_list = []
|
||||
graph_id = dic1.pop('graph')
|
||||
for v in dic1.values():
|
||||
set_id_list.append(self.add(v))
|
||||
self.newData.emit(set_id_list, graph_id)
|
||||
|
||||
elif dtype == 'tnmh':
|
||||
set_id_list = []
|
||||
graph_id = dic1.pop('graph')
|
||||
for k, (tg, fit) in dic1.items():
|
||||
p: ExperimentContainer = self[k]
|
||||
col = p.plot_real.linecolor
|
||||
|
||||
tg_data_id = []
|
||||
|
||||
if tg is not None:
|
||||
set_id_list.append(self.add(tg, color=col))
|
||||
|
||||
set_id = self.add(fit, color=col)
|
||||
self[set_id].setLine(style=LineStyle.Dashed)
|
||||
self[set_id].setSymbol(symbol=SymbolStyle.No)
|
||||
set_id_list.append(set_id)
|
||||
|
||||
self.newData.emit(set_id_list, graph_id)
|
||||
self.newData.emit(set_id_list, graph_id)
|
||||
|
||||
@QtCore.pyqtSlot(int, dict)
|
||||
def smooth_data(self, npoints, param_kwargs):
|
||||
|
Reference in New Issue
Block a user