physical_board_channel.h

Go to the documentation of this file.
00001 
00002 // Name:        physical_board_channel.h
00003 // Purpose:     
00004 // Author:      NDA
00005 // Modified by: 
00006 // Created:     10/01/06 14:18:40
00007 // RCS-ID:      
00008 // Copyright:   CAEN S.p.A All rights reserved.
00009 // Licence:     
00011 
00012 #ifndef _PHYSICAL_BOARD_CHANNEL_H_
00013 #define _PHYSICAL_BOARD_CHANNEL_H_
00014 
00015 #if defined(__GNUG__) && !defined(__APPLE__)
00016 #pragma interface "physical_board_channel.h"
00017 #endif
00018 
00023 #include "generic_board_channel.h"
00024 
00025 extern "C" 
00026 {
00027         #include "CAENVMETool/cvt_board_commons.h"
00028 }
00029 
00030 //#include "appsettings.h"
00031 
00032 class PhysicalBoardChannel: public GenericBoardChannel
00033 {
00034 public:
00035         PhysicalBoardChannel( GenericBoard* parent, int ch_index, cvt_board_data* p_data, void (* scope_refresh)( int, bool), wxMutex *p_data_mutex, AppSettings *p_app_settings);
00036         virtual ~PhysicalBoardChannel(void);
00037         //
00038         // Properties
00039         int m_DAC_offset_bit;
00040         double m_DAC_bit_2_volt, m_DAC_volt_2_bit;
00041         double m_trigger_threshold_volt;
00042         int m_trigger_thr_sample;
00043 
00044         //
00045         // Methods
00046         virtual bool LoadConfig( wxConfigBase* p_config, const wxString& base_section);
00047         virtual bool SaveConfig( wxConfigBase* p_config, const wxString& base_section);
00048 
00049         // Pure virtual implementation
00050         inline double GetSampleVolt( int i){ return (double)( this->GetSample( i))* this->m_bit_2_volt;};
00051         inline int GetSample( int i){ return (int)( this->m_p_sample_buffer[i]<< 2)- 0x8000;};
00052         inline UINT32 GetBufferCount( void){ return this->m_sample_buffer_count;}
00053         void DrawTrigger( int scope_index, wxDC &dc);
00054 
00055         // Pure virtual 
00056         virtual bool ReadSamplesCache( UINT32 num_samples)= 0;
00057         virtual bool WriteDACOffset( void)= 0;
00058         virtual bool WriteChannelTrigger( void)= 0;
00059 
00060 protected:
00061 #ifdef SAMPLE_LOCK
00062         wxMutex m_samples_mutex;
00063 #endif
00064         UINT16 *m_p_sample_buffer;
00065         UINT32 m_sample_buffer_size, m_sample_buffer_count;
00066         UINT16 *m_p_tmp_sample_buffer;
00067         UINT32 m_tmp_sample_buffer_size, m_tmp_sample_buffer_count, m_tmp_record_sample_counter;
00068 };
00069 
00070 
00071 #endif  // _PHYSICAL_BOARD_CHANNEL_H_
00072 

Generated on Mon Mar 19 17:14:08 2007 for CAENScope by  doxygen 1.4.6-NO