/// <summary>
        /// 根据索引导出CIT文件
        /// </summary>
        /// <param name="filePath">cit文件路径</param>
        /// <param name="startMileage">开始里程(公里)</param>
        /// <param name="endMileage">结束里程(公里)</param>
        /// <returns>成功:返回导出路径,失败:空字符串</returns>
        public string ExportCITFileAndIndexData(string filePath, double startMileage, double endMileage)
        {
            string destFile = filePath + "\\" +
                              Path.GetFileNameWithoutExtension(CitFilePath) + "_" +
                              startMileage.ToString() + "-" + endMileage.ToString() + ".cit";

            if (_citFile.iKmInc == 1 && startMileage < endMileage)
            {
                double change = startMileage;
                startMileage = endMileage;
                endMileage   = change;
            }
            if (_citFile != null && MileageFix.FixData.Count > 0)
            {
                if (_citFile.iKmInc == 0)
                {
                    if (startMileage >= MileageFix.FixData[MileageFix.FixData.Count - 1].MarkedEndPoint.UserSetMileage / 1000 ||
                        endMileage <= MileageFix.FixData[0].MarkedStartPoint.UserSetMileage / 1000)
                    {
                        return("");
                    }
                    if (startMileage < (MileageFix.FixData[0].MarkedStartPoint.UserSetMileage / 1000))
                    {
                        startMileage = (MileageFix.FixData[0].MarkedStartPoint.UserSetMileage / 1000);
                    }
                    if (endMileage > MileageFix.FixData[MileageFix.FixData.Count - 1].MarkedEndPoint.UserSetMileage / 1000)
                    {
                        endMileage = MileageFix.FixData[MileageFix.FixData.Count - 1].MarkedEndPoint.UserSetMileage / 1000;
                    }
                }
                else if (_citFile.iKmInc == 1)
                {
                    if (endMileage >= MileageFix.FixData[MileageFix.FixData.Count - 1].MarkedEndPoint.UserSetMileage / 1000 ||
                        startMileage <= MileageFix.FixData[0].MarkedStartPoint.UserSetMileage / 1000)
                    {
                        return("");
                    }
                    if (startMileage > MileageFix.FixData[0].MarkedStartPoint.UserSetMileage / 1000)
                    {
                        startMileage = MileageFix.FixData[0].MarkedStartPoint.UserSetMileage / 1000;
                    }
                    if (endMileage < MileageFix.FixData[MileageFix.FixData.Count - 1].MarkedEndPoint.UserSetMileage / 1000)
                    {
                        endMileage = MileageFix.FixData[MileageFix.FixData.Count - 1].MarkedEndPoint.UserSetMileage / 1000;
                    }
                }
                Milestone startStone = new Milestone();
                Milestone endStone   = new Milestone();
                startStone = MileageFix.CalcMilestoneByFixedMilestone((float)startMileage * 1000);
                endStone   = MileageFix.CalcMilestoneByFixedMilestone((float)endMileage * 1000);
                if (startStone.mFilePosition != -1 && endStone.mFileEndPostion != -1)
                {
                    if (!Directory.Exists(filePath))
                    {
                        Directory.CreateDirectory(filePath);
                    }

                    List <double[]>          channelData           = CitFileProcess.GetAllChannelDataInRange(_citFilePath, startStone.mFilePosition, endStone.mFileEndPostion);
                    List <ChannelDefinition> channelDefinitionList = CitFileProcess.GetChannelDefinitionList(_citFilePath);
                    if (CitFileProcess.WriteCitFile(destFile, CitFile, channelDefinitionList, "", channelData))
                    {
                        CitFileProcess.SetKmFrom(destFile, (float)startStone.GetMeter() / 1000);
                        CitFileProcess.SetKmTo(destFile, (float)endStone.GetMeter() / 1000);
                        string    indexFile   = destFile.Replace(".cit", ".idf");
                        IOperator newOperator = new IndexOperator();
                        newOperator.IndexFilePath = indexFile;
                        //IndexOperator.CreateDB(indexFile);
                        long fileHead = FileDataOffset.GetSamplePointStartOffset(channelData.Count, 4);
                        AddNewIndexData(destFile, newOperator, fileHead, startStone.mFilePosition, endStone.mFileEndPostion, channelData.Count);
                        AddInvaildData(newOperator, fileHead, startStone.mFilePosition, endStone.mFileEndPostion, channelData.Count);
                        return(destFile);
                    }
                    return("");
                }
                return("");
            }
            else
            {
                return(ExportOnlyCITFile(destFile, startMileage, endMileage));
            }
        }
        /// <summary>
        /// 导出CIT文件
        /// </summary>
        /// <param name="filePath">文件路径</param>
        /// <param name="filePath">导出路径</param>
        /// <param name="startMileage">起始里程(单位:米)</param>
        /// <param name="endMileage">结束里程(单位:米)</param>
        /// <returns></returns>
        public string ExportOnlyCITFile(string filePath, double startMileage, double endMileage)
        {
            try
            {
                if (_citFile != null)
                {
                    long startPostion = -1;
                    long endPostion   = -1;

                    startPostion = CitFileProcess.GetCurrentPositionByMilestone(_citFilePath, (float)startMileage, true);
                    endPostion   = CitFileProcess.GetCurrentPositionByMilestone(_citFilePath, (float)endMileage, true);

                    if (startPostion == -1 || endPostion == -1)
                    {
                        return("");
                    }

                    if (CitFileProcess.WriteCitFile(filePath, _citFile, CitFileProcess.GetChannelDefinitionList(_citFilePath), ""))
                    {
                        if (startPostion > endPostion)
                        {
                            long temp = startPostion;
                            startPostion = endPostion;
                            endPostion   = temp;
                        }
                        long sampleCount  = CitFileProcess.GetSampleCountByRange(_citFilePath, startPostion, endPostion);
                        int  sampleNumber = 5000;

                        if (sampleCount > sampleNumber)
                        {
                            long pageCount = (sampleCount / sampleNumber);

                            long pageEndPostion = 0;
                            for (int i = 0; i < pageCount; i++)
                            {
                                List <double[]> channelData = CitFileProcess.GetAllChannelDataInRange(_citFilePath, startPostion, sampleNumber, ref pageEndPostion);
                                startPostion = pageEndPostion;
                                CitFileProcess.WriteCitChannelData(filePath, channelData);
                            }

                            if (pageEndPostion < endPostion)
                            {
                                List <double[]> channelData = CitFileProcess.GetAllChannelDataInRange(_citFilePath, startPostion, endPostion);
                                CitFileProcess.WriteCitChannelData(filePath, channelData);
                            }
                        }
                        else
                        {
                            List <double[]> channelData = CitFileProcess.GetAllChannelDataInRange(_citFilePath, startPostion, endPostion);
                            CitFileProcess.WriteCitChannelData(filePath, channelData);
                        }
                        if (CitFileProcess.SetKmFrom(filePath, (float)startMileage / 1000) &&
                            CitFileProcess.SetKmTo(filePath, (float)endMileage / 1000))
                        {
                            return(filePath);
                        }
                    }
                }
                return(string.Empty);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }