コード例 #1
0
        private void OnTick()
        {
            lock (this)
            {
                MillisecondsLeft -= 1;
                OnCountdownChanged?.Invoke(MillisecondsLeft);
                if (MillisecondsLeft > 0)
                {
                    return;
                }

                var sensor = NextSensor;
                TimingTriggered?.Invoke(sensor, DateTime.Now);

                if (NextSensor + 1 >= SensorCount)
                {
                    Reset();
                    return;
                }

                NextSensor++;
                OnNextSensorChanged?.Invoke(NextSensor);
                MillisecondsLeft = GetNextWaitTime();
            }
        }
コード例 #2
0
 public void TriggerSensor(int sensorNumber)
 {
     TimingTriggered?.Invoke(sensorNumber, DateTime.Now);
 }
コード例 #3
0
 public void Trigger(int number, DateTime dateTime) => TimingTriggered?.Invoke(number, dateTime);
コード例 #4
0
 public void SendImpulse(int sensorId)
 {
     TimingTriggered?.Invoke(sensorId, DateTime.UtcNow);
 }