M_DIST::Set

Set the distance value

int Set(
   double       dist,
   ProcUnit     *ptrProcUnit,
   int  imageNo,
   int  mode
);

Parameters
dist
Distance or length
*ptrProcUnit
Pointer to the processing unit class
imageNo
The current target image number to be registered
mode
bit1:calibration ON/OFF, bit0:scroll ON/OFF

Return Value
Returns 0 when the expression is successfully converted.
Otherwise returns a non-zero value.

Description
Set the distance value

Example
    int Sample::MeasureProc(ProcUnit *ptrProcUnit)
    {

        double posX1, posY1, posX2, posY2;
        int    outputMode = 0;
        M_DIST   distance;

        func_measure(&posX1, &posY1);
        func_measure(&posX2, &posY2);
        int dist = sqr((posX1 - posX2) * (posX1 - posX2)
                     + (posY1 - posY2) * (posY1 - posY2));


        if (ptrSetupData->outputCoordinate == 1) {
                outputMode |= 0x00000001;
        }
        if (ptrSetupData->calibration == 1) {
                outputMode |= 0x00000002;
        }

        // set data

        distance.Set(dist, ptrProcUnit, 0, outputMode);

    }