Changeset 10052
- Timestamp:
- 11/17/10 15:30:16 (14 years ago)
- Location:
- fact/BIASctrl
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/BIASctrl/BIASctrl.cc
r10049 r10052 72 72 73 73 // Install signal handler and set signal SIGUSR1 to interrupt blocking system calls 74 signal(SIGUSR1, &DummyHandler);75 siginterrupt (SIGUSR1, true);74 //signal(SIGUSR1, &DummyHandler); 75 //siginterrupt (SIGUSR1, true); 76 76 77 77 // Assure lock file is deleted in case of a program crash or call to exit() -
fact/BIASctrl/Crate.cc
r10049 r10052 19 19 // Initialize 20 20 InitOK = false; 21 File = NULL; 21 22 m = PIO; 22 23 Name = new char [CrateName.size()+1]; … … 50 51 return; 51 52 } 53 54 // Generate FILE pointer 55 if ((File = fdopen(fDescriptor, "rb+")) == NULL) { 56 m->PrintMessage("Error: fdopen() failed on device %d/%s (%s)\n", CrateNumber, Name, strerror(errno)); 57 return; 58 } 52 59 53 60 // Get current serial port settings … … 77 84 78 85 if(fDescriptor != -1) { 86 GlobalSet(0); 87 79 88 SystemReset(); 80 if (close(fDescriptor) == -1) m->PrintMessage("Error closing device %s (%s)\n", Name, strerror(errno));; 89 if (File == NULL) { 90 if (close(fDescriptor) == -1) m->PrintMessage("Error closing device %s (%s)\n", Name, strerror(errno)); 91 } 92 else if (fclose(File) != 0) m->PrintMessage("Error closing device %s\n", Name); 81 93 } 82 94 … … 90 102 // 91 103 // Returns: 0 error, 1 success, -1 time-out exceeded 92 intCrate::Communicate(unsigned char* wbuf, int Bytes) {93 94 int N , Ret = 0;104 vector<char> Crate::Communicate(unsigned char* wbuf, int Bytes) { 105 106 int N; 95 107 fd_set SelectDescriptor; 96 108 struct timeval WaitTime = {(long) m->fTimeOut, (long) ((m->fTimeOut-(long) m->fTimeOut)*1e6)}; 97 98 // === Lock file descriptor === 99 if (lockf(fDescriptor, F_LOCK, 0) == -1) { 100 m->Message(m->ERROR, "Failed to lock file descriptor (%s)", strerror(errno)); 101 return 0; 102 } 103 109 char Buffer[10000]; 110 vector<char> Data; 111 112 // === Lock device === 113 flockfile(File); 114 104 115 // === Write data === 105 116 if ((N = write(fDescriptor, wbuf, Bytes)) < Bytes) { … … 110 121 } 111 122 112 // === Try to read until time-out === 113 FD_ZERO(&SelectDescriptor); FD_SET(fDescriptor, &SelectDescriptor); 114 if (select(fDescriptor+1, &SelectDescriptor, NULL, NULL, &WaitTime)==-1) { 115 m->Message(m->ERROR, "Error with select() (%s)", strerror(errno)); 123 // === Try to read back data with time-out === 124 do { 125 FD_ZERO(&SelectDescriptor); FD_SET(fDescriptor, &SelectDescriptor); 126 if (select(fDescriptor+1, &SelectDescriptor, NULL, NULL, &WaitTime)==-1) { 127 m->Message(m->ERROR, "Error with select() (%s)", strerror(errno)); 128 goto ExitCommunicate; 129 } 130 131 // Time-out expired? 132 if (!FD_ISSET(fDescriptor, &SelectDescriptor)) { 133 Data.push_back(-1); 134 goto ExitCommunicate; 135 } 136 137 // Read data 138 if ((N = read(fDescriptor, Buffer, sizeof(Buffer))) == -1) { 139 m->Message(m->ERROR, "Read error (%s)", strerror(errno)); 140 ErrorCount++; 141 goto ExitCommunicate; 142 } 143 144 // Add data to buffer 145 for (int i=0; i<N; i++) Data.push_back(Buffer[i]); 146 } while(Data.size() < (unsigned int) Bytes); 147 148 // === Check if multiple of three bytes were returned === 149 if (Data.size() % 3 != 0) { 150 Data.clear(); 116 151 goto ExitCommunicate; 117 152 } 118 153 119 // Time-out expired? 120 if (!FD_ISSET(fDescriptor, &SelectDescriptor)) { 121 Ret = -1; 122 goto ExitCommunicate; 123 } 124 125 // Read data 126 if ((N = read(fDescriptor, ReadBuffer, sizeof(ReadBuffer))) == -1) { 127 m->Message(m->ERROR, "Read error (%s)", strerror(errno)); 128 ErrorCount++; 129 goto ExitCommunicate; 130 } 131 132 // === Check wrap counter if three bytes were returned === 133 if (N == 3) { 154 // === Check/update all wrap counter === 155 for (unsigned int i=0; i<Data.size(); i+=3) { 134 156 if (WrapCount != -1) { 135 if ((WrapCount+1)%8 == (( ReadBuffer[0]>>4) & 7)) WrapOK = true;157 if ((WrapCount+1)%8 == ((Data[i]>>4) & 7)) WrapOK = true; 136 158 else WrapOK = false; 137 159 } 138 WrapCount = (ReadBuffer[0]>>4) & 7; 139 Ret = 1; 140 } 141 160 WrapCount = (Data[i]>>4) & 7; 161 } 162 142 163 // === UnLock file descriptor === 143 164 ExitCommunicate: 144 if (lockf(fDescriptor, F_ULOCK, 0) == -1) { 145 m->Message(m->ERROR, "Failed to unlock file descriptor (%s)", strerror(errno)); 146 return 0; 147 } 148 149 return Ret; 165 funlockfile(File); 166 167 if (Data.empty()) Data.push_back(0); 168 169 return Data; 150 170 } 151 171 … … 156 176 157 177 unsigned char wbuf[] = {0,0,0}; 158 int ret;159 160 if ((ret = Communicate(wbuf, 3)) == 1) {178 vector<char> Data = Communicate(wbuf, 3); 179 180 if (Data.size() == 3) { 161 181 ClearVoltageArrays(); 162 182 ErrorCount = 0; 163 } 164 return ret; 183 return 1; 184 } 185 return Data[0]; 165 186 } 166 187 … … 181 202 182 203 // Execute command 183 unsigned char wbuf[] = {1<<5 | Board<<1 | (Channel&16)>>4, Channel<<4, 0}; 184 int ret; 204 unsigned char wbuf[] = {1<<5 | Board<<1 | (Channel&16)>>4, Channel<<4, 0}; 205 vector<char> Data = Communicate(wbuf, 3); 206 207 if (Data.size() == 3) { 208 Current[Board][Channel] = Data[1] + (Data[0]&15)*256; 209 OC[Board][Channel] = Data[0] & 128; 210 ResetHit = Data[2] & 128; 211 if (Board==2 && Channel==19) OC[Board][Channel] = false; 212 return 1; 213 } 214 return Data[0]; 215 } 216 217 218 // 219 // Read all channels status 220 // 221 int Crate::ReadAll() { 222 223 unsigned char wbuf[3*MAX_NUM_BOARDS*NUM_CHANNELS]; 224 int Count = 0; 225 226 // Prepare command to read all channels 227 for (int i=0; i<MAX_NUM_BOARDS; i++) for (int j=0; j<NUM_CHANNELS; j++) { 228 wbuf[Count++] = 1<<5 | i<<1 | (j&16)>>4; 229 wbuf[Count++] = j<<4; 230 wbuf[Count++] = 0; 231 } 232 233 // Execute command 234 vector<char> Data = Communicate(wbuf, 3*MAX_NUM_BOARDS*NUM_CHANNELS); 185 235 186 if ((ret = Communicate(wbuf, 3)) == 1) { 187 Current[Board][Channel] = ReadBuffer[1] + (ReadBuffer[0]&15)*256; 188 OC[Board][Channel] = ReadBuffer[0] & 128; 189 ResetHit = ReadBuffer[2] & 128; 190 } 191 return ret; 236 if (Data.size() != 3*MAX_NUM_BOARDS*NUM_CHANNELS) return Data[0]; 237 238 //Evaluate returned data 239 Count = 0; 240 for (int i=0; i<MAX_NUM_BOARDS; i++) for (int j=0; j<NUM_CHANNELS; j++) { 241 Current[i][j] = Data[Count+1] + (Data[Count]&15)*256; 242 OC[i][j] = Data[Count] & 128; 243 ResetHit = Data[Count+2] & 128; 244 Count += 3; 245 if (i==2 && j==19) OC[i][j] = false; 246 } 247 return 1; 192 248 } 193 249 … … 204 260 // Execute command 205 261 unsigned char wbuf[] = {1<<6 , SetPoint>>8, SetPoint}; 206 int ret; 207 208 if ((ret = Communicate(wbuf, 3)) == 1) { 209 for (int i=0; i<MAX_NUM_BOARDS; i++) { 210 for (int j=0; j<NUM_CHANNELS; j++) { 211 DAC[i][j] = SetPoint; 212 Volt[i][j] = (double) SetPoint / 0xfff * 90; 213 } 214 } 215 } 216 return ret; 262 vector<char> Data = Communicate(wbuf, 3); 263 264 if (Data.size() == 3) { 265 for (int i=0; i<MAX_NUM_BOARDS; i++) for (int j=0; j<NUM_CHANNELS; j++) { 266 DAC[i][j] = SetPoint; 267 Volt[i][j] = (double) SetPoint / 0xfff * 90; 268 } 269 return 1; 270 } 271 return Data[0]; 217 272 } 218 273 … … 237 292 // Execute command 238 293 unsigned char wbuf[] = {3<<5 | Board<<1 | (Channel&16)>>4, Channel<<4 | SetPoint>>8, SetPoint}; 239 int ret;294 vector<char> Data = Communicate(wbuf, 3); 240 295 241 if ( (ret = Communicate(wbuf, 3)) == 1) {296 if (Data.size() == 3) { 242 297 DAC[Board][Channel] = SetPoint; 243 298 Volt[Board][Channel] = (double) SetPoint / 0xfff * 90; 244 } 245 return ret; 299 return 1; 300 } 301 return Data[0]; 302 } 303 304 305 // ***** Channel set ***** 306 int Crate::SetAll() { 307 308 unsigned char wbuf[3*MAX_NUM_BOARDS*NUM_CHANNELS]; 309 double Volt = 10; 310 int Count=0; 311 for (int i=0; i<MAX_NUM_BOARDS; i++) for (int j=0; j<NUM_CHANNELS; j++) { 312 wbuf[Count++] = 3<<5 | i<<1 | (j&16)>>4; 313 wbuf[Count++] = j<<4 | ((int) (Volt/90*0x0fff))>>8; 314 wbuf[Count++] = (int) (Volt/90*0x0fff); 315 Volt += 0.2; 316 } 317 318 // Execute command 319 vector<char> Data = Communicate(wbuf, 3*MAX_NUM_BOARDS*NUM_CHANNELS); 320 321 if (Data.size() == 3*MAX_NUM_BOARDS*NUM_CHANNELS) { 322 //DAC[Board][Channel] = SetPoint; 323 //Volt[Board][Channel] = (double) SetPoint / 0xfff * 90; 324 return 1; 325 } 326 return Data[0]; 246 327 } 247 328 … … 251 332 252 333 unsigned char wbuf = 0; 253 int Trial = 0, ret; 254 334 int Trial = 0; 335 vector<char> Data; 336 255 337 while(++Trial <= 3) { 256 if((ret = Communicate(&wbuf, 1)) == 1) return true; 257 if (ret == 0) break; 338 Data = Communicate(&wbuf, 1); 339 if (Data.size() == 3) return true; 340 if (Data[0] == 0) break; 258 341 } 259 342 return false; 343 } 344 345 346 // ***** Determine offset for current measurement ***** 347 bool Crate::CurrentCalib(double Voltage) { 348 349 // Set voltage of all channels and wait for current to settle 350 if (GlobalSet((int) (Voltage/90*0xfff)) != 1) return false; 351 sleep(1); 352 353 // Measure current of all channels 354 if (ReadAll() != 1) return false; 355 356 for (int i=0; i<MAX_NUM_BOARDS; i++) for (int j=0; j<NUM_CHANNELS; j++) { 357 CurrentOffset[i][j] = Current[i][j]; 358 } 359 return true; 260 360 } 261 361 -
fact/BIASctrl/Crate.h
r10049 r10052 9 9 #include <sys/ioctl.h> 10 10 #include <string> 11 #include <vector> 11 12 12 13 #include "dis.hxx" … … 22 23 class User *m; 23 24 int CrateNumber; 24 int fDescriptor; 25 int fDescriptor; 26 FILE *File; 25 27 DimService *NameService; 26 char ReadBuffer[3];27 28 28 intCommunicate(unsigned char*, int);29 std::vector<char> Communicate(unsigned char*, int); 29 30 void ClearVoltageArrays(); 30 31 … … 45 46 int DAC[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in DAC units 46 47 double Volt[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in Volt 48 int CurrentOffset[MAX_NUM_BOARDS][NUM_CHANNELS]; // Offset for current measurement 47 49 48 50 bool InitOK; 49 51 52 int SetAll(); 53 int ReadAll(); 50 54 int SystemReset(); 51 55 int ReadChannel(unsigned int, unsigned int); … … 53 57 int ChannelSet(int, int, unsigned int); 54 58 bool Synch(); 59 bool CurrentCalib(double); 55 60 }; 56 61 -
fact/BIASctrl/History.txt
r9917 r10052 2 2 program 'hvcontrol' (revision 9852). 3 3 20/8/2010 Removed the possibility to set DAC values. 4 17/11/2010 Added possibility for bulk transfers (ReadAll(), SetAll()) -
fact/BIASctrl/User.cc
r10049 r10052 4 4 5 5 #include "User.h" 6 #include <readline/readline.h> 6 7 7 8 using namespace std; … … 17 18 {"hv", &User::cmd_hv, 2, "<id>|<ch>|<all> <v>", "Change bias of pixel or (all) chan. of active boards"}, 18 19 {"gs", &User::cmd_gs, 1, "[crate] <volt>", "Global voltage set"}, 19 {"status", &User::cmd_status, 0, "[dac]", "Show status information (DAC values if requested)"}, 20 {"status", &User::cmd_status, 0, "[dac|current]", "Show status information (DAC values if requested)"}, 21 {"ccal", &User::cmd_ccal, 1, "<volt>", "Calibrate current measurement at given voltage"}, 20 22 {"load", &User::cmd_load, 1, "<file>", "Load and set bias settings from file"}, 21 23 {"save", &User::cmd_save, 1, "<file>", "Save current bias settings to file"}, 22 {"exit", &User::cmd_exit, 0, "", "Exit program"},23 24 {"rate", &User::cmd_rate, 1, "<rate>", "Set refresh rate in Hz"}, 24 25 {"timeout", &User::cmd_timeout, 1, "<time>", "Set timeout to return from read in seconds"}, 25 26 {"reset", &User::cmd_reset, 1, "<crates>", "Reset crates"}, 26 {"help", &User::cmd_help, 0, "", "Print help"}}; 27 {"help", &User::cmd_help, 0, "", "Print help"}, 28 {"exit", &User::cmd_exit, 0, "", "Exit program"}}; 27 29 28 30 … … 77 79 // 78 80 User::~User() { 79 81 80 82 // Wait for thread to quit 81 83 if (pthread_join(Thread, NULL) != 0) { … … 170 172 else { 171 173 vector<string> T = Tokenize(Parameter[n], "/"); 174 Crt.Min = 0; 175 Crt.Max = Crates.size()-1; 176 Chan.Min = 0; 177 Chan.Max = MAX_NUM_BOARDS*NUM_CHANNELS-1; 178 172 179 if (T.size() == 2) { 173 Crt = ConvertToRange(T[0]); 174 Chan = ConvertToRange(T[1]); 180 if(!ConvertToRange(T[0], Crt) || !ConvertToRange(T[1], Chan)) { 181 PrintMessage("Numeric conversion or out-of-range error for parameter %d, skipping channel\n", n); 182 continue; 183 } 175 184 } 176 185 else { 177 186 Crt.Min = Crt.Max = 0; 178 Chan = ConvertToRange(T[0]); 187 if (!ConvertToRange(T[0], Chan)) { 188 PrintMessage("Numeric conversion or out-of-range error for parameter %d, skipping channel\n", n); 189 continue; 190 } 179 191 } 180 192 } 181 193 182 // Check validity of ranges183 if (Crt.Min < 0 || Chan.Min < 0 || Crt.Max >= (int) Crates.size() || Chan.Max >= MAX_NUM_BOARDS*NUM_CHANNELS) {184 PrintMessage("Numeric conversion or out-of-range error for parameter %d, skipping channel\n", n);185 continue;186 }187 188 194 // Convert voltage value and check format 189 195 if (!ConvertToDouble(Parameter[n+1], &Double)) { … … 304 310 void User::cmd_reset() { 305 311 306 struct Range R = ConvertToRange(Parameter[1]); 307 308 for (int i=0; i<(int) Crates.size(); i++) if (i>= R.Min && i<=R.Max) { 312 struct Range R = {0, Crates.size()-1}; 313 314 // Check ranges 315 if(!ConvertToRange(Parameter[1], R)) { 316 PrintMessage("Error, crate number out of range\n"); 317 return; 318 } 319 320 for (int i=R.Min; i<=R.Max; i++) { 309 321 if (Crates[i]->SystemReset() == 1) PrintMessage("System reset of crate %s (#%d)\n", Crates[i]->Name, i); 310 322 else PrintMessage("Error: Could not reset board %s (#%d)\n", Crates[i]->Name, i); … … 322 334 323 335 if (Crates[0]->GlobalSet((int) (Voltage/90*0xfff)) != 1) { 324 printf("Error: Could not global set board %d\n", 0);336 PrintMessage("Error: Could not global set board %d\n", 0); 325 337 } 338 } 339 340 // 341 // Determine current measurement offset 342 // 343 void User::cmd_ccal() { 344 345 double Voltage; 346 347 if (!ConvertToDouble(Parameter[1], &Voltage)) { 348 PrintMessage("Error with format of voltage parameter\n"); 349 return; 350 } 351 352 // Execute current offset determination 353 if (!Crates[0]->CurrentCalib(Voltage)) { 354 PrintMessage("Error with current calibration of board %d\n", 0); 355 return; 356 } 357 358 PrintMessage("Current calibration of board %d done\n", 0); 326 359 } 327 360 … … 370 403 Crates[i]->ResetHit ? "yes" : "no", Crates[i]->ErrorCount); 371 404 405 if (Parameter.size() == 1) PrintMessage("Channel voltages (in V)"); 406 else if (Match(Parameter[1], "dac")) PrintMessage("Channel voltages (in DAC values)"); 407 else PrintMessage("Channel currents (in uA)"); 408 372 409 for (int j=0; j<MAX_NUM_BOARDS*NUM_CHANNELS; j++) { 373 410 if (j%12 == 0) PrintMessage("\n%3.1d: ", j); 374 if (Parameter.size() == 2) PrintMessage("%5d ", Crates[i]->DAC[j/NUM_CHANNELS][j%NUM_CHANNELS]);375 else PrintMessage("%#5.2f ",Crates[i]->Volt[j/NUM_CHANNELS][j%NUM_CHANNELS]);376 //PrintMessage(" (%#5.2f %s) ", Crates[i]->Current[j/NUM_CHANNELS][j%NUM_CHANNELS], Crates[i]->OC[j/NUM_CHANNELS][j%NUM_CHANNELS] ? "OC":"");411 if (Parameter.size() == 1) PrintMessage("%#5.2f ",Crates[i]->Volt[j/NUM_CHANNELS][j%NUM_CHANNELS]); 412 else if (Match(Parameter[1], "dac")) PrintMessage("%5d ", Crates[i]->DAC[j/NUM_CHANNELS][j%NUM_CHANNELS]); 413 else PrintMessage("%#5.2f %s ", (Crates[i]->Current[j/NUM_CHANNELS][j%NUM_CHANNELS]-Crates[i]->CurrentOffset[j/NUM_CHANNELS][j%NUM_CHANNELS])*1.2, Crates[i]->OC[j/NUM_CHANNELS][j%NUM_CHANNELS] ? "OC":""); 377 414 } 378 415 PrintMessage("\n"); … … 402 439 403 440 ExitRequest = true; 404 pthread_kill(Thread, SIGUSR1); 441 //pthread_kill(Thread, SIGUSR1); 442 //pthread_cancel(Thread); 405 443 } 406 444 … … 421 459 422 460 // Print to console 423 if(strlen(Text)>0 && Text[strlen(Text)-1]=='\n') printf("\r%s%s", Text, "\rBias> "); // New prompt 424 else printf("%s", Text); 461 printf("%s", Text); // New prompt 425 462 fflush(stdout); 463 if (strlen(Text)>0 && Text[strlen(Text)-1]=='\n') rl_on_new_line(); // New prompt 426 464 427 465 // Send to DIM text service … … 458 496 459 497 static bool Warned = false; 460 return; 498 461 499 while (!ExitRequest) { 462 500 for (unsigned int i=0; i<Crates.size(); i++) { … … 470 508 471 509 if (Crates[i]->ResetHit) { 472 Message(INFO, "Manual reset of board %d", i); 510 Message(INFO, "Manual reset of board %d, setting voltages to zero and issuing system reset", i); 511 Crates[i]->GlobalSet(0); 473 512 Crates[i]->SystemReset(); 474 513 } … … 478 517 } 479 518 519 if (Crates[i]->ReadAll() != 1) { 520 Message(ERROR, "Monitor could not read status from crate %d", i); 521 continue; 522 } 523 480 524 for (int j=0; j<MAX_NUM_BOARDS*NUM_CHANNELS; j++) { 481 if (Crates[i]->ReadChannel(j/NUM_CHANNELS, j%NUM_CHANNELS) != 1) {482 Message(ERROR, "Monitor could not read status of crate %d, board %d, channel %d", i, j/NUM_CHANNELS, j%NUM_CHANNELS);483 continue;484 }485 525 if (Crates[i]->OC[j/NUM_CHANNELS][j%NUM_CHANNELS]) { 486 Message(WARN, "Overcurrent on crate %d, board %d, channel %d, resetting board", i, j/NUM_CHANNELS, j%NUM_CHANNELS); 526 Message(WARN, "Overcurrent on crate %d, board %d, channel %d, setting voltage to zero", i, j/NUM_CHANNELS, j%NUM_CHANNELS); 527 Crates[i]->ChannelSet(j/NUM_CHANNELS, j%NUM_CHANNELS, 0); 487 528 Crates[i]->SystemReset(); 488 529 } … … 505 546 // Check if two strings match (min 1 character must match) 506 547 // 507 bool Match(string str, const char *cmd) {548 bool User::Match(string str, const char *cmd) { 508 549 509 550 return strncasecmp(str.c_str(),cmd,strlen(str.c_str())==0 ? 1:strlen(str.c_str())) ? false:true; … … 514 555 // 515 556 // Return false if conversion did not stop on whitespace or EOL character 516 bool ConvertToDouble(string String, double *Result) {557 bool User::ConvertToDouble(string String, double *Result) { 517 558 518 559 char *EndPointer; … … 523 564 } 524 565 525 bool ConvertToInt(string String, int *Result) {566 bool User::ConvertToInt(string String, int *Result) { 526 567 527 568 char *EndPointer; … … 535 576 // Interprets a range 536 577 // 537 struct Range ConvertToRange(string String) {538 539 struct Range R;578 bool User::ConvertToRange(string String, struct User::Range &R) { 579 580 int N, M; 540 581 541 582 // Full range 542 if (Match(String, "all")) { 543 R.Min = 0; 544 R.Max = std::numeric_limits<int>::max(); 545 return R; 546 } 583 if (Match(String, "all")) return true; 547 584 548 585 // Single number 549 if (ConvertToInt(String, &R.Min)) { 550 R.Max = R.Min; 551 return R; 586 if (ConvertToInt(String, &N)) { 587 if (N>= R.Min && N<=R.Max) { 588 R.Max = R.Min = N; 589 return true; 590 } 591 return false; 552 592 } 553 593 554 594 // Range a-b 555 595 vector<string> V = EvidenceServer::Tokenize(String, "-"); 556 if (V.size() == 2 && ConvertToInt(V[0], &R.Min) && ConvertToInt(V[1], &R.Max)) return R; 557 558 R.Min = R.Max = -1; 559 return R; 560 } 596 if (V.size()==2 && ConvertToInt(V[0], &N) && ConvertToInt(V[1], &M) && N>=R.Min && M<=R.Max) { 597 R.Min = N; 598 R.Max = M; 599 return true; 600 } 601 602 return false; 603 } -
fact/BIASctrl/User.h
r10049 r10052 35 35 void commandHandler(); 36 36 37 struct Range { 38 int Min; 39 int Max; 40 }; 41 42 bool Match(std::string, const char *); 43 bool ConvertToDouble(std::string, double *); 44 bool ConvertToInt(std::string, int *); 45 bool ConvertToRange(std::string, struct Range &); 46 37 47 public: 38 48 double fTimeOut; … … 53 63 void cmd_exit(); void cmd_rate(); 54 64 void cmd_timeout(); void cmd_reset(); 55 void cmd_help(); 65 void cmd_help(); void cmd_ccal(); 56 66 }; 57 67 58 struct Range {59 int Min;60 int Max;61 };62 63 bool Match(std::string, const char *);64 bool ConvertToDouble(std::string, double *);65 bool ConvertToInt(std::string, int *);66 struct Range ConvertToRange(std::string);67 68 68 #endif
Note:
See TracChangeset
for help on using the changeset viewer.