def run(self): # do read for any length of data finished = IrisUtil.Process_ReadFromRxStream_Async(self) if finished: # do deinitialize work here IrisUtil.Process_RxDeactive(self) self.running = False return finished
def __init__(self, main): self.main = main IrisUtil.Assert_ZeroSerialNotAllowed(self) IrisUtil.Format_UserInputSerialAnts(self) # init sdr object IrisUtil.Init_CollectSDRInstantNeeded(self, clockRate=80e6) # create gains and set them IrisUtil.Init_CreateDefaultGain_WithFrontEnd(self) self.rate = 10e6 # save this for later build tx tone IrisUtil.Init_CreateBasicGainSettings(self, rate=self.rate, bw=None, freq=3.6e9, dcoffset=None) # create streams (but not activate them) IrisUtil.Init_CreateTxRxStreams(self) # sync trigger and clock IrisUtil.Init_SynchronizeTriggerClock(self) self.numSamples = 1024 # could be changed during runtime self.showSamples = 8192 # init max show samples self.selfparameters = {"numSamples": int, "showSamples": int} # this will automatically added to UI # add precode and postcode support IrisUtil.Gains_AddPrecodePostcodeGains(self) IrisUtil.Gains_LoadGainKeyException(self, rxGainKeyException=IrisUtil.Gains_GainKeyException_RxPostcode, txGainKeyException=IrisUtil.Gains_GainKeyException_TxPrecode)
def __init__(self, main): self.main = main IrisUtil.Assert_ZeroSerialNotAllowed(self) IrisUtil.Alert_OnlyTorR_OtherIgnored(self, "Rx") # ignore Iris not Rx IrisUtil.Format_UserInputSerialAnts(self) IrisUtil.Assert_Rx_Required(self) # require at least one rx # init sdr object IrisUtil.Init_CollectSDRInstantNeeded(self, clockRate=80e6) # create gains and set them IrisUtil.Init_CreateDefaultGain_WithDevFE(self) IrisUtil.Init_CreateBasicGainSettings(self, bw=5e6, freq=2.35e9, dcoffset=True, rxrate=6e6) # create streams (but not activate them) IrisUtil.Init_CreateRxStreams_RevB(self) # sync trigger and clock IrisUtil.Init_SynchronizeTriggerClock(self) self.numSamples = 10000000 # could be changed during runtime self.showSamples = 8192 # init max show samples self.showIntervalS = 10 # 10s show one picture with length of self.showSamples self.selfparameters = { "numSamples": lambda x: int(x) if not self.running else None, # only set when it's not running "showSamples": int, "showIntervalS": int } # this will automatically added to UI # record time of now, it will then be used to calculate when to show samples self.lastTime = time.time() self.running = False
def prepareReceive(self): # prepare work, create tx rx buffer IrisUtil.Process_CreateReceiveBuffer(self) IrisUtil.Process_ClearStreamBuffer(self) # activate IrisUtil.Process_ComputeTimeToDoThings_UseHasTime(self, delay = 10000000) IrisUtil.Process_RxActivate_SetupContinuousReadRxStream(self) # setup registers of how many samples are already received (initialized as 0) IrisUtil.Process_BuildAsyncRxRegisters(self) # set register and time self.lastTime = time.time() self.running = True
def loop(self): if self.main.userTrig: self.main.userTrig = False self.main.changedF() # just register set self.doSimpleRx() IrisUtil.Interface_UpdateUserGraph( self, self.correlationSampes) # update to user graph
def __init__(self, main): self.main = main IrisUtil.Alert_SerialNumsIgnored(self) # create empty variables to prevent exception, when user load a file, it will be set again IrisUtil.Init_CreateDefaultGain_FileAnalyze(self) # add input to user GUI, for them to input self.fileName = "" # the hdf5 filename self.offset = 0 # the offset of data to show self.length = 128 # how many points to show in user space. if not enough, a warning will be shown in GUI self.selfparameters = { "fileName": lambda filename: IrisUtil.Analyze_LoadHDF5FileByName(self, filename), # if check failed, raise exception, otherwise load it! "offset": int, "length": int } # this will automatically added to UI
def loop(self): if self.main.userTrig: if not self.running: self.main.userTrig = False self.main.changedF() # just register set self.prepareReceive() if self.running: finished = self.run() if finished or time.time() - self.lastTime >= self.showIntervalS: self.lastTime = time.time() IrisUtil.Interface_UpdateUserGraph(self, uselast=True) # update to user graph, use the last few data but not the head
def doSimpleRxTx(self): # prepare work, create tx rx buffer IrisUtil.Process_BuildTxTones_Sinusoid(self) IrisUtil.Process_CreateReceiveBuffer(self) IrisUtil.Process_ClearStreamBuffer(self) # activate IrisUtil.Process_TxActivate_WriteFlagAndDataToTxStream(self) IrisUtil.Process_RxActivate_WriteFlagToRxStream(self) # trigger in the near future time.sleep(0.1) IrisUtil.Process_GenerateTrigger(self) time.sleep(0.1) # read stream IrisUtil.Process_ReadFromRxStream(self) IrisUtil.Process_HandlePostcode(self) # postcode is work on received data # deactive IrisUtil.Process_TxDeactive(self) IrisUtil.Process_RxDeactive(self)
def doSimpleRx(self): # prepare work, create tx rx buffer IrisUtil.Process_CreateReceiveBuffer(self) IrisUtil.Process_ClearStreamBuffer(self) # activate IrisUtil.Process_ComputeTimeToDoThings_UseHasTime(self, delay = 10000000) IrisUtil.Process_RxActivate_WriteFlagToRxStream_UseHasTime(self, rx_delay = 57) # sleep to wait IrisUtil.Process_WaitForTime_NoTrigger(self) # read stream IrisUtil.Process_ReadFromRxStream(self) IrisUtil.Process_HandlePostcode(self) # postcode is work on received data # deactive IrisUtil.Process_RxDeactive(self)
def __init__(self, main): self.main = main IrisUtil.Assert_ZeroSerialNotAllowed(self) IrisUtil.Format_UserInputSerialAnts(self) # init sdr object IrisUtil.Init_CollectSDRInstantNeeded(self, clockRate=80e6) # create gains and set them IrisUtil.Init_CreateDefaultGain_WithFrontEnd(self) self.rate = 10e6 # save this for later build tx tone IrisUtil.Init_CreateBasicGainSettings(self, rate=self.rate, bw=30e6, freq=3.6e9, dcoffset=True) # create streams (but not activate them) IrisUtil.Init_CreateTxRxStreams(self) # sync trigger and clock IrisUtil.Init_SynchronizeTriggerClock(self) self.txFrameSize = 1024 # immutable self.numSamples = 1024 # could be changed during runtime self.showSamples = 8192 # init max show samples self.selfparameters = { "numSamples": int, "showSamples": int } # this will automatically added to UI # add precode and postcode support # IrisUtil.Gains_AddPrecodePostcodeGains(self) # IrisUtil.Gains_LoadGainKeyException(self, rxGainKeyException=IrisUtil.Gains_GainKeyException_RxPostcode, txGainKeyException=IrisUtil.Gains_GainKeyException_TxPrecode) # repeat sequence generate self.numSamples = 1024 # immutable during runtime, this is the sinusoid of each antenna, but every antenna is sending this one by one IrisUtil.Init_CreateRepeatorSinusoidSequence(self) # set repeat IrisUtil.Process_TxActivate_WriteFlagAndDataToTxStream_RepeatFlag(self)
def doSimpleRx(self): # prepare work, create tx rx buffer IrisUtil.Process_CreateReceiveBuffer(self) IrisUtil.Process_ClearStreamBuffer(self) # activate IrisUtil.Process_ComputeTimeToDoThings_UseHasTime(self, delay=10000000, alignment=2730667) IrisUtil.Process_RxActivate_WriteFlagToRxStream_UseHasTime(self, rx_delay=0) # sleep to wait IrisUtil.Process_WaitForTime_NoTrigger(self) # read stream IrisUtil.Process_ReadFromRxStream(self) IrisUtil.Process_HandlePostcode( self) # postcode is work on received data # deactive IrisUtil.Process_RxDeactive(self) # do correlation IrisUtil.Process_DoCorrelation2FindFirstPFDMSymbol(self)
def setGains(self, gains): IrisUtil.Gains_HandleSelfParameters(self, gains) IrisUtil.Gains_SetBasicGains(self, gains)
def nowGains(self): gains = IrisUtil.Gains_GetBasicGains(self) IrisUtil.Gains_AddParameter(self, gains) return gains
def getExtraInfos(self): return IrisUtil.Extra_GetExtraInfo_WithDevFE( self) # with front-end temperature
def __del__(self): print('Iris destruction called') IrisUtil.Deinit_SafeDelete(self)
def __init__(self, main): self.main = main IrisUtil.Assert_ZeroSerialNotAllowed(self) IrisUtil.Format_UserInputSerialAnts(self) IrisUtil.Assert_Tx_Required(self) # require at least one tx # import waveform file IrisUtil.Format_LoadWaveFormFile( self, 'LTE_OneRepeator_SyncWatcher_DevFE_RevB_180902_Waveform.csv') # init sdr object IrisUtil.Init_CollectSDRInstantNeeded(self, clockRate=80e6) # create gains and set them IrisUtil.Init_CreateDefaultGain_WithDevFE(self) IrisUtil.Init_CreateBasicGainSettings(self, bw=5e6, freq=2.35e9, dcoffset=True, txrate=1.5e6, rxrate=9e6) # create streams (but not activate them) IrisUtil.Init_CreateRxStreams_RevB(self) # sync trigger and clock IrisUtil.Init_SynchronizeTriggerClock(self) self.numSamples = 1024 # could be changed during runtime self.showSamples = 8192 # init max show samples serial, ant = IrisUtil.Format_SplitSerialAnt(self.tx_serials_ant[0]) if ant == 2: self.txSelect = "%s-0" % serial # select one to send, other set 0 else: self.txSelect = "%s-%d" % (serial, ant) self.alignOffset = 0 self.selfparameters = { "numSamples": int, "showSamples": int, "txSelect": lambda x: IrisUtil.Format_CheckSerialAntInTx( self, x), # use closure to send "self" object in "alignOffset": int } # this will automatically added to UI # add postcode support IrisUtil.Gains_AddPostcodeGains(self) IrisUtil.Gains_LoadGainKeyException( self, rxGainKeyException=IrisUtil.Gains_GainKeyException_RxPostcode) # repeat sequence generate IrisUtil.Init_CreateRepeatorOnehotWaveformSequence(self) # set repeat IrisUtil.Process_TxActivate_WriteFlagAndDataToTxStream_RepeatFlag(self)
def loop(self): if self.main.userTrig: self.main.userTrig = False self.main.changedF() # just register set self.doSimpleShow() IrisUtil.Interface_UpdateUserGraph(self) # update to user graph
def nowGains(self): gains = IrisUtil.Gains_GetBasicGains(self) # enable operations on data recorded IrisUtil.Gains_AddParameter(self, gains) return gains
def setGains(self, gains): IrisUtil.Gains_SetBasicGains(self, gains)