Skip to content
Snippets Groups Projects
Commit ef5fab9d authored by BUTEAU's avatar BUTEAU
Browse files

First code reread

parent e6de576f
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -18,7 +18,7 @@
// ============================================================================
// DEPENDENCIES
// ============================================================================
#include "..\include\LecroyException.h"
#include "LecroyException.h"
namespace lecroy {
......
......@@ -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);
......
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);
......
......@@ -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)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment