Index: /fact/BIASctrl/Crate.cc
===================================================================
--- /fact/BIASctrl/Crate.cc	(revision 10117)
+++ /fact/BIASctrl/Crate.cc	(revision 10118)
@@ -32,5 +32,4 @@
 	  Present[i][j] = false;
 	  Current[i][j] = 0;
-	  CurrentOffset[i][j] = 0;
 	}
   }
@@ -293,21 +292,4 @@
 
 
-// ***** Determine offset for current measurement *****
-bool Crate::CurrentCalib(double Voltage) {
-
-  // Set voltage of all channels and wait for current to settle
-  if (GlobalSet((int) (Voltage/90*0xfff)) != 1) return false;
-  sleep(1);
-  
-  // Measure current of all channels
-  if (ReadAll() != 1) return false;
-
-  for (int i=0; i<MAX_NUM_BOARDS; i++) for (int j=0; j<NUM_CHANNELS; j++) {
- 	CurrentOffset[i][j] = Current[i][j];
-  }
-  return true;
-}
-
-
 // ***** Set all voltages of board to zero *****
 void Crate::ClearVoltageArrays() {
@@ -343,5 +325,5 @@
 
   if (Channel >= MAX_NUM_BOARDS*NUM_CHANNELS) return 0;
-  else return Current[Channel/NUM_CHANNELS][Channel%NUM_CHANNELS]-CurrentOffset[Channel/NUM_CHANNELS][Channel%NUM_CHANNELS]; 
+  else return Current[Channel/NUM_CHANNELS][Channel%NUM_CHANNELS]; 
 }
 
Index: /fact/BIASctrl/Crate.h
===================================================================
--- /fact/BIASctrl/Crate.h	(revision 10117)
+++ /fact/BIASctrl/Crate.h	(revision 10118)
@@ -35,5 +35,4 @@
 	double Volt[MAX_NUM_BOARDS][NUM_CHANNELS];	// Voltage in Volt
 	float Current[MAX_NUM_BOARDS][NUM_CHANNELS];
-	float CurrentOffset[MAX_NUM_BOARDS][NUM_CHANNELS]; // Offset for current measurement
 
 	std::vector<unsigned char> Communicate(std::string);
@@ -63,5 +62,4 @@
 	int GlobalSet(double);
 	bool Synch();
-	bool CurrentCalib(double);
 	double GetVoltage(unsigned int);
 	unsigned int GetDAC(unsigned int);
Index: /fact/BIASctrl/User.cc
===================================================================
--- /fact/BIASctrl/User.cc	(revision 10117)
+++ /fact/BIASctrl/User.cc	(revision 10118)
@@ -16,8 +16,8 @@
   } CommandList[] = 
    {{"synch", &User::cmd_synch, 0, "", "Synchronize board"},
-    {"hv", &User::cmd_hv, 2, "<id>|<ch>|<all> <v>", "Change bias of pixel or (all) chan. of active boards"},
+    {"pixel", &User::cmd_hv, 2, "<pixel id> <v>", "Change bias of pixel"},
+	{"channel", &User::cmd_hv, 2, "<channel|all> <v>", "Change bias of (all) channels of active boards"},
     {"gs", &User::cmd_gs, 1, "[crate] <volt>", "Global voltage set"},
 	{"status", &User::cmd_status, 0, "[dac|current]", "Show status information (DAC values if requested)"},
-	{"ccal", &User::cmd_ccal, 1, "<volt>", "Calibrate current measurement at given voltage"},
 	{"mode", &User::cmd_mode, 1, "<static|dynamic>", "Set voltage stabilization mode"},
 	{"load", &User::cmd_load, 1, "<file>", "Load and set bias settings from file"},
@@ -63,6 +63,8 @@
   }
 
-  // Create instances
-  pm 	 = new PixelMap(GetConfig("PixMapTable"));
+  // Create PixelMap instance (map from config server)
+  DimRpcInfo RPC((char *) "ConfigRequest", (char *) "");
+  RPC.setData((char *) "Misc PixelMap");
+  PixMap = new PixelMap(std::string(RPC.getString(), RPC.getSize()));
   
   // Install DIM command (after all initialized)
@@ -90,5 +92,5 @@
 
   delete DIMCommand;    
-  delete pm;
+  delete PixMap;
   delete ConsoleOut;	
   free(ConsoleText);  
@@ -169,9 +171,15 @@
   for (unsigned int n=1; n < Parameter.size()-1; n+=2) {
 
-	// Extract channel identification
-	if (pm->Pixel_to_HVboard(Parameter[n]) != 999999999) {
-      Crt.Min = Crt.Max = pm->Pixel_to_HVboard(Parameter[n]);
-      Chan.Min = Chan.Max = pm->Pixel_to_HVchain(Parameter[n])*NUM_CHANNELS + pm->Pixel_to_HVchannel(Parameter[n]);
-	}
+	// Pixel identification?
+	if (Match(Parameter[0], "pixel")) {
+	  // Skip if first character is not digit
+	  if (isdigit(Parameter[n][0] == 0)) continue;
+	  // Skip if pixel ID not existing 
+	  if (PixMap->Pixel_to_HVcrate(atoi(Parameter[n].c_str())) == PixMap->PM_ERROR_CODE) continue;
+
+      Crt.Min = Crt.Max = PixMap->Pixel_to_HVcrate(atoi(Parameter[n].c_str()));
+      Chan.Min = Chan.Max = PixMap->Pixel_to_HVboard(atoi(Parameter[n].c_str()))*NUM_CHANNELS + PixMap->Pixel_to_HVchannel(atoi(Parameter[n].c_str()));
+	}
+	// Channel identification
 	else {
       vector<string> T = Tokenize(Parameter[n], "/");
@@ -181,6 +189,4 @@
 	  Chan.Max = MAX_NUM_BOARDS*NUM_CHANNELS-1;
 	  
-	  if (Parameter[n] == "-") continue;
-
 	  if (T.size() == 2) {
 		if(!ConvertToRange(T[0], Crt) || !ConvertToRange(T[1], Chan)) {
@@ -204,5 +210,4 @@
 	}
 
-
 	// Loop over given crates and channels
 	for (int i=Crt.Min; i<=Crt.Max; i++) for (int j=Chan.Min; j<=Chan.Max; j++) {
@@ -342,27 +347,4 @@
 	}
   }    
-}
-
-//
-// Determine current measurement offset
-//
-void User::cmd_ccal() {
-
-  double Voltage;
-    
-  if (!ConvertToDouble(Parameter[1], &Voltage)) {
-    PrintMessage("Error with format of voltage parameter\n");  
-	return;
-  }
-
-  // Execute current offset determination
-  for (unsigned int i=0; i<Crates.size(); i++) {
-	if (!Crates[i]->CurrentCalib(Voltage)) {
-      PrintMessage("Error with current calibration of crate %d\n", i);
-	  return;
-	}
-
-	PrintMessage("Current calibration of crate %d done\n", i);
-  }
 }
 
Index: /fact/BIASctrl/User.h
===================================================================
--- /fact/BIASctrl/User.h	(revision 10117)
+++ /fact/BIASctrl/User.h	(revision 10118)
@@ -26,5 +26,5 @@
 	enum RunMode {mode_static, mode_dynamic};
 
-	PixelMap *pm;
+	PixelMap *PixMap;
 	DimCommand *DIMCommand;
 	DimService *ConsoleOut;
@@ -66,6 +66,5 @@
 	void cmd_exit();	void cmd_rate();
 	void cmd_timeout();	void cmd_reset();
-	void cmd_help();	void cmd_ccal();
-	void cmd_mode();
+	void cmd_help();	void cmd_mode();
 };
 
Index: /fact/Evidence/Edd/Edd.cc
===================================================================
--- /fact/Evidence/Edd/Edd.cc	(revision 10117)
+++ /fact/Evidence/Edd/Edd.cc	(revision 10118)
@@ -23,4 +23,5 @@
 class EddDim *Handler;
 QString DRSBoard = "drsdaq";
+std::string PixelMapText;
 
 // History chooser function (opens plot for numeric data, TextHist for all other)
@@ -1016,5 +1017,5 @@
 
 // Constructor
-EventScope::EventScope(QWidget *P): EddBasePlot(P), PixelMap("../../config/PixelMap.txt", false) {
+EventScope::EventScope(QWidget *P): EddBasePlot(P), PixelMap(PixelMapText, false) {
 
   Name = DRSBoard+"/EventData";
@@ -1064,5 +1065,5 @@
   struct ItemDetails N;
   
-  N.Signal = NewCurve(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel)+ " (" + DRS_to_Pixel(Board, Chip, Channel).c_str() + ")");
+  N.Signal = NewCurve(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel)+ " (" + ToPixel(0, Board, Chip, Channel) + ")");
   N.Board = Board;
   N.Chip = Chip;
@@ -1090,5 +1091,5 @@
   ClearCurve(0);
 
-  List.first().Signal->setTitle(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel) + " (" + DRS_to_Pixel(Board, Chip, Channel).c_str() + ")");
+  List.first().Signal->setTitle(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel) + " (" + ToPixel(0, Board, Chip, Channel) + ")");
   List.first().Board = Board;
   List.first().Chip = Chip;
@@ -1269,5 +1270,11 @@
 }
 
-
+// Translate FPA ID to Pixel ID (use '-' instead of PM_ERROR_CODE)
+QString EventScope::ToPixel(unsigned int Crate, unsigned int Board, unsigned int Patch, unsigned int Pixel) {
+  
+  if (FPA_to_Pixel(Crate, Board, Patch, Pixel) == PM_ERROR_CODE) return "-";
+  else return QString::number(FPA_to_Pixel(Crate, Board, Patch, Pixel));
+}
+  
 //------------------------------------------------------------------
 //**************************** Tab pages ***************************
@@ -1491,7 +1498,9 @@
 
   // Pixel ID
-  PixelID = new QLineEdit;
+  PixelID = new QSpinBox;
   PixelID->setMaximumWidth(60);
-  connect(PixelID, SIGNAL(returnPressed()), SLOT(TranslatePixelID()));
+  PixelID->setRange(-1, 9999);
+  PixelID->setSpecialValueText("n/a");
+  connect(PixelID, SIGNAL(valueChanged(int)), SLOT(TranslatePixelID(int)));
   PixelID->setToolTip("Pixel identification");
   
@@ -1560,4 +1569,7 @@
   StartStop(false);
   connect(Scope, SIGNAL(PixelData(QVector<double>)), SLOT(SetPixelData(QVector<double>)));
+
+  // Call to get initial pixel ID correct
+  UpdateScope(0);
 }
 
@@ -1568,13 +1580,16 @@
 
 // Translate pixel ID to board, chip, channel
-void TP_DAQ::TranslatePixelID() {
-  
-  if (Scope->Pixel_to_DRSboard(PixelID->text().toStdString()) == 999999999) {
-	QMessageBox::warning(this, "Edd Message","Pixel ID unknown.",QMessageBox::Ok);
-  }
+void TP_DAQ::TranslatePixelID(int ID) {
+
+  // setValue() below will call UpdateScope() through signal, therefore need to store numbers here
+  unsigned int BoardNo = Scope->Pixel_to_FPAboard(ID);
+  unsigned int PatchNo = Scope->Pixel_to_FPApatch(ID);
+  unsigned int PixelNo = Scope->Pixel_to_FPApixel(ID);
+  
+  if (BoardNo == Scope->PM_ERROR_CODE) PixelID->setValue(-1);
   else {
-    Board->setValue(Scope->Pixel_to_DRSboard(PixelID->text().toStdString()));
-    Chip->setValue(Scope->Pixel_to_DRSchip(PixelID->text().toStdString()));
-    Channel->setValue(Scope->Pixel_to_DRSchannel(PixelID->text().toStdString()));
+    Board->setValue(BoardNo);
+    Chip->setValue(PatchNo);
+    Channel->setValue(PixelNo);
   }
 }
@@ -1599,5 +1614,7 @@
 
   // Update pixel ID
-  PixelID->setText(Scope->DRS_to_Pixel(Board->value(), Chip->value(), Channel->value()).c_str());
+  PixelID->setValue(Scope->FPA_to_Pixel(0, Board->value(), Chip->value(), Channel->value()));
+  if (PixelID->value() == (int) Scope->PM_ERROR_CODE) PixelID->setValue(-1);
+  
   // Update first trace
   Scope->UpdateFirst(Board->value(), Chip->value(), Channel->value());
@@ -1885,4 +1902,9 @@
   if (argc > 1) DRSBoard = "FADctrl";
 
+  // Make RPC to get pixelmap
+  DimRpcInfo RPC((char *) "ConfigRequest", (char *) "");
+  RPC.setData((char *) "Misc PixelMap");
+  PixelMapText = std::string(RPC.getString(), RPC.getSize());
+
   QApplication app(argc, argv); 
   GUI MainWindow;
Index: /fact/Evidence/Edd/Edd.h
===================================================================
--- /fact/Evidence/Edd/Edd.h	(revision 10117)
+++ /fact/Evidence/Edd/Edd.h	(revision 10118)
@@ -290,4 +290,5 @@
 	void AddTrace(int, int, int);
 	void SetActive(bool);
+	QString ToPixel(unsigned int, unsigned int, unsigned int, unsigned int);
 
   private slots:
@@ -339,6 +340,5 @@
     QPlainTextEdit *RunHeaderDisplay, *EventHeaderDisplay;
 
- 	QSpinBox *Channel, *Chip, *Board;
- 	QLineEdit *PixelID;
+ 	QSpinBox *Channel, *Chip, *Board, *PixelID;
  	QFormLayout *FormLayout;
 	QWidget *Display;
@@ -347,5 +347,5 @@
 
   private slots:
-	void TranslatePixelID();
+	void TranslatePixelID(int);
 	void UpdateScope(int);
 	void KeepCurrent();
Index: /fact/Feedback/Feedback.cc
===================================================================
--- /fact/Feedback/Feedback.cc	(revision 10117)
+++ /fact/Feedback/Feedback.cc	(revision 10118)
@@ -10,6 +10,4 @@
 #include "Feedback.h"
 #include "PixelMap.h"
-
-#define PIXMAP_LOCATION "../config/PixelMap.txt"
 
 static const char* FBState_Description[] = {
@@ -42,5 +40,9 @@
 Feedback::Feedback(): EvidenceServer(SERVER_NAME) {
 
-  PixMap = new PixelMap(PIXMAP_LOCATION, false);
+  // Make RPC to get pixelmap
+  DimRpcInfo RPC((char *) "ConfigRequest", (char *) "");
+  RPC.setData((char *) "Misc PixelMap");
+
+  PixMap = new PixelMap(std::string(RPC.getString(), RPC.getSize()));
   TimeBarrier = 0;
 
@@ -52,22 +54,12 @@
   fIDTable = Tokenize(GetConfig("IDTable"), " \t");
   Multiplicity = new unsigned int [fIDTable.size()];
-  
-  multiset<string> A;
-  char *Buf;
-  
+
+  // Determine multiplicity of bias to pixel connection  
+  std::vector<unsigned int> A;
   for (unsigned int i=0; i<fIDTable.size(); i++) {
- 	if (asprintf(&Buf, "BiasID%d%d%d", PixMap->Pixel_to_HVboard(fIDTable[i]),
-	  	PixMap->Pixel_to_HVchain(fIDTable[i]), PixMap->Pixel_to_HVchannel(fIDTable[i])) == -1) Message(FATAL, "asprintf() failed");
-	A.insert(Buf);
-	free(Buf);
-  }
-  
-  for (unsigned int i=0; i<fIDTable.size(); i++) {
- 	if (asprintf(&Buf, "BiasID%d%d%d", PixMap->Pixel_to_HVboard(fIDTable[i]),
-	  	PixMap->Pixel_to_HVchain(fIDTable[i]), PixMap->Pixel_to_HVchannel(fIDTable[i])) == -1) Message(FATAL, "asprintf() failed");
-	Multiplicity[i] = A.count(Buf);
-	free(Buf);
-  }
-
+	A = PixMap->HV_to_Pixel(PixMap->Pixel_to_HVcrate(atoi(fIDTable[i].c_str())), PixMap->Pixel_to_HVboard(atoi(fIDTable[i].c_str())), PixMap->Pixel_to_HVchannel(atoi(fIDTable[i].c_str())));
+	Multiplicity[i] = A.size();
+  }
+  
   // Initialise with zero content ???
   Average    = new float [fIDTable.size()];
@@ -227,5 +219,5 @@
   float Correction;
 
-  // Refect data is feedback off or timestamp too early
+  // Reject data if feedback off or timestamp too early
   if (FBMode == Off || getCommand()->getTimestamp() < TimeBarrier) return;
   TimeBarrier = 0;
@@ -298,5 +290,5 @@
   // Send command (non-blocking since in handler thread)
   if (!Cmd.str().empty()) {
-	DimClient::sendCommandNB("Bias/Command", (char *) ("hv "+Cmd.str()).c_str());
+	DimClient::sendCommandNB("Bias/Command", (char *) ("pixel "+Cmd.str()).c_str());
   }
 
@@ -385,15 +377,15 @@
   // Build command
   for (unsigned int i=0; i<fIDTable.size(); i++) { 
-	Cmd << fIDTable[i] << " " << std::showpos << -U/2/Multiplicity[i] << " ";		  		  
+	Cmd << fIDTable[i] << " " << std::showpos << -U/2/Multiplicity[i] << " ";
   }
   
   // Send command
   if (!Cmd.str().empty()) {
-	DimClient::sendCommand("Bias/Command", ("hv "+Cmd.str()).c_str());
+	DimClient::sendCommand("Bias/Command", ("pixel "+Cmd.str()).c_str());
   }
 
   DiffVoltage = U;
   SetFBMode(ResponseFirst);
-  PrintMessage("HV Feedback: Decreasing voltages by %f for response measurement, acquiring data.\n",DiffVoltage/2);
+  PrintMessage("Feedback: Decreasing voltages by %f for response measurement, acquiring data.\n",DiffVoltage/2);
 }
 
@@ -439,5 +431,5 @@
 void Feedback::commandHandler() {
 
-  string Command = ToString("C", getCommand()->getData(), getCommand()->getSize());
+  string Command = ToString((char *) "C", getCommand()->getData(), getCommand()->getSize());
   
   // Parse command into tokens
Index: /fact/Feedback/Makefile
===================================================================
--- /fact/Feedback/Makefile	(revision 10117)
+++ /fact/Feedback/Makefile	(revision 10118)
@@ -12,5 +12,5 @@
 
 CPPFLAGS = -DREVISION='"$(REVISION)"' -O3 -Wall
-LIBS = -lstdc++ -lz -lpthread -lutil -lfl -lreadline -ltermcap $(DIMDIR)/linux/libdim.a
+LIBS = -L /usr/lib/termcap -lstdc++ -lz -lpthread -lutil -lfl -lreadline -ltermcap $(DIMDIR)/linux/libdim.a
 
 Feedback: $(OBJECTS)
Index: ct/config/PixelMap.txt
===================================================================
--- /fact/config/PixelMap.txt	(revision 10117)
+++ 	(revision )
@@ -1,76 +1,0 @@
-#######################################################################
-#
-# Mapping table to connect DRS channels to HV channels   
-#
-# =====================================================================
-#
-# needed for HV feedback -> read by DAQ and HV program
-# 
-# to be edited if DRS or HV channels change
-#
-# Format for pixel names is (x-x-x), to be followed by : delimiter
-#
-# gAPD arrangement within pixel is NOT defined here
-#
-# =====================================================================
-#
-# allowed field separators: space and tab in arbitrary combination
-#
-# empty lines allowed
-#
-# lines _starting_ with # considered as comment (first character!)
-#
-# =====================================================================
-#
-# pixel numbering: module-superpixel-pixel
-#
-######################################################################
-
-
-#Pixel:  DRS-board DRS-chip DRS-channel   HV board HV-chain HV-channel
-#---------------------------------------------------------------------
-0-1-1:		0	0	0		0	0	 0
-0-1-2:		0	0	2		0	0	 1
-0-1-3:		0	0	4		0 	0	 2
-0-1-4:		0	0	6		0 	0	 3
-#---------------------------------------------------------------------
-0-2-1:		0	1	0		0	0	 4
-0-2-2:		0	1	2		0	0	 5
-0-2-3:		0	1	4		0 	0	 6
-0-2-4:		0	1	6		0 	0	 7
-#---------------------------------------------------------------------
-0-3-1:		0	2	0		0	0	 8
-0-3-2:		0	2	2		0	0	 9
-0-3-3:		0	2	4		0 	0	10
-0-3-4:		0	2	6		0 	0	11
-#---------------------------------------------------------------------
-0-4-1:		0	3	0		0	0	12
-0-4-2:		0	3	2		0	0	13
-0-4-3:		0	3	4		0 	0	14
-0-4-4:		0	3	6		0 	0	15
-#---------------------------------------------------------------------
-0-5-1:		1	0	0		0	0	16
-0-5-2:		1	0	2		0	0	17
-0-5-3:		1	0	4		0 	1	 0
-0-5-4:		1	0	6		0 	1	 1
-#---------------------------------------------------------------------
-0-6-1:		1	1	0		0	1	 2
-0-6-2:		1	1	2		0	1	 3
-0-6-3:		1	1	4		0 	1	 4
-0-6-4:		1	1	6		0 	1	 5
-#---------------------------------------------------------------------
-0-7-1:		1	2	0		0	1	 6
-0-7-2:		1	2	2		0	1	 7
-0-7-3:		1	2	4		0 	1	 8
-0-7-4:		1	2	6		0 	1	 9
-#---------------------------------------------------------------------
-0-8-1:		1	3	0		0	1	10
-0-8-2:		1	3	2		0	1	11
-0-8-3:		1	3	4		0 	1	12
-0-8-4:		1	3	6		0 	1	13
-#---------------------------------------------------------------------
-0-9-1:		2	0	0		0	1	14
-0-9-2:		2	0	2		0	1	15
-0-9-3:		2	0	4		0 	1	16
-0-9-4:		2	0	6		0 	1	17
-#---------------------------------------------------------------------
Index: ct/config/PixelMap_M0.txt
===================================================================
--- /fact/config/PixelMap_M0.txt	(revision 10117)
+++ 	(revision )
@@ -1,74 +1,0 @@
-#######################################################################
-#
-# Mapping table to connect DRS channels to HV channels
-#
-# !!! only valid for M0 !!!
-#
-# =====================================================================
-#
-# needed for HV feedback -> read by DAQ and HV program
-# 
-# to be edited if DRS or HV channels change
-#
-# pixel ID is unsigned int 0 - 35, to be followed by : delimiter
-#
-# gAPD arrangement within pixel is NOT defined here
-#
-# =====================================================================
-#
-# allowed field separators: space and tab in arbitrary combination
-#
-# each entry has to end with ;
-#
-# lines _starting_ with # considered as comment (first character!)
-#
-#######################################################################
-
-
-#ID:  crate  board patch(chip) pixel(channel)  HV-crate HV-board HV-channel    PosX    PosY
-#--------------------------------------------------------------------------------------------------------
-00:	0	0	0	0		0	0	 0		5	5;
-01:	0	0	0	2		0	0	 1		4	5;
-02:	0	0	0	4		0 	0	 2		4	4;
-03:	0	0	0	6		0 	0	 3		5	4;
-#--------------------------------------------------------------------------------------------------------
-04:	0	0	1	0		0	0	 4		5	3;
-05:	0	0	1	2		0	0	 5		4	3;
-06:	0	0	1	4		0 	0	 6		4	2;
-07:	0	0	1	6		0 	0	 7		5	2;
-#--------------------------------------------------------------------------------------------------------
-08:	0	0	2	0		0	0	 8		5	1;
-09:	0	0	2	2		0	0	 9		4	1;
-10:	0	0	2	4		0 	0	10		4	0;
-11:	0	0	2	6		0 	0	11		5	0;
-#--------------------------------------------------------------------------------------------------------
-12:	0	0	3	0		0	0	12		3	5;
-13:	0	0	3	2		0	0	13		2	5;
-14:	0	0	3	4		0 	0	14		2	4;
-15:	0	0	3	6		0 	0	15		3	4;
-#--------------------------------------------------------------------------------------------------------
-16:	0	1	0	0		0	0	16		3	3;
-17:	0	1	0	2		0	0	17		2	3;
-18:	0	1	0	4		0 	1	 0		2	2;
-19:	0	1	0	6		0 	1	 1		3	2;
-#--------------------------------------------------------------------------------------------------------
-20:	0	1	1	0		0	1	 2		3	1;
-21:	0	1	1	2		0	1	 3		2	1;
-22:	0	1	1	4		0 	1	 4		2	0;
-23:	0	1	1	6		0 	1	 5		3	0;
-#--------------------------------------------------------------------------------------------------------
-24:	0	1	2	0		0	1	 6		1	5;
-25:	0	1	2	2		0	1	 7		0	5;
-26:	0	1	2	4		0 	1	 8		0	4;
-27:	0	1	2	6		0 	1	 9		1	4;
-#--------------------------------------------------------------------------------------------------------
-28:	0	1	3	0		0	1	10		1	3;
-29:	0	1	3	2		0	1	11		0	3;
-30:	0	1	3	4		0 	1	12		0	2;
-31:	0	1	3	6		0 	1	13		1	2;
-#--------------------------------------------------------------------------------------------------------
-32:	0	2	0	0		0	1	14		1	1;
-33:	0	2	0	2		0	1	15		0	1;
-34:	0	2	0	4		0 	1	16		0	0;
-35:	0	2	0	6		0 	1	17		1	0;
-#--------------------------------------------------------------------------------------------------------
Index: /fact/drsdaq/Makefile
===================================================================
--- /fact/drsdaq/Makefile	(revision 10117)
+++ /fact/drsdaq/Makefile	(revision 10118)
@@ -26,5 +26,5 @@
 
 CPPFLAGS = -DREVISION='"$(REVISION)"' -O3 -Wall $(VMECTRL)
-LIBS = -lstdc++ -lz -lpthread -lutil -lfl -lreadline -ltermcap $(VMELIB) $(DIMDIR)/linux/libdim.a
+LIBS = -L /usr/lib/termcap -lstdc++ -lz -lpthread -lutil -lfl -lreadline -ltermcap $(VMELIB) $(DIMDIR)/linux/libdim.a
 
 drsdaq: $(OBJECTS)
Index: /fact/tools/Scripts/Logon
===================================================================
--- /fact/tools/Scripts/Logon	(revision 10117)
+++ /fact/tools/Scripts/Logon	(revision 10118)
@@ -12,10 +12,4 @@
 export LD_LIBRARY_PATH=$QWTDIR/lib:$DIMDIR/linux:$LD_LIBRARY_PATH
 export PATH=$DIMDIR/linux:$REPOS_DIR/tools/Scripts:$QTDIR/bin:.:$PATH
-
-echo
-echo Note: Operation needs Evidence configuration server running on $DIM_DNS_NODE
-echo "To start, log on as user 'daqct3' and execute 'start' script"
-echo "Contact: Oliver Grimm (32192) or Quirin Weitzel (33973)"
-echo
 
 # Check if repository is a mixed or locally modified version (only for login shell))
Index: /fact/tools/ddd/Functions.cpp
===================================================================
--- /fact/tools/ddd/Functions.cpp	(revision 10117)
+++ /fact/tools/ddd/Functions.cpp	(revision 10118)
@@ -57,11 +57,6 @@
   BoardNo->setEnabled(true);
   PixelID->setEnabled(true);
-  M0Start->setEnabled(true);
-  M0Stop->setEnabled(true);
   PhysPipeAction->setEnabled(true);
   EventNo->setRange(1, R->Events);
-  M0Display->setEnabled(true);
-  M0Start->setRange(0, R->Samples-1);  
-  M0Stop->setRange(0, R->Samples-1);
   ChannelNo->setRange(0, R->NChannels-1);
   ChipNo->setRange(0, R->NChips-1);
@@ -78,6 +73,4 @@
     BoardNo->setEnabled(false);
     PixelID->setEnabled(false);
-    M0Start->setEnabled(false);
-    M0Stop->setEnabled(false);
 	PhysPipeAction->setEnabled(false);
     RunHeaderDisplay->clear();
@@ -90,5 +83,5 @@
 void ddd::DisplayEvent(int) {
 
-  PixelID->setText(PixMap->DRS_to_Pixel(BoardNo->value(), ChipNo->value(),	ChannelNo->value()).c_str());  // Translate to pixel ID
+  PixelID->setValue(PixMap->FPA_to_Pixel(0, BoardNo->value(), ChipNo->value(),	ChannelNo->value()));  // Translate to pixel ID
   if(Socket->state() == QAbstractSocket::ConnectedState) return; // do not execute if socket is open
   
@@ -149,99 +142,4 @@
   delete[] x;	delete[] y;
 
-  // ************************************   
-  // Get data for M0 display (event based)
-  // ************************************   
-
-  if (!(M0Display->isEnabled())) return;
-
-  double z[6][6] = {{0}};//36 pixels
-  bool IDerror = false;
-
-  //only interested in M0 data using DRS2
-  //if (RD->RHeader->NChannels == 9) IDerror = true;  
-
-  //only interested in M0 data using DRS4
-  if (RD->RHeader->NChannels == 10) IDerror = true;  
-
-  for(unsigned int i=0; i<RD->RHeader->NBoards; i++) {//board loop
-    for(unsigned int j=0; j<RD->RHeader->NChips; j++) {//chip loop
-      for(unsigned int k=0; k<RD->RHeader->NChannels; k++) {//channel loop
-
-	//for DRS2 data (requires the correct pixelmap!!!
-	//if( ( (i==0 || i==1) && (j<=1) && (k<=7) ) || ( (i==2) && (j==0) && (k<=3) ) ) {
-
-	//for DRS4 data (requires the correct pixelmap!!!
-	if( ( (i==0 || i==1) && (j<=3) && (k==0 || k==2 || k==4 || k==6) ) || ( (i==2) && (j==0) && (k==0 || k==2 || k==4 || k==6) ) ) {
-	 
-	  //get module, superpixel and pixel number from pixel name
-	  std::string pixelname = PixMap->DRS_to_Pixel(i,j,k);
-	  if (pixelname == "") {
-	    IDerror = true;
-	    continue;
-	  }
-	  char pixelname_copy[256];
-	  memset(pixelname_copy,'\0',256);
-	  pixelname.copy(pixelname_copy, 256);
-
-	  char delim[] = "-";
-	  char *buffer = NULL;
-	  int module = -1;
-	  int superpixel = -1;
-	  int pixel = -1;
-
-	  buffer = strtok(pixelname_copy, delim);
-	  module = atoi(buffer);
-	  buffer = strtok(NULL, delim);
-	  superpixel = atoi(buffer);
-	  buffer = strtok(NULL, delim);
-	  pixel = atoi(buffer);
-
-	  //usual M0 mapping
-	  //int binx = 5-(int((superpixel-1)/3)*2)-(int((pixel%4)/2));
-	  //int biny = 5-(((superpixel-1)%3)*2)-(int((pixel-1)/2));
-
-	  //M0 upside down
-	  int binx = 5-(5-(int((superpixel-1)/3)*2)-(int((pixel%4)/2)));
-	  int biny = 5-(5-(((superpixel-1)%3)*2)-(int((pixel-1)/2)));
-
-	  //search maximum sample amplitude within user specified window
-	  //start bin is always smaller than stop bin (taken care of by updated ranges)
-	  int StartBin = (int)(M0Start->value());
-	  int StopBin = (int)(M0Stop->value());
-
-	  for(int l=StartBin; l<=StopBin; l++){
-
-	    float sample = *((short *) (RD->Data + RD->RHeader->NBoards*RD->RHeader->NChips*sizeof(int)) + 
-			     i*RD->RHeader->NChips*RD->RHeader->NChannels*RD->RHeader->Samples+
-			     j*RD->RHeader->NChannels*RD->RHeader->Samples+
-			     k*RD->RHeader->Samples+
-			     l)*RD->BStruct[i].ScaleFactor;
-
-	    if (fabs(sample) > z[binx][biny]) {
-	      z[binx][biny]=fabs(sample);
-	    }
-
-	  }//sample loop
-	}//only M0 data
-      }//channel loop
-    }//chip loop
-  }//board loop
-
-  if(IDerror){
-    QMessageBox::warning(this, "ddd Message","Sorry! The M0 display is not available for this data file because of a pixel ID mismatch.",QMessageBox::Ok);
-    if(M0Window->isVisible()) M0Window->hide();
-    M0Display->setEnabled(false);
-    return;
-  }
-
-  //fill data to M0 display (event based)
-  Signal2D->setData(SpectrogramDataM0(z));
-  Graph2D->axisWidget(QwtPlot::yRight)->setColorMap(Signal2D->data().range(),Signal2D->colorMap());
-  Graph2D->setAxisScale(QwtPlot::yRight,Signal2D->data().range().minValue(),Signal2D->data().range().maxValue() );
-  Graph2D->replot();
-
-  //update ranges for start and stop bin to avoid startbin > stopbin
-  M0Start->setRange(0, M0Stop->value());  
-  M0Stop->setRange(M0Start->value(),(RD->RHeader->Samples)-1);
 }
 
@@ -252,12 +150,4 @@
   else SocketWindow->show();
 }
-
-// +++ Open sub window for M0 Display +++
-void ddd::OpenM0Window() {
-
-  if(M0Window->isVisible()) M0Window->hide();
-  else M0Window->show();
-}
-
 
 // +++ Acquire data through socket (acquire botton only available if socket exists) +++
@@ -307,7 +197,4 @@
       CloseDatafile();
 
-      M0Window->hide();
-      M0Display->setEnabled(false);
-
       ChannelNo->setEnabled(true);
       ChipNo->setEnabled(true);
@@ -416,10 +303,11 @@
 
 // +++ Translate pixel ID +++
-void ddd::TranslatePixelID() {
-  
-  int Board = PixMap->Pixel_to_DRSboard(PixelID->text().toStdString());
-  int Chip = PixMap->Pixel_to_DRSchip(PixelID->text().toStdString());
-  int Channel = PixMap->Pixel_to_DRSchannel(PixelID->text().toStdString());
-
+void ddd::TranslatePixelID(int ID) {
+  
+  // setValue() below will call UpdateScope() through signal, therefore need to store numbers here
+  int Board = PixMap->Pixel_to_FPAboard(ID);
+  int Chip = PixMap->Pixel_to_FPApatch(ID);
+  int Channel = PixMap->Pixel_to_FPApixel(ID);
+  
   if(Board	>= BoardNo->minimum()	&& Board	<= BoardNo->maximum() && 
      Chip	>= ChipNo->minimum()	&& Chip		<= ChipNo->maximum() &&
@@ -429,5 +317,5 @@
     ChannelNo->setValue(Channel);
   }
-  else if(Board==999999999) QMessageBox::warning(this, "ddd Message","Pixel ID unknown.",QMessageBox::Ok);
+  else if (Board == (int) PixMap->PM_ERROR_CODE) PixelID->setValue(-1);
   else QMessageBox::warning(this, "ddd Message","Pixel ID out of current range.",QMessageBox::Ok);
 }
Index: /fact/tools/ddd/GUI.cpp
===================================================================
--- /fact/tools/ddd/GUI.cpp	(revision 10117)
+++ /fact/tools/ddd/GUI.cpp	(revision 10118)
@@ -22,5 +22,9 @@
   // Instantiate without console output
   RD = new RawDataCTX(true);
-  PixMap = new PixelMap("../../config/PixelMap.txt", false);
+
+  // Instantiate PixelMap
+  DimRpcInfo RPC((char *) "ConfigRequest", (char *) "");
+  RPC.setData((char *) "Misc PixelMap");
+  PixMap = new PixelMap(std::string(RPC.getString(), RPC.getSize()));
    
   Tmpfile = tmpfile();
@@ -67,8 +71,10 @@
   BoardNo->setToolTip("Mezzanine board number");
  
-   // TextBox for pixel ID
-  PixelID = new QLineEdit(Central);
+  // SpinBox for pixel ID
+  PixelID = new QSpinBox(Central);
   PixelID->setEnabled(false);
-  connect(PixelID, SIGNAL(returnPressed()), this, SLOT(TranslatePixelID()));
+  PixelID->setRange(-1, 9999);
+  PixelID->setSpecialValueText("n/a");
+  connect(PixelID, SIGNAL(valueChanged(int)), this, SLOT(TranslatePixelID(int)));
   PixelID->setToolTip("Pixel identification");
  
@@ -86,10 +92,4 @@
   connect(SocketButton, SIGNAL(clicked()), this, SLOT(OpenSocketWindow()));
   SocketButton->setToolTip("Open window for socket communication");
-
-  // M0 display button
-  M0Display = new QPushButton("M0 Display",Central);
-  M0Display->setFont(QFont("Times", 10, QFont::Bold));
-  connect(M0Display, SIGNAL(clicked()), this, SLOT(OpenM0Window()));
-  M0Display->setToolTip("Open window for M0 display");
 
   // Acquire button and Continuous check box
@@ -150,5 +150,4 @@
   MainLayout->addLayout(FormLayout, 2, 0);
   MainLayout->addWidget(SocketButton, 6,0);
-  MainLayout->addWidget(M0Display, 3,0);
   MainLayout->addWidget(GetButton, 4,0);
   MainLayout->addWidget(ContinuousBox, 5,0);
@@ -229,61 +228,4 @@
   SocketLayout->addWidget(SocketOutput, 2, 0, 4, 4);
 
-  //-----------------------------------------------------------------------
-  //**************************** M0 window ****************************
-  //-----------------------------------------------------------------------
-   
-  M0Window = new QWidget();
-  M0Window->setWindowTitle("ddd - M0 Display");
-
-  Graph2D = new QwtPlot(M0Window);
-  Graph2D->setAutoReplot(true);
-  Graph2D->setCanvasBackground(QColor(Qt::white));
-
-  M0Start = new QSpinBox(M0Window);
-  M0Start->setEnabled(false);
-  connect(M0Start, SIGNAL(valueChanged(int)), this, SLOT(DisplayEvent(int)));
-  M0Start->setToolTip("First bin/sample of time window");
-  M0StartLayout = new QFormLayout;  
-  M0StartLayout->addRow("First Bin", M0Start);
-
-  M0Stop = new QSpinBox(M0Window);
-  M0Stop->setEnabled(false);
-  M0Stop->setRange(0,1023);
-  M0Stop->setValue(1023);
-  connect(M0Stop, SIGNAL(valueChanged(int)), this, SLOT(DisplayEvent(int)));
-  M0Stop->setToolTip("Last bin/sample of time window");
-  M0StopLayout = new QFormLayout;  
-  M0StopLayout->addRow("Last Bin", M0Stop);
-
-  M0Layout = new QGridLayout(M0Window);
-  M0Layout->addWidget(Graph2D, 1,1,3,3);
-  M0Layout->addLayout(M0StartLayout,4,1);
-  M0Layout->addLayout(M0StopLayout,4,2);
-
-  Signal2D = new QwtPlotSpectrogram;
-  Signal2D->attach(Graph2D);
-
-  //initialize raster data of M0 display
-  double z[6][6];
-  for (int i=0; i<6; i++){
-      for (int j=0; j<6; j++){
-	  z[i][j]=i+j;
-      }
-  }
-  Signal2D->setData(SpectrogramDataM0(z));
-
-  //color (z-) axis of M0 display
-  colorMap = QwtLinearColorMap(Qt::yellow, Qt::red);  
-  Signal2D->setColorMap(colorMap);
-
-  Graph2D->axisWidget(QwtPlot::yRight)->setTitle("Maximum Sample Amplitude (mV)");
-  Graph2D->axisWidget(QwtPlot::yRight)->setColorBarEnabled(true);
-  Graph2D->axisWidget(QwtPlot::yRight)->setColorMap(Signal2D->data().range(),Signal2D->colorMap());
-
-  Graph2D->setAxisScale(QwtPlot::yRight,Signal2D->data().range().minValue(),Signal2D->data().range().maxValue());
-  Graph2D->enableAxis(QwtPlot::yRight);
-  Graph2D->plotLayout()->setAlignCanvasToScales(true);
-  Graph2D->replot();
-
 }
 
@@ -291,13 +233,10 @@
   // Qwt items
   delete Grid;			delete Signal;
-  delete Signal2D;
   // Layout items
   delete PortLayout;		delete CommandLayout;
-  delete M0StartLayout;         delete M0StopLayout;
   delete AddressLayout;		delete FormLayout;
   delete SpinLayout;
   // Other items 		
   delete SocketWindow;
-  delete M0Window;
   delete PixMap;		delete RD;
   
Index: /fact/tools/ddd/GUI.h
===================================================================
--- /fact/tools/ddd/GUI.h	(revision 10117)
+++ /fact/tools/ddd/GUI.h	(revision 10118)
@@ -10,12 +10,8 @@
 #include <qwt_plot_zoomer.h>
 #include <qwt_plot_panner.h>
-#include <qwt_plot_spectrogram.h>
-#include <qwt_raster_data.h>
-#include <qwt_scale_widget.h>
-#include <qwt_plot_layout.h>
-#include <qwt_color_map.h>
 
 #include "../../drsdaq/RawDataCTX.h"
 #include "../../pixelmap/PixelMap.h"
+#include "dic.hxx"
 
 #define SOCKET_TIMEOUT 10000	// Milliseconds to wait for socket connection
@@ -28,25 +24,23 @@
     Q_OBJECT
 
-    QPushButton *GetButton, *SocketButton, *Connect, *M0Display;
+    QPushButton *GetButton, *SocketButton, *Connect;
     QCheckBox *ContinuousBox;
     QToolButton *LoadButton;
-    QLineEdit *FilenameBox, *IPAddress, *Command, *PixelID;
-    QSpinBox *EventNo, *ChannelNo, *ChipNo, *BoardNo, *Port, *M0Start, *M0Stop;
+    QLineEdit *FilenameBox, *IPAddress, *Command;
+    QSpinBox *PixelID, *EventNo, *ChannelNo, *ChipNo, *BoardNo, *Port;
     QPlainTextEdit *RunHeaderDisplay, *EventHeaderDisplay, *SocketOutput;
     QTabWidget *TabWidget;
     QTcpSocket *Socket;
-    QWidget *SocketWindow, *Central, *M0Window;
+    QWidget *SocketWindow, *Central;
     QAction *OpenAction, *ConnectAction, *PhysPipeAction;
-    QGridLayout *SocketLayout, *MainLayout, *M0Layout;
-    QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout, *M0StartLayout, *M0StopLayout;
+    QGridLayout *SocketLayout, *MainLayout;
+    QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout;
     
-    QwtPlot *Graph, *Graph2D;
+    QwtPlot *Graph;
     QwtPlotZoomer *Zoomer;
     QwtPlotCurve *Signal;
     QwtPlotPanner *Panner;
     QwtPlotGrid *Grid;
-    QwtPlotSpectrogram *Signal2D;
-    QwtLinearColorMap colorMap;
-    
+
     void closeEvent(QCloseEvent *); 
 
@@ -66,5 +60,4 @@
     void FileDialog();
     void OpenSocketWindow();
-    void OpenM0Window();
     void GetSignalFromSocket();
     void MakeConnection();
@@ -73,5 +66,5 @@
     void GotDisconnected();
     void HandleZoom(const QwtDoubleRect &);
-    void TranslatePixelID();
+    void TranslatePixelID(int);
     
     void MenuSave();
@@ -81,46 +74,2 @@
     void MenuAbout();
 };
-
-//Data class for 2D spectrogram (MO display specific)
-class SpectrogramDataM0: public QwtRasterData {
-
-private:
-
-    double _z[6][6];
-    double _zmin;
-    double _zmax;
-
-public:
-    
-    SpectrogramDataM0(const double z[6][6]): QwtRasterData(QwtDoubleRect(0, 0, 6, 6)) {
-	for (int i = 0; i<6; i++){
-	  for (int j = 0; j<6; j++){
-	      _z[i][j] = z[i][j];
-	      if (z[i][j] > _zmax) _zmax = z[i][j];
-	      if (z[i][j] < _zmin) _zmin = z[i][j];
-	   }
-	}
-    }
-
-    virtual QwtRasterData *copy() const {
-	return new SpectrogramDataM0(_z);
-    }
-
-    virtual QwtDoubleInterval range() const {
-        return QwtDoubleInterval(_zmin, _zmax);
-    }
-
-    virtual void initRaster(const QwtDoubleRect = QwtDoubleRect(0, 0, 6, 6),
-			    const QSize =QSize(1,1)) {};	 
-	 	
-    virtual double value(double x, double y) const {
-
-	unsigned int first = (unsigned int)x;
-	unsigned int second = (unsigned int)y;
-
-	const double v = _z[first][second];
-        return v;
-
-    }
-
-};
Index: /fact/tools/ddd/ddd.pro
===================================================================
--- /fact/tools/ddd/ddd.pro	(revision 10117)
+++ /fact/tools/ddd/ddd.pro	(revision 10118)
@@ -6,9 +6,9 @@
 TARGET = 
 DEPENDPATH += .
-INCLUDEPATH += . /ihp/local/qwt-5.2.1/include
+INCLUDEPATH += . .. $(QWTDIR)/include $(DIMDIR)/dim ../../drsdaq ../../pixelmap
 
 # Input
 HEADERS += GUI.h ../../pixelmap/Pixel.h ../../pixelmap/PixelMap.h ../../drsdaq/RawDataCTX.h
 SOURCES += Functions.cpp GUI.cpp ../../pixelmap/Pixel.cc ../../pixelmap/PixelMap.cc ../../drsdaq/RawDataCTX.cc
-LIBS += -L/ihp/local/qwt-5.2.1/lib -lqwt
+LIBS += -L$(QWTDIR)/lib -lqwt $(DIMDIR)/linux/libdim.a
 QT += network
