---
title: "公交位置模拟工具"
author: "spjich"
date: "2015-12-22T15:37:31Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2015-12-22T15:40:41Z"
id: 2265771
url: "https://spjich.iteye.com/blog/2265771"
---

#### 承接上一篇

[http://spjich.iteye.com/blog/2264025](/blog/2264025)

 

公交位置判断完成以后，模拟测试会比较麻烦，要模拟公交的动态移动，所以我做了一个模拟工具，模拟公交运动

以下是git地址

[https://git.oschina.net/spjich/busMonitor.git](https://git.oschina.net/spjich/busMonitor.git)

# 运行环境

java1.7/java1.6

tomcat7

redis可选

# [](http://git.oschina.net/spjich/busMonitor#%E8%BF%90%E8%A1%8C%E9%A6%96%E9%A1%B5)运行首页

![TMD](http://git.oschina.net/spjich/busMonitor/raw/master/PIC/1.jpg)

# [](http://git.oschina.net/spjich/busMonitor#step1-%E8%AE%BE%E7%BD%AE%E6%A8%A1%E6%8B%9F%E7%BA%BF%E8%B7%AF)step1.设置模拟线路

在输入框中输入你要模拟的线路,本程序就会模拟一辆bus在该线路上的移动

# [](http://git.oschina.net/spjich/busMonitor#step2-%E6%9F%A5%E7%9C%8B%E7%BA%BF%E8%B7%AF%E8%B7%AF%E5%BE%84)step2.查看线路路径

这个功能可以查看到在step1中设置的线路的路径情况

 ![TMD](http://git.oschina.net/spjich/busMonitor/raw/master/PIC/2.jpg)

# [](http://git.oschina.net/spjich/busMonitor#step3-%E6%A8%A1%E6%8B%9F%E8%BD%A6%E8%BE%86%E7%A7%BB%E5%8A%A8)step3.模拟车辆移动

可以观察车辆从起点-&gt;终点的移动（刷新周期10s），因为本工程只是一个工具，所以目前只支持单反向

 ![TMD](http://git.oschina.net/spjich/busMonitor/raw/master/PIC/3.jpg)

 

# [](http://git.oschina.net/spjich/busMonitor#step4-%E6%A8%A1%E6%8B%9F%E9%87%8D%E7%BD%AE)step4.模拟重置

将车辆移动到原点，重新跑线路

Tips: 由于业务需要，本工程使用了redis，如果使用者无需redis，可以配置configure.properties里的is\_redis\_enable字段 公交位置系统的实现可以参考 [http://spjich.iteye.com/blog/2264025](/blog/2264025)

 

 

 

 

 

 

 

 

原创文章，转载请声名出处