diff options
author | Thomas White <taw@physics.org> | 2022-11-12 11:13:53 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2022-11-12 11:37:03 +0100 |
commit | 5a02170f9e1952cd335b6b097e8ce33de7bb35b1 (patch) | |
tree | ca21feda4181e444e10e11ce863cc017c69461e7 /docs/basic-control.rst | |
parent | f99311300912814ccaf4fdd6b3c753d1206e024c (diff) |
Introduce new type for attribute names
There's a serious problem with the design so far, where symbols are used
for attribute names (intensity, strobe, colour etc), and also for
attribute values (on, off, random etc). There's no way for 'at' to
tell the difference between the two. For example, this form is
ambiguous: (at myfixture 'strobe 'on)
This commit introduces a new class, <starlet-attribute>, to replace the
use of symbols here. The attributes are enumerated in (starlet attributes),
and new ones can be added later. The attribute objects remember their
'canonical' names, to allow states to be printed.
Apart from solving the ambiguity problem, this has two further
advantages. First, attribute names no longer need to be quoted
everywhere. Second, multiple names can be used to refer to the same
attribute. For example: (define color colour).
Diffstat (limited to 'docs/basic-control.rst')
-rw-r--r-- | docs/basic-control.rst | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/docs/basic-control.rst b/docs/basic-control.rst index f326a5d..dea5ece 100644 --- a/docs/basic-control.rst +++ b/docs/basic-control.rst @@ -5,26 +5,25 @@ Basic attribute control and building states Once your fixtures are patched (see `<patching.rst>`_), you can set attributes sing ``at``. For example, to set the intensity of ``my-dimmer`` to 100%:: - (at my-dimmer 'intensity 100) + (at my-dimmer intensity 100) If you leave out the attribute name, then ``intensity`` will be assumed:: (at my-dimmer 100) The available parameters are determined by the fixture definition (see -`<new-fixture.rst>`_), and are referred to by their symbolic name (i.e. quote -them with ``'``). For example:: +`<new-fixture.rst>`_). For example:: - (at my-moving-light 'pan 32) - (at my-moving-light 'tilt 70) - (at my-moving-light 'zoom 60) + (at my-moving-light pan 32) + (at my-moving-light tilt 70) + (at my-moving-light zoom 60) -Not all fixtures accept a single number. For example, ``'colour`` (note: UK -spelling) takes a colour object, which can be constructed using ``rgb`` or -``cmy``. Starlet (or rather, the fixture definition code) is responsible for -converting the colour to the native representation used by the fixture:: +Not all fixtures accept a single number. For example, ``'colour`` takes a +colour object, which can be constructed using ``rgb`` or ``cmy``. Starlet (or +rather, the fixture definition code) is responsible for converting the colour +to the native representation used by the fixture:: - (at my-moving-light 'colour (rgb 80 23 25)) + (at my-moving-light colour (rgb 80 23 25)) You can set attributes for multiple fixtures at once:: @@ -55,9 +54,9 @@ call ``(sel #f)`` or simply ``(sel)``:: (sel my-moving-light) (at 100) - (at 'colour (rgb 80 23 25)) - (at 'tilt 70) - (at 'pan 32) + (at colour (rgb 80 23 25)) + (at tilt 70) + (at pan 32) (sel #f) The fixture display window (see `<fixture-display.rst>`_) will highlight the |