1
Vote

ArgumentOutOfRangeException

description

Sorry my english, i find a exception when i deactivate and activate 5 markers, in the release 5579 branches v.1.0, the exception throw in:
 
Line 388 of TouchlessMgr.cs ArgumentOutOfRangeException
...
for (int x = _markerScanCommandsX[mscIndexX].coordinate; x <= _markerScanCommandsX[mscIndexX + 1].coordinate; x++, pPixelCurr++)
...
 
mscIndexX is 1 and the array is of length 2 and therefore is outside the array
 
this is me pice of code:
 
public void ActivateMarkers()
    {
        foreach(Marker marker in _touchlessMgr.Markers)
            marker.Active = true;
    }
 
    public void DeactivateMarkers()
    {
        foreach (Marker marker in _touchlessMgr.Markers)
            marker.Active = false;
    }

comments

zot wrote May 20, 2010 at 10:02 PM

Ok i solved the problem! i dont know if it's the best way but works for me :)

The problem arises when you deactivate and activate the markers, to perform this action, the DX and DY values rise to negative values for example -40 000

I solved it with this code as i mentioned above I do not know if it's the best way to solve the problem or whether this well at all but it works for me:

Line 470 of TouchlessMgr.cs

if (marker.prevData.DX < -imageHeight)
                marker.prevData.DX = 0;
            if (marker.prevData.DY < -imageWidth)
                marker.prevData.DY = 0;
And in the line 382 of the same class:

if (mscIndexX + 1 >= _markerScanCommandsX.Count)
                        continue;
if (mscIndexY + 1 >= _markerScanCommandsY.Count)
                        continue;

wrote Feb 21, 2013 at 11:27 PM