@dnv-plant/typescriptpws 1.0.77 → 1.0.78-alpha.1946028
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/index.ts +2 -2
- package/package.json +6 -6
- package/src/calculations/applicationTools.ts +22 -25
- package/src/calculations/discharge.ts +155 -176
- package/src/calculations/dispersion.ts +24 -27
- package/src/calculations/dispersionView.ts +151 -172
- package/src/calculations/fireball.ts +23 -26
- package/src/calculations/jetFire.ts +43 -49
- package/src/calculations/lateExplosion.ts +44 -50
- package/src/calculations/linkedRunners.ts +165 -177
- package/src/calculations/poolFire.ts +23 -26
- package/src/calculations/properties.ts +22 -25
- package/src/calculations/radiation.ts +228 -261
- package/src/calculations/standalones.ts +23 -26
- package/src/calculations/toxics.ts +22 -25
- package/src/calculations/utilities.ts +248 -284
- package/src/constants.ts +2 -2
- package/src/entities.ts +2 -2
- package/src/entity-schemas.ts +2 -2
- package/src/enums.ts +2 -2
- package/src/materials.ts +41 -73
- package/src/utilities.ts +36 -95
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/***********************************************************************
|
|
2
2
|
* This file has been auto-generated by a code generation tool.
|
|
3
|
-
* Version: 1.0.
|
|
4
|
-
* Date/time:
|
|
3
|
+
* Version: 1.0.78
|
|
4
|
+
* Date/time: 20 Jun 2025 16:35:08
|
|
5
5
|
* Template: templates/typescriptpws/calculations.razor.
|
|
6
6
|
***********************************************************************/
|
|
7
7
|
|
|
@@ -310,36 +310,33 @@ export class DistancesAndEllipsesToRadiationLevelsCalculation extends Calculatio
|
|
|
310
310
|
|
|
311
311
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
312
312
|
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
331
|
-
}
|
|
313
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
314
|
+
|
|
315
|
+
const responseSchema = new DistancesAndEllipsesToRadiationLevelsCalculationResponseSchema();
|
|
316
|
+
const validatedResponse = responseSchema.validate(data);
|
|
317
|
+
|
|
318
|
+
this.resultCode = validatedResponse.resultCode;
|
|
319
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
320
|
+
Object.assign(this, {
|
|
321
|
+
distances: validatedResponse.distances,
|
|
322
|
+
contourPoints: validatedResponse.contourPoints,
|
|
323
|
+
nContourPoints: validatedResponse.nContourPoints,
|
|
324
|
+
areas: validatedResponse.areas,
|
|
325
|
+
resultCode: validatedResponse.resultCode,
|
|
326
|
+
messages: validatedResponse.messages ?? [],
|
|
327
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
328
|
+
operationId: validatedResponse.operationId,
|
|
329
|
+
});
|
|
332
330
|
} else {
|
|
333
|
-
this.
|
|
331
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
334
332
|
}
|
|
335
|
-
} catch (
|
|
336
|
-
if (
|
|
337
|
-
this.
|
|
333
|
+
} catch (err: any) {
|
|
334
|
+
if ((err as any)?.response) {
|
|
335
|
+
this.handleFailedResponse((err as any).response);
|
|
338
336
|
} else {
|
|
339
|
-
|
|
337
|
+
throw err;
|
|
340
338
|
}
|
|
341
|
-
console.error(
|
|
342
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
339
|
+
console.error(err);
|
|
343
340
|
}
|
|
344
341
|
|
|
345
342
|
return this.resultCode;
|
|
@@ -675,36 +672,33 @@ export class DistancesAndEllipsesToRadiationLevelsForPoolFiresCalculation extend
|
|
|
675
672
|
|
|
676
673
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
677
674
|
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
696
|
-
}
|
|
675
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
676
|
+
|
|
677
|
+
const responseSchema = new DistancesAndEllipsesToRadiationLevelsForPoolFiresCalculationResponseSchema();
|
|
678
|
+
const validatedResponse = responseSchema.validate(data);
|
|
679
|
+
|
|
680
|
+
this.resultCode = validatedResponse.resultCode;
|
|
681
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
682
|
+
Object.assign(this, {
|
|
683
|
+
distances: validatedResponse.distances,
|
|
684
|
+
contourPoints: validatedResponse.contourPoints,
|
|
685
|
+
nContourPoints: validatedResponse.nContourPoints,
|
|
686
|
+
areas: validatedResponse.areas,
|
|
687
|
+
resultCode: validatedResponse.resultCode,
|
|
688
|
+
messages: validatedResponse.messages ?? [],
|
|
689
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
690
|
+
operationId: validatedResponse.operationId,
|
|
691
|
+
});
|
|
697
692
|
} else {
|
|
698
|
-
this.
|
|
693
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
699
694
|
}
|
|
700
|
-
} catch (
|
|
701
|
-
if (
|
|
702
|
-
this.
|
|
695
|
+
} catch (err: any) {
|
|
696
|
+
if ((err as any)?.response) {
|
|
697
|
+
this.handleFailedResponse((err as any).response);
|
|
703
698
|
} else {
|
|
704
|
-
|
|
699
|
+
throw err;
|
|
705
700
|
}
|
|
706
|
-
console.error(
|
|
707
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
701
|
+
console.error(err);
|
|
708
702
|
}
|
|
709
703
|
|
|
710
704
|
return this.resultCode;
|
|
@@ -1037,33 +1031,30 @@ export class DistancesToRadiationLevelsCalculation extends CalculationBase {
|
|
|
1037
1031
|
|
|
1038
1032
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1039
1033
|
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
}
|
|
1054
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1055
|
-
}
|
|
1034
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
1035
|
+
|
|
1036
|
+
const responseSchema = new DistancesToRadiationLevelsCalculationResponseSchema();
|
|
1037
|
+
const validatedResponse = responseSchema.validate(data);
|
|
1038
|
+
|
|
1039
|
+
this.resultCode = validatedResponse.resultCode;
|
|
1040
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
1041
|
+
Object.assign(this, {
|
|
1042
|
+
distances: validatedResponse.distances,
|
|
1043
|
+
resultCode: validatedResponse.resultCode,
|
|
1044
|
+
messages: validatedResponse.messages ?? [],
|
|
1045
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
1046
|
+
operationId: validatedResponse.operationId,
|
|
1047
|
+
});
|
|
1056
1048
|
} else {
|
|
1057
|
-
this.
|
|
1049
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1058
1050
|
}
|
|
1059
|
-
} catch (
|
|
1060
|
-
if (
|
|
1061
|
-
this.
|
|
1051
|
+
} catch (err: any) {
|
|
1052
|
+
if ((err as any)?.response) {
|
|
1053
|
+
this.handleFailedResponse((err as any).response);
|
|
1062
1054
|
} else {
|
|
1063
|
-
|
|
1055
|
+
throw err;
|
|
1064
1056
|
}
|
|
1065
|
-
console.error(
|
|
1066
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1057
|
+
console.error(err);
|
|
1067
1058
|
}
|
|
1068
1059
|
|
|
1069
1060
|
return this.resultCode;
|
|
@@ -1326,33 +1317,30 @@ export class DistanceToRadiationCalculation extends CalculationBase {
|
|
|
1326
1317
|
|
|
1327
1318
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1328
1319
|
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1343
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1344
|
-
}
|
|
1320
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
1321
|
+
|
|
1322
|
+
const responseSchema = new DistanceToRadiationCalculationResponseSchema();
|
|
1323
|
+
const validatedResponse = responseSchema.validate(data);
|
|
1324
|
+
|
|
1325
|
+
this.resultCode = validatedResponse.resultCode;
|
|
1326
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
1327
|
+
Object.assign(this, {
|
|
1328
|
+
distance: validatedResponse.distance,
|
|
1329
|
+
resultCode: validatedResponse.resultCode,
|
|
1330
|
+
messages: validatedResponse.messages ?? [],
|
|
1331
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
1332
|
+
operationId: validatedResponse.operationId,
|
|
1333
|
+
});
|
|
1345
1334
|
} else {
|
|
1346
|
-
this.
|
|
1335
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1347
1336
|
}
|
|
1348
|
-
} catch (
|
|
1349
|
-
if (
|
|
1350
|
-
this.
|
|
1337
|
+
} catch (err: any) {
|
|
1338
|
+
if ((err as any)?.response) {
|
|
1339
|
+
this.handleFailedResponse((err as any).response);
|
|
1351
1340
|
} else {
|
|
1352
|
-
|
|
1341
|
+
throw err;
|
|
1353
1342
|
}
|
|
1354
|
-
console.error(
|
|
1355
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1343
|
+
console.error(err);
|
|
1356
1344
|
}
|
|
1357
1345
|
|
|
1358
1346
|
return this.resultCode;
|
|
@@ -1610,33 +1598,30 @@ export class RadiationAtAPointCalculation extends CalculationBase {
|
|
|
1610
1598
|
|
|
1611
1599
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1612
1600
|
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
}
|
|
1627
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1628
|
-
}
|
|
1601
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
1602
|
+
|
|
1603
|
+
const responseSchema = new RadiationAtAPointCalculationResponseSchema();
|
|
1604
|
+
const validatedResponse = responseSchema.validate(data);
|
|
1605
|
+
|
|
1606
|
+
this.resultCode = validatedResponse.resultCode;
|
|
1607
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
1608
|
+
Object.assign(this, {
|
|
1609
|
+
radiation: validatedResponse.radiation,
|
|
1610
|
+
resultCode: validatedResponse.resultCode,
|
|
1611
|
+
messages: validatedResponse.messages ?? [],
|
|
1612
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
1613
|
+
operationId: validatedResponse.operationId,
|
|
1614
|
+
});
|
|
1629
1615
|
} else {
|
|
1630
|
-
this.
|
|
1616
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1631
1617
|
}
|
|
1632
|
-
} catch (
|
|
1633
|
-
if (
|
|
1634
|
-
this.
|
|
1618
|
+
} catch (err: any) {
|
|
1619
|
+
if ((err as any)?.response) {
|
|
1620
|
+
this.handleFailedResponse((err as any).response);
|
|
1635
1621
|
} else {
|
|
1636
|
-
|
|
1622
|
+
throw err;
|
|
1637
1623
|
}
|
|
1638
|
-
console.error(
|
|
1639
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1624
|
+
console.error(err);
|
|
1640
1625
|
}
|
|
1641
1626
|
|
|
1642
1627
|
return this.resultCode;
|
|
@@ -1894,33 +1879,30 @@ export class RadiationAtAPointForPoolFiresCalculation extends CalculationBase {
|
|
|
1894
1879
|
|
|
1895
1880
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1896
1881
|
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
}
|
|
1911
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1912
|
-
}
|
|
1882
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
1883
|
+
|
|
1884
|
+
const responseSchema = new RadiationAtAPointForPoolFiresCalculationResponseSchema();
|
|
1885
|
+
const validatedResponse = responseSchema.validate(data);
|
|
1886
|
+
|
|
1887
|
+
this.resultCode = validatedResponse.resultCode;
|
|
1888
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
1889
|
+
Object.assign(this, {
|
|
1890
|
+
radiation: validatedResponse.radiation,
|
|
1891
|
+
resultCode: validatedResponse.resultCode,
|
|
1892
|
+
messages: validatedResponse.messages ?? [],
|
|
1893
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
1894
|
+
operationId: validatedResponse.operationId,
|
|
1895
|
+
});
|
|
1913
1896
|
} else {
|
|
1914
|
-
this.
|
|
1897
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
1915
1898
|
}
|
|
1916
|
-
} catch (
|
|
1917
|
-
if (
|
|
1918
|
-
this.
|
|
1899
|
+
} catch (err: any) {
|
|
1900
|
+
if ((err as any)?.response) {
|
|
1901
|
+
this.handleFailedResponse((err as any).response);
|
|
1919
1902
|
} else {
|
|
1920
|
-
|
|
1903
|
+
throw err;
|
|
1921
1904
|
}
|
|
1922
|
-
console.error(
|
|
1923
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
1905
|
+
console.error(err);
|
|
1924
1906
|
}
|
|
1925
1907
|
|
|
1926
1908
|
return this.resultCode;
|
|
@@ -2191,33 +2173,30 @@ export class RadiationAtPointsCalculation extends CalculationBase {
|
|
|
2191
2173
|
|
|
2192
2174
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2193
2175
|
|
|
2194
|
-
const
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
}
|
|
2208
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
2209
|
-
}
|
|
2176
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
2177
|
+
|
|
2178
|
+
const responseSchema = new RadiationAtPointsCalculationResponseSchema();
|
|
2179
|
+
const validatedResponse = responseSchema.validate(data);
|
|
2180
|
+
|
|
2181
|
+
this.resultCode = validatedResponse.resultCode;
|
|
2182
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
2183
|
+
Object.assign(this, {
|
|
2184
|
+
radiation: validatedResponse.radiation,
|
|
2185
|
+
resultCode: validatedResponse.resultCode,
|
|
2186
|
+
messages: validatedResponse.messages ?? [],
|
|
2187
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
2188
|
+
operationId: validatedResponse.operationId,
|
|
2189
|
+
});
|
|
2210
2190
|
} else {
|
|
2211
|
-
this.
|
|
2191
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
2212
2192
|
}
|
|
2213
|
-
} catch (
|
|
2214
|
-
if (
|
|
2215
|
-
this.
|
|
2193
|
+
} catch (err: any) {
|
|
2194
|
+
if ((err as any)?.response) {
|
|
2195
|
+
this.handleFailedResponse((err as any).response);
|
|
2216
2196
|
} else {
|
|
2217
|
-
|
|
2197
|
+
throw err;
|
|
2218
2198
|
}
|
|
2219
|
-
console.error(
|
|
2220
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2199
|
+
console.error(err);
|
|
2221
2200
|
}
|
|
2222
2201
|
|
|
2223
2202
|
return this.resultCode;
|
|
@@ -2493,33 +2472,30 @@ export class RadiationAtPointsForPoolFiresCalculation extends CalculationBase {
|
|
|
2493
2472
|
|
|
2494
2473
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2495
2474
|
|
|
2496
|
-
const
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
}
|
|
2510
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
2511
|
-
}
|
|
2475
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
2476
|
+
|
|
2477
|
+
const responseSchema = new RadiationAtPointsForPoolFiresCalculationResponseSchema();
|
|
2478
|
+
const validatedResponse = responseSchema.validate(data);
|
|
2479
|
+
|
|
2480
|
+
this.resultCode = validatedResponse.resultCode;
|
|
2481
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
2482
|
+
Object.assign(this, {
|
|
2483
|
+
radiation: validatedResponse.radiation,
|
|
2484
|
+
resultCode: validatedResponse.resultCode,
|
|
2485
|
+
messages: validatedResponse.messages ?? [],
|
|
2486
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
2487
|
+
operationId: validatedResponse.operationId,
|
|
2488
|
+
});
|
|
2512
2489
|
} else {
|
|
2513
|
-
this.
|
|
2490
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
2514
2491
|
}
|
|
2515
|
-
} catch (
|
|
2516
|
-
if (
|
|
2517
|
-
this.
|
|
2492
|
+
} catch (err: any) {
|
|
2493
|
+
if ((err as any)?.response) {
|
|
2494
|
+
this.handleFailedResponse((err as any).response);
|
|
2518
2495
|
} else {
|
|
2519
|
-
|
|
2496
|
+
throw err;
|
|
2520
2497
|
}
|
|
2521
|
-
console.error(
|
|
2522
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2498
|
+
console.error(err);
|
|
2523
2499
|
}
|
|
2524
2500
|
|
|
2525
2501
|
return this.resultCode;
|
|
@@ -2782,33 +2758,30 @@ export class RadiationContourCalculation extends CalculationBase {
|
|
|
2782
2758
|
|
|
2783
2759
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2784
2760
|
|
|
2785
|
-
const
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
}
|
|
2799
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
2800
|
-
}
|
|
2761
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
2762
|
+
|
|
2763
|
+
const responseSchema = new RadiationContourCalculationResponseSchema();
|
|
2764
|
+
const validatedResponse = responseSchema.validate(data);
|
|
2765
|
+
|
|
2766
|
+
this.resultCode = validatedResponse.resultCode;
|
|
2767
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
2768
|
+
Object.assign(this, {
|
|
2769
|
+
contourPoints: validatedResponse.contourPoints,
|
|
2770
|
+
resultCode: validatedResponse.resultCode,
|
|
2771
|
+
messages: validatedResponse.messages ?? [],
|
|
2772
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
2773
|
+
operationId: validatedResponse.operationId,
|
|
2774
|
+
});
|
|
2801
2775
|
} else {
|
|
2802
|
-
this.
|
|
2776
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
2803
2777
|
}
|
|
2804
|
-
} catch (
|
|
2805
|
-
if (
|
|
2806
|
-
this.
|
|
2778
|
+
} catch (err: any) {
|
|
2779
|
+
if ((err as any)?.response) {
|
|
2780
|
+
this.handleFailedResponse((err as any).response);
|
|
2807
2781
|
} else {
|
|
2808
|
-
|
|
2782
|
+
throw err;
|
|
2809
2783
|
}
|
|
2810
|
-
console.error(
|
|
2811
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
2784
|
+
console.error(err);
|
|
2812
2785
|
}
|
|
2813
2786
|
|
|
2814
2787
|
return this.resultCode;
|
|
@@ -3077,33 +3050,30 @@ export class RadiationTransectCalculation extends CalculationBase {
|
|
|
3077
3050
|
|
|
3078
3051
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
3079
3052
|
|
|
3080
|
-
const
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
}
|
|
3094
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
3095
|
-
}
|
|
3053
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
3054
|
+
|
|
3055
|
+
const responseSchema = new RadiationTransectCalculationResponseSchema();
|
|
3056
|
+
const validatedResponse = responseSchema.validate(data);
|
|
3057
|
+
|
|
3058
|
+
this.resultCode = validatedResponse.resultCode;
|
|
3059
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
3060
|
+
Object.assign(this, {
|
|
3061
|
+
radiationRecords: validatedResponse.radiationRecords,
|
|
3062
|
+
resultCode: validatedResponse.resultCode,
|
|
3063
|
+
messages: validatedResponse.messages ?? [],
|
|
3064
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
3065
|
+
operationId: validatedResponse.operationId,
|
|
3066
|
+
});
|
|
3096
3067
|
} else {
|
|
3097
|
-
this.
|
|
3068
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
3098
3069
|
}
|
|
3099
|
-
} catch (
|
|
3100
|
-
if (
|
|
3101
|
-
this.
|
|
3070
|
+
} catch (err: any) {
|
|
3071
|
+
if ((err as any)?.response) {
|
|
3072
|
+
this.handleFailedResponse((err as any).response);
|
|
3102
3073
|
} else {
|
|
3103
|
-
|
|
3074
|
+
throw err;
|
|
3104
3075
|
}
|
|
3105
|
-
console.error(
|
|
3106
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
3076
|
+
console.error(err);
|
|
3107
3077
|
}
|
|
3108
3078
|
|
|
3109
3079
|
return this.resultCode;
|
|
@@ -3372,33 +3342,30 @@ export class RadiationTransectForPoolFiresCalculation extends CalculationBase {
|
|
|
3372
3342
|
|
|
3373
3343
|
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
3374
3344
|
|
|
3375
|
-
const
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
}
|
|
3389
|
-
this.messages.push(...(validatedResponse.messages ?? []));
|
|
3390
|
-
}
|
|
3345
|
+
const { data } = await this.postRequest(url, requestJson);
|
|
3346
|
+
|
|
3347
|
+
const responseSchema = new RadiationTransectForPoolFiresCalculationResponseSchema();
|
|
3348
|
+
const validatedResponse = responseSchema.validate(data);
|
|
3349
|
+
|
|
3350
|
+
this.resultCode = validatedResponse.resultCode;
|
|
3351
|
+
if (this.resultCode === Enums.ResultCode.SUCCESS) {
|
|
3352
|
+
Object.assign(this, {
|
|
3353
|
+
radiationRecords: validatedResponse.radiationRecords,
|
|
3354
|
+
resultCode: validatedResponse.resultCode,
|
|
3355
|
+
messages: validatedResponse.messages ?? [],
|
|
3356
|
+
calculationElapsedTime: validatedResponse.calculationElapsedTime,
|
|
3357
|
+
operationId: validatedResponse.operationId,
|
|
3358
|
+
});
|
|
3391
3359
|
} else {
|
|
3392
|
-
this.
|
|
3360
|
+
this.messages.push(...(validatedResponse.messages ?? []));
|
|
3393
3361
|
}
|
|
3394
|
-
} catch (
|
|
3395
|
-
if (
|
|
3396
|
-
this.
|
|
3362
|
+
} catch (err: any) {
|
|
3363
|
+
if ((err as any)?.response) {
|
|
3364
|
+
this.handleFailedResponse((err as any).response);
|
|
3397
3365
|
} else {
|
|
3398
|
-
|
|
3366
|
+
throw err;
|
|
3399
3367
|
}
|
|
3400
|
-
console.error(
|
|
3401
|
-
this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
|
|
3368
|
+
console.error(err);
|
|
3402
3369
|
}
|
|
3403
3370
|
|
|
3404
3371
|
return this.resultCode;
|