private void Logic_NewRaceClockEvent(object sender, HighPrecisionTimer.TickEventArgs e)
        {
            span = startspan.Subtract(new TimeSpan(0, 0, Convert.ToInt32(e.Duration.TotalSeconds)));

            this.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate()
            {
                lbCounter.Text = span.ToString();
            });
        }
        private void _timer_Tick(object sender, HighPrecisionTimer.TickEventArgs e)
        {
            _raceCountDown = span.Subtract(new TimeSpan(0, 0, Convert.ToInt32(e.Duration.TotalSeconds)));

            //this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate()
            //{
            //            lbCounter.Text = span.ToString();


            //});

            if (e.Duration.TotalSeconds >= 60 && LastEventCode == RaceEventCode.T5)
            {
                lock (this)
                {
                    LastEventCode = RaceEventCode.T4;
                }
                Task.Factory.StartNew(() =>
                {
                    EventT4();
                });
            }
            if (e.Duration.TotalSeconds >= 240 && LastEventCode == RaceEventCode.T4)
            {
                lock (this)
                {
                    LastEventCode = RaceEventCode.T1;
                }
                Task.Factory.StartNew(() =>
                {
                    EventT1();
                });

                //  pict1minleft.Image=Marconi.Properties.Resources.race_red_light;
            }

            if (e.Duration.TotalSeconds >= 300 && LastEventCode == RaceEventCode.T1)
            {
                lock (this)
                {
                    LastEventCode = RaceEventCode.T0;
                }
                Task.Factory.StartNew(() =>
                {
                    EventStart();
                });
            }

            NewRaceClockEvent?.Invoke(this, e);
            NewRaceEvent?.Invoke(this, new RaceEvent(LastEventCode.ToString()));
        }
Example #3
0
        private void Logic_NewRaceClockEvent(object sender, HighPrecisionTimer.TickEventArgs e)
        {
            if ((sender as MarconiRaceControllerLogic) != null && (sender as MarconiRaceControllerLogic).RaceInCourse)
            {
                return;
            }

            countDownSpan = (sender as MarconiRaceControllerLogic).RaceCountDown;

            this.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate()
            {
                lbCounter.Text = countDownSpan;

                oblist.SetObjects(_raceQueue, true);
            });
        }
Example #4
0
 private void R_NewRaceClockEvent(object sender, HighPrecisionTimer.TickEventArgs e)
 {
     Logic_NewRaceClockEvent(sender, e);
 }