Index: /hvcontrol/HV.conf
===================================================================
--- /hvcontrol/HV.conf	(revision 34)
+++ /hvcontrol/HV.conf	(revision 35)
@@ -1,3 +1,3 @@
-# Main configuration file for the HV control program V1.0, 2009 03 17, 18:46:08
+# Main configuration file for the HV control program V1.0, 2009 04 23, 17:13:36
 # Note: this file will be updated at program exit
 
@@ -13,5 +13,9 @@
 IsDAC              FALSE   # Define here if user input is interpreted as DAC value or voltage
 
-HVCalibOffset      -0.800000   # Calibration of DAC to voltage values
+DACMin             11008   # Starting point for calibration of DAC to voltage values
+DACMax             12496   # End point for calibration of DAC to voltage values
+HVMin              67.000000   # Starting point for calibration of voltage to DAC values
+HVMax              76.000000   # End point for calibration of voltage to DAC values
+HVCalibOffset      67.000000   # Calibration of DAC to voltage values
 HVCalibSlope       0.006400   # Calibration of DAC to voltage values
 
Index: /hvcontrol/Makefile
===================================================================
--- /hvcontrol/Makefile	(revision 34)
+++ /hvcontrol/Makefile	(revision 35)
@@ -1,49 +1,38 @@
 #
-#  Makefile for the CTX HV utility 
+#  Makefile example
 #
 
-include Makefile.general
+SOURCES = hvcontrol.cpp src/CCCommand.cc src/ConsoleCommand.cc src/HV.cc src/HVConfig.cc src/HVCalib.cc src/HVMonitor.cc src/HVStatus.cc src/Log.cc src/ProcessIO.cc src/ReadCard.cc src/Utilities.cc ../../fact_repos.svn/pixelmap/Pixel.cc ../../fact_repos.svn/pixelmap/PixelMap.cc
 
-PROGRAMS = hvcontrol remotecontrol 
+OBJECTS = $(addsuffix .o, $(basename $(SOURCES)))
 
-SUBDIRS = src
+#INCDIRS   = -I. -IDRS -I../pixelmap
+INCDIRS   = -I. -I../pixelmap -I./src
 
+CFLAGS = -pipe -fthread-jumps -funroll-all-loops -O3 -Wall -DOS_LINUX
+CPPFLAGS = -pipe -fPIC -fthread-jumps -funroll-all-loops -O3 -Wall -DOS_LINUX $(VMECTRL)
+LIBS = -lstdc++ -lz -lpthread -lutil -lfl -lusb -lftdi -L/usr/lib -L/sw/lib
 
-all: $(PROGRAMS) 
+hvcontrol: $(OBJECTS)
+	$(CC) $(CPPFLAGS) -o $@ $(OBJECTS) $(LIBS)
 
+clean:
+	@rm -f $(OBJECTS) $(SOBJECTS).so
+	@rm -f *.d
+	@rm -f *~
 
-OBJECTS   = $(SUBDIRS:=/*.o)
+-include Dep.d
 
-INCDIRS   = -I. $(SUBDIRS:%=-I%)
+# Implicit rules
 
-MRPROPERS = $(SUBDIRS:=.mrproper)
+%.o : %.c
+	$(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $<
+%.o : %.cc
+	$(CC) $(CPPFLAGS) $(INCDIRS) -c -o $@ $<
+%.o : %.cpp
+	$(CC) $(CPPFLAGS) $(INCDIRS) -c -o $@ $<
+%.d :
+	@echo "Generating dependencies" $@
+	@$(CC) -MM $(SOURCES) $(INCDIRS) \
+	| sed 's/^\(.*\).o:/$@ \1.o:/' > $@
 
-CLEANERS  = $(SUBDIRS:=.cleaner)
-
-LIBRARIES = $(SUBDIRS:=.all)
-
-
-$(PROGRAMS) : % : %.o $(LIBRARIES)
-	$(G++) $(CFLAGS) -o $@ $@.o  $(OBJECTS) $(LIBS) 
-
-include Makefile.rules
-
-$(LIBRARIES):
-	@echo " Calling make in $(@:.all=)"
-	@(cd $(@:.all=); $(MAKE) -f Makefile all)
-
-$(MRPROPERS):
-	@echo " Doing Mr.Proper in $(@:.mrproper=)"
-	@(cd $(@:.mrproper=); $(MAKE) -f Makefile mrproper)
-
-$(CLEANERS):
-	@echo " Doing clean in $(@:.cleaner=)"
-	@(cd $(@:.cleaner=); $(MAKE) -f Makefile clean)
-
-mrproper: $(MRPROPERS) rmobj rmbak rmdep
-	@rm -f $(PROGRAMS)
-	@echo " Done."
-
-clean: $(CLEANERS) rmobj
-	@echo " Done."
-
Index: /hvcontrol/hvcontrol.cpp
===================================================================
--- /hvcontrol/hvcontrol.cpp	(revision 34)
+++ /hvcontrol/hvcontrol.cpp	(revision 35)
@@ -31,4 +31,6 @@
 #define LOCKFILE "/tmp/CTX_HV_LOCK"
 
+void CrashHandler(int Signal);
+
 
 int main(int argc, char *argv[]) {
@@ -46,5 +48,5 @@
   // The flag O_EXCL together with O_CREAT assure that the lock 
   // file cannot be opened by another instance, i.e. there are no parallel write accesses
-  if ((LockDescriptor = open(LOCKFILE,O_RDONLY|O_CREAT|O_EXCL)) == -1) {  
+  /*  if ((LockDescriptor = open(LOCKFILE,O_RDONLY|O_CREAT|O_EXCL)) == -1) {  
     sprintf(str, "Could not create lock file %s", LOCKFILE);
     perror(str);
@@ -52,4 +54,20 @@
   }
   close(LockDescriptor);
+  */
+  if((LockDescriptor = open(LOCKFILE,O_WRONLY|O_CREAT|O_EXCL,S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH)) == -1) {
+    if(errno==EEXIST) {
+      printf("Error: Lock file already existing\n");
+      sprintf(str,"paste %s -s -d ' '",LOCKFILE);
+      system(str);
+    }
+    else {
+      sprintf(str, "Could not create lock file %s", LOCKFILE);
+      perror(str);
+    }
+    exit(EXIT_FAILURE);
+  }
+  close(LockDescriptor);
+  sprintf(str,"echo Created >%s; date >>%s; echo by $USER@$HOSTNAME>>%s",LOCKFILE,LOCKFILE,LOCKFILE);
+  system(str);
 
 
@@ -81,4 +99,16 @@
   signal(SIGUSR1, &SignalHandler);
   siginterrupt (SIGUSR1, true);
+
+  // Install signals to assure that the lock file is deleted in case of a program crash
+  signal(SIGQUIT, &CrashHandler);
+  signal(SIGILL, &CrashHandler);
+  signal(SIGABRT, &CrashHandler);
+  signal(SIGFPE, &CrashHandler);
+  signal(SIGSEGV, &CrashHandler);
+  signal(SIGBUS, &CrashHandler);
+  signal(SIGTERM, &CrashHandler);
+  signal(SIGINT, &CrashHandler);
+  signal(SIGHUP, &CrashHandler);
+
 
   // Create threads
@@ -116,2 +146,10 @@
   return 0;
 }
+
+// Remove lock file before running default signal code
+void CrashHandler(int Signal) {
+  remove(LOCKFILE);
+  printf("Caught signal number %d. Removing lockfile and performing standard signal action. Good luck.\n",Signal);
+  signal(Signal, SIG_DFL);
+  raise(Signal);
+}
Index: /hvcontrol/src/CCCommand.cc
===================================================================
--- /hvcontrol/src/CCCommand.cc	(revision 34)
+++ /hvcontrol/src/CCCommand.cc	(revision 35)
@@ -79,6 +79,4 @@
       m->status->Pc = comline;      
                  
-      sprintf(str,"Test in CCComand: %s",m->status->Pc);
-      printf(str);
 
       ParseInput(m->status->Pc,&(m->status->NParam),m->status->Param);
Index: /hvcontrol/src/HV.cc
===================================================================
--- /hvcontrol/src/HV.cc	(revision 34)
+++ /hvcontrol/src/HV.cc	(revision 35)
@@ -334,9 +334,10 @@
 
   unsigned char wbuf[] = {0,0,0};
-  
+
   if (!(hv>=0.0 && hv<=0X3FFF)) {
     fprintf(fptr," Error: HV beyond limits [0 - 0x3FFF]\n"); 
     return 0;
   }
+  
 
   switch (chain) {
Index: /hvcontrol/src/HVConfig.cc
===================================================================
--- /hvcontrol/src/HVConfig.cc	(revision 34)
+++ /hvcontrol/src/HVConfig.cc	(revision 35)
@@ -36,4 +36,8 @@
   fTimeOut           = 1.;
   IsDAC              = true;
+  DACMin             = 11008;
+  DACMax             = 12496;
+  HVMin              = 67.0;
+  HVMax              = 76.0;
   fHVCalibOffset      = -.8;
   fHVCalibSlope       = 0.0064;
@@ -91,4 +95,8 @@
   ReadCard("CCClient",           fCCClient,          's', f);
   ReadCard("IsDAC",             &str,                's', f);
+  ReadCard("DACMin",            &DACMin,             'I', f);
+  ReadCard("DACMax",            &DACMax,             'I', f);
+  ReadCard("HVMin",             &HVMin,              'f', f);
+  ReadCard("HVMax",             &HVMax,              'f', f);
   ReadCard("HVCalibOffset",     &fHVCalibOffset,     'f', f);
   ReadCard("HVCalibSlope",      &fHVCalibSlope,      'f', f);
@@ -121,4 +129,8 @@
   fprintf(fptr," CCClient:          %s\n\n",     fCCClient);
   fprintf(fptr," Set DAC values:    %s\n\n",     IsDAC ? "yes" : "no");
+  fprintf(fptr," DACMin value:      %d\n\n",     DACMin);
+  fprintf(fptr," DACMax value:      %d\n\n",     DACMax);
+  fprintf(fptr," HVMin value:       %f\n\n",     HVMin);
+  fprintf(fptr," HVMax value:       %f\n\n",     HVMax);
   fprintf(fptr," HVCalibOffset :    %f\n\n",     fHVCalibOffset);
   fprintf(fptr," HVCalibSlope :     %f\n\n",     fHVCalibSlope);
@@ -166,4 +178,8 @@
   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);
Index: /hvcontrol/src/HVConfig.h
===================================================================
--- /hvcontrol/src/HVConfig.h	(revision 34)
+++ /hvcontrol/src/HVConfig.h	(revision 35)
@@ -36,4 +36,9 @@
   float  fStatusRefreshRate;
 
+  int DACMin;
+  int DACMax;
+  float HVMin;
+  float HVMax;
+
   float  fHVCalibOffset;
   float  fHVCalibSlope;
Index: /hvcontrol/src/HVStatus.cc
===================================================================
--- /hvcontrol/src/HVStatus.cc	(revision 34)
+++ /hvcontrol/src/HVStatus.cc	(revision 35)
@@ -162,5 +162,5 @@
  
   if (status->Socket != -1) // Print status string to socket if open
-    write(status->Socket,str,strlen(str));
+    write(status->Socket,str,strlen(str)+1);
 
 }
Index: /hvcontrol/src/ProcessIO.cc
===================================================================
--- /hvcontrol/src/ProcessIO.cc	(revision 34)
+++ /hvcontrol/src/ProcessIO.cc	(revision 35)
@@ -22,6 +22,9 @@
   status  = new Status;
   config  = new HVConfig(stdout,ConfigFile);
+  calib  = new HVCalib(config);
   log     = new Log(config->fLogPath);
   hv      = new HV(config->fUSBDevice,config->USBDeviceNumber,stdout);
+ 
+  pm = new PixelMap("../fact_repos.svn/config/PixelMap.txt");
 
   // Initialize status structure (HVStatus.cc/h)
@@ -85,8 +88,9 @@
   config->WriteHVConfig(stdout,config->FileName);
 
-  if (hv)      delete hv;
-  if (status)  delete status;
-  if (config)  delete config;
-  if (log)     delete log;
+  delete hv;
+  delete status;
+  delete config;
+  delete log;
+  delete pm;
   
 }
@@ -104,5 +108,6 @@
   puts(" help                              Print help");
   puts(" hv <ch>|<all> [b][x]<v>           Set chan. <ch>|<all> chan. of active chain(s)/board(s) to <v>");
