📄 channelmenu.m
字号:
function fig = ChannelMenu(sam)
%************************************************************
%
% Copyright 2002 The Mobile and Portable Radio Research Group
%
% Part of GUI for downlink simulator.
% Generates the channel menue and controls the processing and
% navigation whil in that menu
%
%************************************************************
global DelayHandle AmpHandle EbNoHandle VelocityHandle
load ChannelMenu
bdwidth = 5;
topbdwidth=30;
ScreenSize = get(0,'ScreenSize');
Width = 500;
Height = 430;
right = round((ScreenSize(3)-Width)/2);
bottom = ScreenSize(4)-Height-4*topbdwidth;
%Generate Figure
h0 = figure('Color',[0.8 0.8 0.8], ...
'Colormap',mat0, ...
'FileName','C:\MATLABR11\work\LGIChannel\DownlinkSimulator\gui\ChannelMenu.m', ...
'PaperPosition',[18 180 576 432], ...
'PaperUnits','points', ...
'Position',[right bottom Width Height], ...
'Tag','Fig3', ...
'ToolBar','none');
%Generate Subtitle
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[105 247.5 198.75 19.5], ...
'String','Channel Configuation', ...
'Style','text', ...
'Tag','StaticText2');
%Generate Title
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',18, ...
'ListboxTop',0, ...
'Position',[93.75 278.25 237 24], ...
'String','WCDMA Downlink Simulator', ...
'Style','text', ...
'Tag','StaticText1');
%Interface for the EbNo edit box
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',10, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[134.25 220.5 41.25 15], ...
'String','EbNo', ...
'Style','text', ...
'Tag','StaticText3');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',10, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[236.25 220.5 47.25 15], ...
'String','decibels', ...
'Style','text', ...
'Tag','StaticText3');
EbNoHandle = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[189.75 220.5 36 14.25], ...
'Style','edit', ...
'String','0', ...
'Tag','EbNo Box');
%Interface for the Velocity edit box
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',10, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[88.5 193.5 89.25 15], ...
'String','Maximum Velocity', ...
'Style','text', ...
'Tag','StaticText3');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',10, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[236.25 193.5 31.5 15], ...
'String','km/hr', ...
'Style','text', ...
'Tag','StaticText3');
VelocityHandle = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[189.75 193.5 36 14.25], ...
'Style','edit', ...
'String','0', ...
'Tag','Velocity Box');
%Object for Multipath Profile
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[40.5 164.25 111 19.5], ...
'String','Multipath Profile', ...
'Style','text', ...
'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',10, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[36.75 140.25 152.5 14.25], ...
'String','Delays in nanoseconds (ns)', ...
'Style','text', ...
'Tag','StaticText2');
%Objects for Multipath Delays
DelayHandle(1) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[37.5 122.25 45 15], ...
'Style','edit', ...
'String','0',...
'Tag','EditText1');
DelayHandle(2) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[87.75 121.5 45 15], ...
'Callback','BoxNum=2;DelayCallback',...
'Style','edit', ...
'Tag','EditText1');
DelayHandle(3) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[137.25 121.5 45 15], ...
'Callback','BoxNum=3;DelayCallback',...
'Style','edit', ...
'Tag','EditText1');
DelayHandle(4) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[187.5 121.5 45 15], ...
'Callback','BoxNum=4;DelayCallback',...
'Style','edit', ...
'Tag','EditText1');
DelayHandle(5) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[237.75 121.5 45 15], ...
'Callback','BoxNum=5;DelayCallback',...
'Style','edit', ...
'Tag','EditText1');
DelayHandle(6) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[287.25 121.5 45 15], ...
'Callback','BoxNum=6;DelayCallback',...
'Style','edit', ...
'Tag','EditText1');
%Objects for Amplitudes of each multipath componet
AmpHandle(1) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[37.5 80.25 45 15], ...
'Callback','BoxNum=1;AmpCallback',...
'Style','edit', ...
'String','0',...
'Tag','EditText1');
AmpHandle(2) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[87.75 80.25 45 15], ...
'Callback','BoxNum=2;AmpCallback',...
'Style','edit', ...
'Tag','EditText1');
AmpHandle(3) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[137.25 80.25 45 15], ...
'Callback','BoxNum=3;AmpCallback',...
'Style','edit', ...
'Tag','EditText1');
AmpHandle(4) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[187.5 80.25 45 15], ...
'Callback','BoxNum=4;AmpCallback',...
'Style','edit', ...
'Tag','EditText1');
AmpHandle(5) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[237.75 80.25 45 15], ...
'Callback','BoxNum=5;AmpCallback',...
'Style','edit', ...
'Tag','EditText1');
AmpHandle(6) = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'ListboxTop',0, ...
'Position',[287.25 80.25 45 15], ...
'Callback','BoxNum=6;AmpCallback',...
'Style','edit', ...
'Tag','EditText1');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'FontSize',10, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[39 96 135.75 14.25], ...
'String','Relative Amplitude in decibels', ...
'Style','text', ...
'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'ListboxTop',0, ...
'Position',[23.25 63 351.75 14.25], ...
'String',mat1, ...
'Style','text', ...
'Tag','StaticText2');
%Naviagation Keys
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'ListboxTop',0, ...
'Position',[293.75 29.25 45 15], ...
'Callback','close',...
'String','Cancel', ...
'Tag','Pushbutton2');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'ListboxTop',0, ...
'Position',[238.75 29.25 45 15], ...
'Callback','NextChannelCallback',...
'String','Next >>', ...
'Tag','Pushbutton2');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.831372549019608 0.815686274509804 0.784313725490196], ...
'Callback','close;ModulatorMenu(SimConfig)',...
'ListboxTop',0, ...
'Position',[183.75 29.25 45 15], ...
'String','<< Back', ...
'Tag','Pushbutton2');
if nargin == 1
if isfield(sam,'EbNo_dB')
EbNo_dB = sam.EbNo_dB;
set(EbNoHandle,'String',num2str(EbNo_dB));
end
if isfield(sam,'Velocity')
velocity = sam.Velocity;
set(VelocityHandle,'String',velocity);
end
if isfield(sam,'Delays')
%Get the length of the array
DelayLength = length(sam.Delays);
%The length of the array must be non-zero.
%If its length is zero, then there is not data to load into the
%menu. Otherwise load the data
if (DelayLength > 0) & (DelayLength <=6)
for k=1:DelayLength
TempDelay = sam.Delays(k)*1e9;
TempAmp = sam.Amplitudes(k);
set(DelayHandle(k),'String',TempDelay);
set(AmpHandle(k),'String',TempAmp);
end
end
end
end
if nargout > 0, fig = h0; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -