= papywizard Developper Guide = * [#Introduction Introduction] * [#API API] * [#Architecture Architecture] * [#Hardware Hardware] * [#Model Model] * [#Custompresets Custom presets] * [#View View] * [#Distributing Distributing] * [#MakeDebianpackage Make Debian package] * [#Thefuture The future] == Introduction == Papywizard is entirely written in python. It uses PyGTK (Python bindings for GTK) toolkit for the GUI, and a few additional modules, mainly for hardware control (pybluez and pyserial). Optionnaly, vpython (OpenGL-based module) can also be used to simulate the position of the head (note that this will be soon a separate application). == API == The API documentation is available as web page in the {{{html/}}} directory. == Architecture == Papywizard uses a MVC-like pattern, which keeps the model separated from the views. This allows to use any other toolkit if needed; I recently switched from Tkinter to PyGTK, to run papywizard on Nokia plateform. I hope, one day, to be able to run papywizard on QTopia-based devices, like Openmoko. But I first need to get such device ;o) Low-levels routines which control the hardware are also in their own package; I plan to made them even more modular, to be used in an external project to control the head. For know, only Merlin/Orion head is supported, but it is very easy to implement other heads. A word about the simulation (to come). === Hardware === === Model === ==== Custom presets ==== The current (1.0) version does not allow user to add its own presets, at least not from the GUI. But it is not very difficult to modify the code to do that. Just edit the: {{{/papywizard/common/config.py}}} file (you may need to become root), and add the new preset(s) in the '''PRESET_INDEX''' and '''PRESET''' vars. The first one is used by the GUI to build the list of presets (in a Combo Box), and contains a double-entry dict. The integer is the position of the preset in the GUI list. The second var contains the presets themselves. Note that the names must match in the 3 locations! A preset is just a python dict., where the key is its name (as listed in the GUI), and the value a list of tuple, where each tuple is the ''(yaw, pitch)'' position to shoot. Note that it is possible to use The {{{None}}} value as position; in this case, the given axis won't move, but rather stay at the previous position. This is mainly used for ''zenith'' and ''nadir'', where the ''yaw'' position does not matter. Example: {{{ PRESET_INDEX = {'4@0 + Z + N': 0, '3@-15 + Z': 1, '6@-15 + 6@30 + N': 2, '3 + 6 + 12 + 6 + 3 (28mm)': 3, 0: '4@0 + Z + N', 1: '3@-15 + Z', 2: '6@-15 + 6@30 + N', 3: '3 + 6 + 12 + 6 + 3 (28mm)'} PRESET = {'4@0 + Z + N': [( 0., 0.), (90., 0.), (180., 0.), (270., 0.), (None, 90.), (None, -90.)], '3@-15 + Z': [( 0., -15.), (120., -15.), (240., -15.), (None, 90.)], '6@-15 + 6@30 + N': [( 0., -15.), ( 60., -15.), (120., -15.), (180., -15.), (240., -15.), (300., -15.), (300., 30.), (240., 30.), (180., 30.), (120., 30.), ( 60., 30.), ( 0., 30.), (None, -90.)], '3 + 6 + 12 + 6 + 3 (28mm)': [( 30., 70.), (150., 70.), (270., 70.), (300., 40.), (240., 40.), (180., 40.), (120., 40.), ( 60., 40.), ( 0., 40.), ( 0., 10.), ( 30., -10.), ( 60., 10.), ( 90., -10.), (120., 10.), (150., -10.), (180., 10.), (210.,-10.), (240., 10.), (270.,-10.), (300., 10.), (330.,-10.), (300., -40.), (240., -40.), (180., -40.), (120., -40.), ( 60., -40.), ( 0., -40.), ( 30., -70.), (150., -70.), (270., -70.)]} }}} === View === == Distributing == === Make Debian package === Papywizard includes an distutils extension script to build debian package in a easy way: {{{ $ python setup.py bdist_debian }}} The package is build in the {{{dist/}}} directory. == The future ==