scriptGlobals.getNavs = [] rxInit() # wait for nav waitTTFFLoops = 0 while (waitTTFFLoops < 13): if (scriptUtilities.waitForNav() == True): break else: mainFrame.Delay(10) waitTTFFLoops = waitTTFFLoops + 1 mainFrame.Delay(10) # Begin test scriptUtilities.logApp("*", scriptGlobals.TestBeginLabel) print "Number of test levels %d" % (len( scriptGlobals.TestSignalLevelsList)) for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] atten = Utilities.HelperFunctions.GetCalibrationAtten( scriptGlobals.CableLoss, level, scriptGlobals.SignalType) if (scriptGlobals.TestAborted == True): break scriptUtilities.logApp("*", scriptGlobals.InitializedLabel) # Create directory for log files Now = time.localtime(time.time()) timeNowStr = time.strftime("%m%d%Y_%H%M%S", Now) comIdx = 0 for usePort in scriptGlobals.DutMainPortsList: if (usePort < 0):
if(navStatus == True): print "RX(s) navigate -- start test now" else: print "Rx(s) not navigate" ttbWaitTime = 900 msgString = "Wait %d seconds for TTB to navigate?" % (ttbWaitTime) if (scriptGlobals.UseTTBForAiding == 1): # last element is timeout in ms result = MessageBoxEx.Show(msgString, "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information,20000); if (result == DialogResult.Yes): # ttbWaitTime = 2 displayStr = "%s: Wait %d sec for TTB to navigate and collect aiding information%s Press OK to cancel wait time" % (time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()),ttbWaitTime, "\r\n\r\n ") scriptUtilities.logApp("*",displayStr) result = MessageBoxEx.Show(displayStr, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information,ttbWaitTime*1000); # scriptGlobals.MainFrame.Delay(ttbWaitTime) else: print "Skip TTB waiting"; for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] if (scriptGlobals.TestAborted == True): print "Test aborted" break scriptUtilities.setAtten(defaultAtten) atten = Utilities.HelperFunctions.GetCalibrationAtten(scriptGlobals.CableLoss,level,scriptGlobals.SignalType) # setup each active com ports Now = time.localtime(time.time()) timeNowStr = time.strftime("%m%d%Y_%H%M%S", Now)
if (scriptGlobals.TestAborted == True): print "Test aborted" break APMNumFixes = APMNumFixesArray[APMIndex] APMTBF = APMTBFArray[APMIndex] APMDutyCycle = APMDutyCycleArray[APMIndex] APMMaxHrzError = APMMaxHrzErrorArray[APMIndex] APMMaxVrtError = APMMaxVrtErrorArray[APMIndex] APMPriority = APMPriorityArray[APMIndex] APMMaxOffTime = APMMaxOffTimeArray[APMIndex] APMMaxSearchTime = APMMaxSearchTimeArray[APMIndex] APMTimeAccPriority = APMTimeAccPriorityArray[APMIndex] if (APMNumFixes != 0): APMNumFixes = 0 scriptUtilities.logApp( "*", "Invalid number of fixes -- Set to 0") # Loop for each test levels for levelIndex in range( 0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] if (scriptGlobals.TestAborted == True): print "Test aborted" break atten = Utilities.HelperFunctions.GetCalibrationAtten( scriptGlobals.CableLoss, level, scriptGlobals.SignalType) diffAtten = atten - defaultAtten if ((levelIndex == 0) and (diffAtten > 5) and (atten > 5)): dropAtten = divmod(atten, 5) drop5dBLoop = dropAtten[0]
def simOffSV(svID): scriptGlobals.MainFrame.SimCtrl.SetPowerOnOff("-", svID,False,False,False) logStr = "###### Turn off SV %d ######" % (svID) scriptUtilities.logApp("*", logStr)
if (scriptGlobals.SignalSource == General.clsGlobal.SIM): scriptGlobals.MainFrame.SimCtrl.EndScenario(False) scriptGlobals.MainFrame.SimCtrl.SelectScenario( scriptGlobals.SimFile) scriptGlobals.MainFrame.SimCtrl.SetPowerLevel( "-", scriptGlobals.SimInitialAtten, 1, True, True, True) scriptGlobals.MainFrame.SimCtrl.RunScenario() scriptUtilities.sendFactoryReset() # ttbWaitTime = 2 displayStr = "%s: Wait %d sec for RX to navigate and collectGPS information %s Press OK to cancel wait time" % ( time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()), nbWaitTime, "\r\n\r\n ") scriptUtilities.logApp("*", displayStr) result = MessageBoxEx.Show(displayStr, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information, nbWaitTime * 1000) scriptUtilities.updateSiRFNavStartParams() if (scriptGlobals.TestAborted == True): print "Test aborted" break print "Testing power level: %d" % (level) # setup each active com ports # Create directory for log files Now = time.localtime(time.time()) timeNowStr = time.strftime("%m%d%Y_%H%M%S", Now)
def simRewind(): scriptUtilities.logApp("*", "###### SIM rewind ######") scriptGlobals.MainFrame.SimCtrl.RewindScenario()
def simOff(): scriptGlobals.MainFrame.SimCtrl.SetPowerOnOff("-", 1,False,True,True) scriptUtilities.logApp("*", "###### Turn off simulator power ######")
def simSetAllChanAtten(atten): scriptGlobals.MainFrame.SimCtrl.SetPowerLevel("-", atten, 1, True, True, True) logStr = "###### Set SIM atten: %.1f ######" % (atten) scriptUtilities.logApp("*", logStr)
def simOff(): scriptGlobals.MainFrame.SimCtrl.SetPowerOnOff("-", 1, False, True, True) scriptUtilities.logApp("*", "###### Turn off simulator power ######")
def simStop(): scriptGlobals.MainFrame.SimCtrl.EndScenario(False) scriptGlobals.MainFrame.Delay(1) scriptUtilities.logApp("*", "###### SIM stops ######")
def simRun(): scriptGlobals.MainFrame.SimCtrl.RewindScenario() scriptGlobals.MainFrame.SimCtrl.RunScenario() scriptUtilities.logApp("*", "###### SIM starts ######")
def simLoad(simFile): scriptGlobals.MainFrame.SimCtrl.SelectScenario(simFile) scriptGlobals.MainFrame.Delay(1) logStr = "###### Loading SIM file: %s ######" % (simFile) scriptUtilities.logApp("*", logStr)
if(navStatus == True): print "RX(s) navigate -- start test now" else: print "Rx(s) not navigate" ttbWaitTime = 900 msgString = "Wait %d seconds for TTB to navigate?" % (ttbWaitTime) if (scriptGlobals.UseTTBForAiding == 1): # last element is timeout in ms result = MessageBoxEx.Show(msgString, "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information,20000); if (result == DialogResult.Yes): # ttbWaitTime = 2 displayStr = "%s: Wait %d sec for TTB to navigate and collect aiding information%s Press OK to cancel wait time" % (time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()),ttbWaitTime, "\r\n\r\n ") scriptUtilities.logApp("*",displayStr) result = MessageBoxEx.Show(displayStr, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information,ttbWaitTime*1000); else: print "Skip TTB waiting"; for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] if (scriptGlobals.TestAborted == True): print "Test aborted" break scriptUtilities.setAtten(defaultAtten) nbWaitTime = 900 msgString = "Wait %d seconds to collect GPS information?" % (nbWaitTime) if (scriptGlobals.UseTTBForAiding == 0): # last element is timeout in ms result = MessageBoxEx.Show(msgString, "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information,20000);
scriptUtilities.updateDUTInfo(comIdx) myPort.comm.m_TestSetup.Atten = atten myPort.comm.Log.OpenFile(portLogFile) myPort.comm.RxCtrl.ResetCtrl.OpenTTFFLog(ttffLogFile) myPort.comm.RxCtrl.ResetCtrl.ResetCount = 0 myPort.comm.RxCtrl.ResetCtrl.LoopitInprogress = True myPort.comm.RxCtrl.ResetCtrl.ResetInterval = General.clsGlobal.LoopitTimeout # if not CGEE test disable CGEE since CGEE is enable by default if (mpmTestCondition.Contains("CGEE") == False): # myPort.comm.WriteData("A0 A2 00 06 E8 FE 00 00 00 00 01 E6 B0 B3") myPort.comm.WriteData("A0 A2 00 04 E8 20 00 01 01 09 B0 B3"); comIdx = comIdx + 1 scriptUtilities.setResetInitParams() scriptUtilities.logApp("*", scriptGlobals.InitializedLabel) # wait for nav waitTTFFLoops = 0 while(waitTTFFLoops < 13): if(scriptUtilities.waitForNav() == True): break else: mainFrame.Delay(10) waitTTFFLoops = waitTTFFLoops + 1 mainFrame.Delay(10) if (mpmSoakTimeSecs != 0): displayStr = "%s: Wait %d sec for DUT to collect GPS information%s Press OK to cancel wait time\n" % (time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()),mpmSoakTimeSecs, "\r\n\r\n ") scriptUtilities.logApp("*",displayStr) result = MessageBoxEx.Show(displayStr, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information,int(mpmSoakTimeSecs)*1000);
def simOffChan(chan): scriptGlobals.MainFrame.SimCtrl.SetPowerOnOff("-", chan, False, True, False) logStr = "###### Turn off channel %d ######" % (chan) scriptUtilities.logApp("*", logStr)
print "Rx(s) not navigate" ttbWaitTime = 900 msgString = "Wait %d seconds for TTB to navigate?" % (ttbWaitTime) if (scriptGlobals.UseTTBForAiding == 1): # last element is timeout in ms result = MessageBoxEx.Show(msgString, "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information, 20000) if (result == DialogResult.Yes): # ttbWaitTime = 2 displayStr = "%s: Wait %d sec for TTB to navigate and collect aiding information%s Press OK to cancel wait time" % ( time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()), ttbWaitTime, "\r\n\r\n ") scriptUtilities.logApp("*", displayStr) result = MessageBoxEx.Show(displayStr, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information, ttbWaitTime * 1000) else: print "Skip TTB waiting" for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] if (scriptGlobals.TestAborted == True): print "Test aborted" break scriptUtilities.setAtten(defaultAtten) nbWaitTime = 900 msgString = "Wait %d seconds to collect GPS information?" % (
def simOffSV(svID): scriptGlobals.MainFrame.SimCtrl.SetPowerOnOff("-", svID, False, False, False) logStr = "###### Turn off SV %d ######" % (svID) scriptUtilities.logApp("*", logStr)
def simSetAllChanAtten(atten): scriptGlobals.MainFrame.SimCtrl.SetPowerLevel("-",atten,1,True,True,True) logStr = "###### Set SIM atten: %.1f ######" % (atten) scriptUtilities.logApp("*", logStr)
def simSetChanAtten(atten, chan): scriptGlobals.MainFrame.SimCtrl.SetPowerLevel("-", atten, chan, True, False, True) logStr = "###### Set SIM atten: %.1f on channel: %d ######" % (atten, chan) scriptUtilities.logApp("*", logStr)
def simOffChan(chan): scriptGlobals.MainFrame.SimCtrl.SetPowerOnOff("-", chan,False,True,False) logStr = "###### Turn off channel %d ######" % (chan) scriptUtilities.logApp("*", logStr)
scriptGlobals.getNavs = [] rxInit() # wait for nav waitTTFFLoops = 0 while(waitTTFFLoops < 13): if(scriptUtilities.waitForNav() == True): break else: mainFrame.Delay(10) waitTTFFLoops = waitTTFFLoops + 1 mainFrame.Delay(10) # Begin test scriptUtilities.logApp("*", scriptGlobals.TestBeginLabel) print "Number of test levels %d" % (len(scriptGlobals.TestSignalLevelsList)) for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] atten = Utilities.HelperFunctions.GetCalibrationAtten(scriptGlobals.CableLoss,level,scriptGlobals.SignalType) if (scriptGlobals.TestAborted == True): break scriptUtilities.logApp("*", scriptGlobals.InitializedLabel) # Create directory for log files Now = time.localtime(time.time()) timeNowStr = time.strftime("%m%d%Y_%H%M%S", Now) comIdx = 0 for usePort in scriptGlobals.DutMainPortsList: if (usePort < 0): comIdx = comIdx + 1 continue
def simSetChanAtten(atten, chan): scriptGlobals.MainFrame.SimCtrl.SetPowerLevel("-",atten,chan,True,False,True) logStr = "###### Set SIM atten: %.1f on channel: %d ######" % (atten, chan) scriptUtilities.logApp("*", logStr)
scriptGlobals.getNavs = [] rxInit() # wait for nav waitTTFFLoops = 0 while (waitTTFFLoops < 13): if (scriptUtilities.waitForNav() == True): break else: mainFrame.Delay(10) waitTTFFLoops = waitTTFFLoops + 1 mainFrame.Delay(10) # Begin test scriptUtilities.logApp("*", scriptGlobals.TestBeginLabel) print "Number of test levels %d" % (len( scriptGlobals.TestSignalLevelsList)) for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] if (scriptGlobals.TestAborted == True): break scriptUtilities.logApp("*", scriptGlobals.InitializedLabel) atten = Utilities.HelperFunctions.GetCalibrationAtten( scriptGlobals.CableLoss, level, scriptGlobals.SignalType) # Create directory for log files Now = time.localtime(time.time()) timeNowStr = time.strftime("%m%d%Y_%H%M%S", Now) comIdx = 0 for usePort in scriptGlobals.DutMainPortsList: if (usePort < 0):
mainFrame.UpdateGUIFromScript() testName = ["SENSITIVITY_TEST1", "NOMINAL_ACCURACY_TEST2", "DYNAMIC_RANGE_TEST3", "MULTIPATH_TEST4", "MOVING_SCENARIO_TEST5"] aidingName = ["MSB", "MSA1", "MSA2", "MSAB_B", "MSAB_A1", "MSAB_A2"] #Initialize print "Initializing ..." #mainFrame.SimCtrl.EndScenario(False) #mainFrame.Delay(5) scriptUtilities.init() SPAzAtten = 20 print "Bring SPAz down %d dB" % (SPAzAtten) scriptGlobals.MainFrame.SpazCtrl.WriteSPAzAtten(SPAzAtten) simFilePath = mainSimFilesDirs + test1To5SimFilesDirs[1] logString = "Loading: " + simFilePath scriptUtilities.logApp("*", logString) mainFrame.SimCtrl.EndScenario(False) mainFrame.SimCtrl.SelectScenario(simFilePath) mainFrame.Delay(5) mainFrame.SimCtrl.RunScenario() # wait for nav waitTTFFLoops = 0 while(waitTTFFLoops < 13): if(scriptUtilities.waitForNav() == True): break else: mainFrame.Delay(10) waitTTFFLoops = waitTTFFLoops + 1 mainFrame.SimCtrl.EndScenario(False) comIdx = 0
scriptGlobals.getNavs = [] rxInit() # wait for nav waitTTFFLoops = 0 while waitTTFFLoops < 13: if scriptUtilities.waitForNav() == True: break else: mainFrame.Delay(10) waitTTFFLoops = waitTTFFLoops + 1 mainFrame.Delay(10) # Begin test scriptUtilities.logApp("*", scriptGlobals.TestBeginLabel) print "Number of test levels %d" % (len(scriptGlobals.TestSignalLevelsList)) for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] if scriptGlobals.TestAborted == True: break scriptUtilities.logApp("*", scriptGlobals.InitializedLabel) atten = Utilities.HelperFunctions.GetCalibrationAtten( scriptGlobals.CableLoss, level, scriptGlobals.SignalType ) # Create directory for log files Now = time.localtime(time.time()) timeNowStr = time.strftime("%m%d%Y_%H%M%S", Now) comIdx = 0 for usePort in scriptGlobals.DutMainPortsList: if usePort < 0:
"MULTIPATH_TEST4", "MOVING_SCENARIO_TEST5" ] aidingName = ["MSB", "MSA1", "MSA2", "MSAB_B", "MSAB_A1", "MSAB_A2"] #Initialize print "Initializing ..." #mainFrame.SimCtrl.EndScenario(False) #mainFrame.Delay(5) scriptUtilities.init() SPAzAtten = 20 print "Bring SPAz down %d dB" % (SPAzAtten) scriptGlobals.MainFrame.SpazCtrl.WriteSPAzAtten(SPAzAtten) simFilePath = mainSimFilesDirs + test1To5SimFilesDirs[1] logString = "Loading: " + simFilePath scriptUtilities.logApp("*", logString) mainFrame.SimCtrl.EndScenario(False) mainFrame.SimCtrl.SelectScenario(simFilePath) mainFrame.Delay(5) mainFrame.SimCtrl.RunScenario() # wait for nav waitTTFFLoops = 0 while (waitTTFFLoops < 13): if (scriptUtilities.waitForNav() == True): break else: mainFrame.Delay(10) waitTTFFLoops = waitTTFFLoops + 1 mainFrame.SimCtrl.EndScenario(False) comIdx = 0
navStatus = False count = 0 while((navStatus == False) and (count < 12)): navStatus = mainFrame.GetNavStatus("*") count = count + 1 print "Wait for nav loop %d" %(count) if ((navStatus == True) or (count >= 12)): break # if ((General.clsGlobal.Abort == True) or (General.clsGlobal.AbortSingle == True)): # scriptGlobals.TestAborted = True # break mainFrame.Delay(5) # Set TP mode logStr = "TP(%d,%d) begins..." %(TPOnTime,TPTBF) scriptUtilities.logApp("*", logStr) comIdx = 0 for usePort in scriptGlobals.DutMainPortsList: if (usePort < 0): comIdx = comIdx + 1 continue myPort = scriptGlobals.DutPortManagersList[comIdx] myPort.comm.LowPowerParams.Mode = 3; myPort.comm.LowPowerParams.TPDutyCycle = TPDutyCycle myPort.comm.LowPowerParams.TPOnTime = TPOnTime myPort.comm.LowPowerParams.TPUpdateRate = TPTBF myPort.comm.LowPowerParams.TPMaxOffTime = TPMaxOffTime myPort.comm.LowPowerParams.TPMaxSearchTime = TPMaxSearchTime myPort.comm.RxCtrl.SetPowerMode(False); comIdx = comIdx + 1
if (scriptGlobals.TestAborted == True): print "Test aborted" break APMNumFixes = APMNumFixesArray[APMIndex] APMTBF = APMTBFArray[APMIndex] APMDutyCycle = APMDutyCycleArray[APMIndex] APMMaxHrzError = APMMaxHrzErrorArray[APMIndex] APMMaxVrtError = APMMaxVrtErrorArray[APMIndex] APMPriority = APMPriorityArray[APMIndex] APMMaxOffTime = APMMaxOffTimeArray[APMIndex] APMMaxSearchTime = APMMaxSearchTimeArray[APMIndex] APMTimeAccPriority = APMTimeAccPriorityArray[APMIndex] if (APMNumFixes != 0): APMNumFixes = 0 scriptUtilities.logApp("*", "Invalid number of fixes -- Set to 0") # Loop for each test levels for levelIndex in range(0, len(scriptGlobals.TestSignalLevelsList)): level = scriptGlobals.TestSignalLevelsList[levelIndex] if (scriptGlobals.TestAborted == True): print "Test aborted" break atten = Utilities.HelperFunctions.GetCalibrationAtten(scriptGlobals.CableLoss,level,scriptGlobals.SignalType) diffAtten = atten - defaultAtten if ((levelIndex == 0) and (diffAtten > 5) and (atten > 5)): dropAtten = divmod(atten,5) drop5dBLoop = dropAtten[0] restAtten = dropAtten[1] for dropIndex in range(0, int(drop5dBLoop)+1):