Open thanasipantazides opened 1 year ago
Also:
QtWidgets.QFrame
to group one detector's buttons and plot. I think you need to add all the widgets to the frame, then can add the frame to the layout?Ok, now it can look like this (on a laptop screen, at night):
The Focus detector yields a popup window like this:
but the tabs besides Plot show nothing. This is achieved by reparenting DetectorPanel
to a new parentless widget GSEPopout
which contains a QTabWidget
.
There are a couple ways to move forward with populating the table view (for strips or pixels), parameters view (for general detector parameter setting), and other detector data views:
DetectorPanel
to GSEPopout
, just reparent a composite widget for its plot (possibly its QGroupBox
). Then, add more composite widgets to DetectorPanel
—one for each tab view in GSEPopout
. Call .hide()
on them on __init__()
and .show()
them when the popout is created. This way, all detector-specific data and interfaces are under DetectorPanel
.DetectorPlotView
(e.g.), DetectorStripTableView
, etc classes for each tab and instantiate them as needed from GSEPopout
or DetectorGridView
. They can all inherit from a common DetectorBackend
which persists across the application and handles stuff like the FormatterUDPInterface
and disk I/O for plotting. This may be a more layered architecture (and more inline with MVC) but a big refactor (including of Kris's code).These really amount to the same thing (QWidget
s inside an aggregate QWidget
), so I'd rather bite the bullet and refactor everything under a well-designed parent (option (2)).
To implement (2), do:
DetectorPanel
to something more informative, like DetectorPlotView
.DetectorPlotView
constructor some structure of detector parameters (to hold parser, normal ranges for HK values, etc). Use placeholder object for now. Should just become attribute of DetectorPlotView
.DetectorPlotView
constructor some FormatterUDPInterface
-like object.
FormatterUDPInterface
. If done, rename FormatterInterface
. Since all DetectorPlotView
s should hold a reference to the same FormatterUDPInterface
, there should not be 7 separate file read actions going on at once.DetectorPlotView
, move file I/O to use FormatterInterface
. DetectorStripView
as an aggregation of a QTableWidget
and a couple QPushButton
s which pull and push data to and from FOXSI via FormatterUDPInterface
.
__init__()
) to FormatterUDPInterface
.DetectorPixelView
for CMOS and Timepix.DetectorParametersView
as an aggregation of a QFormLayout
and some QPushButton
s which pull and push data to and from FOXSI via FormatterUDPInterface
.
__init__()
) to FormatterUDPInterface
.DetectorCommandView
as a filtered/reduced GlobalCommandPanel
.
__init__()
) to FormatterUDPInterface
.DetectorContainer
or something to hold DetectorPlotView
, DetectorStripView
, DetectorParametersView
, and DetectorCommandView
.
.handlePopout()
and .handlePopin()
methods.And, add superclass of all Detector...View
s that include self.name
, self.label
, other expected attributes for displaying.
Stuff to add
Currently, the GUI looks like this:
And it does very little. Need to add functionality to existing UI elements, plus more elements.
DetectorPanel.modalImageButton
) should open a modal window to table-style editor, where individual strips or pixels can be masked/disabled, thresholds adjusted, etc.DetectorPanel.modalParamsButton
) should open a modal window where detector/ASIC parameters can be edited.DetectorPanel.modalPlotButton
) should open a modal window focusing on just that plot (seeapplication.GSEFocus
class).