diff --git a/doc/DeviceServerUsersGuide_en.doc b/doc/DeviceServerUsersGuide_en.doc index 1e326554700989fc867a58203d0a5d117e319df9..a0e08d2b000d998579dcc9d4f95179e151b84c82 100644 Binary files a/doc/DeviceServerUsersGuide_en.doc and b/doc/DeviceServerUsersGuide_en.doc differ diff --git a/include/SocketException.h b/include/SocketException.h index c4502328fe6d144f101974f0a6e2e118f43aae3f..7f06595033a70a6b57f7509e3a844982b10b84e7 100644 --- a/include/SocketException.h +++ b/include/SocketException.h @@ -18,7 +18,7 @@ // ============================================================================ // DEPENDENCIES // ============================================================================ -#include "..\include\LecroyException.h" +#include "LecroyException.h" namespace lecroy { diff --git a/include/Waveform.h b/include/Waveform.h index 3698c535de491504d969adabdafdad8a3c9a46de..a6d3ad4ef6b5bedc2dbf6dae2090f6d7d0fe1650 100644 --- a/include/Waveform.h +++ b/include/Waveform.h @@ -113,13 +113,13 @@ public: //- DTOR ~WaveForm_data(); - std::string get_channel_name (void) throw (lecroy::LecroyException); - void set_channel_name (std::string); -WAVEDESC_BLOCK *get_wavedesc_descriptor (void) throw (lecroy::LecroyException); - 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_channel_name (void) throw (lecroy::LecroyException); + void set_channel_name (std::string); + WAVEDESC_BLOCK *get_wavedesc_descriptor (void) throw (lecroy::WaveformException); + 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); diff --git a/src/AcquireWaveformLecroy.cpp b/src/AcquireWaveformLecroy.cpp index a2b3b7172d737ee26cf62672432c4f3f23d40e0a..d55d749544bc69ecce046c8de1b036aebe44d998 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.4 2004-10-07 09:21:18 xavela Exp $"; +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 $"; //+============================================================================= // // file : AcquireWaveformLecroy.cpp @@ -11,11 +11,14 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio // // project : TANGO Device Server // -// $Author: xavela $ +// $Author: buteau $ // -// $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. // @@ -231,6 +234,10 @@ void AcquireWaveformLecroy::init_device() 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); @@ -244,6 +251,7 @@ void AcquireWaveformLecroy::init_device() Tango::PANIC ); } + */ } @@ -307,6 +315,8 @@ void AcquireWaveformLecroy::always_executed_hook() //- Get the waveform data and description( ADC resolution, horizontal and vertical infos, data length ...) try { + // First do a real read on the hardware + // waveform_ptr->get_waveform_data(); set_state(Tango::ON); set_status("Waveform data acquired."); @@ -375,10 +385,13 @@ void AcquireWaveformLecroy::read_attr_hardware(vector<long> &attr_list) try { //- allocate memory for the two attributes + DEBUG_STREAM << "data_length = " << data_length << endl; attr_rawWaveformData_read = new Tango::DevShort[data_length]; attr_verticalScaledData_read = new Tango::DevDouble[data_length]; - cout << "data_length = " << data_length << endl; } + //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) { set_state(Tango::ALARM); diff --git a/src/Waveform.cpp b/src/Waveform.cpp index 0e72c2381d829a5c7cf39104974fa514ba77bfaa..0951cceb689f58211f66c875e7f0ded0055e8ae5 100644 --- a/src/Waveform.cpp +++ b/src/Waveform.cpp @@ -25,7 +25,7 @@ WaveForm_data::WaveForm_data(std::string ch_name) channel_name = ch_name; sh_raw_waveform_data = NULL; vertical_scaled_waveform_data = NULL; - trigger_time_value = "Not avaiable"; + trigger_time_value = "Not available"; //- the memory allocation is done in the get_waveform_data( ) method ptrRawData = 0; } @@ -33,7 +33,6 @@ WaveForm_data::WaveForm_data(std::string ch_name) WaveForm_data::~WaveForm_data() { if(ptrRawData) - { delete [] ptrRawData; ptrRawData = 0; @@ -52,7 +51,7 @@ WaveForm_data::~WaveForm_data() } //- Method to return the channel name -std::string WaveForm_data::get_channel_name( ) throw (lecroy::LecroyException) +std::string WaveForm_data::get_channel_name( ) throw (lecroy::WaveformException) { std::string error = " channel_name is not initialized !"; @@ -174,6 +173,9 @@ 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 &) { throw; @@ -253,6 +255,8 @@ 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) {