فهرست منبع

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 سال پیش
والد
کامیت
b7b411ff55
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      dmx/dmx.pl

+ 3 - 3
dmx/dmx.pl

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