Пример #1
0
 public bool writeGlideIni(glide glidedata)
 {
     try
     {
         if (File.Exists("C:/jcdatatxt/Glide.ini"))
         {
             File.Delete("C:/jcdatatxt/Glide.ini");
         }
         //configInfdata preConfigData = getConfigIni();
         ini.INIIO.WritePrivateProfileString("标定数据", "滑行区间", glidedata.Hxqj, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "区间名义速度", glidedata.Qjmysd, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "PLHP", glidedata.Plhp, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "CCDT", glidedata.Ccdt, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "ACDT", glidedata.Acdt, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "误差", glidedata.Wc, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "加载设定功率", glidedata.Jzsdgl, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "备注说明", glidedata.Bzsm, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "标定结果", glidedata.Bdjg, "C:/jcdatatxt/Glide.ini");
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #2
0
        public glide readGlideData(string filePath)
        {
            glide vmas_data = new glide();

            try
            {
                StringBuilder temp = new StringBuilder();
                temp.Length = 2048;
                if (File.Exists(filePath))
                {
                    ini.INIIO.GetPrivateProfileString("标定数据", "滑行区间", "", temp, 2048, filePath);//、
                    vmas_data.Hxqj = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "区间名义速度", "", temp, 2048, filePath);
                    vmas_data.Qjmysd = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "PLHP", "", temp, 2048, filePath);
                    vmas_data.Plhp = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "CCDT", "", temp, 2048, filePath);
                    vmas_data.Ccdt = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "ACDT", "", temp, 2048, filePath);
                    vmas_data.Acdt = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "误差", "", temp, 2048, filePath);
                    vmas_data.Wc = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "加载设定功率", "", temp, 2048, filePath);
                    vmas_data.Jzsdgl = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "备注说明", "", temp, 2048, filePath);
                    vmas_data.Bzsm = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "标定结果", "", temp, 2048, filePath);
                    vmas_data.Bdjg = temp.ToString();
                }
                else
                {
                    vmas_data.Bdjg = "-1";
                }
                return(vmas_data);
            }
            catch
            {
                vmas_data.Bdjg = "-1";
                return(vmas_data);
            }
        }
Пример #3
0
 public bool writeGlideIni(glide glidedata)
 {
     try
     {
         if (File.Exists("C:/jcdatatxt/Glide.ini"))
         {
             File.Delete("C:/jcdatatxt/Glide.ini");
         }
         //configInfdata preConfigData = getConfigIni();
         ini.INIIO.WritePrivateProfileString("标定数据", "滑行区间", glidedata.Hxqj, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "区间名义速度", glidedata.Qjmysd, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "PLHP", glidedata.Plhp, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "CCDT", glidedata.Ccdt, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "ACDT", glidedata.Acdt, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "GXDL", glidedata.Gxdl, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "误差", glidedata.Wc, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "加载设定功率", glidedata.Jzsdgl, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "备注说明", glidedata.Bzsm, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "标定结果", glidedata.Bdjg, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "ACDT40", glidedata.Acdt40, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "ACDT24", glidedata.Acdt24, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "CCDT40", glidedata.Ccdt40, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "CCDT24", glidedata.Ccdt24, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "PLHP40", glidedata.Plhp40, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "PLHP24", glidedata.Plhp24, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "IHP40", glidedata.Ihp40, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "IHP24", glidedata.Ihp24, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "RESULT40", glidedata.Result40, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "RESULT24", glidedata.Result24, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "STARTTIME", glidedata.Starttime, "C:/jcdatatxt/Glide.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "NeuFinished", glidedata.NeuFinished, "C:/jcdatatxt/Glide.ini");
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #4
0
        public glide readGlideData(string filePath)
        {
            glide vmas_data = new glide();

            try
            {
                StringBuilder temp = new StringBuilder();
                temp.Length = 2048;
                if (File.Exists(filePath))
                {
                    ini.INIIO.GetPrivateProfileString("标定数据", "滑行区间", "", temp, 2048, filePath);//、
                    vmas_data.Hxqj = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "区间名义速度", "", temp, 2048, filePath);
                    vmas_data.Qjmysd = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "PLHP", "", temp, 2048, filePath);
                    vmas_data.Plhp = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "CCDT", "", temp, 2048, filePath);
                    vmas_data.Ccdt = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "ACDT", "", temp, 2048, filePath);
                    vmas_data.Acdt = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "GXDL", "", temp, 2048, filePath);
                    vmas_data.Gxdl = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "误差", "", temp, 2048, filePath);
                    vmas_data.Wc = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "加载设定功率", "", temp, 2048, filePath);
                    vmas_data.Jzsdgl = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "备注说明", "", temp, 2048, filePath);
                    vmas_data.Bzsm = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "标定结果", "", temp, 2048, filePath);
                    vmas_data.Bdjg = temp.ToString();

                    ini.INIIO.GetPrivateProfileString("标定数据", "IHP40", "", temp, 2048, filePath);
                    vmas_data.Ihp40 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "PLHP40", "", temp, 2048, filePath);
                    vmas_data.Plhp40 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "CCDT40", "", temp, 2048, filePath);
                    vmas_data.Ccdt40 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "ACDT40", "", temp, 2048, filePath);
                    vmas_data.Acdt40 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "RESULT40", "", temp, 2048, filePath);
                    vmas_data.Result40 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "IHP24", "", temp, 2048, filePath);
                    vmas_data.Ihp24 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "PLHP24", "", temp, 2048, filePath);
                    vmas_data.Plhp24 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "CCDT24", "", temp, 2048, filePath);
                    vmas_data.Ccdt24 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "ACDT24", "", temp, 2048, filePath);
                    vmas_data.Acdt24 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "RESULT24", "", temp, 2048, filePath);
                    vmas_data.Result24 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "STARTTIME", "", temp, 2048, filePath);
                    vmas_data.Starttime = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "NeuFinished", "", temp, 2048, filePath);
                    vmas_data.NeuFinished = temp.ToString();
                }
                else
                {
                    vmas_data.Bdjg = "-1";
                }
                return(vmas_data);
            }
            catch
            {
                vmas_data.Bdjg = "-1";
                return(vmas_data);
            }
        }