/********************************************************************\ 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]; fPixMapTable = 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,"PixMapTable %s\n\n", fPixMapTable); fprintf(f,"TestMode %s #Test Mode: if no HV boards are connected, the test mode can be used.",((TestMode) ? "TRUE" : "FALSE")); 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,"DACMin %d # Starting point for calibration of DAC to voltage values\n",DACMin); fprintf(f,"DACMax %d # End point for calibration of DAC to voltage values\n",DACMax); fprintf(f,"HVMin %f # Starting point for calibration of voltage to DAC values\n",HVMin); fprintf(f,"HVMax %f # End point for calibration of voltage to DAC values\n",HVMax); 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