Changeset 11362 for fact/BIASctrl
- Timestamp:
- 07/12/11 17:13:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/BIASctrl/User.cc
r11361 r11362 15 15 const char *Help; 16 16 } CommandList[] = 17 {{"pixel", &User::cmd_hv, 2, "<pix el id> <volt|default>", "Change bias of pixel"},18 {"channel", &User::cmd_hv, 2, "< channel range> <v>", "Change bias of (all) channels of active crate"},17 {{"pixel", &User::cmd_hv, 2, "<pix id> <volt|default>", "Change bias of pixel (to default value)"}, 18 {"channel", &User::cmd_hv, 2, "<range> <volt|default>", "Change bias of (all) channels of active crate"}, 19 19 {"gs", &User::cmd_gs, 1, "[crate] <volt>", "Global voltage set active crate"}, 20 20 {"reset", &User::cmd_reset, 0, "", "Reset active crate"}, … … 235 235 236 236 // Convert voltage value and check format 237 if (!ConvertToDouble(Parameter[n+1], &Double)) { 238 if (Match(Parameter[0], "pixel") && Match(Parameter[n+1], "default")) { 239 if (PixelID < DefaultVoltage.size()) Double = DefaultVoltage[PixelID]; 240 else Double = 0; 241 } 242 else { 243 PrintMessage("Error: Wrong number format for voltage setting\n"); 244 continue; 245 } 237 if (!ConvertToDouble(Parameter[n+1], &Double) && !Match(Parameter[n+1], "default")) { 238 PrintMessage("Error: Wrong number format for voltage setting\n"); 239 continue; 246 240 } 247 241 … … 252 246 253 247 // Voltage change (number starts with + oder -) ignored if current DAC value is zero 254 if (isdigit(Parameter[n+1][0])==0 && Crates[i]->GetDAC(j) == 0) continue; 248 if ((Parameter[n+1][0]=='+' || Parameter[n+1][0]=='-') && Crates[i]->GetDAC(j) == 0) continue; 249 250 // Should the default value be set? 251 if (Match(Parameter[n+1], "default")) { 252 // Pixel ID given directly or channel number? 253 if (!Match(Parameter[0], "pixel")) { 254 vector<unsigned int> List = PixMap->HV_to_Pixel(i, j/NUM_CHANNELS, j%NUM_CHANNELS); 255 if (!List.empty()) PixelID = List[0]; 256 else PixelID = numeric_limits<unsigned int>::max(); 257 } 258 259 // Set default voltage 260 if (PixelID < DefaultVoltage.size()) Voltages[i][j] = DefaultVoltage[PixelID]; 261 else Voltages[i][j] = 0; 262 continue; 263 } 255 264 256 265 // Relative or absolute change?
Note:
See TracChangeset
for help on using the changeset viewer.