示例#1
0
    def recovery_handler(self, channel, data):
        rec = acomms_osp_recovery_t.decode(data)
        if self.tol_no > rec.new_tol_no: return
        if self.tol_no != rec.org_tol_no: return

        self.tol_no = rec.new_tol_no
        self.org_no = rec.org_tol_no

        self.recovery += 1
示例#2
0
    def __init__ (self, log, osp_chan, rec_chan):
        print '{Acoustic_node} parsing OSP events...'
        #self.osps = [acomms_osp_t.decode (e.data) for e in log if osp_chan in e.channel]
        osps = [acomms_osp_t.decode (e.data) for e in log if osp_chan in e.channel]
        print '{Acoustic_node} found %d OSPs' % (len (osps))

        print '{Acoustic_node} parsing OSP recovery events...'
        #self.recs = [acomms_osp_recovery_t.decode (e.data) for e in log if rec_chan in e.channel]
        recs = [acomms_osp_recovery_t.decode (e.data) for e in log if rec_chan in e.channel]
        print '{Acoustic_node} found %d recoveries' % (len (recs))

        t_osp = [o.utime for o in osps]
        t_rec = [o.utime for o in recs]

        self.t_osp = np.asarray (t_osp)
        self.t_rec = np.asarray (t_rec)
        utime = t_osp+t_rec
        utime.sort ()
        self.utime = np.asarray (utime)
示例#3
0
    def __init__(self, log, osp_chan, rec_chan):
        print '{Acoustic_node} parsing OSP events...'
        #self.osps = [acomms_osp_t.decode (e.data) for e in log if osp_chan in e.channel]
        osps = [
            acomms_osp_t.decode(e.data) for e in log if osp_chan in e.channel
        ]
        print '{Acoustic_node} found %d OSPs' % (len(osps))

        print '{Acoustic_node} parsing OSP recovery events...'
        #self.recs = [acomms_osp_recovery_t.decode (e.data) for e in log if rec_chan in e.channel]
        recs = [
            acomms_osp_recovery_t.decode(e.data) for e in log
            if rec_chan in e.channel
        ]
        print '{Acoustic_node} found %d recoveries' % (len(recs))

        t_osp = [o.utime for o in osps]
        t_rec = [o.utime for o in recs]

        self.t_osp = np.asarray(t_osp)
        self.t_rec = np.asarray(t_rec)
        utime = t_osp + t_rec
        utime.sort()
        self.utime = np.asarray(utime)