File: communication.txt
Last modified: 24-feb-2007

User program interactive communication

There are three devices "mouse", "keyboard" and "dials" you can use to interact with the program once its is up and running.

MAIN creates three windows:

3D graphics window interactions

Mouse

The mouse can be used besides for picking atoms as a substitute input from dials.

It has 3 buttons: left (L), middle (M) and right(R). When one or two of them are pressed and moved, they replace input from the current dials set. By default:

The left button (L) can control rotations around X, Y and Z axis. When the cursor is moved within a circle of the image window center, the horizontal movements correspond to rotation about Y axis and vertical about X axis. If cursor is moved outside the circle, its' movement results in rotation about Z axis.

The middle button (M) controls translations along X and Y direction.

The left and middle button (LM) pressed together and moved vertically translate image along the Z direction.

The right button (R) controls scaling of the image (zoom). When cursor is moved towards the center of the image window, the image is shrunk, and when it is moving away from it, the image is expanded.

The right and middle button (RM) pressed together control clipping. When the cursor is moved towards the center of the image window, the clipping planes are moved together, and when it is moving away from it, the separation between the clipping planes is increased.

Changing dial definitions will also change the mouse button functions. In general, pressed middle button (M) mimics dials 1 and 2, pressed left and middle button (LM) mimic dial 3, right button (R) mimic dial 4, left button (L) mimics dials 5, 6 and 7, and combination of right and middle button (RM) mimic dial 8. (Dial numbering is two rows: 1-4, 5-8).

Releasing a mouse button while still moving the cursor results in a continuation repetition of the last move before the release. So smooth rotations of image on the screen can be achieved.

Mouse trouble shooting

When mouse doesn't behave properly it needs to be resetted. This happens quite often (on HP it is a rule) when the image window is iconized and then restored.

So reset the mouse by pressing any keyboard character key or type commands


> image mouse off
> image mouse on

If you get anoyed with dial rotations (you are unable to pick atoms because you keep moving the image), turn the mouse dial mimicking functions off:


> image mouse off

Keyboard shortcuts: magic of a keyboard touch

Pressing keys is usually the quickest way for an experienced user to issue commands. Keyboard single key shortcuts require no confirmation and are always at the tip of your fingers. They deal with image manipulation and they serve as shortcuts for some of the mostly applied clicks.

Currently these functions are supported:

Besides, each time a key is pressed, the mouse event mask is reset to avoid mouse events hangups due to Xwindows server client communication problems (bugs).

Arrow keys

The "arrow" keys mimic dials.

The yellow color shows to which pair of dials are arrow keys assigned.

Pressing "Home", "PgUp", "End", "PgDn" changes their assignment.

Dials

If you have them use them. They provide you with the best control of manual model building.

"Depp pages" window

You can select and trigger functions only with the mouse. The right mouse button clicks functions, the left one is reserved for future use to invoke configration windows.

Dials label window

It accepts no input. It only shows the current dial box and arrow key assignments.

User menu block communication

The arrow shape cursos indicates the program awaits new events from the interactive devices (mouse, dials and keyboard).

When an ITEM is clicked the cursor is changed from an arrow to a clock pointing that MAIN is executing the submitted commands. The arrow shape of the cursor reapears after the commands have been completed.

"help" mode is activated by pressing "H" in the image window and indicated by the cursor change into the question mark. When items are clicked in the help mode, their documentation is written into the terminal window and no command is submitted. Another "H" returns clicking of items into the working mode indicated by the "arrow" cursor shape.

Using menu items

Clicking a menu item always does something. A user is never asked for a confirmation, except in the case of deleting "active" atoms.

Arguments to items are hanging. They are always available (unless a list is empty). They are taken from:

The general philosophy is that you first define an argument and afterwards activate the function. This way the same argument can be reused in many functions, besides the argument list can be edited so that the atom clicked by mistake can be removed with no need to cancel the function. So approval of a command is not necessary. One level of "UN_DO" for coordinate changes can return the geometry of a model to its previous state.

Menu arguments: History list

Atoms are arguments. more precisely they become potential arguments, by clicking. When clicked, an atom is pushed on the top of the history list and a white label is displayed at the position of the atom. The last one clicked is always the first one on the list. The last atom can be dropped from the list ("HIS_DROP"). The whole history list can be cleared with "HIS_CLEA". The "HIS_DIST" allows you to measure and monitor interatomic distances when moving the atoms around. For more about history items see MAIN_MENU:history.html.

You can control the information displayed in the label. "IMAGE HISTORY" commands manipulate the history list and history functions. See MAIN_COM:image.html.

Menu arguments: Selection keys

The history list is created by clicking atoms. Atomic selections are usually created by providing history atoms to the "SELECT NICE" and "SELECT LONG" menu blocks. You can, however, at any moment choose to use the command language to define or redefine any of the keyed arguments. The most commonly used keys are "active", "passive" and ""image"".

Key "active" tells that something will happen with the selection of atoms (MINIMIZE, for example, will allow to move only active atoms). the key "image" contains the list of pickable atoms, ...

"KEY something SELECT ... END" commands manipulate the keys. See MAIN_COM:select.html.

There is also "WORK_REFL" key, which does not mark a list of atoms but reflections. It is a key, in contrast to "WORK_SEGM", which is a variable.

Menu arguments: inquired variables

Some arguments are inquired. You have to respond with a typed an answer, which can be either an integer or real number or a string. The resulting variables are either immediately applied ("LOAD_PDB") and also deleted after their use, or stored as GLOBAL variables to be used later in combination with other items ("MAP_ACT" and other map related menu items). Command


> show vari

reveals the current variable list and their values. For instructions how to set variables see "SET VARIABLE" in MAIN_COM:set.html.

Menu arguments: predefined variables

Some variables are defined in the initial macros as global variables and then used throughout the MAIN macros environment to pass some common arguments.

The variable "WORK_SEGM" contains a list of working SEGMENT NAMES. It is used to pass the list to various macros, which then use the list in their SELECT commands. "RE_IMAGE", "SYMMETRY", "REFINE" are only some of them. The variable is defined through "create_main_config.pl" tools in a "read.com" file and can be verified with "SHW_SEGM" updated with "UPD_SEGM" menu items. If the variable doesn't exist, or contains the wrong segment names, essentially nothing will work, unless you have created your own working environment.

In a "read.com" map variables "MAP_2FOFC", "MAP_FOBS" are defined in order to differentiate among various created maps.

The "DEF_ALL" variable is defined in a MAIN_UTILS:get_top_par_19_csd.com or similar script and it points to a macro, which assigns atom types and creates lists necessary for energy calculations.