Skip to content
Snippets Groups Projects
Commit 6e755d26 authored by Xavier ELATTAOUI's avatar Xavier ELATTAOUI
Browse files

xavier : add an attr waveArray2.

Sorts attr in expert and operator view with Pogo.
Inconsistencies removed.
parent ef5fab9d
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ Device Attributes Description
</h1>
<Br>
<b>
Revision: 1.1.1.1 - Author: syldup
Revision: 1.4 - Author: xavela
</b>
</center>
......@@ -42,26 +42,29 @@ Revision: 1.1.1.1 - Author: syldup
<Td><Center><b>Data Type</b></td></Center>
<Td><Center><b>R/W Type</b></td></Center>
<Td><Center><b>Expert</b></td></Center>
<Tr><Td><b><Center>waveArray1</b><Br>( Length of the first array. This first array contains data of simples waveforms. )</Center></Td>
<Td><Center>DEV_LONG</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>waveArray1</b><Br>( Length of the first array. This second array contains data of simples waveforms. )</Center></Td>
<Td><Center>DEV_LONG</Center></Td><Td><Center>READ</Center></Td><Td><Center>Yes</Center></Td></Tr>
<Tr><Td><b><Center>waveArray2</b><Br>( Length of the second array. This second array contains data of complex waveforms (as FFT, Extrema ....). )</Center></Td>
<Td><Center>DEV_LONG</Center></Td><Td><Center>READ</Center></Td><Td><Center>Yes</Center></Td></Tr>
<Tr><Td><b><Center>waveArrayCount</b><Br>( Length of the two arrays. If the length of wavearray1 is different of this length that's means data are present in the array wavearray2. Which is used for complex data as math operations on a waveform. )</Center></Td>
<Td><Center>DEV_LONG</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>nominalBits</b><Br>( ADC resolution. For simple data this ADC is an 8 bits resolution else it's can be 10 up to 12 bits )</Center></Td>
<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>Yes</Center></Td></Tr>
<Tr><Td><b><Center>horizontalInterval</b><Br>( Sampling interval for time domain waveforms Needed to scale the waveform data stored in the rawWaveformData attribute. )</Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>Yes</Center></Td></Tr>
<Tr><Td><b><Center>horizontalOffset</b><Br>( Trigger offset for the first sweep of the trigger, seconds between the trigger and the first data point. Needed to scale the waveform data stored in the rawWaveformData attribute. )</Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>Yes</Center></Td></Tr>
<Tr><Td><b><Center>verticalGain</b><Br>( The vertical gain. Used to scale the waveform data stored in the rawWaveformData attribute. )</Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>Yes</Center></Td></Tr>
<Tr><Td><b><Center>verticalOffset</b><Br>( Needed to scale the waveform data stored in the rawWaveformData attribute. )</Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>Yes</Center></Td></Tr>
<Tr><Td><b><Center>triggerTime</b></Center></Td>
<Td><Center>DEV_STRING</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
......
......@@ -28,7 +28,7 @@ Device Description
</h1>
<Br>
<b>
Revision: 1.1.1.1 - Author: syldup
Revision: 1.4 - Author: xavela
</b>
</center>
......
......@@ -28,7 +28,7 @@ Device Commands Description
</h1>
<Br>
<b>
Revision: 1.1.1.1 - Author: syldup
Revision: 1.4 - Author: xavela
</b>
</center>
......
......@@ -28,7 +28,7 @@ Device Commands Description
</h1>
<Br>
<b>
Revision: 1.1.1.1 - Author: syldup
Revision: 1.4 - Author: xavela
</b>
</center>
......
......@@ -28,7 +28,7 @@ Properties Description
</h1>
<Br>
<b>
Revision: 1.1.1.1 - Author: syldup
Revision: 1.4 - Author: xavela
</b>
</center>
......
......@@ -28,7 +28,7 @@ Device States Description
</h1>
<Br>
<b>
Revision: 1.1.1.1 - Author: syldup
Revision: 1.4 - Author: xavela
</b>
</center>
......
......@@ -28,7 +28,7 @@ Device Server User's Guide
</h1>
<Br>
<b>
Revision: 1.1.1.1 - Author: syldup
Revision: 1.4 - Author: xavela
</b>
</center>
<Br>
......
......@@ -119,7 +119,7 @@ public:
void get_waveform_data (void) throw (lecroy::LecroyException); //- acquire the waveform data from the scope
short* get_raw_waveform_data (void) throw (lecroy::LecroyException); //- return the ptr on sh_raw_waveform_data
double* get_vertical_scaled_waveform_data (void) throw (lecroy::LecroyException);
std::string get_trigger_time_value (void) throw (lecroy::LecroyException);
std::string get_trigger_time_value (void);
......
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/AcquireWaveformLecroy.cpp,v 1.5 2004-10-18 09:01:40 buteau Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/AcquireWaveformLecroy.cpp,v 1.6 2004-10-18 13:17:49 xavela Exp $";
//+=============================================================================
//
// file : AcquireWaveformLecroy.cpp
......@@ -11,11 +11,14 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// project : TANGO Device Server
//
// $Author: buteau $
// $Author: xavela $
//
// $Revision: 1.5 $
// $Revision: 1.6 $
//
// $Log: not supported by cvs2svn $
// Revision 1.5 2004/10/18 09:01:40 buteau
// First code reread
//
// Revision 1.4 2004/10/07 09:21:18 xavela
// xavier : no cout now.
//
......@@ -109,6 +112,10 @@ void AcquireWaveformLecroy::delete_device()
delete attr_waveArray1_read;
attr_waveArray1_read = 0;
}
if (attr_waveArray2_read) {
delete attr_waveArray2_read;
attr_waveArray2_read = 0;
}
if (attr_waveArrayCount_read) {
delete attr_waveArrayCount_read;
attr_waveArrayCount_read = 0;
......@@ -173,6 +180,9 @@ void AcquireWaveformLecroy::init_device()
attr_waveArray1_read = new Tango::DevLong;
*attr_waveArray1_read = 0;
attr_waveArray2_read = new Tango::DevLong;
*attr_waveArray2_read = 0;
attr_waveArrayCount_read = new Tango::DevLong;
*attr_waveArrayCount_read = 0;
......@@ -228,32 +238,11 @@ void AcquireWaveformLecroy::init_device()
}
//- create the waveform obj
try
{
waveform_ptr = new WaveForm_data(channelName);
set_state(Tango::ON);
set_status("Ready to acquire waveform.");
}
/* AB le constructeur de WaveForm_data ne lance pas d'exception WaveformException
// ce catch est donc inutile
catch(const lecroy::WaveformException &we)
{
set_state(Tango::ALARM);
set_status("Not ready to acquire waveform.");
Tango::DevFailed df = lecroy_to_tango_exception(we);
Tango::Except::re_throw_exception(df,
(const char*) "OUT_OF_MEMORY",
(const char*) "Cannot built a waveform objet.",
(const char*) "AcquireWaveformLecroy::init_device()",
Tango::PANIC
);
}
*/
}
//+----------------------------------------------------------------------------
//
......@@ -389,20 +378,16 @@ void AcquireWaveformLecroy::read_attr_hardware(vector<long> &attr_list)
attr_rawWaveformData_read = new Tango::DevShort[data_length];
attr_verticalScaledData_read = new Tango::DevDouble[data_length];
}
//AB le new Tango::DevShort ne peut pas chouer pour cause de DevFailed
// ==> on ne passera jamais dans ton catch
// Soit tu le supprimes, soit tu mets un catch (std::bad_alloc)
catch(Tango::DevFailed &te)
catch(std::bad_alloc)
{
set_state(Tango::ALARM);
set_status("Memory not allocated to receive data.");
Tango::Except::re_throw_exception(te,
Tango::Except::throw_exception(
(const char *) "OUT_OF_MEMORY",
(const char *) "Cannot allocate memory to receive the data.",
(const char *) "AcquireWaveformLecroy::read_attr_hardware()",
Tango::ERR
);
}
//- Add your own code here
......@@ -429,6 +414,10 @@ void AcquireWaveformLecroy::read_attr_hardware(vector<long> &attr_list)
{
*attr_waveArray1_read = waveform_ptr->get_wavedesc_descriptor()->wave_array_1;
}
if (attr_name == "waveArray2")
{
*attr_waveArray2_read = waveform_ptr->get_wavedesc_descriptor()->wave_array_2;
}
if (attr_name == "waveArrayCount")
{
*attr_waveArrayCount_read = data_length;
......@@ -490,6 +479,12 @@ void AcquireWaveformLecroy::read_attr(Tango::Attribute &attr)
attr.set_value(attr_waveArray1_read);
}
else
if (attr_name == "waveArray2")
{
// Add your own code here
attr.set_value(attr_waveArray2_read);
}
else
if (attr_name == "waveArrayCount")
{
//- Add your own code here
......
......@@ -8,9 +8,12 @@
//
// $Author: xavela $
//
// $Revision: 1.4 $
// $Revision: 1.5 $
//
// $Log: not supported by cvs2svn $
// Revision 1.4 2004/10/07 09:21:18 xavela
// xavier : no cout now.
//
// Revision 1.3 2004/10/05 13:11:11 xavela
// Xavier : previous commit failed.
//
......@@ -46,7 +49,7 @@
/**
* @author $Author: xavela $
* @version $Revision: 1.4 $ $
* @version $Revision: 1.5 $ $
*/
// Add your own constants definitions here.
......@@ -100,6 +103,7 @@ public :
Tango::DevShort *attr_rawWaveformData_read;
Tango::DevDouble *attr_verticalScaledData_read;
Tango::DevLong *attr_waveArray1_read;
Tango::DevLong *attr_waveArray2_read;
Tango::DevLong *attr_waveArrayCount_read;
Tango::DevShort *attr_nominalBits_read;
Tango::DevDouble *attr_horizontalInterval_read;
......
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/AcquireWaveformLecroyClass.cpp,v 1.4 2004-10-07 09:21:18 xavela Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/AcquireWaveformLecroyClass.cpp,v 1.5 2004-10-18 13:17:49 xavela Exp $";
static const char *TagName = "$Name: not supported by cvs2svn $";
......@@ -20,9 +20,12 @@ static const char *RCSfile = "$RCSfile: AcquireWaveformLecroyClass.cpp,v $";
//
// $Author: xavela $
//
// $Revision: 1.4 $
// $Revision: 1.5 $
//
// $Log: not supported by cvs2svn $
// Revision 1.4 2004/10/07 09:21:18 xavela
// xavier : no cout now.
//
// Revision 1.3 2004/10/05 13:11:11 xavela
// Xavier : previous commit failed.
//
......@@ -212,10 +215,24 @@ void AcquireWaveformLecroyClass::attribute_factory(vector<Tango::Attr *> &att_li
wave_array1_prop.set_unit("data");
wave_array1_prop.set_display_unit("data");
wave_array1_prop.set_format("%d");
wave_array1_prop.set_description("Length of the first array.\nThis first array contains data of simples\nwaveforms.");
wave_array1_prop.set_description("Length of the first array.\nThis second array contains data of simples\nwaveforms.");
wave_array1->set_default_properties(wave_array1_prop);
wave_array1->set_disp_level(Tango::EXPERT);
att_list.push_back(wave_array1);
// Attribute : waveArray2
Tango::Attr *wave_array2 =
new Tango::Attr("waveArray2", Tango::DEV_LONG, Tango::READ);
Tango::UserDefaultAttrProp wave_array2_prop;
wave_array2_prop.set_label("Wave Array 2");
wave_array2_prop.set_unit("data");
wave_array2_prop.set_display_unit("data");
wave_array2_prop.set_format("%d");
wave_array2_prop.set_description("Length of the second array.\nThis second array contains data of complex\nwaveforms (as FFT, Extrema ....).");
wave_array2->set_default_properties(wave_array2_prop);
wave_array2->set_disp_level(Tango::EXPERT);
att_list.push_back(wave_array2);
// Attribute : waveArrayCount
Tango::Attr *wave_array_count =
new Tango::Attr("waveArrayCount", Tango::DEV_LONG, Tango::READ);
......@@ -237,6 +254,7 @@ void AcquireWaveformLecroyClass::attribute_factory(vector<Tango::Attr *> &att_li
nominal_bits_prop.set_format("%d");
nominal_bits_prop.set_description("ADC resolution.\nFor simple data this ADC is an 8 bits resolution\nelse it's can be 10 up to 12 bits");
nominal_bits->set_default_properties(nominal_bits_prop);
nominal_bits->set_disp_level(Tango::EXPERT);
att_list.push_back(nominal_bits);
// Attribute : horizontalInterval
......@@ -246,6 +264,7 @@ void AcquireWaveformLecroyClass::attribute_factory(vector<Tango::Attr *> &att_li
horizontal_interval_prop.set_label("Horizontal Interval");
horizontal_interval_prop.set_description("Sampling interval for time domain waveforms\nNeeded to scale the waveform data stored\nin the rawWaveformData attribute.");
horizontal_interval->set_default_properties(horizontal_interval_prop);
horizontal_interval->set_disp_level(Tango::EXPERT);
att_list.push_back(horizontal_interval);
// Attribute : horizontalOffset
......@@ -255,6 +274,7 @@ void AcquireWaveformLecroyClass::attribute_factory(vector<Tango::Attr *> &att_li
horizontal_offset_prop.set_label("Horizontal Offset");
horizontal_offset_prop.set_description("Trigger offset for the first sweep of the trigger,\nseconds between the trigger and the first \ndata point.\nNeeded to scale the waveform data stored\nin the rawWaveformData attribute.");
horizontal_offset->set_default_properties(horizontal_offset_prop);
horizontal_offset->set_disp_level(Tango::EXPERT);
att_list.push_back(horizontal_offset);
// Attribute : verticalGain
......@@ -264,6 +284,7 @@ void AcquireWaveformLecroyClass::attribute_factory(vector<Tango::Attr *> &att_li
vertical_gain_prop.set_label("Vertical Gain");
vertical_gain_prop.set_description("The vertical gain.\nUsed to scale the waveform data stored in\n the rawWaveformData attribute.");
vertical_gain->set_default_properties(vertical_gain_prop);
vertical_gain->set_disp_level(Tango::EXPERT);
att_list.push_back(vertical_gain);
// Attribute : verticalOffset
......@@ -273,6 +294,7 @@ void AcquireWaveformLecroyClass::attribute_factory(vector<Tango::Attr *> &att_li
vertical_offset_prop.set_label("Vertical Offset");
vertical_offset_prop.set_description("Needed to scale the waveform data stored\nin the rawWaveformData attribute.");
vertical_offset->set_default_properties(vertical_offset_prop);
vertical_offset->set_disp_level(Tango::EXPERT);
att_list.push_back(vertical_offset);
// Attribute : triggerTime
......
......@@ -12,9 +12,12 @@
//
// $Author: xavela $
//
// $Revision: 1.4 $
// $Revision: 1.5 $
//
// $Log: not supported by cvs2svn $
// Revision 1.4 2004/10/07 09:21:18 xavela
// xavier : no cout now.
//
// Revision 1.3 2004/10/05 13:11:11 xavela
// Xavier : previous commit failed.
//
......
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/ClassFactory.cpp,v 1.3 2004-10-07 09:21:18 xavela Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/ClassFactory.cpp,v 1.4 2004-10-18 13:17:49 xavela Exp $";
//+=============================================================================
//
// file : ClassFactory.cpp
......@@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// $Author: xavela $
//
// $Revision: 1.3 $
// $Revision: 1.4 $
//
// $Log: not supported by cvs2svn $
// Revision 1.3 2004/10/07 09:21:18 xavela
// xavier : no cout now.
//
// Revision 1.2 2004/10/05 13:11:11 xavela
// Xavier : previous commit failed.
//
......@@ -42,7 +45,7 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
* Create AcquireWaveformLecroyClass singleton and store it in DServer object.
*
* @author $Author: xavela $
* @version $Revision: 1.3 $ $
* @version $Revision: 1.4 $ $
*/
void Tango::DServer::class_factory()
......
......@@ -30,7 +30,7 @@ PROJECT_NUMBER =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = D:\Temp\AcquireWaveformLecroy\src/doc_html
OUTPUT_DIRECTORY = D:\MyDeviceServer\AcquireWaveformLecroy\src/doc_html
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
......@@ -304,7 +304,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = D:\Temp\AcquireWaveformLecroy\src
INPUT = D:\MyDeviceServer\AcquireWaveformLecroy\src
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
......
......@@ -18,11 +18,14 @@
#
# $Revision: 1.3 $
# $Revision: 1.4 $
#
# $Log: not supported by cvs2svn $
# Revision 1.3 2004/10/07 09:21:19 xavela
# xavier : no cout now.
#
# Revision 1.2 2004/10/05 13:11:11 xavela
# Xavier : previous commit failed.
#
......
......@@ -115,35 +115,17 @@ short OFFSET_STRUCT = 0;
//- first desallocate previous data
if (ptrRawData)
{
try
{
delete [] ptrRawData;
ptrRawData = 0;
}
catch(const lecroy::WaveformException &)
{
throw lecroy::WaveformException("MEMORY_DESALLOCATION",
"The pointer (ptrRawData) for the receive data can't be desallocated before the read operation.",
"WaveForm_data::get_waveform_data( ).");
}
}
//- delete previous raw data
if(sh_raw_waveform_data)
{
try
{
delete [] sh_raw_waveform_data;
sh_raw_waveform_data = 0;
}
catch(const lecroy::WaveformException &)
{
throw lecroy::WaveformException("MEMORY_DESALLOCATION",
"The pointer (sh_raw_waveform_data) for the receive data can't be desallocated before the read operation.",
"WaveForm_data::get_waveform_data( ).");
}
}
//- delete previous scaled data
if(vertical_scaled_waveform_data)
......@@ -173,12 +155,12 @@ short OFFSET_STRUCT = 0;
{
SocketLecroy::get_instance( )->TCP_ReadDevice(ptrRawData,length,&response_length);
}
//AB A quoi sert le catch ici
// si tu ne traitespas l''exception , alors il ne sert rien de faire un catch
catch(const lecroy::SocketException &)
catch(const lecroy::WaveformException &)
{
throw;
//- XE :
throw lecroy::WaveformException("OPERATION_FAILED",
"The TCP_ReadDevice() method failed.",
"WaveForm_data::get_waveform_data( ).");
}
//- calculation of the offset of the structure (it can be 15 or 21)
......@@ -257,7 +239,7 @@ double* WaveForm_data::get_vertical_scaled_waveform_data( ) throw (lecroy::Lecro
//- Method to return the trigger time of the acquired waveform
//AB cette methode ne fait pas de throw ==> la signature est fausse
std::string WaveForm_data::get_trigger_time_value ( ) throw (lecroy::LecroyException)
std::string WaveForm_data::get_trigger_time_value ( )
{
//- The format is : "Date = month, day, year ; Time = hours:minutes:seconds"
......
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/main.cpp,v 1.3 2004-10-07 09:21:19 xavela Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/AcquireWaveformLecroy/src/main.cpp,v 1.4 2004-10-18 13:17:49 xavela Exp $";
//+=============================================================================
//
// file : main.cpp
......@@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// $Author: xavela $
//
// $Revision: 1.3 $ $
// $Revision: 1.4 $ $
//
// $Log: not supported by cvs2svn $
// Revision 1.3 2004/10/07 09:21:19 xavela
// xavier : no cout now.
//
// Revision 1.2 2004/10/05 13:11:11 xavela
// Xavier : previous commit failed.
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment