Finished remarking doc/gui.txt in Sphinx's reStructuredText.
[hooke.git] / doc / gui.txt
1 *****************
2 The GUI interface
3 *****************
4
5 by Rolf Schmidt <rschmidt@alcor.concordia.ca>
6
7 Enable by selecting `gui` in your :file:`hooke.cfg`.::
8
9     [user interfaces]
10     command line = False
11     gui = True
12
13 Interface
14 =========
15 Starting Hooke's GUI for the first time, you will see the central plot
16 area with the current plot surrounded by the following windows (the `F*`
17 key toggles the visibility of the panel):
18
19   # Folders (`F5`)
20   # Playlists (`F6`)
21   # Commands (or Settings and commands) (`F7`)
22   # Properties (`F8`)
23   # Assistant (`F9`)
24   # Results (`F10`)
25   # Output (`F11`)
26   # Note (`F12`)
27
28 .. image:: img/gui_screenshot.jpg
29
30 Initially, the window will be rather small in order to work with small
31 screen resolutions. Adjust the size and position to your liking.
32
33 Above the windows you see the navigation toolbar to switch from one
34 curve to another (next/previous).
35
36 Plot area
37 =========
38 The plot area can be customised by setting `preferences` in the core plugin.
39
40 * hide_curve_extension: hides the curve extension in the title of the
41   plot (and from the playlist in the playlists panel)
42 * legend: show or hide the legend
43 * use_zero: display `0` instead of e.g. `0.00` on the axes
44 * decimals (x_decimals, y_decimals): set the decimal places for the x
45   and y axes
46 * prefixes(x_prefix, y_prefix): set the prefix for the x and y axes
47
48 These are global settings. Individual plots can be customised with the
49 same options (except hide_curve_extension) by setting `preferences` in
50 the plot plugin.
51
52 Folders
53 =======
54 Here you can navigate your file system and double click on a saved
55 playlist to open it. You can change the initial folder by modifying
56 `workdir` in the `preferences` (core plugin).
57
58 Playlists
59 =========
60 You can manage several playlists in this window. As the GUI is rather
61 flexible, it is possible to display the curves from different
62 playlists side by side to compare them (relatively handy when
63 comparing different fit parameters). You can double-click a file in
64 the playlist to display it in the plot area. Deleting entire playlists
65 or single files can be accomplished by right-clicking and selecting
66 `Delete`.
67
68 Commands (or Settings and commands)
69 ===================================
70 All available commands are listed under their corresponding plugin. In
71 order to see a plugin and its commands, you have to edit
72 :file:`hooke.conf` and enable th plugin in the plugins section.
73 Selecting a plugin or command will display the associated help in the
74 `Assistant`_ window. You can edit the properties of the selected
75 command in the `Properties`_ window and click `Execute` to run the
76 selected command. If you do not need to modify any properties, you can
77 also double-click a command to run it.
78
79 Properties
80 ==========
81 The properties for the command selected in the `Commands`_ window are
82 displayed here. Edit the properties to your satisfaction (some need to
83 be confirmed by hitting enter, this seems to be a problem in
84 wxPropertyGrid) and click the `Execute` button to run the selected
85 command. Floating point values are limited to a certain number of
86 decimals (limitation of wxPropertyGrid?) so be careful when using
87 floating point values.
88
89 Assistant
90 =========
91 Selecting a plugin or command in the `Commands`_ window will display the
92 associated help here. The help for the plugin should give a general
93 description of the plugin. The help for a command should describe the
94 properties available for this command and suggest reasonable default
95 values if possible. Feel free to point out missing help content.
96
97 Results
98 =======
99 The results from the `autopeak` or `multidistance` commands are
100 displayed here. Initially, all results are checked (i.e. visible). If
101 you want to hide a result, simply uncheck it. Hidden curves will not
102 be exported either. You can only display one type of fit result (WLC,
103 FJC, etc.) at a time and you can switch between result types (results
104 plugin - show_results).
105
106 Output
107 ======
108 The Output window serves as a log where pertinent information is
109 displayed. If something does not work the way you expect it, have a
110 look here to see if there is more information available.
111
112 Note
113 ====
114 A note can be added to every curve: enter your note and click
115 `Update note`. With the copylog command (core plugin) you can copy all
116 the files with a note to a different folder.
117
118 General remarks
119 ===============
120 Ignore the text on the `Welcome` tab. This tab is more like a proof of
121 principle and will contain a short how-to in the future (once the
122 howto is written).
123
124 Hooke's GUI will remember the size and position of the main window
125 (stored in ~/.hooke-gui.cfg).  You can arrange the panels any which
126 way you like and save this arrangement as a perspective.
127
128 .. image:: img/gui_perspective.jpg
129
130 Hooke will always start with the last used perspective and you can
131 switch from one perspective to another by selecting a perspective from
132 the perspectives menu. After deleting a perspective, the radio
133 indicator in the perspectives menu disappears (known bug in
134 wxPython). This is only a visual problem and does not affect anything
135 else.
136
137 In order to pan the plot, zoom in and out and export the plot of your
138 force curves, use the plot toolbar under the plot. A more detailed
139 description is available on the `matplotlib website`_
140
141 .. _matplotlib website:
142   http://matplotlib.sourceforge.net/users/navigation_toolbar.html
143
144
145 Some plugins and commands
146 =========================
147
148 * replot (plot): replots the current force curve from scratch
149   eliminating any secondary plots.
150 * fjc/fjcPEG/wlc (fit): do not use any of these commands directly,
151   they are not implemented properly yet. However, the properties you
152   set for these commands are used for the autopeak command.
153 * plotmanipulators (core): select the plotmanipulators you want to use
154   and arrange them in the proper order.
155 * test (test): use this for testing purposes. You find do_test in
156   hooke.py.
157 * clear_results (results): deletes all fitting results from the curve.
158 * show_results (results): select which fitting results should be
159   displayed on the plot.
160 * overlay (export): exports all retraction curves in a playlist on the
161   same scale. This is achieved by determining the maximum x window and
162   adding x(max) and x(min) to all curves that are shorter than the
163   maximum x window. Make sure to filter your playlist before running
164   this command!
165
166 Basic analysis and autopeak
167 ===========================
168 Please follow the steps in the :doc:`tutorial`. Instead of typing in
169 the command at the command-line, select it in the `Commands`_ window,
170 set your properties in the `Properties`_ window and click on
171 `Execute`.
172
173 The :doc:`autopeak` tutorial is also applicable. You need to setup the
174 type of fit you want to use: in the Properties of the autopeak command
175 (autopeak plugin) select `wlc`, `fjc` or `fjcPEG` from the dropdown
176 list for the `fit_function`.
177
178 If you run different fits (e.g. WLC and FJC) you can switch the
179 display of the results with the `show_results` command (`results`
180 plugin).
181
182 Brief plugin/Properties tutorial
183 ================================
184 Have a look at the files in the `plugins` folder. The python files
185 contain the plot manipulators (i.e. `plotmanip_NAME`), commands
186 (i.e. `do_COMMAND`) and auxilliary methods. The :file:`*.ini` files
187 contain the information for the `Properties`_ window. You can already
188 use a fair number of datatypes (e.g. integer, float, boolean, list,
189 color, etc.) and more can be added. Be careful when using floats as
190 there is a limit to the number of decimals (see above). The
191 plotmanipulators and commands should read the properties directly from
192 the :file:`*.ini` file instead of having them passed to them as
193 arguments. For the time being, accessor methods are located in
194 `hooke.py` (e.g. `GetBoolFromConfig()`).  A more detailed description
195 will be made available.