From 11f818ac252c85289559a1102be7c9e87ba7d126 Mon Sep 17 00:00:00 2001 From: Xavier Elattaoui <xavier.elattaoui@synchrotron-soleil.fr> Date: Thu, 24 Apr 2008 15:46:12 +0000 Subject: [PATCH] xavier : minor change --- include/SocketLecroy.h | 26 ++++++++++++++------------ include/Waveform.h | 12 ++++++------ include/WaveformException.h | 2 +- src/LecroyException.cpp | 2 +- src/LinuxSocketLecroy.cpp | 10 +++++----- src/SocketException.cpp | 2 +- src/SocketLecroy.cpp | 8 ++++---- src/Waveform.cpp | 6 +++--- src/WaveformException.cpp | 2 +- 9 files changed, 36 insertions(+), 34 deletions(-) diff --git a/include/SocketLecroy.h b/include/SocketLecroy.h index d377a2a..00f9cd8 100644 --- a/include/SocketLecroy.h +++ b/include/SocketLecroy.h @@ -16,7 +16,9 @@ #define _SocketLecroy_H //- necessary includes +#ifdef WIN32 #include <winsock2.h> +#endif #include "SocketException.h" @@ -26,14 +28,14 @@ // //////////////////////////////////////////////////////////////////// -static int hSocket; -static int sTimeout = 15; -static int sWinsockInitFlag = FALSE; -static char sCurrentAddress[256]; -static int sConnectedFlag = FALSE; +//static int hSocket; +//static int sTimeout = 15; +//static int sWinsockInitFlag = FALSE; +//static char sCurrentAddress[256]; +//static int sConnectedFlag = FALSE; -const int CMD_BUF_LEN = 8192; -static char sCommandBuffer[CMD_BUF_LEN]; +//const int CMD_BUF_LEN = 8192; +//static char sCommandBuffer[CMD_BUF_LEN]; //- Structure of the command Header typedef struct @@ -74,11 +76,11 @@ public: static SocketLecroy* get_instance(void); static void delete_instance(SocketLecroy*); - void TCP_WriteDevice (char *buf, int length,BOOL eoi_flag) throw (lecroy::LecroyException); //- send a cmd to the device - void TCP_ReadDevice (char *buf, int length, int* nb_byte_received) throw (lecroy::LecroyException); //- read the device replie - void TCP_Connect (char *ip_address) throw (lecroy::LecroyException); //- build TCP/IP connection - void TCP_Disconnect (void) throw (lecroy::LecroyException); //- disconnect the device - void TCP_ClearDevice (void) throw (lecroy::LecroyException); //- disconnect and reconnect the device + void TCP_WriteDevice (char *buf, int length,bool eoi_flag) throw (lecroy::SocketException); //- send a cmd to the device + void TCP_ReadDevice (char *buf, int length, int* nb_byte_received) throw (lecroy::SocketException); //- read the device replie + void TCP_Connect (char *ip_address) throw (lecroy::SocketException); //- build TCP/IP connection + void TCP_Disconnect (void) throw (lecroy::SocketException); //- disconnect the device + void TCP_ClearDevice (void) throw (lecroy::SocketException); //- disconnect and reconnect the device }; diff --git a/include/Waveform.h b/include/Waveform.h index 115d9e8..8dbbabe 100644 --- a/include/Waveform.h +++ b/include/Waveform.h @@ -15,8 +15,8 @@ #define _WaveForm_data_H #include <string> -#include "..\include\WaveformException.h" -#include "..\include\Xstring.h" +#include "WaveformException.h" +#include <Xstring.h> const long MAX_WAVEFORM_DATA_LENGTH = 150000; @@ -113,12 +113,12 @@ public: //- DTOR ~WaveForm_data(); - std::string get_channel_name (void) throw (lecroy::LecroyException); + std::string get_channel_name (void) throw (lecroy::WaveformException); 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); + void get_waveform_data (void) throw (lecroy::WaveformException); //- acquire the waveform data from the scope + short* get_raw_waveform_data (void) throw (lecroy::WaveformException); //- return the ptr on sh_raw_waveform_data + double* get_vertical_scaled_waveform_data (void) throw (lecroy::WaveformException); std::string get_trigger_time_value (void); diff --git a/include/WaveformException.h b/include/WaveformException.h index e9d2056..556eabd 100644 --- a/include/WaveformException.h +++ b/include/WaveformException.h @@ -18,7 +18,7 @@ // ============================================================================ // DEPENDENCIES // ============================================================================ -#include "..\include\LecroyException.h" +#include "LecroyException.h" namespace lecroy { diff --git a/src/LecroyException.cpp b/src/LecroyException.cpp index 577e8d2..bda46fd 100644 --- a/src/LecroyException.cpp +++ b/src/LecroyException.cpp @@ -14,7 +14,7 @@ // ============================================================================ // DEPENDENCIES -#include "..\include\LecroyException.h" +#include "LecroyException.h" namespace lecroy { diff --git a/src/LinuxSocketLecroy.cpp b/src/LinuxSocketLecroy.cpp index ccd171b..c3db4a7 100644 --- a/src/LinuxSocketLecroy.cpp +++ b/src/LinuxSocketLecroy.cpp @@ -80,7 +80,7 @@ SocketLecroy::~SocketLecroy() //- Build the connection -void SocketLecroy::TCP_Connect(char *ip_address) throw (lecroy::LecroyException) +void SocketLecroy::TCP_Connect(char *ip_address) throw (lecroy::SocketException) { struct sockaddr_in serverAddr; int result; @@ -182,7 +182,7 @@ char tmpStr[256]; //- DisconnectFromScope: disconnect from a network device -void SocketLecroy::TCP_Disconnect(void) +void SocketLecroy::TCP_Disconnect(void) throw (lecroy::SocketException) { if (sConnectedFlag) @@ -194,7 +194,7 @@ void SocketLecroy::TCP_Disconnect(void) } //- Clear a connection -void SocketLecroy::TCP_ClearDevice(void) throw (lecroy::LecroyException) +void SocketLecroy::TCP_ClearDevice(void) throw (lecroy::SocketException) { if ( !sConnectedFlag ) @@ -208,7 +208,7 @@ void SocketLecroy::TCP_ClearDevice(void) throw (lecroy::LecroyException) } //- Send commands to the remote device -void SocketLecroy::TCP_WriteDevice(char *buf, int len, bool eoi_flag) throw (lecroy::LecroyException) +void SocketLecroy::TCP_WriteDevice(char *buf, int len, bool eoi_flag) throw (lecroy::SocketException) { TCP_HEADER header; @@ -265,7 +265,7 @@ char *idxPtr; } //- Read the device answer -void SocketLecroy::TCP_ReadDevice(char *buf, int len, int *recv_count) throw (lecroy::LecroyException) +void SocketLecroy::TCP_ReadDevice(char *buf, int len, int *recv_count) throw (lecroy::SocketException) { TCP_HEADER header; diff --git a/src/SocketException.cpp b/src/SocketException.cpp index 7abb279..a22291b 100644 --- a/src/SocketException.cpp +++ b/src/SocketException.cpp @@ -15,7 +15,7 @@ // ============================================================================ // DEPENDENCIES // ============================================================================ -#include "..\include\SocketException.h" +#include "SocketException.h" namespace lecroy { diff --git a/src/SocketLecroy.cpp b/src/SocketLecroy.cpp index 32fdee1..98fe632 100644 --- a/src/SocketLecroy.cpp +++ b/src/SocketLecroy.cpp @@ -51,7 +51,7 @@ SocketLecroy::~SocketLecroy() } //- Build the connection -void SocketLecroy::TCP_Connect(char *ip_address) throw (lecroy::LecroyException) +void SocketLecroy::TCP_Connect(char *ip_address) throw (lecroy::SocketException) { SOCKADDR_IN serverAddr; @@ -163,7 +163,7 @@ void SocketLecroy::TCP_Disconnect(void) } //- Clear a connection -void SocketLecroy::TCP_ClearDevice(void) throw (lecroy::LecroyException) +void SocketLecroy::TCP_ClearDevice(void) throw (lecroy::SocketException) { if (sConnectedFlag != TRUE) @@ -177,7 +177,7 @@ void SocketLecroy::TCP_ClearDevice(void) throw (lecroy::LecroyException) } //- Send commands to the remote device -void SocketLecroy::TCP_WriteDevice(char *buf, int len, BOOL eoi_flag) throw (lecroy::LecroyException) +void SocketLecroy::TCP_WriteDevice(char *buf, int len, BOOL eoi_flag) throw (lecroy::SocketException) { TCP_HEADER header; @@ -234,7 +234,7 @@ char *idxPtr; } //- Read the device answer -void SocketLecroy::TCP_ReadDevice(char *buf, int len, int *recv_count) throw (lecroy::LecroyException) +void SocketLecroy::TCP_ReadDevice(char *buf, int len, int *recv_count) throw (lecroy::SocketException) { TCP_HEADER header; diff --git a/src/Waveform.cpp b/src/Waveform.cpp index 4d3446a..b4c8d53 100644 --- a/src/Waveform.cpp +++ b/src/Waveform.cpp @@ -80,7 +80,7 @@ WAVEDESC_BLOCK* WaveForm_data::get_wavedesc_descriptor( ) throw (lecroy::Wavefor } //- Method to return the raw data of the acquired waveform -void WaveForm_data::get_waveform_data( ) throw (lecroy::LecroyException) +void WaveForm_data::get_waveform_data( ) throw (lecroy::WaveformException) { std::string cmd(""); char* cmdStr = 0; @@ -202,7 +202,7 @@ short OFFSET_STRUCT = 0; } //- return the ptr on sh_raw_waveform_data ( = the waveform data acquired) -short* WaveForm_data::get_raw_waveform_data () throw (lecroy::LecroyException) +short* WaveForm_data::get_raw_waveform_data () throw (lecroy::WaveformException) { if(sh_raw_waveform_data) return sh_raw_waveform_data; @@ -215,7 +215,7 @@ short* WaveForm_data::get_raw_waveform_data () throw (lecroy::LecroyException) //- Method to return the scaled data of the acquired waveform -double* WaveForm_data::get_vertical_scaled_waveform_data( ) throw (lecroy::LecroyException) +double* WaveForm_data::get_vertical_scaled_waveform_data( ) throw (lecroy::WaveformException) { if(vertical_scaled_waveform_data) diff --git a/src/WaveformException.cpp b/src/WaveformException.cpp index 2bae498..f9946fb 100644 --- a/src/WaveformException.cpp +++ b/src/WaveformException.cpp @@ -15,7 +15,7 @@ // ============================================================================ // DEPENDENCIES // ============================================================================ -#include "..\include\WaveformException.h" +#include "WaveformException.h" namespace lecroy { -- GitLab