也可以直接在C盘模板中直接修改,模板路径: C:Program Files (x86)National InstrumentsVision AssistantCGVisual Studio ProjectCS
修改后,以后可以不用修改
public static PointContour IVA_FindExtremeEdge(RakeReport report, bool findClosestEdge)
{
Double extremeDistance;
Double tempDistance;
PointContour edge = new PointContour(0,0);
// Determine if the function should process the first edges or the last edges array
if (findClosestEdge)
{
if (report.FirstEdges.Count > 0 )
{
extremeDistance = report.FirstEdges[0].Distance;
edge = report.FirstEdges[0].Position;
// Then find the edge that is closest to the boundary of the search area
for (int i = 1 ; i < report.FirstEdges.Count ; i++)
{
tempDistance = report.FirstEdges[i].Distance;
if (tempDistance < extremeDistance)
{
extremeDistance = tempDistance;
edge = report.FirstEdges[i].Position;
}
}
}
}
else
{
if( report.LastEdges.Count > 0 )
{
// First, intialize the value with the first edge in the array
extremeDistance = report.LastEdges[0].Distance;
edge = report.LastEdges[0].Position;
// Then find the edge that are closest to the boundary of the search area
for (int i = 1 ; i < report.LastEdges.Count ; i++ )
{
tempDistance = report.LastEdges[i].Distance;
if (tempDistance > extremeDistance)
{
extremeDistance = tempDistance;
edge = report.LastEdges[i].Position;
}
}
}
}
return edge;
}