Пример #1
0
 private void связьСPLCToolStripMenuItem_Click(object sender, EventArgs e)
 {
     tcp_ip = new TCP_IP();
     tcp_ip.Show();
 }
Пример #2
0
        public Control_Form1()
        {
            InitializeComponent();

            tcp_ip = new TCP_IP();

            model = new Model();
            model.createFolder();
            model.createDBAction();
            model.createTableAction();
            model.createMeasureDB();

            view_wStart = new Viev_wStart(model);
            panel1.Controls.Add(view_wStart);
            view_wStart.Hide();

            view_alarm = new View_Alarm(model);
            panel1.Controls.Add(view_alarm);
            view_alarm.Hide();

            view_archiv = new View_Archiv(model);
            panel1.Controls.Add(view_archiv);
            view_archiv.Hide();

            view_seting = new View_Setings(model);
            panel1.Controls.Add(view_seting);
            view_seting.Hide();

            view_wFinish = new View_wFinish(model);
            panel1.Controls.Add(view_wFinish);
            view_wFinish.Hide();

            view_work = new View_Work(model);
            panel1.Controls.Add(view_work);
            view_work.Hide();

            view_graphik = new View_Graphik(model);
            panel1.Controls.Add(view_graphik);
            view_graphik.Hide();

            //-----------------------------------------------------------------------------------------
            view_work.checkBox_ManualChecked(new EventHandler(checkBox_ManualChecked));
            view_work.checkBox_AutoChecked(new EventHandler(checkBox_AutoChecked));
            view_work.buttonNextClick(new EventHandler(button_View_Work_Next));
            view_work.buttonCompressingMouseDown(new MouseEventHandler(buttonViewWorkCompressingMouseDown));
            view_work.buttonCompressingMouseUp(new MouseEventHandler(buttonViewWorkCompressingMouseUp));
            view_work.buttonStreatchingMouseDown(new MouseEventHandler(buttonViewWorkStreatchingMouseDown));
            view_work.buttonStreatchingMouseUp(new MouseEventHandler(buttonViewWorkStreatchingMouseUp));
            view_work.buttonOK_SetupClick(new EventHandler(buttonViewWorkOK_Setup));
            view_work.buttonCancel_Click(new EventHandler(buttonCancelClick));
            //------------------------------------------------------------------------------------------
            view_wStart.button_Next(new EventHandler(button_Next));
            view_wStart.comboBox1_SelectedIndexChanged(new EventHandler(comboBox1SelectedIndexChanged));
            //------------------------------------------------------------------------------------------
            view_wFinish.buttonFinish_Click(new EventHandler(buttonFinish));
            //------------------------------------------------------------------------------------------
            view_seting.button_Add(new EventHandler(buttonAdd));
            view_seting.button_AddUser(new EventHandler(buttonAddUser));
            view_seting.comboBoxSSAbsorbers_SelectedIndexChanged(new EventHandler(comboBoxSSAbsorbersIndexChanged));
            view_seting.comboBoxSSAbsorbers_Click(new EventHandler(comboBoxSSAbsorbersClick));
            view_seting.button_Delete_Absorber(new EventHandler(buttonDeleteAbsorber));
            view_seting.button_Delete_User(new EventHandler(buttonDeleteUsers));
            view_seting.button_Change_Absorber(new EventHandler(buttonUpdateAbsorber));
            view_seting.comboBoxRTMAbsorbers_SelectedIndexChange(new EventHandler(comboBoxRTMAbsorbersSelectedIndexChange));
            view_seting.comboBoxRTMAbsorbers_Click(new EventHandler(comboBoxRTMAbsorbersClick));
            //------------------------------------------------------------------------------------------

            view_archiv.buttonArchivEnter_click(new EventHandler(buttonArchivEnter));
            view_archiv.dateTimePicker1_ValueChanged(new EventHandler(dateTimePicker1ValueChanged));
            view_archiv.dateTimePicker2_ValueChanged(new EventHandler(dateTimePicker2ValueChanged));
            view_archiv.comboBoxSelectCerial_IndexChange(new EventHandler(comboBoxSelectCerialIndexChange));
            view_archiv.comboBoxSelectProtocol_IndexChange(new EventHandler(comboBoxSelectProtocolIndexChange));
            view_archiv.buttonSave_Click(new EventHandler(buttonArchivSave));
            view_archiv.comboBoxBlock_IndexChange(new EventHandler(comboBoxBlockIndexChange));
            view_archiv.comboBoxSeparation_IndexChange(new EventHandler(comboBoxSeparationIndexChange));
            view_archiv.comboBoxRTM_IndexChange(new EventHandler(comboBoxRTMIndexChange));
            //-------------------------------------------------------------------------------------------
            // Properties.Settings.Default.IPAdress = "127.0.0.1";
            // Properties.Settings.Default.Save();

            model.numberProtocol = Properties.Settings.Default.NumberProtocol;

            model.conntectToPLC();

            readReg = new Thread(readHolding);
            readReg.IsBackground = true;
            readReg.Start();
        }