Changeset 10290
- Timestamp:
- 04/05/11 15:06:57 (14 years ago)
- Location:
- fact
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/FADctrl/FAD.cc
r10262 r10290 627 627 continue; 628 628 } 629 PrintMessage(" Last event received %s", ctime(&S.Update.tv_sec));629 PrintMessage("Event rate %.1f Hz Last event received %s", S.Rate, ctime(&S.Update.tv_sec)); 630 630 631 631 // Board identification -
fact/FADctrl/FADBoard.cc
r10279 r10290 24 24 Port = ServerPort; 25 25 Status.Frequency = 0; 26 Status.Rate = 0; 26 27 Status.BoardID = 0; 27 28 … … 51 52 DIM_Status = new DimService((ID.str()+"Status").c_str(), (char *) ""); 52 53 DIM_ID = new DimService((ID.str()+"BoardID").c_str(), (char *) "S", NULL, 0); 54 DIM_Rate = new DimService((ID.str()+"RateHz").c_str(), Status.Rate); 53 55 DIM_Frequency = new DimService((ID.str()+"Frequency").c_str(), Status.Frequency); 54 56 DIM_Temp = new DimService((ID.str()+"Temperature").c_str(), (char *) "F", NULL, 0); … … 85 87 delete DIM_Status; 86 88 delete DIM_ID; 89 delete DIM_Rate; 87 90 delete DIM_Frequency; 88 91 delete DIM_Temp; … … 347 350 348 351 char Buffer[READ_BUFFER_SIZE]; 349 unsigned int Pos = 0, Temp;352 unsigned int Pos = 0, Count = 0; 350 353 const PEVNT_HEADER *Header = (PEVNT_HEADER *) Buffer; 351 354 ssize_t Result; 352 355 struct sockaddr_in SocketAddress; 353 356 struct BoardStatus PrevStatus; 354 time_t LastUpdate = 0;355 357 int Ret; 356 358 … … 415 417 416 418 // Check if buffer starts with start_package_flag, remove data if not 417 Temp = 0;419 unsigned int Temp = 0; 418 420 while (ntohs(*((unsigned short *) (Buffer+Temp))) != 0xfb01 && Temp<Pos) Temp++; 419 421 if (Temp != 0) { … … 439 441 Pnt = (PCHANNEL *) ((short *) (Channel[i] + 1) + ntohs(Channel[i]->roi)); 440 442 } 441 442 PrevStatus = Status;443 443 444 444 // Wait until event thread processed the previous data and lock to avoid concurrent access in GetStatus() … … 505 505 // Prepare predicate for condition variable 506 506 Continue = false; 507 Count++; 507 508 Unlock(); 508 509 … … 511 512 512 513 // Update DIM services if necessary 513 if (time(NULL) - LastUpdate > m->EventUpdateDelay) { 514 LastUpdate = time(NULL); 514 if (Status.Update.tv_sec - PrevStatus.Update.tv_sec > m->EventUpdateDelay) { 515 516 // Determine event rate 517 Status.Rate = 518 Count / (double(Status.Update.tv_sec-PrevStatus.Update.tv_sec) + (Status.Update.tv_usec-PrevStatus.Update.tv_usec)/1000000.0); 519 Count = 0; 515 520 516 521 if (PrevStatus.Frequency != Status.Frequency) DIM_Frequency->updateService(); 517 522 523 if (PrevStatus.Rate != Status.Rate) DIM_Rate->updateService(); 524 518 525 if (memcmp(PrevStatus.Temp, Status.Temp, sizeof(Status.Temp)) != 0) { 519 526 DIM_Temp->updateService(Status.Temp, sizeof(Status.Temp)); … … 528 535 DIM_ID->updateService(&Status.BoardID, sizeof(Status.BoardID)); 529 536 } 537 538 PrevStatus = Status; 530 539 } 531 540 -
fact/FADctrl/FADBoard.h
r10279 r10290 28 28 int Socket; 29 29 pthread_mutex_t Mutex; 30 DimService *DIM_Name, *DIM_Status, *DIM_ID, *DIM_Frequency, *DIM_Temp, *DIM_ROI, *DIM_DAC; 30 DimService *DIM_Name, *DIM_Status, *DIM_ID, *DIM_Frequency; 31 DimService *DIM_Rate, *DIM_Temp, *DIM_ROI, *DIM_DAC; 31 32 32 33 void ReadLoop(); … … 48 49 char Message[STATUS_SIZE]; 49 50 struct timeval Update; 51 float Rate; 50 52 51 53 uint32_t TriggerID; -
fact/FADctrl/History.txt
r10279 r10290 20 20 29/3/2011 Added Status message service for each board (removed several console messages in turn) 21 21 Limited update rate of slow control data to 1 second or interval set by 'update' 22 1/4/2011 Added DIM frequency service 22 1/4/2011 Added DIM frequency service 23 5/4/2011 Added DIM rate service for each board -
fact/tools/Edd/Edd.cc
r10280 r10290 483 483 } 484 484 485 Line = new EddLineDisplay(Board+"RateHz"); 486 Line->setMinimumWidth(50); 487 Button[i/20]->Layout()->addWidget(Line, i+7, 15, 1, 1); 488 485 489 Line = new EddLineDisplay(Board+"Status"); 486 490 Line->setMaximumWidth(150); 487 Button[i/20]->Layout()->addWidget(Line, i+7, 1 5, 1, 1);491 Button[i/20]->Layout()->addWidget(Line, i+7, 16, 1, 1); 488 492 } 489 493 } … … 801 805 // Set features of main window 802 806 setStatusBar(new QStatusBar(this)); 803 setWindowTitle("Edd - Evidence Data Display ");807 setWindowTitle("Edd - Evidence Data Display - Node: " + QString(getenv("DIM_DNS_NODE"))); 804 808 setCentralWidget(TabWidget); 805 809
Note:
See TracChangeset
for help on using the changeset viewer.