Example #1
0
        public void StopUpdate() //모든걸 멈출때 사용되는 함수
        {
            BusThread_RunningState = 3;

            if (Bus057TermCountThread.Started)
            {
                Bus057TermCountThread.StopCount();
            }
        }
Example #2
0
        private void Update057() //외부 쓰레드에서 호출되는 함수, UpdateBusLIstPanels()로부터 호출받음.
        {
            //UpdateBusInfoList() 했다고 가정
            //BusInfo.PrintBusInfoList();
            var bsinfo = BusInfo.FindByBusName("057");

            if (bsinfo != null)
            {
                if (!bsinfo.bustime.Contains("잠시 후") && LastBus057time.Contains("잠시 후")) //버스 도착 순간
                {
                    d.write("[057watcher] 057 arrived");
                    d.write("[057watcher] Starting new term counter");

                    Bus057TermCountThread.StartCount();

                    this.Dispatcher.Invoke(new de(Bus057PanelNormalMode));
                    Bus057DetectionCount += 1;
                }

                if (bsinfo.bustime.Contains("잠시 후"))
                {
                    this.Dispatcher.Invoke(new de(Bus057PanelActiveMode));

                    if (bsinfo.bustime.Contains("잠시 후") && !LastBus057time.Contains("잠시 후") && Bus057TermCountThread.Started)
                    {
                        base_.Update057Average(Bus057TermCountThread.Count + 60 * 2);
                        d.write($"[057watcher] term counter stopped, term={Bus057TermCountThread.Count + 60 * 2}sec, saving result.");
                        Bus057TermCountThread.StopCount();
                    }
                }

                LastBus057time = bsinfo.bustime;
            }
            else
            {
                d.write("[057watcher] null string received, ignoring");
            }
        }