The source/values toolkit

Me and my big mouth. No sooner do I declare the base classes "relatively
stable" than I go and mess around with it all again. Anyway, this is the
long promised set of utilities to make source/values more interesting.
It includes a few interesting little utility functions, a whole bunch of
examples and introduces the notion of "pseudo" devices with no (obvious)
hardware representation like a time-of-day device.

This necessitated making the event system a little more generic (it's
not exclusive the GPIO devices after all; no reason we can't use it on
composite devices in future) and by this point the mixins have gotten
large enough to justify their own module.

The pseudo-devices are a bit spartan and basic at the moment but I'm
sure there'll be plenty of future ideas...
This commit is contained in:
Dave Jones
2016-04-04 01:34:53 +01:00
parent 365e309af6
commit 69dd8a439a
23 changed files with 1091 additions and 423 deletions

View File

@@ -41,6 +41,8 @@ Errors
.. autoexception:: DeviceClosed
.. autoexception:: BadEventHandler
.. autoexception:: CompositeDeviceError
.. autoexception:: CompositeDeviceBadName

View File

@@ -16,6 +16,9 @@ classes:
* :class:`SPIDevice` represents devices that communicate over an SPI interface
(implemented as four GPIO pins)
* :class:`InternalDevice` represents devices that are entirely internal to
the Pi (usually operating system related services)
* :class:`CompositeDevice` represents devices composed of multiple other
devices like HATs
@@ -31,6 +34,9 @@ There are also several `mixin classes`_:
* :class:`SharedMixin` which causes classes to track their construction and
return existing instances when equivalent constructor arguments are passed
* :class:`EventsMixin` which adds activated/deactivated events to devices
along with the machinery to trigger those events
.. _mixin classes: https://en.wikipedia.org/wiki/Mixin
The current class hierarchies are displayed below. For brevity, the mixin
@@ -47,6 +53,10 @@ Next, the classes below :class:`SPIDevice`:
.. image:: images/spi_device_hierarchy.*
Next, the classes below :class:`InternalDevice`:
.. image:: images/other_device_hierarchy.*
Next, the classes below :class:`CompositeDevice`:
.. image:: images/composite_device_hierarchy.*
@@ -60,15 +70,18 @@ Base Classes
============
.. autoclass:: Device
:members: close, closed
:members: close, closed, value, is_active
.. autoclass:: GPIODevice(pin)
:members:
.. autoclass:: CompositeDevice
.. autoclass:: SPIDevice
:members:
.. autoclass:: SPIDevice
.. autoclass:: InternalDevice
:members:
.. autoclass:: CompositeDevice
:members:
Input Devices
@@ -77,9 +90,6 @@ Input Devices
.. autoclass:: InputDevice(pin, pull_up=False)
:members:
.. autoclass:: WaitableInputDevice
:members:
.. autoclass:: DigitalInputDevice(pin, pull_up=False, bounce_time=None)
:members:
@@ -128,3 +138,6 @@ Mixin Classes
.. autoclass:: SharedMixin(...)
:members: _shared_key
.. autoclass:: EventsMixin(...)
:members:

14
docs/api_other.rst Normal file
View File

@@ -0,0 +1,14 @@
================
Internal Devices
================
.. currentmodule:: gpiozero
GPIO Zero also provides several "internal" devices which represent facilities
provided by the operating system itself. These can be used to react to things
like the time of day, or whether a server is available on the network.
.. autoclass:: TimeOfDay
.. autoclass:: PingServer

49
docs/api_source_tools.rst Normal file
View File

@@ -0,0 +1,49 @@
============
Source Tools
============
.. currentmodule:: gpiozero
GPIO Zero includes several utility routines which are intended to be used with
the :attr:`~SourceMixin.source` and :attr:`~ValuesMixin.values` attributes
common to most devices in the library. Given that ``source`` and ``values``
deal with infinite iterators, another excellent source of utilities is the
:mod:`itertools` module in the standard library.
Single source conversions
=========================
.. autofunction:: negated
.. autofunction:: inverted
.. autofunction:: scaled
.. autofunction:: clamped
.. autofunction:: post_delayed
.. autofunction:: pre_delayed
.. autofunction:: quantized
.. autofunction:: queued
Combining sources
=================
.. autofunction:: conjunction
.. autofunction:: disjunction
.. autofunction:: averaged
Artifical sources
=================
.. autofunction:: random_values
.. autofunction:: sin_values
.. autofunction:: cos_values

