= Papywizard Developper Guide = * [#Introduction Introduction] * [#API API] * [#Architecture Architecture] * [#Hardware Hardware] * [#Model Model] * [#Custompresets Custom presets] * [#View View] * [#Distributing Distributing] * [#Makedebianpackage Make Debian package] * [#Makemaemopackage Make Maemo package] * [#Makewindowsinstaller Make Windows installer] * [#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 === ==== Merlin/Orion protocole ==== Paramètres utilisés : * : 1=vertical, 2=horizontal (1 ascii digit) * position coded with 24 bits (6 ascii digits, hex). Le poids faible est envoyé en premier (A35483 se lit 8354A3). À la mise sous tension, la valeur est 800000. Le sens Right incrémente la valeur de l'axe 1, le sens Left décrémente la valeur. Le sens Up incrémente la valeur de l'axe 2, le sens Down décrémente la valeur. Un tour (360°) correspond à un incrément de 0E6600 (soient presque 9 tours possibles dans chaque direction). Lecture de la position d'un axe : commande réponse :j = Lecture du statut d'un axe : commande réponse :f = === Merlin/Orion commands === At switch on: commande réponse :F1 = :F2 = :a1 =D3620E :D1 =F90600 :a2 =D3620E :D2 =F90600 :D2 =F90600 Appui sur le bouton UP, en mode Fast : commande réponse :L2 = :G230 = :I2220000 = :J2 = Relâchement du bouton UP, en mode Fast : commande réponse :L2 = :f2 =503 === Model === === View === == Distributing == === Make Debian package === Papywizard includes an distutils extension script to build debian package in a easy way: {{{ $ python debian/setup.py bdist_debian }}} The package is build in the {{{dist/}}} directory. === Make Maemo package === Same for debian package: {{{ $ python maemo/setup.py bdist_debian }}} === Make Windows installer === This is a little bit tricky (as always on this plateform!). You first need to build the executable, by launching the windows setup script. The easier is to use [http://ipython.scipy.org Ipython]: {{{ In [1]: run windows/setup.py py2exe }}} Then, run the script {{{windows/papywizard.nsi}}} (need to install NSIS software) to build the installer itself. == The future ==