ui_read_options.m

来自「Jankiraman and Mohinder s Space-time cod」· M 代码 · 共 88 行

M
88
字号
function sim_options = ui_read_options
%**************************************************************************
%This program inputs the GUI choices.
%**************************************************************************

% frame length, in symbols
Frm_length = eval(get(findobj('Tag', 'FrmLen'),'String'));

% number of packets
NumberofPackets = eval(get(findobj('Tag', 'NumofPkt'),'String'));

% Channel models
if get(findobj('Tag', 'AWGN'),'Value')
   chan_model = 'AWGN';
elseif get(findobj('Tag', 'Rayleigh'),'Value')
   chan_model = 'Rayleigh';
end

% Rx Diversity options
oneRx = get(findobj('Tag', '1Rx'),'Value');
if oneRx==1
    rx_div=1;
end
twoRx = get(findobj('Tag', '2Rx'),'Value');
if twoRx==1
    rx_div=2;
end

% channel estimation
ch_est=get(findobj('Tag', 'Channel_Est'),'Value');

%receive correlation
rx_corr=get(findobj('Tag', 'Rx_corr'),'Value');

% trellis options
if get(findobj('Tag', '4state_4psk'),'Value')
   option = '4_State_4PSK';
elseif get(findobj('Tag', '8state_4psk'),'Value')
   option = '8_State_4PSK';
elseif get(findobj('Tag', '16state_4psk'),'Value')
   option = '16_State_4PSK';
elseif get(findobj('Tag', '32state_4psk'),'Value')
   option = '32_State_4PSK';
elseif get(findobj('Tag', '8state_8psk'),'Value')
   option = '8_State_8PSK';
elseif get(findobj('Tag', '16state_8psk'),'Value')
   option = '16_State_8PSK';
elseif get(findobj('Tag', '32state_8psk'),'Value')
   option = '32_State_8PSK';
elseif get(findobj('Tag', 'DelayDiv_8psk'),'Value')
   option = 'DelayDiv_8PSK';
elseif get(findobj('Tag', '16state_16qam'),'Value')
   option = '16_State_16qam';
elseif get(findobj('Tag', 'DelayDiv_16qam'),'Value')
   option = 'DelayDiv_16qam';
end

%Save file
savefile=get(findobj('Tag', 'Savefile'),'Value');
filename = get(findobj('Tag', 'FileName'),'String');

str1=filename;
if isempty(str1) & savefile==1
uiwait(errordlg('Enter file name!! Program will exit to command line.','Invalid Input','Modal'));
return;
end

%correlation coefficient
Rx_corr=get(findobj('Tag', 'Rx_corr'),'Value');
corr_val_str=eval(get(findobj('Tag', 'corr_value'),'String'));
if corr_val_str==0 & Rx_corr==1
uiwait(errordlg('Enter correlation coefficient value between 0 and 1!! Program will exit to command line.','Invalid Input','Modal'));
return;
end


sim_options = struct('FrmLen', Frm_length, ...
   'NumberofPackets', NumberofPackets, ...
   'ChannelModel',chan_model, ...
   'Option', option, ...
   'RxDiv',rx_div, ...
   'Channel_Est',ch_est, ...
   'Rx_corr', rx_corr, ...
   'corr_value',corr_val_str, ...
   'Savefile',savefile,...
   'FileName',filename);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?