Commit a7fe0a61 authored by Yuelong Yu's avatar Yuelong Yu
Browse files

added temperature display

parent 2be5f7b5
......@@ -65,9 +65,25 @@ static const char *RcsId = "$Id: $";
//================================================================
//================================================================
// Attributes managed is:
// Attributes managed are:
//================================================================
// RawMatrix | Tango::DevShort Spectrum ( max = 6000)
// Temperature1 | Tango::DevString Scalar
// Temperature2 | Tango::DevString Scalar
// Temperature3 | Tango::DevString Scalar
// Temperature4 | Tango::DevString Scalar
// Temperature5 | Tango::DevString Scalar
// Temperature6 | Tango::DevString Scalar
// Temperature7 | Tango::DevString Scalar
// Temperature8 | Tango::DevString Scalar
// Temperature9 | Tango::DevString Scalar
// Temperature10 | Tango::DevString Scalar
// Temperature11 | Tango::DevString Scalar
// Temperature12 | Tango::DevString Scalar
// Temperature13 | Tango::DevString Scalar
// Temperature14 | Tango::DevString Scalar
// Temperature15 | Tango::DevString Scalar
// Temperature16 | Tango::DevString Scalar
// RawMatrix | Tango::DevShort Spectrum ( max = 6000)
//================================================================
namespace AGIPDMC_ns
......@@ -134,6 +150,22 @@ void AGIPDMC::delete_device()
/*----- PROTECTED REGION END -----*/ // AGIPDMC::delete_device
delete[] attr_Temperature1_read;
delete[] attr_Temperature2_read;
delete[] attr_Temperature3_read;
delete[] attr_Temperature4_read;
delete[] attr_Temperature5_read;
delete[] attr_Temperature6_read;
delete[] attr_Temperature7_read;
delete[] attr_Temperature8_read;
delete[] attr_Temperature9_read;
delete[] attr_Temperature10_read;
delete[] attr_Temperature11_read;
delete[] attr_Temperature12_read;
delete[] attr_Temperature13_read;
delete[] attr_Temperature14_read;
delete[] attr_Temperature15_read;
delete[] attr_Temperature16_read;
delete[] attr_RawMatrix_read;
}
......@@ -156,12 +188,47 @@ void AGIPDMC::init_device()
// Get the device properties from database
get_device_property();
attr_Temperature1_read = new Tango::DevString[1];
attr_Temperature2_read = new Tango::DevString[1];
attr_Temperature3_read = new Tango::DevString[1];
attr_Temperature4_read = new Tango::DevString[1];
attr_Temperature5_read = new Tango::DevString[1];
attr_Temperature6_read = new Tango::DevString[1];
attr_Temperature7_read = new Tango::DevString[1];
attr_Temperature8_read = new Tango::DevString[1];
attr_Temperature9_read = new Tango::DevString[1];
attr_Temperature10_read = new Tango::DevString[1];
attr_Temperature11_read = new Tango::DevString[1];
attr_Temperature12_read = new Tango::DevString[1];
attr_Temperature13_read = new Tango::DevString[1];
attr_Temperature14_read = new Tango::DevString[1];
attr_Temperature15_read = new Tango::DevString[1];
attr_Temperature16_read = new Tango::DevString[1];
attr_RawMatrix_read = new Tango::DevShort[6000];
/*----- PROTECTED REGION ID(AGIPDMC::init_device) ENABLED START -----*/
// Initialize device
Tango::DevString strDefaultTemperature = "-9999;-9999;-9999";
*attr_Temperature1_read = strDefaultTemperature;
*attr_Temperature2_read = strDefaultTemperature;
*attr_Temperature3_read = strDefaultTemperature;
*attr_Temperature4_read = strDefaultTemperature;
*attr_Temperature5_read = strDefaultTemperature;
*attr_Temperature6_read = strDefaultTemperature;
*attr_Temperature7_read = strDefaultTemperature;
*attr_Temperature8_read = strDefaultTemperature;
*attr_Temperature9_read = strDefaultTemperature;
*attr_Temperature10_read = strDefaultTemperature;
*attr_Temperature11_read = strDefaultTemperature;
*attr_Temperature12_read = strDefaultTemperature;
*attr_Temperature13_read = strDefaultTemperature;
*attr_Temperature14_read = strDefaultTemperature;
*attr_Temperature15_read = strDefaultTemperature;
*attr_Temperature16_read = strDefaultTemperature;
std::fill(attr_RawMatrix_read,attr_RawMatrix_read+6000,0);
m_nDataLength = 6000;
......@@ -208,6 +275,7 @@ void AGIPDMC::get_device_property()
// Read device properties from database.
Tango::DbData dev_prop;
dev_prop.push_back(Tango::DbDatum("TTTGWDeviceName"));
dev_prop.push_back(Tango::DbDatum("NumberOfModules"));
// is there at least one property to be read ?
if (dev_prop.size()>0)
......@@ -233,6 +301,17 @@ void AGIPDMC::get_device_property()
// And try to extract TTTGWDeviceName value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> tTTGWDeviceName;
// Try to initialize NumberOfModules from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> numberOfModules;
else {
// Try to initialize NumberOfModules from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> numberOfModules;
}
// And try to extract NumberOfModules value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> numberOfModules;
}
/*----- PROTECTED REGION ID(AGIPDMC::get_device_property_after) ENABLED START -----*/
......@@ -274,6 +353,294 @@ void AGIPDMC::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_attr_hardware
}
//--------------------------------------------------------
/**
* Read attribute Temperature1 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature1(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature1(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature1) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature1_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature1
}
//--------------------------------------------------------
/**
* Read attribute Temperature2 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature2(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature2(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature2) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature2_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature2
}
//--------------------------------------------------------
/**
* Read attribute Temperature3 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature3(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature3(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature3) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature3_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature3
}
//--------------------------------------------------------
/**
* Read attribute Temperature4 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature4(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature4(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature4) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature4_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature4
}
//--------------------------------------------------------
/**
* Read attribute Temperature5 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature5(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature5(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature5) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature5_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature5
}
//--------------------------------------------------------
/**
* Read attribute Temperature6 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature6(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature6(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature6) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature6_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature6
}
//--------------------------------------------------------
/**
* Read attribute Temperature7 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature7(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature7(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature7) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature7_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature7
}
//--------------------------------------------------------
/**
* Read attribute Temperature8 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature8(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature8(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature8) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature8_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature8
}
//--------------------------------------------------------
/**
* Read attribute Temperature9 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature9(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature9(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature9) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature9_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature9
}
//--------------------------------------------------------
/**
* Read attribute Temperature10 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature10(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature10(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature10) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature10_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature10
}
//--------------------------------------------------------
/**
* Read attribute Temperature11 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature11(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature11(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature11) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature11_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature11
}
//--------------------------------------------------------
/**
* Read attribute Temperature12 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature12(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature12(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature12) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature12_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature12
}
//--------------------------------------------------------
/**
* Read attribute Temperature13 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature13(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature13(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature13) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature13_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature13
}
//--------------------------------------------------------
/**
* Read attribute Temperature14 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature14(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature14(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature14) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature14_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature14
}
//--------------------------------------------------------
/**
* Read attribute Temperature15 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature15(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature15(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature15) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature15_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature15
}
//--------------------------------------------------------
/**
* Read attribute Temperature16 related method
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
//--------------------------------------------------------
void AGIPDMC::read_Temperature16(Tango::Attribute &attr)
{
DEBUG_STREAM << "AGIPDMC::read_Temperature16(Tango::Attribute &attr) entering... " << endl;
/*----- PROTECTED REGION ID(AGIPDMC::read_Temperature16) ENABLED START -----*/
// Set the attribute value
attr.set_value(attr_Temperature16_read);
/*----- PROTECTED REGION END -----*/ // AGIPDMC::read_Temperature16
}
//--------------------------------------------------------
/**
* Read attribute RawMatrix related method
......@@ -343,6 +710,26 @@ void AGIPDMC::add_dynamic_attributes()
//
// }
void AGIPDMC::CreateDynamicAttributes()
{
}// //--------------------------------------------------------
// /**
// * Read attribute StringDynAttr related method
// * Description:
// *
// * Data type: Tango::DevString
// * Attr type: Scalar
// */
// //--------------------------------------------------------
// void AGIPDMC::read_StringDynAttr(Tango::Attribute &attr)
// {
// DEBUG_STREAM << "AGIPDMC::read_StringDynAttr(Tango::Attribute &attr) entering... " << endl;
// // Set the attribute value
// attr.set_value(attr_StringDynAttr_read);
//
// }
/*----- PROTECTED REGION END -----*/ // AGIPDMC::namespace_ending
} // namespace
......@@ -77,12 +77,29 @@ class AGIPDMC : public TANGO_BASE_CLASS
/*----- PROTECTED REGION END -----*/ // AGIPDMC::Data Members
// Device property data members
public:
// TTTGWDeviceName:
string tTTGWDeviceName;
// NumberOfModules:
Tango::DevUShort numberOfModules;
// Attribute data members
public:
Tango::DevString *attr_Temperature1_read;
Tango::DevString *attr_Temperature2_read;
Tango::DevString *attr_Temperature3_read;
Tango::DevString *attr_Temperature4_read;
Tango::DevString *attr_Temperature5_read;
Tango::DevString *attr_Temperature6_read;
Tango::DevString *attr_Temperature7_read;
Tango::DevString *attr_Temperature8_read;
Tango::DevString *attr_Temperature9_read;
Tango::DevString *attr_Temperature10_read;
Tango::DevString *attr_Temperature11_read;
Tango::DevString *attr_Temperature12_read;
Tango::DevString *attr_Temperature13_read;
Tango::DevString *attr_Temperature14_read;
Tango::DevString *attr_Temperature15_read;
Tango::DevString *attr_Temperature16_read;
Tango::DevShort *attr_RawMatrix_read;
// Constructors and destructors
......@@ -145,6 +162,150 @@ public:
//--------------------------------------------------------
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* Attribute Temperature1 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature1(Tango::Attribute &attr);
virtual bool is_Temperature1_allowed(Tango::AttReqType type);
/**
* Attribute Temperature2 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature2(Tango::Attribute &attr);
virtual bool is_Temperature2_allowed(Tango::AttReqType type);
/**
* Attribute Temperature3 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature3(Tango::Attribute &attr);
virtual bool is_Temperature3_allowed(Tango::AttReqType type);
/**
* Attribute Temperature4 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature4(Tango::Attribute &attr);
virtual bool is_Temperature4_allowed(Tango::AttReqType type);
/**
* Attribute Temperature5 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature5(Tango::Attribute &attr);
virtual bool is_Temperature5_allowed(Tango::AttReqType type);
/**
* Attribute Temperature6 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature6(Tango::Attribute &attr);
virtual bool is_Temperature6_allowed(Tango::AttReqType type);
/**
* Attribute Temperature7 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature7(Tango::Attribute &attr);
virtual bool is_Temperature7_allowed(Tango::AttReqType type);
/**
* Attribute Temperature8 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature8(Tango::Attribute &attr);
virtual bool is_Temperature8_allowed(Tango::AttReqType type);
/**
* Attribute Temperature9 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature9(Tango::Attribute &attr);
virtual bool is_Temperature9_allowed(Tango::AttReqType type);
/**
* Attribute Temperature10 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature10(Tango::Attribute &attr);
virtual bool is_Temperature10_allowed(Tango::AttReqType type);
/**
* Attribute Temperature11 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature11(Tango::Attribute &attr);
virtual bool is_Temperature11_allowed(Tango::AttReqType type);
/**
* Attribute Temperature12 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature12(Tango::Attribute &attr);
virtual bool is_Temperature12_allowed(Tango::AttReqType type);
/**
* Attribute Temperature13 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature13(Tango::Attribute &attr);
virtual bool is_Temperature13_allowed(Tango::AttReqType type);
/**
* Attribute Temperature14 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature14(Tango::Attribute &attr);
virtual bool is_Temperature14_allowed(Tango::AttReqType type);
/**
* Attribute Temperature15 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature15(Tango::Attribute &attr);
virtual bool is_Temperature15_allowed(Tango::AttReqType type);
/**
* Attribute Temperature16 related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Temperature16(Tango::Attribute &attr);
virtual bool is_Temperature16_allowed(Tango::AttReqType type);
/**
* Attribute RawMatrix related methods
* Description:
......@@ -173,6 +334,8 @@ public:
/*----- PROTECTED REGION ID(AGIPDMC::Additional Method prototypes) ENABLED START -----*/