onroute-policy-engine 2.14.0 → 2.16.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.
|
@@ -10,7 +10,9 @@ export declare enum PolicyCheckId {
|
|
|
10
10
|
MaxTireLoad = "max-tire-load",
|
|
11
11
|
MinDriveAxleWeight = "minimum-drive-axle-weight",
|
|
12
12
|
MinSteerAxleWeight = "minimum-steer-axle-weight",
|
|
13
|
+
MinTandemSteerAxleWeight = "minimum-tandem-steer-axle-weight",
|
|
13
14
|
NumberOfAxles = "number-of-axles",
|
|
14
15
|
NumberOfWheelsPerAxle = "number-of-wheels",
|
|
16
|
+
PickerTruckTractorWeightRestrictions = "picker-truck-tractor-weight-restrictions",
|
|
15
17
|
TruckTractorWheelbase = "truck-tractor-wheelbase"
|
|
16
18
|
}
|
|
@@ -15,7 +15,9 @@ var PolicyCheckId;
|
|
|
15
15
|
PolicyCheckId["MaxTireLoad"] = "max-tire-load";
|
|
16
16
|
PolicyCheckId["MinDriveAxleWeight"] = "minimum-drive-axle-weight";
|
|
17
17
|
PolicyCheckId["MinSteerAxleWeight"] = "minimum-steer-axle-weight";
|
|
18
|
+
PolicyCheckId["MinTandemSteerAxleWeight"] = "minimum-tandem-steer-axle-weight";
|
|
18
19
|
PolicyCheckId["NumberOfAxles"] = "number-of-axles";
|
|
19
20
|
PolicyCheckId["NumberOfWheelsPerAxle"] = "number-of-wheels";
|
|
21
|
+
PolicyCheckId["PickerTruckTractorWeightRestrictions"] = "picker-truck-tractor-weight-restrictions";
|
|
20
22
|
PolicyCheckId["TruckTractorWheelbase"] = "truck-tractor-wheelbase";
|
|
21
23
|
})(PolicyCheckId || (exports.PolicyCheckId = PolicyCheckId = {}));
|
|
@@ -156,7 +156,7 @@ export declare function CheckPermittableWeight(policy: Policy, vehicleConfigurat
|
|
|
156
156
|
* @example
|
|
157
157
|
* // For a single steer, tridem drive configuration
|
|
158
158
|
* const results = CheckMinSteerAxleWeight(policy, ['TRKTRAC'], [
|
|
159
|
-
* { numberOfAxles: 1, axleUnitWeight: 8000 }, //
|
|
159
|
+
* { numberOfAxles: 1, axleUnitWeight: 8000 }, // Single steer axle
|
|
160
160
|
* { numberOfAxles: 3, axleUnitWeight: 30000 } // Tridem drive axle
|
|
161
161
|
* ]);
|
|
162
162
|
* // Returns pass if steer axle weight >= 27% of drive axle weight (8100 kgs)
|
|
@@ -165,6 +165,22 @@ export declare function CheckPermittableWeight(policy: Policy, vehicleConfigurat
|
|
|
165
165
|
* @see AxleGroupPolicyCheckResult
|
|
166
166
|
*/
|
|
167
167
|
export declare function CheckMinSteerAxleWeight(_policy: Policy, _vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
168
|
+
/**
|
|
169
|
+
* Validates minimum tandem steer axle weight requirements for tandem steer
|
|
170
|
+
* power units with tandem or tridem drive axle units. The tandem steer axle
|
|
171
|
+
* unit must carry at least 40% of the drive axle unit weight.
|
|
172
|
+
*
|
|
173
|
+
* @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
|
|
174
|
+
* @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
|
|
175
|
+
* @param axleConfiguration - Array of axle configurations containing weight and axle count information
|
|
176
|
+
* @returns Array of AxleGroupPolicyCheckResult objects with validation results
|
|
177
|
+
*/
|
|
178
|
+
export declare function CheckMinTandemSteerAxleWeight(_policy: Policy, _vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
179
|
+
/**
|
|
180
|
+
* Applies the restricted weight rules for non-standard tandem steer/tridem
|
|
181
|
+
* drive picker truck tractors.
|
|
182
|
+
*/
|
|
183
|
+
export declare function CheckPickerTruckTractorWeightRestrictions(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<AxleGroupPolicyCheckResult>;
|
|
168
184
|
/**
|
|
169
185
|
* Validates minimum drive axle weight requirements for tandem and tridem drive power units.
|
|
170
186
|
*
|
|
@@ -284,6 +300,8 @@ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleC
|
|
|
284
300
|
* - MaxTireLoad: Validates tire load capacity for each axle unit
|
|
285
301
|
* - MinDriveAxleWeight: Validates minimum weight requirements for drive axles
|
|
286
302
|
* - MinSteerAxleWeight: Validates minimum weight requirements for steer axles
|
|
303
|
+
* - MinTandemSteerAxleWeight: Validates tandem steer minimum weight requirements
|
|
304
|
+
* - PickerTruckTractorWeightRestrictions: Validates non-standard picker truck tractor restrictions
|
|
287
305
|
* - NumberOfAxles: Validates axle count per axle unit
|
|
288
306
|
* - NumberOfWheelsPerAxle: Validates tire count per axle unit
|
|
289
307
|
* - BoosterAxleLimit: Validates booster axle count against the preceding trailer
|
|
@@ -6,6 +6,8 @@ exports.CheckBridgeFormula = CheckBridgeFormula;
|
|
|
6
6
|
exports.CheckNumTiresPerAxle = CheckNumTiresPerAxle;
|
|
7
7
|
exports.CheckPermittableWeight = CheckPermittableWeight;
|
|
8
8
|
exports.CheckMinSteerAxleWeight = CheckMinSteerAxleWeight;
|
|
9
|
+
exports.CheckMinTandemSteerAxleWeight = CheckMinTandemSteerAxleWeight;
|
|
10
|
+
exports.CheckPickerTruckTractorWeightRestrictions = CheckPickerTruckTractorWeightRestrictions;
|
|
9
11
|
exports.CheckMinDriveAxleWeight = CheckMinDriveAxleWeight;
|
|
10
12
|
exports.CheckMaxTireLoad = CheckMaxTireLoad;
|
|
11
13
|
exports.CheckBoosterAxleLimit = CheckBoosterAxleLimit;
|
|
@@ -13,6 +15,9 @@ exports.CheckTruckTractorWheelbase = CheckTruckTractorWheelbase;
|
|
|
13
15
|
exports.CheckDriveJeepLoadEqualization = CheckDriveJeepLoadEqualization;
|
|
14
16
|
const dimensions_helper_1 = require("./dimensions.helper");
|
|
15
17
|
const enum_1 = require("../enum");
|
|
18
|
+
function meetsMinimumSteerPercentageOfDriveAxleWeight(steerAxle, driveAxle, minimumPercentage) {
|
|
19
|
+
return (steerAxle.axleUnitWeight >= driveAxle.axleUnitWeight * minimumPercentage);
|
|
20
|
+
}
|
|
16
21
|
/**
|
|
17
22
|
* Validates the number of axles in each axle unit.
|
|
18
23
|
*
|
|
@@ -303,7 +308,7 @@ function CheckPermittableWeight(policy, vehicleConfiguration, axleConfiguration)
|
|
|
303
308
|
* @example
|
|
304
309
|
* // For a single steer, tridem drive configuration
|
|
305
310
|
* const results = CheckMinSteerAxleWeight(policy, ['TRKTRAC'], [
|
|
306
|
-
* { numberOfAxles: 1, axleUnitWeight: 8000 }, //
|
|
311
|
+
* { numberOfAxles: 1, axleUnitWeight: 8000 }, // Single steer axle
|
|
307
312
|
* { numberOfAxles: 3, axleUnitWeight: 30000 } // Tridem drive axle
|
|
308
313
|
* ]);
|
|
309
314
|
* // Returns pass if steer axle weight >= 27% of drive axle weight (8100 kgs)
|
|
@@ -318,14 +323,13 @@ function CheckMinSteerAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
|
|
|
318
323
|
if (axleConfiguration[0].numberOfAxles === 1 &&
|
|
319
324
|
axleConfiguration[1].numberOfAxles === 3) {
|
|
320
325
|
// Check minimum load on steer axle
|
|
321
|
-
if (axleConfiguration[0].
|
|
322
|
-
|
|
323
|
-
message = 'Steer axle meets minimum weight requirements';
|
|
326
|
+
if (meetsMinimumSteerPercentageOfDriveAxleWeight(axleConfiguration[0], axleConfiguration[1], 0.27)) {
|
|
327
|
+
message = 'Single steer axle meets minimum weight requirements';
|
|
324
328
|
result = enum_1.PolicyCheckResultType.Pass;
|
|
325
329
|
}
|
|
326
330
|
else {
|
|
327
331
|
message =
|
|
328
|
-
'
|
|
332
|
+
'Single steer axle must be a minimum of 27% of tridem drive axle weight';
|
|
329
333
|
result = enum_1.PolicyCheckResultType.Fail;
|
|
330
334
|
}
|
|
331
335
|
}
|
|
@@ -343,6 +347,136 @@ function CheckMinSteerAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
|
|
|
343
347
|
});
|
|
344
348
|
return policyCheckResults;
|
|
345
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Validates minimum tandem steer axle weight requirements for tandem steer
|
|
352
|
+
* power units with tandem or tridem drive axle units. The tandem steer axle
|
|
353
|
+
* unit must carry at least 40% of the drive axle unit weight.
|
|
354
|
+
*
|
|
355
|
+
* @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
|
|
356
|
+
* @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
|
|
357
|
+
* @param axleConfiguration - Array of axle configurations containing weight and axle count information
|
|
358
|
+
* @returns Array of AxleGroupPolicyCheckResult objects with validation results
|
|
359
|
+
*/
|
|
360
|
+
function CheckMinTandemSteerAxleWeight(_policy, _vehicleConfiguration, axleConfiguration) {
|
|
361
|
+
const policyCheckResults = new Array();
|
|
362
|
+
const policyId = enum_1.PolicyCheckId.MinTandemSteerAxleWeight;
|
|
363
|
+
const steerAxle = axleConfiguration[0];
|
|
364
|
+
const driveAxle = axleConfiguration[1];
|
|
365
|
+
let message, result;
|
|
366
|
+
if (steerAxle.numberOfAxles === 2 &&
|
|
367
|
+
(driveAxle.numberOfAxles === 2 || driveAxle.numberOfAxles === 3)) {
|
|
368
|
+
if (meetsMinimumSteerPercentageOfDriveAxleWeight(steerAxle, driveAxle, 0.4)) {
|
|
369
|
+
message = 'Tandem steer axle meets minimum weight requirements';
|
|
370
|
+
result = enum_1.PolicyCheckResultType.Pass;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
message =
|
|
374
|
+
'Tandem steer axle must be a minimum of 40% of drive axle weight';
|
|
375
|
+
result = enum_1.PolicyCheckResultType.Fail;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
message = 'Policy check does not apply to this configuration';
|
|
380
|
+
result = enum_1.PolicyCheckResultType.Pass;
|
|
381
|
+
}
|
|
382
|
+
policyCheckResults.push({
|
|
383
|
+
id: policyId,
|
|
384
|
+
message: message,
|
|
385
|
+
result: result,
|
|
386
|
+
startAxleUnit: 1,
|
|
387
|
+
endAxleUnit: 2,
|
|
388
|
+
});
|
|
389
|
+
return policyCheckResults;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Applies the restricted weight rules for non-standard tandem steer/tridem
|
|
393
|
+
* drive picker truck tractors.
|
|
394
|
+
*/
|
|
395
|
+
function CheckPickerTruckTractorWeightRestrictions(policy, vehicleConfiguration, axleConfiguration) {
|
|
396
|
+
const policyId = enum_1.PolicyCheckId.PickerTruckTractorWeightRestrictions;
|
|
397
|
+
const MINIMUM_WHEELBASE_CM = 660;
|
|
398
|
+
const MINIMUM_STEER_AXLE_SPREAD_CM = 100;
|
|
399
|
+
const MINIMUM_DRIVE_AXLE_SPREAD_CM = 240;
|
|
400
|
+
const steerAxle = axleConfiguration[0];
|
|
401
|
+
const driveAxle = axleConfiguration[1];
|
|
402
|
+
const doesNotApply = (message = 'Policy check does not apply to this configuration') => [
|
|
403
|
+
{
|
|
404
|
+
id: policyId,
|
|
405
|
+
message,
|
|
406
|
+
result: enum_1.PolicyCheckResultType.Pass,
|
|
407
|
+
startAxleUnit: 1,
|
|
408
|
+
endAxleUnit: 2,
|
|
409
|
+
},
|
|
410
|
+
];
|
|
411
|
+
if (vehicleConfiguration[0] !== 'PICKRTT' ||
|
|
412
|
+
!steerAxle ||
|
|
413
|
+
!driveAxle ||
|
|
414
|
+
steerAxle.numberOfAxles !== 2 ||
|
|
415
|
+
driveAxle.numberOfAxles !== 3) {
|
|
416
|
+
return doesNotApply();
|
|
417
|
+
}
|
|
418
|
+
const hasWheelbaseDimensions = Number.isFinite(steerAxle.axleSpread) &&
|
|
419
|
+
Number.isFinite(driveAxle.interaxleSpacing) &&
|
|
420
|
+
Number.isFinite(driveAxle.axleSpread);
|
|
421
|
+
const wheelbase = hasWheelbaseDimensions
|
|
422
|
+
? steerAxle.axleSpread / 2 +
|
|
423
|
+
driveAxle.interaxleSpacing +
|
|
424
|
+
driveAxle.axleSpread / 2
|
|
425
|
+
: undefined;
|
|
426
|
+
const isNonStandard = (wheelbase !== undefined && wheelbase < MINIMUM_WHEELBASE_CM) ||
|
|
427
|
+
(steerAxle.axleSpread !== undefined &&
|
|
428
|
+
steerAxle.axleSpread < MINIMUM_STEER_AXLE_SPREAD_CM) ||
|
|
429
|
+
(driveAxle.axleSpread !== undefined &&
|
|
430
|
+
driveAxle.axleSpread < MINIMUM_DRIVE_AXLE_SPREAD_CM);
|
|
431
|
+
if (!isNonStandard) {
|
|
432
|
+
return doesNotApply();
|
|
433
|
+
}
|
|
434
|
+
const powerUnitWeights = policy.getDefaultPowerUnitWeight('PICKRTT', 23);
|
|
435
|
+
const steerWeightDimension = policy.selectCorrectWeightDimension(powerUnitWeights, vehicleConfiguration, axleConfiguration, 0);
|
|
436
|
+
const driveWeightDimension = policy.selectCorrectWeightDimension(powerUnitWeights, vehicleConfiguration, axleConfiguration, 1);
|
|
437
|
+
const steerPermittable = steerWeightDimension === null || steerWeightDimension === void 0 ? void 0 : steerWeightDimension.permittable;
|
|
438
|
+
const drivePermittable = driveWeightDimension === null || driveWeightDimension === void 0 ? void 0 : driveWeightDimension.permittable;
|
|
439
|
+
if (steerPermittable === undefined ||
|
|
440
|
+
drivePermittable === undefined ||
|
|
441
|
+
steerAxle.axleUnitWeight > steerPermittable ||
|
|
442
|
+
driveAxle.axleUnitWeight > drivePermittable) {
|
|
443
|
+
return doesNotApply('Policy check does not apply outside configured permittable axle weights');
|
|
444
|
+
}
|
|
445
|
+
const ratioPasses = meetsMinimumSteerPercentageOfDriveAxleWeight(steerAxle, driveAxle, 0.5);
|
|
446
|
+
const hasRealTrailer = vehicleConfiguration.slice(1).some((vehicleType) => {
|
|
447
|
+
const vehicleDefinition = policy.getVehicleDefinition(vehicleType);
|
|
448
|
+
return !(vehicleDefinition === null || vehicleDefinition === void 0 ? void 0 : vehicleDefinition.ignoreForAxleCalculation);
|
|
449
|
+
});
|
|
450
|
+
const exceedsLegalWeight = ((steerWeightDimension === null || steerWeightDimension === void 0 ? void 0 : steerWeightDimension.legal) !== undefined &&
|
|
451
|
+
steerAxle.axleUnitWeight > steerWeightDimension.legal) ||
|
|
452
|
+
((driveWeightDimension === null || driveWeightDimension === void 0 ? void 0 : driveWeightDimension.legal) !== undefined &&
|
|
453
|
+
driveAxle.axleUnitWeight > driveWeightDimension.legal);
|
|
454
|
+
const trailerPasses = !hasRealTrailer || !exceedsLegalWeight;
|
|
455
|
+
return [
|
|
456
|
+
{
|
|
457
|
+
id: policyId,
|
|
458
|
+
message: ratioPasses
|
|
459
|
+
? ''
|
|
460
|
+
: 'Axle Unit 1 must carry a minimum 50% of Axle Unit 2 axle unit weight.',
|
|
461
|
+
result: ratioPasses
|
|
462
|
+
? enum_1.PolicyCheckResultType.Pass
|
|
463
|
+
: enum_1.PolicyCheckResultType.Fail,
|
|
464
|
+
startAxleUnit: 1,
|
|
465
|
+
endAxleUnit: 2,
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
id: policyId,
|
|
469
|
+
message: trailerPasses
|
|
470
|
+
? ''
|
|
471
|
+
: 'Cannot tow a trailer if Axle Unit 1 and Axle Unit 2 are exceeding legal axle weights.',
|
|
472
|
+
result: trailerPasses
|
|
473
|
+
? enum_1.PolicyCheckResultType.Pass
|
|
474
|
+
: enum_1.PolicyCheckResultType.Fail,
|
|
475
|
+
startAxleUnit: 1,
|
|
476
|
+
endAxleUnit: 2,
|
|
477
|
+
},
|
|
478
|
+
];
|
|
479
|
+
}
|
|
346
480
|
/**
|
|
347
481
|
* Validates minimum drive axle weight requirements for tandem and tridem drive power units.
|
|
348
482
|
*
|
|
@@ -763,6 +897,8 @@ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfi
|
|
|
763
897
|
* - MaxTireLoad: Validates tire load capacity for each axle unit
|
|
764
898
|
* - MinDriveAxleWeight: Validates minimum weight requirements for drive axles
|
|
765
899
|
* - MinSteerAxleWeight: Validates minimum weight requirements for steer axles
|
|
900
|
+
* - MinTandemSteerAxleWeight: Validates tandem steer minimum weight requirements
|
|
901
|
+
* - PickerTruckTractorWeightRestrictions: Validates non-standard picker truck tractor restrictions
|
|
766
902
|
* - NumberOfAxles: Validates axle count per axle unit
|
|
767
903
|
* - NumberOfWheelsPerAxle: Validates tire count per axle unit
|
|
768
904
|
* - BoosterAxleLimit: Validates booster axle count against the preceding trailer
|
|
@@ -780,6 +916,11 @@ exports.policyCheckMap = new Map([
|
|
|
780
916
|
[enum_1.PolicyCheckId.MaxTireLoad, CheckMaxTireLoad],
|
|
781
917
|
[enum_1.PolicyCheckId.MinDriveAxleWeight, CheckMinDriveAxleWeight],
|
|
782
918
|
[enum_1.PolicyCheckId.MinSteerAxleWeight, CheckMinSteerAxleWeight],
|
|
919
|
+
[enum_1.PolicyCheckId.MinTandemSteerAxleWeight, CheckMinTandemSteerAxleWeight],
|
|
920
|
+
[
|
|
921
|
+
enum_1.PolicyCheckId.PickerTruckTractorWeightRestrictions,
|
|
922
|
+
CheckPickerTruckTractorWeightRestrictions,
|
|
923
|
+
],
|
|
783
924
|
[enum_1.PolicyCheckId.NumberOfWheelsPerAxle, CheckNumTiresPerAxle],
|
|
784
925
|
[enum_1.PolicyCheckId.BoosterAxleLimit, CheckBoosterAxleLimit],
|
|
785
926
|
[enum_1.PolicyCheckId.TruckTractorWheelbase, CheckTruckTractorWheelbase],
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
1
|
+
export declare const version = "v2.16.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED