www.pudn.com > WCDMA.rar > TxMenu.m


function fig = TxMenu(sam) 
%************************************************************ 
% 
% Copyright 2002 The Mobile and Portable Radio Research Group 
% 
% Part of GUI for downlink simulator. 
% Generates the Transmitter Configuration menu. 
% This menu allows the user to determine the configuration 
% of the transmitter to include the number of channel, 
% types of channels and channel formats 
% 
%************************************************************ 
 
load TxMenu 
 
global DesiredDPCHformatHandle NumDPCCHforCPCHhandle NumDPCHhandle NumS_CPICHhandle PDSCHformatHandle STTDhandle S_CCPCHformatHandle 
 
s30 = [' 0';' 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']; 
 
s1 = '|SF |Data bits|TPC bits|TFCI bits|Pilot bits|'; 
s2 = '|512|      4  |    2   |    0    |     4    |'; 
s3 = '|512|      2  |    2   |    2    |     4    |'; 
s4 = '|256|     16  |    2   |    0    |     2    |'; 
s5 = '|256|     14  |    2   |    2    |     2    |'; 
s6 = '|256|     14  |    2   |    0    |     4    |'; 
s7 = '|256|     12  |    2   |    2    |     4    |'; 
s8 = '|256|     10  |    2   |    0    |     8    |'; 
s9 = '|256|      8  |    2   |    2    |     8    |'; 
s10 = '|128|     34  |    2   |    0    |     4    |'; 
s11= '|128|     32  |    2   |    2    |     4    |'; 
s12= '|128|     30  |    2   |    0    |     8    |'; 
s13= '|128|     28  |    2   |    2    |     8    |'; 
s14= '| 64|     60  |    4   |    8    |     8    |'; 
s15= '| 32|    140  |    4   |    8    |     8    |'; 
s16= '| 16|    288  |    8   |    8    |    16    |'; 
s17= '|  8|    608  |    8   |    8    |    16    |'; 
s18= '|  4|   1248  |    8   |    8    |    16    |'; 
 
s=strvcat(s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18); 
 
sPDSCH1 = '|SF |Data bits|'; 
sPDSCH2 = '|256|     20  |'; 
sPDSCH3 = '|128|     40  |'; 
sPDSCH4 = '| 64|     80  |'; 
sPDSCH5 = '| 32|    160  |'; 
sPDSCH6 = '| 16|    320  |'; 
sPDSCH7 = '|  8|    640  |'; 
sPDSCH8 = '|  4|   1280  |'; 
 
sPDSCH=strvcat(sPDSCH2,sPDSCH3,sPDSCH4,sPDSCH5,sPDSCH6,sPDSCH7,sPDSCH8); 
 
sSCCPCH1 = '|SF |Data bits|TFCI bits|Pilot bits|'; 
sSCCPCH2 = '|256|     20  |    0    |     0    |'; 
sSCCPCH3 = '|256|     12  |    0    |     8    |'; 
sSCCPCH4 = '|256|     18  |    2    |     0    |'; 
sSCCPCH5 = '|256|     10  |    2    |     8    |'; 
sSCCPCH6 = '|128|     40  |    0    |     0    |'; 
sSCCPCH7 = '|128|     32  |    0    |     8    |'; 
sSCCPCH8 = '|128|     38  |    2    |     0    |'; 
sSCCPCH9 = '|128|     30  |    2    |     8    |'; 
sSCCPCH10= '| 64|     72  |    8    |     0    |'; 
sSCCPCH11= '| 64|     64  |    8    |     8    |'; 
sSCCPCH12= '| 32|    152  |    8    |     0    |'; 
sSCCPCH13= '| 32|    144  |    8    |     8    |'; 
sSCCPCH14= '| 16|    312  |    8    |     0    |'; 
sSCCPCH15= '| 16|    296  |    8    |    16    |'; 
sSCCPCH16= '|  8|    632  |    8    |    0     |'; 
sSCCPCH17= '|  8|    616  |    8    |    16    |'; 
sSCCPCH18= '|  4|   1272  |    8    |    0     |'; 
sSCCPCH19= '|  4|   1256  |    8    |    16    |'; 
 
 
sSCCPCH=strvcat(sSCCPCH2,sSCCPCH3,sSCCPCH4,sSCCPCH5,... 
   sSCCPCH6,sSCCPCH7,sSCCPCH8,sSCCPCH9,sSCCPCH10,sSCCPCH11,... 
   sSCCPCH12,sSCCPCH13,sSCCPCH14,sSCCPCH15,sSCCPCH16,sSCCPCH17,... 
   sSCCPCH18,sSCCPCH19); 
 
