Changeset 13942 for trunk/FACT++/gui
- Timestamp:
- 05/27/12 18:53:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r13923 r13942 39 39 40 40 #include "src/FAD.h" 41 #include "src/HeadersMCP.h" 41 42 #include "src/HeadersFTM.h" 42 43 #include "src/HeadersFAD.h" 44 #include "src/HeadersFSC.h" 43 45 #include "src/HeadersBIAS.h" 44 46 #include "src/HeadersDrive.h" 47 #include "src/HeadersFeedback.h" 48 #include "src/HeadersRateScan.h" 49 #include "src/HeadersRateControl.h" 50 #include "src/HeadersMagicWeather.h" 45 51 46 52 using namespace std; … … 2571 2577 fStatusMCPLabel->setToolTip(s.comment.c_str()); 2572 2578 2573 if (s.index< 2) // No Dim connection2579 if (s.index<MCP::State::kDisconnected) // No Dim connection 2574 2580 SetLedColor(fStatusMCPLed, kLedGray, time); 2575 if (s.index== 2) // Disconnected2581 if (s.index==MCP::State::kDisconnected) // Disconnected 2576 2582 SetLedColor(fStatusMCPLed, kLedRed, time); 2577 if (s.index== 3) // Connecting2583 if (s.index==MCP::State::kConnecting) // Connecting 2578 2584 SetLedColor(fStatusMCPLed, kLedOrange, time); 2579 if (s.index== 4) // Connected2585 if (s.index==MCP::State::kConnected) // Connected 2580 2586 SetLedColor(fStatusMCPLed, kLedYellow, time); 2581 if (s.index== 5 || s.index==10 || s.index>9) // Idle, TriggerOn, TakingData2587 if (s.index==MCP::State::kIdle || s.index>=MCP::State::kConfigured) // Idle, TriggerOn, TakingData 2582 2588 SetLedColor(fStatusMCPLed, kLedGreen, time); 2583 2589 2584 if (s.index> =7 && s.index<=9)2590 if (s.index>MCP::State::kIdle && s.index<MCP::State::kConfigured) 2585 2591 SetLedColor(fStatusMCPLed, kLedGreenBar, time); 2586 2592 2587 fMcpStartRun->setEnabled(s.index>= 5);2588 fMcpStopRun->setEnabled(s.index>= 5);2589 fMcpReset->setEnabled(s.index ==5||(s.index>=7 && s.index<=10));2593 fMcpStartRun->setEnabled(s.index>=MCP::State::kIdle); 2594 fMcpStopRun->setEnabled(s.index>=MCP::State::kIdle); 2595 fMcpReset->setEnabled(s.index>=MCP::State::kIdle && MCP::State::kConfigured); 2590 2596 } 2591 2597 … … 2689 2695 bool enable = false; 2690 2696 2691 if (s.index< 1)// No Dim connection2697 if (s.index<FSC::State::kDisconnected) // No Dim connection 2692 2698 SetLedColor(fStatusFSCLed, kLedGray, time); 2693 if (s.index== 1) // Dim connection / FTM disconnected2699 if (s.index==FSC::State::kDisconnected) // Dim connection / FTM disconnected 2694 2700 SetLedColor(fStatusFSCLed, kLedRed, time); 2695 if (s.index>= 2)// Dim connection / FTM disconnected2701 if (s.index>=FSC::State::kConnected) // Dim connection / FTM disconnected 2696 2702 { 2697 2703 SetLedColor(fStatusFSCLed, kLedGreen, time); … … 2707 2713 fStatusDriveLabel->setToolTip(s.comment.c_str()); 2708 2714 2709 if (s.index< 1) // No Dim connection2715 if (s.index<Drive::State::kDisconnected) // No Dim connection 2710 2716 SetLedColor(fStatusDriveLed, kLedGray, time); 2711 if (s.index== 1) // Dim connection / No connection to cosy2717 if (s.index==Drive::State::kDisconnected) // Dim connection / No connection to cosy 2712 2718 SetLedColor(fStatusDriveLed, kLedRed, time); 2713 if (s.index== 2 || s.index==3) // Not Ready2719 if (s.index==Drive::State::kConnected || s.index==Drive::State::kNotReady) // Not Ready 2714 2720 SetLedColor(fStatusDriveLed, kLedGreenBar, time); 2715 2721 if (s.index==Drive::State::kConnected || s.index==Drive::State::kArmed) // Connected / Armed … … 2719 2725 if (s.index==Drive::State::kTracking) // Tracking 2720 2726 SetLedColor(fStatusDriveLed, kLedGreenCheck, time); 2721 if (s.index ==99) // Error2727 if (s.index>=0xff) // Error 2722 2728 SetLedColor(fStatusDriveLed, kLedGreenWarn, time); 2723 2729 } … … 2747 2753 SetLedColor(fStatusBiasLed, kLedWarnTriangleBorder, time); 2748 2754 2749 fBiasWidget->setEnabled(s.index>= 3);2755 fBiasWidget->setEnabled(s.index>=BIAS::State::kInitializing); 2750 2756 } 2751 2757 … … 2755 2761 fStatusFeedbackLabel->setToolTip(s.comment.c_str()); 2756 2762 2757 if (s.index>8) // Running 2758 SetLedColor(fStatusFeedbackLed, kLedGreenCheck, time); 2759 if (s.index==7 || s.index==8) // Idle 2763 const bool connected = s.index> Feedback::State::kConnecting; 2764 const bool idle = s.index>=Feedback::State::kTempCtrlIdle && s.index<=Feedback::State::kCurrentCtrlIdle; 2765 const bool running = s.index>=Feedback::State::kTempCtrlRunning && s.index<=Feedback::State::kCurrentCtrlRunning; 2766 const bool calib = s.index==Feedback::State::kCalibrating; 2767 2768 if (s.index<=Feedback::State::kConnecting) // NoDim / Disconnected 2769 SetLedColor(fStatusFeedbackLed, kLedRed, time); 2770 if (s.index<Feedback::State::kDisconnected) // No Dim connection 2771 SetLedColor(fStatusFeedbackLed, kLedGray, time); 2772 if (s.index==Feedback::State::kConnecting) // Connecting 2773 SetLedColor(fStatusFeedbackLed, kLedOrange, time); 2774 if (connected) // Connected 2775 SetLedColor(fStatusFeedbackLed, kLedYellow, time); 2776 if (idle) 2760 2777 SetLedColor(fStatusFeedbackLed, kLedGreen, time); 2761 if (s.index>=4 && s.index<=6) // Connected 2762 SetLedColor(fStatusFeedbackLed, kLedYellow, time); 2763 if (s.index==3) // Connecting 2764 SetLedColor(fStatusFeedbackLed, kLedOrange, time); 2765 if (s.index<3) // NoDim / Disconnected 2766 SetLedColor(fStatusFeedbackLed, kLedRed, time); 2767 if (s.index<1) // No Dim connection 2768 SetLedColor(fStatusFeedbackLed, kLedGray, time); 2769 2770 fFeedbackWidget->setEnabled(s.index>=3); 2771 fFeedbackCalibrate->setEnabled(s.index==4 || s.index==6); 2772 fFeedbackStop->setEnabled(s.index>4); 2773 fFeedbackTempStart->setEnabled(s.index==4 || s.index==5); 2774 fFeedbackTempOffset->setEnabled(s.index<=6); 2775 fFeedbackOutputEnable->setEnabled(s.index<=9); 2776 fFeedbackOutputDisable->setEnabled(s.index!=7 && s.index!=8 && s.index!=9); 2777 2778 fFeedbackFrameLeft->setEnabled(s.index!=7 && s.index!=9 && s.index!=10 && s.index!=12); 2779 fFeedbackCanvLeft->setEnabled(s.index!=7 && s.index!=9 && s.index!=10 && s.index!=12); 2778 if (running) 2779 SetLedColor(fStatusFeedbackLed, kLedGreenCheck, time); 2780 if (calib) 2781 SetLedColor(fStatusFeedbackLed, kLedInProgress, time); 2782 2783 fFeedbackWidget->setEnabled(connected); 2784 2785 fFeedbackCalibrate->setEnabled(s.index==Feedback::State::kConnectedFSC || s.index==Feedback::State::kConnected); 2786 fFeedbackTempStart->setEnabled(s.index==Feedback::State::kConnectedFSC || s.index==Feedback::State::kConnected); 2787 2788 fFeedbackStop->setEnabled(s.index>Feedback::State::kConnected); 2789 2790 fFeedbackTempOffset->setEnabled(s.index<=Feedback::State::kConnected); 2791 fFeedbackOutputEnable->setEnabled(s.index<Feedback::State::kTempCtrlRunning); 2792 fFeedbackOutputDisable->setEnabled(running); 2793 2794 const bool enable = 2795 s.index!=Feedback::State::kTempCtrlIdle || 2796 s.index!=Feedback::State::kCurrentCtrlIdle || 2797 s.index!=Feedback::State::kTempCtrlRunning || 2798 s.index!=Feedback::State::kCurrentCtrlRunning; 2799 2800 fFeedbackFrameLeft->setEnabled(enable); 2801 fFeedbackCanvLeft->setEnabled(enable); 2780 2802 } 2781 2803 … … 2785 2807 fStatusRateControlLabel->setToolTip(s.comment.c_str()); 2786 2808 2787 if (s.index== 7) // InProgress2809 if (s.index==RateControl::State::kInProgress) 2788 2810 SetLedColor(fStatusRateControlLed, kLedGreenCheck, time); 2789 if (s.index== 6) // GlobalThresholdSet2811 if (s.index==RateControl::State::kGlobalThresholdSet) 2790 2812 SetLedColor(fStatusRateControlLed, kLedGreen, time); 2791 if (s.index== 5) // SettingGlobalThreshold2813 if (s.index==RateControl::State::kSettingGlobalThreshold) 2792 2814 SetLedColor(fStatusRateControlLed, kLedInProgress, time); 2793 if (s.index== 4) // Connected2815 if (s.index==RateControl::State::kConnected) 2794 2816 SetLedColor(fStatusRateControlLed, kLedGreenBar, time); 2795 if (s.index== 3) // Connecting2817 if (s.index==RateControl::State::kConnecting) 2796 2818 SetLedColor(fStatusRateControlLed, kLedOrange, time); 2797 if (s.index< 3) // NoDim / Disconnected2819 if (s.index<RateControl::State::kConnecting) 2798 2820 SetLedColor(fStatusRateControlLed, kLedRed, time); 2799 if (s.index< 1) // No Dim connection2821 if (s.index<RateControl::State::kDisconnected) 2800 2822 SetLedColor(fStatusRateControlLed, kLedGray, time); 2801 2823 } … … 2831 2853 fStatusWeatherLabel->setText(s.name.c_str()); 2832 2854 2833 if (s.index== 3)2855 if (s.index==MagicWeather::State::kReceiving) 2834 2856 SetLedColor(fStatusWeatherLed, kLedGreen, time); 2835 if (s.index< 3) // No valid data2857 if (s.index<MagicWeather::State::kReceiving) 2836 2858 SetLedColor(fStatusWeatherLed, kLedRed, time); 2837 if (s.index< 1) // No Dim connection2859 if (s.index<MagicWeather::State::kConnected) 2838 2860 SetLedColor(fStatusWeatherLed, kLedGray, time); 2839 2861 } … … 2852 2874 2853 2875 if (server=="RATESCAN") 2854 fRateScanControls->setEnabled(s.index>= 4);2876 fRateScanControls->setEnabled(s.index>=RateScan::State::kConnected); 2855 2877 2856 2878 if (server=="SCHEDULER")
Note:
See TracChangeset
for help on using the changeset viewer.