Changeset 12668
- Timestamp:
- 11/29/11 12:06:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r12658 r12668 798 798 // ======================= DNS ========================================== 799 799 800 uint32_t fDimVersion; 801 802 void UpdateGlobalStatus() 803 { 804 ostringstream dns; 805 dns << (fDimVersion==0?"No connection":"Connection"); 806 dns << " to DIM DNS (" << getenv("DIM_DNS_NODE") << ")"; 807 dns << (fDimVersion==0?".":" established"); 808 809 ostringstream str; 810 str << "V" << fDimVersion/100 << 'r' << fDimVersion%100; 811 812 LedColor_t led = kLedGreen; 813 if (fDimVersion>0) 814 { 815 dns << fixed << setprecision(1) << right; 816 if (fFreeSpaceLogger!=UINT64_MAX) 817 dns << "<pre> * Data logger: " << setw(7) << fFreeSpaceLogger*1e-7 << " GB</pre>"; 818 if (fFreeSpaceData!=UINT64_MAX) 819 dns << "<pre> * Event Builder: " << setw(7) << fFreeSpaceData*1e-7 << " GB</pre>"; 820 821 if (fFreeSpaceLogger<500000000 || fFreeSpaceData<500000000) 822 led = kLedGreenWarn; 823 if (fFreeSpaceLogger<200000000 || fFreeSpaceData<200000000) 824 led = kLedWarnTriangleBorder; 825 826 if (led!=kLedGreen) 827 str << " (Disk space!)"; 828 } 829 830 fStatusDNSLabel->setToolTip(dns.str().c_str()); 831 832 SetLedColor(fStatusDNSLed, fDimVersion==0 ? kLedRed : led, Time()); 833 834 fStatusDNSLabel->setText(fDimVersion==0?"Offline":str.str().c_str()); 835 } 836 800 837 void handleDimDNS(const DimData &d) 801 838 { 802 const int version = d.size()!=4 ? 0 : d.get<uint32_t>(); 803 804 ostringstream str; 805 str << "V" << version/100 << 'r' << version%100; 806 807 ostringstream dns; 808 dns << (version==0?"No connection":"Connection"); 809 dns << " to DIM DNS (" << getenv("DIM_DNS_NODE") << ")"; 810 dns << (version==0?".":" established."); 811 812 fStatusDNSLabel->setText(version==0?"Offline":str.str().c_str()); 813 fStatusDNSLabel->setToolTip(dns.str().c_str()); 814 815 SetLedColor(fStatusDNSLed, version==0 ? kLedRed : kLedGreen, Time()); 816 817 fShutdown->setEnabled(version!=0); 818 fShutdownAll->setEnabled(version!=0); 839 fDimVersion = d.size()!=4 ? 0 : d.get<uint32_t>(); 840 841 UpdateGlobalStatus(); 842 843 fShutdown->setEnabled(fDimVersion!=0); 844 fShutdownAll->setEnabled(fDimVersion!=0); 819 845 } 820 846 821 847 822 848 // ======================= Logger ======================================= 849 850 uint64_t fFreeSpaceLogger; 823 851 824 852 void handleLoggerStats(const DimData &d) … … 832 860 fLoggerSpaceLeft->setEnabled(connected); 833 861 862 fFreeSpaceLogger = UINT64_MAX; 863 UpdateGlobalStatus(); 864 834 865 if (!connected) 835 866 return; … … 840 871 const size_t written = vals[1]; 841 872 const size_t rate = float(vals[2])/vals[3]; 873 874 fFreeSpaceLogger = space; 875 UpdateGlobalStatus(); 842 876 843 877 fLoggerFreeSpace->setSuffix(" MB"); … … 976 1010 977 1011 // ===================== FAD ============================================ 1012 1013 uint64_t fFreeSpaceData; 978 1014 979 1015 void handleFadWriteStats(const DimData &d) … … 987 1023 fEvtBuilderSpaceLeft->setEnabled(connected); 988 1024 1025 fFreeSpaceData = UINT64_MAX; 1026 UpdateGlobalStatus(); 1027 989 1028 if (!connected) 990 1029 return; … … 995 1034 const size_t written = vals[1]; 996 1035 const size_t rate = float(vals[2])/vals[3]; 1036 1037 fFreeSpaceData = space; 1038 UpdateGlobalStatus(); 997 1039 998 1040 fEvtBuilderFreeSpace->setSuffix(" MB"); … … 4031 4073 fDimMagicWeather ("MAGIC_WEATHER/DATA", (void*)NULL, 0, this), 4032 4074 //- 4033 fEventData(0), fDrsCalibration(1440*1024*6+160*1024*2), 4034 fTimeStamp0(0) 4075 fDimVersion(0), 4076 fFreeSpaceLogger(UINT64_MAX), fFreeSpaceData(UINT64_MAX), 4077 fEventData(0), 4078 fDrsCalibration(1440*1024*6+160*1024*2), 4079 fTimeStamp0(0) 4035 4080 { 4036 4081 fClockCondFreq->addItem("--- Hz", QVariant(-1));
Note:
See TracChangeset
for help on using the changeset viewer.