00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef _APPSETTINGS_H_
00013 #define _APPSETTINGS_H_
00014
00015 #if defined(__GNUG__) && !defined(__APPLE__)
00016 #pragma interface "appsettings.h"
00017 #endif
00018
00019 #include <wx/thread.h>
00020 #include "generic_board.h"
00021
00022 class wxMutex;
00023
00024 class AppSettings
00025 {
00026 public:
00027 typedef enum
00028 {
00029 EXT_TRIGGER_MSK= 0x0001,
00030 CHANNEL_TRIGGER_MSK= 0x0002,
00031 SW_AUTO_TRIGGER_MSK= 0x0004,
00032 } TRIGGER_MSK;
00033 typedef enum
00034 {
00035 NO_TRIGGER= 0,
00036 RAISING_EDGE,
00037 FALLING_EDGE,
00038 } TRIGGER_EDGE_TYPE;
00039 typedef enum
00040 {
00041 NO_LINE= 0,
00042 SOLID,
00043 DASHED,
00044 DASH_DOT,
00045 DOTTED,
00046 } GRID_LINE_TYPE;
00047
00048 public:
00049
00050
00051 AppSettings( void (* scope_refresh)( int, bool));
00052 ~AppSettings( void);
00053 bool Load( void);
00054 bool Save( void);
00055
00056
00057
00058 wxMutex m_mutex;
00059
00060
00061 TRIGGER_MSK m_trigger_msk;
00062 int m_post_trigger;
00063 int m_sample_block_size;
00064 wxArrayPtrVoid m_board_array;
00065 wxColor m_grid_line_color[ SCOPE_NUM_PANELS];
00066 GRID_LINE_TYPE m_grid_line_type[ SCOPE_NUM_PANELS];
00067 int m_grid_line_width[ SCOPE_NUM_PANELS];
00068 wxColor m_background_color[ SCOPE_NUM_PANELS];
00069 wxString m_record_folder;
00070 TRIGGER_EDGE_TYPE m_trigger_edge_type;
00071
00072 wxPen *m_grid_pen[ SCOPE_NUM_PANELS];
00073 wxPen *m_mid_grid_pen[ SCOPE_NUM_PANELS];
00074 wxBrush *m_back_brush[ SCOPE_NUM_PANELS];
00075 int m_max_log_X;
00076 double m_offset_sec[ SCOPE_NUM_PANELS];
00077 double m_sec_2_sample;
00078 double m_sec_2_div[ SCOPE_NUM_PANELS];
00079 double m_sample_2_sec;
00080
00081 int m_int_rate_MHz;
00082 int m_ext_rate_MHz;
00083 bool m_use_ext_clock;
00084 bool m_use_TTL;
00085 bool m_trigger_position_keep;
00086 bool m_started;
00087 bool m_show_left_pane;
00088 bool m_show_bottom_pane;
00089 bool m_show_scope_left_top_pane;
00090 bool m_show_scope_right_top_pane;
00091 bool m_show_scope_left_bottom_pane;
00092 bool m_show_scope_right_bottom_pane;
00093
00094 double m_sec_2_pix[ SCOPE_NUM_PANELS];
00095 double m_div_2_pix_X[ SCOPE_NUM_PANELS], m_div_2_pix_Y[ SCOPE_NUM_PANELS];
00096 int m_pix_Y[ SCOPE_NUM_PANELS], m_pix_X[ SCOPE_NUM_PANELS];
00097
00098 bool SetGridPen( int scope_index, const wxPen* grid_pen, const wxPen* mid_grid_pen= NULL);
00099 bool SetBackBrush( int scope_index, const wxBrush* back_brush);
00100
00101 void (* ScopeRefresh)( int, bool);
00102
00103 void SetDiv2Pix( int scope_index, double div_2_pix_X);
00104 void SetSec2Div( int scope_index, double sec_2_div);
00105 void SetSec2Sample( double sec_2_sample);
00106 void SetClock( bool use_ext_clock, int ext_rate_MHz);
00107
00108 inline UINT32 Sec2Pix( int scope_index, double value){ return (UINT32)(double)( this->m_sec_2_pix[ scope_index]* value);};
00109 inline double Sample2Sec( int value){ return this->m_sample_2_sec* (double)value;};
00110
00111 protected:
00112 bool EndVME( void);
00113 bool InitVME( void);
00114
00115 wxString m_vme_board_type_string;
00116 int m_vme_link;
00117 int m_vme_board_num;
00118 int32_t m_vme_handle;
00119 };
00120
00121
00122 #endif
00123
00124