%% =========================================================================== % Copyright (C) 1998,99 by Telia Research AB, Lulea, Sweden; All rights reserved. % % Description : Graphical setup window for duplex simulator % % File : uiSetup.m % Project : FSAN duplex model % Author(s) : Tomas Nordstrom (Tomas.B.Nordstrom@Telia.se) % : % % CVS: $Id: uiSetup.m,v 1.2 1999/03/31 13:16:38 tono Exp $ %% =========================================================================== % Change History % 1998-12-15 (ToNo) Created % 1998-12-16 (ToNo) Added popups for scenario and duplex setting % 1998-12-16 (ToNo) Added parameter editing and start button % 1998-12-17 (ToNo) Removed uiInit (set things here instead) % 1998-12-17 (ToNo) Added more parameters for editing (like PBO) % 1998-12-22 (ToNo) Added more comments % 1999-01-04 (ToNo) Fixed handling of efficiencyLoss % 1999-01-05 (ToNo) Changed modem under test selection, Added FSAN % noise model selection, Removed precalc models % 1999-01-11 (ToNo) Let HAM band flag be reflected in PSD plot % and allowed instant window resizing % 1999-01-14 (ToNo) Working on the str2mat/mat2str & char bug % 1999-02-05 (DaB) Added go function in go button % 1999-02-07 (ToNo) Modified layout to encompass NEXT/FEXT/3cXT levels % 1999-02-12 (ToNo) Added support for PBOmaxlen % 1999-02-25 (ToNo) Generlized list (tfplist) handling % 1998-02-26 (ToNo) Made tt scenarios into a list %% =========================================================================== global ex; global setupfig; global res; figure(setupfig); % Use and show our setup window set(setupfig,'ResizeFcn','uiSetup') clf; figsize=get(gcf,'Position'); % Define sizes and positions of figures fwidth=figsize(3); fheight=figsize(4); uiheight=225; % User interaction area height plotheight=(fheight-uiheight)/2; % Make space for two diagrams plotbd=35; % Coordinates for some of the drawing areas (axes); RECT = [left, bottom, width, height] coordall=[1 1 fwidth fheight]; coordui=[1 fheight-uiheight fwidth uiheight]; coordfm=[plotbd plotheight+plotbd fwidth-plotbd*2 plotheight-plotbd*2]; coordfl=[plotbd plotbd fwidth-plotbd*2 plotheight-plotbd*2]; % Set up drawing areas sallax=axes('Units','pixels','pos',coordall); % The whole window axis('off'); suiax=axes('Units','pixels','pos',coordui); % User interaction area fill([0 0 1 1] ,[0 1 1 0],'w'); axis('off'); plotheight=(fheight-uiheight)/2; tfax=axes('Units','pixels','pos',coordfm); % Area for TF plan axis('off'); psdax=axes('Units','pixels','pos',coordfl); % Area for VDSL PSD mask axis('off'); baseSize=get(0,'DefaultTextFontSize'); %% =========================================================================== % Show & set parameters axes(sallax); % Set up scenario popup menu tmpstr= sprintf('Scenario:'); text(20, fheight-20, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+2,'FontWeight','bold'); scen = getNameList(ex.ttlist); val=1; for i=1:length(scen(:,1)), % get previous value selected if strcmp(deblank(scen(i,:)),ex.tt.name) val=i; break; end end uicontrol('style','popupmenu','string', scen, 'value',val,... 'units','pixels','pos',[20, fheight-50 270 20], ... 'FontSize', baseSize+1, 'BackgroundColor', [1 1 0.9], ... 'callback', 'ex.tt=getList(ex.ttlist,deblank(scen(get(gcbo, ''value''),:)));axes(psdax);plotTTstructure(ex.tt);ex.param.PBOmaxlen=getMaxVDSLlength(ex.tt.topology,ex.tt.traffic); set(pbolenui,''string'',num2str(ex.param.PBOmaxlen));' ... ); % Set up FSAN noise model dval=getNoiseModels; val=1; for i=1:length(dval(:,1)), % get previous value selected if strcmp(deblank(dval(i,:)),ex.param.FSANNoiseModel) val=i; break; end end tmpstr= sprintf('Use noise model:'); text(20, fheight-60, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','popupmenu','string', dval, 'value',1,... 'units','pixels','pos',[20, fheight-90 270 20], ... 'FontSize', baseSize+1, 'BackgroundColor', [1 1 0.9], ... 'callback', 'ex.param.FSANNoiseModel=deblank(dval(get(gcbo, ''value''),:));' ... ); % Set up VDSL duplex popup menu k=1;vval=1; for i=1:length(ex.tfplist), if strncmp(ex.tfplist(i).name,'VDSL',4) modemcells(k)={ex.tfplist(i).name}; if strcmp(ex.tfplist(i).name,ex.param.vdslDuplex) vval=k; ex.param.efficiencyLoss=ex.tfplist(i).efficiencyLoss; end k=k+1; end end % modems=str2mat(modemcells); %org % modems=mat2str(char(modemcells)); %Gye modems=str2mat(char(modemcells)); tmpstr= sprintf('VDSL duplex:'); text(20, fheight-100, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','popupmenu','string', modems, 'value',vval,... 'units','pixels','pos',[20, fheight-130 270 20], ... 'FontSize', baseSize+1, 'BackgroundColor', [1 1 0.9], ... 'callback', 'ex.param.vdslDuplex=deblank(modems(get(gcbo, ''value''),:));axes(tfax);plotTFplan(getList(ex.tfplist,ex.param.vdslDuplex),''Lin'');tfplan=getList(ex.tfplist,ex.param.vdslDuplex);set(pbomui,''value'',findStrIndex(getPBOmethods,tfplan.PBOmethod));set(pbopui,''string'',num2str(tfplan.PBOparam));set(effui,''string'',num2str(tfplan.efficiencyLoss));ex.param.efficiencyLoss=tfplan.efficiencyLoss;set(tduui,''string'',num2str(tfplan.timeDivision.up));set(tddui,''string'',num2str(tfplan.timeDivision.down));' ... ); % Buttons to run things uicontrol('string','GO', 'Position', [310 fheight-uiheight+10 60 20],... 'callback','callbackGO;') uicontrol('string','Close all', 'Position', [430 fheight-uiheight+10 60 20],... 'callback','close all') % Parameters to edit lheight=fheight-20; delta=20; lheight=lheight-delta; tmpstr= sprintf('Fast calculation:'); text(310, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','checkbox','Value',ex.param.fastrecalc,... 'units','pixels','HorizontalAlignment','left',... 'pos',[510 lheight-10 20 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.fastrecalc=get(gcbo,''value'');' ... ); lheight=lheight-delta; tmpstr= sprintf('Force HAM band:'); text(310, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','checkbox','Value',ex.param.HAM,... 'units','pixels','HorizontalAlignment','left',... 'pos',[510 lheight-10 20 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.HAM=get(gcbo,''value'');axes(tfax);plotTFplan(getList(ex.tfplist,ex.param.vdslDuplex),''Lin'');' ... ); lheight=lheight-delta; tmpstr= sprintf('Test Modem:'); text(310, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); tmpstr= sprintf('ADSL'); text(430, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','checkbox','Value',ex.param.testADSL,... 'units','pixels','HorizontalAlignment','left',... 'pos',[510 lheight-10 20 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.testADSL=get(gcbo,''value'');' ... ); lheight=lheight-delta; tmpstr= sprintf('Background noise:'); text(310, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','edit',... 'string',num2str(ex.param.backgroundNoise),'units','pixels','HorizontalAlignment','left',... 'pos',[430 lheight-10 100 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.backgroundNoise=str2num(get(gcbo,''string''));' ... ); lheight=lheight-delta; tmpstr= sprintf('SNR max:'); text(310, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','edit',... 'string',num2str(ex.param.SNRMax),'units','pixels','HorizontalAlignment','left',... 'pos',[430 lheight-10 100 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.SNRMax=str2num(get(gcbo,''string''));' ... ); lheight=lheight-delta; tmpstr= sprintf('Shannon gap:'); text(310, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); uicontrol('style','edit',... 'string',num2str(ex.param.shannonGap),'units','pixels','HorizontalAlignment','left',... 'pos',[430 lheight-10 100 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.shannonGap=str2num(get(gcbo,''string''));' ... ); lheight=lheight-delta; text(310, lheight, 'Level:', 'Units','pixels', 'FontSize', baseSize+1); text(360, lheight, 'NEXT:', 'Units','pixels', 'FontSize', baseSize+1); text(420, lheight, 'FEXT:', 'Units','pixels', 'FontSize', baseSize+1); text(480, lheight, '3cXT:', 'Units','pixels', 'FontSize', baseSize+1); lheight=lheight-delta; uicontrol('style','edit', 'string',num2str(ex.param.XTlevel.NEXT), ... 'units','pixels','HorizontalAlignment','left',... 'pos',[360 lheight-10 50 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.XTlevel.NEXT=str2num(get(gcbo,''string''));' ... ); uicontrol('style','edit', 'string',num2str(ex.param.XTlevel.FEXT), ... 'units','pixels','HorizontalAlignment','left',... 'pos',[420 lheight-10 50 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.XTlevel.FEXT=str2num(get(gcbo,''string''));' ... ); uicontrol('style','edit', 'string',num2str(ex.param.XTlevel.thirdCXT), ... 'units','pixels','HorizontalAlignment','left',... 'pos',[480 lheight-10 50 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.XTlevel.thirdCXT=str2num(get(gcbo,''string''));' ... ); % Parameters connected to the modem choosen lheight=fheight-125; tfplan=getList(ex.tfplist,ex.param.vdslDuplex); lheight=lheight-delta; tmpstr= sprintf('PBO method:'); text(20, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); pbomethods=getPBOmethods; pboval=findStrIndex(pbomethods,tfplan.PBOmethod); pbomui=uicontrol('style','popupmenu','string', pbomethods, 'value',pboval,... 'units','pixels','pos',[120, lheight-10 100 20], ... 'FontSize', baseSize+1, 'BackgroundColor', [1 1 0.9], ... 'callback', 'tfplan.PBOmethod=deblank(pbomethods(get(gcbo, ''value''),:));ex.tfplist=setList(ex.tfplist,ex.param.vdslDuplex,tfplan);' ... ); lheight=lheight-delta; tmpstr= sprintf('PBO parameter:'); text(20, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); pbopui=uicontrol('style','edit',... 'string',num2str(tfplan.PBOparam),'units','pixels','HorizontalAlignment','left',... 'pos',[120 lheight-10 60 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'tfplan.PBOparam=str2num(get(gcbo,''string''));ex.tfplist=setList(ex.tfplist,ex.param.vdslDuplex,tfplan);' ... ); tmpstr= sprintf('Max len:'); text(200, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); pbolenui=uicontrol('style','edit',... 'string',num2str(ex.param.PBOmaxlen),'units','pixels','HorizontalAlignment','left',... 'pos',[255 lheight-10 35 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.PBOmaxlen=str2num(get(gcbo,''string''));' ... ); lheight=lheight-delta; tmpstr= sprintf('Efficiency loss'); text(20, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); effui=uicontrol('style','edit',... 'string',num2str(ex.param.efficiencyLoss), ... 'units','pixels','HorizontalAlignment','left',... 'pos',[120 lheight-10 100 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'ex.param.efficiencyLoss=str2num(get(gcbo,''string''));' ... ); lheight=lheight-delta; tmpstr= sprintf('Time div. up:'); text(20, lheight, tmpstr, ... 'Units','pixels', 'FontSize', baseSize+1); tduui=uicontrol('style','edit',... 'string',num2str(tfplan.timeDivision.up),'units','pixels',... 'HorizontalAlignment','left',... 'pos',[120 lheight-10 40 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'tfplan.timeDivision.up=str2num(get(gcbo,''string''));ex.tfplist=setList(ex.tfplist,ex.param.vdslDuplex,tfplan);' ... ); text(180, lheight, 'down:', 'Units','pixels', 'FontSize', baseSize+1); tddui=uicontrol('style','edit',... 'string',num2str(tfplan.timeDivision.down),'units','pixels', ... 'HorizontalAlignment','left',... 'pos',[220 lheight-10 40 20],'backgroundcolor', [1 1 0.9], ... 'callback', 'tfplan.timeDivision.down=str2num(get(gcbo,''string''));ex.tfplist=setList(ex.tfplist,ex.param.vdslDuplex,tfplan);' ... ); % Show traffic and topology structure axes(psdax); plotTTstructure(ex.tt); % Show PSD masks for VDSL modem axes(tfax); fax.min=ex.param.minfrequency; fax.max=ex.param.maxfrequency; plotTFplan(getList(ex.tfplist,ex.param.vdslDuplex),'Lin'); drawnow;