00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <math.h>
00017
00018
00019 void TGo4AnalysisStatusMonitor::init()
00020 {
00021 setAcceptDrops(FALSE);
00022 QString moviepath=gSystem->Getenv("GO4SYS");
00023 moviepath+="/images/go4logorun4.gif";
00024 fxRunMovie=QMovie(moviepath);
00025 }
00026
00027 void TGo4AnalysisStatusMonitor::WorkWithRatemeter(TGo4Slot* slot)
00028 {
00029 AddLink(slot, "Ratemeter");
00030 }
00031
00032 void TGo4AnalysisStatusMonitor::linkedObjectUpdated( const char * linkname, TObject * obj )
00033 {
00034 TGo4AnalysisClientStatus* status = dynamic_cast<TGo4AnalysisClientStatus*> (obj);
00035 if (status==0) return;
00036 SourceLabel->setText(status->GetCurrentSource());
00037 double Rate = status->GetRate();
00038 if(Rate>10) LCDCurrentRate->display(floor(Rate));
00039 else LCDCurrentRate->display(Rate);
00040
00041 if(!status->IsAnalysisRunning())
00042 {
00043 LCDCurrentRate->setPaletteBackgroundColor(QColor(255,0,0));
00044 Go4Pix->setPixmap(QPixmap::fromMimeSource( "go4logo2.png" ));
00045 }
00046 else
00047 {
00048 LCDCurrentRate->setPaletteBackgroundColor(QColor(0,255,0));
00049 Go4Pix->clear();
00050 Go4Pix->setMovie(fxRunMovie);
00051 }
00052 if(status->GetAvRate()>10)
00053 LCDAverageRate->display(floor(status->GetAvRate()));
00054 else
00055 LCDAverageRate->display(status->GetAvRate());
00056
00057 LCDTime->display((int)status->GetTime());
00058
00059 LCDProcessedEvents->display((int)status->GetCurrentCount());
00060
00061 DateLabel->setText(status->GetDateTime());
00062 }
00063
00064 void TGo4AnalysisStatusMonitor::linkedObjectRemoved(const char * linkname)
00065 {
00066
00067
00068 if (Browser())
00069 Browser()->ToggleMonitoring(0);
00070
00071 ShootCloseWidget();
00072 }
00073
00074