public void InitFixData(string fixedCitFile, string fixedIdfFile = null, bool diffFileName = false) { List <ChannelDefinition> channelDefinition = _citProcess.GetChannelDefinitionList(fixedCitFile); for (int i = 0; i < FixParams.Count; i++) { FixParams[i].ChannelID = channelDefinition.Where(p => p.sNameEn == FixParams[i].ChannelName).ToList()[0].sID; } FileInformation citFile = _citProcess.GetFileInformation(fixedCitFile); _fixedData.Clear(); string idfFIle = fixedCitFile.Replace(".cit", ".idf"); if (diffFileName) { idfFIle = fixedIdfFile; } IndexOperator indexOperator = new IndexOperator(); if (File.Exists(idfFIle)) { indexOperator.IndexFilePath = idfFIle; UserFixedTable fixTable = new UserFixedTable(indexOperator, citFile.iKmInc); if (fixTable.MarkedPoints.Count > 0) { foreach (var point in fixTable.MarkedPoints) { //左半边数据点个数,包括中间点 List <FixPoint> fixPoint = new List <FixPoint>(); int leftFixedCount = FixedSamplingCount + 1; long leftStartPostion = _citProcess.GetAppointFileEndPostion(fixedCitFile, point.FilePointer, -1 * leftFixedCount); long realLeftCount = _citProcess.GetSampleCountByRange(fixedCitFile, leftStartPostion, point.FilePointer); long rightEndPostion = _citProcess.GetAppointFileEndPostion(fixedCitFile, point.FilePointer, FixedSamplingCount); long realRightCount = _citProcess.GetSampleCountByRange(fixedCitFile, point.FilePointer, rightEndPostion); Milestone mile = _citProcess.GetAppointMilestone(fixedCitFile, point.FilePointer); foreach (var item in FixParams) { FixPoint fixP = new FixPoint(); fixP.FixPostion = leftFixedCount; double[] data = _citProcess.GetOneChannelDataInRange(fixedCitFile, item.ChannelID, leftStartPostion, ((int)(realLeftCount + realRightCount))); fixP.Points = data; fixP.ChannelID = item.ChannelID; fixP.OriginalMileage = mile.GetMeter(); fixPoint.Add(fixP); } _fixedData.Add(point, fixPoint); } } } }