Beispiel #1
0
        public Smokemeterdata readAnalysisMeterData(string filePath)
        {
            Smokemeterdata vmas_data = new Smokemeterdata();

            try
            {
                StringBuilder temp = new StringBuilder();
                temp.Length = 2048;
                if (File.Exists(filePath))
                {
                    ini.INIIO.GetPrivateProfileString("标定数据", "K标定值", "", temp, 2048, filePath);//、
                    vmas_data.Kbz = float.Parse(temp.ToString());
                    ini.INIIO.GetPrivateProfileString("标定数据", "K实测值", "", temp, 2048, filePath);
                    vmas_data.Kscz = float.Parse(temp.ToString());
                    ini.INIIO.GetPrivateProfileString("标定数据", "K绝对误差", "", temp, 2048, filePath);
                    vmas_data.Kabswc = float.Parse(temp.ToString());
                    ini.INIIO.GetPrivateProfileString("标定数据", "K相对误差", "", temp, 2048, filePath);
                    vmas_data.Krelwc = float.Parse(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);
            }
        }
Beispiel #2
0
 public bool writeanalysismeterIni(Smokemeterdata flowmeterdata)
 {
     try
     {
         ini.INIIO.WritePrivateProfileString("标定数据", "K标定值", flowmeterdata.Kbz.ToString("0.00"), "C:/jcdatatxt/Smokemeter.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "K实测值", flowmeterdata.Kscz.ToString("0.00"), "C:/jcdatatxt/Smokemeter.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "K绝对误差", flowmeterdata.Kabswc.ToString("0.00"), "C:/jcdatatxt/Smokemeter.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "K相对误差", flowmeterdata.Krelwc.ToString("0.00"), "C:/jcdatatxt/Smokemeter.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "备注说明", flowmeterdata.Bzsm, "C:/jcdatatxt/Smokemeter.ini");
         ini.INIIO.WritePrivateProfileString("标定数据", "标定结果", flowmeterdata.Bdjg, "C:/jcdatatxt/Smokemeter.ini");
         return(true);
     }
     catch
     {
         return(false);
     }
 }