Пример #1
0
 public override void Handle(IntentsDataFlowData obj)
 {
     foreach (var dimmingCurveOutput in _output)
     {
         dimmingCurveOutput.ProcessInputData(obj);
     }
 }
Пример #2
0
 public override void Handle(IntentsDataFlowData obj)
 {
     foreach (ColorBreakdownOutput output in Outputs)
     {
         output.ProcessInputData(obj);
     }
 }
 public override void Handle(IntentsDataFlowData obj)
 {
     if (obj != null) {
         IEnumerable<ICommand> intentStates = EvaluateIntentStates(obj.Value);
         _commandResult = CombineCommands(intentStates);
     }
 }
Пример #4
0
        public void ProcessInputData(IntentsDataFlowData data)
        {
            //Because we are combining at the layer above us, we should really only have one
            //intent that matches this outputs color setting.
            //Everything else will have a zero intensity and should be thrown away when it does not match our outputs color.
            double intensity = 0;

            if (data.Value?.Count > 0)
            {
                foreach (var intentState in data.Value)
                {
                    var i = _filter.GetIntensityForState(intentState);
                    if (i > 0)
                    {
                        intensity = i;
                    }
                }
            }

            if (intensity > 0)
            {
                //Get a ref to the state value which is a struct and update it with the new intensity
                ref IntensityValue intensityValue = ref _state.GetValueRef();
                intensityValue.Intensity = intensity;
                _data.Value = _state;
            }
 public override void Handle(IntentsDataFlowData obj)
 {
     if (obj != null)
     {
         IEnumerable <ICommand> intentStates = EvaluateIntentStates(obj.Value);
         _commandResult = CombineCommands(intentStates);
     }
 }
Пример #6
0
        public void ProcessInputData(IntentsDataFlowData data)
        {
            //Because we are combining at the layer above us, we should really only have one
            //intent that matches this outputs color setting.
            //Everything else will have a zero intensity and should be thrown away when it does not match our outputs color.
            double intensity = 0;

            if (data.Value?.Count > 0)
            {
                foreach (var intentState in data.Value)
                {
                    var i = _filter.GetIntensityForState(intentState);
                    intensity = Math.Max(i, intensity);
                }
            }

            Data.Value = CommandLookup8BitEvaluator.CommandLookup[(byte)(intensity * Byte.MaxValue)];
        }
Пример #7
0
        public override void Handle(IntentsDataFlowData obj)
        {
            IntentChangeCollection intentChanges = null;
            IIntent[] newState = obj.Value.Select(x => x.Intent).ToArray();

            if (_OutputHasStateToCompare) {
                if (_OutputStateDiffersFrom(newState)) {
                    IEnumerable<IIntent> addedIntents = newState.Except(OutputCurrentState);
                    IEnumerable<IIntent> removedIntents = OutputCurrentState.Except(newState);
                    intentChanges = new IntentChangeCollection(addedIntents, removedIntents);
                }
            }
            else {
                intentChanges = new IntentChangeCollection(newState, null);
            }

            OutputCurrentState = newState.ToArray();
            Result = intentChanges;
        }
Пример #8
0
        public override void Handle(IntentsDataFlowData obj)
        {
            //IntentChangeCollection intentChanges = null;
            //IIntent[] newState = obj.Value.Select(x => x.Intent).ToArray();

            //if (_OutputHasStateToCompare) {
            //	if (_OutputStateDiffersFrom(newState)) {
            //		IEnumerable<IIntent> addedIntents = newState.Except(OutputCurrentState);
            //		IEnumerable<IIntent> removedIntents = OutputCurrentState.Except(newState);
            //		intentChanges = new IntentChangeCollection(addedIntents, removedIntents);
            //	}
            //}
            //else {
            //	intentChanges = new IntentChangeCollection(newState, null);
            //}

            //OutputCurrentState = newState.ToArray();
            //Result = intentChanges;
        }
Пример #9
0
 public override void Handle(IntentsDataFlowData obj)
 {
     _output.ProcessInputData(obj);
 }
Пример #10
0
 public override void Handle(IntentsDataFlowData obj)
 {
     foreach(ColorOutput output in Outputs) {
         output.ProcessInputData(obj);
     }
 }
Пример #11
0
 virtual public void Handle(IntentsDataFlowData obj)
 {
 }
Пример #12
0
 public virtual void Handle(IntentsDataFlowData obj)
 {
 }