@gridsuite/commons-ui 0.270.0 → 0.271.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/dialogs/customMuiDialog/CustomMuiDialog.d.ts +10 -3
- package/dist/components/ui/dialogs/customMuiDialog/CustomMuiDialog.js +33 -28
- package/dist/features/index.js +87 -2
- package/dist/features/network-modifications/common/branch/branchCreation.types.d.ts +26 -0
- package/dist/features/network-modifications/common/branch/branchModification.types.d.ts +36 -0
- package/dist/features/network-modifications/common/branch/branchModification.types.js +1 -0
- package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.d.ts → common/branch/index.d.ts} +2 -8
- package/dist/features/network-modifications/common/branch/index.js +1 -0
- package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.d.ts +2 -0
- package/dist/features/network-modifications/common/currentLimits/limits.types.d.ts +1 -0
- package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.d.ts +2 -2
- package/dist/features/network-modifications/common/index.d.ts +1 -0
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/reactiveCapability.utils.js +1 -1
- package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.d.ts +2 -2
- package/dist/features/network-modifications/common/regulatingTerminal/regulatingTerminal.utils.js +2 -2
- package/dist/features/network-modifications/index.d.ts +1 -0
- package/dist/features/network-modifications/index.js +87 -2
- package/dist/features/network-modifications/line/characteristics/index.d.ts +0 -1
- package/dist/features/network-modifications/line/characteristics/index.js +1 -2
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.d.ts +4 -19
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.js +0 -14
- package/dist/features/network-modifications/line/creation/lineCreation.types.d.ts +6 -26
- package/dist/features/network-modifications/line/index.js +1 -2
- package/dist/features/network-modifications/line/modification/lineModification.types.d.ts +3 -35
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.d.ts +7 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/TwoWindingsTransformerCharacteristicsPane.js +168 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.d.ts +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/index.js +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.d.ts +41 -0
- package/dist/features/network-modifications/twoWindingsTransformer/characteristics/twoWindingsTransformerCharacteristicsPane.utils.js +51 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogHeader.js +123 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabs.js +89 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.d.ts +14 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerDialogTabsContent.js +118 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/TwoWindingsTransformerForm.js +47 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/index.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/index.js +13 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.d.ts +87 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.types.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.d.ts +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/common/twoWindingsTransformer.utils.js +50 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/index.d.ts +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/index.js +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.d.ts +47 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.types.js +8 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.d.ts +248 -0
- package/dist/features/network-modifications/twoWindingsTransformer/creation/twoWindingsTransformerCreation.utils.js +325 -0
- package/dist/features/network-modifications/twoWindingsTransformer/index.d.ts +11 -0
- package/dist/features/network-modifications/twoWindingsTransformer/index.js +88 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/index.js +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/ToBeEstimatedForm.js +104 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/index.js +7 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.d.ts +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.type.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/measurements/toBeEstimated.utils.js +18 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.d.ts +39 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.types.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.d.ts +265 -0
- package/dist/features/network-modifications/twoWindingsTransformer/modification/twoWindingsTransformerModification.utils.js +100 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.d.ts +13 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/RegulatedTerminalSection.js +130 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.d.ts +20 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/TapChangerSteps.js +311 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/index.js +53 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.d.ts +2 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPane.js +198 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/PhaseTapChangerPaneSteps.js +201 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/index.js +15 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.d.ts +114 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/phaseTapChanger/phaseTapChanger.utils.js +242 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.d.ts +2 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPane.js +283 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/RatioTapChangerPaneSteps.js +181 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/index.js +18 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.d.ts +132 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/ratioTapChanger/ratioTapChanger.utils.js +211 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.d.ts +2 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialog.js +102 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.d.ts +7 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleDialogSubmitButton.js +22 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.d.ts +6 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/CreateRuleForm.js +86 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.d.ts +10 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/ImportRuleDialog.js +140 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/index.js +13 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.d.ts +12 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.types.js +1 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.d.ts +9 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/regulationRule/regulationRule.utils.js +19 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.d.ts +14 -0
- package/dist/features/network-modifications/twoWindingsTransformer/tapChanger/tapChanger.utils.js +79 -0
- package/dist/index.js +98 -6
- package/dist/translations/en/filterExpertEn.d.ts +0 -3
- package/dist/translations/en/filterExpertEn.js +0 -3
- package/dist/translations/en/network-modification-validationEn.d.ts +1 -0
- package/dist/translations/en/network-modification-validationEn.js +2 -1
- package/dist/translations/en/networkModificationsEn.d.ts +70 -9
- package/dist/translations/en/networkModificationsEn.js +71 -10
- package/dist/translations/fr/filterExpertFr.d.ts +0 -3
- package/dist/translations/fr/filterExpertFr.js +0 -3
- package/dist/translations/fr/network-modification-validationFr.d.ts +1 -0
- package/dist/translations/fr/network-modification-validationFr.js +2 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +70 -9
- package/dist/translations/fr/networkModificationsFr.js +71 -10
- package/dist/utils/constants/fieldConstants.d.ts +37 -0
- package/dist/utils/constants/fieldConstants.js +37 -0
- package/dist/utils/constants/index.js +2 -1
- package/dist/utils/constants/translationKeys.d.ts +1 -0
- package/dist/utils/constants/translationKeys.js +2 -0
- package/dist/utils/functions.d.ts +9 -0
- package/dist/utils/functions.js +40 -0
- package/dist/utils/index.js +11 -4
- package/dist/utils/langs.d.ts +1 -0
- package/dist/utils/langs.js +9 -1
- package/dist/utils/types/equipmentType.d.ts +34 -0
- package/dist/utils/types/equipmentType.js +28 -0
- package/dist/utils/types/index.js +4 -1
- package/package.json +1 -1
- /package/dist/features/network-modifications/{line/characteristics/lineCharacteristicsPane.types.js → common/branch/branchCreation.types.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './twoWindingsTransformerCreation.types';
|
|
8
|
+
export * from './twoWindingsTransformerCreation.utils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PhaseTapChangerRegulationMode } from "./twoWindingsTransformerCreation.types.js";
|
|
2
|
+
import { computeRatioTapChangerRegulationMode, getRegulationTypeForEdit, getTapSideForEdit, twoWindingsTransformerCreationDtoToForm, twoWindingsTransformerCreationEmptyFormData, twoWindingsTransformerCreationFormSchema, twoWindingsTransformerCreationFormToDto } from "./twoWindingsTransformerCreation.utils.js";
|
|
3
|
+
export {
|
|
4
|
+
PhaseTapChangerRegulationMode,
|
|
5
|
+
computeRatioTapChangerRegulationMode,
|
|
6
|
+
getRegulationTypeForEdit,
|
|
7
|
+
getTapSideForEdit,
|
|
8
|
+
twoWindingsTransformerCreationDtoToForm,
|
|
9
|
+
twoWindingsTransformerCreationEmptyFormData,
|
|
10
|
+
twoWindingsTransformerCreationFormSchema,
|
|
11
|
+
twoWindingsTransformerCreationFormToDto
|
|
12
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { BranchCreationDto } from '../../common/branch';
|
|
3
|
+
export interface TapChangerStepCreationDto {
|
|
4
|
+
index: number;
|
|
5
|
+
rho: number;
|
|
6
|
+
r: number;
|
|
7
|
+
x: number;
|
|
8
|
+
g: number;
|
|
9
|
+
b: number;
|
|
10
|
+
alpha?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TapChangerCreationDto {
|
|
13
|
+
lowTapPosition: number;
|
|
14
|
+
tapPosition: number;
|
|
15
|
+
isRegulating: boolean;
|
|
16
|
+
targetDeadband: number | null;
|
|
17
|
+
terminalRefConnectableId: string | null;
|
|
18
|
+
terminalRefConnectableType: string | null;
|
|
19
|
+
terminalRefConnectableVlId: string | null;
|
|
20
|
+
steps: TapChangerStepCreationDto[];
|
|
21
|
+
hasLoadTapChangingCapabilities: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface RatioTapChangerCreationDto extends TapChangerCreationDto {
|
|
24
|
+
targetV: number | null;
|
|
25
|
+
}
|
|
26
|
+
export declare enum PhaseTapChangerRegulationMode {
|
|
27
|
+
CURRENT_LIMITER = "CURRENT_LIMITER",
|
|
28
|
+
ACTIVE_POWER_CONTROL = "ACTIVE_POWER_CONTROL"
|
|
29
|
+
}
|
|
30
|
+
export interface PhaseTapChangerCreationDto extends TapChangerCreationDto {
|
|
31
|
+
regulationMode: PhaseTapChangerRegulationMode | null;
|
|
32
|
+
regulationValue: number | null;
|
|
33
|
+
}
|
|
34
|
+
export interface TwoWindingsTransformerCreationDto extends BranchCreationDto {
|
|
35
|
+
r: number | null;
|
|
36
|
+
x: number;
|
|
37
|
+
g: number;
|
|
38
|
+
b: number;
|
|
39
|
+
ratedS: number | null;
|
|
40
|
+
ratedU1: number;
|
|
41
|
+
ratedU2: number;
|
|
42
|
+
ratioTapChanger: RatioTapChangerCreationDto | null;
|
|
43
|
+
phaseTapChanger: PhaseTapChangerCreationDto | null;
|
|
44
|
+
}
|
|
45
|
+
export type TwoWindingsTransformerCreationDtoWithId = TwoWindingsTransformerCreationDto & {
|
|
46
|
+
uuid?: UUID;
|
|
47
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var PhaseTapChangerRegulationMode = /* @__PURE__ */ ((PhaseTapChangerRegulationMode2) => {
|
|
2
|
+
PhaseTapChangerRegulationMode2["CURRENT_LIMITER"] = "CURRENT_LIMITER";
|
|
3
|
+
PhaseTapChangerRegulationMode2["ACTIVE_POWER_CONTROL"] = "ACTIVE_POWER_CONTROL";
|
|
4
|
+
return PhaseTapChangerRegulationMode2;
|
|
5
|
+
})(PhaseTapChangerRegulationMode || {});
|
|
6
|
+
export {
|
|
7
|
+
PhaseTapChangerRegulationMode
|
|
8
|
+
};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { DeepNullable } from '../../../../utils';
|
|
3
|
+
import { RatioTapChangerCreationDto, TapChangerCreationDto, TwoWindingsTransformerCreationDto } from './twoWindingsTransformerCreation.types';
|
|
4
|
+
import { TapChangerMapInfos } from '../common/twoWindingsTransformer.types';
|
|
5
|
+
export declare const getRegulationTypeForEdit: (twt: TwoWindingsTransformerCreationDto, tap: TapChangerCreationDto | null) => "LOCAL" | "DISTANT" | null;
|
|
6
|
+
export declare const computeRatioTapChangerRegulationMode: (ratioTapChangerFormValues?: RatioTapChangerCreationDto | TapChangerMapInfos | null) => "FIXED_RATIO" | "VOLTAGE_REGULATION";
|
|
7
|
+
export declare const getTapSideForEdit: (twt: TwoWindingsTransformerCreationDto, tap: TapChangerCreationDto | null | undefined) => "SIDE1" | "SIDE2" | null;
|
|
8
|
+
export declare const twoWindingsTransformerCreationFormSchema: import('yup').ObjectSchema<NonNullable<{
|
|
9
|
+
equipmentID: string;
|
|
10
|
+
equipmentName: string | null | undefined;
|
|
11
|
+
connectivity: {
|
|
12
|
+
connectivity1: {
|
|
13
|
+
terminalConnected?: boolean | null | undefined;
|
|
14
|
+
connectionDirection?: string | null | undefined;
|
|
15
|
+
connectionName?: string | undefined;
|
|
16
|
+
connectionPosition?: number | null | undefined;
|
|
17
|
+
busOrBusbarSection: {
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
} | null;
|
|
20
|
+
voltageLevel: {
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
} | null;
|
|
23
|
+
};
|
|
24
|
+
connectivity2: {
|
|
25
|
+
terminalConnected?: boolean | null | undefined;
|
|
26
|
+
connectionDirection?: string | null | undefined;
|
|
27
|
+
connectionName?: string | undefined;
|
|
28
|
+
connectionPosition?: number | null | undefined;
|
|
29
|
+
busOrBusbarSection: {
|
|
30
|
+
id?: string | undefined;
|
|
31
|
+
} | null;
|
|
32
|
+
voltageLevel: {
|
|
33
|
+
id?: string | undefined;
|
|
34
|
+
} | null;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
characteristics: {
|
|
38
|
+
b?: number | null | undefined;
|
|
39
|
+
g?: number | null | undefined;
|
|
40
|
+
ratedS?: number | null | undefined;
|
|
41
|
+
ratedU1?: number | null | undefined;
|
|
42
|
+
ratedU2?: number | null | undefined;
|
|
43
|
+
r?: number | null | undefined;
|
|
44
|
+
x?: number | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
limits: {
|
|
47
|
+
operationalLimitsGroups?: {
|
|
48
|
+
AdditionalProperties?: {
|
|
49
|
+
previousValue?: string | null | undefined;
|
|
50
|
+
added: NonNullable<boolean | undefined>;
|
|
51
|
+
deletionMark: NonNullable<boolean | undefined>;
|
|
52
|
+
name: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
limitsProperties?: {
|
|
56
|
+
name: string;
|
|
57
|
+
value: string;
|
|
58
|
+
}[] | undefined;
|
|
59
|
+
operationalLimitsGroupsIsDuplicate?: boolean | null | undefined;
|
|
60
|
+
applicability: string;
|
|
61
|
+
currentLimits: {
|
|
62
|
+
temporaryLimits?: {
|
|
63
|
+
name?: string | null | undefined;
|
|
64
|
+
value?: number | null | undefined;
|
|
65
|
+
acceptableDuration?: number | null | undefined;
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
permanentLimit: number;
|
|
68
|
+
};
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
selectedOperationalLimitsGroupId1?: string | null | undefined;
|
|
73
|
+
selectedOperationalLimitsGroupId2?: string | null | undefined;
|
|
74
|
+
enableOLGModification: NonNullable<boolean | undefined>;
|
|
75
|
+
};
|
|
76
|
+
ratioTapChanger: {
|
|
77
|
+
highTapPosition?: number | null | undefined;
|
|
78
|
+
hasLoadTapChangingCapabilities?: boolean | null | undefined;
|
|
79
|
+
lowTapPosition?: number | null | undefined;
|
|
80
|
+
regulationMode?: string | null | undefined;
|
|
81
|
+
regulationSide?: string | null | undefined;
|
|
82
|
+
regulationType?: string | null | undefined;
|
|
83
|
+
steps?: {
|
|
84
|
+
b?: number | undefined;
|
|
85
|
+
g?: number | undefined;
|
|
86
|
+
r?: number | undefined;
|
|
87
|
+
x?: number | undefined;
|
|
88
|
+
rho?: number | undefined;
|
|
89
|
+
index: number;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
targetDeadband?: {} | null | undefined;
|
|
92
|
+
targetV?: {} | null | undefined;
|
|
93
|
+
tapPosition?: number | null | undefined;
|
|
94
|
+
enabled: NonNullable<boolean | undefined>;
|
|
95
|
+
equipment: {
|
|
96
|
+
id?: string | undefined;
|
|
97
|
+
name?: string | null | undefined;
|
|
98
|
+
type?: string | undefined;
|
|
99
|
+
} | null;
|
|
100
|
+
voltageLevel: {
|
|
101
|
+
id?: string | undefined;
|
|
102
|
+
name?: string | undefined;
|
|
103
|
+
nominalVoltage?: string | undefined;
|
|
104
|
+
substationId?: string | undefined;
|
|
105
|
+
topologyKind?: string | null | undefined;
|
|
106
|
+
} | null;
|
|
107
|
+
};
|
|
108
|
+
phaseTapChanger: {
|
|
109
|
+
currentLimiterRegulatingValue?: number | null | undefined;
|
|
110
|
+
flowSetPointRegulatingValue?: number | null | undefined;
|
|
111
|
+
highTapPosition?: number | null | undefined;
|
|
112
|
+
lowTapPosition?: number | null | undefined;
|
|
113
|
+
regulationMode?: string | null | undefined;
|
|
114
|
+
regulationSide?: string | null | undefined;
|
|
115
|
+
regulationType?: string | null | undefined;
|
|
116
|
+
steps?: {
|
|
117
|
+
b?: number | undefined;
|
|
118
|
+
g?: number | undefined;
|
|
119
|
+
r?: number | undefined;
|
|
120
|
+
x?: number | undefined;
|
|
121
|
+
rho?: number | undefined;
|
|
122
|
+
alpha?: number | undefined;
|
|
123
|
+
index: number;
|
|
124
|
+
}[] | undefined;
|
|
125
|
+
targetDeadband?: number | null | undefined;
|
|
126
|
+
tapPosition?: number | null | undefined;
|
|
127
|
+
enabled: NonNullable<boolean | undefined>;
|
|
128
|
+
equipment: {
|
|
129
|
+
id?: string | undefined;
|
|
130
|
+
name?: string | null | undefined;
|
|
131
|
+
type?: string | undefined;
|
|
132
|
+
} | null;
|
|
133
|
+
voltageLevel: {
|
|
134
|
+
id?: string | undefined;
|
|
135
|
+
name?: string | undefined;
|
|
136
|
+
nominalVoltage?: string | undefined;
|
|
137
|
+
substationId?: string | undefined;
|
|
138
|
+
topologyKind?: string | null | undefined;
|
|
139
|
+
} | null;
|
|
140
|
+
};
|
|
141
|
+
} & {
|
|
142
|
+
AdditionalProperties: {
|
|
143
|
+
previousValue?: string | null | undefined;
|
|
144
|
+
added: NonNullable<boolean | undefined>;
|
|
145
|
+
deletionMark: NonNullable<boolean | undefined>;
|
|
146
|
+
name: string;
|
|
147
|
+
value: string;
|
|
148
|
+
}[] | undefined;
|
|
149
|
+
}>, import('yup').AnyObject, {
|
|
150
|
+
equipmentID: undefined;
|
|
151
|
+
equipmentName: undefined;
|
|
152
|
+
connectivity: {
|
|
153
|
+
connectivity1: {
|
|
154
|
+
voltageLevel: {
|
|
155
|
+
id: undefined;
|
|
156
|
+
};
|
|
157
|
+
busOrBusbarSection: {
|
|
158
|
+
id: undefined;
|
|
159
|
+
};
|
|
160
|
+
connectionDirection: undefined;
|
|
161
|
+
connectionName: undefined;
|
|
162
|
+
connectionPosition: undefined;
|
|
163
|
+
terminalConnected: undefined;
|
|
164
|
+
};
|
|
165
|
+
connectivity2: {
|
|
166
|
+
voltageLevel: {
|
|
167
|
+
id: undefined;
|
|
168
|
+
};
|
|
169
|
+
busOrBusbarSection: {
|
|
170
|
+
id: undefined;
|
|
171
|
+
};
|
|
172
|
+
connectionDirection: undefined;
|
|
173
|
+
connectionName: undefined;
|
|
174
|
+
connectionPosition: undefined;
|
|
175
|
+
terminalConnected: undefined;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
characteristics: {
|
|
179
|
+
r: undefined;
|
|
180
|
+
x: undefined;
|
|
181
|
+
g: undefined;
|
|
182
|
+
b: undefined;
|
|
183
|
+
ratedS: undefined;
|
|
184
|
+
ratedU1: undefined;
|
|
185
|
+
ratedU2: undefined;
|
|
186
|
+
};
|
|
187
|
+
limits: {
|
|
188
|
+
operationalLimitsGroups: undefined;
|
|
189
|
+
selectedOperationalLimitsGroupId1: undefined;
|
|
190
|
+
selectedOperationalLimitsGroupId2: undefined;
|
|
191
|
+
enableOLGModification: undefined;
|
|
192
|
+
};
|
|
193
|
+
ratioTapChanger: {
|
|
194
|
+
voltageLevel: {
|
|
195
|
+
id: undefined;
|
|
196
|
+
name: undefined;
|
|
197
|
+
substationId: undefined;
|
|
198
|
+
nominalVoltage: undefined;
|
|
199
|
+
topologyKind: undefined;
|
|
200
|
+
};
|
|
201
|
+
equipment: {
|
|
202
|
+
id: undefined;
|
|
203
|
+
name: undefined;
|
|
204
|
+
type: undefined;
|
|
205
|
+
};
|
|
206
|
+
enabled: undefined;
|
|
207
|
+
hasLoadTapChangingCapabilities: undefined;
|
|
208
|
+
regulationMode: undefined;
|
|
209
|
+
regulationType: undefined;
|
|
210
|
+
regulationSide: undefined;
|
|
211
|
+
targetV: undefined;
|
|
212
|
+
targetDeadband: undefined;
|
|
213
|
+
lowTapPosition: undefined;
|
|
214
|
+
highTapPosition: undefined;
|
|
215
|
+
tapPosition: undefined;
|
|
216
|
+
steps: "";
|
|
217
|
+
};
|
|
218
|
+
phaseTapChanger: {
|
|
219
|
+
voltageLevel: {
|
|
220
|
+
id: undefined;
|
|
221
|
+
name: undefined;
|
|
222
|
+
substationId: undefined;
|
|
223
|
+
nominalVoltage: undefined;
|
|
224
|
+
topologyKind: undefined;
|
|
225
|
+
};
|
|
226
|
+
equipment: {
|
|
227
|
+
id: undefined;
|
|
228
|
+
name: undefined;
|
|
229
|
+
type: undefined;
|
|
230
|
+
};
|
|
231
|
+
enabled: undefined;
|
|
232
|
+
regulationMode: undefined;
|
|
233
|
+
regulationType: undefined;
|
|
234
|
+
regulationSide: undefined;
|
|
235
|
+
currentLimiterRegulatingValue: undefined;
|
|
236
|
+
flowSetPointRegulatingValue: undefined;
|
|
237
|
+
targetDeadband: undefined;
|
|
238
|
+
lowTapPosition: undefined;
|
|
239
|
+
highTapPosition: undefined;
|
|
240
|
+
tapPosition: undefined;
|
|
241
|
+
steps: "";
|
|
242
|
+
};
|
|
243
|
+
AdditionalProperties: "";
|
|
244
|
+
}, "">;
|
|
245
|
+
export type TwoWindingsTransformerCreationFormData = InferType<typeof twoWindingsTransformerCreationFormSchema>;
|
|
246
|
+
export declare const twoWindingsTransformerCreationEmptyFormData: DeepNullable<TwoWindingsTransformerCreationFormData>;
|
|
247
|
+
export declare const twoWindingsTransformerCreationDtoToForm: (twtDto: TwoWindingsTransformerCreationDto) => TwoWindingsTransformerCreationFormData;
|
|
248
|
+
export declare const twoWindingsTransformerCreationFormToDto: (twtForm: TwoWindingsTransformerCreationFormData) => TwoWindingsTransformerCreationDto;
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { object, string } from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import { convertInputValue, convertOutputValue } from "../../../../utils/conversionUtils.js";
|
|
4
|
+
import { RATIO_REGULATION_MODES, REGULATION_SIDES, PHASE_REGULATION_MODES, UNDEFINED_CONNECTION_DIRECTION, EquipmentType } from "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
6
|
+
import { FieldType } from "../../../../utils/types/fieldType.js";
|
|
7
|
+
import { addSelectedFieldToRows } from "../../../../utils/functions.js";
|
|
8
|
+
import "react/jsx-runtime";
|
|
9
|
+
import "@mui/icons-material";
|
|
10
|
+
import { sanitizeString } from "../../../../utils/ts-utils.js";
|
|
11
|
+
import { getBranchConnectivityWithPositionSchema, getBranchConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
|
|
12
|
+
import "@mui/material";
|
|
13
|
+
import "react";
|
|
14
|
+
import "react-intl";
|
|
15
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
16
|
+
import "react-hook-form";
|
|
17
|
+
import "localized-countries";
|
|
18
|
+
import "localized-countries/data/fr";
|
|
19
|
+
import "localized-countries/data/en";
|
|
20
|
+
import "notistack";
|
|
21
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
22
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
23
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
27
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
29
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
30
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
31
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
32
|
+
import "@hello-pangea/dnd";
|
|
33
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
34
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
35
|
+
import "mui-nested-menu";
|
|
36
|
+
import "react-resizable-panels";
|
|
37
|
+
import "react-papaparse";
|
|
38
|
+
import { creationPropertiesSchema, getFilledPropertiesFromModification, toModificationProperties } from "../../common/properties/propertyUtils.js";
|
|
39
|
+
import { getLimitsValidationSchemaProps, getLimitsEmptyFormDataProps, getAllLimitsFormData, sanitizeLimitsGroups } from "../../common/currentLimits/limitsPane.utils.js";
|
|
40
|
+
import { getTwtCharacteristicsValidationSchemaProps, getTwtCharacteristicsEmptyFormData } from "../characteristics/twoWindingsTransformerCharacteristicsPane.utils.js";
|
|
41
|
+
import "react-dom";
|
|
42
|
+
import "autosuggest-highlight/match";
|
|
43
|
+
import "autosuggest-highlight/parse";
|
|
44
|
+
import "clsx";
|
|
45
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
46
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
47
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
48
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
49
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
50
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
51
|
+
import "react-querybuilder";
|
|
52
|
+
import "uuid";
|
|
53
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
54
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
55
|
+
import "@react-querybuilder/material";
|
|
56
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
57
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
58
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
59
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
60
|
+
import "ag-grid-community";
|
|
61
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
62
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
63
|
+
import "mathjs";
|
|
64
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
65
|
+
import "react-window";
|
|
66
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
67
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
68
|
+
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
69
|
+
import { REGULATION_TYPES } from "../../common/voltageRegulation/voltageRegulation.utils.js";
|
|
70
|
+
import "@mui/material/colors";
|
|
71
|
+
import "@mui/x-charts";
|
|
72
|
+
import { computeHighTapPosition } from "../tapChanger/tapChanger.utils.js";
|
|
73
|
+
import "../tapChanger/regulationRule/CreateRuleForm.js";
|
|
74
|
+
import "../tapChanger/regulationRule/CreateRuleDialog.js";
|
|
75
|
+
import { getPhaseTapChangerValidationSchemaProps, getPhaseTapChangerEmptyFormData, getPhaseTapChangerFormData } from "../tapChanger/phaseTapChanger/phaseTapChanger.utils.js";
|
|
76
|
+
import { getRatioTapChangerValidationSchemaProps, getRatioTapChangerEmptyFormData, getRatioTapChangerFormData } from "../tapChanger/ratioTapChanger/ratioTapChanger.utils.js";
|
|
77
|
+
const getRegulationTypeForEdit = (twt, tap) => {
|
|
78
|
+
if (tap?.terminalRefConnectableId == null) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return tap.terminalRefConnectableId === twt.equipmentId ? REGULATION_TYPES.LOCAL.id : REGULATION_TYPES.DISTANT.id;
|
|
82
|
+
};
|
|
83
|
+
const computeRatioTapChangerRegulationMode = (ratioTapChangerFormValues) => {
|
|
84
|
+
if (ratioTapChangerFormValues?.isRegulating) {
|
|
85
|
+
return RATIO_REGULATION_MODES.VOLTAGE_REGULATION.id;
|
|
86
|
+
}
|
|
87
|
+
return RATIO_REGULATION_MODES.FIXED_RATIO.id;
|
|
88
|
+
};
|
|
89
|
+
const getTapSideForEdit = (twt, tap) => {
|
|
90
|
+
if (tap?.terminalRefConnectableId !== twt.equipmentId) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return tap?.terminalRefConnectableVlId === twt?.voltageLevelId1 ? REGULATION_SIDES.SIDE1.id : REGULATION_SIDES.SIDE2.id;
|
|
94
|
+
};
|
|
95
|
+
const computeRatioTapChangerRegulating = (ratioTapChangerFormValues) => {
|
|
96
|
+
return ratioTapChangerFormValues?.regulationMode === RATIO_REGULATION_MODES.VOLTAGE_REGULATION.id;
|
|
97
|
+
};
|
|
98
|
+
const computeRegulatingTerminalId = (tapChangerValue, currentTwtId) => {
|
|
99
|
+
if (tapChangerValue?.regulationType === REGULATION_TYPES.LOCAL.id) {
|
|
100
|
+
return currentTwtId;
|
|
101
|
+
}
|
|
102
|
+
return tapChangerValue?.equipment?.id ?? null;
|
|
103
|
+
};
|
|
104
|
+
const computeRegulatingTerminalType = (tapChangerValue) => {
|
|
105
|
+
if (tapChangerValue?.equipment?.type) {
|
|
106
|
+
return tapChangerValue?.equipment?.type;
|
|
107
|
+
}
|
|
108
|
+
if (tapChangerValue?.regulationType === REGULATION_TYPES.LOCAL.id) {
|
|
109
|
+
return EquipmentType.TWO_WINDINGS_TRANSFORMER;
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
};
|
|
113
|
+
const computeTapTerminalVlId = (tapChangerValue, connectivity) => {
|
|
114
|
+
if (tapChangerValue?.regulationType === REGULATION_TYPES.LOCAL.id) {
|
|
115
|
+
if (tapChangerValue?.regulationSide === REGULATION_SIDES.SIDE1.id) {
|
|
116
|
+
return connectivity.connectivity1.voltageLevel?.id ?? null;
|
|
117
|
+
}
|
|
118
|
+
return connectivity.connectivity2.voltageLevel?.id ?? null;
|
|
119
|
+
}
|
|
120
|
+
return tapChangerValue?.voltageLevel?.id ?? null;
|
|
121
|
+
};
|
|
122
|
+
const computePhaseTapChangerRegulating = (phaseTapChangerFormValues) => {
|
|
123
|
+
return phaseTapChangerFormValues?.regulationMode === PHASE_REGULATION_MODES.CURRENT_LIMITER.id || phaseTapChangerFormValues?.regulationMode === PHASE_REGULATION_MODES.ACTIVE_POWER_CONTROL.id;
|
|
124
|
+
};
|
|
125
|
+
const computePhaseTapChangerRegulationValue = (phaseTapChangerFormValues) => {
|
|
126
|
+
switch (phaseTapChangerFormValues?.regulationMode) {
|
|
127
|
+
case PHASE_REGULATION_MODES.ACTIVE_POWER_CONTROL.id:
|
|
128
|
+
return phaseTapChangerFormValues?.flowSetPointRegulatingValue ?? void 0;
|
|
129
|
+
case PHASE_REGULATION_MODES.CURRENT_LIMITER.id:
|
|
130
|
+
return phaseTapChangerFormValues?.currentLimiterRegulatingValue ?? void 0;
|
|
131
|
+
default:
|
|
132
|
+
return void 0;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const computeRegulationModeValue = (phaseTapChangerFormValues) => {
|
|
136
|
+
if (phaseTapChangerFormValues?.regulationMode === PHASE_REGULATION_MODES.OFF.id) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return phaseTapChangerFormValues?.regulationMode;
|
|
140
|
+
};
|
|
141
|
+
const transformOperationalLimitsGroupsForForm = (operationalLimitsGroups) => {
|
|
142
|
+
return operationalLimitsGroups?.filter(
|
|
143
|
+
(group) => group.id != null && group.applicability != null
|
|
144
|
+
).map(({ id, currentLimits, applicability, limitsProperties }) => ({
|
|
145
|
+
id: id + applicability,
|
|
146
|
+
name: id,
|
|
147
|
+
applicability,
|
|
148
|
+
limitsProperties: limitsProperties ?? void 0,
|
|
149
|
+
currentLimits: {
|
|
150
|
+
permanentLimit: currentLimits?.permanentLimit ?? "",
|
|
151
|
+
temporaryLimits: currentLimits?.temporaryLimits?.map((tl) => ({
|
|
152
|
+
name: tl.name ?? "",
|
|
153
|
+
value: tl.value ?? "",
|
|
154
|
+
acceptableDuration: tl.acceptableDuration ?? ""
|
|
155
|
+
})) ?? []
|
|
156
|
+
}
|
|
157
|
+
}));
|
|
158
|
+
};
|
|
159
|
+
const twoWindingsTransformerCreationFormSchema = object().shape({
|
|
160
|
+
[FieldConstants.EQUIPMENT_ID]: string().required(),
|
|
161
|
+
[FieldConstants.EQUIPMENT_NAME]: string().nullable(),
|
|
162
|
+
[FieldConstants.CONNECTIVITY]: getBranchConnectivityWithPositionSchema(false, true),
|
|
163
|
+
[FieldConstants.CHARACTERISTICS]: getTwtCharacteristicsValidationSchemaProps(false),
|
|
164
|
+
[FieldConstants.LIMITS]: getLimitsValidationSchemaProps(false),
|
|
165
|
+
[FieldConstants.RATIO_TAP_CHANGER]: getRatioTapChangerValidationSchemaProps(false),
|
|
166
|
+
[FieldConstants.PHASE_TAP_CHANGER]: getPhaseTapChangerValidationSchemaProps(false)
|
|
167
|
+
}).concat(creationPropertiesSchema).required();
|
|
168
|
+
const twoWindingsTransformerCreationEmptyFormData = {
|
|
169
|
+
[FieldConstants.EQUIPMENT_ID]: "",
|
|
170
|
+
[FieldConstants.EQUIPMENT_NAME]: "",
|
|
171
|
+
[FieldConstants.CONNECTIVITY]: getBranchConnectivityWithPositionEmptyFormDataProps(),
|
|
172
|
+
[FieldConstants.CHARACTERISTICS]: getTwtCharacteristicsEmptyFormData(),
|
|
173
|
+
[FieldConstants.LIMITS]: getLimitsEmptyFormDataProps(false),
|
|
174
|
+
[FieldConstants.RATIO_TAP_CHANGER]: getRatioTapChangerEmptyFormData(false),
|
|
175
|
+
[FieldConstants.PHASE_TAP_CHANGER]: getPhaseTapChangerEmptyFormData(false),
|
|
176
|
+
AdditionalProperties: []
|
|
177
|
+
};
|
|
178
|
+
const twoWindingsTransformerCreationDtoToForm = (twtDto) => {
|
|
179
|
+
const ratioTap = twtDto.ratioTapChanger;
|
|
180
|
+
const phaseTap = twtDto.phaseTapChanger;
|
|
181
|
+
return {
|
|
182
|
+
equipmentID: twtDto.equipmentId,
|
|
183
|
+
equipmentName: twtDto.equipmentName ?? "",
|
|
184
|
+
connectivity: {
|
|
185
|
+
connectivity1: getConnectivityFormDataProps({
|
|
186
|
+
voltageLevelId: twtDto.voltageLevelId1,
|
|
187
|
+
busbarSectionId: twtDto.busOrBusbarSectionId1,
|
|
188
|
+
connectionDirection: twtDto.connectionDirection1,
|
|
189
|
+
connectionName: twtDto.connectionName1,
|
|
190
|
+
connectionPosition: twtDto.connectionPosition1,
|
|
191
|
+
terminalConnected: twtDto.connected1
|
|
192
|
+
}),
|
|
193
|
+
connectivity2: getConnectivityFormDataProps({
|
|
194
|
+
voltageLevelId: twtDto.voltageLevelId2,
|
|
195
|
+
busbarSectionId: twtDto.busOrBusbarSectionId2,
|
|
196
|
+
connectionDirection: twtDto.connectionDirection2,
|
|
197
|
+
connectionName: twtDto.connectionName2,
|
|
198
|
+
connectionPosition: twtDto.connectionPosition2,
|
|
199
|
+
terminalConnected: twtDto.connected2
|
|
200
|
+
})
|
|
201
|
+
},
|
|
202
|
+
characteristics: {
|
|
203
|
+
r: twtDto.r,
|
|
204
|
+
x: twtDto.x,
|
|
205
|
+
g: convertInputValue(FieldType.G, twtDto.g),
|
|
206
|
+
b: convertInputValue(FieldType.B, twtDto.b),
|
|
207
|
+
ratedU1: twtDto.ratedU1,
|
|
208
|
+
ratedU2: twtDto.ratedU2,
|
|
209
|
+
ratedS: twtDto.ratedS
|
|
210
|
+
},
|
|
211
|
+
AdditionalProperties: getFilledPropertiesFromModification(twtDto.properties),
|
|
212
|
+
...getAllLimitsFormData(
|
|
213
|
+
transformOperationalLimitsGroupsForForm(twtDto?.operationalLimitsGroups),
|
|
214
|
+
twtDto?.selectedOperationalLimitsGroupId1 ?? null,
|
|
215
|
+
twtDto?.selectedOperationalLimitsGroupId2 ?? null
|
|
216
|
+
),
|
|
217
|
+
...getPhaseTapChangerFormData({
|
|
218
|
+
enabled: phaseTap?.tapPosition !== void 0,
|
|
219
|
+
regulationMode: phaseTap?.isRegulating ? phaseTap?.regulationMode : PHASE_REGULATION_MODES.OFF.id,
|
|
220
|
+
regulationType: getRegulationTypeForEdit(twtDto, phaseTap),
|
|
221
|
+
regulationSide: getTapSideForEdit(twtDto, phaseTap),
|
|
222
|
+
currentLimiterRegulatingValue: phaseTap?.regulationMode === PHASE_REGULATION_MODES.CURRENT_LIMITER.id ? phaseTap?.regulationValue : null,
|
|
223
|
+
flowSetpointRegulatingValue: phaseTap?.regulationMode === PHASE_REGULATION_MODES.ACTIVE_POWER_CONTROL.id ? phaseTap?.regulationValue : null,
|
|
224
|
+
targetDeadband: phaseTap?.targetDeadband,
|
|
225
|
+
lowTapPosition: phaseTap?.lowTapPosition,
|
|
226
|
+
highTapPosition: computeHighTapPosition(phaseTap?.steps ?? []),
|
|
227
|
+
tapPosition: phaseTap?.tapPosition,
|
|
228
|
+
steps: addSelectedFieldToRows(phaseTap?.steps ?? []),
|
|
229
|
+
equipmentID: phaseTap?.terminalRefConnectableId ?? void 0,
|
|
230
|
+
equipmentType: phaseTap?.terminalRefConnectableType ?? void 0,
|
|
231
|
+
voltageLevelId: phaseTap?.terminalRefConnectableVlId ?? void 0
|
|
232
|
+
}),
|
|
233
|
+
...getRatioTapChangerFormData({
|
|
234
|
+
enabled: ratioTap?.tapPosition !== void 0,
|
|
235
|
+
hasLoadTapChangingCapabilities: ratioTap?.hasLoadTapChangingCapabilities,
|
|
236
|
+
regulationMode: computeRatioTapChangerRegulationMode(ratioTap),
|
|
237
|
+
regulationType: getRegulationTypeForEdit(twtDto, ratioTap),
|
|
238
|
+
regulationSide: getTapSideForEdit(twtDto, ratioTap),
|
|
239
|
+
targetV: ratioTap?.targetV,
|
|
240
|
+
targetDeadband: ratioTap?.targetDeadband,
|
|
241
|
+
lowTapPosition: ratioTap?.lowTapPosition,
|
|
242
|
+
highTapPosition: computeHighTapPosition(ratioTap?.steps ?? []),
|
|
243
|
+
tapPosition: ratioTap?.tapPosition,
|
|
244
|
+
steps: addSelectedFieldToRows(ratioTap?.steps ?? []),
|
|
245
|
+
equipmentId: ratioTap?.terminalRefConnectableId ?? void 0,
|
|
246
|
+
equipmentType: ratioTap?.terminalRefConnectableType ?? void 0,
|
|
247
|
+
voltageLevelId: ratioTap?.terminalRefConnectableVlId ?? void 0
|
|
248
|
+
})
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
const twoWindingsTransformerCreationFormToDto = (twtForm) => {
|
|
252
|
+
const enablePhaseTapChanger = twtForm?.phaseTapChanger?.enabled;
|
|
253
|
+
const enableRatioTapChanger = twtForm?.ratioTapChanger?.enabled;
|
|
254
|
+
let ratioTap;
|
|
255
|
+
let phaseTap;
|
|
256
|
+
if (enableRatioTapChanger) {
|
|
257
|
+
const ratioForm = twtForm.ratioTapChanger;
|
|
258
|
+
const hasLoadTapCapabilities = ratioForm.hasLoadTapChangingCapabilities;
|
|
259
|
+
ratioTap = {
|
|
260
|
+
...ratioForm,
|
|
261
|
+
isRegulating: computeRatioTapChangerRegulating(ratioForm),
|
|
262
|
+
terminalRefConnectableId: hasLoadTapCapabilities ? computeRegulatingTerminalId(ratioForm, twtForm.equipmentID) : null,
|
|
263
|
+
terminalRefConnectableType: hasLoadTapCapabilities ? computeRegulatingTerminalType(ratioForm) : null,
|
|
264
|
+
terminalRefConnectableVlId: hasLoadTapCapabilities ? computeTapTerminalVlId(ratioForm, twtForm.connectivity) : null,
|
|
265
|
+
targetV: hasLoadTapCapabilities && ratioForm.targetV != null ? Number(ratioForm.targetV) : null,
|
|
266
|
+
targetDeadband: hasLoadTapCapabilities && ratioForm.targetDeadband != null ? Number(ratioForm.targetDeadband) : null
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
if (enablePhaseTapChanger) {
|
|
270
|
+
const phaseForm = twtForm.phaseTapChanger;
|
|
271
|
+
phaseTap = {
|
|
272
|
+
hasLoadTapChangingCapabilities: true,
|
|
273
|
+
isRegulating: computePhaseTapChangerRegulating(phaseForm),
|
|
274
|
+
regulationValue: computePhaseTapChangerRegulationValue(phaseForm),
|
|
275
|
+
terminalRefConnectableId: computeRegulatingTerminalId(phaseForm, twtForm.equipmentID),
|
|
276
|
+
terminalRefConnectableType: computeRegulatingTerminalType(phaseForm),
|
|
277
|
+
terminalRefConnectableVlId: computeTapTerminalVlId(phaseForm, twtForm.connectivity),
|
|
278
|
+
...phaseForm,
|
|
279
|
+
regulationMode: computeRegulationModeValue(phaseForm)
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
type: ModificationType.TWO_WINDINGS_TRANSFORMER_CREATION,
|
|
284
|
+
equipmentId: twtForm.equipmentID,
|
|
285
|
+
equipmentName: sanitizeString(twtForm.equipmentName),
|
|
286
|
+
// connectivity
|
|
287
|
+
voltageLevelId1: twtForm.connectivity.connectivity1.voltageLevel?.id ?? "",
|
|
288
|
+
busOrBusbarSectionId1: twtForm.connectivity.connectivity1.busOrBusbarSection?.id ?? "",
|
|
289
|
+
connectionDirection1: twtForm.connectivity.connectivity1.connectionDirection ?? UNDEFINED_CONNECTION_DIRECTION,
|
|
290
|
+
connectionName1: sanitizeString(twtForm.connectivity.connectivity1.connectionName),
|
|
291
|
+
connectionPosition1: twtForm.connectivity.connectivity1.connectionPosition,
|
|
292
|
+
connected1: twtForm.connectivity.connectivity1.terminalConnected ?? null,
|
|
293
|
+
voltageLevelId2: twtForm.connectivity.connectivity2.voltageLevel?.id ?? "",
|
|
294
|
+
busOrBusbarSectionId2: twtForm.connectivity.connectivity2.busOrBusbarSection?.id ?? "",
|
|
295
|
+
connectionDirection2: twtForm.connectivity.connectivity2.connectionDirection ?? UNDEFINED_CONNECTION_DIRECTION,
|
|
296
|
+
connectionName2: sanitizeString(twtForm.connectivity.connectivity2.connectionName),
|
|
297
|
+
connectionPosition2: twtForm.connectivity.connectivity2.connectionPosition,
|
|
298
|
+
connected2: twtForm.connectivity.connectivity2.terminalConnected ?? null,
|
|
299
|
+
// characteristics
|
|
300
|
+
r: twtForm.characteristics.r ?? null,
|
|
301
|
+
x: Number(twtForm.characteristics.x),
|
|
302
|
+
g: Number(convertOutputValue(FieldType.G, twtForm.characteristics.g)),
|
|
303
|
+
b: Number(convertOutputValue(FieldType.B, twtForm.characteristics.b)),
|
|
304
|
+
ratedS: twtForm.characteristics.ratedS ?? null,
|
|
305
|
+
ratedU1: Number(twtForm.characteristics.ratedU1),
|
|
306
|
+
ratedU2: Number(twtForm.characteristics.ratedU2),
|
|
307
|
+
properties: toModificationProperties(twtForm),
|
|
308
|
+
// limits
|
|
309
|
+
operationalLimitsGroups: sanitizeLimitsGroups(twtForm.limits.operationalLimitsGroups ?? []),
|
|
310
|
+
selectedOperationalLimitsGroupId1: twtForm.limits.selectedOperationalLimitsGroupId1 ?? null,
|
|
311
|
+
selectedOperationalLimitsGroupId2: twtForm.limits.selectedOperationalLimitsGroupId2 ?? null,
|
|
312
|
+
// tap changers
|
|
313
|
+
ratioTapChanger: ratioTap ?? null,
|
|
314
|
+
phaseTapChanger: phaseTap ?? null
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
export {
|
|
318
|
+
computeRatioTapChangerRegulationMode,
|
|
319
|
+
getRegulationTypeForEdit,
|
|
320
|
+
getTapSideForEdit,
|
|
321
|
+
twoWindingsTransformerCreationDtoToForm,
|
|
322
|
+
twoWindingsTransformerCreationEmptyFormData,
|
|
323
|
+
twoWindingsTransformerCreationFormSchema,
|
|
324
|
+
twoWindingsTransformerCreationFormToDto
|
|
325
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './common';
|
|
8
|
+
export * from './characteristics';
|
|
9
|
+
export * from './tapChanger';
|
|
10
|
+
export * from './creation';
|
|
11
|
+
export * from './modification';
|