Changeset 229 for drsdaq/HVFeedback.cc
- Timestamp:
- 06/24/10 07:51:15 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.