Changeset 13974


Ignore:
Timestamp:
05/30/12 11:35:44 (13 years ago)
Author:
tbretz
Message:
Added a faster procedure when the current control is anables to get to the nominal volatge
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/feedback.cc

    r13922 r13974  
    7979
    8080    double fBiasOffset;
     81    double fTempOffset;
    8182    double fCalibrationOffset;
    8283    double fAppliedOffset;
     
    115116        avgt /= numt; // [deg C]
    116117
    117         const double dUt = (avgt-25)*4./70; // [V]
     118        fTempOffset = (avgt-25)*4./70; // [V]
     119
     120        return HandleCurrentControl();
     121    }
     122
     123    int HandleCurrentControl()
     124    {
     125        const double dUt = fTempOffset; // [V]
    118126
    119127        if (GetCurrentState()==Feedback::State::kCalibrating && fBiasOffset>dUt-1.2)
    120128        {
    121129            ostringstream msg;
    122             msg << " (applied calibration offset " << fBiasOffset << "V exceeds temperature correction " << avgt << "V - 1.2V.";
     130            msg << " (applied calibration offset " << fBiasOffset << "V exceeds temperature correction " << fTempOffset << "V - 1.2V.";
    123131            Warn("Trying to calibrate above G-APD breakdown volatge!");
    124132            Warn(msg);
     
    711719            AverageCurrents(evt);
    712720
     721        if (fControlType==kCurrents && fTempOffset>-2 && fCursorTemp && fCursorCur%3==0)
     722            HandleCurrentControl();
     723
    713724        return GetCurrentState();
    714725    }
     
    930941
    931942        fBiasOffset = evt.GetFloat();
     943        fTempOffset = -3;
    932944        ResetData(0);
    933945        fControlType = kCurrents;
     
    11351147                }
    11361148
    1137                 return fOutputEnabled ? Feedback::State::kCurrentCtrlRunning : Feedback::State::kCurrentCtrlIdle;
     1149                return fOutputEnabled && fCursorTemp>0 ? Feedback::State::kCurrentCtrlRunning : Feedback::State::kCurrentCtrlIdle;
    11381150            }
    11391151        }
Note: See TracChangeset for help on using the changeset viewer.