| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
wx._core.Object --+
|
wx._core.EvtHandler --+
|
wx._core.Window --+
|
wx._windows.TopLevelWindow --+
|
wx._windows.Frame --+
|
MainFrame
The left pane is a FitTree (from fittree.py), the right is a dynamic
panel, accessed via the data member rightPanel, which can hold one of any
number of panels. The panels that can appear in the right pane must be
derived from PDFPanel (in pdfpanel.py) and are defined in the dynamicPanels
dictionary, which is defined in __customProperties. A panel is placed in the
right pane by passing its dynamicPanels dictionary key to the
switchRightPanel method. This method takes care of displaying the panel,
giving the data it needs, and calling its refresh() method.
** NODE TYPES **
The FitTree is essential to the functionality of the Gui.
The tree contains one of five types of items:
"fit" -- This represents a fit that is to be run by pdffit.
"dataset" -- This represents a data for a fit.
"phase" -- This represents the theoretical phases needed for a
dataset or a calculation.
"calculation" -- This represents a calculation which is to be made from
using a configured fit.
Depending upon what type of item is selected in the tree, the right pane
will display the properties and configuration of that item (if in "fitting
mode", see below.) More on these item types is given in the documentation
for the FitTree in fittree.py. See r
** MODES **
The program has various modes of operation.
"fitting" -- In this mode the right pane changes depending upon what
type of item is selected in the FitTree. When the
fitting button is pressed, the program is in "fitting"
mode.
"addingdata" -- This mode is for adding data.
"addingphase" -- This mode is for adding the phase
"config" -- This mode is used for preferences and server
configuration.
"rseries" -- The mode used when configuring an r-series macro.
"tseries" -- The mode used when configuring a temperature series
macro.
"dseries" -- The mode used when configuring a doping series macro.
The mode determines how the tree and other widgets react to user
interaction. The mode of the program is changed with the method setMode.
This method outright enables or disables certain widgets that should not be
used when in certain modes.
** DATA MEMBERS **
dynamicPanels -- The dictionary of right panels. This is used to change the
right panel in the method switchRightPanel. The panels held
by the dynamicPanels dictionary are listed below by their
dictionary keys:
* Miscellaneous panels:
"blank" -- A blank panel
"rseries" -- The r-series macro panel
"tseries" -- The temperature series macro panel
"dseries" -- The doping series macro panel
"welcome" -- A welcome panel
* 'fitting' mode panels
"fit" -- The panel for 'fit' nodes
"phase" -- The panel for 'phase' nodes
"dataset" -- The panel for 'dataset' nodes
"calculation" -- The panel for 'calculation' nodes
* Panels specific to other program modes
"adddata" -- The panel used in 'addingdata' mode
"addphase" -- The panel used in 'addingphase' mode
"serverconfig" -- The panel used in 'config' mode
* Panels for future implementation
"configuration" -- Another 'config' mode panel
rightPanel -- The current right panel.
fullpath -- The full path to the most recently accessed project file.
workpath -- The full path to the working directory. This is modified
whenever something is loaded or saved to file. It is
preserved in the current session and across new projects.
cP -- A python SafeConfigurationParser object. This is in charge
of storing configuration information about the most recently
used files list. It is also used by serverpanel to store
server configuration and by addphasepanel and adddatapanel
to store their respective fullpath variables. The code that
handles the MRU files interacts directly with cP.
mode -- The current mode of the program. This is modified using the
setMode method. See the MODES section above.
name -- The name of the program as defined in pdfguiglobals.
control -- The pdfguicontrol object needed for interfacing with the
engine pdffit2 code.
isAltered -- A Boolean flag that indicates when the program has been
altered. This should be changed with the method needsSave so
that the save menu item and toolbar button can be updated
accordingly.
runningDict -- A dictionary of running fits and calculations indexed by
name. This dictionary is used to change the status colors of
running fits and to keep the user from editing a running
fit.
quitting -- A boolean that is set when the program is quitting. This
flag tells the error handlers to ignore any errors that take
place during shutdown.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
__init__(self, Window parent, int id=-1, String title=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=DEFAULT_FRAME_STYLE, String name=FrameNameStr) -> Frame
|
Open file loaded from the command line. This opens a file without any checking for existing projects. This should only be called after all initializations. It will open a file whose name is specified in pdfguiglobals.cmdargs. |
Several user functions are duplicated many times throughout the gui. This occurrs mostly between the main menu, the right-click menu, and the many buttons in the gui. This method defines local Ids that can be used for all of these. |
Custom user bindings go here. These bindings are not present in wxglade. |
Setup bindings for the main menu and toolbar. Since all toolbar functions use the same Ids as main menu items, the toolbar events do not need their own bindings. |
Switch the panel which is visible in the right hand side.
This sets any panel-specific data and calls the refresh() method of the
new rightPanel. All right panels must be derived from wxPanel and
PDFPanel (in pdfpanel module).
Inputs:
paneltype -- The code used in self.dynamicPanels that indicates the
panel to be displayed. If paneltype is None, the blank
panel is displayed.
|
This method sets the panel specific data for the right panel. This method gets panel-specific data and sends it to the rightPanel. The different types of data assignment are listed below. "fit" type: * Give the fit object to the panel "phase" type: * initialize constraints dictionary and configuration and results * Structure objects. "dataset" type: * initialize configuration, constraints, and results objects "calculation" type: * Give the calculation object to the panel "rseries" type: * Give the fit object to the panel "tseries" type: * Give the fit object to the panel "dseries" type: * Give the fit object to the panel |
Set the mode of the program.
This method takes care of any widget properties that must change when
the mode is changed. If the mode is changing due to the change in the
right panel, always call setMode before switchRightPanel.
"fitting" mode:
* treeCtrlMain is enabled
* plotPanel panel is enabled
* toolBar is enabled
* menuBar is enabled
"addingdata" mode:
"addingphase" mode:
"config" mode:
* treeCtrlMain is disabled
* plotPanel panel is disabled
* toolBar is disabled
* menuBar is disabled
"rseries" mode:
"tseries" mode:
"dseries" mode:
* treeCtrlMain is enabled
* plotPanel panel is disabled
* toolBar is disabled
* menuBar is disabled
|
Load the configuration from file. The MRU list is handled by the local member fileHistory, which is a wxFileHistory object. |
Update the configuration information. This updates the 'MRU' section of the configuration. |
Pop up a dialog if the project needs to be saved. returns: wx.ID_YES if the user chose to save the project. wx.ID_NO if the user chose not to save the project. wx.ID_CANCEL if they changed their mind about their action. |
Manually select a node of the tree and update according to selection. This makes sure that the node is visible after selection. If node is None, this does nothing. |
Update the widgets based on a tree selection. "fitting" mode: * Right panel changes depending upon the type of item selected from the tree. "rseries", "tseries", "dseries" mode: * The behavior is defined in the associated panel |
Set the click behavior for each mode.
Note that this doesn't work on Windows. Be sure to build in redundancy
so that the program behaves as if this does not even get called. If the
Windows bug does not get fixed, this method will probably be
eliminated.
"addingdata" mode:
* can select nothing
"addingphase" mode:
* can select nothing
"config" mode:
* can select nothing
"rseries" mode:
* can only select fit items
"tseries" mode:
* can only select fit items
"dseries" mode:
* can only select fit items
|
Veto editing of some items and in some modes. The following editing attempts are Veto()'d * Editing any item in "addingdata", "addingphase", or "config" mode. |
Allow only certain types of renaming. The following rename attempts are Veto()'d * Giving a node the same name as a sibling. Cousins can share names. * Giving a node the name ''. Everything needs a name. |
Bring up the right-click menu.
This menu can give a different menu depending upon which mode the
program is in. It can even give a different menu depending upon what
part of the tree is selected.
"fitting" mode
The menu appears for right-clicks both on and off of tree items.
The menu has the following items:
"New Fit" -- Append a new fit from anywhere on the tree.
"Copy" -- Copy a fit, phase, dataset, or calc branch
"Paste" -- Paste a copied branch into the tree. Branches
of a given type can only be pasted in certain
places.
"Delete" -- Delete a branch from the tree.
"Insert Phase" -- Insert a phase in the phase section of a fit or
calculation branch.
"Insert Data Set" -- Insert a dataset in the dataset section of a fit
branch.
"Insert Calculation"-- Insert a calculation in the calculation section
of a fit.
The menu appears for right-clicks both on and off of tree items.
The menu has the following items:
"Select All" -- The tree automatically selects all items of the
type the user clicked on.
|
Tell the gui that the program needs to be saved. This changes the state of the save menu and tool bar items. altered -- Whether or not the program needs saving (default True). |
Disable some menu items based upon what is selected in the tree. menu -- The menu which to apply the changes. Note that this method is meant to disable only the shared menu items, that is, those that use the same menu item Ids. These are defined in the top part of __defineLocalIds(). Putting this logic into a single method makes it easier to make changes with the menus. If a specific menu needs additional logic, put that in a separate method. |
Start a new fit tree. A fit is given the name "Fit n", where n is the smallest positive integer such that the name is not already taken. |
Paste a copied fit and link it to the original. This should only be called on a 'fit' node, and only if the original 'fit' node, or at least one with the same name as the original still exists in the tree. |
Insert a new dataset item. This opens up the new data set panel from adddatapanel.py. That panel is in charge of inserting a new phase. See the module for details. |
Insert a new phase item. This opens up the new phase panel from addphasepanel.py. That panel is in charge of inserting a new phase. See the module for details. |
Insert a new calculation item. A calculation is given the name "Calculation n", where n is the smallest positive integer such that the name is not already taken. |
Run the selected fits/calculations and disable their tree entries. This also runs calculations that are children of a running fit. |
Stop all fits. This removes all items from the runningDict and changes the status colors back to wxWHITE. |
Switch the right panel to the 'preferences' panel. The 'preferences' panel uses the 'config' mode. |
Switch the right panel to the 'serverconfig' panel. The 'serverconfig' panel uses the 'config' mode. |
Plots the phase structure. Opens Atomeye and plots the structure. |
Plots the phase structure. Opens Atomeye and plots the structure. |
Open the brower and go to http://groups.google.com/group/diffpy-users |
showMessage(self, info) --> tell user about an exception and so on title -- window title info -- message |
This method is called by the control. Whenever the control needs to communicate directly with the gui it can call this method. The event is processed by onCustom and then handled by the gui on its own terms. |
Update the fitting status. This will alter the local member runningDict so that the running items cannot be altered. The following status ids are defined in the fitting module. Some are given a color which gives the user an indication of the fit status. job is actually a fitting or a calculation object. Fit status INITIALIZED -- 'LIGHT GRAY' CONNECTED -- 'GREEN' CONFIGURED -- 'GREEN' DONE -- 'WHITE' JOB Status VOID QUEUED RUNNING PAUSED |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Fri Apr 10 19:11:03 2009 | http://epydoc.sourceforge.net |