Commit 244974483fcda05a6fed6ef6ce06faf7f42dbf42

Authored by panzh
1 parent 61370ebd

update...

src/main/java/com/bsth/data/gps/process/chains/ForecastProcess.java
... ... @@ -28,9 +28,9 @@ public class ForecastProcess {
28 28 if (isValidSignal(list)) {
29 29 GpsEntity first = list.get(0);
30 30 double sumDist = GeoUtils.getDistance(first, gps);//行驶距离
31   - double seconds = (gps.getTimestamp() - first.getTimestamp()) / 1000 - 45;//耗时
  31 + double seconds = (gps.getTimestamp() - first.getTimestamp()) / 1000 - 20;//耗时 (-20 假设停一站 )
32 32 double avgSpeed = sumDist / seconds;//均速
33   - gps.setSeconds((int) (gps.getDistance() / avgSpeed));//到下一站的时间
  33 + gps.setSeconds((int) (gps.getDistance() / avgSpeed) + 30);//到下一站的时间(30 秒 尝试稀疏一下红绿灯)
34 34 } else {
35 35  
36 36 //用行驶距离 的比例 取计划时间
... ...
src/main/resources/static/pages/m/m.html
... ... @@ -544,7 +544,7 @@
544 544 if (seconds == 0)
545 545 htmlStr += '<div><span class="no red">即将到站</span><h6 class="red">' + array[i].stopdis + '站</h6></div>';
546 546 else
547   - htmlStr += '<div><span class="no">' + seconds + '</span>分<h6>' + array[i].stopdis + '站</h6></div>';
  547 + htmlStr += '<div><span class="no">' + seconds + '</span>分&nbsp;'+(array[i].time % 60)+'秒<h6>' + array[i].stopdis + '站</h6></div>';
548 548 }
549 549 $('.publish_infos').html(htmlStr);
550 550  
... ...