appsettings.h

Go to the documentation of this file.
00001 
00002 // Name:        appsettings.h
00003 // Purpose:     
00004 // Author:      NDA
00005 // Modified by: 
00006 // Created:     11/23/05 16:17:15
00007 // RCS-ID:      
00008 // Copyright:   CAEN S.p.A. All rights reserved
00009 // Licence:     
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,                         // external trigger
00030                 CHANNEL_TRIGGER_MSK=    0x0002,                         // Channels trigger
00031                 SW_AUTO_TRIGGER_MSK=    0x0004,                         // Software auto retrigger
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         // Methods
00051         AppSettings( void (* scope_refresh)( int, bool));
00052         ~AppSettings( void);
00053         bool Load( void);
00054         bool Save( void);
00055 
00056         //
00057         // Common lock
00058         wxMutex m_mutex;
00059         //
00060         // Properties
00061         TRIGGER_MSK m_trigger_msk;                                      // Trigger type masks
00062         int m_post_trigger;                                                     // Number of post trigger samples ( < 0 means pretrigger)
00063         int m_sample_block_size;                                        // The size of samples' buffer
00064         wxArrayPtrVoid m_board_array;                           // Boards array
00065         wxColor m_grid_line_color[ SCOPE_NUM_PANELS];           // The grid color
00066         GRID_LINE_TYPE m_grid_line_type[ SCOPE_NUM_PANELS];     // The grid line type
00067         int m_grid_line_width[ SCOPE_NUM_PANELS];                       // The grid line width
00068         wxColor m_background_color[ SCOPE_NUM_PANELS];          // The background color
00069         wxString m_record_folder;                                       // The folder where to store recorded files
00070         TRIGGER_EDGE_TYPE m_trigger_edge_type;          // 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;                                                        // maximum logical unit X
00076         double m_offset_sec[ SCOPE_NUM_PANELS];         // Horizontal offset (sec)
00077         double m_sec_2_sample;                                          // Samples/ Sec conversion factor       
00078         double m_sec_2_div[ SCOPE_NUM_PANELS];          // Div/ Sec conversion factor
00079         double m_sample_2_sec;                                          // Sec/ Sample conversion factor        
00080 
00081         int m_int_rate_MHz;                                                     // Internal clock (MHz)
00082         int m_ext_rate_MHz;                                                     // External clock (MHz)
00083         bool m_use_ext_clock;                                           // External/ Internal clock usage
00084         bool m_use_TTL;                                                         // Use TTL/NIM external signals 
00085         bool m_trigger_position_keep;                           // Keep trigger position on screen
00086         bool m_started;                                                         // Start acquiring upon loading
00087         bool m_show_left_pane;                                          // Show left pane upon loading
00088         bool m_show_bottom_pane;                                        // Show bottom pane upon loading
00089         bool m_show_scope_left_top_pane;                        // Show scope left top pane upon loading
00090         bool m_show_scope_right_top_pane;                       // Show scope right top pane upon loading
00091         bool m_show_scope_left_bottom_pane;                     // Show scope left bottom pane upon loading
00092         bool m_show_scope_right_bottom_pane;            // Show scope right bottom pane upon loading
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 

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