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

added mask, bunch pattern and external trigger

parent 058fb127
This diff is collapsed.
......@@ -136,6 +136,9 @@ public:
Tango::DevLong *attr_FileStartNum_read;
Tango::DevString *attr_FilePostfix_read;
Tango::DevBoolean *attr_RotateImage_read;
Tango::DevString *attr_Mask_read;
Tango::DevString *attr_BunchStructureFile_read;
Tango::DevUShort *attr_TriggerMode_read;
Tango::DevShort *attr_LiveDataAnalog_read;
Tango::DevShort *attr_LiveDataDigital_read;
......@@ -467,6 +470,40 @@ public:
virtual void read_RotateImage(Tango::Attribute &attr);
virtual void write_RotateImage(Tango::WAttribute &attr);
virtual bool is_RotateImage_allowed(Tango::AttReqType type);
/**
* Attribute Mask related methods
* Description: Tells which modules are running. It should be 0 or 1 for each module.
* The total length should be 8. The first number is related to the module 0
* which is nearest to master FPGA.
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_Mask(Tango::Attribute &attr);
virtual void write_Mask(Tango::WAttribute &attr);
virtual bool is_Mask_allowed(Tango::AttReqType type);
/**
* Attribute BunchStructureFile related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_BunchStructureFile(Tango::Attribute &attr);
virtual void write_BunchStructureFile(Tango::WAttribute &attr);
virtual bool is_BunchStructureFile_allowed(Tango::AttReqType type);
/**
* Attribute TriggerMode related methods
* Description: trigger mode
* 0: internal trigger
* 1: external trigger
*
* Data type: Tango::DevUShort
* Attr type: Scalar
*/
virtual void read_TriggerMode(Tango::Attribute &attr);
virtual void write_TriggerMode(Tango::WAttribute &attr);
virtual bool is_TriggerMode_allowed(Tango::AttReqType type);
/**
* Attribute LiveDataAnalog related methods
* Description: live image data analog
......@@ -541,6 +578,13 @@ public:
*/
virtual void reset();
virtual bool is_Reset_allowed(const CORBA::Any &any);
/**
* Command LoadBunchStructure related method
* Description:
*
*/
virtual void load_bunch_structure();
virtual bool is_LoadBunchStructure_allowed(const CORBA::Any &any);
/*----- PROTECTED REGION ID(AGIPD::Additional Method prototypes) ENABLED START -----*/
......
......@@ -116,6 +116,15 @@
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="LoadBunchStructure" description="" execMethod="load_bunch_structure" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<attributes name="ADCLatency" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true">
<dataType xsi:type="pogoDsl:UShortType"/>
<changeEvent fire="false" libCheckCriteria="true"/>
......@@ -361,6 +370,30 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="rotate image by 180 degree" label="RotateImage" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="Mask" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="Tells which modules are running. It should be 0 or 1 for each module. &#xA;The total length should be 8. The first number is related to the module 0 &#xA;which is nearest to master FPGA." label="Mask" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="BunchStructureFile" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="BunchStructureFile" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="TriggerMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:UShortType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="trigger mode &#xA;0: internal trigger&#xA;1: external trigger" label="TriggerMode" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="LiveDataAnalog" attType="Image" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="1024" maxY="1024" allocReadMember="true">
<dataType xsi:type="pogoDsl:ShortType"/>
<changeEvent fire="false" libCheckCriteria="true"/>
......
......@@ -219,6 +219,24 @@ CORBA::Any *ResetClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CO
return new CORBA::Any();
}
//--------------------------------------------------------
/**
* method : LoadBunchStructureClass::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *LoadBunchStructureClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "LoadBunchStructureClass::execute(): arrived" << endl;
((static_cast<AGIPD *>(device))->load_bunch_structure());
return new CORBA::Any();
}
//===================================================================
// Properties management
......@@ -1285,6 +1303,81 @@ void AGIPDClass::attribute_factory(vector<Tango::Attr *> &att_list)
rotateimage->set_memorized_init(false);
att_list.push_back(rotateimage);
// Attribute : Mask
MaskAttrib *mask = new MaskAttrib();
Tango::UserDefaultAttrProp mask_prop;
mask_prop.set_description("Tells which modules are running. It should be 0 or 1 for each module. \nThe total length should be 8. The first number is related to the module 0 \nwhich is nearest to master FPGA.");
mask_prop.set_label("Mask");
// unit not set for Mask
// standard_unit not set for Mask
// display_unit not set for Mask
// format not set for Mask
// max_value not set for Mask
// min_value not set for Mask
// max_alarm not set for Mask
// min_alarm not set for Mask
// max_warning not set for Mask
// min_warning not set for Mask
// delta_t not set for Mask
// delta_val not set for Mask
mask->set_default_properties(mask_prop);
// Not Polled
mask->set_disp_level(Tango::OPERATOR);
mask->set_memorized();
mask->set_memorized_init(false);
att_list.push_back(mask);
// Attribute : BunchStructureFile
BunchStructureFileAttrib *bunchstructurefile = new BunchStructureFileAttrib();
Tango::UserDefaultAttrProp bunchstructurefile_prop;
// description not set for BunchStructureFile
bunchstructurefile_prop.set_label("BunchStructureFile");
// unit not set for BunchStructureFile
// standard_unit not set for BunchStructureFile
// display_unit not set for BunchStructureFile
// format not set for BunchStructureFile
// max_value not set for BunchStructureFile
// min_value not set for BunchStructureFile
// max_alarm not set for BunchStructureFile
// min_alarm not set for BunchStructureFile
// max_warning not set for BunchStructureFile
// min_warning not set for BunchStructureFile
// delta_t not set for BunchStructureFile
// delta_val not set for BunchStructureFile
bunchstructurefile->set_default_properties(bunchstructurefile_prop);
// Not Polled
bunchstructurefile->set_disp_level(Tango::OPERATOR);
bunchstructurefile->set_memorized();
bunchstructurefile->set_memorized_init(false);
att_list.push_back(bunchstructurefile);
// Attribute : TriggerMode
TriggerModeAttrib *triggermode = new TriggerModeAttrib();
Tango::UserDefaultAttrProp triggermode_prop;
triggermode_prop.set_description("trigger mode \n0: internal trigger\n1: external trigger");
triggermode_prop.set_label("TriggerMode");
// unit not set for TriggerMode
// standard_unit not set for TriggerMode
// display_unit not set for TriggerMode
// format not set for TriggerMode
// max_value not set for TriggerMode
// min_value not set for TriggerMode
// max_alarm not set for TriggerMode
// min_alarm not set for TriggerMode
// max_warning not set for TriggerMode
// min_warning not set for TriggerMode
// delta_t not set for TriggerMode
// delta_val not set for TriggerMode
triggermode->set_default_properties(triggermode_prop);
// Not Polled
triggermode->set_disp_level(Tango::OPERATOR);
triggermode->set_memorized();
triggermode->set_memorized_init(false);
att_list.push_back(triggermode);
// Attribute : LiveDataAnalog
LiveDataAnalogAttrib *livedataanalog = new LiveDataAnalogAttrib();
Tango::UserDefaultAttrProp livedataanalog_prop;
......@@ -1391,6 +1484,15 @@ void AGIPDClass::command_factory()
Tango::OPERATOR);
command_list.push_back(pResetCmd);
// Command LoadBunchStructure
LoadBunchStructureClass *pLoadBunchStructureCmd =
new LoadBunchStructureClass("LoadBunchStructure",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR);
command_list.push_back(pLoadBunchStructureCmd);
/*----- PROTECTED REGION ID(AGIPDClass::command_factory_after) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPDClass::command_factory_after
......
......@@ -425,6 +425,51 @@ public:
{return (static_cast<AGIPD *>(dev))->is_RotateImage_allowed(ty);}
};
// Attribute Mask class definition
class MaskAttrib: public Tango::Attr
{
public:
MaskAttrib():Attr("Mask",
Tango::DEV_STRING, Tango::READ_WRITE) {};
~MaskAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<AGIPD *>(dev))->read_Mask(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<AGIPD *>(dev))->write_Mask(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<AGIPD *>(dev))->is_Mask_allowed(ty);}
};
// Attribute BunchStructureFile class definition
class BunchStructureFileAttrib: public Tango::Attr
{
public:
BunchStructureFileAttrib():Attr("BunchStructureFile",
Tango::DEV_STRING, Tango::READ_WRITE) {};
~BunchStructureFileAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<AGIPD *>(dev))->read_BunchStructureFile(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<AGIPD *>(dev))->write_BunchStructureFile(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<AGIPD *>(dev))->is_BunchStructureFile_allowed(ty);}
};
// Attribute TriggerMode class definition
class TriggerModeAttrib: public Tango::Attr
{
public:
TriggerModeAttrib():Attr("TriggerMode",
Tango::DEV_USHORT, Tango::READ_WRITE) {};
~TriggerModeAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<AGIPD *>(dev))->read_TriggerMode(att);}
virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att)
{(static_cast<AGIPD *>(dev))->write_TriggerMode(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<AGIPD *>(dev))->is_TriggerMode_allowed(ty);}
};
// Attribute LiveDataAnalog class definition
class LiveDataAnalogAttrib: public Tango::ImageAttr
{
......@@ -547,6 +592,29 @@ public:
{return (static_cast<AGIPD *>(dev))->is_Reset_allowed(any);}
};
// Command LoadBunchStructure class definition
class LoadBunchStructureClass : public Tango::Command
{
public:
LoadBunchStructureClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
LoadBunchStructureClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~LoadBunchStructureClass() {};
virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any);
virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any)
{return (static_cast<AGIPD *>(dev))->is_LoadBunchStructure_allowed(any);}
};
/**
* The AGIPDClass singleton definition
......
......@@ -735,6 +735,66 @@ bool AGIPD::is_RotateImage_allowed(TANGO_UNUSED(Tango::AttReqType type))
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPD::is_Mask_allowed()
* Description : Execution allowed for Mask attribute
*/
//--------------------------------------------------------
bool AGIPD::is_Mask_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for Mask attribute in Write access.
/*----- PROTECTED REGION ID(AGIPD::MaskStateAllowed_WRITE) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPD::MaskStateAllowed_WRITE
// Not any excluded states for Mask attribute in read access.
/*----- PROTECTED REGION ID(AGIPD::MaskStateAllowed_READ) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPD::MaskStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPD::is_BunchStructureFile_allowed()
* Description : Execution allowed for BunchStructureFile attribute
*/
//--------------------------------------------------------
bool AGIPD::is_BunchStructureFile_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for BunchStructureFile attribute in Write access.
/*----- PROTECTED REGION ID(AGIPD::BunchStructureFileStateAllowed_WRITE) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPD::BunchStructureFileStateAllowed_WRITE
// Not any excluded states for BunchStructureFile attribute in read access.
/*----- PROTECTED REGION ID(AGIPD::BunchStructureFileStateAllowed_READ) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPD::BunchStructureFileStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPD::is_TriggerMode_allowed()
* Description : Execution allowed for TriggerMode attribute
*/
//--------------------------------------------------------
bool AGIPD::is_TriggerMode_allowed(TANGO_UNUSED(Tango::AttReqType type))
{
// Not any excluded states for TriggerMode attribute in Write access.
/*----- PROTECTED REGION ID(AGIPD::TriggerModeStateAllowed_WRITE) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPD::TriggerModeStateAllowed_WRITE
// Not any excluded states for TriggerMode attribute in read access.
/*----- PROTECTED REGION ID(AGIPD::TriggerModeStateAllowed_READ) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPD::TriggerModeStateAllowed_READ
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPD::is_LiveDataAnalog_allowed()
......@@ -847,4 +907,19 @@ bool AGIPD::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any))
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPD::is_LoadBunchStructure_allowed()
* Description : Execution allowed for LoadBunchStructure attribute
*/
//--------------------------------------------------------
bool AGIPD::is_LoadBunchStructure_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for LoadBunchStructure command.
/*----- PROTECTED REGION ID(AGIPD::LoadBunchStructureStateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPD::LoadBunchStructureStateAllowed
return true;
}
} // End of namespace
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title> AGIPD Tango Class Attribute BunchStructureFile </title>
</head>
<body text="Black" bgcolor="White" link="Blue" vlink="Purple" alink="Red">
<br><br><br>
<font size="+1"><u><b> Attribute BunchStructureFile : </b></u></font>
<ul>
</ul>
<br><br><br>
<Table Border=0 Cellpadding=0 CELLSPACING=20>
<TR>
<TD ALIGN="left" VALIGN=top>
<Table Border=2 Cellpadding=3 CELLSPACING=0>
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan=0> <font size=+1> <center><b> Attribute Definition </b></font></center></td>
</tr>
<tr>
<td> Attribute Type </td>
<td> Scalar </td>
</tr>
<tr>
<td> R/W Type </td>
<td> READ_WRITE </td>
</tr>
<tr>
<td> Data Type </td>
<td> Tango::DEV_STRING </td>
</tr>
<tr>
<td> Display Level </td>
<td> OPERATOR </td>
</tr>
<tr>
<td> Inherited </td>
<td> false </td>
</tr>
<tr>
<td> Abstract </td>
<td> false </td>
</tr>
<tr>
<td> Polling Period </td>
<td> Not polled </td>
</tr>
<tr>
<td> Memorized </td>
<td> true </td>
</tr>
<tr>
<td> Write hardware at init. </td>
<td> Not set </td>
</tr>
<Tr BGCOLOR="#CCCCFF"><Td><Hr></Td><Td><Hr></Td></Tr>
<tr>
<td> Read allowed for </td>
<td> All states </td>
</tr>
<tr>
<td> Write allowed for </td>
<td> All states </td>
</tr>
</table>
</td>
<TD ALIGN="Center" VALIGN=top>
<Table Border=2 Cellpadding=3 CELLSPACING=0>
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan=0> <font size=+1> <center><b> Attribute Properties </b></font></center></td>
</tr>
<tr>
<td> label </td>
<td> BunchStructureFile </td>
</tr>
<tr>
<td> unit </td>
<td> </td>
</tr>
<tr>
<td> standard unit </td>
<td> </td>
</tr>
<tr>
<td> display unit </td>
<td> </td>
</tr>
<tr>
<td> format </td>
<td> </td>
</tr>
<tr>
<td> max_value </td>
<td> </td>
</tr>
<tr>
<td> min_value </td>
<td> </td>
</tr>
<tr>
<td> max_alarm </td>
<td> </td>
</tr>
<tr>
<td> min_alarm </td>
<td> </td>
</tr>
<tr>
<td> max_warning </td>
<td> </td>
</tr>
<tr>
<td> min_warning </td>
<td> </td>
</tr>
<tr>
<td> delta_time </td>
<td> </td>
</tr>
<tr>
<td> delta_val </td>
<td> </td>
</tr>
</table>
</td>
<TD ALIGN="Right" VALIGN=top>
<Table Border=2 Cellpadding=3 CELLSPACING=0>
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan=0> <font size=+1> <center><b> Attribute Event Criteria </b></font></center></td>
</tr>
<tr>
<td> Periodic </td>
<td> Not set </td>
</tr>
<tr>
<td> Relative Change </td>
<td> Not set </td>
</tr>
<tr>
<td> Absolute Change </td>
<td> Not set </td>
</tr>
<Tr BGCOLOR="#CCCCFF"><Td><Hr></Td><Td><Hr></Td></Tr>
<tr>
<td> Archive Periodic </td>
<td> Not set </td>
</tr>
<tr>
<td> Archive Relative Change </td>
<td> Not set </td>
</tr>
<tr>
<td> Archive Absolute Change </td>
<td> Not set </td>
</tr>
<Tr BGCOLOR="#CCCCFF"><Td><Hr></Td><Td><Hr></Td></Tr>
<tr>
<td> Push Change event by user code </td>
<td> false </td>
</tr>
<Tr BGCOLOR="#CCCCFF"><Td> </Td><Td> </Td></Tr>
<tr>
<td> Push Archive event by user code </td>
<td> false </td>
</tr>
<Tr BGCOLOR="#CCCCFF"><Td> </Td><Td> </Td></Tr>
<tr>
<td> Push DataReady event by user code </td>
<td> false </td>
</tr>
</table>
</td>
</TR>
</table>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title> AGIPD Tango Class Attribute Mask </title>
</head>
<body text="Black" bgcolor="White" link="Blue" vlink="Purple" alink="Red">
<br><br><br>
<font size="+1"><u><b> Attribute Mask : </b></u></font>
<ul>
Tells which modules are running. It should be 0 or 1 for each module. <Br>
The total length should be 8. The first number is related to the module 0 <Br>
which is nearest to master FPGA.
</ul>
<br><br><br>
<Table Border=0 Cellpadding=0 CELLSPACING=20>
<TR>
<TD ALIGN="left" VALIGN=top>
<Table Border=2 Cellpadding=3 CELLSPACING=0>
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan=0> <font size=+1> <center><b> Attribute Definition </b></font></center></td>
</tr>
<tr>
<td> Attribute Type </td>
<td> Scalar </td>
</tr>
<tr>
<td> R/W Type </td>