第二步是UI设计,包含4个tab:Host LTE、NB-IoT Common、NB-IoT UL和NB-IoT DL。比如nbiot ul tab:
NB UL carrier对应PRB位置,缺省为紧挨着上端PRACH放置。NB DL carrier的PRB位置由界面配置。
原LTE Grid更新如下:UL/DL Grid中对应NB UL/DL carrier的PRB标记为NB UL和NB DL。
#host lte ul/dl resource grid post-processing
outDir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'output')
for fn in self.args['hostLteGrids']:
with open(os.path.join(outDir, fn), 'r+') as f:
if 'LTE_UL_RES_GRID' in fn:
nbMark1 = self.args['nbInbandPrbIndUl'] * 12 + 1
nbMark2 = (self.args['nbInbandPrbIndUl'] + 1) * 12 + 1
elif 'LTE_DL_RES_GRID' in fn:
nbMark1 = self.args['nbInbandPrbIndDl'] * 12 + 1
nbMark2 = (self.args['nbInbandPrbIndDl'] + 1) * 12 + 1
data = f.read()
lines = data.split('\n')
tokens = lines[0].split(',')[1:]
nbLine = ','.join([str(LteResType.LTE_RES_NB_INBAND.value)] * len(tokens))
f.seek(0)
f.write('\n'.join(lines[0:nbMark1]))
f.write('\n')
if 'LTE_UL_RES_GRID' in fn:
for ire in range(self.scNbUl):
f.write(freq2str36(self.args['nbInbandPrbIndUl'], ire) + ',' + nbLine + '\n')
elif 'LTE_DL_RES_GRID' in fn:
for ire in range(self.scNbDl):
f.write(freq2str36(self.args['nbInbandPrbIndDl'], ire) + ',' + nbLine + '\n')
f.write('\n'.join(lines[nbMark2:]))
更新后的效果如下,比如LTE UL Grid: