Commit a17c901bb4d10718b314ad8053e1de62ba4ec749

Authored by 潘钊
1 parent f49b8a20

update

src/main/resources/static/real_control_v2/css/main.css
... ... @@ -191,7 +191,7 @@ svg.line-chart g.gps-wrap>rect {
191 191 }
192 192  
193 193 svg.line-chart g.gps-wrap>rect[updown="0"] {
194   - /*stroke: rgb(62, 80, 179);*/
  194 + stroke: rgb(62, 80, 179);
195 195 fill: rgb(62, 80, 179);
196 196 }
197 197  
... ...
src/main/resources/static/real_control_v2/fragments/home/layout.html
... ... @@ -38,7 +38,7 @@
38 38 <script id="home-rb-explain-help-temp" type="text/html">
39 39 <ul class="uk-list">
40 40 <li>场外车辆,距离线路超过100米即为越界</li>
41   - <li>线路标准信息限速字段为空,则默认限速60</li>
  41 + <li>超速以线路标准限速为准,为空则默认60</li>
42 42 <li>有任务时,连续2分钟无信号即为掉线</li>
43 43 <li>无任务时,连续10分钟无信号则已离线</li>
44 44 </ul>
... ...
src/main/resources/static/real_control_v2/js/data/data_basic.js
... ... @@ -161,14 +161,14 @@ var gb_data_basic = (function () {
161 161 //是否是环线
162 162 isLoopLine: function (lineCode) {
163 163 var data = gb_common.groupBy(stationRoutes[lineCode], 'directions');
164   - //如果上行起终点名称相同,并且距离50米内 并且下行只有2个站点
  164 + //如果上行起终点距离50米内 并且下行只有2个站点
165 165 var len = data[0].length;
166 166 if(len > 0 && data[1].length == 2){
167 167 var first = data[0][0],
168 168 end = data[0][len - 1];
169 169  
170   - if(first.stationName != end.stationName)
171   - return false;
  170 + /*if(first.stationName != end.stationName)
  171 + return false;*/
172 172  
173 173 var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx}
174 174 ,ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx};
... ...
src/main/resources/static/real_control_v2/js/utils/svg_chart.js
... ... @@ -17,6 +17,8 @@ var gb_svg_chart = (function () {
17 17 return (chart_height - (chart_height / t_max_size * t.length)) / 2 + 5;
18 18 },
19 19 cat_text = function (t) {
  20 + if(!t)
  21 + return 0;
20 22 return t.length > t_max_size ? t.substr(0, t_max_size) : t;
21 23 },
22 24 get_width = function (wrap) {
... ... @@ -39,7 +41,7 @@ var gb_svg_chart = (function () {
39 41 var loopLine = gb_data_basic.isLoopLine(lineCode);
40 42  
41 43 var routes = gb_data_basic.stationRoutes(lineCode);
42   - var data = gb_svg_data_convert.mergeRoute(JSON.parse(JSON.stringify(routes)), enableAttr, lineCode),
  44 + var data = gb_svg_data_convert.mergeRoute(JSON.parse(JSON.stringify(routes)), enableAttr, lineCode, loopLine),
43 45 len = data.length;
44 46  
45 47 var w = get_width(wrap),
... ...
src/main/resources/static/real_control_v2/js/utils/svg_data_convert.js
... ... @@ -4,11 +4,11 @@ var gb_svg_data_convert = (function () {
4 4 * 合并上下行路由
5 5 * type 0 上行 1 下行 2 同名合并 3 异名合并
6 6 *
7   - * 有时间再重写一些这块代码!!!!!
  7 + * 因为基础的数据的各种奇葩搞法,这块打了很多补丁,有时间一定要重写
8 8 *
9 9 * enableAttr: 是否启用配置信息
10 10 */
11   - function mergeRoute(routes, enableAttr, lineCode) {
  11 + function mergeRoute(routes, enableAttr, lineCode, loopLine) {
12 12 //按上下行拆分
13 13 routes = gb_common.groupBy(routes, 'directions');
14 14 var up = routes[0],
... ... @@ -16,6 +16,7 @@ var gb_svg_data_convert = (function () {
16 16 //排序
17 17 up.sort(upSort);
18 18 down.sort(downSort);
  19 + var data = [];
19 20  
20 21 //根据配置处理一下数据
21 22 if (enableAttr) {
... ... @@ -26,8 +27,30 @@ var gb_svg_data_convert = (function () {
26 27 }
27 28 }
28 29  
  30 + //环线 只画上行
  31 + if(loopLine){
  32 + for (var j = 0; j < up.length; j++) {
  33 + var upS = nvl_get(up, j);
  34 + op = {
  35 + name: [upS.stationName],
  36 + id: [get_station_code(upS)],
  37 + type: 0,
  38 + stationMark: upS.stationMark
  39 + };
  40 + data.push(op);
  41 + }
  42 +
  43 + //上下行GPS容器
  44 + $.each(data, function () {
  45 + this.gpsUps = [];
  46 + this.gpsDowns = [];
  47 + });
  48 +
  49 + return data;
  50 + }
  51 +
  52 +
29 53 //同名站点合并
30   - var data = [];
31 54 for (var j = 0; j < up.length; j++) {
32 55 var upS = nvl_get(up, j),
33 56 downS = nvl_get(down, j),
... ... @@ -43,8 +66,8 @@ var gb_svg_data_convert = (function () {
43 66 var dIndex = station_indexof(down, upS, j);
44 67 //上行站点在下行路由中是否存在
45 68 var uIndex = station_indexof(up, downS, j);
46   - if (dIndex == -1) {
47   - if (uIndex == -1) {
  69 + if (dIndex == -1 || dIndex - j > 4) {
  70 + if (uIndex == -1 && dIndex - j < 4) {
48 71 op.type = 3;
49 72 op.name = [upS.stationName, downS.stationName];
50 73 }
... ...