Пример #1
0
    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
Пример #2
0
    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)
Пример #3
0
    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
Пример #4
0
    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
Пример #5
0
 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
Пример #6
0
    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
Пример #7
0
 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
Пример #8
0
    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)
Пример #9
0
    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)
Пример #10
0
    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)
Пример #11
0
    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)
Пример #12
0
 def setGains(self, gains):
     IrisUtil.Gains_HandleSelfParameters(self, gains)
     IrisUtil.Gains_SetBasicGains(self, gains)
Пример #13
0
 def nowGains(self):
     gains = IrisUtil.Gains_GetBasicGains(self)
     IrisUtil.Gains_AddParameter(self, gains)
     return gains
Пример #14
0
 def getExtraInfos(self):
     return IrisUtil.Extra_GetExtraInfo_WithDevFE(
         self)  # with front-end temperature
Пример #15
0
 def __del__(self):
     print('Iris destruction called')
     IrisUtil.Deinit_SafeDelete(self)
Пример #16
0
    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)
Пример #17
0
 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
Пример #18
0
 def nowGains(self):
     gains = IrisUtil.Gains_GetBasicGains(self)  # enable operations on data recorded
     IrisUtil.Gains_AddParameter(self, gains)
     return gains
Пример #19
0
 def setGains(self, gains):
     IrisUtil.Gains_SetBasicGains(self, gains)