Changeset 12900 for trunk/FACT++/src
- Timestamp:
- 02/17/12 13:53:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/feedback.cc
r12899 r12900 51 51 kStateDisconnected, 52 52 kStateConnecting, 53 kStateConnectedFSC, 54 kStateConnectedFAD, 53 55 kStateConnected, 54 56 kStateTempCtrlIdle, … … 817 819 return kStateDimNetworkNA; 818 820 821 const bool bias = fStatusBias.second >= BIAS::kConnecting; 822 const bool fad = fStatusFAD.second >= FAD::kConnected; 823 const bool fsc = fStatusFSC.second >= 2; 824 819 825 // 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) 823 827 return kStateDisconnected; 824 828 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) 829 831 return kStateConnecting; 830 832 … … 867 869 return kStateConnected; 868 870 } 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; 880 897 881 898 return kStateConnected; … … 917 934 918 935 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."); 921 942 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."); 923 944 924 945 AddStateName(kStateFeedbackCtrlIdle, "FeedbackIdle", … … 937 958 "Calibrating current offsets."); 938 959 939 AddEvent("START_FEEDBACK_CONTROL", kStateConnected )960 AddEvent("START_FEEDBACK_CONTROL", kStateConnectedFAD, kStateConnected) 940 961 (bind(&StateMachineFeedback::StartFeedback, this)) 941 962 ("Start the feedback control loop"); 942 963 943 AddEvent("START_GLOBAL_FEEDBACK", kStateConnected )964 AddEvent("START_GLOBAL_FEEDBACK", kStateConnectedFAD, kStateConnected) 944 965 (bind(&StateMachineFeedback::StartFeedbackGlobal, this)) 945 966 ("Start the global feedback control loop"); 946 967 947 AddEvent("START_TEMP_CONTROL", "F:1", kStateConnected )968 AddEvent("START_TEMP_CONTROL", "F:1", kStateConnectedFSC, kStateConnected) 948 969 (bind(&StateMachineFeedback::StartTempCtrl, this, placeholders::_1)) 949 970 ("Start the temperature control loop" … … 983 1004 ("Set time-constant. (-1 to use the cycle time, i.e. the time for the last average cycle, instead)"); 984 1005 985 AddEvent("CALIBRATE_CURRENTS", kStateConnected )//, kStateIdle)1006 AddEvent("CALIBRATE_CURRENTS", kStateConnectedFSC, kStateConnected)//, kStateIdle) 986 1007 (bind(&StateMachineFeedback::CalibrateCurrents, this)) 987 1008 ("");
Note:
See TracChangeset
for help on using the changeset viewer.