Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Oct 7, 2019
1 parent 08ad760 commit 94adf36
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions shapeout2/gui/quick_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,28 @@ def __init__(self, *args, **kwargs):
)

def __getstate__(self):
plot = {"path": self.path,
"downsampling enabled": self.checkBox_downsample.isChecked(),
"downsampling value": self.spinBox_downsample.value(),
"axis x": self.comboBox_x.currentData(),
"axis y": self.comboBox_y.currentData(),
"scale x": self.comboBox_xscale.currentData(),
"scale y": self.comboBox_yscale.currentData(),
"isoelastics enabled": self.checkBox_isoelastics.isChecked(),
"filters": self.filters,
}
event = {"index": self.spinBox_event.value(),
"image auto contrast": self.checkBox_auto_contrast.isChecked(),
"image contour": self.checkBox_contour.isChecked(),
"image zoom": self.checkBox_zoom_roi.isChecked(),
"trace raw": self.checkBox_raw_trace.isChecked(),
}
state = {"plot": plot,
"event": event,
}
plot = {
"path": self.path,
"downsampling enabled": self.checkBox_downsample.isChecked(),
"downsampling value": self.spinBox_downsample.value(),
"axis x": self.comboBox_x.currentData(),
"axis y": self.comboBox_y.currentData(),
"scale x": self.comboBox_xscale.currentData(),
"scale y": self.comboBox_yscale.currentData(),
"isoelastics enabled": self.checkBox_isoelastics.isChecked(),
"filters": self.filters,
}
event = {
"index": self.spinBox_event.value(),
"image auto contrast": self.checkBox_auto_contrast.isChecked(),
"image contour": self.checkBox_contour.isChecked(),
"image zoom": self.checkBox_zoom_roi.isChecked(),
"trace raw": self.checkBox_raw_trace.isChecked(),
}
state = {
"plot": plot,
"event": event,
}
return state

def __setstate__(self, state):
Expand Down Expand Up @@ -157,7 +160,8 @@ def __setstate__(self, state):
for tb in self.signal_widgets:
tb.blockSignals(False)
if "event" in state:
self.checkBox_auto_contrast.setChecked(state["image auto contrast"])
self.checkBox_auto_contrast.setChecked(
state["image auto contrast"])
self.checkBox_contour.setChecked(state["image contour"])
self.checkBox_zoom_roi.setChecked(state["event"]["image zoom"])
self.spinBox_event.setValue(state["event"]["index"])
Expand Down Expand Up @@ -262,7 +266,7 @@ def show_event(self, event):
if (key in ds["trace"] and show):
# show the trace information
tracey = ds["trace"][key][event]
tracex = np.arange(tracey.size)
tracex = np.arange(tracey.size)
self.trace_plots[key].setData(tracex, tracey)
self.trace_plots[key].show()
else:
Expand Down

0 comments on commit 94adf36

Please sign in to comment.