Personal tools
You are here: Home Software CcpNmr Analysis Coding Library Argument Server
Document Actions

Argument Server

by Tim Stevens last modified 2006-03-16 23:02

The Analysis object that serves macros with data model objects

Currently available functions

These functions are available from the instance of ArgumentServer which is automatically passed into Analysis macros as an argument. Using these functions allows the macro to get a hendle on many of the objects available within Analysis without having to make extensive use of the Data Model.

Several of these functions relate to objects that have been specified by user using graphical means. Also, many of the other functions maybe used when Analysis is not in graphical mode, thus allowing a macro to take arguments from the Python command line. These functions will work with graphics if they are available.

Function Description
getProgressBar Provides a progress bar object which may be used in macros to indicate graphically the proportion of its completion.
chooseObject Displays a list of the input objects so that the user can choose one form among them. Works with a single type of otherwise arbitrary Data Model objects.
objectSelectionPopup Pops up a list of the input objects so that the user can choose one form among them. Works with a single type of otherwise arbitrary Data Model objects. Note that this function is only of use if the macro is used with Analysis in graphical mode - it had no ability to fall back to the python shell.
askString Pops up a dialogue box to promt for an arbitrary string input
askInteger Pops up a dialogue box to promt for an arbitrary integer
askFloat Pops up a dialogue box to promt for an arbitrary floating point number
askYesNo Provides a dialogue box with a specified message with [Yes] and [No] buttons below. Clicking these return True and False respectively.
showWarning Provides a dialogue box with a specified warning message with and an [OK] button. Clicking [OK] removes the dialogue and allows the program to continue.
showInfo
getCurrentPeaks Returns the peaks that are currently selected within analysis. These are the boxed crosspeaks visible in the spectrum windows and listed in SelectedPeaksPopup
getCurrentPeak Returns the crosspeak currently under the mouse cursor when the WindowPopup right mouse menu was activated. It is intended that macros that use this function are bound to the right mouse menu.
getCurrentWindow Returns the spectrum window currently under the mouse cursor when the WindowPopup right mouse menu was activated. It is intended that macros that use this function are bound to the right mouse menu.
getCurrentWindowPopup Returns the WindowPopup in which the right mouse menu was last activated. It is intended that macros that use this function are bound to the right mouse menu.
getCurrentSpectra Returns the currently visible spectra in the spectrum window under the mouse cursor when the WindowPopup right mouse menu was activated. It is intended that macros that use this function are bound to the right mouse menu.
getCurrentPeakLists Returns the active peak lists of currently visible spectra in the spectrum window under the mouse cursor when the WindowPopup right mouse menu was activated. It is intended that macros that use this function are bound to the right mouse menu.
getCurrentPosition Returns poistion the mouse cursor (as a dictionary {'x': ,'y': , 'z1':}) in units appropriate to the axes of the window (usually PPM) when the WindowPopup right mouse menu was last activated. It is intended that macros that use this function are bound to the right mouse menu.
getCurrentSpectrum Returns the spectrum containing the crosspeak currently under the mouse cursor when the WindowPopup right mouse menu was activated. It is intended that macros that use this function are bound to the right mouse menu.
getSpectrum Gets a spectrum from the current project. If more than one spectrum is present the user is prompted to choose one.
getPeakList Gets a peak list from the current project. If more than one is present, the user is prompted to choose one via a series of lists that decends the object hierarchy.
getPeak Gets a peak from the current project. If more than one is present, the user is prompted to choose one via a series of lists that decends the object hierarchy.
getCurrentPeakDim Allows the user to select a peak dimension from the currently selected peak.
getProject Returns the top level project object of the ArgumentServer, i.e. the one that is active within Analysis.
getResonance Gets a resonance object from the current project. If more than one is present, the user is prompted to choose one from a list.
getViolationList Gets a violation list from the current project. The user is prompted to choose one via a series of lists that decends the object hierarchy.
getConstraint Gets a constraint from the current project. The user is prompted to choose one via a series of lists that decends the object hierarchy.
getStructure Gets a structure from the current project. If more than one is present, the user is prompted to choose one from a list.
getStructureGeneration Gets a structure generation from the current project. If more than one is present, the user is prompted to choose one from a list.
getExperiment Gets an NMR experiment (the session object not its prototype/template) from the current project. If more than one is present, the user is prompted to choose one from a list.
getWindow Gets a spectrum window from the current project. If more than one is present, the user is prompted to choose one from a list.
getColor Gets a Color from the current project. The user is prompted to choose one from a list.
getColorScheme Gets a colour scheme from the current project. If more than one is present, the user is prompted to choose one from a list.
getShiftList Gets a shift list from the current project. If more than one is present, the user is prompted to choose one from a list.
getSpinSystem Gets a spin system (ResonanceGroup) from the current project. If more than one is present, the user is prompted to choose one from a list.
getChain Gets a Chain from the current project's molsystems. The user is prompted to choose one via a series of lists that decends the object hierarchy.
getResidue Gets a residue from the current project's molSystems. The user is prompted to choose one via a series of lists that decends the object hierarchy.
getAtomSet Gets an atomSet from the current project. If more than one is present, the user is prompted to choose one from a list.
getAtom Gets an atom from the current project's molSystems. The user is prompted to choose one via a series of lists that decends the object hierarchy.
getIsotope Gets an isotope from the current project. If more than one is present, the user is prompted to choose one from a list.


Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: