Ejemplo n.º 1
0
 private void FadeTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (hasRunningFade)
     {
         hasRunningFade = false;
         byte current;
         byte target;
         for (short i = ArtDmxPackage.MinAddress; i <= ArtDmxPackage.MaxAddress; i++)
         {
             current = package.Get(i);
             target  = targetPackage.Get(i);
             if (current < target)
             {
                 package.Set(i, (byte)(current + 1));
                 hasChangedSinceLastSend = true;
                 hasRunningFade          = true;
             }
             else if (current > target)
             {
                 package.Set(i, (byte)(current - 1));
                 hasChangedSinceLastSend = true;
                 hasRunningFade          = true;
             }
         }
     }
 }
Ejemplo n.º 2
0
        //public void Fade(short address, byte value, double milliSeconds)
        //{
        //    var originalValue = package.data[address - 1];
        //    var fade = new Fade(address, value, originalValue, milliSeconds);
        //    fades[address] = fade;
        //}

        public void Set(short address, byte value)
        {
            if (Get(address) != value)
            {
                package.Set(address, value);
                hasChangedSinceLastSend = true;
                hasChangedSinceLastSave = true;
            }
        }