- Timestamp:
- 07/10/11 17:04:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11312 r11322 385 385 DimStampedInfo fDimFtmCounter; 386 386 387 DimStampedInfo fDimFadWriteStats; 387 388 DimStampedInfo fDimFadRuns; 388 389 DimStampedInfo fDimFadEvents; … … 890 891 891 892 // ===================== FAD ============================================ 893 894 void handleFadWriteStats(const DimData &d) 895 { 896 const bool connected = d.size()!=0; 897 898 fEvtBuilderET->setEnabled(connected); 899 fEvtBuilderRate->setEnabled(connected); 900 fEvtBuilderWritten->setEnabled(connected); 901 fEvtBuilderFreeSpace->setEnabled(connected); 902 fEvtBuilderSpaceLeft->setEnabled(connected); 903 904 if (!connected) 905 return; 906 907 const uint64_t *vals = d.ptr<uint64_t>(); 908 909 const size_t space = vals[0]; 910 const size_t written = vals[1]; 911 const size_t rate = float(vals[2])/vals[3]; 912 913 fEvtBuilderFreeSpace->setSuffix(" MB"); 914 fEvtBuilderFreeSpace->setDecimals(0); 915 fEvtBuilderFreeSpace->setValue(space*1e-6); 916 917 if (space> 1000000) // > 1GB 918 { 919 fEvtBuilderFreeSpace->setSuffix(" GB"); 920 fEvtBuilderFreeSpace->setDecimals(2); 921 fEvtBuilderFreeSpace->setValue(space*1e-9); 922 } 923 if (space>= 3000000) // >= 3GB 924 { 925 fEvtBuilderFreeSpace->setSuffix(" GB"); 926 fEvtBuilderFreeSpace->setDecimals(1); 927 fEvtBuilderFreeSpace->setValue(space*1e-9); 928 } 929 if (space>=100000000) // >= 100GB 930 { 931 fEvtBuilderFreeSpace->setSuffix(" GB"); 932 fEvtBuilderFreeSpace->setDecimals(0); 933 fEvtBuilderFreeSpace->setValue(space*1e-9); 934 } 935 936 fEvtBuilderET->setTime(QTime().addSecs(rate>0?space/rate:0)); 937 fEvtBuilderRate->setValue(rate*1e-3); // kB/s 938 fEvtBuilderWritten->setValue(written*1e-6); 939 940 fEvtBuilderRate->setSuffix(" kB/s"); 941 fEvtBuilderRate->setDecimals(2); 942 fEvtBuilderRate->setValue(rate); 943 if (rate> 2) // > 2kB/s 944 { 945 fEvtBuilderRate->setSuffix(" kB/s"); 946 fEvtBuilderRate->setDecimals(1); 947 fEvtBuilderRate->setValue(rate); 948 } 949 if (rate>=100) // >100kB/s 950 { 951 fEvtBuilderRate->setSuffix(" kB/s"); 952 fEvtBuilderRate->setDecimals(0); 953 fEvtBuilderRate->setValue(rate); 954 } 955 if (rate>=1000) // >100kB/s 956 { 957 fEvtBuilderRate->setSuffix(" MB/s"); 958 fEvtBuilderRate->setDecimals(2); 959 fEvtBuilderRate->setValue(rate*1e-3); 960 } 961 if (rate>=10000) // >1MB/s 962 { 963 fEvtBuilderRate->setSuffix(" MB/s"); 964 fEvtBuilderRate->setDecimals(1); 965 fEvtBuilderRate->setValue(rate*1e-3); 966 } 967 if (rate>=100000) // >10MB/s 968 { 969 fEvtBuilderRate->setSuffix(" MB/s"); 970 fEvtBuilderRate->setDecimals(0); 971 fEvtBuilderRate->setValue(rate*1e-3); 972 } 973 974 if (space/1000000>static_cast<size_t>(fEvtBuilderSpaceLeft->maximum())) 975 fEvtBuilderSpaceLeft->setValue(fEvtBuilderSpaceLeft->maximum()); // GB 976 else 977 fEvtBuilderSpaceLeft->setValue(space/1000000); // MB 978 } 892 979 893 980 void handleFadRuns(const DimData &d) … … 2187 2274 // if (getInfo()==&fDimFadFiles) 2188 2275 // return PostInfoHandler(&FactGui::handleFadFiles); 2276 2277 if (getInfo()==&fDimFadWriteStats) 2278 return PostInfoHandler(&FactGui::handleFadWriteStats); 2189 2279 2190 2280 if (getInfo()==&fDimFadConnections) … … 2647 2737 fDimFtmCounter ("FTM_CONTROL/COUNTER", (void*)NULL, 0, this), 2648 2738 //- 2739 fDimFadWriteStats ("FAD_CONTROL/STATS", (void*)NULL, 0, this), 2649 2740 fDimFadRuns ("FAD_CONTROL/RUNS", (void*)NULL, 0, this), 2650 2741 fDimFadEvents ("FAD_CONTROL/EVENTS", (void*)NULL, 0, this),
Note:
See TracChangeset
for help on using the changeset viewer.