using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;//.Tasks;
using GcDevicePc;
using GcDevicePc.DevParam;

namespace GcDevicePc.IniParam
{
    public class CProfileDevice
    {
        static string sMethodFullPath;  //方法文件名全名
        static string sStatusFullPath;  //状态文件名全名

        public static DevParamSet m_DevParam = new DevParamSet();

        IniHelper m_ProfileMetheod = new IniHelper(sMethodFullPath);
        IniHelper m_ProfileStatus = new IniHelper(sStatusFullPath);

        public const int MAX_VALVE_NUM = 6;

        string[] sStage = new string[5];

        public CProfileDevice()
        {
            
            sStage[0] = "Init";
            sStage[1] = "1st";
            sStage[2] = "2nd";
            sStage[3] = "3rd";
        }

        public void SetMethodFullName(string name)
        {
            sMethodFullPath = name;
            m_ProfileMetheod.IniHelperRename(name);
        }

        public void SetStatusFullName(string name)
        {
            sStatusFullPath = name;
            m_ProfileStatus.IniHelperRename(name);
        }

        /// <summary>
        /// 仪器方法文件初始化
        /// </summary>
        public void InitDevMethodIniFile()
        {
            //柱箱
            string sAppName = "柱箱";
            string sDefault = "";
            float fDefault = 0.0f;
            int iDefault = 0;
         
            //if (m_DevParam.syspara.u16Col == 1)
            //{
                sAppName = "柱箱";
                m_ProfileMetheod.WriteValue(sAppName, "柱箱", m_DevParam.syspara.u16Col.ToString());
                m_ProfileMetheod.WriteValue(sAppName, "最高温度", iDefault.ToString());
                m_ProfileMetheod.WriteValue(sAppName, "平衡时间", iDefault.ToString());
                m_ProfileMetheod.WriteValue(sAppName, "快速冷阱", iDefault.ToString());
                m_ProfileMetheod.WriteValue(sAppName, "冷却方式", iDefault.ToString());
            //}

            //色谱柱
	        sAppName = "色谱柱";
	        m_ProfileMetheod.WriteValue(sAppName,"色谱柱",sDefault);
	        m_ProfileMetheod.WriteValue(sAppName,"类型",iDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"最高温度",fDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"长度",fDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"口径",fDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"膜厚",fDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"描述",sDefault);
	        m_ProfileMetheod.WriteValue(sAppName,"压力设定值",fDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"流量设定值",fDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"平均线速度设定值",fDefault.ToString());
	        //检测器前 后  暂时认为前为FID 后为TCD
            //if (m_DevParam.syspara.u16DetFront == 1)
            //{	
            //    sAppName = "前检测器";
            //    m_ProfileMetheod.WriteValue(sAppName,"检测器位置",sDefault);
            //    m_ProfileMetheod.WriteValue(sAppName,"自动点火",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"归零",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"极性",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"灵敏度",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"加热器设定温度",fDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"氢气燃气流量开关",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"氢气燃气流量设定值",fDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"空气流量开关",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"空气流量设定值",fDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"尾吹气流量开关",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"尾吹气流量设定值",fDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"补偿",iDefault.ToString());

            //}
            //if (m_DevParam.syspara.u16DetBehind == 1)
            //{
            //    sAppName = "后TCD";
            //    m_ProfileMetheod.WriteValue(sAppName,"TCD",sDefault);
            //    m_ProfileMetheod.WriteValue(sAppName,"信号值",fDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"桥电路",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"极性",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"自动调零",iDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"加热器设定温度",fDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"尾气设定值",fDefault.ToString());
            //    m_ProfileMetheod.WriteValue(sAppName,"信号补偿",iDefault.ToString());
            //}

	        //进样器
	        m_ProfileMetheod.WriteValue("前进样器","进样器",sDefault);
            m_ProfileMetheod.WriteValue("前进样器", "进样量", iDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样器","注射器尺寸",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样器","进样前样品",sDefault);
	        m_ProfileMetheod.WriteValue("前进样器","进样前溶剂A",sDefault);
	        m_ProfileMetheod.WriteValue("前进样器","进样前溶剂B",sDefault);
	        m_ProfileMetheod.WriteValue("前进样器","推拉针芯次数",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样器","进样后溶剂A",sDefault);
	        m_ProfileMetheod.WriteValue("前进样器","进样后溶剂B",sDefault);

	        m_ProfileMetheod.WriteValue("后进样器","进样器",sDefault);
            m_ProfileMetheod.WriteValue("后进样器", "进样量", iDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样器","注射器尺寸",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样器","进样前样品",sDefault);
	        m_ProfileMetheod.WriteValue("后进样器","进样前溶剂A",sDefault);
	        m_ProfileMetheod.WriteValue("后进样器","进样前溶剂B",sDefault);
	        m_ProfileMetheod.WriteValue("后进样器","推拉针芯次数",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样器","进样后溶剂A",sDefault);
	        m_ProfileMetheod.WriteValue("后进样器","进样后溶剂B",sDefault);

	        //阀门
	        //ushort u16Num = 0;
	        sAppName = "阀";
	        string strKeyName = "阀";
	        for (int i= 0;i <MAX_VALVE_NUM;i++)
	        {
                int channel = i + 1;
                string tstrKeyNameFull = strKeyName + channel.ToString();

		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"开关",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"加热开关",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定温度",fDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间1",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间2",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间3",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间4",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间5",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间6",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间7",iDefault.ToString());
		        m_ProfileMetheod.WriteValue(sAppName,tstrKeyNameFull+"设定时间8",iDefault.ToString());
	        }

	        //进样口
	        m_ProfileMetheod.WriteValue("前进样口","进样口",sDefault);
	        m_ProfileMetheod.WriteValue("前进样口","加热",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","设定温度",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","设定压力",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","设定总流量",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","隔垫吹扫流量设定值",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","柱流量设定值",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","分流不分流模式",sDefault);
	        m_ProfileMetheod.WriteValue("前进样口","分流比",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","分流流量",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","载气开启",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","载气节省量",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("前进样口","载气节省开始时间",fDefault.ToString());

	        m_ProfileMetheod.WriteValue("后进样口","进样口",sDefault);
	        m_ProfileMetheod.WriteValue("后进样口","加热",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","设定温度",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","设定压力",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","设定总流量",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","隔垫吹扫流量设定值",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","柱流量设定值",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","分流不分流模式",sDefault);
	        m_ProfileMetheod.WriteValue("后进样口","分流比",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","分流流量",fDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","载气开启",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","载气节省量",iDefault.ToString());
	        m_ProfileMetheod.WriteValue("后进样口","载气节省开始时间",fDefault.ToString());
	
	        //辅助
	        sAppName = "辅助";
            m_ProfileMetheod.WriteValue(sAppName, "辅助加热区1", iDefault.ToString());
            m_ProfileMetheod.WriteValue(sAppName, "辅助加热区1设定温度", fDefault.ToString());
            m_ProfileMetheod.WriteValue(sAppName, "辅助加热区2", iDefault.ToString());
	        m_ProfileMetheod.WriteValue(sAppName,"辅助加热区2设定温度",fDefault.ToString());
       }

        //public bool SetDevInjPortAllPara(CString strCurDev,CDevInjPort *pDevInjPortPara)
        public bool SetDevInjPortAllPara()  //设置进样口参数
        {
            //m_DevParam.
            const int cFront = 0;
            const int cBehind = 1;
         
            if (m_DevParam.syspara.u16InjPortFront == 1)
            {
                string strCurDev = "前进样口";
                m_ProfileMetheod.WriteValue(strCurDev, "进样口", m_DevParam.port[cFront].sInjPortLoc);
                m_ProfileMetheod.WriteProfileBool(strCurDev, "加热", m_DevParam.port[cFront].bHeater);
                m_ProfileMetheod.WriteValue(strCurDev, "设定温度", m_DevParam.port[cFront].fHeaterSetTemp.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "设定压力", m_DevParam.port[cFront].fSetPre.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "设定总流量", m_DevParam.port[cFront].fSetSumFlow.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "隔垫吹扫流量设定值", m_DevParam.port[cFront].fSetPurgeFlow.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "柱流量设定值", m_DevParam.port[cFront].fSetColumnFlow.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "分流不分流模式", m_DevParam.port[cFront].sWeatherShuntModel.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "分流比", m_DevParam.port[cFront].u16SplitRatio.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "分流流量", m_DevParam.port[cFront].fSplitFlow.ToString());
                m_ProfileMetheod.WriteProfileBool(strCurDev, "载气开启", m_DevParam.port[cFront].bCarrierGasSave);
                m_ProfileMetheod.WriteValue(strCurDev, "载气节省量", m_DevParam.port[cFront].u16CarrierGasSave.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "载气节省开始时间", m_DevParam.port[cFront].fSaveGasTime.ToString());
            }
            if (m_DevParam.syspara.u16InjPortBehind == 1)
            {
                string strCurDev = "后进样口";
                m_ProfileMetheod.WriteValue(strCurDev, "进样口", m_DevParam.port[cBehind].sInjPortLoc);
                m_ProfileMetheod.WriteProfileBool(strCurDev, "加热", m_DevParam.port[cBehind].bHeater);
                m_ProfileMetheod.WriteValue(strCurDev, "设定温度", m_DevParam.port[cBehind].fHeaterSetTemp.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "设定压力", m_DevParam.port[cBehind].fSetPre.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "设定总流量", m_DevParam.port[cBehind].fSetSumFlow.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "隔垫吹扫流量设定值", m_DevParam.port[cBehind].fSetPurgeFlow.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "柱流量设定值", m_DevParam.port[cBehind].fSetColumnFlow.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "分流不分流模式", m_DevParam.port[cBehind].sWeatherShuntModel.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "分流比", m_DevParam.port[cBehind].u16SplitRatio.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "分流流量", m_DevParam.port[cBehind].fSplitFlow.ToString());
                m_ProfileMetheod.WriteProfileBool(strCurDev, "载气开启", m_DevParam.port[cBehind].bCarrierGasSave);
                m_ProfileMetheod.WriteValue(strCurDev, "载气节省量", m_DevParam.port[cBehind].u16CarrierGasSave.ToString());
                m_ProfileMetheod.WriteValue(strCurDev, "载气节省开始时间", m_DevParam.port[cBehind].fSaveGasTime.ToString());
            }
            return true;
        }

        public bool GetDevInjPortAllPara()   //获取进样口参数
        {
            int iDefault = 0;
            float fDefault = 0.0f;
            const int cFront = 0;
            const int cBehind = 1;

            if (m_DevParam.syspara.u16InjPortFront == 1)
            {
                string strCurDev = "前进样口";
                m_DevParam.port[cFront].sInjPortLoc = m_ProfileMetheod.ReadValue(strCurDev, "进样口");
                m_DevParam.port[cFront].bHeater = Convert.ToBoolean(m_ProfileMetheod.GetProfileInt(strCurDev, "加热", iDefault));
                m_DevParam.port[cFront].fHeaterSetTemp = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定温度", fDefault);
                m_DevParam.port[cFront].fHeaterSetTempm = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定温度", fDefault);
                m_DevParam.port[cFront].fSetPre = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定压力", fDefault);
                m_DevParam.port[cFront].fSetSumFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定总流量", fDefault);
                m_DevParam.port[cFront].fSetPurgeFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "隔垫吹扫流量设定值", fDefault);
                m_DevParam.port[cFront].fSetColumnFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "柱流量设定值", fDefault);
                m_DevParam.port[cFront].sWeatherShuntModel = m_ProfileMetheod.ReadValue(strCurDev, "分流不分流模式");
                m_DevParam.port[cFront].u16SplitRatio = Convert.ToUInt16(m_ProfileMetheod.GetProfileInt(strCurDev, "分流比", iDefault));
                m_DevParam.port[cFront].fSplitFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "分流流量", fDefault);
                m_DevParam.port[cFront].bCarrierGasSave = Convert.ToBoolean(m_ProfileMetheod.GetProfileInt(strCurDev, "载气开启", iDefault));
                m_DevParam.port[cFront].u16CarrierGasSave = Convert.ToUInt16(m_ProfileMetheod.GetProfileInt(strCurDev, "载气节省量", iDefault));
                m_DevParam.port[cFront].fSaveGasTime = m_ProfileMetheod.GetProfileFloat(strCurDev, "载气节省开始时间", fDefault);
            }
            if (m_DevParam.syspara.u16InjPortBehind == 1)
            {
                string strCurDev = "后进样口";
                m_DevParam.port[cBehind].sInjPortLoc = m_ProfileMetheod.ReadValue(strCurDev, "进样口");
                m_DevParam.port[cBehind].bHeater = Convert.ToBoolean(m_ProfileMetheod.GetProfileInt(strCurDev, "加热", iDefault));
                m_DevParam.port[cBehind].fHeaterSetTemp = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定温度", fDefault);
                m_DevParam.port[cBehind].fHeaterSetTempm = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定温度", fDefault);
                m_DevParam.port[cBehind].fSetPre = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定压力", fDefault);
                m_DevParam.port[cBehind].fSetSumFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "设定总流量", fDefault);
                m_DevParam.port[cBehind].fSetPurgeFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "隔垫吹扫流量设定值", fDefault);
                m_DevParam.port[cBehind].fSetColumnFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "柱流量设定值", fDefault);
                m_DevParam.port[cBehind].sWeatherShuntModel = m_ProfileMetheod.ReadValue(strCurDev, "分流不分流模式");
                m_DevParam.port[cBehind].u16SplitRatio = Convert.ToUInt16(m_ProfileMetheod.GetProfileInt(strCurDev, "分流比", iDefault));
                m_DevParam.port[cBehind].fSplitFlow = m_ProfileMetheod.GetProfileFloat(strCurDev, "分流流量", fDefault);
                m_DevParam.port[cBehind].bCarrierGasSave = Convert.ToBoolean(m_ProfileMetheod.GetProfileInt(strCurDev, "载气开启", iDefault));
                m_DevParam.port[cBehind].u16CarrierGasSave = Convert.ToUInt16(m_ProfileMetheod.GetProfileInt(strCurDev, "载气节省量", iDefault));
                m_DevParam.port[cBehind].fSaveGasTime = m_ProfileMetheod.GetProfileFloat(strCurDev, "载气节省开始时间", fDefault);
            }
		    return true;
        }

        public bool SetSampleAllPara()
        {
            //const int iDefault = 0;
            //const float fDefault = 0.0f;
            //const int cFront = 0;
            //const int cBehind = 1;

            if (m_DevParam.syspara.u16SampleFront == 1)
            {
                string strCurDev = "前进样器";
                int index = 0;
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样器", m_DevParam.sample[index].sSample);
                m_ProfileMetheod.WriteProfileFloat(strCurDev, "进样量", m_DevParam.sample[index].fSampleQuantity);
                m_ProfileMetheod.WriteProfileFloat(strCurDev, "注射器尺寸", m_DevParam.sample[index].fInjectorSize);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样前样品", m_DevParam.sample[index].sFrontSample);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样前溶剂A", m_DevParam.sample[index].sBSSolventA);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样前溶剂B", m_DevParam.sample[index].sBSSolventB);
                m_ProfileMetheod.WriteProfileInt(strCurDev, "推拉针芯次数", m_DevParam.sample[index].u16PushPullTimes);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样后溶剂A", m_DevParam.sample[index].sASSolventA);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样后溶剂B", m_DevParam.sample[index].sASSolventB);
            }
            if (m_DevParam.syspara.u16SampleBehind == 1)
            {
                string strCurDev = "后进样器";
                int index = 1;
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样器", m_DevParam.sample[index].sSample);
                m_ProfileMetheod.WriteProfileFloat(strCurDev, "进样量", m_DevParam.sample[index].fSampleQuantity);
                m_ProfileMetheod.WriteProfileFloat(strCurDev, "注射器尺寸", m_DevParam.sample[index].fInjectorSize);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样前样品", m_DevParam.sample[index].sFrontSample);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样前溶剂A", m_DevParam.sample[index].sBSSolventA);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样前溶剂B", m_DevParam.sample[index].sBSSolventB);
                m_ProfileMetheod.WriteProfileInt(strCurDev, "推拉针芯次数", m_DevParam.sample[index].u16PushPullTimes);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样后溶剂A", m_DevParam.sample[index].sASSolventA);
                m_ProfileMetheod.WriteProfileString(strCurDev, "进样后溶剂B", m_DevParam.sample[index].sASSolventB);
            }
                return true;
        }

        public bool GetSampleAllPara(string strCurDev)  //获取进样阀参数
        {
            //TCHAR tChar[100];
            //DWORD dSize = 100;
	        const int iDefault = -1;
	        const float fDefault = -1.0f;
            //CString sErr = "Err";
            const int cFront = 0;
            const int cBehind = 1;

            if ((m_DevParam.syspara.u16SampleFront == 1))
            {
                m_DevParam.sample[cFront].sSample = m_ProfileMetheod.ReadValue("前进样器", "进样器");
                m_DevParam.sample[cFront].fSampleQuantity = m_ProfileMetheod.GetProfileFloat("前进样器", "进样量", fDefault);
                m_DevParam.sample[cFront].fInjectorSize = m_ProfileMetheod.GetProfileFloat("前进样器", "注射器尺寸", fDefault);
                m_DevParam.sample[cFront].sFrontSample = m_ProfileMetheod.ReadValue("前进样器", "进样前样品");
                m_DevParam.sample[cFront].sBSSolventA = m_ProfileMetheod.ReadValue("前进样器", "进样前溶剂A");
                m_DevParam.sample[cFront].sBSSolventB = m_ProfileMetheod.ReadValue("前进样器", "进样前溶剂B");
                m_DevParam.sample[cFront].u16PushPullTimes = m_ProfileMetheod.GetProfileInt("前进样器", "推拉针芯次数", iDefault);
                m_DevParam.sample[cFront].sASSolventA = m_ProfileMetheod.ReadValue("前进样器", "进样后溶剂A");
                m_DevParam.sample[cFront].sASSolventB = m_ProfileMetheod.ReadValue("前进样器", "进样后溶剂B");
            }
            if (m_DevParam.syspara.u16SampleBehind == 1)
            {
                m_DevParam.sample[cBehind].sSample = m_ProfileMetheod.ReadValue("后进样器", "进样器");
                m_DevParam.sample[cBehind].fSampleQuantity = m_ProfileMetheod.GetProfileFloat("后进样器", "进样量", fDefault);
                m_DevParam.sample[cBehind].fInjectorSize = m_ProfileMetheod.GetProfileFloat("后进样器", "注射器尺寸", fDefault);
                m_DevParam.sample[cBehind].sFrontSample = m_ProfileMetheod.ReadValue("后进样器", "进样前样品");
                m_DevParam.sample[cBehind].sBSSolventA = m_ProfileMetheod.ReadValue("后进样器", "进样前溶剂A");
                m_DevParam.sample[cBehind].sBSSolventB = m_ProfileMetheod.ReadValue("后进样器", "进样前溶剂B");
                m_DevParam.sample[cBehind].u16PushPullTimes = m_ProfileMetheod.GetProfileInt("后进样器", "推拉针芯次数", iDefault);
                m_DevParam.sample[cBehind].sASSolventA = m_ProfileMetheod.ReadValue("后进样器", "进样后溶剂A");
                m_DevParam.sample[cBehind].sASSolventB = m_ProfileMetheod.ReadValue("后进样器", "进样后溶剂B");
            }
            return true;
        }  //获取进样器参数


        public bool SetInjValveAllPara()  //设置进样阀参数
        {
	       // ushort u16Num = 0;
	        string sAppName = "阀";
	        string strKeyName = "阀";

		    for (int i= 0;i <MAX_VALVE_NUM;i++)
		    {
                int channel = i + 1;
                m_ProfileMetheod.WriteProfileBool(sAppName, strKeyName + channel.ToString() + "开关", m_DevParam.valve.bValveKey[i]);
                m_ProfileMetheod.WriteProfileBool(sAppName, strKeyName + channel.ToString() + "加热开关", m_DevParam.valve.bHeaterKey[i]);
                m_ProfileMetheod.WriteProfileFloat(sAppName, strKeyName + channel.ToString() + "设定温度", m_DevParam.valve.fSetTemp[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间1", m_DevParam.valve.u16ValveSetTime1[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间2", m_DevParam.valve.u16ValveSetTime2[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间3", m_DevParam.valve.u16ValveSetTime3[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间4", m_DevParam.valve.u16ValveSetTime4[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间5", m_DevParam.valve.u16ValveSetTime5[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间6", m_DevParam.valve.u16ValveSetTime6[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间7", m_DevParam.valve.u16ValveSetTime7[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间8", m_DevParam.valve.u16ValveSetTime8[i]);
		    }
		    return true;
        }

        public bool GetInjValveAllPara()  //获取进样阀参数
        {
            const int iDefault = 0;
            const float fDefault = 0.0f;
            string sAppName = "阀";
            string strKeyName = "阀";

            for (int i = 0; i < MAX_VALVE_NUM; i++)
            {
                int channel = i + 1;
                m_DevParam.valve.bValveKey[i] = Convert.ToBoolean(m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "开关", iDefault));
                m_DevParam.valve.bHeaterKey[i] = Convert.ToBoolean(m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "加热开关", iDefault));
                m_DevParam.valve.fSetTemp[i] = m_ProfileMetheod.GetProfileFloat(sAppName, strKeyName + channel.ToString() + "设定温度", fDefault);
                m_DevParam.valve.u16ValveSetTime1[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间1", iDefault);
                m_DevParam.valve.u16ValveSetTime2[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间2", iDefault);
                m_DevParam.valve.u16ValveSetTime3[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间3", iDefault);
                m_DevParam.valve.u16ValveSetTime4[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间4", iDefault);
                m_DevParam.valve.u16ValveSetTime5[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间5", iDefault);
                m_DevParam.valve.u16ValveSetTime6[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间6", iDefault);
                m_DevParam.valve.u16ValveSetTime7[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间7", iDefault);
                m_DevParam.valve.u16ValveSetTime8[i] = m_ProfileMetheod.GetProfileInt(sAppName, strKeyName + channel.ToString() + "设定时间8", iDefault);
            }
            return true;
        }

        public bool SetChromAllPara()  //设置色谱柱
        {
            string sAppName = "色谱柱";
            const int cFront = 0;
            const int cBehind = 1;

            if (m_DevParam.syspara.u16ChromFront == 1)
            {
                m_ProfileMetheod.WriteProfileInt(sAppName, "色谱柱", m_DevParam.chrom[cFront].sChromSelect);
                m_ProfileMetheod.WriteProfileInt(sAppName, "类型", m_DevParam.chrom[cFront].u16ChromType);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "最高温度", m_DevParam.chrom[cFront].fHigestTempSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "长度", m_DevParam.chrom[cFront].fLengthSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "口径", m_DevParam.chrom[cFront].fCalSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "膜厚", m_DevParam.chrom[cFront].fFilmThicknessSet);
                m_ProfileMetheod.WriteProfileString(sAppName, "描述", m_DevParam.chrom[cFront].sDescribe);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "压力设定值", m_DevParam.chrom[cFront].fPreSetValue);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "流量设定值", m_DevParam.chrom[cFront].fFlowSetValue);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "平均线速度设定值", m_DevParam.chrom[cFront].fSetAverageLineSpeed);
            }
            else if (m_DevParam.syspara.u16ChromBehind == 1)
            {
                m_ProfileMetheod.WriteProfileInt(sAppName, "色谱柱", m_DevParam.chrom[cBehind].sChromSelect);
                m_ProfileMetheod.WriteProfileInt(sAppName, "类型", m_DevParam.chrom[cBehind].u16ChromType);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "最高温度", m_DevParam.chrom[cBehind].fHigestTempSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "长度", m_DevParam.chrom[cBehind].fLengthSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "口径", m_DevParam.chrom[cBehind].fCalSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "膜厚", m_DevParam.chrom[cBehind].fFilmThicknessSet);
                m_ProfileMetheod.WriteProfileString(sAppName, "描述", m_DevParam.chrom[cBehind].sDescribe);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "压力设定值", m_DevParam.chrom[cBehind].fPreSetValue);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "流量设定值", m_DevParam.chrom[cBehind].fFlowSetValue);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "平均线速度设定值", m_DevParam.chrom[cBehind].fSetAverageLineSpeed);
            }
            return true;
        }

        public bool GetChromAllPara() //获取色谱柱
        {
	        const int iDefault = 0;
	        const float fDefault = 0.0f;
            string sAppName =null;
            const int cFront = 0;
            const int cBehind = 1;

            if ((m_DevParam.syspara.u16ChromFront == 1))
            {
                sAppName = "前色谱柱";
                m_DevParam.chrom[cFront].sChromSelect = m_ProfileMetheod.GetProfileInt(sAppName, "色谱柱", iDefault);
                m_DevParam.chrom[cFront].u16ChromType = m_ProfileMetheod.GetProfileInt(sAppName, "类型", iDefault);
                m_DevParam.chrom[cFront].fHigestTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "最高温度", fDefault);
                m_DevParam.chrom[cFront].fLengthSet = m_ProfileMetheod.GetProfileFloat(sAppName, "长度", fDefault);
                m_DevParam.chrom[cFront].fCalSet = m_ProfileMetheod.GetProfileFloat(sAppName, "口径", fDefault);
                m_DevParam.chrom[cFront].fFilmThicknessSet = m_ProfileMetheod.GetProfileFloat(sAppName, "膜厚", fDefault);
                m_DevParam.chrom[cFront].sDescribe = m_ProfileMetheod.GetProfileString(sAppName, "描述");
                m_DevParam.chrom[cFront].fPreSetValue = m_ProfileMetheod.GetProfileFloat(sAppName, "压力设定值", fDefault);
                m_DevParam.chrom[cFront].fFlowSetValue = m_ProfileMetheod.GetProfileFloat(sAppName, "流量设定值", fDefault);
                m_DevParam.chrom[cFront].fSetAverageLineSpeed = m_ProfileMetheod.GetProfileFloat(sAppName, "平均线速度设定值", fDefault);
            }

            if ((m_DevParam.syspara.u16ChromBehind == 1))
            {
                sAppName = "后色谱柱";
                m_DevParam.chrom[cBehind].sChromSelect = m_ProfileMetheod.GetProfileInt(sAppName, "色谱柱", iDefault);
                m_DevParam.chrom[cBehind].u16ChromType = m_ProfileMetheod.GetProfileInt(sAppName, "类型", iDefault);
                m_DevParam.chrom[cBehind].fHigestTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "最高温度", fDefault);
                m_DevParam.chrom[cBehind].fLengthSet = m_ProfileMetheod.GetProfileFloat(sAppName, "长度", fDefault);
                m_DevParam.chrom[cBehind].fCalSet = m_ProfileMetheod.GetProfileFloat(sAppName, "口径", fDefault);
                m_DevParam.chrom[cBehind].fFilmThicknessSet = m_ProfileMetheod.GetProfileFloat(sAppName, "膜厚", fDefault);
                m_DevParam.chrom[cBehind].sDescribe = m_ProfileMetheod.GetProfileString(sAppName, "描述");
                m_DevParam.chrom[cBehind].fPreSetValue = m_ProfileMetheod.GetProfileFloat(sAppName, "压力设定值", fDefault);
                m_DevParam.chrom[cBehind].fFlowSetValue = m_ProfileMetheod.GetProfileFloat(sAppName, "流量设定值", fDefault);
                m_DevParam.chrom[cBehind].fSetAverageLineSpeed = m_ProfileMetheod.GetProfileFloat(sAppName, "平均线速度设定值", fDefault);
            }


		    return true;
        }

        public bool SetColTableElseAllPara()  //柱箱配置
        {
	        string sAppName = "柱箱";
            m_ProfileMetheod.WriteProfileInt(sAppName, "柱箱", m_DevParam.col.u16KeyCol);
            m_ProfileMetheod.WriteProfileFloat(sAppName, "最高温度", m_DevParam.col.fHigestTemp);
            m_ProfileMetheod.WriteProfileFloat(sAppName, "平衡时间", m_DevParam.col.fBalanceTime);
            m_ProfileMetheod.WriteProfileInt(sAppName, "快速冷阱", m_DevParam.col.u16FastColdTrap);
            m_ProfileMetheod.WriteProfileInt(sAppName, "冷却方式", m_DevParam.col.u16StartTarp_Type);
            m_ProfileMetheod.WriteProfileInt(sAppName, "柱箱开关", m_DevParam.col.u16KeyCol);
            m_ProfileMetheod.WriteProfileFloat(sAppName, "设定温度", m_DevParam.col.fColTempSet);
            m_ProfileMetheod.WriteProfileFloat(sAppName, "后运行温度", m_DevParam.col.fBehindRunTemp);
            m_ProfileMetheod.WriteProfileFloat(sAppName, "后运行时间", m_DevParam.col.fBehindRunTime);

            sAppName = "程升表";
            m_ProfileMetheod.WriteProfileInt(sAppName, "阶段数目", m_DevParam.col.u16ColProNum);

		    return true;
        }

        public bool GetColTableElseAllPara()  //柱箱配置
        {
	        const int iDefault = 0;
	        const float fDefault = 0.0f;
            string sAppName = "柱箱";

            m_DevParam.col.u16KeyCol = m_ProfileMetheod.GetProfileInt(sAppName, "柱箱开关", iDefault);
            m_DevParam.col.fHigestTemp = m_ProfileMetheod.GetProfileFloat(sAppName, "最高温度", fDefault);
            m_DevParam.col.fBalanceTime = m_ProfileMetheod.GetProfileFloat(sAppName, "平衡时间", fDefault);
            m_DevParam.col.u16FastColdTrap = m_ProfileMetheod.GetProfileInt(sAppName, "快速冷阱", iDefault);
            m_DevParam.col.u16StartTarp_Type = m_ProfileMetheod.GetProfileInt(sAppName, "冷却方式", iDefault);
            m_DevParam.col.fColTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "设定温度", fDefault); //sAppName, "设定温度", fDefault);
            m_DevParam.col.fBehindRunTemp = m_ProfileMetheod.GetProfileFloat(sAppName, "后运行温度", fDefault);
            m_DevParam.col.fBehindRunTime = m_ProfileMetheod.GetProfileFloat(sAppName, "后运行时间", fDefault); 

            sAppName = "程升表";
            m_DevParam.col.u16ColProNum = m_ProfileMetheod.GetProfileInt(sAppName, "阶段数目", iDefault);

            return true;
        }

        public struct stRunTableVal
        {
            //public int StartTemp;
            //public int TargetTemp;
            //public int HeatSpeed;
            //public int BalanceTime;

            public float StartTemp;
            public float TargetTemp;
            public float HeatSpeed;
            public float BalanceTime;

        }

        public bool GetColTableStageVal(ref stRunTableVal stValue, ushort u16Stage) //获取柱箱的程升表的配置
        {
	        string strStage;

	        if(u16Stage >= 4)
	        {
		        strStage = u16Stage.ToString() + "th";
	        }
	        else //if (u16Stage == 0)
	        {
		        strStage = sStage[u16Stage];
	        }

            stValue.StartTemp = m_ProfileMetheod.GetProfileFloat(strStage, "StartTemp", 0);
            stValue.TargetTemp = m_ProfileMetheod.GetProfileFloat(strStage, "TargetTemp", 0);
            stValue.HeatSpeed = m_ProfileMetheod.GetProfileFloat(strStage, "HeatSpeed", 0);
            stValue.BalanceTime = m_ProfileMetheod.GetProfileFloat(strStage, "BalanceTime", 0);

            //stValue.StartTemp = m_ProfileMetheod.GetProfileInt(strStage, "StartTemp", 0);
            //stValue.TargetTemp = m_ProfileMetheod.GetProfileInt(strStage, "TargetTemp", 0);
            //stValue.HeatSpeed = m_ProfileMetheod.GetProfileInt(strStage, "HeatSpeed", 0);
            //stValue.BalanceTime = m_ProfileMetheod.GetProfileInt(strStage, "BalanceTime", 0);

            return true;
        }

        public bool EraseColTable(int Stagenum)
        {
            int i;
            string tmpname;
            for (i = 0; i < Stagenum;i++ )
            {
                if (i >= 4)
                {
                    tmpname = i.ToString() + "th";
                }
                else
                {
                    tmpname = sStage[i];
                }
                m_ProfileMetheod.EraseSection(tmpname);
            }              
            return true;
        }

        public bool SetColTableStageVal(stRunTableVal stValue, ushort u16Stage) //获取柱箱的程升表的配置
        {
            string strStage;

            if (u16Stage >= 4)
            {
                strStage = u16Stage.ToString() + "th";
            }
            else 
            {
                strStage = sStage[u16Stage];
            }

            m_ProfileMetheod.EraseSection(strStage);
            //m_ProfileMetheod.WriteProfileInt(strStage, "TargetTemp", stValue.TargetTemp);
            //m_ProfileMetheod.WriteProfileInt(strStage, "HeatSpeed", stValue.HeatSpeed);
            //m_ProfileMetheod.WriteProfileInt(strStage, "BalanceTime", stValue.BalanceTime);

            m_ProfileMetheod.WriteProfileFloat(strStage, "TargetTemp", stValue.TargetTemp);
            m_ProfileMetheod.WriteProfileFloat(strStage, "HeatSpeed", stValue.HeatSpeed);
            m_ProfileMetheod.WriteProfileFloat(strStage, "BalanceTime", stValue.BalanceTime);

            return true;
        }


        public bool SetTcdAllPara()  //TCD
        {
            string sAppName = "TCD检测器";
            const int cFront = 0;
            const int cInter = 1;
            const int cBehind = 2;
            const int TCD = 0;
            //const int FID = 1;

            if ((m_DevParam.syspara.u16DetFront == 1) && (m_DevParam.syspara.u16DetFrontType == TCD))
            {
                sAppName = "前检测器";
                m_ProfileMetheod.WriteProfileString(sAppName, "TCD", m_DevParam.tcd[cFront].sTcdLoc);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "信号值", m_DevParam.tcd[cFront].fSigValve);
                m_ProfileMetheod.WriteProfileInt(sAppName, "桥电路", m_DevParam.tcd[cFront].u16Electric);
                m_ProfileMetheod.WriteProfileInt(sAppName, "极性", m_DevParam.tcd[cFront].u16Polarity);
                m_ProfileMetheod.WriteProfileInt(sAppName, "自动调零", m_DevParam.tcd[cFront].u16AutoZeroSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "加热器设定温度", m_DevParam.tcd[cFront].fHeaterTempSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "尾气设定值", m_DevParam.tcd[cFront].fTaiGasSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "信号补偿", m_DevParam.tcd[cFront].u16SigDeduct);
                m_ProfileMetheod.WriteProfileInt(sAppName, "加热器开关", m_DevParam.tcd[cFront].u16HeaterSel);
                m_ProfileMetheod.WriteProfileInt(sAppName, "尾吹气", m_DevParam.tcd[cFront].u16TaiGasSel);
            }
            if ((m_DevParam.syspara.u16DetInter == 1) && (m_DevParam.syspara.u16DetInterType == TCD))
            {
                sAppName = "中检测器";
                m_ProfileMetheod.WriteProfileString(sAppName, "TCD", m_DevParam.tcd[cInter].sTcdLoc);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "信号值", m_DevParam.tcd[cInter].fSigValve);
                m_ProfileMetheod.WriteProfileInt(sAppName, "桥电路", m_DevParam.tcd[cInter].u16Electric);
                m_ProfileMetheod.WriteProfileInt(sAppName, "极性", m_DevParam.tcd[cInter].u16Polarity);
                m_ProfileMetheod.WriteProfileInt(sAppName, "自动调零", m_DevParam.tcd[cInter].u16AutoZeroSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "加热器设定温度", m_DevParam.tcd[cInter].fHeaterTempSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "尾气设定值", m_DevParam.tcd[cInter].fTaiGasSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "信号补偿", m_DevParam.tcd[cInter].u16SigDeduct);
                m_ProfileMetheod.WriteProfileInt(sAppName, "加热器开关", m_DevParam.tcd[cInter].u16HeaterSel);
                m_ProfileMetheod.WriteProfileInt(sAppName, "尾吹气", m_DevParam.tcd[cInter].u16TaiGasSel);
            }

            if ((m_DevParam.syspara.u16DetBehind == 1) && (m_DevParam.syspara.u16DetBehindType == TCD))
            {
                sAppName = "后检测器";
                m_ProfileMetheod.WriteProfileString(sAppName, "TCD", m_DevParam.tcd[cBehind].sTcdLoc);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "信号值", m_DevParam.tcd[cBehind].fSigValve);
                m_ProfileMetheod.WriteProfileInt(sAppName, "桥电路", m_DevParam.tcd[cBehind].u16Electric);
                m_ProfileMetheod.WriteProfileInt(sAppName, "极性", m_DevParam.tcd[cBehind].u16Polarity);
                m_ProfileMetheod.WriteProfileInt(sAppName, "自动调零", m_DevParam.tcd[cBehind].u16AutoZeroSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "加热器设定温度", m_DevParam.tcd[cBehind].fHeaterTempSet);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "尾气设定值", m_DevParam.tcd[cBehind].fTaiGasSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "信号补偿", m_DevParam.tcd[cBehind].u16SigDeduct);
                m_ProfileMetheod.WriteProfileInt(sAppName, "加热器开关", m_DevParam.tcd[cBehind].u16HeaterSel);
                m_ProfileMetheod.WriteProfileInt(sAppName, "尾吹气", m_DevParam.tcd[cBehind].u16TaiGasSel);
            }

            return true;
        }

        public bool GetTcdAllPara() //TCD
        {
	        const int iDefault = 0;
	        const float fDefault = 0.0f;
	        string sAppName = "TCD检测器";
            const int cFront = 0;
            const int cInter = 1;
            const int cBehind = 2;
            const int TCD = 0;
           // const int FID = 1;

            if ((m_DevParam.syspara.u16DetFront == 1) && (m_DevParam.syspara.u16DetFrontType == TCD))
            {
                sAppName = "前检测器";
                m_DevParam.tcd[cFront].sTcdLoc = m_ProfileMetheod.GetProfileString(sAppName, "TCD");
                m_DevParam.tcd[cFront].fSigValve = m_ProfileMetheod.GetProfileFloat(sAppName, "信号值", fDefault);
                m_DevParam.tcd[cFront].u16Electric = m_ProfileMetheod.GetProfileInt(sAppName, "桥电路", iDefault);
                m_DevParam.tcd[cFront].u16Polarity = m_ProfileMetheod.GetProfileInt(sAppName, "极性", iDefault);
                m_DevParam.tcd[cFront].u16AutoZeroSet = m_ProfileMetheod.GetProfileInt(sAppName, "自动调零", iDefault);
                m_DevParam.tcd[cFront].fHeaterTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "加热器设定温度", fDefault);
                m_DevParam.tcd[cFront].fTaiGasSet = m_ProfileMetheod.GetProfileFloat(sAppName, "尾气设定值", fDefault);
                m_DevParam.tcd[cFront].u16SigDeduct = m_ProfileMetheod.GetProfileInt(sAppName, "信号补偿", iDefault);
                m_DevParam.tcd[cFront].u16HeaterSel = m_ProfileMetheod.GetProfileInt(sAppName, "加热器开关", iDefault);
                m_DevParam.tcd[cFront].u16TaiGasSel = m_ProfileMetheod.GetProfileInt(sAppName, "尾吹气", iDefault);
            }

            if ((m_DevParam.syspara.u16DetInter == 1) && (m_DevParam.syspara.u16DetInterType == TCD))
            {
                sAppName = "中检测器";
                m_DevParam.tcd[cInter].sTcdLoc = m_ProfileMetheod.GetProfileString(sAppName, "TCD");
                m_DevParam.tcd[cInter].fSigValve = m_ProfileMetheod.GetProfileFloat(sAppName, "信号值", fDefault);
                m_DevParam.tcd[cInter].u16Electric = m_ProfileMetheod.GetProfileInt(sAppName, "桥电路", iDefault);
                m_DevParam.tcd[cInter].u16Polarity = m_ProfileMetheod.GetProfileInt(sAppName, "极性", iDefault);
                m_DevParam.tcd[cInter].u16AutoZeroSet = m_ProfileMetheod.GetProfileInt(sAppName, "自动调零", iDefault);
                m_DevParam.tcd[cInter].fHeaterTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "加热器设定温度", fDefault);
                m_DevParam.tcd[cInter].fTaiGasSet = m_ProfileMetheod.GetProfileFloat(sAppName, "尾气设定值", fDefault);
                m_DevParam.tcd[cInter].u16SigDeduct = m_ProfileMetheod.GetProfileInt(sAppName, "信号补偿", iDefault);
                m_DevParam.tcd[cInter].u16HeaterSel = m_ProfileMetheod.GetProfileInt(sAppName, "加热器开关", iDefault);
                m_DevParam.tcd[cInter].u16TaiGasSel = m_ProfileMetheod.GetProfileInt(sAppName, "尾吹气", iDefault);
            }

            if ((m_DevParam.syspara.u16DetBehind == 1) && (m_DevParam.syspara.u16DetBehindType == TCD))
            {
                sAppName = "后检测器";
                m_DevParam.tcd[cBehind].sTcdLoc = m_ProfileMetheod.GetProfileString(sAppName, "TCD");
                m_DevParam.tcd[cBehind].fSigValve = m_ProfileMetheod.GetProfileFloat(sAppName, "信号值", fDefault);
                m_DevParam.tcd[cBehind].u16Electric = m_ProfileMetheod.GetProfileInt(sAppName, "桥电路", iDefault);
                m_DevParam.tcd[cBehind].u16Polarity = m_ProfileMetheod.GetProfileInt(sAppName, "极性", iDefault);
                m_DevParam.tcd[cBehind].u16AutoZeroSet = m_ProfileMetheod.GetProfileInt(sAppName, "自动调零", iDefault);
                m_DevParam.tcd[cBehind].fHeaterTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "加热器设定温度", fDefault);
                m_DevParam.tcd[cBehind].fTaiGasSet = m_ProfileMetheod.GetProfileFloat(sAppName, "尾气设定值", fDefault);
                m_DevParam.tcd[cBehind].u16SigDeduct = m_ProfileMetheod.GetProfileInt(sAppName, "信号补偿", iDefault);
                m_DevParam.tcd[cBehind].u16HeaterSel = m_ProfileMetheod.GetProfileInt(sAppName, "加热器开关", iDefault);
                m_DevParam.tcd[cBehind].u16TaiGasSel = m_ProfileMetheod.GetProfileInt(sAppName, "尾吹气", iDefault);
            }

            return true;
        }

        public bool SetFidAllPara()  //FID
        {
	        string sAppName = "FID检测器";
            const int cFront = 0;
            const int cInter = 1;
            const int cBehind = 2;
            //const int TCD = 0;
            const int FID = 1;

            if ((m_DevParam.syspara.u16DetFront == 1) && (m_DevParam.syspara.u16DetFrontType == FID))
            {
                sAppName = "前检测器";
                m_ProfileMetheod.WriteProfileString(sAppName, "检测器位置", m_DevParam.fid[cFront].sFid);
                m_ProfileMetheod.WriteProfileInt(sAppName, "自动点火", m_DevParam.fid[cFront].u16KeyFire);
                m_ProfileMetheod.WriteProfileInt(sAppName, "归零", m_DevParam.fid[cFront].u16Zero);
                m_ProfileMetheod.WriteProfileInt(sAppName, "极性", m_DevParam.fid[cFront].u16Polarity);
                m_ProfileMetheod.WriteProfileInt(sAppName, "灵敏度", m_DevParam.fid[cFront].u16Sensitive);
                m_ProfileMetheod.WriteProfileInt(sAppName, "加热器开关", m_DevParam.fid[cFront].u16KeyHeater);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "加热器设定温度", m_DevParam.fid[cFront].fHeaterTempSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "氢气燃气流量开关", m_DevParam.fid[cFront].u16KeyH2Flow);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "氢气燃气流量设定值", m_DevParam.fid[cFront].fSetH2Flow);
                m_ProfileMetheod.WriteProfileInt(sAppName, "空气流量开关", m_DevParam.fid[cFront].u16KeyAirFlow);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "空气流量设定值", m_DevParam.fid[cFront].fAirFlowSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "尾吹气流量开关", m_DevParam.fid[cFront].u16KeyTailGas);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "尾吹气流量设定值", m_DevParam.fid[cFront].fSetTailGas);
                m_ProfileMetheod.WriteProfileInt(sAppName, "补偿", m_DevParam.fid[cFront].u16SigDeduct);
            }

            if ((m_DevParam.syspara.u16DetInter == 1) && (m_DevParam.syspara.u16DetInterType == FID))
            {
                sAppName = "中检测器";
                m_ProfileMetheod.WriteProfileString(sAppName, "检测器位置", m_DevParam.fid[cInter].sFid);
                m_ProfileMetheod.WriteProfileInt(sAppName, "自动点火", m_DevParam.fid[cInter].u16KeyFire);
                m_ProfileMetheod.WriteProfileInt(sAppName, "归零", m_DevParam.fid[cInter].u16Zero);
                m_ProfileMetheod.WriteProfileInt(sAppName, "极性", m_DevParam.fid[cInter].u16Polarity);
                m_ProfileMetheod.WriteProfileInt(sAppName, "灵敏度", m_DevParam.fid[cInter].u16Sensitive);
                m_ProfileMetheod.WriteProfileInt(sAppName, "加热器开关", m_DevParam.fid[cInter].u16KeyHeater);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "加热器设定温度", m_DevParam.fid[cInter].fHeaterTempSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "氢气燃气流量开关", m_DevParam.fid[cInter].u16KeyH2Flow);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "氢气燃气流量设定值", m_DevParam.fid[cInter].fSetH2Flow);
                m_ProfileMetheod.WriteProfileInt(sAppName, "空气流量开关", m_DevParam.fid[cInter].u16KeyAirFlow);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "空气流量设定值", m_DevParam.fid[cInter].fAirFlowSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "尾吹气流量开关", m_DevParam.fid[cInter].u16KeyTailGas);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "尾吹气流量设定值", m_DevParam.fid[cInter].fSetTailGas);
                m_ProfileMetheod.WriteProfileInt(sAppName, "补偿", m_DevParam.fid[cInter].u16SigDeduct);
            }

            if ((m_DevParam.syspara.u16DetBehind == 1) && (m_DevParam.syspara.u16DetBehindType == FID))
            {
                sAppName = "后检测器";
                m_ProfileMetheod.WriteProfileString(sAppName, "检测器位置", m_DevParam.fid[cBehind].sFid);
                m_ProfileMetheod.WriteProfileInt(sAppName, "自动点火", m_DevParam.fid[cBehind].u16KeyFire);
                m_ProfileMetheod.WriteProfileInt(sAppName, "归零", m_DevParam.fid[cBehind].u16Zero);
                m_ProfileMetheod.WriteProfileInt(sAppName, "极性", m_DevParam.fid[cBehind].u16Polarity);
                m_ProfileMetheod.WriteProfileInt(sAppName, "灵敏度", m_DevParam.fid[cBehind].u16Sensitive);
                m_ProfileMetheod.WriteProfileInt(sAppName, "加热器开关", m_DevParam.fid[cBehind].u16KeyHeater);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "加热器设定温度", m_DevParam.fid[cBehind].fHeaterTempSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "氢气燃气流量开关", m_DevParam.fid[cBehind].u16KeyH2Flow);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "氢气燃气流量设定值", m_DevParam.fid[cBehind].fSetH2Flow);
                m_ProfileMetheod.WriteProfileInt(sAppName, "空气流量开关", m_DevParam.fid[cBehind].u16KeyAirFlow);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "空气流量设定值", m_DevParam.fid[cBehind].fAirFlowSet);
                m_ProfileMetheod.WriteProfileInt(sAppName, "尾吹气流量开关", m_DevParam.fid[cBehind].u16KeyTailGas);
                m_ProfileMetheod.WriteProfileFloat(sAppName, "尾吹气流量设定值", m_DevParam.fid[cBehind].fSetTailGas);
                m_ProfileMetheod.WriteProfileInt(sAppName, "补偿", m_DevParam.fid[cBehind].u16SigDeduct);
            }

            return true;
        }

        public bool GetFidAllPara()  //FID
        {
	        const int iDefault = 0;
	        const float fDefault = 0.0f;
	        //string sErr = "Err";
            string sAppName = "FID检测器";
            const int cFront = 0;
            const int cInter = 1;
            const int cBehind = 2;
          //  const int TCD = 0;
            const int FID = 1;

            if ((m_DevParam.syspara.u16DetFront == 1) && (m_DevParam.syspara.u16DetFrontType == FID))
            {
                sAppName = "前检测器";
                m_DevParam.fid[cFront].sFid = m_ProfileMetheod.GetProfileString(sAppName, "检测器位置");
                m_DevParam.fid[cFront].u16KeyFire = m_ProfileMetheod.GetProfileInt(sAppName, "自动点火", iDefault);
                m_DevParam.fid[cFront].u16Zero = m_ProfileMetheod.GetProfileInt(sAppName, "归零", iDefault);
                m_DevParam.fid[cFront].u16Polarity = m_ProfileMetheod.GetProfileInt(sAppName, "极性", iDefault);
                m_DevParam.fid[cFront].u16Sensitive = m_ProfileMetheod.GetProfileInt(sAppName, "灵敏度", iDefault);
                m_DevParam.fid[cFront].u16KeyHeater = m_ProfileMetheod.GetProfileInt(sAppName, "加热器开关", iDefault);
                m_DevParam.fid[cFront].fHeaterTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "加热器设定温度", fDefault);
                m_DevParam.fid[cFront].u16KeyH2Flow = m_ProfileMetheod.GetProfileInt(sAppName, "氢气燃气流量开关", iDefault);
                m_DevParam.fid[cFront].fSetH2Flow = m_ProfileMetheod.GetProfileFloat(sAppName, "氢气燃气流量设定值", fDefault);
                m_DevParam.fid[cFront].u16KeyAirFlow = m_ProfileMetheod.GetProfileInt(sAppName, "空气流量开关", iDefault);
                m_DevParam.fid[cFront].fAirFlowSet = m_ProfileMetheod.GetProfileFloat(sAppName, "空气流量设定值", fDefault);
                m_DevParam.fid[cFront].u16KeyTailGas = m_ProfileMetheod.GetProfileInt(sAppName, "尾吹气流量开关", iDefault);
                m_DevParam.fid[cFront].fSetTailGas = m_ProfileMetheod.GetProfileFloat(sAppName, "尾吹气流量设定值", fDefault);
                m_DevParam.fid[cFront].u16SigDeduct = m_ProfileMetheod.GetProfileInt(sAppName, "补偿", iDefault);
            }

            if ((m_DevParam.syspara.u16DetInter == 1) && (m_DevParam.syspara.u16DetInterType == FID))
            {
                sAppName = "中检测器";
                m_DevParam.fid[cInter].sFid = m_ProfileMetheod.GetProfileString(sAppName, "检测器位置");
                m_DevParam.fid[cInter].u16KeyFire = m_ProfileMetheod.GetProfileInt(sAppName, "自动点火", iDefault);
                m_DevParam.fid[cInter].u16Zero = m_ProfileMetheod.GetProfileInt(sAppName, "归零", iDefault);
                m_DevParam.fid[cInter].u16Polarity = m_ProfileMetheod.GetProfileInt(sAppName, "极性", iDefault);
                m_DevParam.fid[cInter].u16Sensitive = m_ProfileMetheod.GetProfileInt(sAppName, "灵敏度", iDefault);
                m_DevParam.fid[cInter].u16KeyHeater = m_ProfileMetheod.GetProfileInt(sAppName, "加热器开关", iDefault);
                m_DevParam.fid[cInter].fHeaterTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "加热器设定温度", fDefault);
                m_DevParam.fid[cInter].u16KeyH2Flow = m_ProfileMetheod.GetProfileInt(sAppName, "氢气燃气流量开关", iDefault);
                m_DevParam.fid[cInter].fSetH2Flow = m_ProfileMetheod.GetProfileFloat(sAppName, "氢气燃气流量设定值", fDefault);
                m_DevParam.fid[cInter].u16KeyAirFlow = m_ProfileMetheod.GetProfileInt(sAppName, "空气流量开关", iDefault);
                m_DevParam.fid[cInter].fAirFlowSet = m_ProfileMetheod.GetProfileFloat(sAppName, "空气流量设定值", fDefault);
                m_DevParam.fid[cInter].u16KeyTailGas = m_ProfileMetheod.GetProfileInt(sAppName, "尾吹气流量开关", iDefault);
                m_DevParam.fid[cInter].fSetTailGas = m_ProfileMetheod.GetProfileFloat(sAppName, "尾吹气流量设定值", fDefault);
                m_DevParam.fid[cInter].u16SigDeduct = m_ProfileMetheod.GetProfileInt(sAppName, "补偿", iDefault);
            }

            if ((m_DevParam.syspara.u16DetBehind == 1) && (m_DevParam.syspara.u16DetBehindType == FID))
            {
                sAppName = "后检测器";
                m_DevParam.fid[cBehind].sFid = m_ProfileMetheod.GetProfileString(sAppName, "检测器位置");
                m_DevParam.fid[cBehind].u16KeyFire = m_ProfileMetheod.GetProfileInt(sAppName, "自动点火", iDefault);
                m_DevParam.fid[cBehind].u16Zero = m_ProfileMetheod.GetProfileInt(sAppName, "归零", iDefault);
                m_DevParam.fid[cBehind].u16Polarity = m_ProfileMetheod.GetProfileInt(sAppName, "极性", iDefault);
                m_DevParam.fid[cBehind].u16Sensitive = m_ProfileMetheod.GetProfileInt(sAppName, "灵敏度", iDefault);
                m_DevParam.fid[cBehind].u16KeyHeater = m_ProfileMetheod.GetProfileInt(sAppName, "加热器开关", iDefault);
                m_DevParam.fid[cBehind].fHeaterTempSet = m_ProfileMetheod.GetProfileFloat(sAppName, "加热器设定温度", fDefault);
                m_DevParam.fid[cBehind].u16KeyH2Flow = m_ProfileMetheod.GetProfileInt(sAppName, "氢气燃气流量开关", iDefault);
                m_DevParam.fid[cBehind].fSetH2Flow = m_ProfileMetheod.GetProfileFloat(sAppName, "氢气燃气流量设定值", fDefault);
                m_DevParam.fid[cBehind].u16KeyAirFlow = m_ProfileMetheod.GetProfileInt(sAppName, "空气流量开关", iDefault);
                m_DevParam.fid[cBehind].fAirFlowSet = m_ProfileMetheod.GetProfileFloat(sAppName, "空气流量设定值", fDefault);
                m_DevParam.fid[cBehind].u16KeyTailGas = m_ProfileMetheod.GetProfileInt(sAppName, "尾吹气流量开关", iDefault);
                m_DevParam.fid[cBehind].fSetTailGas = m_ProfileMetheod.GetProfileFloat(sAppName, "尾吹气流量设定值", fDefault);
                m_DevParam.fid[cBehind].u16SigDeduct = m_ProfileMetheod.GetProfileInt(sAppName, "补偿", iDefault);
            }

            return true;
        }

        public bool SetDevSignalAllPara()  //信号
        {
            const int channle_num = 8;
            string sAppName = "信号";
            int i = 0;

            m_ProfileMetheod.WriteProfileInt(sAppName, "通道A", m_DevParam.signal.u16ChannelA);
            m_ProfileMetheod.WriteProfileInt(sAppName, "通道B", m_DevParam.signal.u16ChannelB);

            for (i = 0; i < channle_num; i++ )
            {
                m_ProfileMetheod.WriteProfileInt(sAppName, "通道A检测器" + (i+1).ToString(), m_DevParam.signal.uDetA[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, "通道B检测器" + (i+1).ToString(), m_DevParam.signal.uDetB[i]);
            }

            for (i = 0; i < channle_num; i++)
            {
                m_ProfileMetheod.WriteProfileInt(sAppName, "通道A检测时间" + (i + 1).ToString(), m_DevParam.signal.u16DetTimeLengthA[i]);
                m_ProfileMetheod.WriteProfileInt(sAppName, "通道B检测时间" + (i + 1).ToString(), m_DevParam.signal.u16DetTimeLengthB[i]);
            }

		    return true;
        }

        public bool GetDevSignalAllPara()  //信号
        {
            const int iDefault = 0;

            const int channle_num = 8;
            string sAppName = "信号";
            int i = 0;

            m_DevParam.signal.u16ChannelA = m_ProfileMetheod.GetProfileInt(sAppName, "通道A", iDefault);
            m_DevParam.signal.u16ChannelB = m_ProfileMetheod.GetProfileInt(sAppName, "通道B", iDefault);


            for (i = 0; i < channle_num; i++)
            {
                m_DevParam.signal.uDetA[i] = m_ProfileMetheod.GetProfileInt(sAppName, "通道A检测器" + (i + 1).ToString(),iDefault);
                m_DevParam.signal.uDetB[i] = m_ProfileMetheod.GetProfileInt(sAppName, "通道B检测器" + (i + 1).ToString(), iDefault);
            }

            for (i = 0; i < channle_num; i++)
            {
                m_DevParam.signal.u16DetTimeLengthA[i] = m_ProfileMetheod.GetProfileInt(sAppName, "通道A检测时间" + (i + 1).ToString(), iDefault);
                m_DevParam.signal.u16DetTimeLengthB[i] = m_ProfileMetheod.GetProfileInt(sAppName, "通道B检测时间" + (i + 1).ToString(), iDefault);
            }
            return true;
        }

        public bool SetAuxiliaryAllPara()  //辅助
        {
	        string sAppName = "辅助";
            m_ProfileMetheod.WriteProfileInt(sAppName, "辅助加热区1", m_DevParam.aux.u16AuxHeatArea1);
            m_ProfileMetheod.WriteProfileInt(sAppName, "加热开关", (m_DevParam.aux.fTemp_Enable1 || m_DevParam.aux.fTemp_Enable2)? 1 : 0);
            m_ProfileMetheod.WriteProfileFloat(sAppName, "辅助加热区1设定温度", m_DevParam.aux.fSetTemp_HeatArea1);
            m_ProfileMetheod.WriteProfileInt(sAppName, "加热开关", (m_DevParam.aux.fTemp_Enable1 || m_DevParam.aux.fTemp_Enable2)? 1 : 0);
            m_ProfileMetheod.WriteProfileInt(sAppName, "辅助加热区2", m_DevParam.aux.u16AuxHeatArea2);
            m_ProfileMetheod.WriteProfileFloat(sAppName, "辅助加热区2设定温度", m_DevParam.aux.fSetTemp_HeatArea2);
            return true;
        }

        public bool GetAuxiliaryAllPara()   //辅助
        {
	        const int iDefault = 0;
	        const float fDefault = 0.0f;
	 
	        string sAppName = "辅助";
            m_DevParam.aux.u16AuxHeatArea1 = m_ProfileMetheod.GetProfileInt(sAppName, "辅助加热区1", iDefault);
            m_DevParam.aux.fTemp_Enable1 = (m_ProfileMetheod.GetProfileInt(sAppName, "加热开关", iDefault) == 1) ? true: false;
            m_DevParam.aux.fSetTemp_HeatArea1 = m_ProfileMetheod.GetProfileFloat(sAppName, "辅助加热区1设定温度", fDefault);
            m_DevParam.aux.u16AuxHeatArea2 = m_ProfileMetheod.GetProfileInt(sAppName, "辅助加热区2", iDefault);
            m_DevParam.aux.fTemp_Enable2 = (m_ProfileMetheod.GetProfileInt(sAppName, "加热开关", iDefault) == 1) ? true : false;
            m_DevParam.aux.fSetTemp_HeatArea2 = m_ProfileMetheod.GetProfileFloat(sAppName, "辅助加热区2设定温度", fDefault);
		    return true;
        }

        public bool SetRunTableElseAllPara()
        {
            string sAppName = "运行表";

            m_ProfileMetheod.WriteProfileInt(sAppName, "循环次数", m_DevParam.runtable.u16CycleTimes);
            m_ProfileMetheod.WriteProfileInt(sAppName, "等待时间", m_DevParam.runtable.u16WaitTime);
            return true;
        }

        public bool GetRunTableElseAllPara()
        {
	        const int iDefault = 0;
	       // const float fDefault = 0.0f;
	       // string sErr = "Err";
            string sAppName = "运行表";
            m_DevParam.runtable.u16CycleTimes = m_ProfileMetheod.GetProfileInt(sAppName, "循环次数", iDefault);
            m_DevParam.runtable.u16WaitTime = m_ProfileMetheod.GetProfileInt(sAppName, "等待时间", iDefault);
		    return true;
        }


        public bool GetDevState()   //获取配置文件
        {
            const int iDefault = 0;
            // const string sDefault = "null";

            string sAppName = "柱箱单元柱箱";
            m_DevParam.syspara.u16Col = m_ProfileStatus.GetProfileInt(sAppName, "柱箱", iDefault);
            m_DevParam.syspara.u16ColType = m_ProfileStatus.GetProfileInt(sAppName, "柱箱类型", iDefault);
            try
            {
                m_DevParam.syspara.u16ColPTemp = m_ProfileStatus.GetProfileInt(sAppName, "柱箱保护温度", iDefault);
            }
            catch
            {
                m_DevParam.syspara.u16ColPTemp = 0;
            }


            sAppName = "仪器编号";
            m_DevParam.syspara.GCNum = m_ProfileStatus.GetProfileString(sAppName, "仪器号");
            m_DevParam.syspara.GCName = m_ProfileStatus.GetProfileString(sAppName, "仪器名称");

            sAppName = "进样单元进样口";
            m_DevParam.syspara.u16InjPortNum = m_ProfileStatus.GetProfileInt(sAppName, "进样口数量", iDefault);
            m_DevParam.syspara.u16InjPortFront = m_ProfileStatus.GetProfileInt(sAppName, "前进样口", iDefault);
            try
            {
                m_DevParam.syspara.u16InjPortFPTemp = m_ProfileStatus.GetProfileInt(sAppName, "前进样口保护温度", iDefault);
            }
            catch
            {
                m_DevParam.syspara.u16InjPortFPTemp = 0;
            }


            m_DevParam.syspara.u16InjPortBehind = m_ProfileStatus.GetProfileInt(sAppName, "后进样口", iDefault);

            m_DevParam.syspara.u16InjPortType_Front = m_ProfileStatus.GetProfileInt(sAppName, "前进样口类型", iDefault);
            m_DevParam.syspara.u16InjPortLoadGas_Front = m_ProfileStatus.GetProfileInt(sAppName, "前进样口载气", iDefault);
            m_DevParam.syspara.u16InjPortType_Behind = m_ProfileStatus.GetProfileInt(sAppName, "后进样口类型", iDefault);
            try
            {
                m_DevParam.syspara.u16InjPortBPTemp = m_ProfileStatus.GetProfileInt(sAppName, "后进样口保护温度", iDefault);
            }
            catch
            {
                m_DevParam.syspara.u16InjPortBPTemp = 0;
            }

            m_DevParam.syspara.u16InjPortLoadGas_Behind = m_ProfileStatus.GetProfileInt(sAppName, "后进样口载气", iDefault);
            sAppName = "仪器档次";
            m_DevParam.syspara.u16InjPortCtlMode_Behind = m_ProfileStatus.GetProfileInt(sAppName, "仪器档次", iDefault);
            m_DevParam.syspara.u16InjPortCtlMode_Front = m_ProfileStatus.GetProfileInt(sAppName, "仪器档次", iDefault);
            sAppName = "进样单元切换阀";
            m_DevParam.syspara.u16ValveBox = m_ProfileStatus.GetProfileInt(sAppName, "阀数量", iDefault);
            m_DevParam.syspara.u16ValveOne = m_ProfileStatus.GetProfileInt(sAppName, "阀1", iDefault);
            m_DevParam.syspara.u16ValveTwo = m_ProfileStatus.GetProfileInt(sAppName, "阀2", iDefault);
            m_DevParam.syspara.u16ValveThree = m_ProfileStatus.GetProfileInt(sAppName, "阀3", iDefault);
            m_DevParam.syspara.u16ValveFour = m_ProfileStatus.GetProfileInt(sAppName, "阀4", iDefault);
            m_DevParam.syspara.u16ValveFive = m_ProfileStatus.GetProfileInt(sAppName, "阀5", iDefault);
            m_DevParam.syspara.u16ValveSix = m_ProfileStatus.GetProfileInt(sAppName, "阀6", iDefault);

            sAppName = "检测单元";
            m_DevParam.syspara.u16DetNum = m_ProfileStatus.GetProfileInt(sAppName, "检测器数量", iDefault);
            m_DevParam.syspara.u16DetFront = m_ProfileStatus.GetProfileInt(sAppName, "前检测器", iDefault);
            m_DevParam.syspara.u16DetFrontType = m_ProfileStatus.GetProfileInt(sAppName, "前检测器类型", iDefault);
            try
            {
                m_DevParam.syspara.u16DetFrontPTemp = m_ProfileStatus.GetProfileInt(sAppName, "前检测器保护温度", iDefault);
            }
            catch
            {
                m_DevParam.syspara.u16DetFrontPTemp = 0;
            }


            m_DevParam.syspara.u16DetFrontAisle = m_ProfileStatus.GetProfileInt(sAppName, "前检测器通道", iDefault);
            m_DevParam.syspara.u16DetInter = m_ProfileStatus.GetProfileInt(sAppName, "中检测器", iDefault);
            m_DevParam.syspara.u16DetInterType = m_ProfileStatus.GetProfileInt(sAppName, "中检测器类型", iDefault);
            try
            {
                m_DevParam.syspara.u16DetInterPTemp = m_ProfileStatus.GetProfileInt(sAppName, "中检测器保护温度", iDefault);
            }
            catch
            {
                m_DevParam.syspara.u16DetInterPTemp = 0;
            }


            m_DevParam.syspara.u16DetInterAisle = m_ProfileStatus.GetProfileInt(sAppName, "中检测器通道", iDefault);
            m_DevParam.syspara.u16DetBehind = m_ProfileStatus.GetProfileInt(sAppName, "后检测器", iDefault);
            m_DevParam.syspara.u16DetBehindType = m_ProfileStatus.GetProfileInt(sAppName, "后检测器类型", iDefault);
            try
            {
                m_DevParam.syspara.u16DetBehindPTemp = m_ProfileStatus.GetProfileInt(sAppName, "后检测器保护温度", iDefault);
            }
            catch
            {
                m_DevParam.syspara.u16DetBehindPTemp = 0;
            }

            m_DevParam.syspara.u16DetBehindAisle = m_ProfileStatus.GetProfileInt(sAppName, "后检测器通道", iDefault);
            sAppName = "进样单元进样器";
            m_DevParam.syspara.u16SampleNum = m_ProfileStatus.GetProfileInt(sAppName, "进样器数量", iDefault);
            m_DevParam.syspara.u16SampleFront = m_ProfileStatus.GetProfileInt(sAppName, "前进样器", iDefault);
            m_DevParam.syspara.u16SampleBehind = m_ProfileStatus.GetProfileInt(sAppName, "后进样器", iDefault);
            sAppName = "辅助设置";
            m_DevParam.syspara.u16AuxHeater = m_ProfileStatus.GetProfileInt(sAppName, "辅助加热", iDefault);
            m_DevParam.syspara.u16AuxHeaterNum = m_ProfileStatus.GetProfileInt(sAppName, "辅助加热器数量", iDefault);
            m_DevParam.syspara.u16AuxHeater1 = m_ProfileStatus.GetProfileInt(sAppName, "辅助1", iDefault);
            m_DevParam.syspara.u16AuxHeaterName1 = m_ProfileStatus.GetProfileString(sAppName, "辅助名字1");
            m_DevParam.syspara.u16AuxHeater2 = m_ProfileStatus.GetProfileInt(sAppName, "辅助2", iDefault);
            m_DevParam.syspara.u16AuxHeaterName2 = m_ProfileStatus.GetProfileString(sAppName, "辅助名字2");

            sAppName = "柱箱单元色谱柱";
            m_DevParam.syspara.u16ChromNum = m_ProfileStatus.GetProfileInt(sAppName, "色谱柱数量", iDefault);
            m_DevParam.syspara.u16ChromFront = m_ProfileStatus.GetProfileInt(sAppName, "前色谱柱", iDefault);
            m_DevParam.syspara.u16ChromBehind = m_ProfileStatus.GetProfileInt(sAppName, "后色谱柱", iDefault);
            m_DevParam.syspara.u16ChromFrontType = m_ProfileStatus.GetProfileInt(sAppName, "前色谱柱类型", iDefault);
            m_DevParam.syspara.u16ChromBehindType = m_ProfileStatus.GetProfileInt(sAppName, "后色谱柱类型", iDefault);
            sAppName = "仪器档次";
            m_DevParam.syspara.u16StartType = m_ProfileStatus.GetProfileInt(sAppName, "仪器档次", iDefault);

            return true;
        }
    }//class
}//namespace
