Make the tutorial demo a bit more useful

This commit is contained in:
Jeff Parsons 2017-01-04 10:37:47 -08:00 committed by Jeff Parsons
commit d7d7ab2244

View file

@ -44,14 +44,14 @@ The second feature is a generalized method for sending commands to components wi
want to send some serial data to a machine: want to send some serial data to a machine:
{% raw %} {% raw %}
{% include machine-command.html type='button' label='Try It!' machine='vt100' component='SerialPort' command='receiveData' value='Hello World' %} {% include machine-command.html type='button' label='Try It!' machine='test1170' component='SerialPort' command='receiveData' value='HELP\r' %}
{% endraw %} {% endraw %}
which should translate into a control that looks like: which should translate into a control that looks like:
<button type="button" onclick="commandMachine('vt100','SerialPort','receiveData','Hello World')">Try It!</button> <button type="button" onclick="commandMachine('test1170','SerialPort','receiveData','HELP\r')">Try It!</button>
In fact, let's try it now. {% include machine-command.html type='button' label='Try It!' machine='vt100' component='SerialPort' command='receiveData' value='Hello World' %} In fact, let's try it now. {% include machine-command.html type='button' label='Try It!' machine='test1170' component='SerialPort' command='receiveData' value='HELP\r' %}
Obviously, every component we want to control will need to be updated to export the necessary "command" functions. Obviously, every component we want to control will need to be updated to export the necessary "command" functions.