- Timestamp:
- 06/24/10 07:51:15 (15 years ago)
- Location:
- drsdaq
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
drsdaq/DAQReadout.cc
r226 r229 90 90 MinDelay = 1; 91 91 92 // Get configuration data 93 fRawDataPath = GetConfig("RawDataPath"); 94 fCalibDataPath = GetConfig("CalibDataPath"); 95 fFirstSample = atoi(GetConfig("FirstSample")); 96 fSamples = atoi(GetConfig("Samples")); 97 fMinDiskSpaceMB = atoi(GetConfig("MinDiskSpaceMB")); 98 fMaxFileSizeMB = atoi(GetConfig("MaxFileSizeMB")); 99 fDefaultFrequency = atof(GetConfig("DefaultFrequency")); 92 // Get configuration data (static needed for c_str() pointers to remain valid after constructor finished) 93 static std::string _RawDataPath = GetConfig("RawDataPath"); 94 static std::string _CalibDataPath = GetConfig("CalibDataPath"); 95 fRawDataPath = _RawDataPath.c_str(); 96 fCalibDataPath = _CalibDataPath.c_str(); 97 fFirstSample = atoi(GetConfig("FirstSample").c_str()); 98 fSamples = atoi(GetConfig("Samples").c_str()); 99 fMinDiskSpaceMB = atoi(GetConfig("MinDiskSpaceMB").c_str()); 100 fMaxFileSizeMB = atoi(GetConfig("MaxFileSizeMB").c_str()); 101 fDefaultFrequency = atof(GetConfig("DefaultFrequency").c_str()); 100 102 101 103 if (fFirstSample < 0 || fFirstSample > kNumberOfBins || fSamples > kNumberOfBins) { … … 1417 1419 1418 1420 // Return current available storage space in given directory 1419 int CheckDisk(c har *Directory) {1421 int CheckDisk(const char *Directory) { 1420 1422 struct statfs FileSystemStats; 1421 1423 -
drsdaq/DAQReadout.h
r226 r229 52 52 53 53 // Configuration data 54 c har *fCalibDataPath;55 c har *fRawDataPath;54 const char *fCalibDataPath; 55 const char *fRawDataPath; 56 56 int fMinDiskSpaceMB; // Minimum required disk space in MBytes 57 57 int fMaxFileSizeMB; // Maximum File size in Bytes … … 145 145 bool Match(const char*, const char*); 146 146 int ParseInput(char*, const char *Param[]); 147 int CheckDisk(c har*);147 int CheckDisk(const char*); 148 148 149 149 #endif -
drsdaq/HVFeedback.cc
r226 r229 22 22 }; 23 23 24 using namespace std; 25 24 26 // 25 27 // Constructor: Initialise feedback … … 45 47 46 48 // Get configuration data 47 fLedTrigBoard = atoi(m->GetConfig("TrigBoard")); 48 fLedTrigChannel = atoi(m->GetConfig("TrigChannel")); 49 fLedTrigChip = atoi(m->GetConfig("TrigChip")); 50 fLedTrigSample = atoi(m->GetConfig("TrigSample")); 51 fLedTrigThreshold = atoi(m->GetConfig("TrigThreshold")); 52 fLedSignalSample = atoi(m->GetConfig("SignalSample")); 53 fLedBaselineSample = atoi(m->GetConfig("BaselineSample")); 54 fIntHalfWidth = atoi(m->GetConfig("IntHalfWidth")); 55 fDefaultNumAverage = atoi(m->GetConfig("DefaultNumAverage")); 56 57 char *Token = strtok(m->GetConfig("DefaultResponse"), " \t"); 49 fLedTrigBoard = atoi(m->GetConfig("TrigBoard").c_str()); 50 fLedTrigChannel = atoi(m->GetConfig("TrigChannel").c_str()); 51 fLedTrigChip = atoi(m->GetConfig("TrigChip").c_str()); 52 fLedTrigSample = atoi(m->GetConfig("TrigSample").c_str()); 53 fLedTrigThreshold = atoi(m->GetConfig("TrigThreshold").c_str()); 54 fLedSignalSample = atoi(m->GetConfig("SignalSample").c_str()); 55 fLedBaselineSample = atoi(m->GetConfig("BaselineSample").c_str()); 56 fIntHalfWidth = atoi(m->GetConfig("IntHalfWidth").c_str()); 57 fDefaultNumAverage = atoi(m->GetConfig("DefaultNumAverage").c_str()); 58 59 vector<string> Token = m->Tokenize(m->GetConfig("DefaultResponse"), " \t"); 60 unsigned int N = 0; 58 61 for (int i=0; i<m->NumBoards; i++) { 59 62 for (int j=0; j<fNumberOfChips; j++) { 60 63 for (int k=0; k<fNumberOfChannels; k++) { 61 if (Token == NULL) break; 62 Response[i][j][k] = (float) atof(Token); 63 Token = strtok(NULL, " \t"); 64 if (N < Token.size()) Response[i][j][k] = (float) atof(Token[N++].c_str()); 64 65 } 65 66 } 66 67 } 67 68 68 Token = strtok(m->GetConfig("DefaultTarget"), " \t"); 69 Token = m->Tokenize(m->GetConfig("DefaultTarget"), " \t"); 70 N = 0; 69 71 for (int i=0; i<m->NumBoards; i++) { 70 72 for (int j=0; j<fNumberOfChips; j++) { 71 73 for (int k=0; k<fNumberOfChannels; k++) { 72 if (Token == NULL) break; 73 Target[i][j][k] = (float) atof(Token); 74 Token = strtok(NULL, " \t"); 74 if (N < Token.size()) Target[i][j][k] = (float) atof(Token[N++].c_str()); 75 75 } 76 76 } … … 87 87 88 88 // Initial state 89 Gain = atof(m->GetConfig("DefaultGain") );89 Gain = atof(m->GetConfig("DefaultGain").c_str()); 90 90 SetFBMode(FB_Off); 91 91 SetNumAverages(fDefaultNumAverage); -
drsdaq/HVFeedback.h
r226 r229 7 7 #include <math.h> 8 8 #include <sstream> 9 #include <vector> 9 10 10 11 #include "RawDataCTX.h"
Note:
See TracChangeset
for help on using the changeset viewer.