Changeset 12900 for trunk


Ignore:
Timestamp:
02/17/12 13:53:46 (13 years ago)
Author:
tbretz
Message:
Added new states in the feedback which allow to run the temp feedback and the Calibration without the FADs connected and the feedback without the FSC connected -- updated GUI and scripts accordingly
Location:
trunk/FACT++
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/ScriptsForDimCtrl/FirstDrsCalib

    r12802 r12900  
    1313FEEDBACK/ENABLE_OUTPUT 0
    1414FEEDBACK/STOP
    15 .s FEEDBACK 4
     15.s FEEDBACK 6
    1616.w 500
    1717.! echo `date -u` "calibrating bias crate current readings..." >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
    1818FEEDBACK/CALIBRATE_CURRENTS
    19 .s FEEDBACK 9
    20 .s FEEDBACK 4
     19.s FEEDBACK 11
     20.s FEEDBACK 6
    2121.w 3000
    2222FEEDBACK/START_TEMP_CONTROL 0.00
  • trunk/FACT++/gui/FactGui.h

    r12697 r12900  
    30843084            fStatusFeedbackLabel->setToolTip(s.comment.c_str());
    30853085
    3086             if (s.index>6) // Running
     3086            if (s.index>8) // Running
    30873087                SetLedColor(fStatusFeedbackLed, kLedGreenCheck, time);
    3088             if (s.index==5 || s.index==6) // Idle
     3088            if (s.index==7 || s.index==8) // Idle
    30893089                SetLedColor(fStatusFeedbackLed, kLedGreen, time);
    3090             if (s.index==4) // Connected
     3090            if (s.index>=4 && s.index<=6) // Connected
    30913091                SetLedColor(fStatusFeedbackLed, kLedYellow, time);
    30923092            if (s.index==3) // Connecting
     
    30983098
    30993099            fFeedbackWidget->setEnabled(s.index>=3);
    3100             fFeedbackCalibrate->setEnabled(s.index==4);
     3100            fFeedbackCalibrate->setEnabled(s.index==4 || s.index==6);
    31013101            fFeedbackStop->setEnabled(s.index>4);
    3102             fFeedbackTempStart->setEnabled(s.index==4);
    3103             fFeedbackTempOffset->setEnabled(s.index<=4);
    3104             fFeedbackOutputEnable->setEnabled(s.index<=6);
    3105             fFeedbackOutputDisable->setEnabled(s.index!=5 && s.index!=6);
    3106 
    3107             fFeedbackFrameLeft->setEnabled(s.index!=5 && s.index!=7);
    3108             fFeedbackCanvLeft->setEnabled(s.index!=5 && s.index!=7);
     3102            fFeedbackTempStart->setEnabled(s.index==4 || s.index==5);
     3103            fFeedbackTempOffset->setEnabled(s.index<=6);
     3104            fFeedbackOutputEnable->setEnabled(s.index<=8);
     3105            fFeedbackOutputDisable->setEnabled(s.index!=7 && s.index!=8);
     3106
     3107            fFeedbackFrameLeft->setEnabled(s.index!=7 && s.index!=9);
     3108            fFeedbackCanvLeft->setEnabled(s.index!=7 && s.index!=9);
    31093109        }
    31103110
  • trunk/FACT++/src/feedback.cc

    r12899 r12900  
    5151        kStateDisconnected,
    5252        kStateConnecting,
     53        kStateConnectedFSC,
     54        kStateConnectedFAD,
    5355        kStateConnected,
    5456        kStateTempCtrlIdle,
     
    817819            return kStateDimNetworkNA;
    818820
     821        const bool bias = fStatusBias.second >= BIAS::kConnecting;
     822        const bool fad  = fStatusFAD.second  >= FAD::kConnected;
     823        const bool fsc  = fStatusFSC.second  >= 2;
     824
    819825        // All subsystems are not connected
    820         if (fStatusFAD.second<FAD::kConnected &&
    821             fStatusBias.second<BIAS::kConnecting &&
    822             fStatusFSC.second<2)
     826        if (!bias && !fad && !fsc)
    823827            return kStateDisconnected;
    824828
    825         // At least one subsystem is not connected
    826         if (fStatusFAD.second<FAD::kConnected ||
    827             fStatusBias.second<BIAS::kConnected ||
    828             fStatusFSC.second<2)
     829        // At least one subsystem apart from bias is connected
     830        if (bias && !fad && !fsc)
    829831            return kStateConnecting;
    830832
     
    867869            return kStateConnected;
    868870        }
    869 */
    870         if (fControlType==kFeedback || fControlType==kFeedbackGlobal)
    871             return fOutputEnabled ? kStateFeedbackCtrlRunning : kStateFeedbackCtrlIdle;
    872 
    873         if (fControlType==kTemp)
    874         {
    875             if (GetCurrentState()==kStateCalibrating && fCursor<100)
    876                 return GetCurrentState();
    877 
    878             return fOutputEnabled ? kStateTempCtrlRunning : kStateTempCtrlIdle;
    879         }
     871        */
     872
     873        // Needs connection of FAD and BIAS
     874        if (bias && fad)
     875        {
     876            if (fControlType==kFeedback || fControlType==kFeedbackGlobal)
     877                return fOutputEnabled ? kStateFeedbackCtrlRunning : kStateFeedbackCtrlIdle;
     878        }
     879
     880        // Needs connection of FSC and BIAS
     881        if (bias && fsc)
     882        {
     883            if (fControlType==kTemp)
     884            {
     885                if (GetCurrentState()==kStateCalibrating && fCursor<100)
     886                    return GetCurrentState();
     887
     888                return fOutputEnabled ? kStateTempCtrlRunning : kStateTempCtrlIdle;
     889            }
     890        }
     891
     892        if (bias && fad && !fsc)
     893            return kStateConnectedFAD;
     894
     895        if (bias && fsc && !fad)
     896            return kStateConnectedFSC;
    880897
    881898        return kStateConnected;
     
    917934
    918935        AddStateName(kStateConnecting, "Connecting",
    919                      "Not all subsystems (FAD, FSC, Bias) are connected to their hardware.");
    920 
     936                     "Only biasctrl is available and connected with its hardware.");
     937
     938        AddStateName(kStateConnectedFSC, "ConnectedFSC",
     939                     "biasctrl and fscctrl are available and connected with their hardware.");
     940        AddStateName(kStateConnectedFAD, "ConnectedFAD",
     941                     "biasctrl and fadctrl are available and connected with their hardware.");
    921942        AddStateName(kStateConnected, "Connected",
    922                      "All needed subsystems are connected to their hardware, no action is performed.");
     943                     "biasctrl, fadctrl and fscctrl are available and connected with their hardware.");
    923944
    924945        AddStateName(kStateFeedbackCtrlIdle, "FeedbackIdle",
     
    937958                     "Calibrating current offsets.");
    938959
    939         AddEvent("START_FEEDBACK_CONTROL", kStateConnected)
     960        AddEvent("START_FEEDBACK_CONTROL", kStateConnectedFAD, kStateConnected)
    940961            (bind(&StateMachineFeedback::StartFeedback, this))
    941962            ("Start the feedback control loop");
    942963
    943         AddEvent("START_GLOBAL_FEEDBACK", kStateConnected)
     964        AddEvent("START_GLOBAL_FEEDBACK", kStateConnectedFAD, kStateConnected)
    944965            (bind(&StateMachineFeedback::StartFeedbackGlobal, this))
    945966            ("Start the global feedback control loop");
    946967
    947         AddEvent("START_TEMP_CONTROL", "F:1", kStateConnected)
     968        AddEvent("START_TEMP_CONTROL", "F:1", kStateConnectedFSC, kStateConnected)
    948969            (bind(&StateMachineFeedback::StartTempCtrl, this, placeholders::_1))
    949970            ("Start the temperature control loop"
     
    9831004            ("Set time-constant. (-1 to use the cycle time, i.e. the time for the last average cycle, instead)");
    9841005
    985         AddEvent("CALIBRATE_CURRENTS", kStateConnected)//, kStateIdle)
     1006        AddEvent("CALIBRATE_CURRENTS", kStateConnectedFSC, kStateConnected)//, kStateIdle)
    9861007            (bind(&StateMachineFeedback::CalibrateCurrents, this))
    9871008            ("");
Note: See TracChangeset for help on using the changeset viewer.