Esempio n. 1
0
        public async void TheEnclosingMethod()
        {
            //tbkLabel.Text = "thirty seconds delay";

            await Task.Delay(5000);

            Sensor_input_Helper.Command_CheckData(mySerialPort);

            await Task.Delay(5000);

            Sensor_input_Helper.Command_CheckData(mySerialPort);
            await Task.Delay(5000);

            Sensor_input_Helper.Command_CheckData(mySerialPort);
            await Task.Delay(5000);

            Sensor_input_Helper.Command_CheckData(mySerialPort);
            await Task.Delay(5000);

            await Task.Delay(5000);

            Sensor_input_Helper.Command_Check(mySerialPort);
            Sensor_input_Helper.Command_CheckData(mySerialPort);
            //var page = new Page2();
            //page.Show();
        }
Esempio n. 2
0
        private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            timer_baiz_5 = timer_baiz_5 + 1;
            // Updating the Label which displays the current second
            //lblSeconds.Content = DateTime.Now.Second;
            //Sensor_input_Helper.Command_Check(mySerialPort);
            Sensor_input_Helper.Command_CheckData(mySerialPort);

            // Forcing the CommandManager to raise the RequerySuggested event
            CommandManager.InvalidateRequerySuggested();
        }
Esempio n. 3
0
        private void Button1_Baiz_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("start baiz waiting", application_name);
            var timer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(5)
            };

            timer.Start();
            timer.Tick += (sender2, args) =>
            {
                timer.Stop();
                Sensor_input_Helper.Command_Check(mySerialPort);
            };
            timer.Start();
            timer.Tick += (sender2, args) =>
            {
                timer.Stop();
                Sensor_input_Helper.Command_Check(mySerialPort);
            };
            timer.Start();
            timer.Tick += (sender2, args) =>
            {
                timer.Stop();
                Sensor_input_Helper.Command_Check(mySerialPort);
            };
            timer.Start();
            timer.Tick += (sender2, args) =>
            {
                timer.Stop();
                Sensor_input_Helper.Command_Check(mySerialPort);
            };
            timer.Start();
            timer.Tick += (sender2, args) =>
            {
                timer.Stop();
                Sensor_input_Helper.Command_Check(mySerialPort);
            };
            timer.Start();
            timer.Tick += (sender2, args) =>
            {
                timer.Stop();
                Sensor_input_Helper.Command_Check(mySerialPort);
                Sensor_input_Helper.Command_CheckData(mySerialPort);
                MessageBox.Show("Finsih baiz 1 waiting", application_name);
            };
        }
Esempio n. 4
0
        private void Button5_Baiz_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("start baiz waiting", application_name);

            DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();

            dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 3);
            dispatcherTimer.Start();


            if (timer_baiz_5 >= 10)
            {
                dispatcherTimer.Stop();
                Sensor_input_Helper.Command_Check(mySerialPort);
                Sensor_input_Helper.Command_CheckData(mySerialPort);
                MessageBox.Show("Finsih baiz 5 waiting", application_name);
            }
        }
Esempio n. 5
0
        private async void Button4_Baiz_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("start baiz waiting", application_name);
            await Task.Delay(5000);

            await Task.Delay(5000);

            await Task.Delay(5000);

            await Task.Delay(5000);

            await Task.Delay(5000);

            await Task.Delay(5000);

            Sensor_input_Helper.Command_Check(mySerialPort);
            Sensor_input_Helper.Command_CheckData(mySerialPort);
            MessageBox.Show("Finsih baiz 4 waiting", application_name);
        }
Esempio n. 6
0
 private void btn_CheckData_click(object sender, RoutedEventArgs e)
 {
     Sensor_input_Helper.Command_CheckData(mySerialPort);
 }