def test_method(self): sn = self.config.ser_no # get the MOD_TAP_CAL tag information tag_name = 'EDFA_CAL' tagXf = self.UUT.upload(tag_name) self.info("BEFORE: %s" % tagXf.__str__()) fileName = "%s_org.xml" % tag_name self.save_object(tagXf, fileName) errorCount = 0 # retrieve IN_MPD children cal_tags = tagXf.get_element('IN_MPD').get_children() cal_tag_pwr_a = cal_tags[0] cal_tag_pwr_b= cal_tags[2] self.info("cal_tags: %s" % cal_tags) # get the delta from the database. adc_a = int(cal_tag_pwr_a.Adc) adc_b = int(cal_tag_pwr_b.Adc) pwr_a = int(float(cal_tag_pwr_a.Pwr)) pwr_b = int(float(cal_tag_pwr_b.Pwr)) slope = (adc_a - adc_b)/(pwr_a - pwr_b) self.info("adc_a: %s, adc_b: %s, pwr_a: %s,pwr_b: %s, slope: %s" % (adc_a,adc_b,pwr_a,pwr_b,slope)) # based on the serial number get the accuracy result on dbB = 3 pwr = -10 res = database.get_accuracy('line_input', sn, pwr) adj_val = int(res.Delta * slope) self.info("Slope: %s, Adj_val: %s" % (slope, adj_val)) # now that we have the new adjusted value, go through the tag and # adjust all Adc attributes. for cal_tag in cal_tags: cal_tag.Adc = int(cal_tag.Adc) + adj_val self.info("AFTER: %s" % tagXf.__str__()) res = self.UUT.download(tagXf) print res fileName = "%s.xml" % tag_name self.save_object(tagXf, fileName) self.info("Resetting UUT...") self.UUT.reset_card_from_mfgtest() time.sleep(30) if (errorCount): return self.failed("Line_Input_Recal failed") else: return self.passed("Line_Input_Recal passed")
def test_method(self): sn = self.config.ser_no # get the MOD_TAP_CAL tag information tagXf = self.UUT.upload('MOD_TAP_CAL') self.info("%s" % tagXf.__str__()) fileName = "MOD_TAP_CAL_org.xml" self.save_object(tagXf, fileName) errorCount = 0 cal_tags = tagXf.get_children() self.info("cal_tags: %s" % cal_tags) cal_tag_pwr1 = cal_tags[0] cal_tag_pwr3 = cal_tags[2] # get the delta from the database. slope = (int(cal_tag_pwr3.Adc01) - int(cal_tag_pwr1.Adc01))/2 self.info("pwr1: %s, pwr3: %s, slope: %s" % (cal_tag_pwr1, cal_tag_pwr3,slope)) # based on the serial number get the accuracy result on dbB = 3 pwr = 3 res = database.get_accuracy('line_output', sn, pwr) adj_val = int(res.Delta * slope) self.info("Slope: %s, Adj_val: %s" % (slope, adj_val)) # now that we have the new adjusted value, go through the tag and # adjust all Adc attributes. for cal_tag in cal_tags: cal_tag.Adc01 = int(cal_tag.Adc01) + adj_val cal_tag.Adc45 = int(cal_tag.Adc45) + adj_val cal_tag.Adc89 = int(cal_tag.Adc89) + adj_val self.info("%s" % tagXf.__str__()) res = self.UUT.download(tagXf) print res fileName = "MOD_TAP_CAL.xml" self.save_object(tagXf, fileName) self.info("Resetting UUT...") self.UUT.reset_card_from_mfgtest() time.sleep(30) if (errorCount): return self.failed("Line_Output_Recal failed") else: return self.passed("Line_Output_Recal passed")