Пример #1
0
    def __init__(self, payload):
        nmeaSentence.__init__(self, payload)
        p = payload.split(',')
        self.id = p[0]

        if 0 < len(p[1]) and 0 < len(p[2]):
            self.when = datetime.strptime(p[1] + 'T' + p[2],
                                          "%Y-%m-%dT%H:%M:%S")
            pass
        else:
            self.when = None

        if 0 < p[4].find('.'):
            self.lat = float(p[4][:p[4].find('.') - 2])
            self.lat += float(p[4][p[4].find('.') - 2:]) / 60.0
            pass
        else:
            self.lat = 100

        if p[3] == 'S': self.lat = -self.lat

        if 0 < p[6].find('.'):
            self.lon = float(p[6][:p[6].find('.') - 2])
            self.lon += float(p[6][p[6].find('.') - 2:]) / 60.0
            pass
        else:
            self.lon = 200

        if p[5] == 'W': self.lon = -self.lon

        if 0 < len(p[7]): self.alt = int(p[7])
        else: self.alt = -1

        self._mutable = False
Пример #2
0
 def __init__ (self, payload):
     nmeaSentence.__init__(self, payload)
     p = payload.split (",")
     self.id = p[0]
     self.message = self.__messages[int(p[1])]
     self._mutable = False
     return
Пример #3
0
 def __init__(self, payload):
     nmeaSentence.__init__(self, payload)
     p = payload.split(',')
     self.id = p[0]
     self.name = p[1]
     self._mutable = False
     return
Пример #4
0
 def __init__(self, payload):
     nmeaSentence.__init__(self, payload)
     p = payload.split(",")
     self.id = p[0]
     self.message = self.__messages[int(p[1])]
     self._mutable = False
     return
Пример #5
0
    def __init__ (self, payload):
        nmeaSentence.__init__ (self, payload)
        p = payload.split (',')
        self.id = p[0]

        if 0 < len (p[1]) and 0 < len (p[2]):
            self.when = datetime.strptime (p[1] + 'T' + p[2],
                                           "%Y-%m-%dT%H:%M:%S")
            pass
        else: self.when = None
        
        if 0 < p[4].find ('.'):
            self.lat = float (p[4][:p[4].find ('.')-2])
            self.lat += float (p[4][p[4].find ('.')-2:]) / 60.0
            pass
        else: self.lat = 100

        if p[3] == 'S': self.lat = -self.lat
        
        if 0 < p[6].find ('.'):
            self.lon = float (p[6][:p[6].find ('.')-2])
            self.lon += float (p[6][p[6].find ('.')-2:]) / 60.0
            pass
        else: self.lon = 200

        if p[5] == 'W': self.lon = -self.lon
        
        if 0 < len (p[7]): self.alt = int(p[7])
        else: self.alt = -1

        self._mutable = False
Пример #6
0
 def __init__ (self, payload):
     nmeaSentence.__init__ (self, payload)
     p = payload.split (',')
     self.id = p[0]
     self.name = p[1]
     self._mutable = False
     return
Пример #7
0
    def __init__(self,
                 payload=None,
                 gll=0,
                 rmc=0,
                 vtg=0,
                 gga=0,
                 gsa=0,
                 gsv=0,
                 grs=0,
                 gst=0,
                 malm=0,
                 meph=0,
                 mdgp=0,
                 mdbg=0,
                 zda=0,
                 mchn=0):
        if payload is not None:
            nmeaSentence.__init__(self, payload)
            p = payload.split(",")
            self.gll = int(p[1])
            self.rmc = int(p[2])
            self.vtg = int(p[3])
            self.gga = int(p[4])
            self.gsa = int(p[5])
            self.gsv = int(p[6])
            self.grs = int(p[7])
            self.gst = int(p[8])

            self.malm = int(p[14])
            self.meph = int(p[15])
            self.mdgp = int(p[16])
            self.mdbg = int(p[17])
            self.zda = int(p[18])
            self.mchn = int(p[19])
            pass
        else:
            self.gll = gll
            self.rmc = rmc
            self.vtg = vtg
            self.gga = gga
            self.gsa = gsa
            self.gsv = gsv
            self.grs = grs
            self.gst = gst
            self.malm = malm
            self.meph = meph
            self.mdgp = mdgp
            self.mdbg = mdbg
            self.zda = zda
            self.mchn = mchn
            payload = "PMTK314,%d,%d,%d,%d,%d,%d,%d,%d,0,0,0,0,0,%d,%d,%d,%d,%d,%d"
            payload = payload % (gll, rmc, vtg, gga, gsa, gsv, grs, gst, malm,
                                 meph, mdgp, mdbg, zda, mchn)
            nmeaSentence.__init__(self, payload)
            pass

        self._mutable = False
        return
Пример #8
0
    def __init__(self, payload):
        nmeaSentence.__init__(self, payload)
        p = payload.split(',')
        self.id = p[0]
        self.name = p[1]
        self.__date = p[2]

        if 0 < len(p[2]):
            self.date = datetime.strptime(p[2], "%Y-%m-%d").date()
            pass

        self._mutable = False
        return
Пример #9
0
    def __init__ (self, payload):
        nmeaSentence.__init__ (self, payload)
        p = payload.split (',')
        self.id = p[0]
        self.name = p[1]
        self.__date = p[2]

        if 0 < len (p[2]):
            self.date = datetime.strptime (p[2], "%Y-%m-%d").date()
            pass
        
        self._mutable = False
        return
Пример #10
0
 def __init__ (self,
               payload=None,
               gll=0, rmc=0, vtg=0, gga=0, gsa=0, gsv=0, grs=0, gst=0,
               malm=0, meph=0, mdgp=0, mdbg=0, zda=0, mchn=0):
     if payload is not None:
         nmeaSentence.__init__(self, payload)
         p = payload.split (",")
         self.gll  = int (p[1])
         self.rmc  = int (p[2])
         self.vtg  = int (p[3])
         self.gga  = int (p[4])
         self.gsa  = int (p[5])
         self.gsv  = int (p[6])
         self.grs  = int (p[7])
         self.gst  = int (p[8])
         
         self.malm = int (p[14])
         self.meph = int (p[15])
         self.mdgp = int (p[16])
         self.mdbg = int (p[17])
         self.zda  = int (p[18])
         self.mchn = int (p[19])
         pass
     else:
         self.gll = gll
         self.rmc = rmc
         self.vtg = vtg
         self.gga = gga
         self.gsa = gsa
         self.gsv = gsv
         self.grs = grs
         self.gst = gst
         self.malm = malm
         self.meph = meph
         self.mdgp = mdgp
         self.mdbg = mdbg
         self.zda = zda
         self.mchn = mchn
         payload = "PMTK314,%d,%d,%d,%d,%d,%d,%d,%d,0,0,0,0,0,%d,%d,%d,%d,%d,%d"
         payload = payload % (gll, rmc, vtg, gga, gsa, gsv, grs, gst,
                              malm, meph, mdgp, mdbg, zda, mchn)
         nmeaSentence.__init__(self, payload)
         pass
     
     self._mutable = False
     return
Пример #11
0
 def __init__(self, payload):
     nmeaSentence.__init__(self, payload)
     self._mutable = False
     return
Пример #12
0
 def __init__ (self, payload):
     nmeaSentence.__init__(self, payload)
     self._mutable = False
     return