当前位置: 首页>>代码示例>>C#>>正文


C# HTuple.TupleSortIndex方法代码示例

本文整理汇总了C#中HTuple.TupleSortIndex方法的典型用法代码示例。如果您正苦于以下问题:C# HTuple.TupleSortIndex方法的具体用法?C# HTuple.TupleSortIndex怎么用?C# HTuple.TupleSortIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTuple的用法示例。


在下文中一共展示了HTuple.TupleSortIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: drawFunction

        /// <summary>Plots a function provided as an HTuple</summary>
        private void drawFunction(HTuple tuple)
        {
            HTuple val;
            int maxY,maxX;
            float stepOffset;

            if (tuple.Length == 0)
            {
                resetPlot();
                return;
            }

            val = tuple.TupleSortIndex();
            maxX = tuple.Length - 1;
            maxY = (int)tuple[val[val.Length - 1].I].D;

            axisXLength = maxX;

            switch (axisAdaption)
            {
                case AXIS_RANGE_ADAPTING:
                    axisYLength = maxY;
                    break;
                case AXIS_RANGE_INCREASING:
                    axisYLength = (maxY > axisYLength) ? maxY : axisYLength;
                    break;
            }

            backBuffer.Clear(System.Drawing.Color.WhiteSmoke);
            backBuffer.FillRectangle(brushFuncPanel, originX, 0, panelWidth, panelHeight);

            stepOffset = drawXYLabels();
            drawLineCurve(tuple, stepOffset);
            backBuffer.Flush();

            gPanel.DrawImageUnscaled(functionMap, 0, 0);
            gPanel.Flush();
        }
开发者ID:Joncash,项目名称:HanboAOMClassLibrary,代码行数:39,代码来源:FunctionPlot.cs

示例2: ComputeStatistics

        /// <summary>Adjusts statistics of measure projection (line profile).</summary>
        public void ComputeStatistics(double[] grayVals)
        {
            HTuple tuple, val;
            int max =0;

            if (grayVals != null)
            {
                tuple = new HTuple(grayVals);

                val = tuple.TupleMean();
                labelMean.Text = val[0].D.ToString("f2");
                val = tuple.TupleDeviation();
                labelDeviation.Text = val[0].D.ToString("f2");

                val = tuple.TupleSortIndex();
                labelPeakX.Text = val[val.Length - 1].I + "";
                max = (int)tuple[val[val.Length - 1].I].D;
                labelPeak.Text = max + "";

                labelRange.Text = (int)tuple[0].D + " ... " + (int)tuple[tuple.Length - 1].D;
                labelRangeX.Text = "0 ... " + (tuple.Length - 1);
            }
            else
            {
                labelMean.Text = "0";
                labelDeviation.Text = "0";

                labelPeakX.Text = "0";
                labelPeak.Text = "0";

                labelRange.Text = "0 ... 0";
                labelRangeX.Text = "0 ... 0";
            }
        }
开发者ID:rtigithub,项目名称:HALCON-12-codelets,代码行数:35,代码来源:MeasureForm.cs


注:本文中的HTuple.TupleSortIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。