Changeset 10903
- Timestamp:
- 06/03/11 13:34:49 (13 years ago)
- Location:
- fact/drsdaq
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/drsdaq/DAQReadout.cc
r274 r10903 46 46 {"uptime", &DAQReadout::cmd_uptime, false, "", "Get DAQ uptime"}, 47 47 {"update", &DAQReadout::cmd_update, false, "<sec>", "Minimum delay between updates to DIM event service"}, 48 {"write", &DAQReadout::cmd_write, true, "<chips> <channels>", "Select number of chips and channels to write to disk"}, 48 49 {"exit", &DAQReadout::cmd_exit, false, "", "Exit program"}, 49 50 {"help", &DAQReadout::cmd_help, false, "", "Print help"}}; … … 79 80 MinDelay = 1; 80 81 RunNumber = -1; 82 ChipsToWrite = kNumberOfChipsMax; 83 ChannelsToWrite = kNumberOfChannelsMax; 81 84 82 85 // Get configuration data (static needed for c_str() pointers to remain valid after constructor finished) … … 205 208 // Get uptime 206 209 void DAQReadout::cmd_uptime() { 210 207 211 time_t ActualT; 208 time (&ActualT); 212 213 time(&ActualT); 209 214 PrintMessage("%02d:%02d:%02d\n", (int) difftime(ActualT, StartTime)/3600, ((int) difftime(ActualT, StartTime)/60)%60, (int) difftime(ActualT, StartTime)%60); 210 215 } … … 212 217 // Print disk space 213 218 void DAQReadout::cmd_disk() { 219 214 220 PrintMessage("Free disk space (%s) [MB]: %lu\n", fRawDataPath, CheckDisk(fRawDataPath)); 215 221 } … … 217 223 // Print current number of events 218 224 void DAQReadout::cmd_events() { 225 219 226 if(daq_state != active) PrintMessage("DAQ not active\n"); 220 227 else PrintMessage("Current number of events: %d (of %d requested)\n", NumEvents, NumEventsRequested); … … 620 627 // Set DRS sampling frequency 621 628 void DAQReadout::cmd_freq() { 629 622 630 if (NParam>=2 && atof(Param[1])) { 623 631 SetDRSFrequency(atof(Param[1]), NParam==2 ? false : true); … … 628 636 // Set LED 629 637 void DAQReadout::cmd_led() { 638 630 639 if (Match(Param[1], "on") || Match(Param[1], "off")) 631 640 for (int i=FirstBoard; i<=LastBoard; i++) … … 719 728 } 720 729 730 // Select chips and channels to write to disk 731 void DAQReadout::cmd_write() { 732 733 int Chips, Chans; 734 735 if (NParam != 3) { 736 PrintUsage(); 737 return; 738 } 739 740 Chips = atoi(Param[1]); 741 Chans = atoi(Param[2]); 742 743 if (Chips<1 || Chips>kNumberOfChipsMax || Chans<1 || Chans>kNumberOfChannelsMax) { 744 PrintMessage("Number of chips or channels out of range\n"); 745 return; 746 } 747 748 ChipsToWrite = Chips; 749 ChannelsToWrite = Chans; 750 } 751 721 752 // Adress DRS boards 722 753 void DAQReadout::cmd_board() { … … 993 1024 994 1025 RHeader->NBoards = NumBoards==0 && daq_runtype==test ? 1 : (LastBoard - FirstBoard) + 1; 995 RHeader->NChips = NumBoards==0 ? kNumberOfChipsMax : GetBoard(0)->GetNumberOfChips();996 RHeader->NChannels = NumBoards==0 ? kNumberOfChannelsMax : GetBoard(0)->GetNumberOfChannels();1026 RHeader->NChips = NumBoards==0 ? kNumberOfChipsMax : std::min(GetBoard(0)->GetNumberOfChips(), ChipsToWrite); 1027 RHeader->NChannels = NumBoards==0 ? kNumberOfChannelsMax : std::min(GetBoard(0)->GetNumberOfChannels(), ChannelsToWrite); 997 1028 RHeader->NBytes = sizeof(short); 998 1029 -
fact/drsdaq/DAQReadout.h
r274 r10903 17 17 #include <sys/vfs.h> 18 18 #include <sys/time.h> 19 #include <algorithm> 19 20 20 21 #include "RawDataCTX.h" … … 88 89 int FirstBoard; 89 90 int LastBoard; 91 int ChipsToWrite; 92 int ChannelsToWrite; 93 90 94 float *DRSFreq; // DRS sampling frequency [GHz] 91 95 bool *ACalib; … … 101 105 void cmd_acalib(); void cmd_serial(); 102 106 void cmd_trigger(); void cmd_centre(); 103 void cmd_refclk(); 107 void cmd_refclk(); void cmd_write(); 104 108 void cmd_wmode(); void cmd_rmode(); 105 109 void cmd_dmode(); void cmd_read(); -
fact/drsdaq/History.txt
r274 r10903 74 74 drsdaq is 264. 75 75 30/7/2010 Published some run-related information as DIM service. 76 3/6/2011 Added 'write' command (for PEBS application) 76 77
Note:
See TracChangeset
for help on using the changeset viewer.