Browse Source

Linear fade, not geometric, for fades where the number of ticks exceeds the delta in command levels.

This will require some rebalancing of scripts, but should provide a more intuitive behavior in most circumstances (as well as consistent behavior between large and small fades.
Zachary Kotlarek 14 năm trước cách đây
mục cha
commit
b7b411ff55
1 tập tin đã thay đổi với 3 bổ sung và 3 xóa
  1. 3 3
      dmx/dmx.pl

+ 3 - 3
dmx/dmx.pl

@@ -57,7 +57,7 @@ def SendDMXFrame():
     except ValueError:
     except ValueError:
       print 'Invalid command:', cmd
       print 'Invalid command:', cmd
       channel = -1
       channel = -1
-    if (channel >= 0 and channel <= 512 and intensity >= 0 and intensity <= 255 and duration >= 0 and duration <= 60000):
+    if (channel >= 0 and channel <= 512 and intensity >= 0 and intensity <= 255 and duration >= 0 and duration <= 300000):
       if (channel > 0):
       if (channel > 0):
         cmds['value'][channel - 1] = intensity
         cmds['value'][channel - 1] = intensity
         cmds['ticks'][channel - 1] = duration / interval
         cmds['ticks'][channel - 1] = duration / interval
@@ -76,13 +76,13 @@ def SendDMXFrame():
         delta = diff
         delta = diff
       else:
       else:
         delta = float(diff) / float(cmds['ticks'][i])
         delta = float(diff) / float(cmds['ticks'][i])
-      state[i] += int(delta)
+      state[i] += delta
       cmds['ticks'][i] -= 1
       cmds['ticks'][i] -= 1
     
     
   # Send all DMX channels
   # Send all DMX channels
   data = array.array('B')
   data = array.array('B')
   for i in range(len(state)):
   for i in range(len(state)):
-    data.append(state[i])
+    data.append(int(state[i]))
   wrapper.Client().SendDmx(universe, data, DmxSent)
   wrapper.Client().SendDmx(universe, data, DmxSent)
 
 
 # ====================================
 # ====================================