示例#1
0
        private async void GlobalLogStart()
        {
            var t = Task.Run(() =>
            {
                while (_isStarting || PlcAutoLog.Count > 0)
                {
                    if (Quality.Text != _plcAuto.OverallQuality)
                    {
                        setText(Quality, _plcAuto.OverallQuality);
                    }
                    if (PlcAutoLog.Count > 0)
                    {
                        setStatusLabel(PlcAutoLog.Dequeue());
                        Thread.Sleep(30);
                    }
                    else
                    {
                        Thread.Sleep(30);
                    }
                }
            });
            await t;

            setStatusLabel("All services stopped.");
        }
示例#2
0
 private void toggleStartButtons(bool state)
 {
     while (PlcAutoLog.Count > 0)
     {
         setStatusLabel(PlcAutoLog.Dequeue());
         Thread.Sleep(100);
     }
     _isStarting = state;
     setEnabled(this.Stop, state);
     setEnabled(this.SwitchPanel, state);
     setEnabled(this.tabControl, state);
     setEnabled(this.panelStart, !state);
     setEnabled(this.Start, !state);
 }