@dnv-plant/typescriptpws 1.0.86 → 1.0.88

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.
@@ -6,12 +6,10 @@
6
6
  * Editing it may lead to inconsistent results and limit DNV's ability to provide support.
7
7
  * Please contact DNV if you believe changes are required.
8
8
  *
9
- * Version: 1.0.86
10
- * Date/time: 10 Jul 2025 09:49:06
9
+ * Version: 1.0.89
10
+ * Date/time: 29 Jul 2025 17:59:11
11
11
  * Template: templates/typescriptpws/calculations.razor.
12
- ***********************************************************************/
13
-
14
-
12
+ ***********************************************************************/
15
13
 
16
14
  import * as Enums from "../enums";
17
15
  import * as Entities from "../entities";
@@ -36,12 +34,17 @@ class CalculationBase {
36
34
  messages: string[] = [];
37
35
  calculationElapsedTime?: number = 0.0;
38
36
  operationId?: string = "";
37
+ controller?: AbortController;
38
+
39
+ constructor(controller?: AbortController) {
40
+ this.controller = controller;
41
+ }
39
42
 
40
43
  /**
41
44
  * Post JSON to URL and time the call
42
45
  */
43
46
  async postRequest(url: string, data: string): Promise<AxiosResponse> {
44
- return postRequest(url, data);
47
+ return postRequest(url, data, this.controller);
45
48
  }
46
49
 
47
50
  /**
@@ -153,6 +156,234 @@ class CalculationFailedResponseSchema {
153
156
  }
154
157
  }
155
158
 
159
+ export interface BESSConfidenceIntervalEnergyScalingCalculationRequestSchemaData {
160
+ chemistry: number;
161
+ confidenceInterval: number;
162
+ }
163
+
164
+ class BESSConfidenceIntervalEnergyScalingCalculationRequest extends CalculationRequestBase {
165
+ chemistry: number;
166
+ confidenceInterval: number;
167
+
168
+ /**
169
+ * BESSConfidenceIntervalEnergyScaling calculation request class.
170
+ *
171
+ */
172
+ constructor(data: {
173
+ chemistry: number,
174
+ confidenceInterval: number
175
+ }) {
176
+ super();
177
+ this.chemistry = data.chemistry;
178
+ this.confidenceInterval = data.confidenceInterval;
179
+ }
180
+ }
181
+
182
+ export class BESSConfidenceIntervalEnergyScalingCalculationRequestSchema {
183
+ schema: Joi.ObjectSchema;
184
+ propertyTypes: Record<string, string>;
185
+
186
+ /**
187
+ * Schema for the BESSConfidenceIntervalEnergyScaling calculation request.
188
+ */
189
+ constructor() {
190
+ this.schema = Joi.object({
191
+ chemistry: Joi.number().integer(),
192
+ confidenceInterval: Joi.number().unsafe(),
193
+ }).unknown(true);
194
+
195
+ this.propertyTypes = {
196
+ chemistry: "number",
197
+ confidenceInterval: "number",
198
+ };
199
+ }
200
+
201
+ validate(data: BESSConfidenceIntervalEnergyScalingCalculationRequestSchemaData): BESSConfidenceIntervalEnergyScalingCalculationRequest {
202
+ const { error, value } = this.schema.validate(data, { abortEarly: false });
203
+ if (error) {
204
+ throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
205
+ }
206
+ return this.makeCalculationRequest(value);
207
+ }
208
+
209
+ makeCalculationRequest(data: BESSConfidenceIntervalEnergyScalingCalculationRequestSchemaData): BESSConfidenceIntervalEnergyScalingCalculationRequest {
210
+ return new BESSConfidenceIntervalEnergyScalingCalculationRequest(data);
211
+ }
212
+ }
213
+
214
+ export class BESSConfidenceIntervalEnergyScalingCalculation extends CalculationBase {
215
+ chemistry: number;
216
+ confidenceInterval: number;
217
+ kUpper?: number;
218
+ kLower?: number;
219
+
220
+ /**
221
+ * Confidence interval scaling values for a BESS calculation.
222
+ *
223
+ */
224
+ constructor(data: {
225
+ chemistry: number,
226
+ confidenceInterval: number
227
+ controller?: AbortController;
228
+ }) {
229
+ super(data.controller);
230
+ this.chemistry = data.chemistry;
231
+ this.confidenceInterval = data.confidenceInterval;
232
+ }
233
+
234
+ async run() {
235
+ try {
236
+ const request = new BESSConfidenceIntervalEnergyScalingCalculationRequest({
237
+ chemistry: this.chemistry,
238
+ confidenceInterval: this.confidenceInterval
239
+ });
240
+
241
+ const schema = new BESSConfidenceIntervalEnergyScalingCalculationRequestSchema();
242
+ const validatedRequest = schema.validate(request);
243
+
244
+ const requestJson = JSON.stringify(validatedRequest);
245
+ const url = `${getAnalyticsApiTarget()}calculatebessconfidenceintervalenergyscaling?clientId=${getClientAliasId()}`;
246
+
247
+ this.resultCode = Enums.ResultCode.UNEXPECTED_APPLICATION_ERROR;
248
+
249
+ const { data } = await this.postRequest(url, requestJson);
250
+
251
+ const responseSchema = new BESSConfidenceIntervalEnergyScalingCalculationResponseSchema();
252
+ const validatedResponse = responseSchema.validate(data);
253
+
254
+ this.resultCode = validatedResponse.resultCode;
255
+ if (this.resultCode === Enums.ResultCode.SUCCESS) {
256
+ Object.assign(this, {
257
+ kUpper: validatedResponse.kUpper,
258
+ kLower: validatedResponse.kLower,
259
+ resultCode: validatedResponse.resultCode,
260
+ messages: validatedResponse.messages ?? [],
261
+ calculationElapsedTime: validatedResponse.calculationElapsedTime,
262
+ operationId: validatedResponse.operationId,
263
+ });
264
+ } else {
265
+ this.messages.push(...(validatedResponse.messages ?? []));
266
+ }
267
+ } catch (err: any) {
268
+ if ((err as any)?.response) {
269
+ this.handleFailedResponse((err as any).response);
270
+ } else {
271
+ throw err;
272
+ }
273
+ console.error(err);
274
+ }
275
+
276
+ return this.resultCode;
277
+ }
278
+
279
+ toString() {
280
+ const parts = ["* BESSConfidenceIntervalEnergyScaling"];
281
+
282
+ parts.push(`kUpper: ${String(this.kUpper)}`);
283
+ parts.push(`kLower: ${String(this.kLower)}`);
284
+ parts.push(`resultCode: ${String(this.resultCode)}`);
285
+ parts.push("*** messages:");
286
+ parts.push(`messages: ${this.messages !== undefined ? this.messages : "(None)"}`);
287
+ parts.push(`calculationElapsedTime: ${this.calculationElapsedTime !== undefined ? this.calculationElapsedTime : "(None)"}`);
288
+ parts.push(`operationId: ${this.operationId !== undefined ? this.operationId : "(None)"}`);
289
+
290
+ return parts.join("\n");
291
+ }
292
+ }
293
+
294
+ export class BESSConfidenceIntervalEnergyScalingCalculationResponse extends CalculationResponseBase {
295
+ kUpper: number;
296
+ kLower: number;
297
+
298
+ /**
299
+ * BESSConfidenceIntervalEnergyScaling calculation response class.
300
+ *
301
+ */
302
+ constructor(data: {
303
+ kUpper: number,
304
+ kLower: number,
305
+ resultCode: Enums.ResultCode,
306
+ messages: string[],
307
+ calculationElapsedTime: number,
308
+ operationId: string
309
+ }) {
310
+ super();
311
+ this.kUpper = data.kUpper;
312
+ this.kLower = data.kLower;
313
+ this.resultCode = data.resultCode;
314
+ this.messages = data.messages;
315
+ this.calculationElapsedTime = data.calculationElapsedTime;
316
+ this.operationId = data.operationId;
317
+ }
318
+
319
+ initialiseFromDictionary(data: { [key: string]: unknown }) {
320
+ if (data.kUpper !== undefined && typeof data.kUpper === "number") {
321
+ this.kUpper = data.kUpper as number;
322
+ }
323
+ if (data.kLower !== undefined && typeof data.kLower === "number") {
324
+ this.kLower = data.kLower as number;
325
+ }
326
+ if (data.resultCode !== undefined && (typeof data.resultCode === "string" || typeof data.resultCode === "number")) {
327
+ this.resultCode = data.resultCode as Enums.ResultCode;
328
+ }
329
+ this.messages = this.messages ?? [];
330
+ if (data.messages && Array.isArray(data.messages)) {
331
+ this.messages.push(...data.messages);
332
+ }
333
+ if (data.calculationElapsedTime !== undefined && typeof data.calculationElapsedTime === "number") {
334
+ this.calculationElapsedTime = data.calculationElapsedTime as number;
335
+ }
336
+ if (data.operationId !== undefined && typeof data.operationId === "string") {
337
+ this.operationId = data.operationId as string;
338
+ }
339
+ }
340
+ }
341
+
342
+ export interface BESSConfidenceIntervalEnergyScalingCalculationResponseSchemaData {
343
+ kUpper: number;
344
+ kLower: number;
345
+ resultCode: Enums.ResultCode;
346
+ messages: string[];
347
+ calculationElapsedTime: number;
348
+ operationId: string;
349
+ }
350
+
351
+ export class BESSConfidenceIntervalEnergyScalingCalculationResponseSchema {
352
+ schema: Joi.ObjectSchema;
353
+ propertyTypes: Record<string, string>;
354
+
355
+ /**
356
+ * Schema for the BESSConfidenceIntervalEnergyScaling calculation response.
357
+ */
358
+ constructor() {
359
+ this.schema = Joi.object({
360
+ kUpper: Joi.number().unsafe(),
361
+ kLower: Joi.number().unsafe(),
362
+ resultCode: Joi.string().valid(...Object.values(Enums.ResultCode)),
363
+ messages: Joi.array().items(Joi.string()),
364
+ calculationElapsedTime: Joi.number().unsafe(),
365
+ operationId: Joi.string().uuid().allow(null),
366
+ }).unknown(true);
367
+
368
+ this.propertyTypes = {
369
+ kUpper: "number",
370
+ kLower: "number",
371
+ };
372
+ }
373
+
374
+ validate(data: BESSConfidenceIntervalEnergyScalingCalculationResponseSchemaData): BESSConfidenceIntervalEnergyScalingCalculationResponse {
375
+ const { error, value } = this.schema.validate(data, { abortEarly: false });
376
+ if (error) {
377
+ throw new Error(`Validation error: ${error.details.map((x) => x.message).join(", ")}`);
378
+ }
379
+ return this.makeCalculationResponse(value);
380
+ }
381
+
382
+ makeCalculationResponse(data: BESSConfidenceIntervalEnergyScalingCalculationResponseSchemaData): BESSConfidenceIntervalEnergyScalingCalculationResponse {
383
+ return new BESSConfidenceIntervalEnergyScalingCalculationResponse(data);
384
+ }
385
+ }
386
+
156
387
  export interface BESSToxicSourceCalculationRequestSchemaData {
157
388
  bessUnit: Entities.BESSUnit;
158
389
  bessRelease: Entities.BESSRelease;
@@ -165,16 +396,14 @@ class BESSToxicSourceCalculationRequest extends CalculationRequestBase {
165
396
  /**
166
397
  * BESSToxicSource calculation request class.
167
398
  *
168
- * @param {Entities.BESSUnit} bessUnit - BESS unit under thermal runaway.
169
- * @param {Entities.BESSRelease} bessRelease - Specifics of the release from the unit being considered.
170
399
  */
171
- constructor(
400
+ constructor(data: {
172
401
  bessUnit: Entities.BESSUnit,
173
402
  bessRelease: Entities.BESSRelease
174
- ) {
403
+ }) {
175
404
  super();
176
- this.bessUnit = bessUnit;
177
- this.bessRelease = bessRelease;
405
+ this.bessUnit = data.bessUnit;
406
+ this.bessRelease = data.bessRelease;
178
407
  }
179
408
  }
180
409
 
@@ -206,10 +435,7 @@ export class BESSToxicSourceCalculationRequestSchema {
206
435
  }
207
436
 
208
437
  makeCalculationRequest(data: BESSToxicSourceCalculationRequestSchemaData): BESSToxicSourceCalculationRequest {
209
- return new BESSToxicSourceCalculationRequest(
210
- data.bessUnit,
211
- data.bessRelease
212
- );
438
+ return new BESSToxicSourceCalculationRequest(data);
213
439
  }
214
440
  }
215
441
 
@@ -223,24 +449,23 @@ export class BESSToxicSourceCalculation extends CalculationBase {
223
449
  /**
224
450
  * Toxic outflow from a BESS unit.
225
451
  *
226
- * @param {Entities.BESSUnit} bessUnit - BESS unit under thermal runaway.
227
- * @param {Entities.BESSRelease} bessRelease - Specifics of the release from the unit being considered.
228
452
  */
229
- constructor(
453
+ constructor(data: {
230
454
  bessUnit: Entities.BESSUnit,
231
455
  bessRelease: Entities.BESSRelease
232
- ) {
233
- super();
234
- this.bessUnit = bessUnit;
235
- this.bessRelease = bessRelease;
456
+ controller?: AbortController;
457
+ }) {
458
+ super(data.controller);
459
+ this.bessUnit = data.bessUnit;
460
+ this.bessRelease = data.bessRelease;
236
461
  }
237
462
 
238
463
  async run() {
239
464
  try {
240
- const request = new BESSToxicSourceCalculationRequest(
241
- this.bessUnit,
242
- this.bessRelease
243
- );
465
+ const request = new BESSToxicSourceCalculationRequest({
466
+ bessUnit: this.bessUnit,
467
+ bessRelease: this.bessRelease
468
+ });
244
469
 
245
470
  const schema = new BESSToxicSourceCalculationRequestSchema();
246
471
  const validatedRequest = schema.validate(request);
@@ -310,11 +535,8 @@ export class BESSToxicSourceCalculationResponse extends CalculationResponseBase
310
535
  /**
311
536
  * BESSToxicSource calculation response class.
312
537
  *
313
- * @param {Entities.Material} bessMaterial - Composition of the released material (dependent on batter chemistry).
314
- * @param {Entities.DischargeResult} dischargeResult - Scalar discharge results.
315
- * @param {Entities.DischargeRecord[]} dischargeRecords - Array of discharge records.
316
538
  */
317
- constructor(
539
+ constructor(data: {
318
540
  bessMaterial: Entities.Material,
319
541
  dischargeResult: Entities.DischargeResult,
320
542
  dischargeRecords: Entities.DischargeRecord[],
@@ -322,15 +544,15 @@ export class BESSToxicSourceCalculationResponse extends CalculationResponseBase
322
544
  messages: string[],
323
545
  calculationElapsedTime: number,
324
546
  operationId: string
325
- ) {
547
+ }) {
326
548
  super();
327
- this.bessMaterial = bessMaterial;
328
- this.dischargeResult = dischargeResult;
329
- this.dischargeRecords = dischargeRecords;
330
- this.resultCode = resultCode;
331
- this.messages = messages;
332
- this.calculationElapsedTime = calculationElapsedTime;
333
- this.operationId = operationId;
549
+ this.bessMaterial = data.bessMaterial;
550
+ this.dischargeResult = data.dischargeResult;
551
+ this.dischargeRecords = data.dischargeRecords;
552
+ this.resultCode = data.resultCode;
553
+ this.messages = data.messages;
554
+ this.calculationElapsedTime = data.calculationElapsedTime;
555
+ this.operationId = data.operationId;
334
556
  }
335
557
 
336
558
  initialiseFromDictionary(data: { [key: string]: unknown }) {
@@ -411,15 +633,7 @@ export class BESSToxicSourceCalculationResponseSchema {
411
633
  }
412
634
 
413
635
  makeCalculationResponse(data: BESSToxicSourceCalculationResponseSchemaData): BESSToxicSourceCalculationResponse {
414
- return new BESSToxicSourceCalculationResponse(
415
- data.bessMaterial,
416
- data.dischargeResult,
417
- data.dischargeRecords,
418
- data.resultCode,
419
- data.messages,
420
- data.calculationElapsedTime,
421
- data.operationId
422
- );
636
+ return new BESSToxicSourceCalculationResponse(data);
423
637
  }
424
638
  }
425
639
 
@@ -437,19 +651,16 @@ class LongPipeBreachCalculationRequest extends CalculationRequestBase {
437
651
  /**
438
652
  * LongPipeBreach calculation request class.
439
653
  *
440
- * @param {Entities.Pipe} pipe - a pipe entity.
441
- * @param {Entities.PipeBreach} pipeBreach - a pipe breach entity.
442
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
443
654
  */
444
- constructor(
655
+ constructor(data: {
445
656
  pipe: Entities.Pipe,
446
657
  pipeBreach: Entities.PipeBreach,
447
658
  dischargeParameters: Entities.DischargeParameters
448
- ) {
659
+ }) {
449
660
  super();
450
- this.pipe = pipe;
451
- this.pipeBreach = pipeBreach;
452
- this.dischargeParameters = dischargeParameters;
661
+ this.pipe = data.pipe;
662
+ this.pipeBreach = data.pipeBreach;
663
+ this.dischargeParameters = data.dischargeParameters;
453
664
  }
454
665
  }
455
666
 
@@ -483,11 +694,7 @@ export class LongPipeBreachCalculationRequestSchema {
483
694
  }
484
695
 
485
696
  makeCalculationRequest(data: LongPipeBreachCalculationRequestSchemaData): LongPipeBreachCalculationRequest {
486
- return new LongPipeBreachCalculationRequest(
487
- data.pipe,
488
- data.pipeBreach,
489
- data.dischargeParameters
490
- );
697
+ return new LongPipeBreachCalculationRequest(data);
491
698
  }
492
699
  }
493
700
 
@@ -505,28 +712,26 @@ export class LongPipeBreachCalculation extends CalculationBase {
505
712
  state entity for which pressure gauge is not the right definition, i.e. the final state discharge, state specification for
506
713
  flash calculation, etc.
507
714
  *
508
- * @param {Entities.Pipe} pipe - a pipe entity.
509
- * @param {Entities.PipeBreach} pipeBreach - a pipe breach entity.
510
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
511
715
  */
512
- constructor(
716
+ constructor(data: {
513
717
  pipe: Entities.Pipe,
514
718
  pipeBreach: Entities.PipeBreach,
515
719
  dischargeParameters: Entities.DischargeParameters
516
- ) {
517
- super();
518
- this.pipe = pipe;
519
- this.pipeBreach = pipeBreach;
520
- this.dischargeParameters = dischargeParameters;
720
+ controller?: AbortController;
721
+ }) {
722
+ super(data.controller);
723
+ this.pipe = data.pipe;
724
+ this.pipeBreach = data.pipeBreach;
725
+ this.dischargeParameters = data.dischargeParameters;
521
726
  }
522
727
 
523
728
  async run() {
524
729
  try {
525
- const request = new LongPipeBreachCalculationRequest(
526
- this.pipe,
527
- this.pipeBreach,
528
- this.dischargeParameters
529
- );
730
+ const request = new LongPipeBreachCalculationRequest({
731
+ pipe: this.pipe,
732
+ pipeBreach: this.pipeBreach,
733
+ dischargeParameters: this.dischargeParameters
734
+ });
530
735
 
531
736
  const schema = new LongPipeBreachCalculationRequestSchema();
532
737
  const validatedRequest = schema.validate(request);
@@ -596,11 +801,8 @@ export class LongPipeBreachCalculationResponse extends CalculationResponseBase {
596
801
  /**
597
802
  * LongPipeBreach calculation response class.
598
803
  *
599
- * @param {Entities.Material} exitMaterial - a material entity, representing composition of the released material.
600
- * @param {Entities.DischargeResult} dischargeResult - Scalar discharge results.
601
- * @param {Entities.DischargeRecord[]} dischargeRecords - an array of discharge records.
602
804
  */
603
- constructor(
805
+ constructor(data: {
604
806
  exitMaterial: Entities.Material,
605
807
  dischargeResult: Entities.DischargeResult,
606
808
  dischargeRecords: Entities.DischargeRecord[],
@@ -608,15 +810,15 @@ export class LongPipeBreachCalculationResponse extends CalculationResponseBase {
608
810
  messages: string[],
609
811
  calculationElapsedTime: number,
610
812
  operationId: string
611
- ) {
813
+ }) {
612
814
  super();
613
- this.exitMaterial = exitMaterial;
614
- this.dischargeResult = dischargeResult;
615
- this.dischargeRecords = dischargeRecords;
616
- this.resultCode = resultCode;
617
- this.messages = messages;
618
- this.calculationElapsedTime = calculationElapsedTime;
619
- this.operationId = operationId;
815
+ this.exitMaterial = data.exitMaterial;
816
+ this.dischargeResult = data.dischargeResult;
817
+ this.dischargeRecords = data.dischargeRecords;
818
+ this.resultCode = data.resultCode;
819
+ this.messages = data.messages;
820
+ this.calculationElapsedTime = data.calculationElapsedTime;
821
+ this.operationId = data.operationId;
620
822
  }
621
823
 
622
824
  initialiseFromDictionary(data: { [key: string]: unknown }) {
@@ -697,15 +899,7 @@ export class LongPipeBreachCalculationResponseSchema {
697
899
  }
698
900
 
699
901
  makeCalculationResponse(data: LongPipeBreachCalculationResponseSchemaData): LongPipeBreachCalculationResponse {
700
- return new LongPipeBreachCalculationResponse(
701
- data.exitMaterial,
702
- data.dischargeResult,
703
- data.dischargeRecords,
704
- data.resultCode,
705
- data.messages,
706
- data.calculationElapsedTime,
707
- data.operationId
708
- );
902
+ return new LongPipeBreachCalculationResponse(data);
709
903
  }
710
904
  }
711
905
 
@@ -721,16 +915,14 @@ class VesselCatastrophicRuptureCalculationRequest extends CalculationRequestBase
721
915
  /**
722
916
  * VesselCatastrophicRupture calculation request class.
723
917
  *
724
- * @param {Entities.Vessel} vessel - a vessel entity.
725
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
726
918
  */
727
- constructor(
919
+ constructor(data: {
728
920
  vessel: Entities.Vessel,
729
921
  dischargeParameters: Entities.DischargeParameters
730
- ) {
922
+ }) {
731
923
  super();
732
- this.vessel = vessel;
733
- this.dischargeParameters = dischargeParameters;
924
+ this.vessel = data.vessel;
925
+ this.dischargeParameters = data.dischargeParameters;
734
926
  }
735
927
  }
736
928
 
@@ -762,10 +954,7 @@ export class VesselCatastrophicRuptureCalculationRequestSchema {
762
954
  }
763
955
 
764
956
  makeCalculationRequest(data: VesselCatastrophicRuptureCalculationRequestSchemaData): VesselCatastrophicRuptureCalculationRequest {
765
- return new VesselCatastrophicRuptureCalculationRequest(
766
- data.vessel,
767
- data.dischargeParameters
768
- );
957
+ return new VesselCatastrophicRuptureCalculationRequest(data);
769
958
  }
770
959
  }
771
960
 
@@ -779,24 +968,23 @@ export class VesselCatastrophicRuptureCalculation extends CalculationBase {
779
968
  /**
780
969
  * Calculates the instantaneous release from a pressure vessel or storage tank. It includes expansion modelling to atmospheric conditions. The discharge mass, temperature, and other outputs are reported back as discharge records. The height of the release is located at the midpoint of the vessel.
781
970
  *
782
- * @param {Entities.Vessel} vessel - a vessel entity.
783
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
784
971
  */
785
- constructor(
972
+ constructor(data: {
786
973
  vessel: Entities.Vessel,
787
974
  dischargeParameters: Entities.DischargeParameters
788
- ) {
789
- super();
790
- this.vessel = vessel;
791
- this.dischargeParameters = dischargeParameters;
975
+ controller?: AbortController;
976
+ }) {
977
+ super(data.controller);
978
+ this.vessel = data.vessel;
979
+ this.dischargeParameters = data.dischargeParameters;
792
980
  }
793
981
 
794
982
  async run() {
795
983
  try {
796
- const request = new VesselCatastrophicRuptureCalculationRequest(
797
- this.vessel,
798
- this.dischargeParameters
799
- );
984
+ const request = new VesselCatastrophicRuptureCalculationRequest({
985
+ vessel: this.vessel,
986
+ dischargeParameters: this.dischargeParameters
987
+ });
800
988
 
801
989
  const schema = new VesselCatastrophicRuptureCalculationRequestSchema();
802
990
  const validatedRequest = schema.validate(request);
@@ -866,11 +1054,8 @@ export class VesselCatastrophicRuptureCalculationResponse extends CalculationRes
866
1054
  /**
867
1055
  * VesselCatastrophicRupture calculation response class.
868
1056
  *
869
- * @param {Entities.Material} exitMaterial - a material entity representing the released material (indentical to storage composition).
870
- * @param {Entities.DischargeResult} dischargeResult - Scalar discharge results.
871
- * @param {Entities.DischargeRecord[]} dischargeRecords - an array of discharge records.
872
1057
  */
873
- constructor(
1058
+ constructor(data: {
874
1059
  exitMaterial: Entities.Material,
875
1060
  dischargeResult: Entities.DischargeResult,
876
1061
  dischargeRecords: Entities.DischargeRecord[],
@@ -878,15 +1063,15 @@ export class VesselCatastrophicRuptureCalculationResponse extends CalculationRes
878
1063
  messages: string[],
879
1064
  calculationElapsedTime: number,
880
1065
  operationId: string
881
- ) {
1066
+ }) {
882
1067
  super();
883
- this.exitMaterial = exitMaterial;
884
- this.dischargeResult = dischargeResult;
885
- this.dischargeRecords = dischargeRecords;
886
- this.resultCode = resultCode;
887
- this.messages = messages;
888
- this.calculationElapsedTime = calculationElapsedTime;
889
- this.operationId = operationId;
1068
+ this.exitMaterial = data.exitMaterial;
1069
+ this.dischargeResult = data.dischargeResult;
1070
+ this.dischargeRecords = data.dischargeRecords;
1071
+ this.resultCode = data.resultCode;
1072
+ this.messages = data.messages;
1073
+ this.calculationElapsedTime = data.calculationElapsedTime;
1074
+ this.operationId = data.operationId;
890
1075
  }
891
1076
 
892
1077
  initialiseFromDictionary(data: { [key: string]: unknown }) {
@@ -967,15 +1152,7 @@ export class VesselCatastrophicRuptureCalculationResponseSchema {
967
1152
  }
968
1153
 
969
1154
  makeCalculationResponse(data: VesselCatastrophicRuptureCalculationResponseSchemaData): VesselCatastrophicRuptureCalculationResponse {
970
- return new VesselCatastrophicRuptureCalculationResponse(
971
- data.exitMaterial,
972
- data.dischargeResult,
973
- data.dischargeRecords,
974
- data.resultCode,
975
- data.messages,
976
- data.calculationElapsedTime,
977
- data.operationId
978
- );
1155
+ return new VesselCatastrophicRuptureCalculationResponse(data);
979
1156
  }
980
1157
  }
981
1158
 
@@ -993,19 +1170,16 @@ class VesselLeakCalculationRequest extends CalculationRequestBase {
993
1170
  /**
994
1171
  * VesselLeak calculation request class.
995
1172
  *
996
- * @param {Entities.Vessel} vessel - a vessel entity.
997
- * @param {Entities.Leak} leak - a leak entity.
998
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
999
1173
  */
1000
- constructor(
1174
+ constructor(data: {
1001
1175
  vessel: Entities.Vessel,
1002
1176
  leak: Entities.Leak,
1003
1177
  dischargeParameters: Entities.DischargeParameters
1004
- ) {
1178
+ }) {
1005
1179
  super();
1006
- this.vessel = vessel;
1007
- this.leak = leak;
1008
- this.dischargeParameters = dischargeParameters;
1180
+ this.vessel = data.vessel;
1181
+ this.leak = data.leak;
1182
+ this.dischargeParameters = data.dischargeParameters;
1009
1183
  }
1010
1184
  }
1011
1185
 
@@ -1039,11 +1213,7 @@ export class VesselLeakCalculationRequestSchema {
1039
1213
  }
1040
1214
 
1041
1215
  makeCalculationRequest(data: VesselLeakCalculationRequestSchemaData): VesselLeakCalculationRequest {
1042
- return new VesselLeakCalculationRequest(
1043
- data.vessel,
1044
- data.leak,
1045
- data.dischargeParameters
1046
- );
1216
+ return new VesselLeakCalculationRequest(data);
1047
1217
  }
1048
1218
  }
1049
1219
 
@@ -1058,28 +1228,26 @@ export class VesselLeakCalculation extends CalculationBase {
1058
1228
  /**
1059
1229
  * Calculates the steady state or time-varying leak from a pressure vessel or storage tank. It includes expansion modelling (from the vessel orifice to atmospheric conditions). The discharge rate, temperature, and other time-dependent outputs at a particular time are reported back as discharge records. For steady-state there are always two DischargeRecords generated; for time-varying the number can vary.
1060
1230
  *
1061
- * @param {Entities.Vessel} vessel - a vessel entity.
1062
- * @param {Entities.Leak} leak - a leak entity.
1063
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
1064
1231
  */
1065
- constructor(
1232
+ constructor(data: {
1066
1233
  vessel: Entities.Vessel,
1067
1234
  leak: Entities.Leak,
1068
1235
  dischargeParameters: Entities.DischargeParameters
1069
- ) {
1070
- super();
1071
- this.vessel = vessel;
1072
- this.leak = leak;
1073
- this.dischargeParameters = dischargeParameters;
1236
+ controller?: AbortController;
1237
+ }) {
1238
+ super(data.controller);
1239
+ this.vessel = data.vessel;
1240
+ this.leak = data.leak;
1241
+ this.dischargeParameters = data.dischargeParameters;
1074
1242
  }
1075
1243
 
1076
1244
  async run() {
1077
1245
  try {
1078
- const request = new VesselLeakCalculationRequest(
1079
- this.vessel,
1080
- this.leak,
1081
- this.dischargeParameters
1082
- );
1246
+ const request = new VesselLeakCalculationRequest({
1247
+ vessel: this.vessel,
1248
+ leak: this.leak,
1249
+ dischargeParameters: this.dischargeParameters
1250
+ });
1083
1251
 
1084
1252
  const schema = new VesselLeakCalculationRequestSchema();
1085
1253
  const validatedRequest = schema.validate(request);
@@ -1149,11 +1317,8 @@ export class VesselLeakCalculationResponse extends CalculationResponseBase {
1149
1317
  /**
1150
1318
  * VesselLeak calculation response class.
1151
1319
  *
1152
- * @param {Entities.Material} exitMaterial - a material entity representing the released material (may differ from storage composition).
1153
- * @param {Entities.DischargeResult} dischargeResult - Scalar discharge results.
1154
- * @param {Entities.DischargeRecord[]} dischargeRecords - an array of discharge records.
1155
1320
  */
1156
- constructor(
1321
+ constructor(data: {
1157
1322
  exitMaterial: Entities.Material,
1158
1323
  dischargeResult: Entities.DischargeResult,
1159
1324
  dischargeRecords: Entities.DischargeRecord[],
@@ -1161,15 +1326,15 @@ export class VesselLeakCalculationResponse extends CalculationResponseBase {
1161
1326
  messages: string[],
1162
1327
  calculationElapsedTime: number,
1163
1328
  operationId: string
1164
- ) {
1329
+ }) {
1165
1330
  super();
1166
- this.exitMaterial = exitMaterial;
1167
- this.dischargeResult = dischargeResult;
1168
- this.dischargeRecords = dischargeRecords;
1169
- this.resultCode = resultCode;
1170
- this.messages = messages;
1171
- this.calculationElapsedTime = calculationElapsedTime;
1172
- this.operationId = operationId;
1331
+ this.exitMaterial = data.exitMaterial;
1332
+ this.dischargeResult = data.dischargeResult;
1333
+ this.dischargeRecords = data.dischargeRecords;
1334
+ this.resultCode = data.resultCode;
1335
+ this.messages = data.messages;
1336
+ this.calculationElapsedTime = data.calculationElapsedTime;
1337
+ this.operationId = data.operationId;
1173
1338
  }
1174
1339
 
1175
1340
  initialiseFromDictionary(data: { [key: string]: unknown }) {
@@ -1250,15 +1415,7 @@ export class VesselLeakCalculationResponseSchema {
1250
1415
  }
1251
1416
 
1252
1417
  makeCalculationResponse(data: VesselLeakCalculationResponseSchemaData): VesselLeakCalculationResponse {
1253
- return new VesselLeakCalculationResponse(
1254
- data.exitMaterial,
1255
- data.dischargeResult,
1256
- data.dischargeRecords,
1257
- data.resultCode,
1258
- data.messages,
1259
- data.calculationElapsedTime,
1260
- data.operationId
1261
- );
1418
+ return new VesselLeakCalculationResponse(data);
1262
1419
  }
1263
1420
  }
1264
1421
 
@@ -1276,19 +1433,16 @@ class VesselLineRuptureCalculationRequest extends CalculationRequestBase {
1276
1433
  /**
1277
1434
  * VesselLineRupture calculation request class.
1278
1435
  *
1279
- * @param {Entities.Vessel} vessel - a vessel entity.
1280
- * @param {Entities.LineRupture} lineRupture - a line rupture entity.
1281
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
1282
1436
  */
1283
- constructor(
1437
+ constructor(data: {
1284
1438
  vessel: Entities.Vessel,
1285
1439
  lineRupture: Entities.LineRupture,
1286
1440
  dischargeParameters: Entities.DischargeParameters
1287
- ) {
1441
+ }) {
1288
1442
  super();
1289
- this.vessel = vessel;
1290
- this.lineRupture = lineRupture;
1291
- this.dischargeParameters = dischargeParameters;
1443
+ this.vessel = data.vessel;
1444
+ this.lineRupture = data.lineRupture;
1445
+ this.dischargeParameters = data.dischargeParameters;
1292
1446
  }
1293
1447
  }
1294
1448
 
@@ -1322,11 +1476,7 @@ export class VesselLineRuptureCalculationRequestSchema {
1322
1476
  }
1323
1477
 
1324
1478
  makeCalculationRequest(data: VesselLineRuptureCalculationRequestSchemaData): VesselLineRuptureCalculationRequest {
1325
- return new VesselLineRuptureCalculationRequest(
1326
- data.vessel,
1327
- data.lineRupture,
1328
- data.dischargeParameters
1329
- );
1479
+ return new VesselLineRuptureCalculationRequest(data);
1330
1480
  }
1331
1481
  }
1332
1482
 
@@ -1341,28 +1491,26 @@ export class VesselLineRuptureCalculation extends CalculationBase {
1341
1491
  /**
1342
1492
  * Calculations of discharge from a short pipe attached to a vessel.
1343
1493
  *
1344
- * @param {Entities.Vessel} vessel - a vessel entity.
1345
- * @param {Entities.LineRupture} lineRupture - a line rupture entity.
1346
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
1347
1494
  */
1348
- constructor(
1495
+ constructor(data: {
1349
1496
  vessel: Entities.Vessel,
1350
1497
  lineRupture: Entities.LineRupture,
1351
1498
  dischargeParameters: Entities.DischargeParameters
1352
- ) {
1353
- super();
1354
- this.vessel = vessel;
1355
- this.lineRupture = lineRupture;
1356
- this.dischargeParameters = dischargeParameters;
1499
+ controller?: AbortController;
1500
+ }) {
1501
+ super(data.controller);
1502
+ this.vessel = data.vessel;
1503
+ this.lineRupture = data.lineRupture;
1504
+ this.dischargeParameters = data.dischargeParameters;
1357
1505
  }
1358
1506
 
1359
1507
  async run() {
1360
1508
  try {
1361
- const request = new VesselLineRuptureCalculationRequest(
1362
- this.vessel,
1363
- this.lineRupture,
1364
- this.dischargeParameters
1365
- );
1509
+ const request = new VesselLineRuptureCalculationRequest({
1510
+ vessel: this.vessel,
1511
+ lineRupture: this.lineRupture,
1512
+ dischargeParameters: this.dischargeParameters
1513
+ });
1366
1514
 
1367
1515
  const schema = new VesselLineRuptureCalculationRequestSchema();
1368
1516
  const validatedRequest = schema.validate(request);
@@ -1432,11 +1580,8 @@ export class VesselLineRuptureCalculationResponse extends CalculationResponseBas
1432
1580
  /**
1433
1581
  * VesselLineRupture calculation response class.
1434
1582
  *
1435
- * @param {Entities.Material} exitMaterial - a material entity representing the released material (which may differ from storage composition).
1436
- * @param {Entities.DischargeResult} dischargeResult - Scalar discharge results.
1437
- * @param {Entities.DischargeRecord[]} dischargeRecords - an array of discharge records.
1438
1583
  */
1439
- constructor(
1584
+ constructor(data: {
1440
1585
  exitMaterial: Entities.Material,
1441
1586
  dischargeResult: Entities.DischargeResult,
1442
1587
  dischargeRecords: Entities.DischargeRecord[],
@@ -1444,15 +1589,15 @@ export class VesselLineRuptureCalculationResponse extends CalculationResponseBas
1444
1589
  messages: string[],
1445
1590
  calculationElapsedTime: number,
1446
1591
  operationId: string
1447
- ) {
1592
+ }) {
1448
1593
  super();
1449
- this.exitMaterial = exitMaterial;
1450
- this.dischargeResult = dischargeResult;
1451
- this.dischargeRecords = dischargeRecords;
1452
- this.resultCode = resultCode;
1453
- this.messages = messages;
1454
- this.calculationElapsedTime = calculationElapsedTime;
1455
- this.operationId = operationId;
1594
+ this.exitMaterial = data.exitMaterial;
1595
+ this.dischargeResult = data.dischargeResult;
1596
+ this.dischargeRecords = data.dischargeRecords;
1597
+ this.resultCode = data.resultCode;
1598
+ this.messages = data.messages;
1599
+ this.calculationElapsedTime = data.calculationElapsedTime;
1600
+ this.operationId = data.operationId;
1456
1601
  }
1457
1602
 
1458
1603
  initialiseFromDictionary(data: { [key: string]: unknown }) {
@@ -1533,15 +1678,7 @@ export class VesselLineRuptureCalculationResponseSchema {
1533
1678
  }
1534
1679
 
1535
1680
  makeCalculationResponse(data: VesselLineRuptureCalculationResponseSchemaData): VesselLineRuptureCalculationResponse {
1536
- return new VesselLineRuptureCalculationResponse(
1537
- data.exitMaterial,
1538
- data.dischargeResult,
1539
- data.dischargeRecords,
1540
- data.resultCode,
1541
- data.messages,
1542
- data.calculationElapsedTime,
1543
- data.operationId
1544
- );
1681
+ return new VesselLineRuptureCalculationResponse(data);
1545
1682
  }
1546
1683
  }
1547
1684
 
@@ -1559,19 +1696,16 @@ class VesselReliefValveCalculationRequest extends CalculationRequestBase {
1559
1696
  /**
1560
1697
  * VesselReliefValve calculation request class.
1561
1698
  *
1562
- * @param {Entities.Vessel} vessel - a vessel entity.
1563
- * @param {Entities.ReliefValve} reliefValve - a relief valve entity.
1564
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
1565
1699
  */
1566
- constructor(
1700
+ constructor(data: {
1567
1701
  vessel: Entities.Vessel,
1568
1702
  reliefValve: Entities.ReliefValve,
1569
1703
  dischargeParameters: Entities.DischargeParameters
1570
- ) {
1704
+ }) {
1571
1705
  super();
1572
- this.vessel = vessel;
1573
- this.reliefValve = reliefValve;
1574
- this.dischargeParameters = dischargeParameters;
1706
+ this.vessel = data.vessel;
1707
+ this.reliefValve = data.reliefValve;
1708
+ this.dischargeParameters = data.dischargeParameters;
1575
1709
  }
1576
1710
  }
1577
1711
 
@@ -1605,11 +1739,7 @@ export class VesselReliefValveCalculationRequestSchema {
1605
1739
  }
1606
1740
 
1607
1741
  makeCalculationRequest(data: VesselReliefValveCalculationRequestSchemaData): VesselReliefValveCalculationRequest {
1608
- return new VesselReliefValveCalculationRequest(
1609
- data.vessel,
1610
- data.reliefValve,
1611
- data.dischargeParameters
1612
- );
1742
+ return new VesselReliefValveCalculationRequest(data);
1613
1743
  }
1614
1744
  }
1615
1745
 
@@ -1624,28 +1754,26 @@ export class VesselReliefValveCalculation extends CalculationBase {
1624
1754
  /**
1625
1755
  * Calculations of venting from a relief valve attached to a vessel.
1626
1756
  *
1627
- * @param {Entities.Vessel} vessel - a vessel entity.
1628
- * @param {Entities.ReliefValve} reliefValve - a relief valve entity.
1629
- * @param {Entities.DischargeParameters} dischargeParameters - a discharge parameters entity.
1630
1757
  */
1631
- constructor(
1758
+ constructor(data: {
1632
1759
  vessel: Entities.Vessel,
1633
1760
  reliefValve: Entities.ReliefValve,
1634
1761
  dischargeParameters: Entities.DischargeParameters
1635
- ) {
1636
- super();
1637
- this.vessel = vessel;
1638
- this.reliefValve = reliefValve;
1639
- this.dischargeParameters = dischargeParameters;
1762
+ controller?: AbortController;
1763
+ }) {
1764
+ super(data.controller);
1765
+ this.vessel = data.vessel;
1766
+ this.reliefValve = data.reliefValve;
1767
+ this.dischargeParameters = data.dischargeParameters;
1640
1768
  }
1641
1769
 
1642
1770
  async run() {
1643
1771
  try {
1644
- const request = new VesselReliefValveCalculationRequest(
1645
- this.vessel,
1646
- this.reliefValve,
1647
- this.dischargeParameters
1648
- );
1772
+ const request = new VesselReliefValveCalculationRequest({
1773
+ vessel: this.vessel,
1774
+ reliefValve: this.reliefValve,
1775
+ dischargeParameters: this.dischargeParameters
1776
+ });
1649
1777
 
1650
1778
  const schema = new VesselReliefValveCalculationRequestSchema();
1651
1779
  const validatedRequest = schema.validate(request);
@@ -1715,11 +1843,8 @@ export class VesselReliefValveCalculationResponse extends CalculationResponseBas
1715
1843
  /**
1716
1844
  * VesselReliefValve calculation response class.
1717
1845
  *
1718
- * @param {Entities.Material} exitMaterial - a material entity representing the released material (which may differ from storage composition).
1719
- * @param {Entities.DischargeResult} dischargeResult - Scalar discharge results.
1720
- * @param {Entities.DischargeRecord[]} dischargeRecords - an array of discharge records.
1721
1846
  */
1722
- constructor(
1847
+ constructor(data: {
1723
1848
  exitMaterial: Entities.Material,
1724
1849
  dischargeResult: Entities.DischargeResult,
1725
1850
  dischargeRecords: Entities.DischargeRecord[],
@@ -1727,15 +1852,15 @@ export class VesselReliefValveCalculationResponse extends CalculationResponseBas
1727
1852
  messages: string[],
1728
1853
  calculationElapsedTime: number,
1729
1854
  operationId: string
1730
- ) {
1855
+ }) {
1731
1856
  super();
1732
- this.exitMaterial = exitMaterial;
1733
- this.dischargeResult = dischargeResult;
1734
- this.dischargeRecords = dischargeRecords;
1735
- this.resultCode = resultCode;
1736
- this.messages = messages;
1737
- this.calculationElapsedTime = calculationElapsedTime;
1738
- this.operationId = operationId;
1857
+ this.exitMaterial = data.exitMaterial;
1858
+ this.dischargeResult = data.dischargeResult;
1859
+ this.dischargeRecords = data.dischargeRecords;
1860
+ this.resultCode = data.resultCode;
1861
+ this.messages = data.messages;
1862
+ this.calculationElapsedTime = data.calculationElapsedTime;
1863
+ this.operationId = data.operationId;
1739
1864
  }
1740
1865
 
1741
1866
  initialiseFromDictionary(data: { [key: string]: unknown }) {
@@ -1816,15 +1941,7 @@ export class VesselReliefValveCalculationResponseSchema {
1816
1941
  }
1817
1942
 
1818
1943
  makeCalculationResponse(data: VesselReliefValveCalculationResponseSchemaData): VesselReliefValveCalculationResponse {
1819
- return new VesselReliefValveCalculationResponse(
1820
- data.exitMaterial,
1821
- data.dischargeResult,
1822
- data.dischargeRecords,
1823
- data.resultCode,
1824
- data.messages,
1825
- data.calculationElapsedTime,
1826
- data.operationId
1827
- );
1944
+ return new VesselReliefValveCalculationResponse(data);
1828
1945
  }
1829
1946
  }
1830
1947
 
@@ -1840,16 +1957,14 @@ class VesselStateCalculationRequest extends CalculationRequestBase {
1840
1957
  /**
1841
1958
  * VesselState calculation request class.
1842
1959
  *
1843
- * @param {Entities.Material} material - a material entity.
1844
- * @param {Entities.State} materialState - a state entity describing the fluid pressure, temperature, liquid fraction.
1845
1960
  */
1846
- constructor(
1961
+ constructor(data: {
1847
1962
  material: Entities.Material,
1848
1963
  materialState: Entities.State
1849
- ) {
1964
+ }) {
1850
1965
  super();
1851
- this.material = material;
1852
- this.materialState = materialState;
1966
+ this.material = data.material;
1967
+ this.materialState = data.materialState;
1853
1968
  }
1854
1969
  }
1855
1970
 
@@ -1881,10 +1996,7 @@ export class VesselStateCalculationRequestSchema {
1881
1996
  }
1882
1997
 
1883
1998
  makeCalculationRequest(data: VesselStateCalculationRequestSchemaData): VesselStateCalculationRequest {
1884
- return new VesselStateCalculationRequest(
1885
- data.material,
1886
- data.materialState
1887
- );
1999
+ return new VesselStateCalculationRequest(data);
1888
2000
  }
1889
2001
  }
1890
2002
 
@@ -1899,24 +2011,23 @@ export class VesselStateCalculation extends CalculationBase {
1899
2011
  the vessel conditions (e.g. Pure gas, Stratified Two-Phase vessel, Pressurised Liquid) that can be input to the
1900
2012
  source term models: vessel leak and vessel catastrophic rupture.
1901
2013
  *
1902
- * @param {Entities.Material} material - a material entity.
1903
- * @param {Entities.State} materialState - a state entity describing the fluid pressure, temperature, liquid fraction.
1904
2014
  */
1905
- constructor(
2015
+ constructor(data: {
1906
2016
  material: Entities.Material,
1907
2017
  materialState: Entities.State
1908
- ) {
1909
- super();
1910
- this.material = material;
1911
- this.materialState = materialState;
2018
+ controller?: AbortController;
2019
+ }) {
2020
+ super(data.controller);
2021
+ this.material = data.material;
2022
+ this.materialState = data.materialState;
1912
2023
  }
1913
2024
 
1914
2025
  async run() {
1915
2026
  try {
1916
- const request = new VesselStateCalculationRequest(
1917
- this.material,
1918
- this.materialState
1919
- );
2027
+ const request = new VesselStateCalculationRequest({
2028
+ material: this.material,
2029
+ materialState: this.materialState
2030
+ });
1920
2031
 
1921
2032
  const schema = new VesselStateCalculationRequestSchema();
1922
2033
  const validatedRequest = schema.validate(request);
@@ -1978,24 +2089,22 @@ export class VesselStateCalculationResponse extends CalculationResponseBase {
1978
2089
  /**
1979
2090
  * VesselState calculation response class.
1980
2091
  *
1981
- * @param {Enums.VesselConditions} vesselConditions - The conditions of the material in the vessel.
1982
- * @param {Entities.State} outputState - a state entity describing the fluid pressure, temperature and liquid fraction after the flash calculation.
1983
2092
  */
1984
- constructor(
2093
+ constructor(data: {
1985
2094
  vesselConditions: Enums.VesselConditions,
1986
2095
  outputState: Entities.State,
1987
2096
  resultCode: Enums.ResultCode,
1988
2097
  messages: string[],
1989
2098
  calculationElapsedTime: number,
1990
2099
  operationId: string
1991
- ) {
2100
+ }) {
1992
2101
  super();
1993
- this.vesselConditions = vesselConditions;
1994
- this.outputState = outputState;
1995
- this.resultCode = resultCode;
1996
- this.messages = messages;
1997
- this.calculationElapsedTime = calculationElapsedTime;
1998
- this.operationId = operationId;
2102
+ this.vesselConditions = data.vesselConditions;
2103
+ this.outputState = data.outputState;
2104
+ this.resultCode = data.resultCode;
2105
+ this.messages = data.messages;
2106
+ this.calculationElapsedTime = data.calculationElapsedTime;
2107
+ this.operationId = data.operationId;
1999
2108
  }
2000
2109
 
2001
2110
  initialiseFromDictionary(data: { [key: string]: unknown }) {
@@ -2063,13 +2172,6 @@ export class VesselStateCalculationResponseSchema {
2063
2172
  }
2064
2173
 
2065
2174
  makeCalculationResponse(data: VesselStateCalculationResponseSchemaData): VesselStateCalculationResponse {
2066
- return new VesselStateCalculationResponse(
2067
- data.vesselConditions,
2068
- data.outputState,
2069
- data.resultCode,
2070
- data.messages,
2071
- data.calculationElapsedTime,
2072
- data.operationId
2073
- );
2175
+ return new VesselStateCalculationResponse(data);
2074
2176
  }
2075
2177
  }