Example #1
0
 public bool writeParasiticIni(parasitic parasiticdata)
 {
     try
     {
         if (File.Exists("C:/jcdatatxt/Parasitic.ini"))
         {
             File.Delete("C:/jcdatatxt/Parasitic.ini");
         }
         ini.INIIO.WritePrivateProfileString("标定数据", "速度区间", parasiticdata.Sdqj, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "名义速度", parasiticdata.Mysd, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "滑行时间", parasiticdata.Hxsj, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "寄生功率", parasiticdata.Jsgl, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "累计滑行时间", parasiticdata.Ljhxsj, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "备注说明", parasiticdata.Bz, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "标定结果", parasiticdata.Bdjg, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "Starttime", parasiticdata.Starttime, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "Acdt40", parasiticdata.Acdt40, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "Acdt24", parasiticdata.Acdt24, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "Plhp40", parasiticdata.Plhp40, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "Plhp24", parasiticdata.Plhp24, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "Diw", parasiticdata.Diw, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "kssj", parasiticdata.kssj, "C:/jcdatatxt/Parasitic.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "jssj", parasiticdata.jssj, "C:/jcdatatxt/Parasitic.ini");
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #2
0
        public parasitic readParasiticData(string filePath)
        {
            parasitic vmas_data = new parasitic();

            try
            {
                StringBuilder temp = new StringBuilder();
                temp.Length = 2048;
                if (File.Exists(filePath))
                {
                    ini.INIIO.GetPrivateProfileString("标定数据", "速度区间", "", temp, 2048, filePath);//、
                    vmas_data.Sdqj = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "名义速度", "", temp, 2048, filePath);
                    vmas_data.Mysd = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "滑行时间", "", temp, 2048, filePath);
                    vmas_data.Hxsj = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "寄生功率", "", temp, 2048, filePath);
                    vmas_data.Jsgl = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "累计滑行时间", "", temp, 2048, filePath);
                    vmas_data.Ljhxsj = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "备注说明", "", temp, 2048, filePath);
                    vmas_data.Bz = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "标定结果", "", temp, 2048, filePath);
                    vmas_data.Bdjg = temp.ToString();

                    ini.INIIO.GetPrivateProfileString("标定数据", "Starttime", "", temp, 2048, filePath);
                    vmas_data.Starttime = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "Acdt40", "", temp, 2048, filePath);
                    vmas_data.Acdt40 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "Acdt24", "", temp, 2048, filePath);
                    vmas_data.Acdt24 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "Plhp40", "", temp, 2048, filePath);
                    vmas_data.Plhp40 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "Plhp24", "", temp, 2048, filePath);
                    vmas_data.Plhp24 = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "Diw", "", temp, 2048, filePath);
                    vmas_data.Diw = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "kssj", "", temp, 2048, filePath);
                    vmas_data.kssj = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "jssj", "", temp, 2048, filePath);
                    vmas_data.jssj = temp.ToString();
                }
                else
                {
                    vmas_data.Bdjg = "-1";
                }
                return(vmas_data);
            }
            catch
            {
                vmas_data.Bdjg = "-1";
                return(vmas_data);
            }
        }
Example #3
0
        public bool writeParasiticIni(parasitic parasiticdata)
        {
            try
            {
                if (File.Exists("C:/jcdatatxt/Parasitic.ini"))
                {
                    File.Delete("C:/jcdatatxt/Parasitic.ini");
                }
                ini.INIIO.WritePrivateProfileString("标定数据", "速度区间", parasiticdata.Sdqj, "C:/jcdatatxt/Parasitic.ini");
                ini.INIIO.WritePrivateProfileString("标定数据", "名义速度", parasiticdata.Mysd, "C:/jcdatatxt/Parasitic.ini");
                ini.INIIO.WritePrivateProfileString("标定数据", "滑行时间", parasiticdata.Hxsj, "C:/jcdatatxt/Parasitic.ini");
                ini.INIIO.WritePrivateProfileString("标定数据", "寄生功率", parasiticdata.Jsgl, "C:/jcdatatxt/Parasitic.ini");
                ini.INIIO.WritePrivateProfileString("标定数据", "累计滑行时间", parasiticdata.Ljhxsj, "C:/jcdatatxt/Parasitic.ini");
                ini.INIIO.WritePrivateProfileString("标定数据", "备注说明", parasiticdata.Bz, "C:/jcdatatxt/Parasitic.ini");
                ini.INIIO.WritePrivateProfileString("标定数据", "标定结果", parasiticdata.Bdjg, "C:/jcdatatxt/Parasitic.ini");

                return(true);
            }
            catch
            {
                return(false);
            }
        }