Changeset 12900 for trunk/FACT++/src


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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.