/// <summary>
        /// 计算峰峰值指标,并根据其判断轨道几何不良区段
        /// </summary>
        /// <param name="channelName">通道名中文名</param>
        /// <param name="tt">里程信息</param>
        /// <param name="wx">轨道几何不平顺,高低或是轨向</param>
        /// <param name="wvelo">速度</param>
        /// <param name="wx_gauge">轨距</param>
        /// <param name="thresh_gauge">峰峰值的阈值,取8.0</param>
        /// <returns></returns>
        public List <String> WideGaugePreProcess(String channelName, double[] tt, double[] wx, double[] wvelo, double[] wx_gauge, double thresh_gauge)
        {
            List <String> dataStrList = new List <String>();
            String        dataStr     = null;

            try
            {
                int oneTimeLength = 1000000; //一次处理的点数

                for (int i = 0; i < tt.Length; i += oneTimeLength)
                {
                    int remain = 0;
                    int index  = (i / oneTimeLength) * oneTimeLength;
                    remain = tt.Length - oneTimeLength * (i / oneTimeLength + 1);
                    int      ThisTimeLength = remain > 0 ? oneTimeLength : (remain += oneTimeLength);
                    double[] tmp_tt         = new double[ThisTimeLength];
                    double[] tmp_wx         = new double[ThisTimeLength];
                    double[] tmp_wvelo      = new double[ThisTimeLength];
                    double[] tmp_wx_gauge   = new double[ThisTimeLength];

                    for (int j = 0; j < ThisTimeLength; j++)
                    {
                        tmp_tt[j]       = tt[index + j];
                        tmp_wx[j]       = wx[index + j];
                        tmp_wvelo[j]    = wvelo[index + j];
                        tmp_wx_gauge[j] = wx_gauge[index + j];
                    }

                    MWNumericArray d_tt           = new MWNumericArray(tmp_tt);
                    MWNumericArray d_wx           = new MWNumericArray(tmp_wx);
                    MWNumericArray d_wvelo        = new MWNumericArray(tmp_wvelo);
                    MWNumericArray d_wx_gauge     = new MWNumericArray(tmp_wx_gauge);
                    MWNumericArray d_thresh_gauge = new MWNumericArray(thresh_gauge);


                    //调用算法
                    MWNumericArray resultArrayAB = (MWNumericArray)ppmc.sub_preprocessing_deviation_by_p2p(d_tt, d_wx, d_wvelo, d_wx_gauge, d_thresh_gauge);
                    double[,] tmpArray = (double[, ])resultArrayAB.ToArray();

                    for (int j = 0; j < tmpArray.GetLength(0); j++)
                    {
                        tmpArray[j, 0] = tmp_tt[(long)(tmpArray[j, 0])];
                        tmpArray[j, 1] = tmp_tt[(long)(tmpArray[j, 1])];
                        dataStr        = String.Format("{0},{1},{2},{3}", channelName, tmpArray[j, 0], tmpArray[j, 1], tmpArray[j, 2]);
                        dataStrList.Add(dataStr);
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Source);
                MessageBox.Show(ex.Message);
            }

            return(dataStrList);
        }
        /// <summary>
        /// 峰峰值偏差
        /// </summary>
        /// <param name="channelName">通道名称</param>
        /// <param name="milesData">里程</param>
        /// <param name="channelData">具体通道的数据</param>
        /// <param name="speedData">速度</param>
        /// <param name="gaugeData">轨距</param>
        /// <param name="thresh_gauge">峰峰值的阈值,取8.0</param>
        public List <Result> WaveformPeakDeviation(string channelName, double[] milesData, double[] channelData, double[] speedData, double[] gaugeData, double thresh_gauge = 8.0)
        {
            List <Result> dataList = new List <Result>();

            try
            {
                int oneTimeLength = 1000000; //一次处理的点数

                for (int i = 0; i < milesData.Length; i += oneTimeLength)
                {
                    int remain = 0;
                    int index  = (i / oneTimeLength) * oneTimeLength;
                    remain = milesData.Length - oneTimeLength * (i / oneTimeLength + 1);
                    int      ThisTimeLength = remain > 0 ? oneTimeLength : (remain += oneTimeLength);
                    double[] tmp_tt         = new double[ThisTimeLength];
                    double[] tmp_wx         = new double[ThisTimeLength];
                    double[] tmp_wvelo      = new double[ThisTimeLength];
                    double[] tmp_wx_gauge   = new double[ThisTimeLength];

                    for (int j = 0; j < ThisTimeLength; j++)
                    {
                        tmp_tt[j]       = milesData[index + j];
                        tmp_wx[j]       = channelData[index + j];
                        tmp_wvelo[j]    = speedData[index + j];
                        tmp_wx_gauge[j] = gaugeData[index + j];
                    }

                    MWNumericArray d_tt           = new MWNumericArray(tmp_tt);
                    MWNumericArray d_wx           = new MWNumericArray(tmp_wx);
                    MWNumericArray d_wvelo        = new MWNumericArray(tmp_wvelo);
                    MWNumericArray d_wx_gauge     = new MWNumericArray(tmp_wx_gauge);
                    MWNumericArray d_thresh_gauge = new MWNumericArray(thresh_gauge);

                    DataProcessAdvanceClass ppmc = new DataProcessAdvanceClass();
                    //调用算法
                    MWNumericArray resultArrayAB = (MWNumericArray)ppmc.sub_preprocessing_deviation_by_p2p(d_tt, d_wx, d_wvelo, d_wx_gauge, d_thresh_gauge);
                    double[,] tmpArray = (double[, ])resultArrayAB.ToArray();

                    for (int j = 0; j < tmpArray.GetLength(0); j++)
                    {
                        tmpArray[j, 0] = tmp_tt[(long)(tmpArray[j, 0])];
                        tmpArray[j, 1] = tmp_tt[(long)(tmpArray[j, 1])];
                        //dataStr = String.Format("{0},{1},{2},{3}", channelName, tmpArray[j, 0], tmpArray[j, 1], tmpArray[j, 2]);

                        Result result = new Result();
                        result.channelname = channelName;
                        result.startpos    = tmpArray[j, 0];
                        result.endpos      = tmpArray[j, 1];
                        result.absvalue    = tmpArray[j, 2];

                        dataList.Add(result);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }


            return(dataList);
        }