From fc627cc7b5820230bf282a82380c34e4a08af48c Mon Sep 17 00:00:00 2001
From: Johannes Blume <johannes.blume@desy.de>
Date: Tue, 5 Nov 2019 15:02:02 +0000
Subject: [PATCH] Tagging the Release_1_7 of the  project.

---
 Keithley428.cpp             | 357 +++++++++++++++++++++++++-----------
 Keithley428.h               |  19 +-
 Keithley428.xmi             |   9 +-
 Keithley428Class.cpp        | 145 +++------------
 Keithley428Class.h          |   1 +
 Keithley428StateMachine.cpp |   8 +
 Makefile                    |  18 +-
 7 files changed, 303 insertions(+), 254 deletions(-)

diff --git a/Keithley428.cpp b/Keithley428.cpp
index 7028527..a7c7a2b 100644
--- a/Keithley428.cpp
+++ b/Keithley428.cpp
@@ -183,36 +183,45 @@ void Keithley428::init_device()
     {
         gpib_device = new Tango::DeviceProxy(gpibDevice);
         gpib_device->ping();
-        set_state(Tango::ON);
-        set_status("Keithley428 is ON");
+        
     } 
     catch (Tango::DevFailed &e)
     {
         set_state(Tango::FAULT);
         set_status("Not able to connect to Gpib Device");
     }
+    Tango::DeviceInfo dev_info = gpib_device->info();
 
 
-    if(gpibDeviceType == 1 || gpibDeviceType == 3)
+    
+
+    if(dev_info.dev_class == "PrologixGpib")
     {
+        Tango::DeviceData devin;
+        Tango::DevVarLongArray* args = new Tango::DevVarLongArray;
+        args->length(7);
+        (*args)[0] = gpibDeviceId;
+        (*args)[1] = 0;
+        (*args)[2] = 1;
+        (*args)[3] = 2; 
+        (*args)[4] = 0;
+        (*args)[5] = 0;
+        (*args)[6] = 500;
+        devin << args;
+        gpib_device->command_inout("RegisterDevice", devin);
         m_write_read    = "GPIBWriteRead";
         m_write         = "GPIBWrite";
+        gpib_devicetype = PROLOGIX;
     }
-    else
+    else if(dev_info.dev_class == "GpibDeviceServer")
     {
-        m_write_read    = "WriteRead";
-        m_write         = "Write";
+        m_write_read    = "GPIBWriteRead";
+        m_write         = "GPIBWrite";
     }
-	if(gpibDeviceType == 3)
-	{
-		stringstream tmp;
-		tmp << gpibDeviceId << ',';
-		prepend = tmp.str();
-	}
-	else
-	{
-		prepend = "";
-	}
+
+    set_state(Tango::ON);
+    set_status("Keithley428 is ON");
+
 
 	/*----- PROTECTED REGION END -----*/	//	Keithley428::init_device
 }
@@ -236,7 +245,6 @@ void Keithley428::get_device_property()
 	//	Read device properties from database.
 	Tango::DbData	dev_prop;
 	dev_prop.push_back(Tango::DbDatum("GpibDevice"));
-	dev_prop.push_back(Tango::DbDatum("GpibDeviceType"));
 	dev_prop.push_back(Tango::DbDatum("GpibDeviceId"));
 
 	//	is there at least one property to be read ?
@@ -263,17 +271,6 @@ void Keithley428::get_device_property()
 		//	And try to extract GpibDevice value from database
 		if (dev_prop[i].is_empty()==false)	dev_prop[i]  >>  gpibDevice;
 
-		//	Try to initialize GpibDeviceType from class property
-		cl_prop = ds_class->get_class_property(dev_prop[++i].name);
-		if (cl_prop.is_empty()==false)	cl_prop  >>  gpibDeviceType;
-		else {
-			//	Try to initialize GpibDeviceType from default device value
-			def_prop = ds_class->get_default_device_property(dev_prop[i].name);
-			if (def_prop.is_empty()==false)	def_prop  >>  gpibDeviceType;
-		}
-		//	And try to extract GpibDeviceType value from database
-		if (dev_prop[i].is_empty()==false)	dev_prop[i]  >>  gpibDeviceType;
-
 		//	Try to initialize GpibDeviceId from class property
 		cl_prop = ds_class->get_class_property(dev_prop[++i].name);
 		if (cl_prop.is_empty()==false)	cl_prop  >>  gpibDeviceId;
@@ -290,11 +287,11 @@ void Keithley428::get_device_property()
 	/*----- PROTECTED REGION ID(Keithley428::get_device_property_after) ENABLED START -----*/
 
 	//	Check device property data members init
-	if(gpibDeviceType == 3 && gpibDeviceId < 0)
+	/*if(gpibDeviceType == 3 && gpibDeviceId < 0)
 	{
 		set_state(Tango::FAULT);
 		set_status("Invalid setting for property GpibDeviceId");
-	}
+	}*/
 
 	/*----- PROTECTED REGION END -----*/	//	Keithley428::get_device_property_after
 }
@@ -307,7 +304,7 @@ void Keithley428::get_device_property()
 //--------------------------------------------------------
 void Keithley428::always_executed_hook()
 {
-	INFO_STREAM << "Keithley428::always_executed_hook()  " << device_name << endl;
+	DEBUG_STREAM << "Keithley428::always_executed_hook()  " << device_name << endl;
 	/*----- PROTECTED REGION ID(Keithley428::always_executed_hook) ENABLED START -----*/
 
 	//	code always executed before all requests
@@ -361,20 +358,26 @@ void Keithley428::read_Gain(Tango::Attribute &attr)
 {
 	DEBUG_STREAM << "Keithley428::read_Gain(Tango::Attribute &attr) entering... " << endl;
 	/*----- PROTECTED REGION ID(Keithley428::read_Gain) ENABLED START -----*/
-	DeviceData din;
+    DeviceData din;
     DeviceData dout;
-
-    string tmp_string;
-
     int r_v;
     int w_v;
+    string tmp_string;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "U0X";
+        din << msg;
+    }
+    else
+    {
+        din << "U0X";
+    }
 
-	stringstream tmp;
-	tmp << prepend << "U0X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-    din << buffer;
-
-    dout = gpib_device->command_inout(m_write_read.c_str(), din);  
+    dout = gpib_device->command_inout(m_write_read.c_str(), din);
 
     dout >> tmp_string;
 
@@ -418,15 +421,26 @@ void Keithley428::write_Gain(Tango::WAttribute &attr)
     }
 
 	stringstream tmp;
-	tmp << prepend;
 	if(attr_Gain_write < 11) {
 		tmp << "W0XR" << (int)attr_Gain_write << 'X';
 	}
 	else {
 		tmp << "W1XR10X";
 	}
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-	din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = tmp.str().c_str();
+        din << msg;
+    }
+    else
+    {
+	    Tango::DevString buffer = (char*) tmp.str().c_str();
+	    din << buffer;
+    }
 	gpib_device->command_inout(m_write.c_str(),din);
 
 	/*----- PROTECTED REGION END -----*/	//	Keithley428::write_Gain
@@ -448,11 +462,20 @@ void Keithley428::read_GainStr(Tango::Attribute &attr)
     DeviceData dout;
 
     string tmp_string;
-	stringstream tmp;
-	tmp << prepend << "U3X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
 
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "U3X";
+        din << msg;
+    }
+    else
+    {
+        din << "U3X";;
+    }
 
     dout = gpib_device->command_inout(m_write_read.c_str(),din);  
 
@@ -480,14 +503,23 @@ void Keithley428::read_Overloaded(Tango::Attribute &attr)
 	DeviceData din;
     DeviceData dout;
 
-    string tmp_string;
 
     int overload_flag;
-	stringstream tmp;
-	tmp << prepend << "U1X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
+    string tmp_string;
 
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "U1X";
+        din << msg;
+    }
+    else
+    {
+        din <<  "U1X";
+    }
 
     dout = gpib_device->command_inout(m_write_read.c_str(),din);  
 
@@ -521,11 +553,19 @@ void Keithley428::read_Bypass(Tango::Attribute &attr)
 
     int c_v;
 
-	stringstream tmp;
-	tmp << prepend << "U0X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "U0X";
+        din << msg;
+    }
+    else
+    {
+        din << "U0X";
+    }
 
     dout = gpib_device->command_inout(m_write_read.c_str(),din);  
 
@@ -565,10 +605,21 @@ void Keithley428::write_Bypass(Tango::WAttribute &attr)
             (const char *)"write_Bypass");
     }
 	stringstream tmp;
-	tmp << prepend << 'C' << attr_Bypass_write << 'X';
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-    din << buffer;
-
+	tmp << 'C' << attr_Bypass_write << 'X';
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = tmp.str().c_str();
+        din << msg;
+    }
+    else
+    {
+	    Tango::DevString buffer = (char* )tmp.str().c_str();
+        din << buffer;
+    }
     gpib_device->command_inout(m_write.c_str(),din);
 
 	/*----- PROTECTED REGION END -----*/	//	Keithley428::write_Bypass
@@ -594,12 +645,19 @@ void Keithley428::read_filterState(Tango::Attribute &attr)
 
     int r_v;
 
-	stringstream tmp;
-	tmp << prepend << "U0X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());	
-    
-	din << buffer;
-
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] =  "U0X";
+        din << msg;
+    }
+    else
+    {
+	    din << "U0X";
+    }
     dout = gpib_device->command_inout(m_write_read.c_str(),din);  
 
     dout >> tmp_string;
@@ -645,11 +703,19 @@ void Keithley428::read_autoFilterState(Tango::Attribute &attr)
 
     int r_v;
 
-	stringstream tmp;
-	tmp << prepend << "U0X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "U0X";
+        din << msg;
+    }
+    else
+    {
+        din << "U0X";
+    }
 
     dout = gpib_device->command_inout(m_write_read.c_str(),din);  
 
@@ -691,18 +757,24 @@ void Keithley428::read_RiseTime(Tango::Attribute &attr)
 	DeviceData din;
     DeviceData dout;
 
-    string tmp_string;
     string rise_time_str;
+    string tmp_string;
 
     int value;
 
-	stringstream tmp;
-	tmp << prepend << "U0X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-
-
-    din << buffer;
-
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "U0X";
+        din << msg;
+    }
+    else
+    {
+        din << "U0X";
+    }
     dout = gpib_device->command_inout(m_write_read.c_str(),din);  
 
     dout >> tmp_string;
@@ -769,11 +841,21 @@ void Keithley428::write_RiseTime(Tango::WAttribute &attr)
             (const char *)"write_RiseTime");
     }
 	stringstream tmp;
-	tmp << prepend << 'T' << (int)attr_RiseTime_write << 'X';
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-
-	din << buffer;
-
+	tmp << 'T' << (int)attr_RiseTime_write << 'X';
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = tmp.str().c_str();
+        din << msg;
+    }
+    else
+    {
+	    Tango::DevString buffer = (char*) tmp.str().c_str();
+	    din << buffer;
+    }
     gpib_device->command_inout(m_write.c_str(),din);
 
 	/*----- PROTECTED REGION END -----*/	//	Keithley428::write_RiseTime
@@ -827,11 +909,19 @@ void Keithley428::perform_zero_correct()
 
 	//	Add your own code
 	DeviceData din;
-	stringstream tmp;
-	tmp << prepend << "C2X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-    din << buffer;
-
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "C2X";
+        din << msg;
+    }
+    else
+    {
+        din << "C2X";
+    }
     gpib_device->command_inout(m_write.c_str(),din);
 
 	/*----- PROTECTED REGION END -----*/	//	Keithley428::perform_zero_correct
@@ -850,11 +940,19 @@ void Keithley428::filter_on()
 
 	//	Add your own code
 	DeviceData din;
-	stringstream tmp;
-	tmp << prepend << "P1X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "P1X";
+        din << msg;
+    }
+    else
+    {
+        din << "P1X";
+    }
 
     gpib_device->command_inout(m_write.c_str(),din);
 
@@ -874,11 +972,19 @@ void Keithley428::filter_off()
 
 	//	Add your own code
 	DeviceData din;
-	stringstream tmp;
-	tmp << prepend << "P0X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "P0X";
+        din << msg;
+    }
+    else
+    {
+        din << "P0X";
+    }
 
     gpib_device->command_inout(m_write.c_str(),din);
 
@@ -912,10 +1018,19 @@ void Keithley428::auto_filter_on()
     }
 
     DeviceData din;
-	stringstream tmp;
-	tmp << prepend << "Z1X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "Z1X";
+        din << msg;
+    }
+    else
+    {
+        din << "Z1X";
+    }
 
     gpib_device->command_inout(m_write.c_str(),din);
 
@@ -935,15 +1050,39 @@ void Keithley428::auto_filter_off()
 
 	//	Add your own code
 	DeviceData din;
-	stringstream tmp;
-	tmp << prepend << "Z0X";
-	Tango::DevString buffer = Tango::string_dup(tmp.str().c_str());
-    din << buffer;
+    if(gpib_devicetype == PROLOGIX)
+    {   
+        Tango::DevVarLongStringArray msg;
+        msg.lvalue.length(1);
+        msg.svalue.length(1);
+        msg.lvalue[0] = gpibDeviceId;
+        msg.svalue[0] = "Z0X";
+        din << msg;
+    }
+    else
+    {
+        din << "Z0X";
+    }
 
     gpib_device->command_inout(m_write.c_str(),din);
 
 	/*----- PROTECTED REGION END -----*/	//	Keithley428::auto_filter_off
 }
+//--------------------------------------------------------
+/**
+ *	Method      : Keithley428::add_dynamic_commands()
+ *	Description : Create the dynamic commands if any
+ *                for specified device.
+ */
+//--------------------------------------------------------
+void Keithley428::add_dynamic_commands()
+{
+	/*----- PROTECTED REGION ID(Keithley428::add_dynamic_commands) ENABLED START -----*/
+	
+	//	Add your own code to create and add dynamic commands if any
+	
+	/*----- PROTECTED REGION END -----*/	//	Keithley428::add_dynamic_commands
+}
 
 /*----- PROTECTED REGION ID(Keithley428::namespace_ending) ENABLED START -----*/
 
diff --git a/Keithley428.h b/Keithley428.h
index 721db41..b3985c9 100644
--- a/Keithley428.h
+++ b/Keithley428.h
@@ -62,6 +62,10 @@ class Keithley428 : public TANGO_BASE_CLASS
 /*----- PROTECTED REGION ID(Keithley428::Data Members) ENABLED START -----*/
 
 	//		Add your own data members
+private:
+    //string prepend;
+    Tango::DevShort    gpib_devicetype;
+    enum gpib_devtype  {PROLOGIX = 1, GPIBDEV = 2};
 public:
 
   Tango::DevLong	attr_Gain_write;
@@ -75,21 +79,9 @@ public:
 public:
 	//	GpibDevice:	Name of the gpib device connected to the hardware.
 	string	gpibDevice;
-	//	GpibDeviceType:	Type of the Gpib device used to communicate with the Keithley.
-	//  this can be:
-	//  1 -> Desy GpibDevice (default value)
-	//  2 -> Soleil GpibDeviceServer
-	//  3-> Prologix GPIB network adapter. In this case
-	//       the included GpibDevice will be ignored and
-	//      GpibDeviceId has to be set correctly. The Prologix
-	//      device server has to be configured and started
-	//      separatly.
-	Tango::DevUShort	gpibDeviceType;
 	//	GpibDeviceId:	Gpib device ID if this is to be used with a prologix network
 	//  adapter.
-private:
 	Tango::DevShort	gpibDeviceId;
-	string prepend;
 
 //	Attribute data members
 public:
@@ -128,7 +120,7 @@ public:
 	Keithley428(Tango::DeviceClass *cl,const char *s,const char *d);
 	/**
 	 * The device object destructor.
-	 */	
+	 */
 	~Keithley428() {delete_device();};
 
 
@@ -256,6 +248,7 @@ public:
 
 
 
+
 //	Command related methods
 public:
 	/**
diff --git a/Keithley428.xmi b/Keithley428.xmi
index e79a815..813c527 100644
--- a/Keithley428.xmi
+++ b/Keithley428.xmi
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ASCII"?>
 <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl">
-  <classes name="Keithley428" pogoRevision="8.4">
-    <description description="Class for controlling the Keithley428 current amplifier." title="Keithley428 Current Amplifier" sourcePath="/ssd/blume/src/TangoSvn/tango-ds/DeviceClasses/MeasureInstruments/Keithley/Keithley428/trunk" language="Cpp" filestogenerate="XMI   file,Code files" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
+  <classes name="Keithley428" pogoRevision="9.4">
+    <description description="Class for controlling the Keithley428 current amplifier." title="Keithley428 Current Amplifier" sourcePath="/ssd/blume/src/TangoSvn/tango-ds/DeviceClasses/MeasureInstruments/Keithley/Keithley428/trunk" language="Cpp" filestogenerate="XMI   file,Code files,Protected Regions" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
       <inheritances classname="Device_4Impl" sourcePath=""/>
       <identification contact="at mail.desy.de - tnunez" author="tnunez" emailDomain="mail.desy.de" classFamily="Instrumentation" siteSpecific="" platform="Unix Like" bus="GPIB" manufacturer="Keithley" reference="428"/>
     </description>
@@ -9,11 +9,6 @@
       <type xsi:type="pogoDsl:StringType"/>
       <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
     </deviceProperties>
-    <deviceProperties name="GpibDeviceType" description="Type of the Gpib device used to communicate with the Keithley.&#xA;this can be:&#xA;1 -> Desy GpibDevice (default value)&#xA;2 -> Soleil GpibDeviceServer&#xA;3-> Prologix GPIB network adapter. In this case&#xA;     the included GpibDevice will be ignored and&#xA;    GpibDeviceId has to be set correctly. The Prologix&#xA;    device server has to be configured and started&#xA;    separatly.">
-      <type xsi:type="pogoDsl:UShortType"/>
-      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
-      <DefaultPropValue>1</DefaultPropValue>
-    </deviceProperties>
     <deviceProperties name="GpibDeviceId" description="Gpib device ID if this is to be used with a prologix network&#xA;adapter.">
       <type xsi:type="pogoDsl:ShortType"/>
       <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
diff --git a/Keithley428Class.cpp b/Keithley428Class.cpp
index e2905ab..c635394 100644
--- a/Keithley428Class.cpp
+++ b/Keithley428Class.cpp
@@ -123,8 +123,8 @@ Keithley428Class *Keithley428Class::init(const char *name)
 		catch (bad_alloc &)
 		{
 			throw;
-		}		
-	}		
+		}
+	}
 	return _instance;
 }
 
@@ -320,20 +320,6 @@ void Keithley428Class::set_default_property()
 		dev_def_prop.push_back(data);
 		add_wiz_dev_prop(prop_name, prop_desc,  prop_def);
 	}
-	else
-		add_wiz_dev_prop(prop_name, prop_desc);
-	prop_name = "GpibDeviceType";
-	prop_desc = "Type of the Gpib device used to communicate with the Keithley.\nthis can be:\n1 -> Desy GpibDevice (default value)\n2 -> Soleil GpibDeviceServer\n3-> Prologix GPIB network adapter. In this case\n     the included GpibDevice will be ignored and\n    GpibDeviceId has to be set correctly. The Prologix\n    device server has to be configured and started\n    separatly.";
-	prop_def  = "1";
-	vect_data.clear();
-	vect_data.push_back("1");
-	if (prop_def.length()>0)
-	{
-		Tango::DbDatum	data(prop_name);
-		data << vect_data ;
-		dev_def_prop.push_back(data);
-		add_wiz_dev_prop(prop_name, prop_desc,  prop_def);
-	}
 	else
 		add_wiz_dev_prop(prop_name, prop_desc);
 	prop_name = "GpibDeviceId";
@@ -382,104 +368,6 @@ void Keithley428Class::write_class_property()
 	description << str_desc;
 	data.push_back(description);
 
-	//	put cvs or svn location
-	string	filename("Keithley428");
-	filename += "Class.cpp";
-
-	// check for cvs information
-	string	src_path(CvsPath);
-	start = src_path.find("/");
-	if (start!=string::npos)
-	{
-		end   = src_path.find(filename);
-		if (end>start)
-		{
-			string	strloc = src_path.substr(start, end-start);
-			//	Check if specific repository
-			start = strloc.find("/cvsroot/");
-			if (start!=string::npos && start>0)
-			{
-				string	repository = strloc.substr(0, start);
-				if (repository.find("/segfs/")!=string::npos)
-					strloc = "ESRF:" + strloc.substr(start, strloc.length()-start);
-			}
-			Tango::DbDatum	cvs_loc("cvs_location");
-			cvs_loc << strloc;
-			data.push_back(cvs_loc);
-		}
-	}
-
-	// check for svn information
-	else
-	{
-		string	src_path(SvnPath);
-		start = src_path.find("://");
-		if (start!=string::npos)
-		{
-			end = src_path.find(filename);
-			if (end>start)
-			{
-				header = "$HeadURL: ";
-				start = header.length();
-				string	strloc = src_path.substr(start, (end-start));
-				
-				Tango::DbDatum	svn_loc("svn_location");
-				svn_loc << strloc;
-				data.push_back(svn_loc);
-			}
-		}
-	}
-
-	//	Get CVS or SVN revision tag
-	
-	// CVS tag
-	string	tagname(TagName);
-	header = "$Name: ";
-	start = header.length();
-	string	endstr(" $");
-	
-	end   = tagname.find(endstr);
-	if (end!=string::npos && end>start)
-	{
-		string	strtag = tagname.substr(start, end-start);
-		Tango::DbDatum	cvs_tag("cvs_tag");
-		cvs_tag << strtag;
-		data.push_back(cvs_tag);
-	}
-	
-	// SVN tag
-	string	svnpath(SvnPath);
-	header = "$HeadURL: ";
-	start = header.length();
-	
-	end   = svnpath.find(endstr);
-	if (end!=string::npos && end>start)
-	{
-		string	strloc = svnpath.substr(start, end-start);
-		
-		string tagstr ("/tags/");
-		start = strloc.find(tagstr);
-		if ( start!=string::npos )
-		{
-			start = start + tagstr.length();
-			end   = strloc.find(filename);
-			string	strtag = strloc.substr(start, end-start-1);
-			
-			Tango::DbDatum	svn_tag("svn_tag");
-			svn_tag << strtag;
-			data.push_back(svn_tag);
-		}
-	}
-
-	//	Get URL location
-	string	httpServ(HttpServer);
-	if (httpServ.length()>0)
-	{
-		Tango::DbDatum	db_doc_url("doc_url");
-		db_doc_url << httpServ;
-		data.push_back(db_doc_url);
-	}
-
 	//  Put inheritance
 	Tango::DbDatum	inher_datum("InheritedFrom");
 	vector<string> inheritance;
@@ -750,6 +638,7 @@ void Keithley428Class::attribute_factory(vector<Tango::Attr *> &att_list)
 	//	Not Memorized
 	att_list.push_back(risetimestr);
 
+
 	//	Create a list of static attributes
 	create_static_attribute_list(get_class_attr()->get_attr_list());
 	/*----- PROTECTED REGION ID(Keithley428Class::attribute_factory_after) ENABLED START -----*/
@@ -759,6 +648,26 @@ void Keithley428Class::attribute_factory(vector<Tango::Attr *> &att_list)
 	/*----- PROTECTED REGION END -----*/	//	Keithley428Class::attribute_factory_after
 }
 //--------------------------------------------------------
+/**
+ *	Method      : Keithley428Class::pipe_factory()
+ *	Description : Create the pipe object(s)
+ *                and store them in the pipe list
+ */
+//--------------------------------------------------------
+void Keithley428Class::pipe_factory()
+{
+	/*----- PROTECTED REGION ID(Keithley428Class::pipe_factory_before) ENABLED START -----*/
+	
+	//	Add your own code
+	
+	/*----- PROTECTED REGION END -----*/	//	Keithley428Class::pipe_factory_before
+	/*----- PROTECTED REGION ID(Keithley428Class::pipe_factory_after) ENABLED START -----*/
+	
+	//	Add your own code
+	
+	/*----- PROTECTED REGION END -----*/	//	Keithley428Class::pipe_factory_after
+}
+//--------------------------------------------------------
 /**
  *	Method      : Keithley428Class::command_factory()
  *	Description : Create the command object(s)
@@ -831,7 +740,7 @@ void Keithley428Class::command_factory()
  * method : 		Keithley428Class::create_static_attribute_list
  * description : 	Create the a list of static attributes
  *
- * @param	att_list	the ceated attribute list 
+ * @param	att_list	the ceated attribute list
  */
 //--------------------------------------------------------
 void Keithley428Class::create_static_attribute_list(vector<Tango::Attr *> &att_list)
@@ -865,10 +774,10 @@ void Keithley428Class::erase_dynamic_attributes(const Tango::DevVarStringArray *
 	Tango::Util *tg = Tango::Util::instance();
 
 	for (unsigned long i=0 ; i<devlist_ptr->length() ; i++)
-	{	
+	{
 		Tango::DeviceImpl *dev_impl = tg->get_device_by_name(((string)(*devlist_ptr)[i]).c_str());
 		Keithley428 *dev = static_cast<Keithley428 *> (dev_impl);
-		
+
 		vector<Tango::Attribute *> &dev_att_list = dev->get_device_attr()->get_attribute_list();
 		vector<Tango::Attribute *>::iterator ite_att;
 		for (ite_att=dev_att_list.begin() ; ite_att != dev_att_list.end() ; ++ite_att)
@@ -900,7 +809,7 @@ void Keithley428Class::erase_dynamic_attributes(const Tango::DevVarStringArray *
 Tango::Attr *Keithley428Class::get_attr_object_by_name(vector<Tango::Attr *> &att_list, string attname)
 {
 	vector<Tango::Attr *>::iterator it;
-	for (it=att_list.begin() ; it<att_list.end() ; it++)
+	for (it=att_list.begin() ; it<att_list.end() ; ++it)
 		if ((*it)->get_name()==attname)
 			return (*it);
 	//	Attr does not exist
diff --git a/Keithley428Class.h b/Keithley428Class.h
index 8e047b0..9d7f1b3 100644
--- a/Keithley428Class.h
+++ b/Keithley428Class.h
@@ -312,6 +312,7 @@ public:
 		static Keithley428Class *_instance;
 		void command_factory();
 		void attribute_factory(vector<Tango::Attr *> &);
+		void pipe_factory();
 		void write_class_property();
 		void set_default_property();
 		void get_class_property();
diff --git a/Keithley428StateMachine.cpp b/Keithley428StateMachine.cpp
index 7d4f334..e8704b0 100644
--- a/Keithley428StateMachine.cpp
+++ b/Keithley428StateMachine.cpp
@@ -288,6 +288,7 @@ bool Keithley428::is_RiseTimeStr_allowed(TANGO_UNUSED(Tango::AttReqType type))
 	return true;
 }
 
+
 //=================================================
 //		Commands Allowed Methods
 //=================================================
@@ -387,4 +388,11 @@ bool Keithley428::is_AutoFilterOff_allowed(TANGO_UNUSED(const CORBA::Any &any))
 	return true;
 }
 
+
+/*----- PROTECTED REGION ID(Keithley428::Keithley428StateAllowed.AdditionalMethods) ENABLED START -----*/
+
+//	Additional Methods
+
+/*----- PROTECTED REGION END -----*/	//	Keithley428::Keithley428StateAllowed.AdditionalMethods
+
 }	//	End of namespace
diff --git a/Makefile b/Makefile
index bb8a283..a067448 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ MAKE_ENV = $(TANGO_DIR)/Libraries/cppserver/common
 #
 PACKAGE_NAME = Keithley428
 MAJOR_VERS   = 1
-MINOR_VERS   = 5
+MINOR_VERS   = 7
 RELEASE      = Release_$(MAJOR_VERS)_$(MINOR_VERS)
 
 # #=============================================================================
@@ -37,7 +37,7 @@ RELEASE      = Release_$(MAJOR_VERS)_$(MINOR_VERS)
 # # - DEBUG     : debug symbols - no optimization
 # # - OPTIMIZED : no debug symbols - optimization level set to O2
 # #-----------------------------------------------------------------------------
-RELEASE_TYPE = DEBUG
+# RELEASE_TYPE = DEBUG
 
 #=============================================================================
 # OUTPUT_TYPE can be one of the following :
@@ -56,16 +56,20 @@ OUTPUT_TYPE = DEVICE
 #	- $HOME/DeviceServers if OUTPUT_TYPE is DEVICE
 #	- ../bin for others
 #
-OUTPUT_DIR = ./bin/$(BIN_DIR)
+#OUTPUT_DIR = ./bin/$(BIN_DIR)
 
 
 #
 # if 'make using_trunk=1' use the trunk directories
 #
-ifdef using_trunk
+using_trunk ?= 0
+
+ifeq ($(using_trunk), 1)
   GPIB_DIR = $(TANGO_DIR)/DeviceClasses/Communication/GpibDeviceServer/trunk
+  RELEASE_TYPE = DEBUG
 else
   GPIB_DIR = $(shell find $(TANGO_DIR)/DeviceClasses/Communication/GpibDeviceServer/tags -type d -regex '.*Release_[0-9]*_[0-9]*' | sort -t '_' -k2 -k3 -nr | head -1)
+  RELEASE_TYPE = OPTIMIZED
 endif
 
 #=============================================================================
@@ -82,7 +86,7 @@ INC_DIR_USER= -I . -I$(GPIB_DIR)
 #   - for a device server, tango libraries directories are automatically appended
 #   - '-L ../lib' is automatically appended in all cases
 #
-LIB_DIR_USER=
+LIB_DIR_USER= -L$(GPIB_DIR)/$(_libdir) -L$(TANGO_HOME)/$(_libdir)
 
 #=============================================================================
 # LFLAGS_USR is the list of user link flags
@@ -95,7 +99,7 @@ LIB_DIR_USER=
 # you must use '-lA -lB' in this order as link flags, otherwise you will get
 # 'undefined reference' errors
 #
-LFLAGS_USR+=  $(GPIB_DIR)/bin/libGpibDeviceServer.a  $(TANGO_HOME)/$(_libdir)/libgpib.a
+LFLAGS_USR+=  -lGpibDeviceServer -lgpib
 
 
 #=============================================================================
@@ -157,6 +161,6 @@ include $(MAKE_ENV)/common_target.opt
 
 
 libGpibDeviceServer.a:
-	@echo -e "\n >>> Making $(GPIB_DIR)/bin/libGpibDeviceServer.a \n"
+	@echo -e "\n >>> Making $(GPIB_DIR)/$(_libdir)/libGpibDeviceServer.a \n"
 	cd $(GPIB_DIR) && make  OUTPUT_TYPE=STATIC_LIB
 #PROTECTED REGION END#
-- 
GitLab