Changeset 10118 for fact/BIASctrl/User.cc
- Timestamp:
- 01/25/11 09:47:27 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/BIASctrl/User.cc
r10107 r10118 16 16 } CommandList[] = 17 17 {{"synch", &User::cmd_synch, 0, "", "Synchronize board"}, 18 {"hv", &User::cmd_hv, 2, "<id>|<ch>|<all> <v>", "Change bias of pixel or (all) chan. of active boards"}, 18 {"pixel", &User::cmd_hv, 2, "<pixel id> <v>", "Change bias of pixel"}, 19 {"channel", &User::cmd_hv, 2, "<channel|all> <v>", "Change bias of (all) channels of active boards"}, 19 20 {"gs", &User::cmd_gs, 1, "[crate] <volt>", "Global voltage set"}, 20 21 {"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"},22 22 {"mode", &User::cmd_mode, 1, "<static|dynamic>", "Set voltage stabilization mode"}, 23 23 {"load", &User::cmd_load, 1, "<file>", "Load and set bias settings from file"}, … … 63 63 } 64 64 65 // Create instances 66 pm = new PixelMap(GetConfig("PixMapTable")); 65 // Create PixelMap instance (map from config server) 66 DimRpcInfo RPC((char *) "ConfigRequest", (char *) ""); 67 RPC.setData((char *) "Misc PixelMap"); 68 PixMap = new PixelMap(std::string(RPC.getString(), RPC.getSize())); 67 69 68 70 // Install DIM command (after all initialized) … … 90 92 91 93 delete DIMCommand; 92 delete pm;94 delete PixMap; 93 95 delete ConsoleOut; 94 96 free(ConsoleText); … … 169 171 for (unsigned int n=1; n < Parameter.size()-1; n+=2) { 170 172 171 // Extract channel identification 172 if (pm->Pixel_to_HVboard(Parameter[n]) != 999999999) { 173 Crt.Min = Crt.Max = pm->Pixel_to_HVboard(Parameter[n]); 174 Chan.Min = Chan.Max = pm->Pixel_to_HVchain(Parameter[n])*NUM_CHANNELS + pm->Pixel_to_HVchannel(Parameter[n]); 175 } 173 // Pixel identification? 174 if (Match(Parameter[0], "pixel")) { 175 // Skip if first character is not digit 176 if (isdigit(Parameter[n][0] == 0)) continue; 177 // Skip if pixel ID not existing 178 if (PixMap->Pixel_to_HVcrate(atoi(Parameter[n].c_str())) == PixMap->PM_ERROR_CODE) continue; 179 180 Crt.Min = Crt.Max = PixMap->Pixel_to_HVcrate(atoi(Parameter[n].c_str())); 181 Chan.Min = Chan.Max = PixMap->Pixel_to_HVboard(atoi(Parameter[n].c_str()))*NUM_CHANNELS + PixMap->Pixel_to_HVchannel(atoi(Parameter[n].c_str())); 182 } 183 // Channel identification 176 184 else { 177 185 vector<string> T = Tokenize(Parameter[n], "/"); … … 181 189 Chan.Max = MAX_NUM_BOARDS*NUM_CHANNELS-1; 182 190 183 if (Parameter[n] == "-") continue;184 185 191 if (T.size() == 2) { 186 192 if(!ConvertToRange(T[0], Crt) || !ConvertToRange(T[1], Chan)) { … … 204 210 } 205 211 206 207 212 // Loop over given crates and channels 208 213 for (int i=Crt.Min; i<=Crt.Max; i++) for (int j=Chan.Min; j<=Chan.Max; j++) { … … 342 347 } 343 348 } 344 }345 346 //347 // Determine current measurement offset348 //349 void User::cmd_ccal() {350 351 double Voltage;352 353 if (!ConvertToDouble(Parameter[1], &Voltage)) {354 PrintMessage("Error with format of voltage parameter\n");355 return;356 }357 358 // Execute current offset determination359 for (unsigned int i=0; i<Crates.size(); i++) {360 if (!Crates[i]->CurrentCalib(Voltage)) {361 PrintMessage("Error with current calibration of crate %d\n", i);362 return;363 }364 365 PrintMessage("Current calibration of crate %d done\n", i);366 }367 349 } 368 350
Note:
See TracChangeset
for help on using the changeset viewer.