Changeset 11361 for fact/BIASctrl/User.cc
- Timestamp:
- 07/12/11 16:39:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/BIASctrl/User.cc
r11205 r11361 15 15 const char *Help; 16 16 } CommandList[] = 17 {{"pixel", &User::cmd_hv, 2, "<pixel id> <v >", "Change bias of pixel"},17 {{"pixel", &User::cmd_hv, 2, "<pixel id> <volt|default>", "Change bias of pixel"}, 18 18 {"channel", &User::cmd_hv, 2, "<channel range> <v>", "Change bias of (all) channels of active crate"}, 19 19 {"gs", &User::cmd_gs, 1, "[crate] <volt>", "Global voltage set active crate"}, … … 50 50 if (fStatusRefreshRate < MIN_RATE || fStatusRefreshRate > MAX_RATE) fStatusRefreshRate = 1; 51 51 52 vector<string> Text = Tokenize(GetConfig("DefaultVoltage", ""), " \t"); 53 54 for (unsigned int i=0; i<Text.size(); i++) { 55 DefaultVoltage.push_back(atof(Text[i].c_str())); 56 } 57 52 58 // Open devices 53 59 for (unsigned int i=0; i<Boards.size(); i++) { … … 194 200 double Double; 195 201 struct Range Crt, Chan; 202 unsigned int PixelID = 0; 196 203 vector< map<unsigned int, double> > Voltages (Crates.size()); 197 204 … … 203 210 // Skip if first character is not digit 204 211 if (isdigit(Parameter[n][0] == 0)) continue; 212 213 // Extract pixel ID 214 PixelID = atoi(Parameter[n].c_str()); 215 205 216 // Skip if pixel ID not existing 206 if (PixMap->Pixel_to_HVcrate( atoi(Parameter[n].c_str())) == PixMap->PM_ERROR_CODE) continue;207 208 Crt.Min = Crt.Max = PixMap->Pixel_to_HVcrate( atoi(Parameter[n].c_str()));209 Chan.Min = Chan.Max = PixMap->Pixel_to_HVboard( atoi(Parameter[n].c_str()))*NUM_CHANNELS + PixMap->Pixel_to_HVchannel(atoi(Parameter[n].c_str()));217 if (PixMap->Pixel_to_HVcrate(PixelID) == PixMap->PM_ERROR_CODE) continue; 218 219 Crt.Min = Crt.Max = PixMap->Pixel_to_HVcrate(PixelID); 220 Chan.Min = Chan.Max = PixMap->Pixel_to_HVboard(PixelID)*NUM_CHANNELS + PixMap->Pixel_to_HVchannel(PixelID); 210 221 } 211 222 // Channel identification … … 225 236 // Convert voltage value and check format 226 237 if (!ConvertToDouble(Parameter[n+1], &Double)) { 227 PrintMessage("Error: Wrong number format for voltage setting\n"); 228 continue; 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 } 229 246 } 230 247
Note:
See TracChangeset
for help on using the changeset viewer.