コード例 #1
0
ファイル: burst_scheduler2.py プロジェクト: icopavan/gr-burst
    def sched_pdu(self, pdu):
        sched_time = (self.nproduced_val + 10000); # pick a time in the future
        sched_time = sched_time - sched_time%5000; # round to nearest slot
        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("event_time"), pmt.from_uint64(sched_time));
        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("interp"), pmt.from_long(8));

        hop_offset = 10000;
        offset = (random.random()*self.fs-self.fs/2);
        offset = round(offset/hop_offset)*hop_offset; # quantize to nearest 1k offset
        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("freq_offset"), pmt.from_double(offset));
        self.message_port_pub(pmt.intern("sched_pdu"), pdu);
コード例 #2
0
    def sched_pdu(self, pdu):
        sched_time = (self.nproduced_val + 10000)
        # pick a time in the future
        sched_time = sched_time - sched_time % 5000
        # round to nearest slot
        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("event_time"),
                                 pmt.from_uint64(sched_time))
        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("interp"), pmt.from_long(8))

        hop_offset = 10000
        offset = (random.random() * self.fs - self.fs / 2)
        offset = round(offset / hop_offset) * hop_offset
        # quantize to nearest 1k offset
        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("freq_offset"),
                                 pmt.from_double(offset))
        self.message_port_pub(pmt.intern("sched_pdu"), pdu)
コード例 #3
0
    def sched_pdu(self, pdu):
        sched_time = self.nproduced_val + 10000
        # pick a time in the future
        if sched_time < self.sched_barrier:
            sched_time = self.sched_barrier
            print "delaying packet to sched barrier"

        sched_time = sched_time - sched_time % 1000
        # round to nearest slot
        event_length = pmt.length(pmt.cdr(pdu))
        # event_length = pmt.to_long(pmt.dict_ref(pmt.car(pdu), pmt.intern("event_length"), pmt.PMT_NIL));
        self.sched_barrier = sched_time + event_length + 1000
        print "SCHED_EVENT: time=%d, len=%d  " % (sched_time, event_length)

        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("event_time"), pmt.from_uint64(sched_time))
        self.message_port_pub(pmt.intern("sched_pdu"), pdu)
コード例 #4
0
    def sched_pdu(self, pdu):
        sched_time = (self.nproduced_val + 10000)
        # pick a time in the future
        if (sched_time < self.sched_barrier):
            sched_time = self.sched_barrier
            print "delaying packet to sched barrier"

        sched_time = sched_time - sched_time % 1000
        # round to nearest slot
        event_length = pmt.length(pmt.cdr(pdu))
        #event_length = pmt.to_long(pmt.dict_ref(pmt.car(pdu), pmt.intern("event_length"), pmt.PMT_NIL));
        self.sched_barrier = sched_time + event_length + 1000
        print "SCHED_EVENT: time=%d, len=%d  " % (sched_time, event_length)

        pdu = pdulib.pdu_arg_add(pdu, pmt.intern("event_time"),
                                 pmt.from_uint64(sched_time))
        self.message_port_pub(pmt.intern("sched_pdu"), pdu)