Ejemplo n.º 1
0
        protected override void _PreRender(CancellationTokenSource tokenSource = null)
        {
            _elementData = new EffectIntents();

            if (_data == null)
            {
                return;
            }

            ICommand command = null;

            switch (ValueType)
            {
            case CustomValueType._8Bit:
                command = new _8BitCommand(Value8Bit);
                break;

            case CustomValueType._16Bit:
                command = new _16BitCommand(Value16Bit);
                break;

            case CustomValueType._32Bit:
                command = new _32BitCommand(Value32Bit);
                break;

            case CustomValueType._64Bit:
                command = new _64BitCommand(Value64Bit);
                break;

            case CustomValueType.Color:
                command = new ColorCommand(ColorValue);
                break;

            case CustomValueType.String:
                command = new StringCommand(StringValue);
                break;
            }

            CommandValue value = new CommandValue(command);

            foreach (ElementNode node in TargetNodes)
            {
                foreach (var leafNode in node.GetLeafEnumerator())
                {
                    if (tokenSource != null && tokenSource.IsCancellationRequested)
                    {
                        return;
                    }

                    IIntent intent = new CommandIntent(value, TimeSpan);
                    _elementData.AddIntentForElement(leafNode.Element.Id, intent, TimeSpan.Zero);
                }
            }
        }
Ejemplo n.º 2
0
 public override void Handle(_16BitCommand obj)
 {
     if (CombinatorValue == null)
     {
         CombinatorValue = obj;
     }
     else
     {
         ushort value1 = CombinatorValue.CommandValue;
         ushort value2 = obj.CommandValue;
         CombinatorValue = new _16BitCommand(Math.Max(value1, value2));
     }
 }
Ejemplo n.º 3
0
 public override void Handle(_16BitCommand obj)
 {
     if (CombinatorValue == null)
     {
         CombinatorValue = obj;
     }
     else
     {
         ushort value1 = (CombinatorValue as _16BitCommand).CommandValue;
         ushort value2 = obj.CommandValue;
         CombinatorValue = new _16BitCommand((value1 + value2) >> 1);
     }
 }
Ejemplo n.º 4
0
 public override void Handle(_16BitCommand obj)
 {
     if (CombinatorValue == null)
     {
         CombinatorValue = new _8BitCommand(obj.CommandValue);
     }
     else
     {
         byte value1 = (CombinatorValue as _8BitCommand).CommandValue;
         byte value2 = (byte)obj.CommandValue;
         CombinatorValue = new _8BitCommand(Math.Max(value1, value2));
     }
 }
Ejemplo n.º 5
0
 public override void Handle(_16BitCommand obj)
 {
     if (CombinatorValue == null)
     {
         CombinatorValue = new _32BitCommand(obj.CommandValue);
     }
     else
     {
         uint value1 = CombinatorValue.CommandValue;
         uint value2 = (byte)obj.CommandValue;
         CombinatorValue = new _32BitCommand(Math.Max(value1, value2));
     }
 }
Ejemplo n.º 6
0
 public override void Handle(ColorCommand obj)
 {
     if (CombinatorValue == null)
     {
         CombinatorValue = new _16BitCommand(ColorValue.GetGrayscaleLevel(obj.CommandValue));
     }
     else
     {
         ushort value1 = CombinatorValue.CommandValue;
         ushort value2 = ColorValue.GetGrayscaleLevel(obj.CommandValue);
         CombinatorValue = new _16BitCommand(Math.Max(value1, value2));
     }
 }
 public override void Handle(_64BitCommand obj)
 {
     if (CombinatorValue == null)
     {
         CombinatorValue = new _16BitCommand(obj.CommandValue);
     }
     else
     {
         ushort value1 = (CombinatorValue as _16BitCommand).CommandValue;
         ushort value2 = (ushort)obj.CommandValue;
         CombinatorValue = new _16BitCommand(Math.Max(value1, value2));
     }
 }
Ejemplo n.º 8
0
		public override void Handle(IIntentState<PositionValue> obj)
		{
			EvaluatorValue = new _16BitCommand(PSC.RangeLow + obj.GetValue().Position*PSC.RangeWidth);
		}
Ejemplo n.º 9
0
 virtual public void Handle(_16BitCommand obj)
 {
 }
Ejemplo n.º 10
0
 public override void Handle(IIntentState <LightingValue> obj)
 {
     EvaluatorValue = new _16BitCommand((ushort)(ushort.MaxValue * obj.GetValue().Intensity));
 }
