Example #1
0
        public void InputB(object sender, IntegerEventArgs e)
        {
#if DEBUG
            Console.WriteLine("RaspSub received input B " + e.Value);
#endif
            valueB = e.Value;
        }
Example #2
0
        public void Input(object sender, IntegerEventArgs e)
        {
            Runner.AddTask((o) =>
            {
                bool newOutput = false;

                switch (condition)
                {
                case NumericConditionType.Equal:
                    newOutput = e.Value == compareValue;
                    break;

                case NumericConditionType.NotEqual:
                    newOutput = e.Value != compareValue;
                    break;

                case NumericConditionType.Greater:
                    newOutput = e.Value > compareValue;
                    break;

                case NumericConditionType.Lesser:
                    newOutput = e.Value < compareValue;
                    break;

                case NumericConditionType.GreaterOrEqual:
                    newOutput = e.Value >= compareValue;
                    break;

                case NumericConditionType.LesserOrEqual:
                    newOutput = e.Value <= compareValue;
                    break;
                }

                if (newOutput != currentOutput)
                {
                    currentOutput = newOutput;

                    if (Output != null)
                    {
                        Output(this, new SignalEventArgs {
                            Signal = currentOutput
                        });
                    }
                }
            });
        }
Example #3
0
 public void InputB(object sender, IntegerEventArgs e)
 {
     valB = e.Value;
 }