From 6e755d2622e3c283dad0e6521e039af6c0ba7c5d Mon Sep 17 00:00:00 2001 From: Xavier Elattaoui <xavier.elattaoui@synchrotron-soleil.fr> Date: Mon, 18 Oct 2004 13:17:49 +0000 Subject: [PATCH] xavier : add an attr waveArray2. Sorts attr in expert and operator view with Pogo. Inconsistencies removed. --- doc/doc_html/Attributes.html | 19 ++++++---- doc/doc_html/Description | 2 +- doc/doc_html/DevCommands.html | 2 +- doc/doc_html/DevCommandsTable.html | 2 +- doc/doc_html/Properties.html | 2 +- doc/doc_html/TangoDevStates.html | 2 +- doc/doc_html/index.html | 2 +- include/Waveform.h | 2 +- src/AcquireWaveformLecroy.cpp | 61 ++++++++++++++---------------- src/AcquireWaveformLecroy.h | 16 +++++--- src/AcquireWaveformLecroyClass.cpp | 28 ++++++++++++-- src/AcquireWaveformLecroyClass.h | 5 ++- src/ClassFactory.cpp | 9 +++-- src/Doxyfile | 4 +- src/Makefile | 5 ++- src/Waveform.cpp | 38 +++++-------------- src/main.cpp | 7 +++- 17 files changed, 112 insertions(+), 94 deletions(-) diff --git a/doc/doc_html/Attributes.html b/doc/doc_html/Attributes.html index ea4699b..23413f2 100644 --- a/doc/doc_html/Attributes.html +++ b/doc/doc_html/Attributes.html @@ -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> diff --git a/doc/doc_html/Description b/doc/doc_html/Description index 54e878e..7fef4ed 100644 --- a/doc/doc_html/Description +++ b/doc/doc_html/Description @@ -28,7 +28,7 @@ Device Description </h1> <Br> <b> -Revision: 1.1.1.1 - Author: syldup +Revision: 1.4 - Author: xavela </b> </center> diff --git a/doc/doc_html/DevCommands.html b/doc/doc_html/DevCommands.html index 19c9392..f8eb7ae 100644 --- a/doc/doc_html/DevCommands.html +++ b/doc/doc_html/DevCommands.html @@ -28,7 +28,7 @@ Device Commands Description </h1> <Br> <b> -Revision: 1.1.1.1 - Author: syldup +Revision: 1.4 - Author: xavela </b> </center> diff --git a/doc/doc_html/DevCommandsTable.html b/doc/doc_html/DevCommandsTable.html index 27adff8..193a01c 100644 --- a/doc/doc_html/DevCommandsTable.html +++ b/doc/doc_html/DevCommandsTable.html @@ -28,7 +28,7 @@ Device Commands Description </h1> <Br> <b> -Revision: 1.1.1.1 - Author: syldup +Revision: 1.4 - Author: xavela </b> </center> diff --git a/doc/doc_html/Properties.html b/doc/doc_html/Properties.html index a50a86e..95f9dd6 100644 --- a/doc/doc_html/Properties.html +++ b/doc/doc_html/Properties.html @@ -28,7 +28,7 @@ Properties Description </h1> <Br> <b> -Revision: 1.1.1.1 - Author: syldup +Revision: 1.4 - Author: xavela </b> </center> diff --git a/doc/doc_html/TangoDevStates.html b/doc/doc_html/TangoDevStates.html index 55ebb64..e3efdaf 100644 --- a/doc/doc_html/TangoDevStates.html +++ b/doc/doc_html/TangoDevStates.html @@ -28,7 +28,7 @@ Device States Description </h1> <Br> <b> -Revision: 1.1.1.1 - Author: syldup +Revision: 1.4 - Author: xavela </b> </center> diff --git a/doc/doc_html/index.html b/doc/doc_html/index.html index 66de472..b75e063 100644 --- a/doc/doc_html/index.html +++ b/doc/doc_html/index.html @@ -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> diff --git a/include/Waveform.h b/include/Waveform.h index a6d3ad4..115d9e8 100644 --- a/include/Waveform.h +++ b/include/Waveform.h @@ -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); diff --git a/src/AcquireWaveformLecroy.cpp b/src/AcquireWaveformLecroy.cpp index d55d749..ee08502 100644 --- a/src/AcquireWaveformLecroy.cpp +++ b/src/AcquireWaveformLecroy.cpp @@ -1,4 +1,4 @@ -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,30 +238,9 @@ 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 - ); - } - */ + waveform_ptr = new WaveForm_data(channelName); + set_state(Tango::ON); + set_status("Ready to acquire waveform."); } @@ -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 diff --git a/src/AcquireWaveformLecroy.h b/src/AcquireWaveformLecroy.h index 7dac097..0ed86f9 100644 --- a/src/AcquireWaveformLecroy.h +++ b/src/AcquireWaveformLecroy.h @@ -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. @@ -97,11 +100,12 @@ public : * Attributs member data. */ //@{ - Tango::DevShort *attr_rawWaveformData_read; + Tango::DevShort *attr_rawWaveformData_read; Tango::DevDouble *attr_verticalScaledData_read; - Tango::DevLong *attr_waveArray1_read; - Tango::DevLong *attr_waveArrayCount_read; - Tango::DevShort *attr_nominalBits_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; Tango::DevDouble *attr_horizontalOffset_read; Tango::DevDouble *attr_verticalGain_read; diff --git a/src/AcquireWaveformLecroyClass.cpp b/src/AcquireWaveformLecroyClass.cpp index a770dce..29aef1d 100644 --- a/src/AcquireWaveformLecroyClass.cpp +++ b/src/AcquireWaveformLecroyClass.cpp @@ -1,4 +1,4 @@ -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 diff --git a/src/AcquireWaveformLecroyClass.h b/src/AcquireWaveformLecroyClass.h index a174c87..3ce358d 100644 --- a/src/AcquireWaveformLecroyClass.h +++ b/src/AcquireWaveformLecroyClass.h @@ -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. // diff --git a/src/ClassFactory.cpp b/src/ClassFactory.cpp index 1dbdcb7..d1760e2 100644 --- a/src/ClassFactory.cpp +++ b/src/ClassFactory.cpp @@ -1,4 +1,4 @@ -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() diff --git a/src/Doxyfile b/src/Doxyfile index e6d158b..0119fe9 100644 --- a/src/Doxyfile +++ b/src/Doxyfile @@ -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 diff --git a/src/Makefile b/src/Makefile index 65ed919..b979d2e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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. # diff --git a/src/Waveform.cpp b/src/Waveform.cpp index 0951cce..b3a4304 100644 --- a/src/Waveform.cpp +++ b/src/Waveform.cpp @@ -116,33 +116,15 @@ 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 [] ptrRawData; + ptrRawData = 0; } //- 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 [] sh_raw_waveform_data; + sh_raw_waveform_data = 0; } //- delete previous scaled 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" diff --git a/src/main.cpp b/src/main.cpp index 931317b..7d99251 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -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. // -- GitLab