Example #1
0
        public xysjData readAnalysisMeterData(string filePath)
        {
            xysjData vmas_data = new xysjData();

            try
            {
                StringBuilder temp = new StringBuilder();
                temp.Length = 2048;
                if (File.Exists(filePath))
                {
                    ini.INIIO.GetPrivateProfileString("标定数据", "速度", "", temp, 2048, filePath);//、
                    vmas_data.Sd = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "初载荷", "", temp, 2048, filePath);
                    vmas_data.StartPower = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "初制动力", "", temp, 2048, filePath);
                    vmas_data.StartForce = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "末载荷", "", temp, 2048, filePath);
                    vmas_data.EndPower = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "末制动力", "", temp, 2048, filePath);//、
                    vmas_data.EndForce = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "响应时间", "", temp, 2048, filePath);
                    vmas_data.XyTime = temp.ToString();
                    ini.INIIO.GetPrivateProfileString("标定数据", "稳定时间", "", temp, 2048, filePath);
                    vmas_data.WdTime = 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);
            }
        }
Example #2
0
 public bool writeBzGlideIni(xysjData glidedata)
 {
     try
     {
         if (File.Exists("C:/jcdatatxt/xysjData.ini"))
         {
             File.Delete("C:/jcdatatxt/xysjData.ini");
         }
         //configInfdata preConfigData = getConfigIni();
         ini.INIIO.WritePrivateProfileString("标定数据", "速度", glidedata.Sd, "C:/jcdatatxt/xysjData.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "初载荷", glidedata.StartPower, "C:/jcdatatxt/xysjData.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "初制动力", glidedata.StartForce, "C:/jcdatatxt/xysjData.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "末载荷", glidedata.EndPower, "C:/jcdatatxt/xysjData.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "末制动力", glidedata.EndForce, "C:/jcdatatxt/xysjData.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "响应时间", glidedata.XyTime, "C:/jcdatatxt/xysjData.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "稳定时间", glidedata.WdTime, "C:/jcdatatxt/xysjData.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "标定结果", glidedata.Bdjg, "C:/jcdatatxt/xysjData.ini");
         return(true);
     }
     catch
     {
         return(false);
     }
 }