s10 = [' 0';' 1';' 2';' 3';' 4';' 5';' 6';' 7';' 8';' 9';'10']; 
 
bdwidth = 5; 
topbdwidth=30; 
ScreenSize = get(0,'ScreenSize'); 
Width = 560; 
Height = 420; 
right = round((ScreenSize(3)-Width)/2)-2*bdwidth; 
bottom = ScreenSize(4)-Height-4*topbdwidth; 
 
%Object Defining Figure 
h0 = figure('Color',[0.8 0.8 0.8], ... 
	'Colormap',mat0, ... 
	'FileName','C:\MATLABR11\work\LGIChannel\DownlinkSimulator\gui\TxMenu.m', ... 
	'PaperPosition',[18 180 576 432], ... 
	'PaperUnits','points', ... 
	'Position',[right bottom 560 420], ... 
	'Tag','Fig1', ... 
   'ToolBar','none'); 
 
%Object for title text 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',20, ... 
	'ListboxTop',0, ... 
	'Position',[69 279 282 24.75], ... 
	'String','WCDMA Downlink Simulator', ... 
	'Style','text', ... 
   'Tag','StaticText1'); 
 
%Object for subtitle text 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',14, ... 
	'ListboxTop',0, ... 
	'Position',[91.5 256.5 222.75 18.75], ... 
	'String','Transmitter Configuration', ... 
	'Style','text', ... 
   'Tag','StaticText2'); 
 
%Objects for defining S-CCPCH format 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[18 185 102 15], ... 
	'String','S-CCPCH Format ID', ... 
	'Style','text', ... 
	'Tag','StaticText4'); 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontName','Courier', ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[18 170 250 15], ... 
	'String',sSCCPCH1, ... 
	'Style','text', ... 
	'Tag','StaticText4'); 
S_CCPCHformatHandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'FontName','Courier', ... 
   'BackgroundColor',[1 1 1], ... 
	'ListboxTop',0, ... 
	'Position',[14.25 159 250 12], ... 
	'String',sSCCPCH, ... 
	'Style','popupmenu', ... 
	'Tag','S-CCPCH Popup', ... 
   'Value',1); 
 
%Objects for defining PDSCH format 
 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[18.5 133 102 15], ... 
	'String','PDSCH Format ID', ... 
   'Style','text', ... 
	'Tag','StaticText4'); 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[18.5 118 125 15], ... 
	'String',sPDSCH1, ... 
   'Style','text', ... 
	'Tag','StaticText4'); 
PDSCHformatHandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'FontName','Courier', ... 
	'BackgroundColor',[1 1 1], ... 
	'ListboxTop',0, ... 
	'Position',[14.25 108 125 12], ... 
	'String',sPDSCH, ... 
	'Style','popupmenu', ... 
	'Tag','PDSCH format Popup', ... 
	'Value',1); 
 
%Objects for defining Desired DPCH format 
 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[18.75 239.25 102 12], ... 
	'String','Desired DPCH Format', ... 
	'Style','text', ... 
   'Tag','StaticText4'); 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontName','Courier', ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[18.75 225.25 300 12], ... 
	'String',s1, ... 
	'Style','text', ... 
	'Tag','StaticText4'); 
DesiredDPCHformatHandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[1 1 1], ... 
   'ListboxTop',0, ... 
	'FontName','Courier', ... 
	'Position',[15 211.5 300 12], ... 
	'String',s, ... 
	'Style','popupmenu', ... 
	'Tag','Desired DPCH Format Popup', ... 
	'Value',1); 
 
%Objects for determining the number of remaining DPCHs 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[150 125 136.5 15], ... 
	'String','Number of Remaining DPCHs', ... 
	'Style','text', ... 
	'Tag','StaticText4'); 
NumDPCHhandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[1 1 1], ... 
	'ListboxTop',0, ... 
	'Position',[190 108 47.25 12], ... 
	'String',s30, ... 
	'Style','popupmenu', ... 
	'Tag','Remaining DPCH Popup', ... 
   'Value',1); 
 
%Objectrs for determining the number of DPCCHs for CPCH 
 
NumDPCCHforCPCHhandle  = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[1 1 1], ... 
	'ListboxTop',0, ... 
	'Position',[190 63 47.25 12], ... 
	'String',s10, ... 
	'Style','popupmenu', ... 
	'Tag','Number of DPCCHs for CPCH popup', ... 
	'Value',1); 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[150 80 136.5 15], ... 
	'String','Number of DPCCHs for CPCH', ... 
	'Style','text', ... 
   'Tag','StaticText4'); 
 
%Objects for determining the number of S-CPICHs 
 
h1 = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
	'FontSize',10, ... 
	'HorizontalAlignment','left', ... 
	'ListboxTop',0, ... 
	'Position',[300 125 108 15], ... 
	'String','Number of S-CPICHs', ... 
	'Style','text', ... 
	'Tag','StaticText4'); 
NumS_CPICHhandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
   'BackgroundColor',[1 1 1], ... 
	'ListboxTop',0, ... 
	'Position',[300 108 53.25 12], ... 
	'String',s10, ... 
	'Style','popupmenu', ... 
	'Tag','Number of S-CPICHs', ... 
   'Value',1); 
 
%Objects for determining whether STTD is used in the simulation 
 
STTDhandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
	'BackgroundColor',[ 0.8 0.8 0.8], ... 
   'FontSize',10, ... 
	'ListboxTop',0, ... 
	'Position',[300 80 105 16.5], ... 
	'String','Transmit with STTD', ... 
	'Style','checkbox', ... 
   'Tag','Checkbox1'); 
 
%Navigation Objects 
 
CancelHandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
   'ListboxTop',0, ... 
   'Callback','close',... 
	'Position',[288.75 12.75 51 18], ... 
	'String','Cancel', ... 
	'Tag','Pushbutton1'); 
NextHandle = uicontrol('Parent',h0, ... 
	'Units','points', ... 
   'ListboxTop',0, ... 
   'Callback','NextCallback',... 
	'Position',[228 12.75 51 18], ... 
	'String','Next>>', ... 
   'Tag','Pushbutton1'); 
 
if nargin==1 
   FormatIDs = [0 3 5 8 11 14 17 20 23 26 29 32 35 38 41 44 47]; 
   [fee I] = min(abs(sam.DesiredDPCHformatID - FormatIDs)); 
   set(DesiredDPCHformatHandle,'value',I); 
   set(NumDPCCHforCPCHhandle,'value',sam.NumDPCCHforCPCH+1); 
   set(NumDPCHhandle,'value',sam.Num_DPCH+1); 
   set(NumS_CPICHhandle,'value',sam.NumS_CPICH+1); 
   set(PDSCHformatHandle,'value',sam.PDSCHformatID+1); 
   set(STTDhandle,'value',sam.STTD); 
   set(S_CCPCHformatHandle,'value',sam.S_CCPCHformatID+1); 
end 
 
 
 
if nargout > 0, fig = h0; end