The base_experiment module
Abstract base class for experiment frames.
Classes
ExperimentFrame
-
class src.gui.main.base_experiment.ExperimentFrame(parent, experiment=None, title='Untitled Experiment', icon=None, premade=True, experimentPath=None, globalStatus='none-running', **kwargs)[source]
A frame meant to be overridden by frames for developing experiments.
Parameters : | parent : Transport
The main Transport program frame (or anything which implements the
same interface).
experiment : Experiment
The Experiment object which this frame edits.
title : str
The default name for the experiment.
icon : code
Bitmap data in the form of Python code to use as the icon for this
frame.
premade : bool
Whether this ExperimentFrame represents a premade experiment frame.
Some features—like saving and manually editing the instruments—are
only available to custom experiments, so they are disabled in frames
for premade experiments. The default is True.
experimentPath : str
The path to the experiment, if it was opened from a file. The default
is None.
globalStatus : str
The status of the software, indicating whether any experiments are
running.
|
Methods
-
appendControl(newControl)[source]
Append a control to the list to be disabled when run begins.
Parameters : | newControl : wxWindow
The control to add to the list.
|
-
getEnded()[source]
Return whether the experiment has finished running.
-
initializeMenus()[source]
Create the menu bar.
-
initializeToolbar()[source]
Create the toolbar.
-
notifyStatus(status=None)[source]
Update this frame to reflect the status of the software.
Update the execution button status and the editability of panels
to reflect changes in the software status (e.g., whether the
experiment for this frame is running, whether the experiment
for another frame is running, or whether nothing is running).
Parameters : | status : str
- The status of the software. Valid options are the following:
- self-running
- self-paused
- other-running
- none-running
|
-
onAbout(event)[source]
Open the About screen.
-
onClose(event)[source]
Close the experiment.
-
onExit(event)[source]
Exit the software (this is mostly handled by the parent).
-
onHelp(event)[source]
Open the help system.
-
onHome(event)[source]
Show the home screen, assuming it is the parent.
-
onNew(event)[source]
Create a new experiment.
-
onOpen(event)[source]
Open an experiment.
-
onPause(event)[source]
Pause the experiment.
-
onPremade(event)[source]
Open a premade experiment.
-
onRun(event=None)[source]
Run the experiment.
Returns : | bool :
Whether the experiment aws successfully initiated. The method
returns False if an unrecoverable error was detected or if the
user cancels in response to a recoverable error.
|
-
onSave(event)[source]
Save the experiment.
-
onSaveAs(event)[source]
Save the experiment, prompting for a file name.
-
onStop(event)[source]
Stop the experiment.