Changeset 126 for hvcontrol/src
- Timestamp:
- 12/08/09 13:29:04 (15 years ago)
- Location:
- hvcontrol/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
hvcontrol/src/HV.cc
r113 r126 26 26 BoardName = DeviceName; 27 27 28 for (int i=0; i<NUM_CHAINS; i++) Overcurrent[i] = false; 28 // Create DIM services 29 snprintf(Buffer, sizeof(Buffer), SERVER_NAME"/NAME/ID%.2d", BoardNumber); 30 Name = new DimService (Buffer, BoardName); 31 32 for (int i=0; i<NUM_CHAINS; i++) { 33 for (int j=0; j<NUM_CHANNELS; j++) { 34 snprintf(Buffer, sizeof(Buffer), SERVER_NAME"/VOLT/ID%.2d/%.2d-%.3d", BoardNumber, i, j); 35 BiasVolt[i][j] = new DimService (Buffer, HVV[i][j]); 36 snprintf(Buffer, sizeof(Buffer), SERVER_NAME"/DAC/ID%.2d/%.2d-%.3d", BoardNumber, i, j); 37 BiasDAC[i][j] = new DimService (Buffer, HV[i][j]); 38 } 39 Overcurrent[i] = false; 40 } 29 41 ResetButton = false; 30 42 WrapOK = true; … … 74 86 Reset(); 75 87 close(fDescriptor); 88 } 89 90 delete Name; 91 for (int i=0; i<NUM_CHAINS; i++) { 92 for (int j=0; j<NUM_CHANNELS; j++) { 93 delete BiasVolt[i][j]; 94 delete BiasDAC[i][j]; 95 } 76 96 } 77 97 } … … 194 214 HV[j][k] = 0; 195 215 HVV[j][k] = 0.0; 216 217 // Update DIM services 218 BiasVolt[j][k]->updateService(); 219 BiasDAC[j][k]->updateService(); 196 220 } 197 221 } -
hvcontrol/src/HV.h
r113 r126 10 10 11 11 #include "HVConfig.h" 12 #include "dis.hxx" 12 13 13 14 #define BAUDRATE B115200 … … 52 53 double HVV[NUM_CHAINS][NUM_CHANNELS]; // HV value in volts 53 54 55 DimService *Name; 56 DimService *BiasVolt[NUM_CHAINS][NUM_CHANNELS]; 57 DimService *BiasDAC[NUM_CHAINS][NUM_CHANNELS]; 58 54 59 void ClearVoltageArrays(); 55 60 int Reset(); -
hvcontrol/src/ProcessIO.cc
r113 r126 15 15 16 16 17 ProcessIO::ProcessIO(const char *ConfigFile) {17 ProcessIO::ProcessIO(const char *ConfigFile): EvidenceServer(SERVER_NAME) { 18 18 19 19 // Get program start time … … 268 268 269 269 // Set new voltage (if DAC value, update calibrated value) 270 if(!RampVoltage(DACValue, i, j, k)) Errors++; 271 if(SetDac) fHVBoard[i]->HVV[j][k] = calib->DACToHV(fHVBoard[i]->HV[j][k], i, j, k); 270 if (!RampVoltage(DACValue, i, j, k)) Errors++; 271 if (SetDac) fHVBoard[i]->HVV[j][k] = calib->DACToHV(fHVBoard[i]->HV[j][k], i, j, k); 272 273 // Update DIM services 274 fHVBoard[i]->BiasVolt[j][k]->updateService(); 272 275 273 276 } // Channels … … 316 319 } 317 320 fHVBoard[Board]->HVV[Chain][Channel] = calib->DACToHV(fHVBoard[Board]->HV[Chain][Channel], Board, Chain, Channel); 321 322 // Update DIM services 323 fHVBoard[Board]->BiasVolt[Chain][Channel]->updateService(); 324 318 325 if(++Channel == NUM_CHANNELS) { 319 326 Chain++; … … 625 632 SlowDataClass->NewEntry("Value"); 626 633 SlowDataClass->AddToEntry("%s %d %d %d %d %.2f ",fHVBoard[Board]->BoardName,Board, Chain, Channel, Target, calib->DACToHV(Target,Board,Chain,Channel)); 634 635 // Update DIM service 636 fHVBoard[Board]->BiasDAC[Chain][Channel]->updateService(); 637 627 638 return true; 628 639 } -
hvcontrol/src/ProcessIO.h
r113 r126 7 7 #include <math.h> 8 8 #include <signal.h> 9 10 #define SERVER_NAME "BIAS" // Name to use in DIM 11 #include "../../Evidence/Evidence.h" 9 12 10 13 #include "HVConfig.h" … … 22 25 typedef enum stateenum { active, stopped, na } state_enum; 23 26 24 class ProcessIO {27 class ProcessIO: public EvidenceServer { 25 28 26 29 time_t StartTime;
Note:
See TracChangeset
for help on using the changeset viewer.