资源简介
实现了组合导航GPS和MEMS数据采集和处理,并把采集数据进行保存,可视化显示,为Matlab仿真做了很好的铺垫
代码片段和文件信息
#coding=utf-8
from Tkinter import *
from numpy import *
import serial
import ttk
import threading
import numpy
import string
import binascii
import os
import sys
import time
class BD982_GUI:
def __init__(self):
self.root = Tk()
self.root.geometry(“460x420“)
self.root.title(“Python GPS_GGA & MEMS_GUI“)
# GPS GPS GPS GPS GPS GPS GPS GPS GPS
self.lab0 = Label(self.roottext=““)
self.lab0.grid(row=0column=0sticky=E)
self.lab1 = Label(self.roottext=“Time Setting(s):“)
self.lab1.grid(row=1column=0sticky=E)
var = IntVar()
var.set(‘60‘)
self.en = Entry(self.roottextvariable = var)
self.en.grid(row=1column=1sticky=E)
self.b3 = Button(self.roottext = “Entry“bg = ‘green‘command = self.Entryvar)
self.b3.grid(row=1column=2sticky=W)
#set serial number
self.lab2 = Label(self.roottext = “Serial Number(GPS_GGA)“)
self.lab2.grid(row=2column=0sticky=W)
#set serial list
self.boxValue0 = StringVar()
self.boxChoice0 = ttk.Combobox(self.roottextvariable=self.boxValue0state=“readonly“)
self.boxChoice0[“value“] = (“COM1““COM2““COM3““COM4““COM5““COM6““COM7“)
self.boxChoice0.current(2)
self.boxChoice0.bind(“<>“self.Choice0)
self.boxChoice0.grid(row=3column=0sticky=W)
#set baudrate
self.lab3=Label(self.roottext=“Baudrate Set (GPS_GGA)“)
self.lab3.grid(row=4column=0sticky=W)
#set baudrate list
self.boxValueBaudrate0=IntVar()
self.BaudrateChoice0=ttk.Combobox(self.roottextvariable=self.boxValueBaudrate0state=“readonly“)
self.BaudrateChoice0[“value“]=(9600480014400192003840056000115200)
self.BaudrateChoice0.current(0)
self.BaudrateChoice0.bind(“<>“self.ChoiceBaudrate0)
self.BaudrateChoice0.grid(row=5column=0sticky=W)
self.lab4 = Label(self.roottext=““)
self.lab4.grid(row=6column=0)
self.lab5 = Label(self.roottext=““)
self.lab5.grid(row=7column=0)
#date time longitude latitude nstatus nspeed
self.lab6=Label(self.roottext=“ GPS State:“)
self.lab6.grid(row=2column=1sticky=E)
self.lab7=Label(self.roottext=“ Time:“)
self.lab7.grid(row=3column=1sticky=E)
self.lab8=Label(self.roottext=“ Longitude:“)
self.lab8.grid(row=4column=1sticky=E)
self.lab9=Label(self.roottext=“ Latitude:“)
self.lab9.grid(row=5column=1sticky=E)
self.lab10=Label(self.roottext=“ Height:“)
self.lab10.grid(row=6column=1sticky=E)
self.lab11=Label(self.roottext=“Satellite Numbers:“)
self.lab11.grid(row=7column=1sticky=E)
#show date time
评论
共有 条评论