00001
00002
00003
00004
00005
00006
00007
00008
00009
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
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
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
00046 virtual bool LoadConfig( wxConfigBase* p_config, const wxString& base_section);
00047 virtual bool SaveConfig( wxConfigBase* p_config, const wxString& base_section);
00048
00049
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
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