Have user specify band, update filenames and loaded ini files accordingly

- user can specify band.  loaded ini files and result cal file names are changed accordingly.
- fixed the output of rxatten files to default to gain of 35 and fixed the range to not clip off the ends
This commit is contained in:
dsaha26
2019-01-15 16:18:53 -08:00
parent 741108c171
commit 37595dd471
8 changed files with 39 additions and 27 deletions

View File

@@ -24,7 +24,6 @@ def create_logger():
if __name__ == '__main__':
config_loader = ConfigurationLoader(ROOT_FOLDER)
config_loader.load_config('PRE-TEST', '$DEFAULT')
# config_script_loader = ConfigurationLoader(SCRIPT_FOLDER)
# config_script_loader.load_config('CALIBRATION', '$DEFAULT')
@@ -41,11 +40,21 @@ if __name__ == '__main__':
se = raw_input("Is this the correct analyzer?(y/n):")
if (se == 'y') or (se == 'Y'):
se = 'y'
print("\nWill use analyzer " + context.analyzer_name)
print("\nUsing analyzer " + context.analyzer_name)
break
else:
context.analyzer_name = raw_input("Please enter the correct analyzer name:")
context.user_band = "0"
while (context.user_band != "3") or (context.user_band != "5") or (context.user_band != "28"):
context.user_band = raw_input("Which band are you running?(3/5/28):")
if (context.user_band == "3") or (context.user_band == "5") or (context.user_band == "28"):
print ("\nUsing Band " + context.user_band)
break
else:
print context.user_band + " is not a supported band."
config_loader.load_config('PRE-TEST', '$DEFAULT', context.user_band)
# context = config_script_loader.get_conf()
context.logger = create_logger()
@@ -62,11 +71,6 @@ if __name__ == '__main__':
# This clears /mnt/app if True
context.FLASH_CLEAR_APP = False
# COM PORT
from tools.lte.lte_comport import LTECOMServiceClient
# context.server.com = context.server.get_service_client_from_name('tools.lte.lte_comport.LTECOMServiceClient', url='com')

View File

@@ -21,7 +21,7 @@ class ConfigurationLoader():
def get_conf(self):
return self.conf_obj
def load_config(self, test_type, product):
def load_config(self, test_type, product, band):
section = self._get_test_type(test_type)
product_entries = self._get_product_entries(section, product)
product_folder_and_config = eval(product_entries).split(',')
@@ -36,11 +36,19 @@ class ConfigurationLoader():
self.load_config_file(os.path.join(base_path, product_folder, '.test.ini'), must_exist=False)
# DSTest manually adding the below for calibration
self.load_config_file(os.path.join(base_path, '.calib_const.ini'))
rf_band_ini = '.rf_band' + band + '.ini'
test_ini = '.test' + band + '.ini'
self.load_config_file(os.path.join(base_path, rf_band_ini))
self.load_config_file(os.path.join(base_path, 'system', test_ini))
#self.load_config_file(os.path.join(base_path, '.rf_band3.ini'))
self.load_config_file(os.path.join(base_path, '.rf_band5.ini'))
# self.load_config_file(os.path.join(base_path, '.rf_band5.ini'))
#self.load_config_file(os.path.join(base_path, '.rf_band28.ini'))
#self.load_config_file(os.path.join(base_path, 'system', '.test3.ini'))
self.load_config_file(os.path.join(base_path, 'system', '.test5.ini'))
# self.load_config_file(os.path.join(base_path, 'system', '.test5.ini'))
# self.load_config_file(os.path.join(base_path, 'system', '.test28.ini'))

View File

@@ -64,8 +64,8 @@ class LTECalibTable(object):
with open(file_name, 'wb') as f:
f.write(self.format())
def save(self, bandwidth, tx):
self.save_to_file(self.file_name(bandwidth, tx))
def save(self, band, bandwidth, tx):
self.save_to_file(self.file_name(band, bandwidth, tx))
def load(self, bandwidth, tx):
self.load_from_file(self.file_name(bandwidth, tx))
@@ -82,8 +82,8 @@ class LTECalibTable(object):
row.values = [row.values]
self.add_row(row)
def file_name(self, bandwidth, tx):
return self.file_format() % (bandwidth, tx+1)
def file_name(self, band, bandwidth, tx):
return self.file_format() % (band, bandwidth, tx+1)
def file_format(self):
raise NotImplementedError
@@ -163,7 +163,7 @@ class LTEBBCalibTable(LTECalibTable):
return self
def file_format(self):
return 'bbtxatten_b28_%d_ant%d.cal'
return 'bbtxatten_b%d_%d_ant%d.cal'
def freq_row(self):
return 0
@@ -186,7 +186,7 @@ class LTETXCalibTable(LTECalibTable):
return self
def file_format(self):
return 'fetxatten_b3_%d_ant%d.cal'
return 'fetxatten_b%d_%d_ant%d.cal'
def freq_row(self):
return 0
@@ -208,7 +208,7 @@ class LTEFBCalibTable(LTECalibTable):
return self
def file_format(self):
return 'fefbatten_b3_%d_ant%d.cal'
return 'fefbatten_b%d_%d_ant%d.cal'
def freq_row(self):
return 0
@@ -228,7 +228,7 @@ class LTEFERXCalibTable(LTECalibTable):
return self
def file_format(self):
return 'ferxatten_b3_%d_ant%d.cal'
return 'ferxatten_b%d_%d_ant%d.cal'
def freq_row(self):
return 0
@@ -246,7 +246,7 @@ class LTEBBRXCalibTable(LTECalibTable):
return self
def file_format(self):
return 'bbrxatten_b3_%d_ant%d.cal'
return 'bbrxatten_b%d_%d_ant%d.cal'
def freq_row(self):
return 0

View File

@@ -39,8 +39,8 @@ RX_ATTN_EEPROM = [0, 0]
RX_ATTN_INIT_ATTEN = 2
RX_ATTN_MAX = 31.75
BB_RX0_GAIN = 5
BB_RX1_GAIN = 30
BB_RX0_GAIN = 35
BB_RX1_GAIN = 35
OCXO_MAX_FREQ_ERROR = 50
OCXO_PWM_HIGH = 25000

View File

@@ -15,7 +15,7 @@ BW10_ALL_FREQS = range(RF_DL_BOTTOM_FREQ+5, RF_DL_TOP_FREQ-4, 1)
BW20_ALL_FREQS = range(RF_DL_BOTTOM_FREQ+10, RF_DL_TOP_FREQ-9, 1)
BW5_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+3, RF_UL_TOP_FREQ-2, 1)
BW10_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+5, RF_UL_TOP_FREQ-4, 1)
BW10_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ, RF_UL_TOP_FREQ, 1)
BW20_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+10, RF_UL_TOP_FREQ-9, 1)
LTE_BANDWIDTHS = [10, 5, 20]

View File

@@ -15,7 +15,7 @@ BW10_ALL_FREQS = range(RF_DL_BOTTOM_FREQ+5, RF_DL_TOP_FREQ-4, 1)
BW20_ALL_FREQS = range(RF_DL_BOTTOM_FREQ+10, RF_DL_TOP_FREQ-9, 1)
BW5_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+3, RF_UL_TOP_FREQ-2, 1)
BW10_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+5, RF_UL_TOP_FREQ-4, 1)
BW10_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ, RF_UL_TOP_FREQ, 1)
BW20_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+10, RF_UL_TOP_FREQ-9, 1)
LTE_BANDWIDTHS = [10, 5, 20]

View File

@@ -15,7 +15,7 @@ BW10_ALL_FREQS = range(RF_DL_BOTTOM_FREQ+5, RF_DL_TOP_FREQ-4, 1)
BW20_ALL_FREQS = range(RF_DL_BOTTOM_FREQ+10, RF_DL_TOP_FREQ-9, 1)
BW5_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+3, RF_UL_TOP_FREQ-2, 1)
BW10_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+5, RF_UL_TOP_FREQ-4, 1)
BW10_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ, RF_UL_TOP_FREQ, 1)
BW20_ALL_FREQS_UL = range(RF_UL_BOTTOM_FREQ+10, RF_UL_TOP_FREQ-9, 1)
LTE_BANDWIDTHS = [10, 5, 20]

View File

@@ -104,9 +104,9 @@ def generate_postprocess_tables(context, bw):
except:
pass
with utils.stack_chdir(post_path):
bb_table.save(bw, tx)
tx_table.save(bw, tx)
fb_table.save(bw, tx)
bb_table.save(context.RF_BAND, bw, tx)
tx_table.save(context.RF_BAND, bw, tx)
fb_table.save(context.RF_BAND, bw, tx)
def generate_postprocess_tables_OLD(context, pre_folder, post_folder, bw):