Skip to content
Snippets Groups Projects
Commit 603b2ad0 authored by ELATTAOUI's avatar ELATTAOUI
Browse files

xavier : no cout now.

parent a6da427a
No related branches found
No related tags found
No related merge requests found
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 // file : AcquireWaveformLecroy.cpp
...@@ -13,9 +13,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio ...@@ -13,9 +13,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
// //
// $Author: xavela $ // $Author: xavela $
// //
// $Revision: 1.3 $ // $Revision: 1.4 $
// //
// $Log: not supported by cvs2svn $ // $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 // Revision 1.2 2004/10/05 13:09:10 xavela
// Xavier : memory allocation in read_attr_hardware() method. // 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. // 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() ...@@ -192,6 +195,7 @@ void AcquireWaveformLecroy::init_device()
//- Initialise variables to default values //- Initialise variables to default values
//-------------------------------------------- //--------------------------------------------
data_value=0; data_value=0;
data_length = 0;
ptr_com = 0; ptr_com = 0;
get_device_property(); get_device_property();
...@@ -335,8 +339,6 @@ void AcquireWaveformLecroy::read_attr_hardware(vector<long> &attr_list) ...@@ -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 << "In read_attr_hardware for " << attr_list.size();
DEBUG_STREAM << " attribute(s)" << endl; DEBUG_STREAM << " attribute(s)" << endl;
long data_length = 0;
//- delete previous allocation //- delete previous allocation
if(attr_rawWaveformData_read) if(attr_rawWaveformData_read)
{ {
...@@ -465,25 +467,8 @@ void AcquireWaveformLecroy::read_attr(Tango::Attribute &attr) ...@@ -465,25 +467,8 @@ void AcquireWaveformLecroy::read_attr(Tango::Attribute &attr)
//--------------------------------- //---------------------------------
if (attr_name == "rawWaveformData") if (attr_name == "rawWaveformData")
{ {
try //- Add your own code here
{ attr.set_value(attr_rawWaveformData_read, data_length);
//- 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
);
}
} }
else else
if (attr_name == "waveArray1") if (attr_name == "waveArray1")
...@@ -537,25 +522,7 @@ void AcquireWaveformLecroy::read_attr(Tango::Attribute &attr) ...@@ -537,25 +522,7 @@ void AcquireWaveformLecroy::read_attr(Tango::Attribute &attr)
if (attr_name == "verticalScaledData") if (attr_name == "verticalScaledData")
{ {
// Add your own code here // Add your own code here
try attr.set_value(attr_verticalScaledData_read, data_length);
{
//- 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
);
}
} }
} }
......
...@@ -8,9 +8,12 @@ ...@@ -8,9 +8,12 @@
// //
// $Author: xavela $ // $Author: xavela $
// //
// $Revision: 1.3 $ // $Revision: 1.4 $
// //
// $Log: not supported by cvs2svn $ // $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 // Revision 1.2 2004/10/05 13:09:10 xavela
// Xavier : memory allocation in read_attr_hardware() method. // 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. // 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 @@ ...@@ -43,7 +46,7 @@
/** /**
* @author $Author: xavela $ * @author $Author: xavela $
* @version $Revision: 1.3 $ $ * @version $Revision: 1.4 $ $
*/ */
// Add your own constants definitions here. // Add your own constants definitions here.
...@@ -214,6 +217,7 @@ protected : ...@@ -214,6 +217,7 @@ protected :
WaveForm_data *waveform_ptr; WaveForm_data *waveform_ptr;
short* data_value; short* data_value;
double* data_scaled_value; double* data_scaled_value;
long data_length;
//- Method to convert all lecroy exceptions (type Waveform or Socket exceptions) on Tango exception //- Method to convert all lecroy exceptions (type Waveform or Socket exceptions) on Tango exception
Tango::DevFailed lecroy_to_tango_exception(const lecroy::LecroyException& de); Tango::DevFailed lecroy_to_tango_exception(const lecroy::LecroyException& de);
......
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 $"; static const char *TagName = "$Name: not supported by cvs2svn $";
...@@ -20,9 +20,12 @@ static const char *RCSfile = "$RCSfile: AcquireWaveformLecroyClass.cpp,v $"; ...@@ -20,9 +20,12 @@ static const char *RCSfile = "$RCSfile: AcquireWaveformLecroyClass.cpp,v $";
// //
// $Author: xavela $ // $Author: xavela $
// //
// $Revision: 1.3 $ // $Revision: 1.4 $
// //
// $Log: not supported by cvs2svn $ // $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 // Revision 1.2 2004/10/05 13:09:10 xavela
// Xavier : memory allocation in read_attr_hardware() method. // 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. // calculation of offset of the begining of the struct, which contains the context of the waveform acquisition, in the received block data.
......
...@@ -12,9 +12,12 @@ ...@@ -12,9 +12,12 @@
// //
// $Author: xavela $ // $Author: xavela $
// //
// $Revision: 1.3 $ // $Revision: 1.4 $
// //
// $Log: not supported by cvs2svn $ // $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 // Revision 1.2 2004/10/05 13:09:10 xavela
// Xavier : memory allocation in read_attr_hardware() method. // 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. // calculation of offset of the begining of the struct, which contains the context of the waveform acquisition, in the received block data.
......
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 // file : ClassFactory.cpp
...@@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio ...@@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
// //
// $Author: xavela $ // $Author: xavela $
// //
// $Revision: 1.2 $ // $Revision: 1.3 $
// //
// $Log: not supported by cvs2svn $ // $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 // Revision 1.1.1.1 2004/09/29 15:42:14 syldup
// Initial import. // Initial import.
// //
...@@ -39,7 +42,7 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio ...@@ -39,7 +42,7 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
* Create AcquireWaveformLecroyClass singleton and store it in DServer object. * Create AcquireWaveformLecroyClass singleton and store it in DServer object.
* *
* @author $Author: xavela $ * @author $Author: xavela $
* @version $Revision: 1.2 $ $ * @version $Revision: 1.3 $ $
*/ */
void Tango::DServer::class_factory() void Tango::DServer::class_factory()
......
...@@ -18,11 +18,14 @@ ...@@ -18,11 +18,14 @@
# #
# $Revision: 1.2 $ # $Revision: 1.3 $
# #
# $Log: not supported by cvs2svn $ # $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 # Revision 1.1.1.1 2004/09/29 15:42:14 syldup
# Initial import. # Initial import.
# #
......
...@@ -62,7 +62,7 @@ const int resp = 1; ...@@ -62,7 +62,7 @@ const int resp = 1;
fd_set wr_set = {1, {0}}; fd_set wr_set = {1, {0}};
TIMEVAL tval; TIMEVAL tval;
unsigned long argp; unsigned long argp;
char* tmpStr = 0; char tmpStr[256];
//- connection test //- connection test
...@@ -131,9 +131,8 @@ void SocketLecroy::TCP_Disconnect(void) ...@@ -131,9 +131,8 @@ void SocketLecroy::TCP_Disconnect(void)
if (sConnectedFlag == TRUE) if (sConnectedFlag == TRUE)
{ {
closesocket(hSocket);
closesocket(hSocket); sConnectedFlag = FALSE;
sConnectedFlag = FALSE;
} }
} }
......
...@@ -106,6 +106,13 @@ short OFFSET_STRUCT = 0; ...@@ -106,6 +106,13 @@ short OFFSET_STRUCT = 0;
//- send the request //- send the request
SocketLecroy::get_instance( )->TCP_WriteDevice(cmdStr,length,true); SocketLecroy::get_instance( )->TCP_WriteDevice(cmdStr,length,true);
//- delete cmd allocation
if(cmdStr)
{
delete [] cmdStr;
cmdStr = 0;
}
//- first desallocate previous data //- first desallocate previous data
if (ptrRawData) if (ptrRawData)
...@@ -179,7 +186,6 @@ short OFFSET_STRUCT = 0; ...@@ -179,7 +186,6 @@ short OFFSET_STRUCT = 0;
{ {
//- the offset of the structure which contains the context of the waveform acquisition //- the offset of the structure which contains the context of the waveform acquisition
OFFSET_STRUCT = i; OFFSET_STRUCT = i;
cout << "****** OFFSET STRUCTURE = " << i << "\n" << endl;
} }
} }
......
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 // file : main.cpp
...@@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio ...@@ -12,9 +12,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
// //
// $Author: xavela $ // $Author: xavela $
// //
// $Revision: 1.2 $ $ // $Revision: 1.3 $ $
// //
// $Log: not supported by cvs2svn $ // $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 // Revision 1.1.1.1 2004/09/29 15:42:14 syldup
// Initial import. // Initial import.
// //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment