Skip to content
Snippets Groups Projects
Commit c9da21ec authored by Xavier ELATTAOUI's avatar Xavier ELATTAOUI
Browse files

Added times infos : time to write, read and copy fresh data.

parent 1e03ddea
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,9 @@ private:
//- Waveform description :
WAVEDESC_BLOCK *waveBlockData; //- ptr on the struct WAVEDESC_BLOCK
//- time info to acquire waveform data
std::string time_to_get_waveformData;
public:
//- CTOR
......@@ -137,6 +140,11 @@ public:
throw (lecroy::WaveformException);
std::string get_trigger_time_value ();
std::string get_times_to_get_waveformData () {
return time_to_get_waveformData;
}
};
#endif //- _WaveForm_data_H
......@@ -54,6 +54,10 @@
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT-${aol}-${library}-${mode}</artifactId>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT4Tango-${aol}-${library}-${mode}</artifactId>
</dependency>
</dependencies>
<scm>
......
......@@ -208,6 +208,12 @@ void AcquireWaveformLecroy::delete_device()
delete [] _deviceResponse;
_deviceResponse = 0;
}
DEBUG_STREAM << "Remove the InnerAppender." << endl;
yat4tango::InnerAppender::release(this);
DEBUG_STREAM << "Remove the YatLogAdapter." << endl;
yat4tango::YatLogAdapter::release();
}
//+----------------------------------------------------------------------------
......@@ -272,6 +278,25 @@ void AcquireWaveformLecroy::init_device()
get_device_property();
//---------------------------------------------------------
//- instanciate the log_adapter & inner_appender in order to manage logs
//---------------------------------------------------------
try
{
DEBUG_STREAM << "Create the YatLogAdapter in order to use logs from third party library." << endl;
yat4tango::YatLogAdapter::initialize(this);
DEBUG_STREAM << "Create the InnerAppender in order to manage logs." << endl;
yat4tango::InnerAppender::initialize(this, 512);
}
catch (Tango::DevFailed& df)
{
ERROR_STREAM << df << endl;
set_state(Tango::FAULT);
set_status("OUT OF MEMORY : Failed to create log manager !");
return;
}
//- create the com obj
ptr_com = SocketLecroy::get_instance();
......@@ -427,6 +452,7 @@ yat::Timer t;
waveform_ptr->get_waveform_data();
set_state(Tango::ON);
set_status("Waveform data acquired.");
INFO_STREAM << "Times infos to get waveform data :\n" << waveform_ptr->get_times_to_get_waveformData(); << std::endl;
}
catch(const lecroy::WaveformException &we)
{
......@@ -486,7 +512,8 @@ yat::Timer t;
std::string response = waveform_ptr->get_trigger_time_value();
strcpy(*attr_triggerTime_read, response.c_str());
DEBUG_STREAM << "READ_HW : all data ar now updated. DONE in " << t.elapsed_msec() << " milliseconds.\n" << std::endl;
INFO_STREAM << "READ_HW : all data ar now updated. DONE in " << t.elapsed_msec() << " milliseconds.\n" << std::endl;
}
//+----------------------------------------------------------------------------
......
......@@ -63,6 +63,8 @@
#define _ACQUIREWAVEFORMLECROY_H
#include <tango.h>
#include <yat4tango/InnerAppender.h>
#include <yat4tango/YatLogAdapter.h>
//using namespace Tango;
#include "SocketLecroy.h"
#include "SocketException.h"
......
......@@ -88,10 +88,16 @@ char* cmdStr = 0;
//int ulTrace_Size = 0;
int response_length=0;
unsigned short OFFSET_STRUCT = 0;
std::ostringstream oss;
//- FOR DEBUG : comment out Timer and STD::COUT !!
//yat::Timer t;
//std::cout << "\t WaveForm_data::get_waveform_data( ) -> ENTERING ..." << std::endl;
yat::Timer t_start;
yat::Timer t_end;
std::size_t time_to_write_data;
std::size_t time_to_read_data;
std::size_t time_to_copy_data;
oss << "WaveForm_data::get_waveform_data( ) -> ENTERING ..." << std::endl;
//- init ptr WaveBlocData which point on WAVEDESC_BLOCS structure
waveBlockData = 0;
......@@ -108,6 +114,8 @@ unsigned short OFFSET_STRUCT = 0;
//- send the request
SocketLecroy::get_instance( )->TCP_WriteDevice(cmdStr,length,true);
time_to_write_data = t.elapsed_msec;
oss << "\tTime to WRITE command : " << time_to_write_data << std::endl;
//- delete cmd allocation
if(cmdStr)
......@@ -144,6 +152,8 @@ unsigned short OFFSET_STRUCT = 0;
try
{
SocketLecroy::get_instance( )->TCP_ReadDevice(ptrRawData,length,&response_length);
time_to_read_data = t.elapsed_msec - time_to_write_data;
oss << "\tTime to READ " << response_length << " data : " << time_to_read_data << std::endl;
//std::cout << "\t WaveForm_data::get_waveform_data( ) -> READ DONE, respLgth = " << response_length << std::endl;
}
catch(const lecroy::WaveformException &)
......@@ -206,7 +216,10 @@ unsigned short OFFSET_STRUCT = 0;
vertical_scaled_waveform_data[idx] = (waveBlockData->vertical_gain * sh_raw_waveform_data[idx]) - waveBlockData->vertical_offset;
//std::cout << "\t WaveForm_data::get_waveform_data( ) -> LOOP idx = " << idx << std::endl;
}
time_to_copy_data = t.elapsed_msec - time_to_read_data;
oss << "\tTime to COPY " << response_length << " data : " << time_to_copy_data << std::ends;
time_to_get_waveformData = oss.str();
//std::cout << "\t WaveForm_data::get_waveform_data( ) -> DONE in " << t.elapsed_msec() << " milliseconds." << std::endl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment