diff --git a/src/AcquireWaveformLecroy.cpp b/src/AcquireWaveformLecroy.cpp index 787c5288faeeb9d6219ad8301a233bfcdd69abd7..a2b3b7172d737ee26cf62672432c4f3f23d40e0a 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.3 2004-10-05 13:11:11 xavela Exp $"; +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 $"; //+============================================================================= // // file : AcquireWaveformLecroy.cpp @@ -13,9 +13,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/05 13:11:11 xavela +// Xavier : previous commit failed. +// // Revision 1.2 2004/10/05 13:09:10 xavela // Xavier : memory allocation in read_attr_hardware() method. // calculation of offset of the begining of the struct, which contains the context of the waveform acquisition, in the received block data. @@ -192,6 +195,7 @@ void AcquireWaveformLecroy::init_device() //- Initialise variables to default values //-------------------------------------------- data_value=0; + data_length = 0; ptr_com = 0; get_device_property(); @@ -335,8 +339,6 @@ void AcquireWaveformLecroy::read_attr_hardware(vector<long> &attr_list) DEBUG_STREAM << "In read_attr_hardware for " << attr_list.size(); DEBUG_STREAM << " attribute(s)" << endl; - long data_length = 0; - //- delete previous allocation if(attr_rawWaveformData_read) { @@ -465,25 +467,8 @@ void AcquireWaveformLecroy::read_attr(Tango::Attribute &attr) //--------------------------------- if (attr_name == "rawWaveformData") { - try - { - //- Add your own code here - long data_length = waveform_ptr->get_wavedesc_descriptor()->wave_array_count; - attr.set_value(attr_rawWaveformData_read, data_length); - } - catch(const lecroy::WaveformException &we) - { - set_state(Tango::ALARM); - set_status("Cannot acquire the descriptor on the WAVEDESC_BLOC structure."); - Tango::DevFailed df = lecroy_to_tango_exception(we); - - Tango::Except::re_throw_exception(df, - (const char*) "GET_FAILED", - (const char*) "Failed to get the raw data.", - (const char*) "AcquireWaveformLecroy::read_attr_hardware()", - Tango::ERR - ); - } + //- Add your own code here + attr.set_value(attr_rawWaveformData_read, data_length); } else if (attr_name == "waveArray1") @@ -537,25 +522,7 @@ void AcquireWaveformLecroy::read_attr(Tango::Attribute &attr) if (attr_name == "verticalScaledData") { // Add your own code here - try - { - //- Add your own code here - long data_length = waveform_ptr->get_wavedesc_descriptor()->wave_array_count; - attr.set_value(attr_verticalScaledData_read, data_length); - } - catch(const lecroy::WaveformException &we) - { - set_state(Tango::ALARM); - set_status("Cannot acquire the descriptor on the WAVEDESC_BLOC structure."); - Tango::DevFailed df = lecroy_to_tango_exception(we); - - Tango::Except::re_throw_exception(df, - (const char*) "GET_FAILED", - (const char*) "Failed to get the scaled data.", - (const char*) "AcquireWaveformLecroy::read_attr_hardware()", - Tango::ERR - ); - } + attr.set_value(attr_verticalScaledData_read, data_length); } } diff --git a/src/AcquireWaveformLecroy.h b/src/AcquireWaveformLecroy.h index 7c5dbd325b5245fcbd90f36393dd4fe7089f5815..7dac097b8ef0177bcd4a61c015c99b25e500843f 100644 --- a/src/AcquireWaveformLecroy.h +++ b/src/AcquireWaveformLecroy.h @@ -8,9 +8,12 @@ // // $Author: xavela $ // -// $Revision: 1.3 $ +// $Revision: 1.4 $ // // $Log: not supported by cvs2svn $ +// Revision 1.3 2004/10/05 13:11:11 xavela +// Xavier : previous commit failed. +// // Revision 1.2 2004/10/05 13:09:10 xavela // Xavier : memory allocation in read_attr_hardware() method. // calculation of offset of the begining of the struct, which contains the context of the waveform acquisition, in the received block data. @@ -43,7 +46,7 @@ /** * @author $Author: xavela $ - * @version $Revision: 1.3 $ $ + * @version $Revision: 1.4 $ $ */ // Add your own constants definitions here. @@ -214,6 +217,7 @@ protected : WaveForm_data *waveform_ptr; short* data_value; double* data_scaled_value; + long data_length; //- Method to convert all lecroy exceptions (type Waveform or Socket exceptions) on Tango exception Tango::DevFailed lecroy_to_tango_exception(const lecroy::LecroyException& de); diff --git a/src/AcquireWaveformLecroyClass.cpp b/src/AcquireWaveformLecroyClass.cpp index e45bdeef08c3f31badc6b5f7bc07e8b7ebd50eac..a770dce8d7adbdabfd455d30e975e45e2dbff258 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.3 2004-10-05 13:11:11 xavela Exp $"; +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 *TagName = "$Name: not supported by cvs2svn $"; @@ -20,9 +20,12 @@ static const char *RCSfile = "$RCSfile: AcquireWaveformLecroyClass.cpp,v $"; // // $Author: xavela $ // -// $Revision: 1.3 $ +// $Revision: 1.4 $ // // $Log: not supported by cvs2svn $ +// Revision 1.3 2004/10/05 13:11:11 xavela +// Xavier : previous commit failed. +// // Revision 1.2 2004/10/05 13:09:10 xavela // Xavier : memory allocation in read_attr_hardware() method. // calculation of offset of the begining of the struct, which contains the context of the waveform acquisition, in the received block data. diff --git a/src/AcquireWaveformLecroyClass.h b/src/AcquireWaveformLecroyClass.h index ccdd411ac0d4656b5f8f5dbf05a6d50427c53738..a174c87ffa49209572edee726153b50a1c3e82f0 100644 --- a/src/AcquireWaveformLecroyClass.h +++ b/src/AcquireWaveformLecroyClass.h @@ -12,9 +12,12 @@ // // $Author: xavela $ // -// $Revision: 1.3 $ +// $Revision: 1.4 $ // // $Log: not supported by cvs2svn $ +// Revision 1.3 2004/10/05 13:11:11 xavela +// Xavier : previous commit failed. +// // Revision 1.2 2004/10/05 13:09:10 xavela // Xavier : memory allocation in read_attr_hardware() method. // calculation of offset of the begining of the struct, which contains the context of the waveform acquisition, in the received block data. diff --git a/src/ClassFactory.cpp b/src/ClassFactory.cpp index eedd68637fab10264a5851a9d23b9a0c7b2af9c1..1dbdcb79d1f1fcdc3e5b3f061bcf06be10c29312 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.2 2004-10-05 13:11:11 xavela Exp $"; +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 $"; //+============================================================================= // // file : ClassFactory.cpp @@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio // // $Author: xavela $ // -// $Revision: 1.2 $ +// $Revision: 1.3 $ // // $Log: not supported by cvs2svn $ +// Revision 1.2 2004/10/05 13:11:11 xavela +// Xavier : previous commit failed. +// // Revision 1.1.1.1 2004/09/29 15:42:14 syldup // Initial import. // @@ -39,7 +42,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.2 $ $ + * @version $Revision: 1.3 $ $ */ void Tango::DServer::class_factory() diff --git a/src/Makefile b/src/Makefile index c5229ed2a520b1c463772a9556e77ed0909a0c99..65ed919dbaa982569d0566b7e1b7f08248742843 100644 --- a/src/Makefile +++ b/src/Makefile @@ -18,11 +18,14 @@ # -# $Revision: 1.2 $ +# $Revision: 1.3 $ # # $Log: not supported by cvs2svn $ +# Revision 1.2 2004/10/05 13:11:11 xavela +# Xavier : previous commit failed. +# # Revision 1.1.1.1 2004/09/29 15:42:14 syldup # Initial import. # diff --git a/src/SocketLecroy.cpp b/src/SocketLecroy.cpp index da6c700f83a6204a6a1e4e24bd37f602ea65c854..66747d56b80973b9fed19e1e2101227b245b8d37 100644 --- a/src/SocketLecroy.cpp +++ b/src/SocketLecroy.cpp @@ -62,7 +62,7 @@ const int resp = 1; fd_set wr_set = {1, {0}}; TIMEVAL tval; unsigned long argp; -char* tmpStr = 0; +char tmpStr[256]; //- connection test @@ -131,9 +131,8 @@ void SocketLecroy::TCP_Disconnect(void) if (sConnectedFlag == TRUE) { - - closesocket(hSocket); - sConnectedFlag = FALSE; + closesocket(hSocket); + sConnectedFlag = FALSE; } } diff --git a/src/Waveform.cpp b/src/Waveform.cpp index d49d3d86050803d7ebe784df67bdb65b7486a903..0e72c2381d829a5c7cf39104974fa514ba77bfaa 100644 --- a/src/Waveform.cpp +++ b/src/Waveform.cpp @@ -106,6 +106,13 @@ short OFFSET_STRUCT = 0; //- send the request SocketLecroy::get_instance( )->TCP_WriteDevice(cmdStr,length,true); + + //- delete cmd allocation + if(cmdStr) + { + delete [] cmdStr; + cmdStr = 0; + } //- first desallocate previous data if (ptrRawData) @@ -179,7 +186,6 @@ short OFFSET_STRUCT = 0; { //- the offset of the structure which contains the context of the waveform acquisition OFFSET_STRUCT = i; - cout << "****** OFFSET STRUCTURE = " << i << "\n" << endl; } } diff --git a/src/main.cpp b/src/main.cpp index d3de32a3835f999d1c57b6415e46cf767eb009a1..931317bed20f99f6665d80587821d59ed05a7981 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.2 2004-10-05 13:11:11 xavela Exp $"; +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 $"; //+============================================================================= // // file : main.cpp @@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio // // $Author: xavela $ // -// $Revision: 1.2 $ $ +// $Revision: 1.3 $ $ // // $Log: not supported by cvs2svn $ +// Revision 1.2 2004/10/05 13:11:11 xavela +// Xavier : previous commit failed. +// // Revision 1.1.1.1 2004/09/29 15:42:14 syldup // Initial import. //