Пример #1
0
        private void Test()
        {
            int nowLay = PLC_SP.ReadNowLay();

            if (ToLay == 0 || nowLay == ToLay)
            {
                Random r = new Random();
                int    i = r.Next(11);
                i = (i * 2) - 1;
                PLC_SP.TurnTo(i);
            }
        }
Пример #2
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            timer_Pulse.Interval = TimeSpan.FromSeconds(2);
            timer_Pulse.Tick    += new EventHandler(timer_Pulse_Tick);

            timer_Test.Interval = TimeSpan.FromSeconds(3);
            timer_Test.Tick    += new EventHandler(timer_Test_Tick);

            if (Config.Mac_S.PLCIsEnable == "Y")
            {
                tbPulse.Text = PLC_SP.ReadNowPulse().ToString();
                tbLayer.Text = PLC_SP.ReadNowLay().ToString();
                timer_Pulse.Start();
            }

            if (Config.Mac_S.ShowTest == "N")
            {
                btStart_Test.Visibility = btStop_Test.Visibility = Visibility.Hidden;
            }

            ShowLayerSet();
            ShowLayerTurn();
            ShowLasers();
        }
Пример #3
0
 void timer_Pulse_Tick(object sender, EventArgs e)
 {
     tbPulse.Text = PLC_SP.ReadNowPulse().ToString();
     tbLayer.Text = PLC_SP.ReadNowLay().ToString();
 }