eb1f1f4b049b1263d1c53e6eb6c89aaee799f62d
[hooke.git] / doc / gui.txt
1 *****************
2 The GUI interface
3 *****************
4
5 Orignially by Rolf Schmidt <rschmidt@alcor.concordia.ca>.
6
7 Run the GUI with::
8
9     $ ./bin/hk.py --ui gui
10
11 Alternatively, select `gui` in your config file (see :doc:`config`)::
12
13     [user interfaces]
14     command line = False
15     gui = True
16
17 Interface
18 =========
19 Starting Hooke's GUI for the first time, you will see the central plot
20 area with the current plot surrounded by the following windows (the `F*`
21 key toggles the visibility of the panel):
22
23 * Commands (`F5`)
24 * Folders (`F6`)
25 * Note (`F7`)
26 * Output (`F8`)
27 * Playlists (`F9`)
28 * Properties (`F10`)
29 * Results (`F11`)
30
31 .. image:: img/gui_screenshot.jpg
32
33 Initially, the window will be rather small in order to work with small
34 screen resolutions.  Adjust the size and position to your liking.
35
36 Underneath the menus at thte top of the window there is a navigation
37 toolbar to switch from one curve to another (next/previous).
38
39 Plot area
40 =========
41
42 The plot area displays the current curve.  You can select the data
43 column to use as the x axis using the dropdown menu in the plot
44 navigation bar (under the plot, not to be confused with the navigation
45 bar under the menus).  You can select the columns to plot by clicking
46 the `y column(s)` button and checking interesting columns.  We suggest
47 you stick to columns with a single unit, and not try and dispay, for
48 example, both meters and newtons on the same y axis.
49
50 You can move about the plot using its navigation toolbar.  See the
51 `Matplotlib manual`_ for details.
52
53 .. _Matplotlib manual:
54   http://matplotlib.sourceforge.net/users/navigation_toolbar.html
55
56 You can measure distances and forces directly in the plot.  If you
57 want to know the coordinates of a single point, left click on it.  The
58 index and coordinates of the nearest data point will be displayed in
59 the status bar along with the x and y coordinates of your click.
60
61 To find the distance between two points, just issue the command
62 ``delta``.  You will be asked to click two points.  When you click a
63 point, a blue dot should appear.  When you click the second point, the
64 distances will appear in the output panel.  Hooke automatically
65 adjusts the position of the clicked point to the nearest point in the
66 graph, so you will be always measuring distances and forces between
67 points in the graph.
68
69 .. todo:: Implement blue dots and click handler.
70
71 Folders
72 =======
73 Here you can navigate your file system and double click on a saved
74 playlist to open it.  You can change the initial folder by modifying
75 `workdir` in the `preferences` (core plugin).
76
77 .. todo:: Implement folders panel.
78
79 Playlists
80 =========
81 You can manage several playlists in this window.  As the GUI is rather
82 flexible, it is possible to display the curves from different
83 playlists side by side to compare them (relatively handy when
84 comparing different fit parameters).  You can double-click a file in
85 the playlist to display it in the plot area.  Deleting entire playlists
86 or single files can be accomplished by right-clicking and selecting
87 `Delete`.
88
89 .. todo:: Do we need side-by-side comparison?  How did this work in
90   the old GUI?
91
92 Commands
93 ========
94 All available commands are listed under their corresponding plugin.
95 In order to see a plugin and its commands, you have to edit
96 :file:`hooke.conf` and enable th plugin in the plugins section.
97 Selecting a plugin or command will display the associated properties
98 in the `Properties`_ window.  You can edit the properties and click
99 `Execute` to run the selected command.  If you do not need to modify
100 any properties, you can also double-click a command to run it.
101
102 Mousing over a plugin or command in the `Commands`_ window will
103 display the associated help in a tooltip.  The help for the plugin
104 should give a general description of the plugin.  The help for a
105 command should describe the properties available for this command and
106 suggest reasonable default values if possible.  Feel free to point out
107 missing help content.
108
109 Properties
110 ==========
111 The properties for the command selected in the `Commands`_ window are
112 displayed here.  Edit the properties to your satisfaction (some need to
113 be confirmed by hitting enter, this seems to be a problem in
114 wxPropertyGrid) and click the `Execute` button to run the selected
115 command.  Floating point values are limited to a certain number of
116 decimals (limitation of wxPropertyGrid?) so be careful when using
117 floating point values.
118
119 .. todo:: Document new, non-PropGrid
120   :mod:`~hooke.ui.gui.panel.propertyeditor`.
121
122 Results
123 =======
124 The results from the `autopeak` or `multidistance` commands are
125 displayed here.  Initially, all results are checked (i.e. visible).  If
126 you want to hide a result, simply uncheck it.  Hidden curves will not
127 be exported either.  You can only display one type of fit result (WLC,
128 FJC, etc.) at a time and you can switch between result types (results
129 plugin - show_results).
130
131 .. todo:: Results panel not yet re-implemented.
132
133 Output
134 ======
135 The Output window serves as a log where pertinent information is
136 displayed.  The output is generally the same as what you would see if
137 you were running the commands from the command line.
138
139 Note
140 ====
141 A note can be added to every curve: enter your note and click `Update
142 note`.  With the `note filter playlist` command (`playlist` plugin)
143 you can copy all the curves with a note into a new playlist.
144
145 General remarks
146 ===============
147 Read :doc:`hacking` for an overview of how Hooke works internally and
148 :doc:`config` for more information about configuring Hooke.
149
150 Ignore the text on the `Welcome` tab.  This tab is more like a proof of
151 principle and will contain a short how-to in the future (once the
152 howto is written).
153
154 Hooke's GUI will remember the size and position of the main window
155 (stored in the config file, see :doc:`config`).  You can arrange the
156 panels any which way you like and save this arrangement as a
157 perspective.
158
159 .. image:: img/gui_perspective.jpg
160
161 Hooke will always start with the last used perspective and you can
162 switch from one perspective to another by selecting a perspective from
163 the perspectives menu.  After deleting a perspective, the radio
164 indicator in the perspectives menu disappears (known bug in
165 wxPython).  This is only a visual problem and does not affect anything
166 else.
167
168 In order to pan the plot, zoom in and out and export the plot of your
169 force curves, use the plot toolbar under the plot.  A more detailed
170 description is available on the `Matplotlib website`_
171
172 .. _Matplotlib website:
173   http://matplotlib.sourceforge.net/users/navigation_toolbar.html
174
175 Some plugins and commands
176 =========================
177
178 * overlay (export): exports all retraction curves in a playlist on the
179   same scale.  This is achieved by determining the maximum x window and
180   adding x(max) and x(min) to all curves that are shorter than the
181   maximum x window.  Make sure to filter your playlist before running
182   this command!
183
184 .. todo:: Implement overlay.
185
186 Basic analysis and autopeak
187 ===========================
188
189 .. todo:: Implement autopeak.  Bring in autopeak tutorial from the wiki?
190
191 Please follow the steps in the :doc:`tutorial`.  Instead of typing in
192 the command at the command-line, select it in the `Commands`_ window,
193 set your properties in the `Properties`_ window and click on
194 `Execute` back in the `Commands`_ window.
195
196 The :doc:`autopeak` tutorial is also applicable.  You need to setup the
197 type of fit you want to use: in the Properties of the autopeak command
198 (autopeak plugin) select `WLC`, `FJC` or `FJC_PEG` from the dropdown
199 list for the `polymer model` argument of `polymer fit`.
200
201 Fast curve reviewing and saving
202 ===============================
203 .. todo:: Update curve review tutorial section.
204
205 When automatic routines are not good enough to filter your data, use
206 ``review`` command to cycle through your playlist presenting ten
207 curves in the same graph.  You can then enter the numbers of the
208 interesting curves and automatically save a copy of them into another
209 directory.