Ejemplo n.º 1
0
        void Set_Click(object sender, RoutedEventArgs e)
        {
            Button bt  = sender as Button;
            string lay = bt.Tag.ToString();

            if (csMsg.ShowQuestion("确定要设置该层脉冲吗?", false))
            {
                //读取当前脉冲
                int pulse = PLC_SP.ReadNowPulse();
                PLC_SP.SavePulse(int.Parse(lay), pulse);
            }
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
 void timer_Pulse_Tick(object sender, EventArgs e)
 {
     tbPulse.Text = PLC_SP.ReadNowPulse().ToString();
     tbLayer.Text = PLC_SP.ReadNowLay().ToString();
 }