Commit 0140e85d63535ba1ea004083445aefa4432aad51
1 parent
c19196e3
时刻表v2.7.12
1、修正主副站停站时间总是相反的bug 2、修正吃饭方向总是一个方向的问题 3、修正进出场总是一个方向的问题
Showing
4 changed files
with
46 additions
and
21 deletions
src/main/resources/static/pages/base/timesmodel/js/v2/ParameterObj.js
| ... | ... | @@ -730,6 +730,22 @@ var ParameterObj = function() { |
| 730 | 730 | return _stopTypeObj.isMasterStop && (!_stopTypeObj.isMasterUpStop); |
| 731 | 731 | }, |
| 732 | 732 | |
| 733 | + /** | |
| 734 | + * 获取副站停站的方向(true,上行,false,下行)。 | |
| 735 | + */ | |
| 736 | + getDirAnotherWayStop: function() { | |
| 737 | + if (!this.isTwoWayStop()) { | |
| 738 | + if (this.isUpOneWayStop()) { | |
| 739 | + return true; | |
| 740 | + } else { | |
| 741 | + return false; | |
| 742 | + } | |
| 743 | + | |
| 744 | + } else { | |
| 745 | + return undefined; | |
| 746 | + } | |
| 747 | + }, | |
| 748 | + | |
| 733 | 749 | //----------------- 获取高峰配车数、加班路牌数 ----------------// |
| 734 | 750 | /** |
| 735 | 751 | * 获取高峰建议配车数(TODO:参照一下)。 |
| ... | ... | @@ -1391,7 +1407,7 @@ var ParameterObj = function() { |
| 1391 | 1407 | var _iMinLayoverTime = 0; |
| 1392 | 1408 | var _iMaxlayoverTime = 0; |
| 1393 | 1409 | |
| 1394 | - if (this.isTwoWayStop() || isUp == this.isUpOneWayStop()) { | |
| 1410 | + if (this.isTwoWayStop() || (this.getDirAnotherWayStop() != isUp)) { | |
| 1395 | 1411 | // 主站停站 |
| 1396 | 1412 | // 早晚高峰,行驶时间的10%-15%,最少3分钟 |
| 1397 | 1413 | // 低谷,行驶时间的15%-20%,最少10分钟 | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalLpObj.js
| ... | ... | @@ -486,10 +486,13 @@ InternalLpObj.prototype.fnGetQBcIndexWithFcTimeFromGroupArray = function( |
| 486 | 486 | |
| 487 | 487 | console.log("比较时间=" + fctime.format("HH:mm")); |
| 488 | 488 | |
| 489 | + var oBc; | |
| 490 | + | |
| 489 | 491 | for (i = 0; i < this._$_qCount; i++) { |
| 490 | 492 | group = groupArray[i]; |
| 491 | 493 | if (group) { |
| 492 | - if (group.getBc1() && hasUp) { | |
| 494 | + oBc = group.getBc1(); | |
| 495 | + if (oBc != undefined && (oBc.isUp() == hasUp || oBc.isUp() == hasDown)) { | |
| 493 | 496 | bc1time = group.getBc1().getFcTimeObj(); |
| 494 | 497 | console.log("bc1time=" + bc1time.format("HH:mm") + " tempdiff=" + tempdiff); |
| 495 | 498 | tempdiff = Math.abs(bc1time.diff(fctime)); |
| ... | ... | @@ -514,7 +517,8 @@ InternalLpObj.prototype.fnGetQBcIndexWithFcTimeFromGroupArray = function( |
| 514 | 517 | } |
| 515 | 518 | } |
| 516 | 519 | |
| 517 | - if (group.getBc2() && hasDown) { | |
| 520 | + oBc = group.getBc2(); | |
| 521 | + if (oBc != undefined && (oBc.isUp() == hasUp || oBc.isUp() == hasDown)) { | |
| 518 | 522 | bc2time = group.getBc2().getFcTimeObj(); |
| 519 | 523 | console.log("bc2time=" + bc2time.format("HH:mm") + " tempdiff=" + tempdiff); |
| 520 | 524 | tempdiff = Math.abs(bc2time.diff(fctime)); | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalScheduleObj.js
| ... | ... | @@ -159,12 +159,13 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 159 | 159 | |
| 160 | 160 | // 在第一个班次之前再添加一个模拟班次,用于中标线的作用 |
| 161 | 161 | // 那一圈必定是低谷,而且圈索引0,班次索引1,暂时标记,最后删除 |
| 162 | + var iXXTime = _qIsUp ? _paramObj.getDownTroughTime() : _paramObj.getUpTroughTime(); | |
| 162 | 163 | var iFirstStopTime = |
| 163 | 164 | _paramObj.fnCalcuFixedStopNumber( |
| 164 | 165 | _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -10), |
| 165 | - _qIsUp | |
| 166 | + _qIsUp, | |
| 167 | + iXXTime | |
| 166 | 168 | ); |
| 167 | - var iXXTime = _qIsUp ? _paramObj.getDownTroughTime() : _paramObj.getUpTroughTime(); | |
| 168 | 169 | var oFlagBc = _factory.createBcObj( // 标记班次 |
| 169 | 170 | _internalLpArray[0], |
| 170 | 171 | "normal", |
| ... | ... | @@ -173,6 +174,9 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 173 | 174 | _paramObj.addMinute(aBcArray[0].getFcTimeObj(), -(iFirstStopTime + iXXTime)), |
| 174 | 175 | _paramObj |
| 175 | 176 | ); |
| 177 | + console.log("ddfdfdf=" + (iFirstStopTime)); | |
| 178 | + console.log("ddfdfdf=" + (iXXTime)); | |
| 179 | + console.log("ttt ==" + oFlagBc.getFcTimeObj().format("HH:mm")); | |
| 176 | 180 | oFlagBc.fnSetDelFlag(true); // 标记了删除记号 |
| 177 | 181 | |
| 178 | 182 | _internalLpArray[0].setBc(0, 1, oFlagBc); |
| ... | ... | @@ -1377,6 +1381,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 1377 | 1381 | // 晚饭index |
| 1378 | 1382 | var aDEIndex; |
| 1379 | 1383 | |
| 1384 | + console.log("吃饭"); | |
| 1380 | 1385 | // 所有吃饭都默认在一个方向,两个方向暂时不考虑 |
| 1381 | 1386 | if (_paramObj.fnIsUpEat()) { |
| 1382 | 1387 | aLEIndex = _internalLpArray[0].getQBcIndexWithFcTime(_paramObj.toTimeObj("10:15"), true, false); |
| ... | ... | @@ -1533,12 +1538,12 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 1533 | 1538 | oLp.fnGetBcChainInfo(0)["s_b"] |
| 1534 | 1539 | ); |
| 1535 | 1540 | aOtherBc.push(_factory.createBcObj( |
| 1536 | - oLp, "bd", true, 1, | |
| 1541 | + oLp, "bd", oStartBc.isUp(), 1, | |
| 1537 | 1542 | oStartBc.getFcTimeObj(), |
| 1538 | 1543 | _paramObj |
| 1539 | 1544 | )); |
| 1540 | 1545 | aOtherBc.push(_factory.createBcObj( |
| 1541 | - oLp, "out", true, 1, | |
| 1546 | + oLp, "out", oStartBc.isUp(), 1, | |
| 1542 | 1547 | oStartBc.getFcTimeObj(), |
| 1543 | 1548 | _paramObj |
| 1544 | 1549 | )); |
| ... | ... | @@ -1551,12 +1556,12 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 1551 | 1556 | oEndBc.fnSetIsLastBc(false); // 有可能最后一个班次是吃饭班次,重置 |
| 1552 | 1557 | oEndBc.fnSetEatTime(0); // 有可能最后一个班次是吃饭班次,重置 |
| 1553 | 1558 | aOtherBc.push(_factory.createBcObj( |
| 1554 | - oLp, "in", true, 1, | |
| 1559 | + oLp, "in", oEndBc.isUp(), 1, | |
| 1555 | 1560 | oEndBc.getArrTimeObj(), |
| 1556 | 1561 | _paramObj |
| 1557 | 1562 | )); |
| 1558 | 1563 | aOtherBc.push(_factory.createBcObj( |
| 1559 | - oLp, "lc", true, 1, | |
| 1564 | + oLp, "lc", oEndBc.isUp(), 1, | |
| 1560 | 1565 | oEndBc.getArrTimeObj(), |
| 1561 | 1566 | _paramObj |
| 1562 | 1567 | )); |
| ... | ... | @@ -1567,12 +1572,12 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 1567 | 1572 | oLp.fnGetBcChainInfo(0)["s_b"] |
| 1568 | 1573 | ); |
| 1569 | 1574 | aOtherBc.push(_factory.createBcObj( |
| 1570 | - oLp, "bd", true, 1, | |
| 1575 | + oLp, "bd", oStartBc.isUp(), 1, | |
| 1571 | 1576 | oStartBc.getFcTimeObj(), |
| 1572 | 1577 | _paramObj |
| 1573 | 1578 | )); |
| 1574 | 1579 | aOtherBc.push(_factory.createBcObj( |
| 1575 | - oLp, "out", true, 1, | |
| 1580 | + oLp, "out", oStartBc.isUp(), 1, | |
| 1576 | 1581 | oStartBc.getFcTimeObj(), |
| 1577 | 1582 | _paramObj |
| 1578 | 1583 | )); |
| ... | ... | @@ -1582,7 +1587,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 1582 | 1587 | oLp.fnGetBcChainInfo(0)["e_b"] |
| 1583 | 1588 | ); |
| 1584 | 1589 | aOtherBc.push(_factory.createBcObj( |
| 1585 | - oLp, "in", true, 1, | |
| 1590 | + oLp, "in", oEndBc.isUp(), 1, | |
| 1586 | 1591 | oEndBc.getArrTimeObj(), |
| 1587 | 1592 | _paramObj |
| 1588 | 1593 | )); |
| ... | ... | @@ -1593,12 +1598,12 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 1593 | 1598 | oLp.fnGetBcChainInfo(1)["s_b"] |
| 1594 | 1599 | ); |
| 1595 | 1600 | aOtherBc.push(_factory.createBcObj( |
| 1596 | - oLp, "bd", true, 1, | |
| 1601 | + oLp, "bd", oStartBc.isUp(), 1, | |
| 1597 | 1602 | oStartBc.getFcTimeObj(), |
| 1598 | 1603 | _paramObj |
| 1599 | 1604 | )); |
| 1600 | 1605 | aOtherBc.push(_factory.createBcObj( |
| 1601 | - oLp, "out", true, 1, | |
| 1606 | + oLp, "out", oStartBc.isUp(), 1, | |
| 1602 | 1607 | oStartBc.getFcTimeObj(), |
| 1603 | 1608 | _paramObj |
| 1604 | 1609 | )); |
| ... | ... | @@ -1608,12 +1613,12 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { |
| 1608 | 1613 | oLp.fnGetBcChainInfo(1)["e_b"] |
| 1609 | 1614 | ); |
| 1610 | 1615 | aOtherBc.push(_factory.createBcObj( |
| 1611 | - oLp, "in", true, 1, | |
| 1616 | + oLp, "in", oEndBc.isUp(), 1, | |
| 1612 | 1617 | oEndBc.getArrTimeObj(), |
| 1613 | 1618 | _paramObj |
| 1614 | 1619 | )); |
| 1615 | 1620 | aOtherBc.push(_factory.createBcObj( |
| 1616 | - oLp, "lc", true, 1, | |
| 1621 | + oLp, "lc", oEndBc.isUp(), 1, | |
| 1617 | 1622 | oEndBc.getArrTimeObj(), |
| 1618 | 1623 | _paramObj |
| 1619 | 1624 | )); | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
| ... | ... | @@ -19,7 +19,7 @@ var Main_v2 = function() { |
| 19 | 19 | var _bcsj = paramObj.calcuTravelTime(_fcsj, isUp); |
| 20 | 20 | var _arrsj = paramObj.addMinute(_fcsj, _bcsj); |
| 21 | 21 | //var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, _bcsj); |
| 22 | - var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, !isUp, paramObj.calcuTravelTime(_fcsj, isUp)); | |
| 22 | + var _stoptime = paramObj.fnCalcuFixedStopNumber(_arrsj, isUp, paramObj.calcuTravelTime(_fcsj, isUp)); | |
| 23 | 23 | var _tccid = paramObj.getTTinfoId(); |
| 24 | 24 | var _ttinfoid = paramObj.getTTinfoId(); |
| 25 | 25 | var _xl = paramObj.getXlId(); |
| ... | ... | @@ -806,10 +806,10 @@ var Main_v2 = function() { |
| 806 | 806 | // 11、祛除上标线结尾有删除标记的班次 |
| 807 | 807 | schedule.fnRemoveDelLastFlagBc(); |
| 808 | 808 | // |
| 809 | - // // TODO:12、平均化指定时间后的班次列表间隔 | |
| 810 | - // schedule.fnAdjustBcInterval2_avg(true, _paramObj.toTimeObj("19:50")); | |
| 811 | - // schedule.fnAdjustBcInterval2_avg(false, _paramObj.toTimeObj("19:50")); | |
| 812 | - // | |
| 809 | + // // // TODO:12、平均化指定时间后的班次列表间隔 | |
| 810 | + // // schedule.fnAdjustBcInterval2_avg(true, _paramObj.toTimeObj("19:50")); | |
| 811 | + // // schedule.fnAdjustBcInterval2_avg(false, _paramObj.toTimeObj("19:50")); | |
| 812 | + | |
| 813 | 813 | // 10、补进出场例保班次 |
| 814 | 814 | schedule.fnCalcuOtherBc(); |
| 815 | 815 | ... | ... |