<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -93,7 +93,7 @@ alias pw='echo `&lt; /dev/urandom tr -cd &quot;[:graph:]&quot; | head -c8`'
 
 # Maintenance
 alias fixopera='rm -r ~/.config/opera/{mail,lock}'
-alias backup='sudo rsync -az --delete --exclude=/share --exclude=/tmp --exclude=/dev --exclude=/sys --exclude=/proc --exclude=/media --exclude=/mnt --exclude=/home/barrucadu/tmp / --exclude=/home/barrucadu/.git'
+alias backup='sudo rsync -az --delete --exclude=/share --exclude=/tmp --exclude=/dev --exclude=/sys --exclude=/proc --exclude=/media --exclude=/mnt --exclude=/home/barrucadu/tmp / --exclude=/home/barrucadu/.git / /media/M2HDb/cthulhu'
 
 # Servers
 alias sql='mysql -p -u root'</diff>
      <filename>.config/zsh/aliases</filename>
    </modified>
    <modified>
      <diff>@@ -1,69 +1,66 @@
 name = &quot;Martin Roboscan 812&quot;
 
-# dmx = {&quot;command&quot; : {&quot;argument&quot; : [value, channeloffset, meaning, max], ...}, ...}
+# dmx = {&quot;command&quot; : {&quot;argument&quot; : [min, channeloffset, meaning, max], ...}, ...}
 
-# If a max value is specified, a range is allowed.
-# When a range, the value specified is the minimum value
-
-dmx = {&quot;setup&quot;  : {&quot;no&quot;     : [0,   0, &quot;No strobe&quot;],
-                   &quot;gobo&quot;   : [11,  0, &quot;Gobo strobe&quot;,   74],
-                   &quot;colour&quot; : [75,  0, &quot;Colour strobe&quot;, 138],
-                   &quot;auto&quot;   : [139, 0, &quot;Remote auto trig&quot;],
-                   &quot;music&quot;  : [171, 0, &quot;Remote music trig&quot;],
-                   &quot;reset&quot;  : [203, 0, &quot;Reset fixture&quot;],
-                   &quot;lamp&quot;   : [236, 0, &quot;Lamp power on&quot;]},
+dmx = {&quot;setup&quot;  : {&quot;no&quot;     : [0,   0, &quot;No strobe&quot;,         10],
+                   &quot;gobo&quot;   : [11,  0, &quot;Gobo strobe&quot;,       74],
+                   &quot;colour&quot; : [75,  0, &quot;Colour strobe&quot;,     138],
+                   &quot;auto&quot;   : [139, 0, &quot;Remote auto trig&quot;,  170],
+                   &quot;music&quot;  : [171, 0, &quot;Remote music trig&quot;, 202],
+                   &quot;reset&quot;  : [203, 0, &quot;Reset fixture&quot;,     235],
+                   &quot;lamp&quot;   : [236, 0, &quot;Lamp power on&quot;,     255]},
        
-       &quot;colour&quot; : {&quot;b-w&quot;   : [0,   1, &quot;Black to white&quot;],
-                   &quot;w-1&quot;   : [15,  1, &quot;White to colour 1&quot;],
-                   &quot;1-2&quot;   : [30,  1, &quot;Colour 1 to colour 2&quot;],
-                   &quot;2-3&quot;   : [45,  1, &quot;Colour 2 to colour 3&quot;],
-                   &quot;3-4&quot;   : [60,  1, &quot;Colour 3 to colour 4&quot;],
-                   &quot;4-5&quot;   : [75,  1, &quot;Colour 4 to colour 5&quot;],
-                   &quot;5-6&quot;   : [90,  1, &quot;Colour 5 to colour 6&quot;],
-                   &quot;6-7&quot;   : [105, 1, &quot;Colour 6 to colour 7&quot;],
-                   &quot;7-8&quot;   : [120, 1, &quot;Colour 7 to colour 8&quot;],
-                   &quot;8-9&quot;   : [135, 1, &quot;Colour 8 to colour 9&quot;],
-                   &quot;9-10&quot;  : [150, 1, &quot;Colour 9 to colour 10&quot;],
-                   &quot;10-11&quot; : [165, 1, &quot;Colour 10 to colour 11&quot;],
-                   &quot;11&quot;    : [180, 1, &quot;Colour 11&quot;],
-                   &quot;10&quot;    : [185, 1, &quot;Colour 10&quot;],
-                   &quot;9&quot;     : [190, 1, &quot;Colour 9&quot;],
-                   &quot;8&quot;     : [195, 1, &quot;Colour 8&quot;],
-                   &quot;7&quot;     : [200, 1, &quot;Colour 7&quot;],
-                   &quot;6&quot;     : [205, 1, &quot;Colour 6&quot;],
-                   &quot;5&quot;     : [210, 1, &quot;Colour 5&quot;],
-                   &quot;4&quot;     : [215, 1, &quot;Colour 4&quot;],
-                   &quot;3&quot;     : [220, 1, &quot;Colour 3&quot;],
-                   &quot;2&quot;     : [225, 1, &quot;Colour 2&quot;],
-                   &quot;1&quot;     : [230, 1, &quot;Colour 1&quot;],
-                   &quot;w&quot;     : [235, 1, &quot;White&quot;],
-                   &quot;b&quot;     : [240, 1, &quot;Black&quot;]},
+       &quot;colour&quot; : {&quot;b-w&quot;   : [0,   1, &quot;Black to white]&quot;,        14],
+                   &quot;w-1&quot;   : [15,  1, &quot;White to colour 1&quot;,      29],
+                   &quot;1-2&quot;   : [30,  1, &quot;Colour 1 to colour 2&quot;,   44],
+                   &quot;2-3&quot;   : [45,  1, &quot;Colour 2 to colour 3&quot;,   59],
+                   &quot;3-4&quot;   : [60,  1, &quot;Colour 3 to colour 4&quot;,   74],
+                   &quot;4-5&quot;   : [75,  1, &quot;Colour 4 to colour 5&quot;,   89],
+                   &quot;5-6&quot;   : [90,  1, &quot;Colour 5 to colour 6&quot;,   104],
+                   &quot;6-7&quot;   : [105, 1, &quot;Colour 6 to colour 7&quot;,   119],
+                   &quot;7-8&quot;   : [120, 1, &quot;Colour 7 to colour 8&quot;,   134],
+                   &quot;8-9&quot;   : [135, 1, &quot;Colour 8 to colour 9&quot;,   149],
+                   &quot;9-10&quot;  : [150, 1, &quot;Colour 9 to colour 10&quot;,  164],
+                   &quot;10-11&quot; : [165, 1, &quot;Colour 10 to colour 11&quot;, 179],
+                   &quot;11&quot;    : [180, 1, &quot;Colour 11&quot;,              184],
+                   &quot;10&quot;    : [185, 1, &quot;Colour 10&quot;,              189],
+                   &quot;9&quot;     : [190, 1, &quot;Colour 9&quot;,               194],
+                   &quot;8&quot;     : [195, 1, &quot;Colour 8&quot;,               199],
+                   &quot;7&quot;     : [200, 1, &quot;Colour 7&quot;,               204],
+                   &quot;6&quot;     : [205, 1, &quot;Colour 6&quot;,               209],
+                   &quot;5&quot;     : [210, 1, &quot;Colour 5&quot;,               214],
+                   &quot;4&quot;     : [215, 1, &quot;Colour 4&quot;,               219],
+                   &quot;3&quot;     : [220, 1, &quot;Colour 3&quot;,               224],
+                   &quot;2&quot;     : [225, 1, &quot;Colour 2&quot;,               229],
+                   &quot;1&quot;     : [230, 1, &quot;Colour 1&quot;,               234],
+                   &quot;w&quot;     : [235, 1, &quot;White&quot;,                  239],
+                   &quot;b&quot;     : [240, 1, &quot;Black&quot;,                  255]},
 
-       &quot;gobo&quot;   : {&quot;c-o&quot;   : [0,   2, &quot;Closed to open&quot;],
-                   &quot;o-1&quot;   : [15,  2, &quot;Open to gobo 1&quot;],
-                   &quot;1-2&quot;   : [30,  2, &quot;Gobo 1 to gobo 2&quot;],
-                   &quot;2-3&quot;   : [45,  2, &quot;Gobo 2 to gobo 3&quot;],
-                   &quot;3-4&quot;   : [60 , 2, &quot;Gobo 3 to gobo 4&quot;],
-                   &quot;4-5&quot;   : [75,  2, &quot;Gobo 4 to gobo 5&quot;],
-                   &quot;5-6&quot;   : [90,  2, &quot;Gobo 5 to gobo 6&quot;],
-                   &quot;6-7&quot;   : [105, 2, &quot;Gobo 6 to gobo 7&quot;],
-                   &quot;7-8&quot;   : [120, 2, &quot;Gobo 7 to gobo 8&quot;],
-                   &quot;8-9&quot;   : [135, 2, &quot;Gobo 8 to gobo 9&quot;],
-                   &quot;9-10&quot;  : [150, 2, &quot;Gobo 9 to gobo 10&quot;],
-                   &quot;10-11&quot; : [165, 2, &quot;Gobo 10 to gobo 11&quot;],
-                   &quot;11&quot;    : [180, 2, &quot;Gobo 11&quot;],
-                   &quot;10&quot;    : [185, 2, &quot;Gobo 10&quot;],
-                   &quot;9&quot;     : [190, 2, &quot;Gobo 9&quot;],
-                   &quot;8&quot;     : [195, 2, &quot;Gobo 8&quot;],
-                   &quot;7&quot;     : [200, 2, &quot;Gobo 7&quot;],
-                   &quot;6&quot;     : [205, 2, &quot;Gobo 6&quot;],
-                   &quot;5&quot;     : [210, 2, &quot;Gobo 5&quot;],
-                   &quot;4&quot;     : [215, 2, &quot;Gobo 4&quot;],
-                   &quot;3&quot;     : [220, 2, &quot;Gobo 3&quot;],
-                   &quot;2&quot;     : [225, 2, &quot;Gobo 2&quot;],
-                   &quot;1&quot;     : [230, 2, &quot;Gobo 1&quot;],
-                   &quot;o&quot;     : [235, 2, &quot;Open&quot;],
-                   &quot;c&quot;     : [240, 2, &quot;Closed&quot;]},
+       &quot;gobo&quot;   : {&quot;c-o&quot;   : [0,   2, &quot;Closed to open&quot;,     14],
+                   &quot;o-1&quot;   : [15,  2, &quot;Open to gobo 1&quot;,     29],
+                   &quot;1-2&quot;   : [30,  2, &quot;Gobo 1 to gobo 2&quot;,   44],
+                   &quot;2-3&quot;   : [45,  2, &quot;Gobo 2 to gobo 3&quot;,   59],
+                   &quot;3-4&quot;   : [60 , 2, &quot;Gobo 3 to gobo 4&quot;,   74],
+                   &quot;4-5&quot;   : [75,  2, &quot;Gobo 4 to gobo 5&quot;,   89],
+                   &quot;5-6&quot;   : [90,  2, &quot;Gobo 5 to gobo 6&quot;,   104],
+                   &quot;6-7&quot;   : [105, 2, &quot;Gobo 6 to gobo 7&quot;,   119],
+                   &quot;7-8&quot;   : [120, 2, &quot;Gobo 7 to gobo 8&quot;,   134],
+                   &quot;8-9&quot;   : [135, 2, &quot;Gobo 8 to gobo 9&quot;,   149],
+                   &quot;9-10&quot;  : [150, 2, &quot;Gobo 9 to gobo 10&quot;,  164],
+                   &quot;10-11&quot; : [165, 2, &quot;Gobo 10 to gobo 11&quot;, 179],
+                   &quot;11&quot;    : [180, 2, &quot;Gobo 11&quot;,            184],
+                   &quot;10&quot;    : [185, 2, &quot;Gobo 10&quot;,            189],
+                   &quot;9&quot;     : [190, 2, &quot;Gobo 9&quot;,             194],
+                   &quot;8&quot;     : [195, 2, &quot;Gobo 8&quot;,             199],
+                   &quot;7&quot;     : [200, 2, &quot;Gobo 7&quot;,             204],
+                   &quot;6&quot;     : [205, 2, &quot;Gobo 6&quot;,             209],
+                   &quot;5&quot;     : [210, 2, &quot;Gobo 5&quot;,             214],
+                   &quot;4&quot;     : [215, 2, &quot;Gobo 4&quot;,             219],
+                   &quot;3&quot;     : [220, 2, &quot;Gobo 3&quot;,             224],
+                   &quot;2&quot;     : [225, 2, &quot;Gobo 2&quot;,             229],
+                   &quot;1&quot;     : [230, 2, &quot;Gobo 1&quot;,             234],
+                   &quot;o&quot;     : [235, 2, &quot;Open&quot;,               239],
+                   &quot;c&quot;     : [240, 2, &quot;Closed&quot;,             255]},
 
        &quot;move&quot;   : {&quot;pan&quot;  : [0, 3, &quot;Pan&quot;,  255],
                    &quot;tilt&quot; : [0, 4, &quot;Tilt&quot;, 255]},
@@ -72,3 +69,5 @@ dmx = {&quot;setup&quot;  : {&quot;no&quot;     : [0,   0, &quot;No strobe&quot;],
                    &quot;col&quot; :  [0, 6, &quot;Colour/gobo speed&quot;, 255]}}
 
 channels = [&quot;Control&quot;, &quot;Colour&quot;,&quot;Gobo&quot;, &quot;Pan&quot;, &quot;Tilt&quot;, &quot;Move Speed&quot;, &quot;Col. Speed&quot;]
+
+defaults = [0, 0, 0, 127, 127, 0, 0]</diff>
      <filename>.data/pydmx/roboscan.py</filename>
    </modified>
    <modified>
      <diff>@@ -4,3 +4,5 @@ dmx = {&quot;volume&quot;  : {&quot;off&quot; : [0, 0, &quot;No snow&quot;],
                     &quot;on&quot;  : [5, 0, &quot;Snow&quot;, 255]}}
 
 channels = [&quot;Volume&quot;]
+
+defaults = [0]</diff>
      <filename>.data/pydmx/snowmachine.py</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 
 # Python script to control dmx devices. Requires the server to be up and running.
 
-import os, sys, imp, subprocess, curses, curses.wrapper
+import os, sys, imp, subprocess, curses, curses.ascii, curses.wrapper
 
 # ----- Global Variables ----- #
 datapath   = None
@@ -11,6 +11,39 @@ activename = None
 chandata   = None
 
 # ----- Function Definitions ----- #
+def dmxcmd(channel, value=None, name=None):
+    global activename
+    global chandata
+
+    if name == None:
+        name = activename
+
+    argvector = []
+    if value == None:
+        argvector = [&quot;k8062&quot;, str(channel)]
+    else:
+        chandata[name][channel][0] = int(value)
+        channel += chandata[name]['info']['startchan']
+        argvector = [&quot;k8062&quot;, str(channel), str(value)]
+        
+    process = subprocess.Popen(argvector, stdout=subprocess.PIPE)
+    output  = process.communicate()
+    
+    if value == None: return int(output[0])
+
+def loaddmx(name):
+    global chandata
+
+    loaded = False
+    for chan in chandata[name].keys():
+        if not chan == 'info':
+            newval = dmxcmd(chan + chandata[name]['info']['startchan'])
+            if not chandata[name][chan][0] == newval:
+                chandata[name][chan][0] = newval
+                loaded = True
+
+    return loaded
+
 def nameinit(newname, newmodel, newstartchan):
     global chandata
     global data
@@ -37,18 +70,12 @@ def nameinit(newname, newmodel, newstartchan):
             else:
                 chandata[newname].update({key : [0, var]})
 
-def dmxcmd(channel, value):
-    global chandata
-    global activename
+    dontload = loaddmx(newname)
 
-    chandata[activename][channel][0] = int(value)
-    
-    channel += chandata[activename]['info']['startchan']
-    
-    argvector = [&quot;k8062&quot;, str(channel), str(value)]
-    process   = subprocess.Popen(argvector, stdout=subprocess.PIPE)
-    output    = process.communicate()
-    #print(output) - for debugging
+    if not dontload:
+        for channel in range(0, len(data.defaults)):
+            dmxcmd(channel, data.defaults[channel], newname)
+             
 
 def updateui(stdscr, active):
     global chandata
@@ -129,6 +156,10 @@ def updateui(stdscr, active):
                 if type(chan) is list:
                     if chan[0] == value or (len(chan) &gt; 2 and (chan[0] &lt;= value &lt;= chan[2])):
 
+                        stdscr.move(height - 3, 1)
+                        stdscr.addstr(&quot;Name:   &quot;, curses.color_pair(5) and curses.A_BOLD)
+                        stdscr.addstr(activename)
+
                         stdscr.move(height - 2, 1)
                         stdscr.addstr(&quot;Device: &quot;, curses.color_pair(5) and curses.A_BOLD)
                         stdscr.addstr(data.name)
@@ -144,14 +175,14 @@ def cursesui(stdscr):
     
     curses.curs_set(0)
 
+    activechan = 0
+
     curses.init_pair(1, curses.COLOR_RED,   curses.COLOR_RED)
     curses.init_pair(2, curses.COLOR_BLUE,  curses.COLOR_BLUE)
     curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_GREEN)
     curses.init_pair(4, curses.COLOR_RED,   curses.COLOR_BLACK)
     curses.init_pair(5, curses.COLOR_CYAN,  curses.COLOR_BLACK)
 
-    activechan = 0
-
     while True:
         updateui(stdscr, activechan)
         
@@ -161,6 +192,9 @@ def cursesui(stdscr):
         if ch == ord('q'):
             break
         
+        elif ch == ord('r'):
+            loaddmx(activename)
+
         elif ch == curses.KEY_LEFT:
             if not activechan == 0:
                 activechan -= 1
@@ -169,27 +203,27 @@ def cursesui(stdscr):
             if not activechan == len(chandata[activename]) - 1:
                 activechan += 1
                 
-        elif ch in [curses.KEY_UP, curses.KEY_PPAGE]:
+        elif ch in [curses.KEY_UP, curses.KEY_PPAGE, ord('n')]:
             for cmd in chandata[activename][activechan]:
                 if type(cmd) is list:
                     newdata = chandata[activename][activechan][0] + 1
                     if ch == curses.KEY_PPAGE:
                         newdata += 9
 
-                    if len(cmd) &gt; 2 and (cmd[0] &lt;= newdata &lt;= cmd[2]):
+                    if len(cmd) &gt; 2 and (cmd[0] &lt;= newdata &lt;= cmd[2]) and not ch == ord('n'):
                         newval = newdata
                     elif cmd[0] &gt; chandata[activename][activechan][0]:
                         if cmd[0] &lt; newval or newval == -1:
                             newval = cmd[0]
                             
-        elif ch in [curses.KEY_DOWN, curses.KEY_NPAGE]:
+        elif ch in [curses.KEY_DOWN, curses.KEY_NPAGE, ord('p')]:
             for cmd in chandata[activename][activechan]:
                 if type(cmd) is list:
                     newdata = chandata[activename][activechan][0] - 1
                     if ch == curses.KEY_NPAGE:
                         newdata -= 9
 
-                    if len(cmd) &gt; 2 and (cmd[0] &lt;= newdata &lt;= cmd[2]):
+                    if len(cmd) &gt; 2 and (cmd[0] &lt;= newdata &lt;= cmd[2]) and not ch == ord('p'):
                         newval = newdata
                     elif cmd[0] &lt; chandata[activename][activechan][0]:
                         if cmd[0] &gt; newval or newval == -1:
@@ -272,6 +306,9 @@ def parsecmd(command, arg, arg2, arg3):
         if arg in chandata.keys():
             activename = arg
         
+    elif command == &quot;reload&quot;:
+        loaddmx(activename)
+        
     else:
         try:
             cmd = data.dmx[command][arg]
@@ -370,7 +407,7 @@ activename = 'start'
 #print(chandata)
 #sys.exit()
 
-# ----- Start Up ----- #
+# ----- Main ----- #
 looping = True
 
 while looping:</diff>
      <filename>bin/pydmx</filename>
    </modified>
    <modified>
      <diff>@@ -31,20 +31,28 @@ void dmx_close()
 
 int main(int argc, char* argv[])
 {
+    int chan = 0;
+    int val  = 0;
+
+    dmx_open();
+
     if(argc == 3) {
-	int chan = atoi(argv[1]);
-	int val  = atoi(argv[2]);
+	chan = atoi(argv[1]);
+	val  = atoi(argv[2]);
 
 	if(0 &lt;= chan &amp;&amp; chan &lt;= 512 &amp;&amp; 0 &lt;= val &amp;&amp; val &lt;= 255) {
-	    dmx_open();
 	    dmx_channels[chan]=val;
-	    dmx_close();
-
-	    printf(&quot;Value of channel %i changed to %i.\n&quot;, chan, val);
 	} else {
 	    fprintf(stderr, &quot;Invalid channel or value: 0 &lt;= channel &lt;= 512, 0 &lt;= value &lt;= 255\n&quot;);
 	}
+    } else if(argc == 2) {
+	chan = atoi(argv[1]);
+	if(0 &lt;= chan &amp;&amp; chan &lt;= 512) {
+	    printf(&quot;%i\n&quot;, dmx_channels[chan]);
+	}
     } else {
-	printf(&quot;Usage: dmx [channel] [value]\n&quot;);
+	printf(&quot;Usage: k8062 [channel] (value)\n&quot;);
     }
+
+    dmx_close();
 }</diff>
      <filename>code/c/dmx/k8062.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6eb1d08e37401ebc25a1af673dd019ff94558053</id>
    </parent>
  </parents>
  <author>
    <name>Barrucadu</name>
    <email>mike@barrucadu.co.uk</email>
  </author>
  <url>http://github.com/Barrucadu/home/commit/dd5eb84ed09cb87ca52fe4796b10dfc75de90437</url>
  <id>dd5eb84ed09cb87ca52fe4796b10dfc75de90437</id>
  <committed-date>2009-11-05T13:37:28-08:00</committed-date>
  <authored-date>2009-11-05T13:37:28-08:00</authored-date>
  <message>Much work on pydmx.</message>
  <tree>9a6dfb4964481b62dab44a1fc1f412cc95927f4d</tree>
  <committer>
    <name>Barrucadu</name>
    <email>mike@barrucadu.co.uk</email>
  </committer>
</commit>
