Changeset 4172
- Timestamp:
- 05/25/04 13:59:45 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp
r3401 r4172 162 162 // Check if this spot is compatible with the spot of the 163 163 // upper left LED 164 if ( pActualSpot->contains ( LED1_X, LED1_Y ) )165 { 166 dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X); 164 if ( pActualSpot->contains2( LED1_X, LED1_Y ) ) 165 { 166 dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X); 167 167 dY1 = pActualSpot->getY() + (CAMERA_Y - LED1_Y); 168 168 dX += dX1; dY += dY1; 169 169 iNumLEDs++; 170 } 170 } 171 171 // Check if this spot is compatible with the spot of the 172 172 // upper right LED 173 else if ( pActualSpot->contains ( LED2_X, LED2_Y ) )174 { 175 dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X); 173 else if ( pActualSpot->contains2( LED2_X, LED2_Y ) ) 174 { 175 dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X); 176 176 dY2 = pActualSpot->getY() + (CAMERA_Y - LED2_Y); 177 177 dX += dX2; dY += dY2; 178 178 iNumLEDs++; 179 } 179 } 180 180 // Check if this spot is compatible with the spot of the 181 181 // lower left LED 182 else if ( pActualSpot->contains ( LED3_X, LED3_Y ) )183 { 184 dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X); 182 else if ( pActualSpot->contains2( LED3_X, LED3_Y ) ) 183 { 184 dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X); 185 185 dY3 = pActualSpot->getY() + (CAMERA_Y - LED3_Y); 186 186 dX += dX3; dY += dY3; 187 187 iNumLEDs++; 188 } 188 } 189 189 // Check if this spot is compatible with the spot of the 190 190 // lower right LED 191 else if ( pActualSpot->contains ( LED4_X, LED4_Y ) )192 { 193 dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X); 191 else if ( pActualSpot->contains2( LED4_X, LED4_Y ) ) 192 { 193 dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X); 194 194 dY4 = pActualSpot->getY() + (CAMERA_Y - LED4_Y); 195 195 dX += dX4; dY += dY4; … … 201 201 if( iNumLEDs != 0) 202 202 { 203 m_iCenterX = (int) rint(dX / iNumLEDs); 204 m_iCenterY = (int) rint(dY / iNumLEDs); 203 m_iCenterX = (int) rint(dX / iNumLEDs); 204 m_iCenterY = (int) rint(dY / iNumLEDs); 205 205 } 206 206 // qDebug("Center at: %d %d -- with %d LEDs",m_iCenterX, m_iCenterY, iNumLEDs ); … … 219 219 m_iSpotX -= iDx; 220 220 m_iSpotY -= iDy; 221 // qDebug("Spot at x,y: %4d %4d", m_iSpotX, m_iSpotY ); 221 // qDebug("Spot at x,y: %4d %4d", m_iSpotX, m_iSpotY ); 222 222 223 223 // Now we calculate the distance of the real spot to the stored reference position 224 224 p_dX = (double) (iRefX - m_iSpotX); 225 225 p_dY = (double) (iRefY - m_iSpotY); 226 // qDebug("Dx Dy: %4.0f %4.0f", dX, dY ); 226 // qDebug("Dx Dy: %4.0f %4.0f", dX, dY ); 227 227 } 228 228 … … 235 235 double dAlpha1 = atan( m_pPanel->getSlopeX() ); 236 236 double dAlpha2 = atan( m_pPanel->getSlopeY() ); 237 // qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 ); 237 // qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 ); 238 238 double dSinA1 = sin( dAlpha1 ); 239 239 double dSinA2 = sin( dAlpha2 ); … … 244 244 dFacX /= ( dCosA1 - dSinA1 * dCosA2 / dSinA2 ); 245 245 double dFacY = (dY - dFacX * dSinA1) / dSinA2; 246 // qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY ); 246 // qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY ); 247 247 248 248 p_iX = (int) ( dFacX * m_pPanel->getConversionX() ); … … 253 253 p_iY = (p_iY >> 1) << 1; 254 254 255 qDebug("Steps till reference: %4d %4d", p_iX, p_iY ); 255 qDebug("Steps till reference: %4d %4d", p_iX, p_iY ); 256 256 QCString qsMsg; 257 257 qsMsg.sprintf( "%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %5d %5d", … … 261 261 m_pPanel->getLaserX(), m_pPanel->getLaserY(), 262 262 (int) rint(dX), (int) rint(dY), 263 p_iX, p_iY ); 263 p_iX, p_iY ); 264 264 QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) ); 265 265 } … … 272 272 273 273 m_qlSpotList.clear(); 274 int top = LED2_Y - 10;275 int bottom = LED3_Y + 10;276 int left = LED1_X - 10;277 int right = LED4_X + 10;274 int top = LED2_Y - 20; 275 int bottom = LED3_Y + 20; 276 int left = LED1_X - 20; 277 int right = LED4_X + 20; 278 278 279 279 for (int i=top; i <bottom; i++) … … 306 306 } 307 307 } 308 308 calcCenter(); 309 309 if( m_qlSpots.count() == 1) 310 310 {
Note:
See TracChangeset
for help on using the changeset viewer.