📄 bsedit.m
字号:
%BSEDIT BSEDIT displays a dialog box to add or modify base stations
%
%Inputs (from base workspace):
% activeBS: BS to show
%Outputs:
% modified array of basestation structures
%
%Authors: Achim Wacker (AWa) NTC, Kai Heikkinen (KHeik) NET
%
%Revision: 5.0.0cd Date: 17-Jul-2001
%
%needed m-files: BSplot.m, BSshow.m, BSwrite.m
h0 = figure(...
'Units', 'Pixels', ...
'Color', [0.8 0.8 0.8], ...
'Name', 'npsw 5.0.0 - BS edit window', ...
'NumberTitle', 'off', ...
'PaperType', 'A4', ...
'Position', [300 145 580 520], ...
'Tag', 'FigBSedit');
%location
locParamText = [{'x coordinate:'}, {'y coordinate:'}, {'ground height:'}];
locCallback = str2mat(...
'basestation(currentBS).x = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).y = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).groundHeight = str2num(get(gcbo, ''String''));');
locTag = str2mat('EditTextXcoord', 'EditTextYcoord', 'EditTextGroundHeight');
%TRX
trxParamText = [...
{'antenna height:'}, {'antenna type:'}, {'antenna direction:'}, {'antenna tilt:'}, ...
{'cable losses:'}, {'MHA gain:'}, {'RF head gain:'}, {'max. total TX power:'}, ...
{'max. TX power/link (CHE):'}, {'min. TX power/link (CHE):'}, {'max. TX power/link (soft):'}, ...
{'CPICH power:'}, {'other CCH powers:'}, {'CPICH-to-ref-RAB-offset:'}, {'channel type:'}, ...
{'carriers:'}];
trxUnit = str2mat('m', '', 'deg NTE', 'deg', 'dB', 'dB', 'dB', 'dBm', 'dBm', 'dBm', 'dBm', 'dBm', ...
'dBm', 'dB', '', '');
trxCallback = str2mat(...
'basestation(currentBS).antennaHeight = str2num(get(gcbo, ''String''));', ...
'',...
'basestation(currentBS).antennaDir = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).antennaTilt = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).cableLosses = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).mhaGain = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).rfHeadGain = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).txMaxPower = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).txMaxPowerPerLink = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).txMinPowerPerLink = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).pTxDLAbsMax = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).CPICHPower = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).commonChannelOther = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).CPICHToRefRabOffset = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).channel = str2num(get(gcbo, ''String''));', ...
'basestation(currentBS).numCarr = str2num(get(gcbo, ''String''));');
trxTag = str2mat(...
'EditTextAntennaHeight', '', 'EditTextAntennaDir', 'EditTextAntennaTilt', ...
'EditTextCableLosses', 'EditTextMhaGain', 'EditTextRfHeadGain', 'EditTextTxPower', ...
'EditTextTxMaxPowerPerLink', 'EditTextTxMinPowerPerLink', 'EditTextPTxDLAbsMax', ...
'EditTextCPICHPower', 'EditTextCommonChannelOther', 'EditTextCPICHToRefRabOffset', ...
'EditTextChannel', 'EditTextNumCarr');
%Loading
uetaParamText = [{'max. own load:'}, {'max. total load:'}];
uetaCallback = str2mat(...
'basestation(currentBS).excessLoadOwn = str2num(get(gcbo, ''String''))/100;', ...
'basestation(currentBS).excessLoadTotal = str2num(get(gcbo, ''String''))/100;');
uetaTag = str2mat('EditTextUetaOwn', 'EditTextUetaTotal');
framePos = [30 310 215 95; 265 60 290 420; 30 185 215 70; 30 60 215 70];
frameTextPos = [30 405 131 23; 265 480 114 23; 30 255 130 23; 30 130 125 23];
frameText = [{'Location parameters:'}, {'TRx parameters:'}, {'UL load parameters:'}, ...
{'SHO parameter(s):'}];
for k = 1:length(frameText) %frames and titles
h1 = uicontrol(...
'Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'ListboxTop', 0, ...
'Position', framePos(k, :), ...
'Style', 'frame', ...
'Tag', 'Frame1');
h1 = uicontrol(...
'Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'left', ...
'ListboxTop', 0, ...
'Position', frameTextPos(k, :), ...
'String', frameText(k), ...
'Style', 'text', ...
'Units', 'Pixels');
end
for k = 1:length(locParamText)
h1 = uicontrol(...
'parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [45 395-k*25 75 20], ...
'String', locParamText(k), ...
'Style', 'text', ...
'Units', 'Pixels');
h1 = uicontrol(...
'parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [200 395-k*25 25 20], ...
'String', 'm', ...
'Style', 'text', ...
'Units', 'Pixels');
h1 = uicontrol(...
'Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', deblank(locCallback(k, :)), ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [135 398-k*25 75 20], ...
'String', '0', ...
'Style', 'edit', ...
'Units', 'Pixels', ...
'Tag', deblank(locTag(k, :)));
end
for k = 1:length(uetaParamText)
h1 = uicontrol(...
'parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [45 245-k*25 75 20], ...
'String', uetaParamText(k), ...
'Style', 'text', ...
'Units', 'Pixels');
h1 = uicontrol(...
'parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [200 245-k*25 25 20], ...
'String', '%', ...
'Style', 'text', ...
'Units', 'Pixels');
h1 = uicontrol(...
'Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', deblank(uetaCallback(k, :)), ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [135 248-k*25 75 20], ...
'String', '0', ...
'Style', 'edit', ...
'Units', 'Pixels', ...
'Tag', deblank(uetaTag(k, :)));
end
for k = 1:length(trxParamText)
h1 = uicontrol(...
'parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [280 470-k*25 130 20], ...
'String', trxParamText(k), ...
'Style', 'text', ...
'Units', 'Pixels');
if k ~= 2
h1 = uicontrol(...
'parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'left', ...
'ListboxTop', 0, ...
'Position', [500 470-k*25 50 20], ...
'String', deblank(trxUnit(k, :)), ...
'Style', 'text', ...
'Units', 'Pixels');
h1 = uicontrol(...
'Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', deblank(trxCallback(k, :)), ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [420 473-k*25 75 20], ...
'String', '0', ...
'Style', 'edit', ...
'Units', 'Pixels', ...
'Tag', deblank(trxTag(k, :)));
else
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', 'basestation(currentBS).antennaType = strtok(antName(get(gcbo, ''Value''), :));', ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [420 423 100 20], ...
'String', antName, ...
'Style', 'popupmenu', ...
'Tag', 'PopupAntennaType', ...
'Units', 'Pixels', ...
'Value', 3);
end
end
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [45 488 75 15], ...
'String', 'active BS:', ...
'Style', 'text', ...
'Units', 'Pixels');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', [...
'currentBS = str2num(get(gcbo, ''String''));' ...
'BSshow(basestation(currentBS), gcf);'], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [135 485 75 20], ...
'String', '57', ...
'Style', 'edit', ...
'Units', 'Pixels', ...
'Tag', 'EditTextCurrentBS', ...
'Value', []);
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [45 463 75 15], ...
'String', 'operator/carrier:', ...
'Style', 'text', ...
'Units', 'Pixels');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', [...
'tmpOperator = str2num(get(gcbo, ''String''));' ...
'basestation(currentBS).usedCarr = tmpOperator;' ...
'BSshow(basestation(currentBS), gcf);'], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [135 460 75 20], ...
'String', '1', ...
'Style', 'edit', ...
'Units', 'Pixels', ...
'Tag', 'EditTextOperator', ...
'Value', []);
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'left', ...
'ListboxTop', 0, ...
'Position', [220 72 15 15], ...
'String', '0', ...
'Style', 'text', ...
'Units', 'Pixels', ...
'Tag', 'StaticText9');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [105 72 20 15], ...
'String', '-20', ...
'Style', 'text', ...
'Units', 'Pixels', ...
'Tag', 'StaticText10');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', [...
'basestation(currentBS).WINDOW_ADD = get(gcbo, ''Value'');'...
'set(findobj(''Tag'', ''EditTextWINDOW_ADD''),' ...
'''Value'', basestation(currentBS).WINDOW_ADD,' ...
'''String'', num2str(basestation(currentBS).WINDOW_ADD));'], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Max', 0, ...
'Min', -20, ...
'Position', [135 72 75 20], ...
'SliderStep', [0.005 0.05], ...
'String', '-9.6', ...
'Style', 'slider', ...
'Units', 'Pixels', ...
'Tag', 'SliderWINDOW_ADD', ...
'Value', -6);
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [1 1 1], ...
'Callback', [...
'w_add = str2num(get(gcbo, ''String''));'...
'w_add = min(w_add, 0);'...
'w_add = max(w_add, -20);' ...
'basestation(currentBS).WINDOW_ADD = w_add;'...
'set(findobj(''Tag'', ''EditTextWINDOW_ADD''), ''String'', num2str(w_add));' ...
'set(findobj(''Tag'', ''SliderWINDOW_ADD''), ''Value'', basestation(currentBS).WINDOW_ADD);' ...
'clear w_add'], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [135 97 75 20], ...
'String', '-6', ...
'Style', 'edit', ...
'Units', 'Pixels', ...
'Tag', 'EditTextWINDOW_ADD', ...
'Value', -4.6);
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'right', ...
'ListboxTop', 0, ...
'Position', [35 98 85 15], ...
'String', 'WINDOW_ADD:', ...
'Style', 'text', ...
'Units', 'Pixels', ...
'Tag', 'StaticText20');
h1 = uicontrol(...
'parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'HorizontalAlignment', 'left', ...
'ListboxTop', 0, ...
'Position', [215 98 25 15], ...
'String', 'dB', ...
'Style', 'text', ...
'Units', 'Pixels', ...
'Tag', 'StaticText' ...
);
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'Callback', ['numBSs = numBSs+1;' ...
'currentBS = numBSs;' ...
'set(findobj(''Tag'', ''EditTextCurrentBS''), ''String'', num2str(currentBS), ''Value'', currentBS);' ...
'basestation(currentBS) = BSdefault;' ...
'BSshow(basestation(currentBS), gcf);'], ...
'ListboxTop', 0, ...
'Position', [30 20 100 30], ...
'String', 'Create new BS', ...
'Units', 'Pixels', ...
'Tag', 'PushbuttonCreateNew');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'Callback', ['close(gcf);' ...
'BSplot(basestation, gcf, vectMap, lossData);'], ...
'ListboxTop', 0, ...
'Position', [455 20 100 30], ...
'String', 'Close', ...
'Units', 'Pixels', ...
'Tag', 'PushbuttonClose');
h1 = uicontrol('Parent', h0, ...
'BackgroundColor', [0.75 0.75 0.75], ...
'Callback', 'BSwrite(basestation, ''BSparam.txt'');', ...
'ListboxTop', 0, ...
'Position', [245 20 100 30], ...
'String', 'Save', ...
'Units', 'Pixels', ...
'Tag', 'PushbuttonSave');
set(findobj(gcf, 'Tag', 'EditTextCurrentBS'), 'String', num2str(currentBS));
BSshow(basestation(currentBS), gcf);
if (pathlossModel == 7 | pathlossModel == 8)
disableTag = str2mat(locTag, 'PushbuttonCreateNew');
if useImportedAntennaInfo
disableTag = str2mat(disableTag, 'EditTextAntennaHeight', 'EditTextAntennaDir', ...
'PopupAntennaType', 'EditTextAntennaTilt');
end
[numDisable dummy] = size(disableTag);
for k = 1:numDisable
set(findobj('Tag', deblank(disableTag(k, :))), 'enable', 'off')
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -