/********************************************************************\ Name: HVConfig.cc Created by: Sebastian Commichau, November 2008 commichau@phys.ethz.ch Contents: Class reading the HV utility configuration file \********************************************************************/ #include "ReadCard.h" #include "HVConfig.h" HVConfig::HVConfig(FILE* fptr, char *configfile) { fLogPath = new char[FILENAME_MAX_SIZE]; fUSBDevice = new char*[MAX_NUM_HVBOARDS]; fCCClient = new char[FILENAME_MAX_SIZE]; for (int i=0; itm_year, 1 + time_now->tm_mon, time_now->tm_mday, time_now->tm_hour, time_now->tm_min, time_now->tm_sec); fprintf(f,"# Note: this file will be updated at program exit\n\n"); fprintf(f,"LogPath %s\n\n", fLogPath); fprintf(f,"TimeOut %.2f s # Timeout to return from read (%.2f,...%.2f) s\n\n",fTimeOut,MIN_TIMEOUT,MAX_TIMEOUT); fprintf(f,"StatusRefreshRate %.2f Hz # Status update rate (%.2f,...%.2f) Hz\n\n",fStatusRefreshRate,MIN_RATE,MAX_RATE); fprintf(f,"CCPort %d # Port used to look for commands from the Central Control\n",fCCPort); fprintf(f,"CCClient %s # Central Control client name\n\n",fCCClient); fprintf(f,"IsDAC %s # Define here if user input is interpreted as DAC value or voltage\n\n",((IsDAC) ? "TRUE" : "FALSE")); fprintf(f,"HVCalibOffset %f # Calibration of DAC to voltage values\n",fHVCalibOffset); fprintf(f,"HVCalibSlope %f # Calibration of DAC to voltage values\n\n",fHVCalibSlope); fprintf(f,"HVMaxDiff %f # Speed for HV changes limited to 1V/ms\n",fHVMaxDiff); fprintf(f,"# List of HV boards (at most %d HV boards will be recognized):\n",MAX_NUM_HVBOARDS); for (int i=0;i