-  puts(" hvdiff <ch>|<all> [b][x]<diff>    Set chan. <ch>|<all> chan. of active chain(s)/board(s) to <diff>");
+  //  puts(" hvdiff <ch>|<all> [b][x]<diff>    Set chan. <ch>|<all> chan. of active chain(s)/board(s) to <diff>");
+  puts(" hvdiff <PXL id> <diff>            Set HV difference of pixel PXL id to <diff>");
   puts(" list                              List all HV boards");
   puts(" load <file>                       Load HV settings from <file>");
@@ -128,9 +133,4 @@
 int ProcessIO::CommandControl() {
 
-  //  bool IsDAC;
-  //  float  fHVCalibOffset;
-  //  float  fHVCalibSlope;
-  //  float  fHVMaxDiff;
-
 
   // Adress HV board
@@ -340,6 +340,4 @@
       }
 
-      if (!(config->IsDAC))
-	hvoltage=(unsigned int)((hvoltageV-config->fHVCalibOffset)/config->fHVCalibSlope);
 
       StopMonitor();
@@ -350,9 +348,9 @@
 	for (int j=status->FirstChain;j<=status->LastChain;j++) {
 	  if (!allchannels) {
-	    if ((hv->GetHVBoard(i))->SetHV(stdout,j,channel,hvoltage,rbuf,status->Verbose)==1) {
-	      
+ // Convert from HV to DAC values
+	    if (!(config->IsDAC))
+	      hvoltage = calib->HVToDAC(hvoltageV,i,j,channel);
+	    if ((hv->GetHVBoard(i))->SetHV(stdout,j,channel,hvoltage,rbuf,status->Verbose)==1){
 	      status->HV[i][j][channel]=hvoltage;
-	      sprintf(str, "Test1   status->HV = %d\n",hvoltage);
-	      DoPrompt(str);
 	      UpdateStatus(i,rbuf);
 	      
@@ -370,15 +368,15 @@
 	      errors++;
 	    }
-
 	  }
+
 	  else {
-
 	    sprintf(str,"updating board %d chain %d\n",hv->GetHVBoard(i)->GetBoardNumber(),j);
 	    DoPrompt(str);
 	    
-
 	    for (int k=0;k<MAX_NUM_CHANNELS;k++) {
+ // Convert from HV to DAC values
+	      if (!(config->IsDAC)) 
+		hvoltage = calib->HVToDAC(hvoltageV,i,j,k);
 	      if ((hv->GetHVBoard(i))->SetHV(stdout,j,k,hvoltage,rbuf,status->Verbose)==1) {
-		
 		status->HV[i][j][k]=hvoltage;
 		UpdateStatus(i,rbuf);
@@ -436,19 +434,33 @@
     int hvdiff = 0;
     unsigned int hvoltage = 0;
+    float hvoltageV = 0.0;
     float hvdiffV = 0.0;
-    int channel = 0;
-    bool allchannels = FALSE;
+    std::string pixelname(status->Param[1]);
+    unsigned int board = 0;
+    unsigned int chain = 0;
+    unsigned int channel = 0;
+
 
     if (status->Param[1][0]>0 && status->Param[2][0]>0) {
 
+
+      // Set board
+      board = pm->Pixel_to_HVboard(pixelname);
+      //      std::cout << "Board: " << board << std::endl;
+      // Set chain
+      chain = pm->Pixel_to_HVchain(status->Param[1]);
+      //      std::cout << "Chain: " << chain << std::endl;
       // Set channel
-      if (IsNoDigit(status->Param[1]))
-	channel = atoi(status->Param[1]);
-      else if(status->Param[1][0] == 'a')
-	allchannels = TRUE;
-      else {
-	DoPrompt("error: wrong input format - usage: hvdiff <channel>|<all> <hv difference>\n");
-	return 0;
-      }
+      channel = pm->Pixel_to_HVchannel(status->Param[1]);
+      //      std::cout << "Channel: " << channel << std::endl;
+
+      /*      if (IsNoDigit(status->Param[1]))
+	      channel = atoi(status->Param[1]);
+	      else if(status->Param[1][0] == 'a')
+	      allchannels = TRUE;
+	      else {
+	      DoPrompt("error: wrong input format - usage: hvdiff <channel>|<all> <hv difference>\n");
+	      return 0;
+	}*/
 
       // Binary input
@@ -481,94 +493,62 @@
 	return 0;
       }
-      else if (hvdiff>0X3FFF) {
-	DoPrompt("difference of high voltage out of range (Vmin: -16383, Vmax: 16383)!\n");
-	return 0;
-      }
-      else if (hvdiffV>78.0 && (-78.0<hvdiffV)) {
-	DoPrompt("difference of high voltage out of range (Vmin: -78.0, Vmax: 78.0)!\n");
-	return 0;
-      }
-
+      else if (hvdiff>config->DACMax || hvdiff <(-(config->DACMax))) {
+	sprintf(str,"difference of high voltage [hvdiff:%d] out of range (Vmin: 0.0, Vmax: %d)!\n", hvdiff,config->DACMax);
+	DoPrompt(str);
+	return 0;
+      }
+      else if (hvdiffV>(calib->DACToHV(config->DACMax,0,0,0))|| hvdiffV<-(calib->DACToHV(config->DACMax,0,0,0))) {
+	sprintf(str,"difference of high voltage [hvdiff:%f] out of range (Vmin: 0.0, Vmax: %f)!\n",hvdiffV,calib->DACToHV(config->DACMax,0,0,0));
+	DoPrompt(str);
+	return 0;
+      }
+
+      //Convert from HV to DAC values
       if (!(config->IsDAC)){
-	hvdiff=(int)(hvdiffV/config->fHVCalibSlope);
+	hvoltage = status->HV[board][chain][channel];
+	hvoltageV = calib->DACToHV(hvoltage,board,chain,channel);
+	hvoltageV = hvoltageV + hvdiffV;
+	hvdiff = calib->HVToDAC(hvoltageV,board,chain,channel) - hvoltage;
       }
       StopMonitor();
 
-      
-      for (int i=status->FirstBoard;i<=status->LastBoard;i++) {
-
-	for (int j=status->FirstChain;j<=status->LastChain;j++) {
-	  if (!allchannels) {
-	    hvoltage = status->HV[i][j][channel];
-	    for (int k=0;k<=abs((int)(hvdiff/config->fHVMaxDiff));k++){
-	      if (k<abs((int)(hvdiff/config->fHVMaxDiff))){
-		hvoltage=(unsigned int)(hvoltage + config->fHVMaxDiff*hvdiff/abs(hvdiff));
-	      }
-	      if (k==(int)(abs((int)(hvdiff/config->fHVMaxDiff)))){
-		hvoltage=(unsigned int)(hvoltage + (hvdiff%(int)config->fHVMaxDiff));
-	      }
-
-
-	      status->HV[i][j][channel]=hvoltage;
-	      if ((hv->GetHVBoard(i))->SetHV(stdout,j,channel,hvoltage,rbuf,status->Verbose)==1) {
-		UpdateStatus(i,rbuf);
-		sprintf(str,"board %d: high voltage of chain %d channel %d set to %d | 0X%.4X\n",hv->GetHVBoard(i)->GetBoardNumber(),j,channel,hvoltage,hvoltage);
-		DoPrompt(str);
-		if (status->Verbose) {
-		  sPrintStatus(status,str,i);
-		  DoPrompt(str);
-		}
-		sPrintStatus(status,str,i); // Print status only to socket 
-	      }
-	      else {
-		sprintf(str,"board %d error: could not set hv - check timeout and try again\n",hv->GetHVBoard(i)->GetBoardNumber());
-		DoPrompt(str);
-		errors++;
-	      }
-	      //	    Sleep(1);
-	    }
+   
+      
+      hvoltage = status->HV[board][chain][channel];
+      for (int k=0;k<=abs((int)(hvdiff/config->fHVMaxDiff));k++){
+	if (k<abs((int)(hvdiff/config->fHVMaxDiff))){
+	  hvoltage=(unsigned int)(hvoltage + config->fHVMaxDiff*hvdiff/abs(hvdiff));
+	}
+	if (k==(int)(abs((int)(hvdiff/config->fHVMaxDiff)))){
+	  hvoltage=(unsigned int)(hvoltage + (hvdiff%(int)config->fHVMaxDiff));
+	}
+	
+	
+	status->HV[board][chain][channel]=hvoltage;
+	if ((hv->GetHVBoard(board))->SetHV(stdout,chain,channel,hvoltage,rbuf,status->Verbose)==1) {
+	  UpdateStatus(board,rbuf);
+	  if (k==(int)(abs((int)(hvdiff/config->fHVMaxDiff)))){
+	    sprintf(str,"board %d: high voltage of chain %d channel %d set to %d | 0X%.4X\n",hv->GetHVBoard(board)->GetBoardNumber(),chain,channel,hvoltage,hvoltage);
+	    DoPrompt(str);
+	    sPrintStatus(status,str,board); // Print status only to socket 
 	  }
-	  else {
-	    
-	    sprintf(str,"updating board %d chain %d\n",hv->GetHVBoard(i)->GetBoardNumber(),j);
-	    DoPrompt(str);
-	    
-
-	    for (int k=0;k<MAX_NUM_CHANNELS;k++) {
-   	      int hvoltage = status->HV[i][j][k];
-	      for (int l=0;l<=abs((int)(hvdiff/config->fHVMaxDiff));l++){
-	    	if (l<abs((int)(hvdiff/config->fHVMaxDiff)))
-		  hvoltage=(unsigned int)(hvoltage + config->fHVMaxDiff*hvdiff/abs(hvdiff));
-		if (l==(int)(abs((int)(hvdiff/config->fHVMaxDiff))))
-		  hvoltage=(unsigned int)(hvoltage + (hvdiff%(int)config->fHVMaxDiff));
-		status->HV[i][j][k]=hvoltage;
-		if ((hv->GetHVBoard(i))->SetHV(stdout,j,k,hvoltage,rbuf,status->Verbose)==1) {
-		
-		  UpdateStatus(i,rbuf);
-		
-		  if (status->Verbose) {
-		    sprintf(str,"board %d: high voltage of chain %d channel %d set to %d | 0X%.4X\n",hv->GetHVBoard(i)->GetBoardNumber(),j,k,hvoltage,hvoltage);
-		    DoPrompt(str);
-		    sPrintStatus(status,str,i);
-		    DoPrompt(str);
-		  }
-		  sPrintStatus(status,str,i); // Print status only to socket 
-		  
-		}
-		else {
-		  sprintf(str,"board %d error: could not set HV - check timeout and try again\n",hv->GetHVBoard(i)->GetBoardNumber());
-		  DoPrompt(str);
-		  errors++;
-		}
-		//		Sleep(0.001);
-	      }
-	    }
-	  }
-	}
-      }
+	}
+	else {
+	  sprintf(str,"board %d chain %d channel %d error: could not set hv - check timeout and try again\n",hv->GetHVBoard(board)->GetBoardNumber(), chain, channel);
+	  DoPrompt(str);
+	  errors++;
+	}
+      }          // for loop over k
+	//	    Sleep(1);
+      if (status->Verbose) {
+	sPrintStatus(status,str,board);
+	DoPrompt(str);
+      }
+   
+    
       StartMonitor();
 
       if (errors) {
-	sprintf(str,"warning %d error(s) => check timeout and try again\n",errors);
+	sprintf(str,"warning %d error(s)\n",errors);
 	DoPrompt(str);
       }
@@ -579,10 +559,10 @@
     }
     else {
-      sprintf(str,"usage: hvdiff <channel>|<all> <hv difference>\n");
+      sprintf(str,"usage: hvdiff <PXL id> <hv difference>\n");
       DoPrompt(str);
     }
     return 0;
 
-    }
+  }
 
       // End: Write difference of high voltage --------------------------------------------------------------------
Index: /hvcontrol/src/ProcessIO.h
===================================================================
--- /hvcontrol/src/ProcessIO.h	(revision 34)
+++ /hvcontrol/src/ProcessIO.h	(revision 35)
@@ -28,6 +28,10 @@
 #include "Log.h"
 #include "HVConfig.h"
+#include "HVCalib.h"
 #include "Utilities.h"
 #include "HV.h"
+
+#include <iostream>
+#include "../../fact_repos.svn/pixelmap/PixelMap.h"
 
 
@@ -45,7 +49,10 @@
   char bdata[16];
 
+  PixelMap *pm;
+
  public:
   
   HVConfig*    config;
+  HVCalib*     calib;
   Status*      status;
   Log*         log;
