Update documentation
This commit is contained in:
parent
371c7afb25
commit
db1128ab52
|
@ -0,0 +1,15 @@
|
||||||
|
<a name="exec"></a>
|
||||||
|
|
||||||
|
## exec(cmd, arg, opts) ⇒ <code>Promise.<{stdout: string, stderr: stderr}></code>
|
||||||
|
Promisified child_process.exec
|
||||||
|
|
||||||
|
**Kind**: global function
|
||||||
|
|
||||||
|
| Param | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| cmd | | |
|
||||||
|
| arg | | |
|
||||||
|
| opts | | See child_process.exec node docs |
|
||||||
|
| opts.stdout | <code>stream.Writable</code> | If defined, child process stdout will be piped to it. |
|
||||||
|
| opts.stderr | <code>stream.Writable</code> | If defined, child process stderr will be piped to it. |
|
||||||
|
|
|
@ -3,134 +3,177 @@
|
||||||
## lib/mscript
|
## lib/mscript
|
||||||
|
|
||||||
* [lib/mscript](#module_lib/mscript)
|
* [lib/mscript](#module_lib/mscript)
|
||||||
* [~mscript](#module_lib/mscript..mscript)
|
* [~Mscript](#module_lib/mscript..Mscript)
|
||||||
* [.arg(shrt, lng)](#module_lib/mscript..mscript.arg) ⇒ <code>boolean</code>
|
* [.clear()](#module_lib/mscript..Mscript+clear)
|
||||||
* [.arg_pos(shrt, lng)](#module_lib/mscript..mscript.arg_pos) ⇒ <code>boolean</code>
|
* [.interpret()](#module_lib/mscript..Mscript+interpret)
|
||||||
* [.state_clear()](#module_lib/mscript..mscript.state_clear)
|
* [.basic_cmd()](#module_lib/mscript..Mscript+basic_cmd)
|
||||||
* [.alts_unique()](#module_lib/mscript..mscript.alts_unique)
|
* [.new_loop()](#module_lib/mscript..Mscript+new_loop)
|
||||||
* [.interpret()](#module_lib/mscript..mscript.interpret)
|
* [.end_loop()](#module_lib/mscript..Mscript+end_loop)
|
||||||
* [.last_loop()](#module_lib/mscript..mscript.last_loop)
|
* [.move_cam()](#module_lib/mscript..Mscript+move_cam)
|
||||||
* [.parent_loop()](#module_lib/mscript..mscript.parent_loop)
|
* [.move_proj()](#module_lib/mscript..Mscript+move_proj)
|
||||||
* [.state_update()](#module_lib/mscript..mscript.state_update)
|
* [.set_state()](#module_lib/mscript..Mscript+set_state)
|
||||||
* [.str_to_arr()](#module_lib/mscript..mscript.str_to_arr)
|
* [.last_loop()](#module_lib/mscript..Mscript+last_loop)
|
||||||
* [.light_state()](#module_lib/mscript..mscript.light_state)
|
* [.parent_loop()](#module_lib/mscript..Mscript+parent_loop)
|
||||||
* [.light_to_arr()](#module_lib/mscript..mscript.light_to_arr)
|
* [.loop_count()](#module_lib/mscript..Mscript+loop_count)
|
||||||
* [.loop_count()](#module_lib/mscript..mscript.loop_count)
|
* [.fade()](#module_lib/mscript..Mscript+fade)
|
||||||
* [.fail()](#module_lib/mscript..mscript.fail)
|
* [.fade_count()](#module_lib/mscript..Mscript+fade_count)
|
||||||
* [.output()](#module_lib/mscript..mscript.output)
|
* [.fade_start()](#module_lib/mscript..Mscript+fade_start)
|
||||||
* [.init()](#module_lib/mscript..mscript.init)
|
* [.fade_end()](#module_lib/mscript..Mscript+fade_end)
|
||||||
* [.tests()](#module_lib/mscript..mscript.tests)
|
* [.update()](#module_lib/mscript..Mscript+update)
|
||||||
|
* [.str_to_arr()](#module_lib/mscript..Mscript+str_to_arr)
|
||||||
|
* [.light_to_arr()](#module_lib/mscript..Mscript+light_to_arr)
|
||||||
|
* [.light_state()](#module_lib/mscript..Mscript+light_state)
|
||||||
|
* [.fail()](#module_lib/mscript..Mscript+fail)
|
||||||
|
|
||||||
<a name="module_lib/mscript..mscript"></a>
|
<a name="module_lib/mscript..Mscript"></a>
|
||||||
|
|
||||||
### lib/mscript~mscript
|
### lib/mscript~Mscript
|
||||||
object mscript
|
class Mscript
|
||||||
|
|
||||||
**Kind**: inner constant of [<code>lib/mscript</code>](#module_lib/mscript)
|
**Kind**: inner class of [<code>lib/mscript</code>](#module_lib/mscript)
|
||||||
|
|
||||||
* [~mscript](#module_lib/mscript..mscript)
|
* [~Mscript](#module_lib/mscript..Mscript)
|
||||||
* [.arg(shrt, lng)](#module_lib/mscript..mscript.arg) ⇒ <code>boolean</code>
|
* [.clear()](#module_lib/mscript..Mscript+clear)
|
||||||
* [.arg_pos(shrt, lng)](#module_lib/mscript..mscript.arg_pos) ⇒ <code>boolean</code>
|
* [.interpret()](#module_lib/mscript..Mscript+interpret)
|
||||||
* [.state_clear()](#module_lib/mscript..mscript.state_clear)
|
* [.basic_cmd()](#module_lib/mscript..Mscript+basic_cmd)
|
||||||
* [.alts_unique()](#module_lib/mscript..mscript.alts_unique)
|
* [.new_loop()](#module_lib/mscript..Mscript+new_loop)
|
||||||
* [.interpret()](#module_lib/mscript..mscript.interpret)
|
* [.end_loop()](#module_lib/mscript..Mscript+end_loop)
|
||||||
* [.last_loop()](#module_lib/mscript..mscript.last_loop)
|
* [.move_cam()](#module_lib/mscript..Mscript+move_cam)
|
||||||
* [.parent_loop()](#module_lib/mscript..mscript.parent_loop)
|
* [.move_proj()](#module_lib/mscript..Mscript+move_proj)
|
||||||
* [.state_update()](#module_lib/mscript..mscript.state_update)
|
* [.set_state()](#module_lib/mscript..Mscript+set_state)
|
||||||
* [.str_to_arr()](#module_lib/mscript..mscript.str_to_arr)
|
* [.last_loop()](#module_lib/mscript..Mscript+last_loop)
|
||||||
* [.light_state()](#module_lib/mscript..mscript.light_state)
|
* [.parent_loop()](#module_lib/mscript..Mscript+parent_loop)
|
||||||
* [.light_to_arr()](#module_lib/mscript..mscript.light_to_arr)
|
* [.loop_count()](#module_lib/mscript..Mscript+loop_count)
|
||||||
* [.loop_count()](#module_lib/mscript..mscript.loop_count)
|
* [.fade()](#module_lib/mscript..Mscript+fade)
|
||||||
* [.fail()](#module_lib/mscript..mscript.fail)
|
* [.fade_count()](#module_lib/mscript..Mscript+fade_count)
|
||||||
* [.output()](#module_lib/mscript..mscript.output)
|
* [.fade_start()](#module_lib/mscript..Mscript+fade_start)
|
||||||
* [.init()](#module_lib/mscript..mscript.init)
|
* [.fade_end()](#module_lib/mscript..Mscript+fade_end)
|
||||||
* [.tests()](#module_lib/mscript..mscript.tests)
|
* [.update()](#module_lib/mscript..Mscript+update)
|
||||||
|
* [.str_to_arr()](#module_lib/mscript..Mscript+str_to_arr)
|
||||||
|
* [.light_to_arr()](#module_lib/mscript..Mscript+light_to_arr)
|
||||||
|
* [.light_state()](#module_lib/mscript..Mscript+light_state)
|
||||||
|
* [.fail()](#module_lib/mscript..Mscript+fail)
|
||||||
|
|
||||||
<a name="module_lib/mscript..mscript.arg"></a>
|
<a name="module_lib/mscript..Mscript+clear"></a>
|
||||||
|
|
||||||
#### mscript.arg(shrt, lng) ⇒ <code>boolean</code>
|
#### mscript.clear()
|
||||||
Check for the presence of specific arguments in process
|
Clear the state of the script
|
||||||
argv
|
|
||||||
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
**Returns**: <code>boolean</code> - Is flag present
|
<a name="module_lib/mscript..Mscript+interpret"></a>
|
||||||
|
|
||||||
| Param | Type | Description |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| shrt | <code>string</code> | Short version of argument or flag |
|
|
||||||
| lng | <code>string</code> | Long version of argument or flag |
|
|
||||||
|
|
||||||
<a name="module_lib/mscript..mscript.arg_pos"></a>
|
|
||||||
|
|
||||||
#### mscript.arg_pos(shrt, lng) ⇒ <code>boolean</code>
|
|
||||||
Check for the position of specific arguments in process
|
|
||||||
argv
|
|
||||||
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
**Returns**: <code>boolean</code> - Position of arg or flag, for locating input
|
|
||||||
|
|
||||||
| Param | Type | Description |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| shrt | <code>string</code> | Short version of argument or flag |
|
|
||||||
| lng | <code>string</code> | Long version of argument or flag |
|
|
||||||
|
|
||||||
<a name="module_lib/mscript..mscript.state_clear"></a>
|
|
||||||
|
|
||||||
#### mscript.state_clear()
|
|
||||||
Clear the state object
|
|
||||||
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
<a name="module_lib/mscript..mscript.alts_unique"></a>
|
|
||||||
|
|
||||||
#### mscript.alts_unique()
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
<a name="module_lib/mscript..mscript.interpret"></a>
|
|
||||||
|
|
||||||
#### mscript.interpret()
|
#### mscript.interpret()
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
Main function, accepts multi-line string, parses into lines
|
||||||
<a name="module_lib/mscript..mscript.last_loop"></a>
|
and interprets the instructions from the text. Returns an array
|
||||||
|
of steps to be fed into the mcopy.
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+basic_cmd"></a>
|
||||||
|
|
||||||
|
#### mscript.basic_cmd()
|
||||||
|
Apply a basic two character command
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+new_loop"></a>
|
||||||
|
|
||||||
|
#### mscript.new_loop()
|
||||||
|
Start a new loop
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+end_loop"></a>
|
||||||
|
|
||||||
|
#### mscript.end_loop()
|
||||||
|
Close the most recent loop
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+move_cam"></a>
|
||||||
|
|
||||||
|
#### mscript.move_cam()
|
||||||
|
Move camera to explicitly-defined frame
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+move_proj"></a>
|
||||||
|
|
||||||
|
#### mscript.move_proj()
|
||||||
|
Move projector to explicitly-defined frame
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+set_state"></a>
|
||||||
|
|
||||||
|
#### mscript.set_state()
|
||||||
|
Set the state of either the cam or projector
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+last_loop"></a>
|
||||||
|
|
||||||
#### mscript.last_loop()
|
#### mscript.last_loop()
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
Return the last loop
|
||||||
<a name="module_lib/mscript..mscript.parent_loop"></a>
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+parent_loop"></a>
|
||||||
|
|
||||||
#### mscript.parent_loop()
|
#### mscript.parent_loop()
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
Return the second-last loop
|
||||||
<a name="module_lib/mscript..mscript.state_update"></a>
|
|
||||||
|
|
||||||
#### mscript.state_update()
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
<a name="module_lib/mscript..Mscript+loop_count"></a>
|
||||||
<a name="module_lib/mscript..mscript.str_to_arr"></a>
|
|
||||||
|
|
||||||
#### mscript.str_to_arr()
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
<a name="module_lib/mscript..mscript.light_state"></a>
|
|
||||||
|
|
||||||
#### mscript.light_state()
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
<a name="module_lib/mscript..mscript.light_to_arr"></a>
|
|
||||||
|
|
||||||
#### mscript.light_to_arr()
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
<a name="module_lib/mscript..mscript.loop_count"></a>
|
|
||||||
|
|
||||||
#### mscript.loop_count()
|
#### mscript.loop_count()
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
Extract the loop count integer from a LOOP cmd
|
||||||
<a name="module_lib/mscript..mscript.fail"></a>
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+fade"></a>
|
||||||
|
|
||||||
|
#### mscript.fade()
|
||||||
|
Execute a fade of frame length, from color to another color
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+fade_count"></a>
|
||||||
|
|
||||||
|
#### mscript.fade_count()
|
||||||
|
Extract the fade length integer from a FADE cmd
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+fade_start"></a>
|
||||||
|
|
||||||
|
#### mscript.fade_start()
|
||||||
|
Extract the start color from a string
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+fade_end"></a>
|
||||||
|
|
||||||
|
#### mscript.fade_end()
|
||||||
|
Extract the end color from a string
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+update"></a>
|
||||||
|
|
||||||
|
#### mscript.update()
|
||||||
|
Increase the state of a specific object, such as the camera/projector,
|
||||||
|
by the value defined in val
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+str_to_arr"></a>
|
||||||
|
|
||||||
|
#### mscript.str_to_arr()
|
||||||
|
Split string on command, extract any integers from string
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+light_to_arr"></a>
|
||||||
|
|
||||||
|
#### mscript.light_to_arr()
|
||||||
|
Split a string on a command to extract data for light array
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+light_state"></a>
|
||||||
|
|
||||||
|
#### mscript.light_state()
|
||||||
|
Split a string to extract an rgb color value
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
|
<a name="module_lib/mscript..Mscript+fail"></a>
|
||||||
|
|
||||||
#### mscript.fail()
|
#### mscript.fail()
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
Throw an error with specific message
|
||||||
<a name="module_lib/mscript..mscript.output"></a>
|
|
||||||
|
|
||||||
#### mscript.output()
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
<a name="module_lib/mscript..mscript.init"></a>
|
|
||||||
|
|
||||||
#### mscript.init()
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
<a name="module_lib/mscript..mscript.tests"></a>
|
|
||||||
|
|
||||||
#### mscript.tests()
|
|
||||||
Legacy tests. To be deprecated in future releases.
|
|
||||||
|
|
||||||
**Kind**: static method of [<code>mscript</code>](#module_lib/mscript..mscript)
|
|
||||||
|
|
Loading…
Reference in New Issue