Changing the Calibration order of CCV( from “Z” to “S” )
Posted: 21 March 2011 09:10 PM   [ Ignore ]
Avatar
Rank
Joined  2011-01-19
Total Posts:  35
New Member

Recently, we made a big MT table( 1m x 2m ). when we calibrated the table, we must calibrate the table from left to right again and again .
just like:
?ACT=28&fid=27&aid=6832_kY52SOH5YbXVP70ydUjd title=Z width=75%

then we changed the code, make the calibration like “S” but not “Z”.
just like:
?ACT=28&fid=27&aid=6831_WAadITvWELbhg50VotBa title=S width=75%

I will post the code if you like. smile

Image Attachments
CCV_Calibration_Z.pngCCV_Calibration_S.png
Profile
 
 
Posted: 22 March 2011 12:38 PM   [ Ignore ]   [ # 1 ]
RankRankRankRank
Joined  2009-08-21
Total Posts:  555
Elite

Of course, paste the code/changes , for reference of people at least smile !

 Signature 

~~Amit~~

Blog - Twitter - Facebook

Profile
 
 
Posted: 23 March 2011 08:28 AM   [ Ignore ]   [ # 2 ]
Avatar
Rank
Joined  2011-01-19
Total Posts:  35
New Member

OK, now let me show you how to do this.

*************** update 2011-04-02 ***************
Fix the bug that revert code problem.

<ol>
CalibrationUtils.h
<li>Add the code into this file(under private:):

int               calibrationIndex;
void              Index2Stepbool bRevert false );    // ** 2011-04-02 update

</li>
CalibrationUtils.cpp
<li>Add the code into loadXMLSettings() method( under CalibrationStep ):

calibrationIndex 0;

</li>
<li>Add the code into beginCalibration() method( under CalibrationStep ):

calibrationIndex 0;

</li>
<li>Change the nextCalibrationStep() method to:

void CalibrationUtils::nextCalibrationStep()
{
    
if(bCalibrating)
    
{
        calibrationIndex
++;
        
Index2Step();
        
        if(
calibrationIndex >= GRID_POINTS)
        
{
            bCalibrating 
false;
            
calibrationStep 0;
            
calibrationIndex 0;

            
saveCalibration(); // Should we remove this?
            
calculateBox();

            
saveCalibration();
        
}
    }
}

</li>
<li>Change the revertCalibrationStep() method to:

void CalibrationUtils::revertCalibrationStep()
{
    
if(bCalibrating)
    
{
        calibrationIndex
--;
        
Index2Steptrue );
        if(
calibrationIndex 0)
        
{
            calibrationStep 
0;
            
calibrationIndex 0;
        
}
    }
}

<li>Add the Index2Step() method:

void CalibrationUtils::Index2Stepbool bRevert {    // ** 2011-04-02 update
    
int x GRID_X 1;    // Set the points count of one line to "x"
    
if ( bRevert {    // Backward
        
if ( (calibrationIndex x) % == {    // "Index" at Even line
            
if ( ( calibrationIndex ) % == {
                calibrationStep 
-= x;
            
else {
                calibrationStep
--;
            
}
        } 
else {                    // Odd line
            
if ( (calibrationIndex ) % == {
                calibrationStep 
-= x;
            
else {
                calibrationStep
++;
            
}
        }
    } 
else {        // Forward
        
if( ( (calibrationIndex )/x) % == {    // Even line
            
if ( ( calibrationIndex ) % x  == {       // The "corner"
                
calibrationStep += x;
            
else {
                calibrationStep
++;
            
}
        } 
else {                                     // Odd line
            
if ( (calibrationIndex ) % == {         // The "corner"
                
calibrationStep += x;
            
else {
                calibrationStep
--;
            
}
        }
    }

</li>
<li>OK, finished!</li>
</ol>
Have fun!smile

Profile