#
Junjie
5 天以前 909164aa1859fdf25330eb130bc90b8bd22e540b
src/main/webapp/static/js/stationPathPolicy/stationPathPolicy.js
@@ -11,8 +11,12 @@
        s1MaxLenRatio: 1.15,
        s1MaxTurnDiff: 1,
        s2BusyWeight: 2.0,
        s2QueueWeight: 2.5,
        s2WaitWeight: 1.5,
        s2DeadlockWeight: 8.0,
        s2RunBlockWeight: 10.0,
        s2LoopLoadWeight: 12.0,
        circleMaxLoadLimit: 80.0,
        stationPathLenWeightPercent: 50,
        stationPathCongWeightPercent: 50,
        stationPathPassOtherOutStationWeightPercent: 100,
@@ -1153,9 +1157,11 @@
        },
        normalizeProfile: function (raw) {
            var config = Object.assign({}, this.defaultProfileConfig(), this.parseJson(raw.configJson) || raw.config || {})
            config.circleMaxLoadLimit = this.toNumberSafe(config.circleMaxLoadLimit)
            config.stationPathLenWeightPercent = this.toNumberSafe(config.stationPathLenWeightPercent)
            config.stationPathCongWeightPercent = this.toNumberSafe(config.stationPathCongWeightPercent)
            config.stationPathPassOtherOutStationWeightPercent = this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent)
            config.circleMaxLoadLimit = config.circleMaxLoadLimit == null ? 80 : config.circleMaxLoadLimit
            config.stationPathLenWeightPercent = config.stationPathLenWeightPercent == null ? 50 : config.stationPathLenWeightPercent
            config.stationPathCongWeightPercent = config.stationPathCongWeightPercent == null ? 50 : config.stationPathCongWeightPercent
            config.stationPathPassOtherOutStationWeightPercent = config.stationPathPassOtherOutStationWeightPercent == null ? 100 : config.stationPathPassOtherOutStationWeightPercent
@@ -1206,6 +1212,7 @@
        },
        sanitizeProfileForSave: function (item) {
            var config = Object.assign({}, item.config || {})
            config.circleMaxLoadLimit = this.toNumberSafe(config.circleMaxLoadLimit) == null ? 80 : this.toNumberSafe(config.circleMaxLoadLimit)
            config.stationPathLenWeightPercent = this.toNumberSafe(config.stationPathLenWeightPercent) == null ? 50 : this.toNumberSafe(config.stationPathLenWeightPercent)
            config.stationPathCongWeightPercent = this.toNumberSafe(config.stationPathCongWeightPercent) == null ? 50 : this.toNumberSafe(config.stationPathCongWeightPercent)
            config.stationPathPassOtherOutStationWeightPercent = this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent) == null ? 100 : this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent)
@@ -1303,6 +1310,16 @@
            var num = Number(value)
            return isNaN(num) ? null : num
        },
        displayLoadLimitPercent: function (value) {
            var num = this.toNumberSafe(value)
            if (num == null) {
                num = 80
            }
            if (num <= 1) {
                num = num * 100
            }
            return num.toFixed(1) + '%'
        },
        notNull: function (value) {
            return value != null
        },