- Timestamp:
- 05/23/11 08:55:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10750 r10768 914 914 // ===================== FTM ============================================ 915 915 916 double fTimeStamp1; 917 916 918 void handleFtmTriggerCounter(const DimData &d) 917 919 { … … 927 929 const FTM::DimTriggerCounter &sdata = *reinterpret_cast<const FTM::DimTriggerCounter*>(d.ptr()); 928 930 929 fFtmTime->setText(QString::number(sdata.fTimeStamp ));931 fFtmTime->setText(QString::number(sdata.fTimeStamp/1000000., 'f', 6)+ " s"); 930 932 fTriggerCounter->setText(QString::number(sdata.fTriggerCounter)); 933 934 if (sdata.fTimeStamp>0) 935 fTriggerCounterRate->setValue(1000000.*sdata.fTriggerCounter/sdata.fTimeStamp); 936 else 937 fTriggerCounterRate->setValue(0); 931 938 932 939 … … 937 944 { 938 945 fTriggerCounter0 = sdata.fTriggerCounter; 946 fTimeStamp1 = sdata.fTimeStamp; 939 947 return; 940 948 } … … 944 952 TH1 *h = (TH1*)c->FindObject("TimeFrame"); 945 953 946 const double rate = sdata.fTriggerCounter-fTriggerCounter0; 947 fTriggerCounter0 = sdata.fTriggerCounter; 948 949 if (rate<0) 954 const double rate = sdata.fTriggerCounter-fTriggerCounter0; 955 const double tdiff = sdata.fTimeStamp -fTimeStamp1; 956 957 fTriggerCounter0 = sdata.fTriggerCounter; 958 fTimeStamp1 = sdata.fTimeStamp; 959 960 if (rate<0 && tdiff<=0) 950 961 { 951 962 fGraphFtmRate.Set(0); … … 962 973 } 963 974 964 const double avgrate = sdata.fTimeStamp>0 ? double(sdata.fTriggerCounter)/sdata.fTimeStamp : 1; 975 if (rate<0) 976 return; 977 978 const double avgrate = sdata.fTimeStamp>0 ? double(sdata.fTriggerCounter)/sdata.fTimeStamp*1000000 : 1; 965 979 966 980 const double t1 = h->GetXaxis()->GetXmax(); 967 981 const double t0 = h->GetXaxis()->GetXmin(); 968 982 969 h->SetBins(h->GetNbinsX()+1, t0, t0+sdata.fTimeStamp +1);983 h->SetBins(h->GetNbinsX()+1, t0, t0+sdata.fTimeStamp/1000000.+1); 970 984 fGraphFtmRate.SetPoint(fGraphFtmRate.GetN(), 971 t0+sdata.fTimeStamp , rate);985 t0+sdata.fTimeStamp/1000000., 1000000*rate/tdiff); 972 986 973 987 if (t1-t0>60) … … 1023 1037 const FTM::DimDynamicData &sdata = *reinterpret_cast<const FTM::DimDynamicData*>(d.ptr()); 1024 1038 1025 fFtmTime->setText(QString::number(sdata.fTimeStamp)); 1026 fOnTime->setText(QString::number(sdata.fOnTimeCounter)); 1039 fOnTime->setText(QString::number(sdata.fOnTimeCounter/1000000., 'f', 6)+" s"); 1040 1041 if (sdata.fTimeStamp>0) 1042 fOnTimeRel->setValue(100.*sdata.fOnTimeCounter/sdata.fTimeStamp); 1043 else 1044 fOnTimeRel->setValue(0); 1027 1045 1028 1046 fFtmTemp0->setValue(sdata.fTempSensor[0]*0.1); … … 1350 1368 SetFtuStatusLed(d.time); 1351 1369 1352 // Write to special window!1353 Out() << "Error:" << endl;1354 Out() << sdata.fError << endl;1370 // FIXME: Write to special window! 1371 //Out() << "Error:" << endl; 1372 //Out() << sdata.fError << endl; 1355 1373 } 1356 1374 … … 1375 1393 SetLedColor(fStatusFTMLed, kLedYellow, time); 1376 1394 if (s.index==FTM::kConnected || s.index==FTM::kIdle || s.index==FTM::kTakingData) // Dim connection / FTM connected 1377 {1378 1395 SetLedColor(fStatusFTMLed, kLedGreen, time); 1396 1397 if (s.index==FTM::kConnected || s.index==FTM::kIdle) // Dim connection / FTM connected 1379 1398 enable = true; 1380 }1381 1399 1382 1400 fTriggerWidget->setEnabled(enable); … … 1957 1975 #ifdef HAVE_ROOT 1958 1976 1977 fGraphFtmRate.SetLineColor(kBlue); 1978 fGraphFtmRate.SetMarkerColor(kBlue); 1979 fGraphFtmRate.SetMarkerStyle(kFullDotMedium); 1980 1959 1981 for (int i=0; i<160; i++) 1982 { 1960 1983 fGraphPatchRate[i].SetName("PatchRate"); 1984 fGraphPatchRate[i].SetLineColor(kBlue); 1985 fGraphPatchRate[i].SetMarkerColor(kBlue); 1986 fGraphPatchRate[i].SetMarkerStyle(kFullDotMedium); 1987 } 1961 1988 for (int i=0; i<40; i++) 1989 { 1962 1990 fGraphBoardRate[i].SetName("BoardRate"); 1991 fGraphBoardRate[i].SetLineColor(kBlue); 1992 fGraphBoardRate[i].SetMarkerColor(kBlue); 1993 fGraphBoardRate[i].SetMarkerStyle(kFullDotMedium); 1994 } 1963 1995 /* 1964 1996 TCanvas *c = fFtmTempCanv->GetCanvas();
Note:
See TracChangeset
for help on using the changeset viewer.