View File

@@ -9,7 +9,6 @@ digraph classes {
node [color="#9ec6e0", fontcolor="#000000"]
Device;
GPIODevice;
WaitableInputDevice;
SmoothedInputDevice;
/* Concrete classes */
@@ -17,9 +16,8 @@ digraph classes {
GPIODevice->Device;
InputDevice->GPIODevice;
WaitableInputDevice->InputDevice;
DigitalInputDevice->WaitableInputDevice;
SmoothedInputDevice->WaitableInputDevice;
DigitalInputDevice->InputDevice;
SmoothedInputDevice->InputDevice;
Button->DigitalInputDevice;
MotionSensor->SmoothedInputDevice;
LightSensor->SmoothedInputDevice;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -4,175 +4,165 @@
<!-- Generated by graphviz version 2.36.0 (20140111.2315)
-->
<!-- Title: classes Pages: 1 -->
<svg width="701pt" height="404pt"
viewBox="0.00 0.00 701.00 404.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 400)">
<svg width="721pt" height="332pt"
viewBox="0.00 0.00 721.00 332.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 328)">
<title>classes</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-400 697,-400 697,4 -4,4"/>
<polygon fill="white" stroke="none" points="-4,4 -4,-328 717,-328 717,4 -4,4"/>
<!-- Device -->
<g id="node1" class="node"><title>Device</title>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="485,-396 431,-396 431,-360 485,-360 485,-396"/>
<text text-anchor="middle" x="458" y="-375.5" font-family="Sans" font-size="10.00" fill="#000000">Device</text>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="499,-324 445,-324 445,-288 499,-288 499,-324"/>
<text text-anchor="middle" x="472" y="-303.5" font-family="Sans" font-size="10.00" fill="#000000">Device</text>
</g>
<!-- GPIODevice -->
<g id="node2" class="node"><title>GPIODevice</title>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="494,-324 422,-324 422,-288 494,-288 494,-324"/>
<text text-anchor="middle" x="458" y="-303.5" font-family="Sans" font-size="10.00" fill="#000000">GPIODevice</text>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="508,-252 436,-252 436,-216 508,-216 508,-252"/>
<text text-anchor="middle" x="472" y="-231.5" font-family="Sans" font-size="10.00" fill="#000000">GPIODevice</text>
</g>
<!-- GPIODevice&#45;&gt;Device -->
<g id="edge1" class="edge"><title>GPIODevice&#45;&gt;Device</title>
<path fill="none" stroke="black" d="M458,-324.303C458,-332.017 458,-341.288 458,-349.888"/>
<polygon fill="black" stroke="black" points="454.5,-349.896 458,-359.896 461.5,-349.896 454.5,-349.896"/>
</g>
<!-- WaitableInputDevice -->
<g id="node3" class="node"><title>WaitableInputDevice</title>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="440.5,-180 327.5,-180 327.5,-144 440.5,-144 440.5,-180"/>
<text text-anchor="middle" x="384" y="-159.5" font-family="Sans" font-size="10.00" fill="#000000">WaitableInputDevice</text>
</g>
<!-- InputDevice -->
<g id="node5" class="node"><title>InputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="438.5,-252 365.5,-252 365.5,-216 438.5,-216 438.5,-252"/>
<text text-anchor="middle" x="402" y="-231.5" font-family="Sans" font-size="10.00" fill="#ffffff">InputDevice</text>
</g>
<!-- WaitableInputDevice&#45;&gt;InputDevice -->
<g id="edge3" class="edge"><title>WaitableInputDevice&#45;&gt;InputDevice</title>
<path fill="none" stroke="black" d="M388.449,-180.303C390.455,-188.102 392.869,-197.491 395.101,-206.171"/>
<polygon fill="black" stroke="black" points="391.722,-207.082 397.602,-215.896 398.501,-205.339 391.722,-207.082"/>
<path fill="none" stroke="black" d="M472,-252.303C472,-260.017 472,-269.288 472,-277.888"/>
<polygon fill="black" stroke="black" points="468.5,-277.896 472,-287.896 475.5,-277.896 468.5,-277.896"/>
</g>
<!-- SmoothedInputDevice -->
<g id="node4" class="node"><title>SmoothedInputDevice</title>
<g id="node3" class="node"><title>SmoothedInputDevice</title>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="289.5,-108 166.5,-108 166.5,-72 289.5,-72 289.5,-108"/>
<text text-anchor="middle" x="228" y="-87.5" font-family="Sans" font-size="10.00" fill="#000000">SmoothedInputDevice</text>
</g>
<!-- SmoothedInputDevice&#45;&gt;WaitableInputDevice -->
<g id="edge5" class="edge"><title>SmoothedInputDevice&#45;&gt;WaitableInputDevice</title>
<path fill="none" stroke="black" d="M266.162,-108.124C287.393,-117.651 314.008,-129.593 336.569,-139.717"/>
<polygon fill="black" stroke="black" points="335.406,-143.031 345.962,-143.932 338.271,-136.644 335.406,-143.031"/>
<!-- InputDevice -->
<g id="node4" class="node"><title>InputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="445.5,-180 372.5,-180 372.5,-144 445.5,-144 445.5,-180"/>
<text text-anchor="middle" x="409" y="-159.5" font-family="Sans" font-size="10.00" fill="#ffffff">InputDevice</text>
</g>
<!-- SmoothedInputDevice&#45;&gt;InputDevice -->
<g id="edge4" class="edge"><title>SmoothedInputDevice&#45;&gt;InputDevice</title>
<path fill="none" stroke="black" d="M272.278,-108.124C299.802,-118.769 335.123,-132.429 362.97,-143.198"/>
<polygon fill="black" stroke="black" points="361.893,-146.535 372.483,-146.877 364.418,-140.006 361.893,-146.535"/>
</g>
<!-- InputDevice&#45;&gt;GPIODevice -->
<g id="edge2" class="edge"><title>InputDevice&#45;&gt;GPIODevice</title>
<path fill="none" stroke="black" d="M415.843,-252.303C422.489,-260.611 430.578,-270.723 437.887,-279.859"/>
<polygon fill="black" stroke="black" points="435.336,-282.273 444.317,-287.896 440.803,-277.901 435.336,-282.273"/>
<path fill="none" stroke="black" d="M424.573,-180.303C432.202,-188.78 441.523,-199.136 449.876,-208.417"/>
<polygon fill="black" stroke="black" points="447.315,-210.804 456.606,-215.896 452.518,-206.121 447.315,-210.804"/>
</g>
<!-- DigitalInputDevice -->
<g id="node6" class="node"><title>DigitalInputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="439.5,-108 336.5,-108 336.5,-72 439.5,-72 439.5,-108"/>
<text text-anchor="middle" x="388" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">DigitalInputDevice</text>
<g id="node5" class="node"><title>DigitalInputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="460.5,-108 357.5,-108 357.5,-72 460.5,-72 460.5,-108"/>
<text text-anchor="middle" x="409" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">DigitalInputDevice</text>
</g>
<!-- DigitalInputDevice&#45;&gt;WaitableInputDevice -->
<g id="edge4" class="edge"><title>DigitalInputDevice&#45;&gt;WaitableInputDevice</title>
<path fill="none" stroke="black" d="M387.011,-108.303C386.57,-116.017 386.041,-125.288 385.549,-133.888"/>
<polygon fill="black" stroke="black" points="382.054,-133.712 384.977,-143.896 389.042,-134.112 382.054,-133.712"/>
<!-- DigitalInputDevice&#45;&gt;InputDevice -->
<g id="edge3" class="edge"><title>DigitalInputDevice&#45;&gt;InputDevice</title>
<path fill="none" stroke="black" d="M409,-108.303C409,-116.017 409,-125.288 409,-133.888"/>
<polygon fill="black" stroke="black" points="405.5,-133.896 409,-143.896 412.5,-133.896 405.5,-133.896"/>
</g>
<!-- Button -->
<g id="node7" class="node"><title>Button</title>
<g id="node6" class="node"><title>Button</title>
<polygon fill="#2980b9" stroke="#2980b9" points="445,-36 391,-36 391,-0 445,-0 445,-36"/>
<text text-anchor="middle" x="418" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">Button</text>
</g>
<!-- Button&#45;&gt;DigitalInputDevice -->
<g id="edge6" class="edge"><title>Button&#45;&gt;DigitalInputDevice</title>
<path fill="none" stroke="black" d="M410.584,-36.3034C407.206,-44.1868 403.13,-53.6958 399.377,-62.4536"/>
<polygon fill="black" stroke="black" points="396.053,-61.3255 395.33,-71.8957 402.487,-64.0829 396.053,-61.3255"/>
<g id="edge5" class="edge"><title>Button&#45;&gt;DigitalInputDevice</title>
<path fill="none" stroke="black" d="M415.775,-36.3034C414.783,-44.0173 413.592,-53.2875 412.486,-61.8876"/>
<polygon fill="black" stroke="black" points="409.003,-61.531 411.199,-71.8957 415.946,-62.4237 409.003,-61.531"/>
</g>
<!-- MotionSensor -->
<g id="node8" class="node"><title>MotionSensor</title>
<g id="node7" class="node"><title>MotionSensor</title>
<polygon fill="#2980b9" stroke="#2980b9" points="82.5,-36 -0.5,-36 -0.5,-0 82.5,-0 82.5,-36"/>
<text text-anchor="middle" x="41" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">MotionSensor</text>
</g>
<!-- MotionSensor&#45;&gt;SmoothedInputDevice -->
<g id="edge7" class="edge"><title>MotionSensor&#45;&gt;SmoothedInputDevice</title>
<g id="edge6" class="edge"><title>MotionSensor&#45;&gt;SmoothedInputDevice</title>
<path fill="none" stroke="black" d="M82.5014,-34.5353C109.086,-44.4869 143.895,-57.5168 172.8,-68.3368"/>
<polygon fill="black" stroke="black" points="171.763,-71.6859 182.356,-71.9139 174.217,-65.1302 171.763,-71.6859"/>
</g>
<!-- LightSensor -->
<g id="node9" class="node"><title>LightSensor</title>
<g id="node8" class="node"><title>LightSensor</title>
<polygon fill="#2980b9" stroke="#2980b9" points="175,-36 101,-36 101,-0 175,-0 175,-36"/>
<text text-anchor="middle" x="138" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">LightSensor</text>
</g>
<!-- LightSensor&#45;&gt;SmoothedInputDevice -->
<g id="edge8" class="edge"><title>LightSensor&#45;&gt;SmoothedInputDevice</title>
<g id="edge7" class="edge"><title>LightSensor&#45;&gt;SmoothedInputDevice</title>
<path fill="none" stroke="black" d="M160.247,-36.3034C171.582,-45.1193 185.53,-55.9679 197.819,-65.5258"/>
<polygon fill="black" stroke="black" points="195.966,-68.519 206.009,-71.8957 200.264,-62.9935 195.966,-68.519"/>
</g>
<!-- LineSensor -->
<g id="node10" class="node"><title>LineSensor</title>
<g id="node9" class="node"><title>LineSensor</title>
<polygon fill="#2980b9" stroke="#2980b9" points="263,-36 193,-36 193,-0 263,-0 263,-36"/>
<text text-anchor="middle" x="228" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">LineSensor</text>
</g>
<!-- LineSensor&#45;&gt;SmoothedInputDevice -->
<g id="edge9" class="edge"><title>LineSensor&#45;&gt;SmoothedInputDevice</title>
<g id="edge8" class="edge"><title>LineSensor&#45;&gt;SmoothedInputDevice</title>
<path fill="none" stroke="black" d="M228,-36.3034C228,-44.0173 228,-53.2875 228,-61.8876"/>
<polygon fill="black" stroke="black" points="224.5,-61.8956 228,-71.8957 231.5,-61.8957 224.5,-61.8956"/>
</g>
<!-- DistanceSensor -->
<g id="node11" class="node"><title>DistanceSensor</title>
<g id="node10" class="node"><title>DistanceSensor</title>
<polygon fill="#2980b9" stroke="#2980b9" points="373,-36 281,-36 281,-0 373,-0 373,-36"/>
<text text-anchor="middle" x="327" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">DistanceSensor</text>
</g>
<!-- DistanceSensor&#45;&gt;SmoothedInputDevice -->
<g id="edge10" class="edge"><title>DistanceSensor&#45;&gt;SmoothedInputDevice</title>
<g id="edge9" class="edge"><title>DistanceSensor&#45;&gt;SmoothedInputDevice</title>
<path fill="none" stroke="black" d="M302.782,-36.1239C290.077,-45.1069 274.336,-56.2375 260.577,-65.9659"/>
<polygon fill="black" stroke="black" points="258.456,-63.1791 252.311,-71.8102 262.497,-68.8947 258.456,-63.1791"/>
</g>
<!-- OutputDevice -->
<g id="node12" class="node"><title>OutputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="556,-252 474,-252 474,-216 556,-216 556,-252"/>
<text text-anchor="middle" x="515" y="-231.5" font-family="Sans" font-size="10.00" fill="#ffffff">OutputDevice</text>
<g id="node11" class="node"><title>OutputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="576,-180 494,-180 494,-144 576,-144 576,-180"/>
<text text-anchor="middle" x="535" y="-159.5" font-family="Sans" font-size="10.00" fill="#ffffff">OutputDevice</text>
</g>
<!-- OutputDevice&#45;&gt;GPIODevice -->
<g id="edge11" class="edge"><title>OutputDevice&#45;&gt;GPIODevice</title>
<path fill="none" stroke="black" d="M500.91,-252.303C494.077,-260.695 485.743,-270.93 478.244,-280.139"/>
<polygon fill="black" stroke="black" points="475.528,-277.931 471.928,-287.896 480.956,-282.351 475.528,-277.931"/>
<g id="edge10" class="edge"><title>OutputDevice&#45;&gt;GPIODevice</title>
<path fill="none" stroke="black" d="M519.427,-180.303C511.798,-188.78 502.477,-199.136 494.124,-208.417"/>
<polygon fill="black" stroke="black" points="491.482,-206.121 487.394,-215.896 496.685,-210.804 491.482,-206.121"/>
</g>
<!-- DigitalOutputDevice -->
<g id="node13" class="node"><title>DigitalOutputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="571,-180 459,-180 459,-144 571,-144 571,-180"/>
<text text-anchor="middle" x="515" y="-159.5" font-family="Sans" font-size="10.00" fill="#ffffff">DigitalOutputDevice</text>
<g id="node12" class="node"><title>DigitalOutputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="591,-108 479,-108 479,-72 591,-72 591,-108"/>
<text text-anchor="middle" x="535" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">DigitalOutputDevice</text>
</g>
<!-- DigitalOutputDevice&#45;&gt;OutputDevice -->
<g id="edge12" class="edge"><title>DigitalOutputDevice&#45;&gt;OutputDevice</title>
<path fill="none" stroke="black" d="M515,-180.303C515,-188.017 515,-197.288 515,-205.888"/>
<polygon fill="black" stroke="black" points="511.5,-205.896 515,-215.896 518.5,-205.896 511.5,-205.896"/>
<g id="edge11" class="edge"><title>DigitalOutputDevice&#45;&gt;OutputDevice</title>
<path fill="none" stroke="black" d="M535,-108.303C535,-116.017 535,-125.288 535,-133.888"/>
<polygon fill="black" stroke="black" points="531.5,-133.896 535,-143.896 538.5,-133.896 531.5,-133.896"/>
</g>
<!-- LED -->
<g id="node14" class="node"><title>LED</title>
<polygon fill="#2980b9" stroke="#2980b9" points="519,-108 465,-108 465,-72 519,-72 519,-108"/>
<text text-anchor="middle" x="492" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">LED</text>
<g id="node13" class="node"><title>LED</title>
<polygon fill="#2980b9" stroke="#2980b9" points="534,-36 480,-36 480,-0 534,-0 534,-36"/>
<text text-anchor="middle" x="507" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">LED</text>
</g>
<!-- LED&#45;&gt;DigitalOutputDevice -->
<g id="edge13" class="edge"><title>LED&#45;&gt;DigitalOutputDevice</title>
<path fill="none" stroke="black" d="M497.685,-108.303C500.248,-116.102 503.333,-125.491 506.185,-134.171"/>
<polygon fill="black" stroke="black" points="502.933,-135.488 509.38,-143.896 509.584,-133.303 502.933,-135.488"/>
<g id="edge12" class="edge"><title>LED&#45;&gt;DigitalOutputDevice</title>
<path fill="none" stroke="black" d="M513.921,-36.3034C517.075,-44.1868 520.878,-53.6958 524.381,-62.4536"/>
<polygon fill="black" stroke="black" points="521.195,-63.9108 528.158,-71.8957 527.694,-61.311 521.195,-63.9108"/>
</g>
<!-- Buzzer -->
<g id="node15" class="node"><title>Buzzer</title>
<polygon fill="#2980b9" stroke="#2980b9" points="591,-108 537,-108 537,-72 591,-72 591,-108"/>
<text text-anchor="middle" x="564" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">Buzzer</text>
<g id="node14" class="node"><title>Buzzer</title>
<polygon fill="#2980b9" stroke="#2980b9" points="606,-36 552,-36 552,-0 606,-0 606,-36"/>
<text text-anchor="middle" x="579" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">Buzzer</text>
</g>
<!-- Buzzer&#45;&gt;DigitalOutputDevice -->
<g id="edge14" class="edge"><title>Buzzer&#45;&gt;DigitalOutputDevice</title>
<path fill="none" stroke="black" d="M551.888,-108.303C546.132,-116.526 539.138,-126.517 532.794,-135.579"/>
<polygon fill="black" stroke="black" points="529.84,-133.696 526.973,-143.896 535.575,-137.71 529.84,-133.696"/>
<g id="edge13" class="edge"><title>Buzzer&#45;&gt;DigitalOutputDevice</title>
<path fill="none" stroke="black" d="M568.124,-36.3034C563.008,-44.4411 556.805,-54.311 551.155,-63.2987"/>
<polygon fill="black" stroke="black" points="548.11,-61.5667 545.751,-71.8957 554.036,-65.2919 548.11,-61.5667"/>
</g>
<!-- PWMOutputDevice -->
<g id="node16" class="node"><title>PWMOutputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="693,-180 589,-180 589,-144 693,-144 693,-180"/>
<text text-anchor="middle" x="641" y="-159.5" font-family="Sans" font-size="10.00" fill="#ffffff">PWMOutputDevice</text>
<g id="node15" class="node"><title>PWMOutputDevice</title>
<polygon fill="#2980b9" stroke="#2980b9" points="713,-108 609,-108 609,-72 713,-72 713,-108"/>
<text text-anchor="middle" x="661" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">PWMOutputDevice</text>
</g>
<!-- PWMOutputDevice&#45;&gt;OutputDevice -->
<g id="edge15" class="edge"><title>PWMOutputDevice&#45;&gt;OutputDevice</title>
<path fill="none" stroke="black" d="M610.177,-180.124C593.55,-189.361 572.835,-200.869 554.981,-210.788"/>
<polygon fill="black" stroke="black" points="552.983,-207.894 545.942,-215.81 556.383,-214.013 552.983,-207.894"/>
<g id="edge14" class="edge"><title>PWMOutputDevice&#45;&gt;OutputDevice</title>
<path fill="none" stroke="black" d="M630.177,-108.124C613.55,-117.361 592.835,-128.869 574.981,-138.788"/>
<polygon fill="black" stroke="black" points="572.983,-135.894 565.942,-143.81 576.383,-142.013 572.983,-135.894"/>
</g>
<!-- PWMLED -->
<g id="node17" class="node"><title>PWMLED</title>
<polygon fill="#2980b9" stroke="#2980b9" points="670,-108 612,-108 612,-72 670,-72 670,-108"/>
<text text-anchor="middle" x="641" y="-87.5" font-family="Sans" font-size="10.00" fill="#ffffff">PWMLED</text>
<g id="node16" class="node"><title>PWMLED</title>
<polygon fill="#2980b9" stroke="#2980b9" points="690,-36 632,-36 632,-0 690,-0 690,-36"/>
<text text-anchor="middle" x="661" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">PWMLED</text>
</g>
<!-- PWMLED&#45;&gt;PWMOutputDevice -->
<g id="edge16" class="edge"><title>PWMLED&#45;&gt;PWMOutputDevice</title>
<path fill="none" stroke="black" d="M641,-108.303C641,-116.017 641,-125.288 641,-133.888"/>
<polygon fill="black" stroke="black" points="637.5,-133.896 641,-143.896 644.5,-133.896 637.5,-133.896"/>
<g id="edge15" class="edge"><title>PWMLED&#45;&gt;PWMOutputDevice</title>
<path fill="none" stroke="black" d="M661,-36.3034C661,-44.0173 661,-53.2875 661,-61.8876"/>
<polygon fill="black" stroke="black" points="657.5,-61.8956 661,-71.8957 664.5,-61.8957 657.5,-61.8956"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,19 @@
/* vim: set et sw=4 sts=4: */
digraph classes {
graph [rankdir=BT];
node [shape=rect, style=filled, fontname=Sans, fontsize=10];
edge [];
/* Abstract classes */
node [color="#9ec6e0", fontcolor="#000000"]
Device;
InternalDevice;
/* Concrete classes */
node [color="#2980b9", fontcolor="#ffffff"];
InternalDevice->Device;
TimeOfDay->InternalDevice;
PingServer->InternalDevice;
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.36.0 (20140111.2315)
-->
<!-- Title: classes Pages: 1 -->
<svg width="163pt" height="188pt"
viewBox="0.00 0.00 163.00 188.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 184)">
<title>classes</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-184 159,-184 159,4 -4,4"/>
<!-- Device -->
<g id="node1" class="node"><title>Device</title>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="104,-180 50,-180 50,-144 104,-144 104,-180"/>
<text text-anchor="middle" x="77" y="-159.5" font-family="Sans" font-size="10.00" fill="#000000">Device</text>
</g>
<!-- InternalDevice -->
<g id="node2" class="node"><title>InternalDevice</title>
<polygon fill="#9ec6e0" stroke="#9ec6e0" points="119.5,-108 34.5,-108 34.5,-72 119.5,-72 119.5,-108"/>
<text text-anchor="middle" x="77" y="-87.5" font-family="Sans" font-size="10.00" fill="#000000">InternalDevice</text>
</g>
<!-- InternalDevice&#45;&gt;Device -->
<g id="edge1" class="edge"><title>InternalDevice&#45;&gt;Device</title>
<path fill="none" stroke="black" d="M77,-108.303C77,-116.017 77,-125.288 77,-133.888"/>
<polygon fill="black" stroke="black" points="73.5001,-133.896 77,-143.896 80.5001,-133.896 73.5001,-133.896"/>
</g>
<!-- TimeOfDay -->
<g id="node3" class="node"><title>TimeOfDay</title>
<polygon fill="#2980b9" stroke="#2980b9" points="68.5,-36 -0.5,-36 -0.5,-0 68.5,-0 68.5,-36"/>
<text text-anchor="middle" x="34" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">TimeOfDay</text>
</g>
<!-- TimeOfDay&#45;&gt;InternalDevice -->
<g id="edge2" class="edge"><title>TimeOfDay&#45;&gt;InternalDevice</title>
<path fill="none" stroke="black" d="M44.6292,-36.3034C49.6281,-44.4411 55.691,-54.311 61.2121,-63.2987"/>
<polygon fill="black" stroke="black" points="58.2766,-65.2069 66.4931,-71.8957 64.2411,-61.5429 58.2766,-65.2069"/>
</g>
<!-- PingServer -->
<g id="node4" class="node"><title>PingServer</title>
<polygon fill="#2980b9" stroke="#2980b9" points="155,-36 87,-36 87,-0 155,-0 155,-36"/>
<text text-anchor="middle" x="121" y="-15.5" font-family="Sans" font-size="10.00" fill="#ffffff">PingServer</text>
</g>
<!-- PingServer&#45;&gt;InternalDevice -->
<g id="edge3" class="edge"><title>PingServer&#45;&gt;InternalDevice</title>
<path fill="none" stroke="black" d="M110.124,-36.3034C105.008,-44.4411 98.8045,-54.311 93.1551,-63.2987"/>
<polygon fill="black" stroke="black" points="90.1098,-61.5667 87.7513,-71.8957 96.0363,-65.2919 90.1098,-61.5667"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -12,7 +12,9 @@ Table of Contents
api_output
api_spi
api_boards
api_other
api_generic
api_source_tools
api_pins
api_exc
changelog