Create and handle the VDAT GUI, as well as some specific functions related to handling particular elements of the GUI, like the progress bar.
Originally created: Thu Apr 23 18:47:02 2015 by: PyQt5 UI code generator 5.2.1, run on output from QtDesigner
Set-up the user interface for VDAT
Parameters: | mainWindow : PyQt4.QtGui.MainWindow instance
queue : vdat.gui.queue.Queue instance
|
---|
Override the user closing the window. Instead wait for anything on the immediate queue to finish running and then quit.
Change the central panel of VDAT
Parameters: | type_ : str
|
---|
Panel with the focal plane
Class to store variable which controls looping over IFUs
Return the current focal plane (or none if not set)
Returns: | fplane : pyhetdex.het.fplane.FPlane
|
---|
Grabs the IFUs from the fplane class variable of FplanePanel and check that that the IFUs have been properly initialized.
Returns: | ifu : vdat.gui.ifu_widget.IFUWidget
|
---|
Grabs the IFUs from the fplane class variable of FplanePanel and check that that the IFUs have been properly initialized. Yield selected IFUs
Returns: | ifu : vdat.gui.ifu_widget.IFUWidget
|
---|
Create a new focal plane panel, and save it in the global. Delete the old one.
Returns: | __FPLANEPANEL__ : class:FplanePanel
|
---|
Class to create and handle the focal plane window in the GUI
Set up the basic elements, like the combo box and the widget, of a viewer of HETDEX focal planes
Parameters: | type_ : str
|
---|
Update the contents of the image scale boxes
Parameters: | min_scale : float
max_scale : float
|
---|
Set the image scale parameters, based on what is written in the min_cut and max_cut boxes.
A model to populate a treeview
Widget with custom items.
This was written following this tutorial
Simple hierachy
+- 20150622
+-- Calibration
+--- Model-1
+--- Model-2
+--- Model-3
+-- RawScience
>>> model = ReductionTreeviewModel()
>>> nights = ReductionNode("Nights", 1, model)
>>> model.rootnode = nights
>>> night1 = ReductionNode("20150622", 1, model, parent=nights)
>>> nights.add_subnode(night1)
>>> cal = ReductionNode("Calibration", 1, model, parent=night1)
>>> night1.add_subnode(cal)
>>> cal.add_subnode(ReductionNode("Models-1", 1, model, parent=cal))
>>> cal.add_subnode(ReductionNode("Models-2", 2, model, parent=cal))
>>> cal.add_subnode(ReductionNode("Models-3", 3, model, parent=cal))
>>> rawsci = ReductionNode("RawScience", 2, model, parent=night1)
>>> night1.add_subnode(rawsci)
A class to store nodes in the custom treeview model.
Parameters: | name : String
path : string
row : int
model : ReductionTreeviewModel instance
type_ : string
selectable : bool, optional
checkable : bool, optional
parent : ReductionNode instance, optional
|
---|
Attributes
name, row, model, parent | (as in the parameters) |
column | (int) column index |
subnodes | (list) sub-nodes of the current node |
Return the index of the node
Returns: | index : QModelIndex instance
|
---|
Add a subnode to the current node
Parameters: | node : QModelIndex instance
|
---|
Get the child at row
Parameters: | row : int
|
---|---|
Returns: | ReductionNode instance
|
A model that stores the tree structure for the treeview widget
Parameters: | parent : qtobject
column_title : string, optional
|
---|
Get the rootnode of this tree
Returns: | node : ReductionNode instance
|
---|
Return the checked nodes.
setData() makes sure that at most one node per type is selected
Returns: | dictionary
|
---|
Return number of columns, for us this is always 1
Parameters: | parentIndex : PyQt4.QtCore.QModelIndex
|
---|---|
Returns: | int
|
Return the number of subnodes under a parent node
Parameters: | parentIndex : PyQt4.QtCore.QModelIndex
|
---|---|
Returns: | nrows : int
|
Return information about the header items
Parameters: | section : int
orientation : int
role : int
|
---|
Return information about the specified node
Parameters: | index : QtCore.QModelIndex instance
role : int
|
---|
If the role is QtCore.Qt.CheckStateRole, change the check status of the index, making sure that at most one element per checkable node type is selected.
Parameters: | index : QtCore.QModelIndex instance
value :
role : int
|
---|
Return the index of the node with row, column and parent
Implementation from https://www.mail-archive.com/pyqt@riverbankcomputing.com/msg19414.html
Parameters: | row, column : int
parentIndex : QModelIndex
|
---|---|
Returns: | QtCore.QModelIndex
|
Return an index to the parent of the node with index
Parameters: | index : QtCore.QModelIndex instance
|
---|---|
Returns: | QtCore.QModelIndex instance
|
Custom tree view widget
Returns the button widget
Add an action menu to the tree view
Parameters: | position : PyQt4.QtCore.QPoint instance |
---|
Clone the directory associated to node and add it to the tree view and to the database
Parameters: | index : QModelIndex instance
node : class:ReductionNode instance
|
---|
Ask the user the new directory name
Parameters: | original_name : string
parent_path : string
|
---|---|
Returns: | new_name : string
|
Create a text dialog with the default text
Parameters: | default_text : string
label_prefix : string
|
---|---|
Returns: | string
|
Copy the directory src to dst. Both are children of parent_path.
Also set to true the is_clone entry in the shot file
Parameters: | parent_path : string
src, dst : string
|
---|
Clone node, update it and insert it
Parameters: | index : QModelIndex instance
new_name : string
|
---|
Setup a treeview widget with which to browse the file structure
Parameters: | parent : QWidget
|
---|---|
Returns: | PyQt4.QtGui.QTreeView instance
|
Create the directory structure in the redux directory
Parameters: | parent : QWidget
|
---|---|
Returns: | model : ReductionTreeviewModel instance |
Form implementation generated from reading ui file ‘listWindow.ui’
Created: Mon Jun 15 16:25:52 2015 by: PyQt4 UI code generator 4.10.4
A container for commands on the queue. Also saves the current config object.
Parameters: | command : CommandInterpreter
label : string
tool_tip : string, optional
parent : QtWidget instance
|
---|
Adds the ability to delete and modify items on the list by hand
A queue that stores user commands and displays them in a GUI window.
A signal emitted when a job is added to the queue
Add a command to the queue. Emit the job_added signal.
Parameters: | command : CommandInterpreter
label : string
tool_tip : string, optional
|
---|
Get the top item from the queue.
Returns: | cmd : Callable
config : pyhetdex.tools.configuration.ConfigParser instance
Todo Check that not deleting the item doesnt cause a memory leak. |
---|
Action for the queue window.
Create the menu entry and binds signals known by the queue window to show/hide it
Create a Queue instance and save it. You can access it with get_queue()
Parameters: | parent : QtWidget instance
|
---|
Connection between the gui and the background thread to keep the gui responsive as vdat works
A worker object to stick into a QThread so it can run in the background and allow the GUI to still be responsive.
Attributes
finished | (pyqtSignal) qt signal |
Parameters: | func : callable
bg : Background object
immediate : bool
args : list
kwargs : dictionary
|
---|
Signals have to be attached to an object. This object contain the signal that is used to trigger Workers in the background thread.
Attributes
signal | (pyqtSignal) qt signal |
Run a multiple QThreads in the background.
By doing this the GUI can remain response whilst the code is doing work. Have to keep the same QThread throughout as the VDAT database has to be queried from the Thread that created it.
The background needs to be given a queue to read jobs from.
Run a job on the immediate thread. These jobs don’t queue but kick off the old job and start up immediately (the functions have to be specially designed, see below)
Parameters: | func : function
conf : vdat config object |
---|
Set up a background instance
Parameters: | parent : QtWidget instance
|
---|
Returns the Background instance created by set_backgound()