onroute-policy-engine 2.18.1 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enum/policy-check.d.ts +4 -2
- package/dist/enum/policy-check.js +3 -1
- package/dist/helper/ctr-717.helper.d.ts +2 -0
- package/dist/helper/ctr-717.helper.js +33 -0
- package/dist/helper/policy-check.helper.d.ts +12 -6
- package/dist/helper/policy-check.helper.js +234 -39
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare enum PolicyCheckResultType {
|
|
2
2
|
Pass = "pass",
|
|
3
|
-
Fail = "fail"
|
|
3
|
+
Fail = "fail",
|
|
4
|
+
Warning = "warning"
|
|
4
5
|
}
|
|
5
6
|
export declare enum PolicyCheckId {
|
|
7
|
+
AxleGroupMaximumLegalWeightThreshold = "axle-group-maximum-legal-weight-threshold",
|
|
6
8
|
BoosterAxleLimit = "booster-axle-limit",
|
|
7
9
|
BridgeFormula = "bridge-formula",
|
|
8
10
|
CheckPermittableWeight = "check-permittable-weight",
|
|
@@ -14,5 +16,5 @@ export declare enum PolicyCheckId {
|
|
|
14
16
|
NumberOfAxles = "number-of-axles",
|
|
15
17
|
NumberOfWheelsPerAxle = "number-of-wheels",
|
|
16
18
|
PickerTruckTractorWeightRestrictions = "picker-truck-tractor-weight-restrictions",
|
|
17
|
-
|
|
19
|
+
WheelbaseLegalLimits = "wheelbase-legal-limits"
|
|
18
20
|
}
|
|
@@ -5,9 +5,11 @@ var PolicyCheckResultType;
|
|
|
5
5
|
(function (PolicyCheckResultType) {
|
|
6
6
|
PolicyCheckResultType["Pass"] = "pass";
|
|
7
7
|
PolicyCheckResultType["Fail"] = "fail";
|
|
8
|
+
PolicyCheckResultType["Warning"] = "warning";
|
|
8
9
|
})(PolicyCheckResultType || (exports.PolicyCheckResultType = PolicyCheckResultType = {}));
|
|
9
10
|
var PolicyCheckId;
|
|
10
11
|
(function (PolicyCheckId) {
|
|
12
|
+
PolicyCheckId["AxleGroupMaximumLegalWeightThreshold"] = "axle-group-maximum-legal-weight-threshold";
|
|
11
13
|
PolicyCheckId["BoosterAxleLimit"] = "booster-axle-limit";
|
|
12
14
|
PolicyCheckId["BridgeFormula"] = "bridge-formula";
|
|
13
15
|
PolicyCheckId["CheckPermittableWeight"] = "check-permittable-weight";
|
|
@@ -19,5 +21,5 @@ var PolicyCheckId;
|
|
|
19
21
|
PolicyCheckId["NumberOfAxles"] = "number-of-axles";
|
|
20
22
|
PolicyCheckId["NumberOfWheelsPerAxle"] = "number-of-wheels";
|
|
21
23
|
PolicyCheckId["PickerTruckTractorWeightRestrictions"] = "picker-truck-tractor-weight-restrictions";
|
|
22
|
-
PolicyCheckId["
|
|
24
|
+
PolicyCheckId["WheelbaseLegalLimits"] = "wheelbase-legal-limits";
|
|
23
25
|
})(PolicyCheckId || (exports.PolicyCheckId = PolicyCheckId = {}));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCtr717TableValue = getCtr717TableValue;
|
|
4
|
+
const CTR_717_WEIGHT_BANDS = [
|
|
5
|
+
{ minimumSpreadCm: 800, maximumWeightKg: 34000 },
|
|
6
|
+
{ minimumSpreadCm: 760, maximumWeightKg: 33000 },
|
|
7
|
+
{ minimumSpreadCm: 720, maximumWeightKg: 32000 },
|
|
8
|
+
{ minimumSpreadCm: 690, maximumWeightKg: 31000 },
|
|
9
|
+
{ minimumSpreadCm: 650, maximumWeightKg: 30000 },
|
|
10
|
+
{ minimumSpreadCm: 610, maximumWeightKg: 29000 },
|
|
11
|
+
{ minimumSpreadCm: 570, maximumWeightKg: 28000 },
|
|
12
|
+
{ minimumSpreadCm: 530, maximumWeightKg: 27000 },
|
|
13
|
+
{ minimumSpreadCm: 500, maximumWeightKg: 26000 },
|
|
14
|
+
{ minimumSpreadCm: 460, maximumWeightKg: 25000 },
|
|
15
|
+
{ minimumSpreadCm: 420, maximumWeightKg: 24000 },
|
|
16
|
+
{ minimumSpreadCm: 380, maximumWeightKg: 23000 },
|
|
17
|
+
{ minimumSpreadCm: 340, maximumWeightKg: 22000 },
|
|
18
|
+
{ minimumSpreadCm: 300, maximumWeightKg: 21000 },
|
|
19
|
+
{ minimumSpreadCm: 260, maximumWeightKg: 20000 },
|
|
20
|
+
{ minimumSpreadCm: 230, maximumWeightKg: 19000 },
|
|
21
|
+
{ minimumSpreadCm: 190, maximumWeightKg: 18000 },
|
|
22
|
+
{ minimumSpreadCm: 120, maximumWeightKg: 17000 },
|
|
23
|
+
{ minimumSpreadCm: 100, maximumWeightKg: 16500 },
|
|
24
|
+
{ minimumSpreadCm: 0, maximumWeightKg: 9100 },
|
|
25
|
+
];
|
|
26
|
+
/** Returns the authoritative CTR 7.17 table value for a spread in centimetres. */
|
|
27
|
+
function getCtr717TableValue(spreadCm) {
|
|
28
|
+
var _a;
|
|
29
|
+
if (!Number.isFinite(spreadCm) || spreadCm < 0) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
return (_a = CTR_717_WEIGHT_BANDS.find(({ minimumSpreadCm }) => spreadCm >= minimumSpreadCm)) === null || _a === void 0 ? void 0 : _a.maximumWeightKg;
|
|
33
|
+
}
|
|
@@ -14,6 +14,13 @@ import { Policy } from 'onroute-policy-engine';
|
|
|
14
14
|
* @returns Array of PolicyCheckResult objects representing the outcomes of the policy check
|
|
15
15
|
*/
|
|
16
16
|
type PolicyCheck = (policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>) => Array<PolicyCheckResult>;
|
|
17
|
+
/** Applies the standard lower-of rule or the exact 7.16(g) exception. */
|
|
18
|
+
export declare function getMaximumLegalAxleGroupWeightThreshold(individualLegalWeightSum: number, ctr717TableValue: number, isTandemDriveSingleJeepException: boolean): number;
|
|
19
|
+
/**
|
|
20
|
+
* Validates every contiguous axle-unit group within 8 m, excluding groups
|
|
21
|
+
* beginning at axle unit 1, against the CTR 7.17 maximum legal weight.
|
|
22
|
+
*/
|
|
23
|
+
export declare function CheckAxleGroupMaximumLegalWeightThreshold(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<AxleGroupPolicyCheckResult>;
|
|
17
24
|
/**
|
|
18
25
|
* Validates the number of axles in each axle unit.
|
|
19
26
|
*
|
|
@@ -266,12 +273,9 @@ export declare function CheckMaxTireLoad(_policy: Policy, _vehicleConfiguration:
|
|
|
266
273
|
*/
|
|
267
274
|
export declare function CheckBoosterAxleLimit(_policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
268
275
|
/**
|
|
269
|
-
* Validates
|
|
270
|
-
*
|
|
271
|
-
* Wheelbase is derived from the spacing between axle units 1 and 2 plus half
|
|
272
|
-
* of axle unit 2 spread. Axle dimensions are stored in centimetres.
|
|
276
|
+
* Validates wheelbase legal limits for supported power unit vehicle sub-types.
|
|
273
277
|
*/
|
|
274
|
-
export declare function
|
|
278
|
+
export declare function CheckWheelbaseLegalLimits(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
275
279
|
/**
|
|
276
280
|
* Validates that the drive axle unit and first jeep axle unit are load equalized
|
|
277
281
|
* within 1000 kg when they have the same number of axles.
|
|
@@ -295,6 +299,7 @@ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleC
|
|
|
295
299
|
* this map with additional entries.
|
|
296
300
|
*
|
|
297
301
|
* Currently includes:
|
|
302
|
+
* - AxleGroupMaximumLegalWeightThreshold: Validates axle groups within 8 m against CTR 7.17
|
|
298
303
|
* - BridgeFormula: Validates axle groups against bridge formula requirements
|
|
299
304
|
* - CheckPermittableWeight: Validates total vehicle weight against permit limits
|
|
300
305
|
* - MaxTireLoad: Validates tire load capacity for each axle unit
|
|
@@ -305,7 +310,8 @@ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleC
|
|
|
305
310
|
* - NumberOfAxles: Validates axle count per axle unit
|
|
306
311
|
* - NumberOfWheelsPerAxle: Validates tire count per axle unit
|
|
307
312
|
* - BoosterAxleLimit: Validates booster axle count against the preceding trailer
|
|
308
|
-
* -
|
|
313
|
+
* - TruckTractorWheelbaseLegalLimits: Validates derived wheelbase for single steer, tandem drive truck tractors
|
|
314
|
+
* - WheelbaseLegalLimits: Validates wheelbase against legal limits
|
|
309
315
|
* - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
|
|
310
316
|
*
|
|
311
317
|
* @see PolicyCheck
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.policyCheckMap = void 0;
|
|
4
|
+
exports.getMaximumLegalAxleGroupWeightThreshold = getMaximumLegalAxleGroupWeightThreshold;
|
|
5
|
+
exports.CheckAxleGroupMaximumLegalWeightThreshold = CheckAxleGroupMaximumLegalWeightThreshold;
|
|
4
6
|
exports.CheckNumberOfAxles = CheckNumberOfAxles;
|
|
5
7
|
exports.CheckBridgeFormula = CheckBridgeFormula;
|
|
6
8
|
exports.CheckNumTiresPerAxle = CheckNumTiresPerAxle;
|
|
@@ -11,10 +13,123 @@ exports.CheckPickerTruckTractorWeightRestrictions = CheckPickerTruckTractorWeigh
|
|
|
11
13
|
exports.CheckMinDriveAxleWeight = CheckMinDriveAxleWeight;
|
|
12
14
|
exports.CheckMaxTireLoad = CheckMaxTireLoad;
|
|
13
15
|
exports.CheckBoosterAxleLimit = CheckBoosterAxleLimit;
|
|
14
|
-
exports.
|
|
16
|
+
exports.CheckWheelbaseLegalLimits = CheckWheelbaseLegalLimits;
|
|
15
17
|
exports.CheckDriveJeepLoadEqualization = CheckDriveJeepLoadEqualization;
|
|
16
18
|
const dimensions_helper_1 = require("./dimensions.helper");
|
|
19
|
+
const ctr_717_helper_1 = require("./ctr-717.helper");
|
|
17
20
|
const enum_1 = require("../enum");
|
|
21
|
+
/** Applies the standard lower-of rule or the exact 7.16(g) exception. */
|
|
22
|
+
function getMaximumLegalAxleGroupWeightThreshold(individualLegalWeightSum, ctr717TableValue, isTandemDriveSingleJeepException) {
|
|
23
|
+
const tandemDriveSingleJeepMinimumKg = 24000;
|
|
24
|
+
return isTandemDriveSingleJeepException
|
|
25
|
+
? Math.max(tandemDriveSingleJeepMinimumKg, ctr717TableValue)
|
|
26
|
+
: Math.min(individualLegalWeightSum, ctr717TableValue);
|
|
27
|
+
}
|
|
28
|
+
function getApplicableLegalWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex) {
|
|
29
|
+
var _a;
|
|
30
|
+
const vehicleIndex = axleUnitVehicleIndexes[axleIndex];
|
|
31
|
+
const vehicleType = vehicleConfiguration[vehicleIndex];
|
|
32
|
+
const axle = axleConfiguration[axleIndex];
|
|
33
|
+
if (!vehicleType || !axle) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const weights = vehicleIndex === 0
|
|
37
|
+
? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * 10 +
|
|
38
|
+
axleConfiguration[1].numberOfAxles)
|
|
39
|
+
: policy.getDefaultTrailerWeight(vehicleType, axle.numberOfAxles);
|
|
40
|
+
if (weights.length === 0) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return (_a = policy.selectCorrectWeightDimension(weights, vehicleConfiguration, axleConfiguration, axleIndex)) === null || _a === void 0 ? void 0 : _a.legal;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Validates every contiguous axle-unit group within 8 m, excluding groups
|
|
47
|
+
* beginning at axle unit 1, against the CTR 7.17 maximum legal weight.
|
|
48
|
+
*/
|
|
49
|
+
function CheckAxleGroupMaximumLegalWeightThreshold(policy, vehicleConfiguration, axleConfiguration) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const ctr717MaxSpreadCm = 800;
|
|
52
|
+
const policyCheckResults = new Array();
|
|
53
|
+
const policyId = enum_1.PolicyCheckId.AxleGroupMaximumLegalWeightThreshold;
|
|
54
|
+
if (axleConfiguration.length < 3) {
|
|
55
|
+
return policyCheckResults;
|
|
56
|
+
}
|
|
57
|
+
const hasVehicleIndexes = axleConfiguration.some((axleUnit) => axleUnit.vehicleIndex !== undefined);
|
|
58
|
+
const axleUnitVehicleIndexes = hasVehicleIndexes
|
|
59
|
+
? (0, dimensions_helper_1.getAxleUnitVehicleIndexes)(policy, vehicleConfiguration, axleConfiguration)
|
|
60
|
+
: axleConfiguration.map((_, axleIndex) => axleIndex < 2 ? 0 : axleIndex - 1);
|
|
61
|
+
const legalWeightThresholds = axleConfiguration.map((_, axleIndex) => getApplicableLegalWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex));
|
|
62
|
+
for (let startAxleIndex = 1; startAxleIndex < axleConfiguration.length - 1; startAxleIndex++) {
|
|
63
|
+
const firstAxle = axleConfiguration[startAxleIndex];
|
|
64
|
+
const firstAxleSpread = (_a = firstAxle.axleSpread) !== null && _a !== void 0 ? _a : 0;
|
|
65
|
+
let groupSpread = firstAxleSpread;
|
|
66
|
+
let actualWeight = firstAxle.axleUnitWeight;
|
|
67
|
+
let individualLegalWeightSum = legalWeightThresholds[startAxleIndex];
|
|
68
|
+
if (!Number.isFinite(firstAxleSpread) ||
|
|
69
|
+
firstAxleSpread < 0 ||
|
|
70
|
+
!Number.isFinite(actualWeight)) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
for (let endAxleIndex = startAxleIndex + 1; endAxleIndex < axleConfiguration.length; endAxleIndex++) {
|
|
74
|
+
const endAxle = axleConfiguration[endAxleIndex];
|
|
75
|
+
const endAxleSpread = (_b = endAxle.axleSpread) !== null && _b !== void 0 ? _b : 0;
|
|
76
|
+
const interaxleSpacing = endAxle.interaxleSpacing;
|
|
77
|
+
const endAxleLegalWeight = legalWeightThresholds[endAxleIndex];
|
|
78
|
+
if (!Number.isFinite(interaxleSpacing) ||
|
|
79
|
+
interaxleSpacing <= 0 ||
|
|
80
|
+
!Number.isFinite(endAxleSpread) ||
|
|
81
|
+
endAxleSpread < 0 ||
|
|
82
|
+
!Number.isFinite(endAxle.axleUnitWeight)) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
groupSpread += interaxleSpacing + endAxleSpread;
|
|
86
|
+
actualWeight += endAxle.axleUnitWeight;
|
|
87
|
+
if (individualLegalWeightSum === undefined ||
|
|
88
|
+
endAxleLegalWeight === undefined) {
|
|
89
|
+
individualLegalWeightSum = undefined;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
individualLegalWeightSum += endAxleLegalWeight;
|
|
93
|
+
}
|
|
94
|
+
if (groupSpread > ctr717MaxSpreadCm) {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
const ctr717TableValue = (0, ctr_717_helper_1.getCtr717TableValue)(groupSpread);
|
|
98
|
+
const isTandemDriveSingleJeepException = startAxleIndex === 1 &&
|
|
99
|
+
endAxleIndex === 2 &&
|
|
100
|
+
vehicleConfiguration[0] === 'TRKTRAC' &&
|
|
101
|
+
vehicleConfiguration[1] === enum_1.AccessoryVehicleType.Jeep &&
|
|
102
|
+
axleUnitVehicleIndexes[1] === 0 &&
|
|
103
|
+
axleUnitVehicleIndexes[2] === 1 &&
|
|
104
|
+
axleConfiguration[1].numberOfAxles === 2 &&
|
|
105
|
+
axleConfiguration[2].numberOfAxles === 1;
|
|
106
|
+
if (ctr717TableValue === undefined ||
|
|
107
|
+
(!isTandemDriveSingleJeepException &&
|
|
108
|
+
individualLegalWeightSum === undefined)) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const thresholdWeight = getMaximumLegalAxleGroupWeightThreshold(individualLegalWeightSum !== null && individualLegalWeightSum !== void 0 ? individualLegalWeightSum : 0, ctr717TableValue, isTandemDriveSingleJeepException);
|
|
112
|
+
const passes = actualWeight <= thresholdWeight;
|
|
113
|
+
const startAxleUnit = startAxleIndex + 1;
|
|
114
|
+
const endAxleUnit = endAxleIndex + 1;
|
|
115
|
+
const overloadAmount = Math.max(0, actualWeight - thresholdWeight);
|
|
116
|
+
policyCheckResults.push({
|
|
117
|
+
id: policyId,
|
|
118
|
+
result: passes
|
|
119
|
+
? enum_1.PolicyCheckResultType.Pass
|
|
120
|
+
: enum_1.PolicyCheckResultType.Fail,
|
|
121
|
+
message: passes
|
|
122
|
+
? ''
|
|
123
|
+
: `Axle Group ${startAxleUnit} to ${endAxleUnit} exceeds the maximum legal weight threshold of ${thresholdWeight} kg by ${overloadAmount} kg.`,
|
|
124
|
+
startAxleUnit,
|
|
125
|
+
endAxleUnit,
|
|
126
|
+
actualWeight,
|
|
127
|
+
thresholdWeight,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return policyCheckResults;
|
|
132
|
+
}
|
|
18
133
|
function meetsMinimumSteerPercentageOfDriveAxleWeight(steerAxle, driveAxle, minimumPercentage) {
|
|
19
134
|
return (steerAxle.axleUnitWeight >= driveAxle.axleUnitWeight * minimumPercentage);
|
|
20
135
|
}
|
|
@@ -503,6 +618,7 @@ function CheckPickerTruckTractorWeightRestrictions(policy, vehicleConfiguration,
|
|
|
503
618
|
* @see PolicyCheck
|
|
504
619
|
* @see AxleGroupPolicyCheckResult
|
|
505
620
|
*/
|
|
621
|
+
// TODO this evaluation should only be applied to certain vehicle subtypes, await spec update
|
|
506
622
|
function CheckMinDriveAxleWeight(_policy, _vehicleConfiguration, axleConfiguration) {
|
|
507
623
|
const policyCheckResults = new Array();
|
|
508
624
|
const policyId = enum_1.PolicyCheckId.MinDriveAxleWeight;
|
|
@@ -535,6 +651,7 @@ function CheckMinDriveAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
|
|
|
535
651
|
id: policyId,
|
|
536
652
|
message: message,
|
|
537
653
|
result: result,
|
|
654
|
+
// TODO both start and end axle units should be the drive axle, is this always the second axle unit in the configuration? Or is it the last axle unit of the power unit configuration?
|
|
538
655
|
startAxleUnit: 1,
|
|
539
656
|
endAxleUnit: axleConfiguration.length,
|
|
540
657
|
});
|
|
@@ -790,54 +907,126 @@ function CheckBoosterAxleLimit(_policy, vehicleConfiguration, axleConfiguration)
|
|
|
790
907
|
return policyCheckResults;
|
|
791
908
|
}
|
|
792
909
|
/**
|
|
793
|
-
* Validates
|
|
794
|
-
*
|
|
795
|
-
* Wheelbase is derived from the spacing between axle units 1 and 2 plus half
|
|
796
|
-
* of axle unit 2 spread. Axle dimensions are stored in centimetres.
|
|
910
|
+
* Validates wheelbase legal limits for supported power unit vehicle sub-types.
|
|
797
911
|
*/
|
|
798
|
-
function
|
|
799
|
-
|
|
800
|
-
const powerUnitSubtype = vehicleConfiguration[0];
|
|
801
|
-
const steerAxle = axleConfiguration[0];
|
|
802
|
-
const driveAxle = axleConfiguration[1];
|
|
803
|
-
if (powerUnitSubtype !== 'TRKTRAC' ||
|
|
804
|
-
!steerAxle ||
|
|
805
|
-
!driveAxle ||
|
|
806
|
-
steerAxle.numberOfAxles !== 1 ||
|
|
807
|
-
driveAxle.numberOfAxles !== 2 ||
|
|
808
|
-
driveAxle.interaxleSpacing === undefined ||
|
|
809
|
-
driveAxle.axleSpread === undefined) {
|
|
810
|
-
return [];
|
|
811
|
-
}
|
|
812
|
-
const wheelbase = driveAxle.interaxleSpacing + driveAxle.axleSpread / 2;
|
|
912
|
+
function CheckWheelbaseLegalLimits(policy, vehicleConfiguration, axleConfiguration) {
|
|
913
|
+
var _a, _b, _c;
|
|
813
914
|
const resultBase = {
|
|
814
|
-
id:
|
|
915
|
+
id: enum_1.PolicyCheckId.WheelbaseLegalLimits,
|
|
815
916
|
startAxleUnit: 1,
|
|
816
917
|
endAxleUnit: 2,
|
|
817
918
|
};
|
|
818
|
-
|
|
919
|
+
const powerUnitSubtype = vehicleConfiguration[0];
|
|
920
|
+
const steerAxle = Object.assign(Object.assign({}, axleConfiguration[0]), { axleSpread: (_a = axleConfiguration[0].axleSpread) !== null && _a !== void 0 ? _a : 0 });
|
|
921
|
+
const driveAxle = Object.assign(Object.assign({}, axleConfiguration[1]), { axleSpread: (_b = axleConfiguration[1].axleSpread) !== null && _b !== void 0 ? _b : 0, interaxleSpacing: (_c = axleConfiguration[1].interaxleSpacing) !== null && _c !== void 0 ? _c : 0 });
|
|
922
|
+
// TODO we need to add Truck with PME and Truck Tractor with PME when ready
|
|
923
|
+
const isSupportedVehicleSubtype = (value) => {
|
|
924
|
+
return (value === 'REGTRCK' ||
|
|
925
|
+
value === 'TRKTRAC' ||
|
|
926
|
+
value === 'PICKRTT' ||
|
|
927
|
+
value === 'OGBEDTK');
|
|
928
|
+
};
|
|
929
|
+
const isSingleSteer = steerAxle.numberOfAxles === 1;
|
|
930
|
+
const isTandemSteer = steerAxle.numberOfAxles === 2;
|
|
931
|
+
const isTandemDrive = driveAxle.numberOfAxles === 2;
|
|
932
|
+
const isTridemDrive = driveAxle.numberOfAxles === 3;
|
|
933
|
+
const isTruckTractor = powerUnitSubtype === 'TRKTRAC';
|
|
934
|
+
const isPickerTruckTractor = powerUnitSubtype === 'PICKRTT';
|
|
935
|
+
const isOilfieldBedTruck = powerUnitSubtype === 'OGBEDTK';
|
|
936
|
+
const wheelbase = isSingleSteer
|
|
937
|
+
? driveAxle.interaxleSpacing + driveAxle.axleSpread / 2
|
|
938
|
+
: steerAxle.axleSpread / 2 +
|
|
939
|
+
driveAxle.interaxleSpacing +
|
|
940
|
+
driveAxle.axleSpread / 2;
|
|
941
|
+
// the following logic covers the ASW 6.2 to 7.2m feature, we are grouping it with CheckWheelBaseLegalLimits because of feature overlap
|
|
942
|
+
if ((isTruckTractor || isPickerTruckTractor) &&
|
|
943
|
+
isSingleSteer &&
|
|
944
|
+
isTandemDrive &&
|
|
945
|
+
wheelbase > 620) {
|
|
946
|
+
if (wheelbase > 720) {
|
|
947
|
+
return [
|
|
948
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 and Axle Unit 2 is greater than 7.2m.' }),
|
|
949
|
+
];
|
|
950
|
+
}
|
|
951
|
+
if (wheelbase >= 620) {
|
|
952
|
+
const hasDisallowedTrailer = vehicleConfiguration.slice(1).some((v) => {
|
|
953
|
+
const trailer = policy.getTrailerDefinition(v);
|
|
954
|
+
const isSemiTrailer = (trailer === null || trailer === void 0 ? void 0 : trailer.id) === 'SEMITRL';
|
|
955
|
+
return !isSemiTrailer;
|
|
956
|
+
});
|
|
957
|
+
const hasTrailer = vehicleConfiguration.length > 1;
|
|
958
|
+
return [
|
|
959
|
+
Object.assign(Object.assign({}, resultBase), { result: hasDisallowedTrailer
|
|
960
|
+
? enum_1.PolicyCheckResultType.Fail
|
|
961
|
+
: enum_1.PolicyCheckResultType.Warning, message: hasTrailer && !hasDisallowedTrailer
|
|
962
|
+
? 'Wheelbase for Axle Unit X and Axle Unit Y is between 6.2m and 7.2m. Semi-Trailer wheelbase must be within dimensions table found in CTPM 5.3.7.A.'
|
|
963
|
+
: 'Wheelbase for Axle Unit 1 and Axle Unit 2 is between 6.2m and 7.2m. See CTPM 5.3.7.A.' }),
|
|
964
|
+
];
|
|
965
|
+
}
|
|
819
966
|
return [
|
|
820
|
-
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.
|
|
967
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
|
|
821
968
|
];
|
|
822
969
|
}
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
970
|
+
if (isSupportedVehicleSubtype(powerUnitSubtype)) {
|
|
971
|
+
if (isSingleSteer && isTridemDrive) {
|
|
972
|
+
// TODO we need to add Truck with PME and Truck Tractor with PME when ready
|
|
973
|
+
if (isTruckTractor || isPickerTruckTractor) {
|
|
974
|
+
if (wheelbase < 660) {
|
|
975
|
+
return [
|
|
976
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 6.6 m.' }),
|
|
977
|
+
];
|
|
978
|
+
}
|
|
979
|
+
if (wheelbase > 680) {
|
|
980
|
+
return [
|
|
981
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is greater than 6.8 m.' }),
|
|
982
|
+
];
|
|
983
|
+
}
|
|
828
984
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
985
|
+
else {
|
|
986
|
+
if (wheelbase < 660) {
|
|
987
|
+
return [
|
|
988
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 6.6 m.' }),
|
|
989
|
+
];
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
if (isTandemSteer && isTridemDrive) {
|
|
994
|
+
if (wheelbase < 770) {
|
|
995
|
+
if (isOilfieldBedTruck) {
|
|
996
|
+
if (driveAxle.axleSpread >= 280 &&
|
|
997
|
+
driveAxle.axleSpread < 300 &&
|
|
998
|
+
wheelbase < 780) {
|
|
999
|
+
return [
|
|
1000
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 7.8 m.' }),
|
|
1001
|
+
];
|
|
1002
|
+
}
|
|
1003
|
+
if (driveAxle.axleSpread >= 300 &&
|
|
1004
|
+
driveAxle.axleSpread <= 310 &&
|
|
1005
|
+
wheelbase < 790) {
|
|
1006
|
+
return [
|
|
1007
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 7.9 m.' }),
|
|
1008
|
+
];
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
if (!isOilfieldBedTruck &&
|
|
1012
|
+
driveAxle.axleSpread >= 240 &&
|
|
1013
|
+
driveAxle.axleSpread < 280) {
|
|
1014
|
+
return [
|
|
1015
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 7.7 m.' }),
|
|
1016
|
+
];
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
if (isOilfieldBedTruck && wheelbase > 1000) {
|
|
1020
|
+
return [
|
|
1021
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is greater than 10.0 m.' }),
|
|
1022
|
+
];
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
832
1025
|
return [
|
|
833
|
-
Object.assign(Object.assign({}, resultBase), { result:
|
|
834
|
-
? enum_1.PolicyCheckResultType.Fail
|
|
835
|
-
: enum_1.PolicyCheckResultType.Pass, message: 'Wheelbase for Axle Unit 1 and Axle Unit 2 is between 6.2m and 7.2m. See CTPM 5.3.7.A.' }),
|
|
1026
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
|
|
836
1027
|
];
|
|
837
1028
|
}
|
|
838
|
-
return [
|
|
839
|
-
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
|
|
840
|
-
];
|
|
1029
|
+
return [];
|
|
841
1030
|
}
|
|
842
1031
|
/**
|
|
843
1032
|
* Validates that the drive axle unit and first jeep axle unit are load equalized
|
|
@@ -895,6 +1084,7 @@ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfi
|
|
|
895
1084
|
* this map with additional entries.
|
|
896
1085
|
*
|
|
897
1086
|
* Currently includes:
|
|
1087
|
+
* - AxleGroupMaximumLegalWeightThreshold: Validates axle groups within 8 m against CTR 7.17
|
|
898
1088
|
* - BridgeFormula: Validates axle groups against bridge formula requirements
|
|
899
1089
|
* - CheckPermittableWeight: Validates total vehicle weight against permit limits
|
|
900
1090
|
* - MaxTireLoad: Validates tire load capacity for each axle unit
|
|
@@ -905,7 +1095,8 @@ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfi
|
|
|
905
1095
|
* - NumberOfAxles: Validates axle count per axle unit
|
|
906
1096
|
* - NumberOfWheelsPerAxle: Validates tire count per axle unit
|
|
907
1097
|
* - BoosterAxleLimit: Validates booster axle count against the preceding trailer
|
|
908
|
-
* -
|
|
1098
|
+
* - TruckTractorWheelbaseLegalLimits: Validates derived wheelbase for single steer, tandem drive truck tractors
|
|
1099
|
+
* - WheelbaseLegalLimits: Validates wheelbase against legal limits
|
|
909
1100
|
* - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
|
|
910
1101
|
*
|
|
911
1102
|
* @see PolicyCheck
|
|
@@ -915,6 +1106,10 @@ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfi
|
|
|
915
1106
|
exports.policyCheckMap = new Map([
|
|
916
1107
|
[enum_1.PolicyCheckId.NumberOfAxles, CheckNumberOfAxles],
|
|
917
1108
|
[enum_1.PolicyCheckId.BridgeFormula, CheckBridgeFormula],
|
|
1109
|
+
[
|
|
1110
|
+
enum_1.PolicyCheckId.AxleGroupMaximumLegalWeightThreshold,
|
|
1111
|
+
CheckAxleGroupMaximumLegalWeightThreshold,
|
|
1112
|
+
],
|
|
918
1113
|
[enum_1.PolicyCheckId.CheckPermittableWeight, CheckPermittableWeight],
|
|
919
1114
|
[enum_1.PolicyCheckId.MaxTireLoad, CheckMaxTireLoad],
|
|
920
1115
|
[enum_1.PolicyCheckId.MinDriveAxleWeight, CheckMinDriveAxleWeight],
|
|
@@ -926,6 +1121,6 @@ exports.policyCheckMap = new Map([
|
|
|
926
1121
|
],
|
|
927
1122
|
[enum_1.PolicyCheckId.NumberOfWheelsPerAxle, CheckNumTiresPerAxle],
|
|
928
1123
|
[enum_1.PolicyCheckId.BoosterAxleLimit, CheckBoosterAxleLimit],
|
|
929
|
-
[enum_1.PolicyCheckId.TruckTractorWheelbase, CheckTruckTractorWheelbase],
|
|
930
1124
|
[enum_1.PolicyCheckId.DriveJeepLoadEqualization, CheckDriveJeepLoadEqualization],
|
|
1125
|
+
[enum_1.PolicyCheckId.WheelbaseLegalLimits, CheckWheelbaseLegalLimits],
|
|
931
1126
|
]);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
1
|
+
export declare const version = "v2.20.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED