-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateGUI.m
62 lines (52 loc) · 3.77 KB
/
CreateGUI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function [gui_text_freq] = CreateGUI(params)
global Ftune;
global F_radio;
%% Frequency entry box
f = figure('Name','KC6F SDR','NumberTitle','off', 'Visible','off',...
'Position',[360,500,450,285], 'ToolBar', 'none',...
'MenuBar', 'none', 'CloseRequestFcn', @quitCallback);
% Text Displays
gui_text_freq = uicontrol('Style','text','String',[num2str(1e-6*Ftune, '%#2.6g') ' MHz'],...
'HorizontalAlignment', 'left',...
'FontSize', 22, 'FontName', 'Courier New Bold',...
'Position',[20,140,420,30]);
%% Sliders
IF_tune_range = 1e-3*(params.Fs_radio/2 - 10e3);
gui_slider_IF_tune = uicontrol('Style', 'slider',...
'Min',-IF_tune_range,'Max',IF_tune_range,'Value',0, 'SliderStep', [.1 1]/384,...
'Position', [20 240 420 20],...
'Callback', @(source,callbackdata) updateIFcallback(source,callbackdata));
gui_slider_Radio_tune = uicontrol('Style', 'slider',...
'Min',1.6,'Max',30.0,'Value',1e-6*F_radio, 'SliderStep', [.01 .1]/(30-1.6),...
'Position', [20 180 420 20],...
'Callback', @(source,callbackdata) updateRadioFreqCallback(source,callbackdata));
%% Pushbuttons
gui_button_ptt = uicontrol('Style', 'pushbutton', 'String', 'PTT',...
'enable','on', 'Position', [20 20 50 20],...
'FontWeight', 'bold', 'Callback', @(hObject, eventdata) pttButtonCallback(hObject, eventdata, params.SR_DLL_NAME));
%% Menu Bar
gui_menu_file = uimenu('Label','File');
uimenu(gui_menu_file,'Label','Quit','Callback',@quitCallback);
gui_menu_radio = uimenu('Label','Radio');
uimenu(gui_menu_radio,'Label','Open Radio','Callback',@openRadioCallback);
uimenu(gui_menu_radio,'Label','Close Radio','Callback',@closeRadioCallback);
gui_menu_DSP = uimenu('Label','Noise Reduction');
uimenu(gui_menu_DSP,'Label','None','Callback',@(source, callbackdata)noiseMenuCallback(source, callbackdata, gui_menu_DSP), 'Checked', 'on');
uimenu(gui_menu_DSP,'Label','Wavelet','Callback',@(source, callbackdata)noiseMenuCallback(source, callbackdata, gui_menu_DSP), 'Checked', 'off');
uimenu(gui_menu_DSP,'Label','Savitzky-Golay','Callback',@(source, callbackdata)noiseMenuCallback(source, callbackdata, gui_menu_DSP), 'Checked', 'off');
gui_menu_mode = uimenu('Label','Mode');
uimenu(gui_menu_mode,'Label','USB','Callback', @(source, callbackdata)modeCallback(source, callbackdata, gui_menu_mode), 'Checked', 'on');
uimenu(gui_menu_mode,'Label','LSB','Callback',@(source, callbackdata)modeCallback(source, callbackdata, gui_menu_mode), 'Checked', 'off');
uimenu(gui_menu_mode,'Label','CW','Callback',@(source, callbackdata)modeCallback(source, callbackdata, gui_menu_mode), 'Checked', 'off');
uimenu(gui_menu_mode,'Label','AM','Callback',@(source, callbackdata)modeCallback(source, callbackdata, gui_menu_mode), 'Checked', 'off');
%% Labels
uicontrol('Style','text','String',['IF Offset'],...
'HorizontalAlignment', 'left',...
'FontSize', 12,...
'Position',[20,260,420,20]);
uicontrol('Style','text','String',['Radio Tune'],...
'HorizontalAlignment', 'left',...
'FontSize', 12,...
'Position',[20,200,420,20]);
f.Visible = 'on';
end