1 /**
2 @file 	Si5351C_wxgui.h
3 @author Lime Microsystems
4 */
5 
6 #ifndef Si5351C_wxgui_H
7 #define Si5351C_wxgui_H
8 
9 #include <wx/sizer.h>
10 #include <wx/stattext.h>
11 #include <wx/textctrl.h>
12 #include <wx/checkbox.h>
13 #include <wx/frame.h>
14 #include <wx/button.h>
15 #include <wx/radiobox.h>
16 #include <string>
17 #include "lime/LimeSuite.h"
18 
19 class Si5351C_wxgui: public wxFrame
20 {
21 public:
22 
23     Si5351C_wxgui(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString &title = _(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int styles = wxDEFAULT_FRAME_STYLE, wxString idname = "");
24     void Initialize(lms_device_t* pModule);
25     virtual ~Si5351C_wxgui();
26     void ModifyClocksGUI(const std::string &board);
27 
28     //(*Declarations(Si5351C_wxgui)
29     wxCheckBox* chkEN_CLK5;
30     wxCheckBox* chkInvert_CLK6;
31     wxTextCtrl* txtFreq_CLK7;
32     wxTextCtrl* txtFreq_CLK1;
33     wxCheckBox* chkEN_CLK3;
34     wxCheckBox* chkEN_CLK4;
35     wxCheckBox* chkInvert_CLK3;
36     wxTextCtrl* txtFreq_CLK5;
37     wxStaticText* StaticText13;
38     wxStaticText* StaticText2;
39     wxButton* btnLoadFile;
40     wxTextCtrl* txtFreq_CLK0;
41     wxStaticText* lblCLK6;
42     wxStaticText* lblCLK7;
43     wxStaticText* lblCLK0;
44     wxButton* btnResetToDefaults;
45     wxStaticText* lblCLK5;
46     wxStaticText* StaticText11;
47     wxStaticText* StaticText1;
48     wxButton* btnConfigure;
49     wxCheckBox* chkEN_CLK6;
50     wxStaticText* lblCLK4;
51     wxStaticText* lblCLK2;
52     wxTextCtrl* txtFreq_CLK3;
53     wxButton* btnReadStatus;
54     wxTextCtrl* txtFreq_CLK6;
55     wxButton* btnClearStatus;
56     wxTextCtrl* txtFreq_CLK2;
57     wxCheckBox* chkInvert_CLK2;
58     wxCheckBox* chkInvert_CLK0;
59     wxCheckBox* chkEN_CLK1;
60     wxStaticText* StaticText12;
61     wxStaticText* lblStatus;
62     wxStaticText* lblCLK3;
63     wxCheckBox* chkEN_CLK7;
64     wxCheckBox* chkInvert_CLK1;
65     wxTextCtrl* txtFreq_CLK4;
66     wxTextCtrl* txtCLKIN_MHz;
67     wxStaticText* lblCLK1;
68     wxCheckBox* chkInvert_CLK7;
69     wxCheckBox* chkInvert_CLK5;
70     wxCheckBox* chkEN_CLK2;
71     wxCheckBox* chkEN_CLK0;
72     wxCheckBox* chkInvert_CLK4;
73     wxRadioBox* rgrClkSrc;
74     wxRadioBox* rgrXTALfreq;
75     //*)
76 
77 protected:
78     void ClockEnable(unsigned int i, bool enabled);
79     //(*Identifiers(Si5351C_wxgui)
80     static const long ID_BUTTON2;
81     static const long ID_BUTTON4;
82     static const long ID_STATICTEXT1;
83     static const long ID_TEXTCTRL1;
84     static const long ID_STATICTEXT14;
85     static const long ID_BUTTON1;
86     static const long ID_BUTTON5;
87     static const long ID_STATICTEXT2;
88     static const long ID_STATICTEXT11;
89     static const long ID_STATICTEXT12;
90     static const long ID_STATICTEXT13;
91     static const long ID_STATICTEXT3;
92     static const long ID_CHECKBOX1;
93     static const long ID_TEXTCTRL2;
94     static const long ID_CHECKBOX9;
95     static const long ID_STATICTEXT4;
96     static const long ID_CHECKBOX2;
97     static const long ID_TEXTCTRL3;
98     static const long ID_CHECKBOX10;
99     static const long ID_STATICTEXT5;
100     static const long ID_CHECKBOX3;
101     static const long ID_TEXTCTRL4;
102     static const long ID_CHECKBOX11;
103     static const long ID_STATICTEXT6;
104     static const long ID_CHECKBOX4;
105     static const long ID_TEXTCTRL5;
106     static const long ID_CHECKBOX12;
107     static const long ID_STATICTEXT7;
108     static const long ID_CHECKBOX5;
109     static const long ID_TEXTCTRL6;
110     static const long ID_CHECKBOX13;
111     static const long ID_STATICTEXT8;
112     static const long ID_CHECKBOX6;
113     static const long ID_TEXTCTRL7;
114     static const long ID_CHECKBOX14;
115     static const long ID_STATICTEXT9;
116     static const long ID_CHECKBOX7;
117     static const long ID_TEXTCTRL8;
118     static const long ID_CHECKBOX15;
119     static const long ID_STATICTEXT10;
120     static const long ID_CHECKBOX8;
121     static const long ID_TEXTCTRL9;
122     static const long ID_CHECKBOX16;
123     static const long ID_BUTTON3;
124     //*)
125 
126 private:
127     //(*Handlers(Si5351C_wxgui)
128     void OnbtnLoadFileClick(wxCommandEvent& event);
129     void OnbtnConfigureClockClick(wxCommandEvent& event);
130     void OnbtnResetToDefaultsClick(wxCommandEvent& event);
131     void OnButton1Click(wxCommandEvent& event);
132     void OnbtnReadStatusClick(wxCommandEvent& event);
133     void OnbtnClearStatusClick(wxCommandEvent& event);
134     bool LoadRegValuesFromFile(std::string FName);
135     unsigned char m_newConfiguration[255];
136     lms_device_t* lmsControl;
137     //*)
138 
139 protected:
140 
141     void BuildContent(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size);
142 
143     DECLARE_EVENT_TABLE()
144 };
145 
146 #endif
147