Changeset 4508


Ignore:
Timestamp:
08/05/04 06:01:46 (20 years ago)
Author:
merck
Message:
MMerck: Small bug fixes when testing.
MMerck: Version 2.03
Location:
trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.cpp

    r4473 r4508  
    193193  int iStateCaCo, iStateCalib, iStateSentinel, iStateHVPS, iStateLid;
    194194  int iStateLV, iStateCool, iStateHV, iStateDC, iStateCaosLEDs;
    195   int iStateFADCFans, iStateCalCan, iStateCalIO, iStateCalLV, iStateAMCLEDs;
     195  int iStateFADCFans, iStateCalCan, iStateCalIO, iStateCalLV;
    196196  qts >> iStateCaCo >> iStateCalib >> iStateSentinel >> iStateHVPS >> iStateLid;
    197197  qts >> iStateLV >> iStateCool >> iStateHV >> iStateDC >> iStateCaosLEDs;
    198   qts >> iStateFADCFans >> iStateCalCan >> iStateCalIO >> iStateCalLV >> iStateAMCLEDs;
     198  qts >> iStateFADCFans >> iStateCalCan >> iStateCalIO >> iStateCalLV;
    199199  int iStateAMC, iStateHEAT;
    200200  qts >> iStateAMC >> iStateHEAT;
    201201  int iStateLIDAR, iStateOptical, iStateL2T, iStateAUX, iStateGRB;
    202202  qts >> iStateLIDAR >> iStateOptical >> iStateL2T >> iStateAUX >> iStateGRB;
     203  int iStateAMCLEDs;
     204        qts >> iStateAMCLEDs;
    203205        double dZd, dAz, dDec, dRA;
    204206        qts >> dZd >> dAz >> dDec >> dRA;
  • trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.cpp

    r3401 r4508  
    5959                        m_qtTimer.stop();
    6060                        m_qtTimer.start( CC_REPORT_TIMEOUT, true );
    61 //                      qDebug( msg );
     61                        qDebug( msg );
    6262                        emit reportFromCC( msg );
    6363//                      m_pParent->setAMCState( iStatus );
  • trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcdefs.h

    r4478 r4508  
    1616 ***************************************************************************/
    1717
    18 #define AMC_VERSION             "2.01"
     18#define AMC_VERSION             "2.03"
    1919
    2020#define CAMERA_X                344.0 //                       
  • trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmirrorpanel.cpp

    r4481 r4508  
    209209        double dX = p_dX;
    210210        double dY = p_dY;
     211        double dAlpha1 = atan( getSlopeX() );
     212        double dAlpha2 = atan( getSlopeY() );
     213
    211214        if( m_zReversed )
    212215        {
    213216                dX = p_dY;
    214217                dY = p_dX;
     218//              dAlpha1 = atan( getSlopeY() );
     219//              dAlpha2 = atan( getSlopeX() );
    215220        }
    216 //      qDebug("Dx Dy: %4.0f %4.0f", dX, dY ); 
    217 
    218         double dAlpha1 = atan( getSlopeX() );
    219         double dAlpha2 = atan( getSlopeY() );
    220 //      qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 );     
     221        qDebug("Dx Dy: %5.1f %5.1f", dX, dY ); 
     222        qDebug("SlopeX, SlopeY: %7.4f %7.4f", getSlopeY(), getSlopeX() );       
     223        qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 );     
    221224
    222225        double dSinA1 = sin( dAlpha1 );
     
    228231        dFacX /= ( dCosA1 - dSinA1 * dCosA2 / dSinA2 );
    229232        double dFacY = ( dY - dFacX * dSinA1 ) / dSinA2;
    230 //      qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY );       
    231 
     233        qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY );       
     234
     235        p_iStepsX = (int) ( dFacX * getConversionX() );
     236        p_iStepsY = (int) ( dFacY * getConversionY() );
    232237        if( m_zReversed )
    233238        {
    234                 p_iStepsY = (int) ( dFacY * getConversionY() );
    235                 p_iStepsX = (int) ( dFacX * getConversionX() );
    236         }
    237         else
    238         {
    239                 p_iStepsX = (int) ( dFacX * getConversionX() );
    240                 p_iStepsY = (int) ( dFacY * getConversionY() );
     239                if(getSlopeX() < 0.0)
     240                        p_iStepsX = (int) ( dFacX * -1.0 * getConversionX() );
     241                if(getSlopeY() < 0.0)
     242                        p_iStepsY = (int) ( dFacY * -1.0 * getConversionY() );
    241243        }
    242244
     
    253255void AMCMirrorPanel::getCorrectedRef( double& p_dRefX, double& p_dRefY )
    254256{
    255         const double  kPixelperMMX = 0.44;
     257        const double  kPixelperMMX = -0.44;
    256258        const double  kPixelperMMY = 0.44;
    257259
     
    270272
    271273        /*     
    272          * We assumethat the video camera is horizontally alligned with mirror dish.
     274         * We assume that the video camera is horizontally alligned with mirror dish.
    273275         * If we have a rotation of the video image in respect to the mirror frame we
    274276         * must add an extra correction here.
    275          * As the coordinate system of the video image has a reversed Y axis ( 0rign being
     277         * As the coordinate system of the video image has a reversed Y axis ( origin being
    276278         * the upper left corner) we have to multiply the Y correction with -1. to get the right
    277279         * sign.
     
    280282        double dCorrSpotY = -1.0 * cos( dZeta ) * dCorrection;
    281283
    282         p_dRefX += dCorrSpotY * kPixelperMMX;
    283         p_dRefY += dCorrSpotY * kPixelperMMY;
     284  p_dRefX += dCorrSpotX * kPixelperMMX;
     285  p_dRefY += dCorrSpotY * kPixelperMMY;
    284286        qDebug( "Laser spot position after applying correction:   %f %f", p_dRefX, p_dRefY );
    285287}
  • trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp

    r4505 r4508  
    100100
    101101                // check if the laser adjustment converged
    102                 double dX,dY;
    103102                getSpot();
    104                 getDistToRef(dX, dY);
    105103                int x,y;
    106104                calcSteps( x, y );
     
    109107                m_pPanel->setLaserOn( false );
    110108
     109                double dRefX, dRefY;
     110                m_pPanel->getCorrectedRef( dRefX, dRefY );
     111                double dX, dY;
     112                dX = dRefX - m_dSpotX;
     113                dY = dRefY - m_dSpotY;
     114               
    111115                if( (fabs(dX) > 1.5) || (fabs(dY) > 1.5) )
    112116                {
     
    214218        double dRefX;
    215219        double dRefY;
    216 //      dRefX = m_pPanel->getLaserX();
    217 //      dRefY = m_pPanel->getLaserY();
    218220        m_pPanel->getCorrectedRef( dRefX, dRefY );
    219221
Note: See TracChangeset for help on using the changeset viewer.