Exemplo n.º 1
0
        private void sendRGBValue(RGBOutput.IRGBOutput rgbOutput)
        {
            if (!_newRGBValue.Equals(_oldRGBValue))
            {
                rgbOutput.ShowRGB(_newRGBValue);

                _oldRGBValue.CopyValues(_newRGBValue);
            }

            /* else
             * {
             *   System.Diagnostics.Debug.WriteLine("Did not send Value, because it's the same as the old one");
             * }*/
        }
Exemplo n.º 2
0
 public abstract void showRGB(byte[] specArray, int min_slider, int max_slider, int min_trigger, bool absNotRel, RGBOutput.IRGBOutput rgbOutput);
Exemplo n.º 3
0
        public override void showRGB(byte[] specArray, int min_slider, int max_slider, int min_trigger, bool absNotRel, RGBOutput.IRGBOutput rgbOutput)
        {
            if (min_trigger != 0)
            {
                for (int i = 0; i < specArray.Length; i++)
                {
                    specArray[i] = specArray[i] < min_trigger ? (byte)0 : specArray[i];
                }
                if (!absNotRel)
                {
                    for (int i = 0; i < specArray.Length; i++)
                    {
                        specArray[i] = rel_check(specArray[i], min_trigger);
                    }
                }
            }
            // TODO still neded?
            if (min_trigger < 0)
            {
                min_trigger = 1;
            }
            // TODO end
            m = 765 / (double)min_trigger;


            int new_amount_rgbs = rgbOutput.GetAmountRGBs();

            // In case the amount of RGBs changed create new array (usually if output changes)
            if (rgbs == null || amount_rgbs != new_amount_rgbs)
            {
                rgbs = new RGBValue[new_amount_rgbs];
                for (int led = 0; led < new_amount_rgbs; led++)
                {
                    rgbs[led] = new RGBValue();
                }
                amount_rgbs = new_amount_rgbs;
            }

            rgbs = my_callback(specArray, min_slider, max_slider, min_trigger);
            rgbOutput.ShowRGBs(rgbs);
        }
Exemplo n.º 4
0
        public override void showRGB(byte[] specArray, int min_slider, int max_slider, int min_trigger, bool absNotRel, RGBOutput.IRGBOutput rgbOutput)
        {
            if (min_trigger != 0)
            {
                for (int i = 0; i < specArray.Length; i++)
                {
                    specArray[i] = specArray[i] < min_trigger ? (byte)0 : specArray[i];
                }
                if (!absNotRel)
                {
                    for (int i = 0; i < specArray.Length; i++)
                    {
                        specArray[i] = rel_check(specArray[i], min_trigger);
                    }
                }
            }
            if (min_trigger < 0)
            {
                min_trigger = 1;
            }
            m = 765 / (double)min_trigger;

            _newRGBValue = my_callback(_newRGBValue, specArray, min_slider, max_slider, min_trigger);
            sendRGBValue(rgbOutput);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Sets new RGBOutput interface
 /// </summary>
 /// <param name="rgbOutput">interface to set</param>
 public virtual void SetRGBOutput(RGBOutput.IRGBOutput rgbOutput)
 {
     _rgbOutput = rgbOutput;
 }