Changeset 11361
- Timestamp:
- 07/12/11 16:39:50 (13 years ago)
- Location:
- fact/BIASctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/BIASctrl/Crate.h
r10118 r11361 32 32 DimService *BiasCurrent; 33 33 34 34 35 int DAC[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in DAC units 35 36 double Volt[MAX_NUM_BOARDS][NUM_CHANNELS]; // Voltage in Volt 36 37 float Current[MAX_NUM_BOARDS][NUM_CHANNELS]; 37 38 38 std::vector<unsigned char> Communicate(std::string); 39 39 void ClearVoltageArrays(); -
fact/BIASctrl/History.txt
r11205 r11361 13 13 3/6/2011 Fixed bug in channel addressing from board numbers above 7. 14 14 28/6/2011 Adapted for compilation under ubuntu 15 12/7/2011 Default voltages implemented for pixel command. -
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 -
fact/BIASctrl/User.h
r10153 r11361 35 35 36 36 std::vector<class Crate *> Crates; 37 std::vector<double> DefaultVoltage; 37 38 38 39 void commandHandler();
Note:
See TracChangeset
for help on using the changeset viewer.