Beispiel #1
0
        private void updateSignals(object sender, EventArgs e)
        {
            // Log.Write(LogLevel.Debug, "tst");


            if (m_pause)
            {
                main_bt_pause.Background = Brushes.Aqua;
                //  main_bt_pause.BorderThickness = new Thickness(1,1,1,3);
                //  main_bt_pause.BorderBrush = Brushes.Red;
                // main_bt_pause.s
                // main_bt_pause.Style = (Style)Application.Current.Resources["activeButton"];
            }
            else
            {
                main_bt_pause.ClearValue(Button.BackgroundProperty);
                main_bt_pause.ClearValue(Button.BorderThicknessProperty);
                main_bt_pause.ClearValue(Button.BorderBrushProperty);
            }

            //connect
            tbCounter.Text = m_plc.tags.get_dint().ToString();
            //karetka
            kar_tb_position.Text    = m_plc.tags.get_ust_karetka_poziciya().ToString(); //go to
            kar_tb_current_pos.Text = m_plc.tags.get_kar_tek_poz().ToString();
            kar_tb_step.Text        = m_plc.tags.get_ust_karetka_rasst().ToString();
            kar_tb_left_speed.Text  = m_plc.tags.get_ust_karetka_skor_vlevo().ToString();
            kar_tb_right_speed.Text = m_plc.tags.get_ust_karetka_skor_vpravo().ToString();
            //kar_cb_lk.IsChecked = m_plc.tags.get_karetka_sleva();
            //kar_cb_pk.IsChecked = m_plc.tags.get_karetka_sprava();
            kar_led_lk.IsActive = m_plc.tags.get_karetka_sleva();
            kar_led_pk.IsActive = m_plc.tags.get_karetka_sprava();

            if (m_plc.tags.get_vyhd_kar_dom())
            {
                kar_bt_find_orign.Background = Brushes.Aqua;
            }
            else
            {
                kar_bt_find_orign.ClearValue(Button.BackgroundProperty);
            }

            if (m_plc.tags.get_vyhd_kar_abs())
            {
                kar_bt_start.Background = Brushes.Aqua;
            }
            else
            {
                kar_bt_start.ClearValue(Button.BackgroundProperty);
            }

            if (m_plc.tags.get_vyhd_kar_otn_vlevo())
            {
                kar_bt_vlevo.Background = Brushes.Aqua;
            }
            else
            {
                kar_bt_vlevo.ClearValue(Button.BackgroundProperty);
            }

            if (m_plc.tags.get_vyhd_kar_otn_vpravo())
            {
                kar_bt_vpravo.Background = Brushes.Aqua;
            }
            else
            {
                kar_bt_vpravo.ClearValue(Button.BackgroundProperty);
            }
            // kar_cb_error.IsChecked ???

            //stol
            stol_tb_porsh_otn0.Text     = m_plc.tags.get_ust_stol_poz_porsh_ot_nulya().ToString();
            stol_tb_plita_width.Text    = m_plc.tags.get_ust_stol_tolshh_plity().ToString();
            stol_tb_position.Text       = m_plc.tags.get_ust_stol_poziciya().ToString();
            stol_tb_step_value.Text     = m_plc.tags.get_ust_stol_otn_rasst().ToString();
            stol_tb_speed.Text          = m_plc.tags.get_ust_stol_skor_vverh().ToString();
            stol_tb_line.Text           = m_plc.tags.get_linejka().ToString();
            main_linejka_dublicate.Data = m_plc.tags.get_linejka().ToString();

            if (m_plc.tags.get_vyhd_pereschjot())
            {
                stol_bt_line_control.Background = Brushes.Aqua;
            }
            else
            {
                stol_bt_line_control.ClearValue(Button.BackgroundProperty);
            }


            if (m_plc.tags.get_vyhd_stol_poisk_nulya())
            {
                stol_bt_find_zero.Background = Brushes.Aqua;
            }
            else
            {
                stol_bt_find_zero.ClearValue(Button.BackgroundProperty);
            }



            //dat
            dat_po1.Data = m_plc.tags.get_ga_po1().ToString();
            dat_po2.Data = m_plc.tags.get_ga_po2().ToString();
            dat_po3.Data = m_plc.tags.get_ga_po3().ToString();
            dat_ph2.Data = m_plc.tags.get_ga_ph2().ToString();
            //dat_T1.Data = m_plc.tags.get_ga_t1().ToString();
            //dat_T2.Data = m_plc.tags.get_ga_t2().ToString();
            //dat_T3.Data = m_plc.tags.get_ga_t3().ToString();
            //dat_T4.Data = m_plc.tags.get_ga_t4().ToString();
            dat_davl9.Data  = m_plc.tags.get_davl9().ToString();
            dat_davl10.Data = m_plc.tags.get_davl10().ToString();
            dat_davl11.Data = m_plc.tags.get_davl11().ToString();

            dat_sk_pot.IsActive  = m_plc.tags.get_prot_skanator();
            dat_sk_tmp.IsActive  = m_plc.tags.get_vys_temp_skanator();
            dat_kl_pot.IsActive  = m_plc.tags.get_prot_gol_laz_i_kalimator();
            dat_kl_tmp.IsActive  = m_plc.tags.get_vys_temp_gol_laz_i_kalimator();
            dat_ls_pot.IsActive  = m_plc.tags.get_prot_lazer();
            dat_ls_temp.IsActive = m_plc.tags.get_vys_temp_lazer();
            dat_cooller.IsActive = m_plc.tags.get_ohl_skan() == 1;

            if (m_plc.tags.get_ohl_skan() == 1)
            {
                dat_cooller.Text = "Охлаждение в норме";
            }
            else if (m_plc.tags.get_ohl_skan() == 0)
            {
                dat_cooller.Text = "Охлаждение недостаточно";
            }
            else
            {
                dat_cooller.Text = "Охлаждение превышено";
            }


            dat_ls_active.IsActive = SpIceController.isBusy();
            dat_ls_wait.IsActive   = SpIceController.isWait();

            m_plc.tags.set_prozhig_rab(SpIceController.isBusy());
            //autoFire
            laerFinish     = (lastLaerFinish == true && !m_plc.tags.get_sloj_rab());
            lastLaerFinish = m_plc.tags.get_sloj_rab();



            if (laerFinish)
            {
                int stop = 1;
            }

            //laerFinish1 = (lastLaerFinish1 == true && !m_plc.tags.get_sloj_rab());
            //lastLaerFinish1 = m_plc.tags.get_sloj_rab();

            pauseFinish     = (lastPauseFinish == true && !m_plc.tags.get_kom_pauza());
            lastPauseFinish = m_plc.tags.get_kom_pauza();
            // pauseFinish = !m_plc.tags.get_kom_pauza();
            bool s1 = m_plc.tags.get_ust_kol_slojov() > 0 && laerFinish && !m_plc.tags.get_kom_pauza() && !m_plc.tags.get_kom_prer();
            bool s2 = !m_plc.tags.get_sloj_rab() && pauseFinish && m_plc.tags.get_kom_rab_do_pauzy() && !m_plc.tags.get_kom_prer();

            if (s1 || s2)
            {
                Log.Write(LogLevel.Info, "start layer ");
                SpIceController.StartLayer_(true);
            }

            //main
            m_main_layerCount_finish.Text = m_plc.tags.get_schjot_slojov().ToString();
            m_main_layerCount.Text        = m_plc.tags.get_ust_kol_slojov().ToString();

            //shnek
            snek_s1_tb.Data      = m_plc.tags.get_ust_vrem_rab_sh1().ToString();
            snek_s2_tb.Data      = m_plc.tags.get_ust_vrem_rab_sh2().ToString();
            snek_s3_tb.Data      = m_plc.tags.get_ust_vrem_rab_sh3().ToString();
            snek_s3_tb_nagr.Data = m_plc.tags.get_tok_sh3().ToString();
            snek_s3_lo.IsActive  = m_plc.tags.get_nizhn_ur_poroshka();
            snek_s3_up.IsActive  = m_plc.tags.get_verhn_ur_poroshka();
            //sloi
            layer_widh.Data          = m_plc.tags.get_ust_tolshh_sloya().ToString();
            layer_time_rot_m3.Data   = m_plc.tags.get_ust_vrem_vrashh_na_meste().ToString();
            layer_stop_m3.Data       = m_plc.tags.get_ust_kar_poz_otkl_sh3().ToString();
            layer_doz_num.Data       = m_plc.tags.get_ust_kol_slojov_dlya_dozatora().ToString();
            layer_doz_rem.Data       = m_plc.tags.get_ost_slojov_dlya_dozatora().ToString();
            layer_pusk_num.Data      = m_plc.tags.get_ust_kol_slojov().ToString();
            layer_pusk_rem.Data      = m_plc.tags.get_ost_slojov().ToString();
            layer_pusk_gotov.Data    = m_plc.tags.get_schjot_slojov().ToString();
            layer_scriptFile.Content = SpIceController.getScripFileName();
            if (m_plc.tags.get_proc_obshh_rab())
            {
                main_bt_process.Background = Brushes.Aqua;
            }
            else
            {
                main_bt_process.ClearValue(Button.BackgroundProperty);
            }

            //modul postroenia
            // build_led1.IsActive = m_plc.tags.get_


            bool errVal = !m_plc.tags.get_prot_skanator() || m_plc.tags.get_vys_temp_skanator() ||
                          !m_plc.tags.get_prot_gol_laz_i_kalimator() || m_plc.tags.get_vys_temp_gol_laz_i_kalimator() ||
                          !m_plc.tags.get_prot_lazer() || m_plc.tags.get_vys_temp_lazer() || m_plc.tags.get_ohl_skan() != 1;

            main_bt_startLayer.IsEnabled = !errVal;
            layer_avtomat_pusk.IsEnabled = !errVal;

            if (false && m_plc.tags.get_proc_obshh_rab() && (m_plc.tags.get_avar_doz() || m_plc.tags.get_avar_m3()))
            {
                m_pause = !m_pause;
                m_plc.tags.set_kom_pauza(m_pause);

                string reason = "";
                if (m_plc.tags.get_avar_doz())
                {
                    m_plc.tags.set_avar_doz(false);
                    reason += "[avar_doz]";
                }
                if (m_plc.tags.get_avar_m3())
                {
                    m_plc.tags.set_avar_m3(false);
                    reason += "[avar_m3]";
                }

                System.Windows.MessageBox.Show("Принудительная приостановка процесса прожига " + reason);
            }
        }
Beispiel #2
0
 private void main_bt_startLayer_Click(object sender, RoutedEventArgs e)
 {
     Log.Write(LogLevel.Info, "start layer ");
     SpIceController.StartLayer_(true);
 }