Skip to content
Snippets Groups Projects
Commit 5b06a329 authored by ulc0011's avatar ulc0011
Browse files

ENH: data_plot_2.py now gives possibility of choosing whether to plot overall...

ENH: data_plot_2.py now gives possibility of choosing whether to plot overall summary or graph for selected region
parent 5a4dabb1
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,13 @@ class Window(QtWidgets.QDialog):
# data loading, we can have more than one y_data! TODO
self.d = run_path("get_data_for_gui.py")
self.data = self.d["plot_summary_data"]
#self.data = self.d["nested_regions_report_data"][0]["plot_data"]
self.combo_reg = QtWidgets.QComboBox(self)
self.combo_reg.addItem('Overall summary')
#TODO - multiple measurements handling (2 in range is ad hoc)
for i in range(0,len(self.d["nested_regions_report_data"]),2):
self.combo_reg.addItem("REGION - {}".format(self.d["nested_regions_report_data"][i]["nested_region"]))
if len(self.data) > 1:
self.combo = QtWidgets.QComboBox(self)
......@@ -60,6 +67,14 @@ class Window(QtWidgets.QDialog):
self.plot_data = self.data[0]
self.lab_reg = QtWidgets.QLabel('Choose Area: ')
self.lab_reg.setFont(self.bf)
hl_reg = QtWidgets.QHBoxLayout()
hl_reg.addWidget(self.lab_reg)
hl_reg.addWidget(self.combo_reg)
self.combo_reg.activated[str].connect(self.chooseReg)
layout.addLayout(hl_reg)
if len(self.data) > 1:
self.label = QtWidgets.QLabel('Choose quantity: ')
self.label.setFont(self.bf)
......@@ -88,6 +103,20 @@ class Window(QtWidgets.QDialog):
self.plot()
def chooseReg(self, dataLabel):
if dataLabel == "Overall summary":
self.data = self.d["plot_summary_data"]
else:
for i in range(0,len(self.d["nested_regions_report_data"])):
tmp = "REGION - {}".format(self.d["nested_regions_report_data"][i]["nested_region"])
if dataLabel == tmp:
self.data = self.d["nested_regions_report_data"][i]["plot_data"]
self.plot_data = self.data[0]
if len(self.data) > 1:
for i in range(0,len(self.data)):
if str(self.combo.currentText()) == self.data[i][0]["arg"]:
self.plot_data = self.data[i]
self.plot()
def chooseData(self, dataLabel):
for i in range(0,len(self.data)):
......@@ -106,7 +135,7 @@ class Window(QtWidgets.QDialog):
def change_sw(self):
self.sw = not self.sw
self.plot()
#pp.pprint(self.plot_data)
pp.pprint(self.d["nested_regions_report_data"])
def plot(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment