onroute-policy-engine 2.22.1 → 2.23.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.
|
@@ -7,6 +7,7 @@ export declare enum PolicyCheckId {
|
|
|
7
7
|
AxleGroupMaximumLegalWeightThreshold = "axle-group-maximum-legal-weight-threshold",
|
|
8
8
|
BoosterAxleLimit = "booster-axle-limit",
|
|
9
9
|
BridgeFormula = "bridge-formula",
|
|
10
|
+
CheckLegalWeight = "check-legal-weight",
|
|
10
11
|
CheckPermittableWeight = "check-permittable-weight",
|
|
11
12
|
DriveJeepLoadEqualization = "drive-jeep-load-equalization",
|
|
12
13
|
MaxTireLoad = "max-tire-load",
|
|
@@ -12,6 +12,7 @@ var PolicyCheckId;
|
|
|
12
12
|
PolicyCheckId["AxleGroupMaximumLegalWeightThreshold"] = "axle-group-maximum-legal-weight-threshold";
|
|
13
13
|
PolicyCheckId["BoosterAxleLimit"] = "booster-axle-limit";
|
|
14
14
|
PolicyCheckId["BridgeFormula"] = "bridge-formula";
|
|
15
|
+
PolicyCheckId["CheckLegalWeight"] = "check-legal-weight";
|
|
15
16
|
PolicyCheckId["CheckPermittableWeight"] = "check-permittable-weight";
|
|
16
17
|
PolicyCheckId["DriveJeepLoadEqualization"] = "drive-jeep-load-equalization";
|
|
17
18
|
PolicyCheckId["MaxTireLoad"] = "max-tire-load";
|
|
@@ -16,6 +16,14 @@ import { Policy } from 'onroute-policy-engine';
|
|
|
16
16
|
type PolicyCheck = (policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>) => Array<PolicyCheckResult>;
|
|
17
17
|
/** Applies the standard lower-of rule or the exact 7.16(g) exception. */
|
|
18
18
|
export declare function getMaximumLegalAxleGroupWeightThreshold(individualLegalWeightSum: number, ctr717TableValue: number, isTandemDriveSingleJeepException: boolean): number;
|
|
19
|
+
/**
|
|
20
|
+
* Validates each axle unit against its legal weight maximum.
|
|
21
|
+
*
|
|
22
|
+
* The feature-defined steering and drive limits are authoritative for the
|
|
23
|
+
* standard truck/truck-tractor and PME subtypes. Other axle units retain
|
|
24
|
+
* their configured legal weight lookup.
|
|
25
|
+
*/
|
|
26
|
+
export declare function CheckLegalWeight(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
19
27
|
/**
|
|
20
28
|
* Validates every contiguous axle-unit group within 8 m, excluding groups
|
|
21
29
|
* beginning at axle unit 1, against the CTR 7.17 maximum legal weight.
|
|
@@ -301,6 +309,7 @@ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleC
|
|
|
301
309
|
* Currently includes:
|
|
302
310
|
* - AxleGroupMaximumLegalWeightThreshold: Validates axle groups within 8 m against CTR 7.17
|
|
303
311
|
* - BridgeFormula: Validates axle groups against bridge formula requirements
|
|
312
|
+
* - CheckLegalWeight: Validates axle units against legal weight limits
|
|
304
313
|
* - CheckPermittableWeight: Validates total vehicle weight against permit limits
|
|
305
314
|
* - MaxTireLoad: Validates tire load capacity for each axle unit
|
|
306
315
|
* - MinDriveAxleWeight: Validates minimum weight requirements for drive axles
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.policyCheckMap = void 0;
|
|
4
4
|
exports.getMaximumLegalAxleGroupWeightThreshold = getMaximumLegalAxleGroupWeightThreshold;
|
|
5
|
+
exports.CheckLegalWeight = CheckLegalWeight;
|
|
5
6
|
exports.CheckAxleGroupMaximumLegalWeightThreshold = CheckAxleGroupMaximumLegalWeightThreshold;
|
|
6
7
|
exports.CheckNumberOfAxles = CheckNumberOfAxles;
|
|
7
8
|
exports.CheckBridgeFormula = CheckBridgeFormula;
|
|
@@ -18,6 +19,27 @@ exports.CheckDriveJeepLoadEqualization = CheckDriveJeepLoadEqualization;
|
|
|
18
19
|
const dimensions_helper_1 = require("./dimensions.helper");
|
|
19
20
|
const ctr_717_helper_1 = require("./ctr-717.helper");
|
|
20
21
|
const enum_1 = require("../enum");
|
|
22
|
+
const POWER_UNIT_AXLE_CODE_MULTIPLIER = 10;
|
|
23
|
+
const LEGAL_WEIGHT_MAXIMUM_KG = {
|
|
24
|
+
SINGLE_AXLE: 9100,
|
|
25
|
+
STANDARD_TRUCK_TRACTOR_STEER: 6000,
|
|
26
|
+
STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE: 7300,
|
|
27
|
+
TANDEM_AXLE: 17000,
|
|
28
|
+
STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE: 13600,
|
|
29
|
+
PME_TANDEM_STEER_WITH_TRIDEM_DRIVE: 15200,
|
|
30
|
+
TRIDEM_AXLE: 24000,
|
|
31
|
+
};
|
|
32
|
+
const PERMITTABLE_WEIGHT_MAXIMUM_KG = {
|
|
33
|
+
SINGLE_STEER: 9100,
|
|
34
|
+
SINGLE_NON_STEER: 11000,
|
|
35
|
+
TANDEM: 23000,
|
|
36
|
+
STANDARD_TRIDEM: 28000,
|
|
37
|
+
QUALIFYING_TRIDEM: 29000,
|
|
38
|
+
};
|
|
39
|
+
const QUALIFYING_TRIDEM_SPREAD_CM = {
|
|
40
|
+
MINIMUM: 240,
|
|
41
|
+
MAXIMUM: 370,
|
|
42
|
+
};
|
|
21
43
|
/** Applies the standard lower-of rule or the exact 7.16(g) exception. */
|
|
22
44
|
function getMaximumLegalAxleGroupWeightThreshold(individualLegalWeightSum, ctr717TableValue, isTandemDriveSingleJeepException) {
|
|
23
45
|
const tandemDriveSingleJeepMinimumKg = 24000;
|
|
@@ -34,7 +56,7 @@ function getApplicableLegalWeightThreshold(policy, vehicleConfiguration, axleCon
|
|
|
34
56
|
return undefined;
|
|
35
57
|
}
|
|
36
58
|
const weights = vehicleIndex === 0
|
|
37
|
-
? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles *
|
|
59
|
+
? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * POWER_UNIT_AXLE_CODE_MULTIPLIER +
|
|
38
60
|
axleConfiguration[1].numberOfAxles)
|
|
39
61
|
: policy.getDefaultTrailerWeight(vehicleType, axle.numberOfAxles);
|
|
40
62
|
if (weights.length === 0) {
|
|
@@ -42,6 +64,98 @@ function getApplicableLegalWeightThreshold(policy, vehicleConfiguration, axleCon
|
|
|
42
64
|
}
|
|
43
65
|
return (_a = policy.selectCorrectWeightDimension(weights, vehicleConfiguration, axleConfiguration, axleIndex)) === null || _a === void 0 ? void 0 : _a.legal;
|
|
44
66
|
}
|
|
67
|
+
function getAxleUnitVehicleIndexLookup(policy, vehicleConfiguration, axleConfiguration) {
|
|
68
|
+
return axleConfiguration.some((axleUnit) => axleUnit.vehicleIndex !== undefined)
|
|
69
|
+
? (0, dimensions_helper_1.getAxleUnitVehicleIndexes)(policy, vehicleConfiguration, axleConfiguration)
|
|
70
|
+
: axleConfiguration.map((_, axleIndex) => axleIndex < 2 ? 0 : axleIndex - 1);
|
|
71
|
+
}
|
|
72
|
+
function getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex, threshold) {
|
|
73
|
+
var _a;
|
|
74
|
+
var _b;
|
|
75
|
+
const vehicleIndex = axleUnitVehicleIndexes[axleIndex];
|
|
76
|
+
const vehicleType = vehicleConfiguration[vehicleIndex];
|
|
77
|
+
const axleUnit = axleConfiguration[axleIndex];
|
|
78
|
+
if (!vehicleType || !axleUnit) {
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
const weights = vehicleIndex === 0
|
|
82
|
+
? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * POWER_UNIT_AXLE_CODE_MULTIPLIER +
|
|
83
|
+
axleConfiguration[1].numberOfAxles)
|
|
84
|
+
: policy.getDefaultTrailerWeight(vehicleType, axleUnit.numberOfAxles);
|
|
85
|
+
if (weights.length === 0) {
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
return ((_b = (_a = policy.selectCorrectWeightDimension(weights, vehicleConfiguration, axleConfiguration, axleIndex)) === null || _a === void 0 ? void 0 : _a[threshold]) !== null && _b !== void 0 ? _b : 0);
|
|
89
|
+
}
|
|
90
|
+
function isFeatureLegalWeightPowerUnit(vehicleType) {
|
|
91
|
+
return (vehicleType === 'REGTRCK' ||
|
|
92
|
+
vehicleType === 'TRKTRAC' ||
|
|
93
|
+
vehicleType === 'TRCKPME' ||
|
|
94
|
+
vehicleType === 'TRACPME');
|
|
95
|
+
}
|
|
96
|
+
function getFeatureLegalPowerUnitWeightThreshold(vehicleType, axleConfiguration, axleIndex) {
|
|
97
|
+
const steerAxle = axleConfiguration[0];
|
|
98
|
+
const driveAxle = axleConfiguration[1];
|
|
99
|
+
const hasPme = vehicleType === 'TRCKPME' || vehicleType === 'TRACPME';
|
|
100
|
+
if (axleIndex === 0) {
|
|
101
|
+
if (steerAxle.numberOfAxles === 1 &&
|
|
102
|
+
(driveAxle.numberOfAxles === 1 || driveAxle.numberOfAxles === 2)) {
|
|
103
|
+
return hasPme || vehicleType === 'REGTRCK'
|
|
104
|
+
? LEGAL_WEIGHT_MAXIMUM_KG.SINGLE_AXLE
|
|
105
|
+
: LEGAL_WEIGHT_MAXIMUM_KG.STANDARD_TRUCK_TRACTOR_STEER;
|
|
106
|
+
}
|
|
107
|
+
if (steerAxle.numberOfAxles === 1 && driveAxle.numberOfAxles === 3) {
|
|
108
|
+
return hasPme
|
|
109
|
+
? LEGAL_WEIGHT_MAXIMUM_KG.SINGLE_AXLE
|
|
110
|
+
: LEGAL_WEIGHT_MAXIMUM_KG.STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE;
|
|
111
|
+
}
|
|
112
|
+
if (steerAxle.numberOfAxles === 2 && driveAxle.numberOfAxles === 2) {
|
|
113
|
+
return LEGAL_WEIGHT_MAXIMUM_KG.TANDEM_AXLE;
|
|
114
|
+
}
|
|
115
|
+
if (steerAxle.numberOfAxles === 2 && driveAxle.numberOfAxles === 3) {
|
|
116
|
+
return hasPme
|
|
117
|
+
? LEGAL_WEIGHT_MAXIMUM_KG.PME_TANDEM_STEER_WITH_TRIDEM_DRIVE
|
|
118
|
+
: LEGAL_WEIGHT_MAXIMUM_KG.STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (axleIndex === 1) {
|
|
122
|
+
return {
|
|
123
|
+
1: LEGAL_WEIGHT_MAXIMUM_KG.SINGLE_AXLE,
|
|
124
|
+
2: LEGAL_WEIGHT_MAXIMUM_KG.TANDEM_AXLE,
|
|
125
|
+
3: LEGAL_WEIGHT_MAXIMUM_KG.TRIDEM_AXLE,
|
|
126
|
+
}[driveAxle.numberOfAxles];
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Validates each axle unit against its legal weight maximum.
|
|
132
|
+
*
|
|
133
|
+
* The feature-defined steering and drive limits are authoritative for the
|
|
134
|
+
* standard truck/truck-tractor and PME subtypes. Other axle units retain
|
|
135
|
+
* their configured legal weight lookup.
|
|
136
|
+
*/
|
|
137
|
+
function CheckLegalWeight(policy, vehicleConfiguration, axleConfiguration) {
|
|
138
|
+
const policyId = enum_1.PolicyCheckId.CheckLegalWeight;
|
|
139
|
+
const powerUnitType = vehicleConfiguration[0];
|
|
140
|
+
const axleUnitVehicleIndexes = getAxleUnitVehicleIndexLookup(policy, vehicleConfiguration, axleConfiguration);
|
|
141
|
+
return axleConfiguration.map((axleUnit, axleIndex) => {
|
|
142
|
+
const featureThreshold = axleUnitVehicleIndexes[axleIndex] === 0 &&
|
|
143
|
+
isFeatureLegalWeightPowerUnit(powerUnitType)
|
|
144
|
+
? getFeatureLegalPowerUnitWeightThreshold(powerUnitType, axleConfiguration, axleIndex)
|
|
145
|
+
: undefined;
|
|
146
|
+
const legalWeight = featureThreshold !== null && featureThreshold !== void 0 ? featureThreshold : getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex, 'legal');
|
|
147
|
+
const result = axleUnit.axleUnitWeight <= legalWeight;
|
|
148
|
+
const axleUnitNumber = axleIndex + 1;
|
|
149
|
+
return {
|
|
150
|
+
id: policyId,
|
|
151
|
+
message: `Weight for axle unit ${axleUnitNumber} ${result ? 'is legal' : `must not exceed ${legalWeight} kgs`}`,
|
|
152
|
+
result: result ? enum_1.PolicyCheckResultType.Pass : enum_1.PolicyCheckResultType.Fail,
|
|
153
|
+
axleUnit: axleUnitNumber,
|
|
154
|
+
actualWeight: axleUnit.axleUnitWeight,
|
|
155
|
+
thresholdWeight: legalWeight,
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}
|
|
45
159
|
/**
|
|
46
160
|
* Validates every contiguous axle-unit group within 8 m, excluding groups
|
|
47
161
|
* beginning at axle unit 1, against the CTR 7.17 maximum legal weight.
|
|
@@ -172,6 +286,37 @@ function CheckNumberOfAxles(_policy, _vehicleConfiguration, axleConfiguration) {
|
|
|
172
286
|
});
|
|
173
287
|
return policyCheckResults;
|
|
174
288
|
}
|
|
289
|
+
function getBridgeFormulaInputFailure(axleConfiguration) {
|
|
290
|
+
for (let axleIndex = 0; axleIndex < axleConfiguration.length; axleIndex++) {
|
|
291
|
+
const axleUnit = axleConfiguration[axleIndex];
|
|
292
|
+
const axleUnitNumber = axleIndex + 1;
|
|
293
|
+
let message;
|
|
294
|
+
if (!Number.isFinite(axleUnit.axleUnitWeight) ||
|
|
295
|
+
axleUnit.axleUnitWeight <= 0) {
|
|
296
|
+
message = `Axle unit weight for axle unit ${axleUnitNumber} must be a finite number greater than 0.`;
|
|
297
|
+
}
|
|
298
|
+
else if (axleUnit.numberOfAxles > 1 &&
|
|
299
|
+
(!Number.isFinite(axleUnit.axleSpread) ||
|
|
300
|
+
axleUnit.axleSpread <= 0)) {
|
|
301
|
+
message = `Axle spread for axle unit ${axleUnitNumber} must be a finite number greater than 0 when the unit has multiple axles.`;
|
|
302
|
+
}
|
|
303
|
+
else if (axleIndex > 0 &&
|
|
304
|
+
(!Number.isFinite(axleUnit.interaxleSpacing) ||
|
|
305
|
+
axleUnit.interaxleSpacing <= 0)) {
|
|
306
|
+
message = `Axle spacing before axle unit ${axleUnitNumber} must be a finite number greater than 0.`;
|
|
307
|
+
}
|
|
308
|
+
if (message) {
|
|
309
|
+
return {
|
|
310
|
+
id: enum_1.PolicyCheckId.BridgeFormula,
|
|
311
|
+
message,
|
|
312
|
+
result: enum_1.PolicyCheckResultType.Fail,
|
|
313
|
+
startAxleUnit: axleUnitNumber,
|
|
314
|
+
endAxleUnit: axleUnitNumber,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return undefined;
|
|
319
|
+
}
|
|
175
320
|
/**
|
|
176
321
|
* Performs bridge formula calculations on axle groups and returns policy check results.
|
|
177
322
|
*
|
|
@@ -201,6 +346,10 @@ function CheckNumberOfAxles(_policy, _vehicleConfiguration, axleConfiguration) {
|
|
|
201
346
|
function CheckBridgeFormula(policy, _vehicleConfiguration, axleConfiguration) {
|
|
202
347
|
const policyCheckResults = new Array();
|
|
203
348
|
const policyId = enum_1.PolicyCheckId.BridgeFormula;
|
|
349
|
+
const inputFailure = getBridgeFormulaInputFailure(axleConfiguration);
|
|
350
|
+
if (inputFailure) {
|
|
351
|
+
return [inputFailure];
|
|
352
|
+
}
|
|
204
353
|
const bridgeCalcResults = policy.calculateBridge(axleConfiguration);
|
|
205
354
|
bridgeCalcResults.forEach((br) => {
|
|
206
355
|
const message = `Axle group ${br.startAxleUnit} to ${br.endAxleUnit} ${br.success ? 'passes' : 'does not pass'} bridge formula.`;
|
|
@@ -338,77 +487,51 @@ function CheckNumTiresPerAxle(_policy, _vehicleConfiguration, axleConfiguration)
|
|
|
338
487
|
* @see SingleAxleDimension
|
|
339
488
|
*/
|
|
340
489
|
function CheckPermittableWeight(policy, vehicleConfiguration, axleConfiguration) {
|
|
341
|
-
const policyCheckResults = new Array();
|
|
342
490
|
const policyId = enum_1.PolicyCheckId.CheckPermittableWeight;
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
singleAxleDimensions.push(steerAxleDimension);
|
|
356
|
-
const driveAxleDimension = policy.selectCorrectWeightDimension(weight, vehicleConfiguration, axleConfiguration, 1) || {};
|
|
357
|
-
singleAxleDimensions.push(driveAxleDimension);
|
|
491
|
+
const axleUnitVehicleIndexes = getAxleUnitVehicleIndexLookup(policy, vehicleConfiguration, axleConfiguration);
|
|
492
|
+
return axleConfiguration.map((axleUnit, axleIndex) => {
|
|
493
|
+
const vehicleIndex = axleUnitVehicleIndexes[axleIndex];
|
|
494
|
+
const isSingleSteer = axleIndex === 0 && vehicleIndex === 0 && axleUnit.numberOfAxles === 1;
|
|
495
|
+
const isTandemSteer = axleIndex === 0 && vehicleIndex === 0 && axleUnit.numberOfAxles === 2;
|
|
496
|
+
let permittableWeight;
|
|
497
|
+
if (isSingleSteer) {
|
|
498
|
+
permittableWeight = PERMITTABLE_WEIGHT_MAXIMUM_KG.SINGLE_STEER;
|
|
499
|
+
}
|
|
500
|
+
else if (!isTandemSteer) {
|
|
501
|
+
if (axleUnit.numberOfAxles === 1) {
|
|
502
|
+
permittableWeight = PERMITTABLE_WEIGHT_MAXIMUM_KG.SINGLE_NON_STEER;
|
|
358
503
|
}
|
|
359
|
-
else if (
|
|
360
|
-
|
|
361
|
-
const trailerDimension = policy.selectCorrectWeightDimension(weight, vehicleConfiguration, axleConfiguration, i + 1) || {};
|
|
362
|
-
singleAxleDimensions.push(trailerDimension);
|
|
504
|
+
else if (axleUnit.numberOfAxles === 2) {
|
|
505
|
+
permittableWeight = PERMITTABLE_WEIGHT_MAXIMUM_KG.TANDEM;
|
|
363
506
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
// Explicit multi-axle ownership path supplied by the consuming application.
|
|
385
|
-
// This is the new way, using { vehicleIndex: num }
|
|
386
|
-
const axleUnitVehicleIndexes = (0, dimensions_helper_1.getAxleUnitVehicleIndexes)(policy, vehicleConfiguration, axleConfiguration);
|
|
387
|
-
axleConfiguration.forEach((ac, i) => {
|
|
388
|
-
const vehicleIndex = axleUnitVehicleIndexes[i];
|
|
389
|
-
const vehicleType = vehicleConfiguration[vehicleIndex];
|
|
390
|
-
const weight = vehicleIndex === 0
|
|
391
|
-
? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * 10 +
|
|
392
|
-
axleConfiguration[1].numberOfAxles)
|
|
393
|
-
: policy.getDefaultTrailerWeight(vehicleType, ac.numberOfAxles);
|
|
394
|
-
const axleDimension = weight.length > 0
|
|
395
|
-
? policy.selectCorrectWeightDimension(weight, vehicleConfiguration, axleConfiguration, i) || {}
|
|
396
|
-
: {};
|
|
397
|
-
const actualWeight = ac.axleUnitWeight;
|
|
398
|
-
const permittableWeight = axleDimension.permittable || 0;
|
|
399
|
-
const result = actualWeight <= permittableWeight;
|
|
400
|
-
const axleUnit = i + 1;
|
|
401
|
-
const message = `Weight for axle unit ${axleUnit} ${result ? 'is permittable' : `must not exceed ${permittableWeight} kgs`}`;
|
|
402
|
-
policyCheckResults.push({
|
|
507
|
+
else if (axleUnit.numberOfAxles === 3) {
|
|
508
|
+
const spreadQualifies = axleUnit.axleSpread !== undefined &&
|
|
509
|
+
axleUnit.axleSpread >= QUALIFYING_TRIDEM_SPREAD_CM.MINIMUM &&
|
|
510
|
+
axleUnit.axleSpread <= QUALIFYING_TRIDEM_SPREAD_CM.MAXIMUM;
|
|
511
|
+
const nextVehicleIndex = vehicleIndex + 1;
|
|
512
|
+
const hasImmediatelyFollowingBooster = vehicleConfiguration[nextVehicleIndex] ===
|
|
513
|
+
enum_1.AccessoryVehicleType.Booster;
|
|
514
|
+
const boosterAxle = axleConfiguration.find((_, candidateIndex) => candidateIndex > axleIndex &&
|
|
515
|
+
axleUnitVehicleIndexes[candidateIndex] === nextVehicleIndex);
|
|
516
|
+
const boosterQualifies = !hasImmediatelyFollowingBooster || (boosterAxle === null || boosterAxle === void 0 ? void 0 : boosterAxle.numberOfAxles) === 1;
|
|
517
|
+
permittableWeight =
|
|
518
|
+
spreadQualifies && boosterQualifies
|
|
519
|
+
? PERMITTABLE_WEIGHT_MAXIMUM_KG.QUALIFYING_TRIDEM
|
|
520
|
+
: PERMITTABLE_WEIGHT_MAXIMUM_KG.STANDARD_TRIDEM;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
permittableWeight !== null && permittableWeight !== void 0 ? permittableWeight : (permittableWeight = getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex, 'permittable'));
|
|
524
|
+
const result = axleUnit.axleUnitWeight <= permittableWeight;
|
|
525
|
+
const axleUnitNumber = axleIndex + 1;
|
|
526
|
+
return {
|
|
403
527
|
id: policyId,
|
|
404
|
-
message:
|
|
528
|
+
message: `Weight for axle unit ${axleUnitNumber} ${result ? 'is permittable' : `must not exceed ${permittableWeight} kgs`}`,
|
|
405
529
|
result: result ? enum_1.PolicyCheckResultType.Pass : enum_1.PolicyCheckResultType.Fail,
|
|
406
|
-
axleUnit:
|
|
407
|
-
actualWeight:
|
|
530
|
+
axleUnit: axleUnitNumber,
|
|
531
|
+
actualWeight: axleUnit.axleUnitWeight,
|
|
408
532
|
thresholdWeight: permittableWeight,
|
|
409
|
-
}
|
|
533
|
+
};
|
|
410
534
|
});
|
|
411
|
-
return policyCheckResults;
|
|
412
535
|
}
|
|
413
536
|
/**
|
|
414
537
|
* Validates minimum steer axle weight requirements for single steer, tridem drive power units.
|
|
@@ -1092,6 +1215,7 @@ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfi
|
|
|
1092
1215
|
* Currently includes:
|
|
1093
1216
|
* - AxleGroupMaximumLegalWeightThreshold: Validates axle groups within 8 m against CTR 7.17
|
|
1094
1217
|
* - BridgeFormula: Validates axle groups against bridge formula requirements
|
|
1218
|
+
* - CheckLegalWeight: Validates axle units against legal weight limits
|
|
1095
1219
|
* - CheckPermittableWeight: Validates total vehicle weight against permit limits
|
|
1096
1220
|
* - MaxTireLoad: Validates tire load capacity for each axle unit
|
|
1097
1221
|
* - MinDriveAxleWeight: Validates minimum weight requirements for drive axles
|
|
@@ -1116,6 +1240,7 @@ exports.policyCheckMap = new Map([
|
|
|
1116
1240
|
enum_1.PolicyCheckId.AxleGroupMaximumLegalWeightThreshold,
|
|
1117
1241
|
CheckAxleGroupMaximumLegalWeightThreshold,
|
|
1118
1242
|
],
|
|
1243
|
+
[enum_1.PolicyCheckId.CheckLegalWeight, CheckLegalWeight],
|
|
1119
1244
|
[enum_1.PolicyCheckId.CheckPermittableWeight, CheckPermittableWeight],
|
|
1120
1245
|
[enum_1.PolicyCheckId.MaxTireLoad, CheckMaxTireLoad],
|
|
1121
1246
|
[enum_1.PolicyCheckId.MinDriveAxleWeight, CheckMinDriveAxleWeight],
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
1
|
+
export declare const version = "v2.23.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED