2018-03-16 16:57:02 +00:00
|
|
|
<a name="module_lib/mscript"></a>
|
|
|
|
|
|
|
|
## lib/mscript
|
|
|
|
|
|
|
|
* [lib/mscript](#module_lib/mscript)
|
2018-06-17 03:13:14 +00:00
|
|
|
* [~Mscript](#module_lib/mscript..Mscript)
|
|
|
|
* [.clear()](#module_lib/mscript..Mscript+clear)
|
|
|
|
* [.interpret()](#module_lib/mscript..Mscript+interpret)
|
|
|
|
* [.basic_cmd()](#module_lib/mscript..Mscript+basic_cmd)
|
|
|
|
* [.new_loop()](#module_lib/mscript..Mscript+new_loop)
|
|
|
|
* [.end_loop()](#module_lib/mscript..Mscript+end_loop)
|
|
|
|
* [.move_cam()](#module_lib/mscript..Mscript+move_cam)
|
|
|
|
* [.move_proj()](#module_lib/mscript..Mscript+move_proj)
|
|
|
|
* [.set_state()](#module_lib/mscript..Mscript+set_state)
|
|
|
|
* [.last_loop()](#module_lib/mscript..Mscript+last_loop)
|
|
|
|
* [.parent_loop()](#module_lib/mscript..Mscript+parent_loop)
|
|
|
|
* [.loop_count()](#module_lib/mscript..Mscript+loop_count)
|
|
|
|
* [.fade()](#module_lib/mscript..Mscript+fade)
|
|
|
|
* [.fade_count()](#module_lib/mscript..Mscript+fade_count)
|
|
|
|
* [.fade_start()](#module_lib/mscript..Mscript+fade_start)
|
|
|
|
* [.fade_end()](#module_lib/mscript..Mscript+fade_end)
|
|
|
|
* [.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)
|
2019-02-22 21:31:53 +00:00
|
|
|
* [~startsWith()](#module_lib/mscript..startsWith)
|
2018-06-17 03:13:14 +00:00
|
|
|
|
|
|
|
<a name="module_lib/mscript..Mscript"></a>
|
|
|
|
|
|
|
|
### lib/mscript~Mscript
|
|
|
|
class Mscript
|
|
|
|
|
|
|
|
**Kind**: inner class of [<code>lib/mscript</code>](#module_lib/mscript)
|
|
|
|
|
|
|
|
* [~Mscript](#module_lib/mscript..Mscript)
|
|
|
|
* [.clear()](#module_lib/mscript..Mscript+clear)
|
|
|
|
* [.interpret()](#module_lib/mscript..Mscript+interpret)
|
|
|
|
* [.basic_cmd()](#module_lib/mscript..Mscript+basic_cmd)
|
|
|
|
* [.new_loop()](#module_lib/mscript..Mscript+new_loop)
|
|
|
|
* [.end_loop()](#module_lib/mscript..Mscript+end_loop)
|
|
|
|
* [.move_cam()](#module_lib/mscript..Mscript+move_cam)
|
|
|
|
* [.move_proj()](#module_lib/mscript..Mscript+move_proj)
|
|
|
|
* [.set_state()](#module_lib/mscript..Mscript+set_state)
|
|
|
|
* [.last_loop()](#module_lib/mscript..Mscript+last_loop)
|
|
|
|
* [.parent_loop()](#module_lib/mscript..Mscript+parent_loop)
|
|
|
|
* [.loop_count()](#module_lib/mscript..Mscript+loop_count)
|
|
|
|
* [.fade()](#module_lib/mscript..Mscript+fade)
|
|
|
|
* [.fade_count()](#module_lib/mscript..Mscript+fade_count)
|
|
|
|
* [.fade_start()](#module_lib/mscript..Mscript+fade_start)
|
|
|
|
* [.fade_end()](#module_lib/mscript..Mscript+fade_end)
|
|
|
|
* [.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+clear"></a>
|
|
|
|
|
|
|
|
#### mscript.clear()
|
|
|
|
Clear the state of the script
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
|
|
|
<a name="module_lib/mscript..Mscript+interpret"></a>
|
2018-03-16 16:57:02 +00:00
|
|
|
|
|
|
|
#### mscript.interpret()
|
2018-06-17 03:13:14 +00:00
|
|
|
Main function, accepts multi-line string, parses into lines
|
|
|
|
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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.basic\_cmd()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.new\_loop()
|
2018-06-17 03:13:14 +00:00
|
|
|
Start a new loop
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
|
|
|
<a name="module_lib/mscript..Mscript+end_loop"></a>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.end\_loop()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.move\_cam()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.move\_proj()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.set\_state()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.last\_loop()
|
2018-06-17 03:13:14 +00:00
|
|
|
Return the last loop
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
|
|
|
<a name="module_lib/mscript..Mscript+parent_loop"></a>
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.parent\_loop()
|
2018-06-17 03:13:14 +00:00
|
|
|
Return the second-last loop
|
|
|
|
|
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
|
|
|
<a name="module_lib/mscript..Mscript+loop_count"></a>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.loop\_count()
|
2018-06-17 03:13:14 +00:00
|
|
|
Extract the loop count integer from a LOOP cmd
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2018-06-17 03:13:14 +00:00
|
|
|
**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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.fade\_count()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.fade\_start()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.fade\_end()
|
2018-06-17 03:13:14 +00:00
|
|
|
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>
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.str\_to\_arr()
|
2018-06-17 03:13:14 +00:00
|
|
|
Split string on command, extract any integers from string
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2018-06-17 03:13:14 +00:00
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
|
|
|
<a name="module_lib/mscript..Mscript+light_to_arr"></a>
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.light\_to\_arr()
|
2018-06-17 03:13:14 +00:00
|
|
|
Split a string on a command to extract data for light array
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2018-06-17 03:13:14 +00:00
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
|
|
|
<a name="module_lib/mscript..Mscript+light_state"></a>
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2019-02-22 21:31:53 +00:00
|
|
|
#### mscript.light\_state()
|
2018-06-17 03:13:14 +00:00
|
|
|
Split a string to extract an rgb color value
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2018-06-17 03:13:14 +00:00
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
|
|
|
<a name="module_lib/mscript..Mscript+fail"></a>
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2018-06-17 03:13:14 +00:00
|
|
|
#### mscript.fail()
|
|
|
|
Throw an error with specific message
|
2018-03-16 16:57:02 +00:00
|
|
|
|
2018-06-17 03:13:14 +00:00
|
|
|
**Kind**: instance method of [<code>Mscript</code>](#module_lib/mscript..Mscript)
|
2019-02-22 21:31:53 +00:00
|
|
|
<a name="module_lib/mscript..startsWith"></a>
|
|
|
|
|
|
|
|
### lib/mscript~startsWith()
|
|
|
|
startswith function from lodash, do not want the entire lib for this
|
|
|
|
|
|
|
|
**Kind**: inner method of [<code>lib/mscript</code>](#module_lib/mscript)
|