using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;//.Tasks;
using System.Windows.Forms;
using GcDevicePc.ConfigDlg;

namespace GcDevicePc
{
    public partial class MethodConfig : MethodBase
    {
        public InjSample m_InjSampleDlg = new InjSample();
        public AuxDlg m_AuxDlg = new AuxDlg();
        public ChromeDlg m_chromeDlg = new ChromeDlg();
        public InjPortDlg m_InjPortDlg = new InjPortDlg();
        public InjValveDlg m_InjValveDlg = new InjValveDlg();
        public RealColDlg m_RealColDlg = new RealColDlg();
        public RunTableDlg m_RunTableDlg = new RunTableDlg();
        public SignalDlg m_SignalDlg = new SignalDlg();
        public Det m_det = new Det();

        public MethodConfig()
        {
            InitializeComponent();     
        }

        private void InitMethodConfig()
        {           
            m_InjSampleDlg.TopLevel = false;
            m_InjSampleDlg.Show();
            tabControlMethod.TabPages[0].Controls.Add(m_InjSampleDlg);
            m_InjValveDlg.TopLevel = false;
            m_InjValveDlg.Show();
            tabControlMethod.TabPages[1].Controls.Add(m_InjValveDlg);
            m_InjPortDlg.TopLevel = false;
            m_InjPortDlg.Show();
            tabControlMethod.TabPages[2].Controls.Add(m_InjPortDlg);
            m_chromeDlg.TopLevel = false;
            m_chromeDlg.Show();
            tabControlMethod.TabPages[3].Controls.Add(m_chromeDlg);
            m_RealColDlg.TopLevel = false;
            m_RealColDlg.Show();
            tabControlMethod.TabPages[4].Controls.Add(m_RealColDlg);
            m_det.TopLevel = false;
            m_det.Show();
            tabControlMethod.TabPages[5].Controls.Add(m_det);
            m_SignalDlg.TopLevel = false;
            m_SignalDlg.Show();
            tabControlMethod.TabPages[6].Controls.Add(m_SignalDlg);
            m_AuxDlg.TopLevel = false;
            m_AuxDlg.Show();
            tabControlMethod.TabPages[7].Controls.Add(m_AuxDlg);
            //m_RunTableDlg.TopLevel = false;
            //m_RunTableDlg.Show();
            //tabControlMethod.TabPages[8].Controls.Add(m_RunTableDlg);        
        }

        private void MethodConfig_Load(object sender, EventArgs e)
        {
            InitMethodConfig();
        }

        public void Save_Method()
        {
            m_InjPortDlg.recordCurData();
            globaldata.m_profileMethod.SetDevInjPortAllPara();
            m_InjSampleDlg.recordCurData();
            globaldata.m_profileMethod.SetSampleAllPara();
            m_InjValveDlg.recordCurData();
            globaldata.m_profileMethod.SetInjValveAllPara();
            m_chromeDlg.recordCurData();
            globaldata.m_profileMethod.SetChromAllPara();
            m_RealColDlg.recordCurData();
            globaldata.m_profileMethod.SetColTableElseAllPara();
            m_AuxDlg.recordCurData();
            globaldata.m_profileMethod.SetAuxiliaryAllPara();
            m_det.recordCurData();
            globaldata.m_profileMethod.SetFidAllPara();
            globaldata.m_profileMethod.SetTcdAllPara();

           // m_SignalDlg.recordCurData();
           // globaldata.m_profileMethod.SetDevSignalAllPara();

          //  m_RunTableDlg.recordCurData();
          //  globaldata.m_profileMethod.SetRunTableElseAllPara();

         //   string message = "方法文件保存成功";
         //   MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
       
    }
}
