[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob/doc design_custominput.rst
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob/doc design_custominput.rst |
Date: |
Fri, 27 Jun 2003 10:22:17 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/06/27 10:22:16
Modified files:
doc : design_custominput.rst
Log message:
More
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/design_custominput.rst.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: libvob/doc/design_custominput.rst
diff -u libvob/doc/design_custominput.rst:1.1
libvob/doc/design_custominput.rst:1.2
--- libvob/doc/design_custominput.rst:1.1 Thu Jun 26 04:50:59 2003
+++ libvob/doc/design_custominput.rst Fri Jun 27 10:22:16 2003
@@ -34,7 +34,7 @@
There are also different uses for the axes inside:
- to control the value of some parameter absolutely, so the position
- should be converted to an absolute number between 0 and 1, or -1 and 1.
+ should be converted to an absolute number between 0 and 1.
An event should be sent whenever the number changes, but noise should
be filtered.
@@ -59,9 +59,98 @@
Need to support both axes received from mice and actual joysticks.
+The system has to be extensible to several input devices.
+
Calibration
-----------
The calibration process needs to be trivial: press a key, wriggle
the device to extreme positions, and press another key.
+
+When several input devices are used, they should detect among themselves,
+*which* ones of them the user is trying to calibrate.
+
+Getting information
+-------------------
+
+Each input device should define names and characteristics for the axes,
+for programs to show the user what can be connected to what.
+
+
+Design
+======
+
+First of all, a central class which allows programs to access the currently
+configured input devices: ``InputDeviceManager``. From this class, users may
get
+instances of the ``InputDevice`` class. This class also contains the methods
for
+beginning and ending calibration.
+
+The ``InputDevice`` classes again allow users to get the axes.
+
+.. UML:: custominput_1
+
+ class InputDeviceManager
+
+ class InputDevice
+
+ class Axis
+ methods
+ void setMainAxisListener()
+
+ class AxisListener "interface"
+ methods
+ void changed(float value)
+
+ class AbsoluteAxisListener "interface"
+ inherit AxisListener
+
+ class RelativeAxisListener "interface"
+ inherit AxisListener
+
+ class AbsoluteLinearAxisListener
+ realize AbsoluteAxisListener
+ fields
+ AbsoluteAxisListener child
+ float min, max
+
+ class AbsoluteLogAxisListener
+ realize AbsoluteAxisListener
+ fields
+ AbsoluteAxisListener child
+ float min, max
+
+ class FirstDerivativeAxisListener
+ fields
+ AbsoluteAxisListener child
+ float min, max
+ float value
+ float sensitivity
+
+ class RelativeModAxisListener
+ fields
+ AbsoluteAxisListener child
+ float mod
+ float value
+
+
+The user end of the picture is handled by the "model" classes: this is a
design similar
+to swing.
+
+ class BoundedFloatModel "interface"
+ fields
+ minimum
+ maximum
+ value
+ methods
+ addActionListener(...)
+
+XXX
+
+There can only be one main axis listener per axis - to not confuse the user.
+If desired, we may later add the capability to put in "non-main" listeners.
+
+.. vim: set syntax=text
+
+An example use in python code would
+