Ejemplo n.º 11
0
 public void Handle(ColorCommand obj)
 {
     EvaluatorValue = new _16BitCommand(ColorValue.GetGrayscaleLevel(obj.CommandValue));
 }
Ejemplo n.º 12
0
 public override void Handle(IIntentState<LightingValue> obj)
 {
     EvaluatorValue = new _16BitCommand((ushort)(ushort.MaxValue * obj.GetValue().Intensity));
 }
Ejemplo n.º 13
0
 public override void Handle(_16BitCommand obj)
 {
     Value = obj.CommandValue;
 }
Ejemplo n.º 14
0
 public override void Handle(_16BitCommand obj)
 {
     Command = new _16BitCommand(_reducer.Reduce(obj.CommandValue, ReductionPercentage));
 }
Ejemplo n.º 15
0
 public virtual void Handle(_16BitCommand obj)
 {
 }
Ejemplo n.º 16
0
 public override void Handle(IIntentState <RGBValue> obj)
 {
     System.UInt16 level = (System.UInt16)(System.UInt16.MaxValue * obj.GetValue().Intensity);
     EvaluatorValue = new _16BitCommand(level);
 }
Ejemplo n.º 17
0
 public override void Handle(IIntentState <PositionValue> obj)
 {
     EvaluatorValue = new _16BitCommand((ushort)(ushort.MaxValue * obj.GetValue().Position));
 }
Ejemplo n.º 18
0
		public override void Handle(_16BitCommand obj)
		{
			Value = obj.CommandValue;
		}
Ejemplo n.º 19
0
 public override void Handle(IIntentState<RGBValue> obj)
 {
     System.UInt16 level = (System.UInt16)(System.UInt16.MaxValue * obj.GetValue().Intensity);
     EvaluatorValue = new _16BitCommand(level);
 }
Ejemplo n.º 20
0
 public override void Handle(_16BitCommand obj)
 {
     Command = new _16BitCommand(_reducer.Reduce(obj.CommandValue, ReductionPercentage));
 }
Ejemplo n.º 21
0
 public override void Handle(IIntentState<PositionValue> obj)
 {
     EvaluatorValue = new _16BitCommand((ushort)(ushort.MaxValue * obj.GetValue().Position));
 }
Ejemplo n.º 22
0
 public void Handle(_16BitCommand obj)
 {
     EvaluatorValue = obj;
 }
Ejemplo n.º 23
0
 public void Handle(_16BitCommand obj)
 {
     EvaluatorValue = new _8BitCommand(obj.CommandValue);
 }
Ejemplo n.º 24
0
        protected override void _PreRender(CancellationTokenSource tokenSource = null)
        {
            _elementData = new EffectIntents();

            if (_data == null)
                return;

            ICommand command = null;

            switch (ValueType) {
                case CustomValueType._8Bit:
                    command = new _8BitCommand(Value8Bit);
                    break;
                case CustomValueType._16Bit:
                    command = new _16BitCommand(Value16Bit);
                    break;
                case CustomValueType._32Bit:
                    command = new _32BitCommand(Value32Bit);
                    break;
                case CustomValueType._64Bit:
                    command = new _64BitCommand(Value64Bit);
                    break;
                case CustomValueType.Color:
                    command = new ColorCommand(ColorValue);
                    break;
                case CustomValueType.String:
                    command = new StringCommand(StringValue);
                    break;
            }

            CommandValue value = new CommandValue(command);

            foreach (ElementNode node in TargetNodes)
            {
                foreach (var leafNode in node.GetLeafEnumerator())
                {
                    if (tokenSource != null && tokenSource.IsCancellationRequested)
                        return;

                    IIntent intent = new CommandIntent(value, TimeSpan);
                    _elementData.AddIntentForElement(leafNode.Element.Id, intent, TimeSpan.Zero);
                }

            }
        }
Ejemplo n.º 25
0
 public override void Handle(IIntentState <PositionValue> obj)
 {
     EvaluatorValue = new _16BitCommand(PSC.RangeLow + obj.GetValue().Position *PSC.RangeWidth);
 }
Ejemplo n.º 26
0
        public override void Handle(IIntentState <ColorValue> obj)
        {
            byte byteLevel = ColorValue.GetGrayscaleLevel(obj.GetValue().Color);

            EvaluatorValue = new _16BitCommand(byteLevel);
        }