@gridsuite/commons-ui 0.178.0 → 0.180.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/index.js +79 -1
- package/dist/components/inputs/index.js +2 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.d.ts +15 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.js +75 -0
- package/dist/components/inputs/reactHookForm/index.d.ts +1 -0
- package/dist/components/inputs/reactHookForm/index.js +2 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.d.ts +7 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.js +63 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.d.ts +37 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.js +267 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.d.ts +34 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.js +1 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.d.ts +241 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.js +196 -0
- package/dist/components/network-modifications/common/connectivity/index.d.ts +10 -0
- package/dist/components/network-modifications/common/connectivity/index.js +25 -0
- package/dist/components/network-modifications/common/index.d.ts +4 -1
- package/dist/components/network-modifications/common/index.js +56 -1
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +37 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.d.ts +9 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.js +52 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.js +74 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +56 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +69 -0
- package/dist/components/network-modifications/common/measurements/index.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/index.js +26 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.d.ts +58 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.js +55 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.js +1 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.d.ts +22 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.js +36 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.d.ts +15 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.js +71 -0
- package/dist/components/network-modifications/common/setpoints/index.d.ts +8 -0
- package/dist/components/network-modifications/common/setpoints/index.js +10 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.d.ts +16 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +62 -0
- package/dist/components/network-modifications/index.d.ts +1 -0
- package/dist/components/network-modifications/index.js +71 -1
- package/dist/components/network-modifications/load/common/LoadDialogHeader.d.ts +7 -0
- package/dist/components/network-modifications/load/common/LoadDialogHeader.js +103 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.d.ts +14 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.js +49 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.d.ts +8 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.js +61 -0
- package/dist/components/network-modifications/load/common/LoadForm.d.ts +5 -0
- package/dist/components/network-modifications/load/common/LoadForm.js +73 -0
- package/dist/components/network-modifications/load/common/index.d.ts +12 -0
- package/dist/components/network-modifications/load/common/index.js +12 -0
- package/dist/components/network-modifications/load/common/load.types.d.ts +16 -0
- package/dist/components/network-modifications/load/common/load.types.js +1 -0
- package/dist/components/network-modifications/load/common/load.utils.d.ts +11 -0
- package/dist/components/network-modifications/load/common/load.utils.js +8 -0
- package/dist/components/network-modifications/load/creation/index.d.ts +8 -0
- package/dist/components/network-modifications/load/creation/index.js +7 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.d.ts +16 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.js +1 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.d.ts +53 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.js +98 -0
- package/dist/components/network-modifications/load/index.d.ts +8 -0
- package/dist/components/network-modifications/load/index.js +17 -0
- package/dist/components/network-modifications/substation/creation/substationCreation.utils.js +2 -1
- package/dist/components/network-modifications/voltage-level/creation/substation-creation/SubstationAutocompleteAddButton.js +3 -0
- package/dist/components/network-modifications/voltage-level/index.d.ts +1 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.d.ts +12 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.js +1 -0
- package/dist/components/parameters/common/utils.d.ts +25 -2
- package/dist/components/parameters/common/utils.js +40 -1
- package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.d.ts +2 -18
- package/dist/components/parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js +2 -38
- package/dist/components/parameters/dynamic-security-analysis/constants.d.ts +9 -0
- package/dist/components/parameters/dynamic-security-analysis/constants.js +8 -0
- package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.d.ts +10 -0
- package/dist/components/parameters/dynamic-security-analysis/contingency-parameters.js +65 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.d.ts +10 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-inline.js +130 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.d.ts +9 -0
- package/dist/components/parameters/dynamic-security-analysis/dynamic-security-analysis-parameters-form.js +103 -0
- package/dist/components/parameters/dynamic-security-analysis/index.d.ts +8 -0
- package/dist/components/parameters/dynamic-security-analysis/index.js +8 -0
- package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.d.ts +10 -0
- package/dist/components/parameters/dynamic-security-analysis/scenario-parameters.js +16 -0
- package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.d.ts +51 -0
- package/dist/components/parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js +181 -0
- package/dist/components/parameters/index.d.ts +1 -0
- package/dist/components/parameters/index.js +6 -0
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +24 -4
- package/dist/components/parameters/util/make-component-utils.d.ts +17 -0
- package/dist/components/parameters/util/make-component-utils.js +96 -0
- package/dist/components/parameters/util/styles.d.ts +38 -0
- package/dist/components/parameters/util/styles.js +41 -0
- package/dist/index.js +95 -4
- package/dist/services/dynamic-security-analysis.d.ts +4 -0
- package/dist/services/dynamic-security-analysis.js +29 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +6 -1
- package/dist/services/sensitivity-analysis.d.ts +1 -1
- package/dist/services/sensitivity-analysis.js +3 -2
- package/dist/services/utils.d.ts +2 -0
- package/dist/services/utils.js +3 -0
- package/dist/translations/en/networkModificationsEn.d.ts +17 -0
- package/dist/translations/en/networkModificationsEn.js +18 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +17 -0
- package/dist/translations/fr/networkModificationsFr.js +18 -1
- package/dist/utils/constants/fieldConstants.d.ts +24 -1
- package/dist/utils/constants/fieldConstants.js +24 -1
- package/dist/utils/index.js +10 -2
- package/dist/utils/ts-utils.d.ts +5 -6
- package/dist/utils/ts-utils.js +11 -0
- package/dist/utils/types/elementType.d.ts +1 -0
- package/dist/utils/types/elementType.js +1 -0
- package/dist/utils/types/equipmentType.d.ts +18 -0
- package/dist/utils/types/equipmentType.js +27 -1
- package/dist/utils/types/index.js +8 -2
- package/package.json +1 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { object, bool, number, string } from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import "../../../../utils/conversionUtils.js";
|
|
4
|
+
import "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import "../../../../utils/yupConfig.js";
|
|
8
|
+
const getVoltageLevelAndBusOrBusBarSectionFieldsSchema = (isEquipmentModification, relatedFieldName) => {
|
|
9
|
+
return object().nullable().when({
|
|
10
|
+
is: () => !isEquipmentModification,
|
|
11
|
+
then: (schema) => schema.required()
|
|
12
|
+
}).shape({
|
|
13
|
+
[FieldConstants.ID]: string().when([], {
|
|
14
|
+
is: () => isEquipmentModification,
|
|
15
|
+
then: (schema) => schema.nullable()
|
|
16
|
+
})
|
|
17
|
+
}).test("YupRequired", "YupRequired", (value, context) => {
|
|
18
|
+
const isEmpty = value?.[FieldConstants.ID] === null || value?.[FieldConstants.ID] === void 0 || value?.[FieldConstants.ID] === "";
|
|
19
|
+
const isEmptyRelatedField = context.parent?.[relatedFieldName] === null || context.parent?.[relatedFieldName]?.[FieldConstants.ID] === "" || context.parent?.[relatedFieldName]?.[FieldConstants.ID] === void 0;
|
|
20
|
+
return !(isEmpty && !isEmptyRelatedField);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const getConnectivityPropertiesValidationSchema = (isEquipmentModification = false) => {
|
|
24
|
+
return {
|
|
25
|
+
[FieldConstants.VOLTAGE_LEVEL]: getVoltageLevelAndBusOrBusBarSectionFieldsSchema(
|
|
26
|
+
isEquipmentModification,
|
|
27
|
+
FieldConstants.BUS_OR_BUSBAR_SECTION
|
|
28
|
+
),
|
|
29
|
+
[FieldConstants.BUS_OR_BUSBAR_SECTION]: getVoltageLevelAndBusOrBusBarSectionFieldsSchema(
|
|
30
|
+
isEquipmentModification,
|
|
31
|
+
FieldConstants.VOLTAGE_LEVEL
|
|
32
|
+
)
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const getConnectivityWithPositionSchema = (isEquipmentModification = false) => object().shape({
|
|
36
|
+
[FieldConstants.CONNECTION_DIRECTION]: string().nullable(),
|
|
37
|
+
[FieldConstants.CONNECTION_NAME]: string(),
|
|
38
|
+
[FieldConstants.CONNECTION_POSITION]: number().nullable(),
|
|
39
|
+
[FieldConstants.CONNECTED]: bool().nullable().when([], {
|
|
40
|
+
is: () => !isEquipmentModification,
|
|
41
|
+
then: (schema) => schema.required()
|
|
42
|
+
}),
|
|
43
|
+
...getConnectivityPropertiesValidationSchema(isEquipmentModification)
|
|
44
|
+
});
|
|
45
|
+
const getConnectivityWithPositionValidationSchema = (isEquipmentModification = false, id = FieldConstants.CONNECTIVITY) => ({
|
|
46
|
+
[id]: getConnectivityWithPositionSchema(isEquipmentModification)
|
|
47
|
+
});
|
|
48
|
+
const getCon1andCon2WithPositionValidationSchema = (isEquipmentModification = false, id = FieldConstants.CONNECTIVITY) => ({
|
|
49
|
+
[id]: object().shape({
|
|
50
|
+
...getConnectivityWithPositionValidationSchema(isEquipmentModification, FieldConstants.CONNECTIVITY_1),
|
|
51
|
+
...getConnectivityWithPositionValidationSchema(isEquipmentModification, FieldConstants.CONNECTIVITY_2)
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
const getConnectivityWithoutPositionValidationSchema = (id = FieldConstants.CONNECTIVITY) => {
|
|
55
|
+
return {
|
|
56
|
+
[id]: object().shape(getConnectivityPropertiesValidationSchema())
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const getConnectivityPropertiesEmptyFormData = (isEquipmentModification = false) => {
|
|
60
|
+
return {
|
|
61
|
+
[FieldConstants.VOLTAGE_LEVEL]: null,
|
|
62
|
+
[FieldConstants.BUS_OR_BUSBAR_SECTION]: null,
|
|
63
|
+
[FieldConstants.CONNECTED]: isEquipmentModification ? null : true
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const getConnectivityWithPositionEmptyFormDataProps = (isEquipmentModification = false) => ({
|
|
67
|
+
...getConnectivityPropertiesEmptyFormData(isEquipmentModification),
|
|
68
|
+
[FieldConstants.CONNECTION_DIRECTION]: null,
|
|
69
|
+
[FieldConstants.CONNECTION_NAME]: "",
|
|
70
|
+
[FieldConstants.CONNECTION_POSITION]: null
|
|
71
|
+
});
|
|
72
|
+
const getConnectivityWithPositionEmptyFormData = (isEquipmentModification = false, id = FieldConstants.CONNECTIVITY) => ({
|
|
73
|
+
[id]: getConnectivityWithPositionEmptyFormDataProps(isEquipmentModification)
|
|
74
|
+
});
|
|
75
|
+
const getCont1Cont2WithPositionEmptyFormData = (isEquipmentModification = false, id = FieldConstants.CONNECTIVITY) => ({
|
|
76
|
+
[id]: {
|
|
77
|
+
...getConnectivityWithPositionEmptyFormData(isEquipmentModification, FieldConstants.CONNECTIVITY_1),
|
|
78
|
+
...getConnectivityWithPositionEmptyFormData(isEquipmentModification, FieldConstants.CONNECTIVITY_2)
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const getConnectivityWithoutPositionEmptyFormData = (id = FieldConstants.CONNECTIVITY) => ({
|
|
82
|
+
[id]: getConnectivityPropertiesEmptyFormData()
|
|
83
|
+
});
|
|
84
|
+
const getConnectivityVoltageLevelData = ({ voltageLevelId }) => {
|
|
85
|
+
if (!voltageLevelId) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
[FieldConstants.ID]: voltageLevelId
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const getConnectivityBusBarSectionData = ({ busbarSectionId }) => {
|
|
93
|
+
if (!busbarSectionId) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
[FieldConstants.ID]: busbarSectionId
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const getConnectivityPropertiesData = ({
|
|
101
|
+
voltageLevelId,
|
|
102
|
+
busbarSectionId
|
|
103
|
+
}) => {
|
|
104
|
+
return {
|
|
105
|
+
[FieldConstants.VOLTAGE_LEVEL]: getConnectivityVoltageLevelData({
|
|
106
|
+
voltageLevelId
|
|
107
|
+
}),
|
|
108
|
+
[FieldConstants.BUS_OR_BUSBAR_SECTION]: getConnectivityBusBarSectionData({
|
|
109
|
+
busbarSectionId
|
|
110
|
+
})
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
const getNewVoltageLevelData = (newVoltageLevel) => ({
|
|
114
|
+
id: newVoltageLevel.equipmentId,
|
|
115
|
+
name: newVoltageLevel.equipmentName ?? "",
|
|
116
|
+
substationId: newVoltageLevel.substationId,
|
|
117
|
+
topologyKind: newVoltageLevel.topologyKind
|
|
118
|
+
});
|
|
119
|
+
const getConnectivityData = ({ voltageLevelId, busbarSectionId }, id = FieldConstants.CONNECTIVITY) => {
|
|
120
|
+
return {
|
|
121
|
+
[id]: getConnectivityPropertiesData({
|
|
122
|
+
voltageLevelId,
|
|
123
|
+
busbarSectionId
|
|
124
|
+
})
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
const getConnectivityFormDataProps = ({
|
|
128
|
+
voltageLevelId,
|
|
129
|
+
busbarSectionId,
|
|
130
|
+
connectionDirection,
|
|
131
|
+
connectionName,
|
|
132
|
+
connectionPosition,
|
|
133
|
+
terminalConnected,
|
|
134
|
+
isEquipmentModification = false
|
|
135
|
+
}) => {
|
|
136
|
+
return {
|
|
137
|
+
...getConnectivityPropertiesData({
|
|
138
|
+
voltageLevelId,
|
|
139
|
+
busbarSectionId
|
|
140
|
+
}),
|
|
141
|
+
[FieldConstants.CONNECTION_DIRECTION]: connectionDirection ?? null,
|
|
142
|
+
[FieldConstants.CONNECTION_NAME]: connectionName ?? "",
|
|
143
|
+
[FieldConstants.CONNECTION_POSITION]: connectionPosition ?? null,
|
|
144
|
+
[FieldConstants.CONNECTED]: terminalConnected ?? (isEquipmentModification ? null : true)
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
const getConnectivityFormData = ({
|
|
148
|
+
voltageLevelId,
|
|
149
|
+
busbarSectionId,
|
|
150
|
+
connectionDirection,
|
|
151
|
+
connectionName,
|
|
152
|
+
connectionPosition,
|
|
153
|
+
terminalConnected,
|
|
154
|
+
isEquipmentModification = false
|
|
155
|
+
}, id = FieldConstants.CONNECTIVITY) => {
|
|
156
|
+
return {
|
|
157
|
+
[id]: getConnectivityFormDataProps({
|
|
158
|
+
voltageLevelId,
|
|
159
|
+
busbarSectionId,
|
|
160
|
+
connectionDirection,
|
|
161
|
+
connectionName,
|
|
162
|
+
connectionPosition,
|
|
163
|
+
terminalConnected,
|
|
164
|
+
isEquipmentModification
|
|
165
|
+
})
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
const createConnectivityData = (equipmentToModify, index) => ({
|
|
169
|
+
busbarSectionId: equipmentToModify?.[`busOrBusbarSectionId${index}`]?.value ?? null,
|
|
170
|
+
connectionDirection: equipmentToModify?.[`connectionDirection${index}`]?.value ?? null,
|
|
171
|
+
connectionName: equipmentToModify?.[`connectionName${index}`]?.value ?? "",
|
|
172
|
+
connectionPosition: equipmentToModify?.[`connectionPosition${index}`]?.value ?? null,
|
|
173
|
+
voltageLevelId: equipmentToModify?.[`voltageLevelId${index}`]?.value ?? null,
|
|
174
|
+
terminalConnected: equipmentToModify?.[`terminal${index}Connected`]?.value ?? null,
|
|
175
|
+
isEquipmentModification: true
|
|
176
|
+
});
|
|
177
|
+
export {
|
|
178
|
+
createConnectivityData,
|
|
179
|
+
getCon1andCon2WithPositionValidationSchema,
|
|
180
|
+
getConnectivityBusBarSectionData,
|
|
181
|
+
getConnectivityData,
|
|
182
|
+
getConnectivityFormData,
|
|
183
|
+
getConnectivityFormDataProps,
|
|
184
|
+
getConnectivityPropertiesData,
|
|
185
|
+
getConnectivityPropertiesEmptyFormData,
|
|
186
|
+
getConnectivityPropertiesValidationSchema,
|
|
187
|
+
getConnectivityVoltageLevelData,
|
|
188
|
+
getConnectivityWithPositionEmptyFormData,
|
|
189
|
+
getConnectivityWithPositionEmptyFormDataProps,
|
|
190
|
+
getConnectivityWithPositionSchema,
|
|
191
|
+
getConnectivityWithPositionValidationSchema,
|
|
192
|
+
getConnectivityWithoutPositionEmptyFormData,
|
|
193
|
+
getConnectivityWithoutPositionValidationSchema,
|
|
194
|
+
getCont1Cont2WithPositionEmptyFormData,
|
|
195
|
+
getNewVoltageLevelData
|
|
196
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 './connectivity.type';
|
|
8
|
+
export * from './connectivityForm.utils';
|
|
9
|
+
export * from './ConnectivityForm';
|
|
10
|
+
export * from './BranchConnectivityForm';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createConnectivityData, getCon1andCon2WithPositionValidationSchema, getConnectivityBusBarSectionData, getConnectivityData, getConnectivityFormData, getConnectivityFormDataProps, getConnectivityPropertiesData, getConnectivityPropertiesEmptyFormData, getConnectivityPropertiesValidationSchema, getConnectivityVoltageLevelData, getConnectivityWithPositionEmptyFormData, getConnectivityWithPositionEmptyFormDataProps, getConnectivityWithPositionSchema, getConnectivityWithPositionValidationSchema, getConnectivityWithoutPositionEmptyFormData, getConnectivityWithoutPositionValidationSchema, getCont1Cont2WithPositionEmptyFormData, getNewVoltageLevelData } from "./connectivityForm.utils.js";
|
|
2
|
+
import { ConnectivityForm } from "./ConnectivityForm.js";
|
|
3
|
+
import { BranchConnectivityForm } from "./BranchConnectivityForm.js";
|
|
4
|
+
export {
|
|
5
|
+
BranchConnectivityForm,
|
|
6
|
+
ConnectivityForm,
|
|
7
|
+
createConnectivityData,
|
|
8
|
+
getCon1andCon2WithPositionValidationSchema,
|
|
9
|
+
getConnectivityBusBarSectionData,
|
|
10
|
+
getConnectivityData,
|
|
11
|
+
getConnectivityFormData,
|
|
12
|
+
getConnectivityFormDataProps,
|
|
13
|
+
getConnectivityPropertiesData,
|
|
14
|
+
getConnectivityPropertiesEmptyFormData,
|
|
15
|
+
getConnectivityPropertiesValidationSchema,
|
|
16
|
+
getConnectivityVoltageLevelData,
|
|
17
|
+
getConnectivityWithPositionEmptyFormData,
|
|
18
|
+
getConnectivityWithPositionEmptyFormDataProps,
|
|
19
|
+
getConnectivityWithPositionSchema,
|
|
20
|
+
getConnectivityWithPositionValidationSchema,
|
|
21
|
+
getConnectivityWithoutPositionEmptyFormData,
|
|
22
|
+
getConnectivityWithoutPositionValidationSchema,
|
|
23
|
+
getCont1Cont2WithPositionEmptyFormData,
|
|
24
|
+
getNewVoltageLevelData
|
|
25
|
+
};
|
|
@@ -4,5 +4,8 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
-
export * from './properties';
|
|
8
7
|
export * from './form.utils';
|
|
8
|
+
export * from './properties';
|
|
9
|
+
export * from './measurements';
|
|
10
|
+
export * from './setpoints';
|
|
11
|
+
export * from './connectivity';
|
|
@@ -1,24 +1,79 @@
|
|
|
1
|
+
import { filledTextField, italicFontTextField, standardTextField } from "./form.utils.js";
|
|
1
2
|
import { PropertiesForm } from "./properties/PropertiesForm.js";
|
|
2
3
|
import { PropertyForm } from "./properties/PropertyForm.js";
|
|
3
4
|
import { copyEquipmentPropertiesForCreation, createPropertyModification, creationPropertiesSchema, emptyProperties, fetchPredefinedProperties, getConcatenatedProperties, getFilledPropertiesFromModification, getPropertiesFromModification, getPropertyValue, initializedProperty, mergeModificationAndEquipmentProperties, modificationPropertiesSchema, toModificationProperties } from "./properties/propertyUtils.js";
|
|
4
|
-
import {
|
|
5
|
+
import { getPowerWithValidityEditData, getPowerWithValidityEmptyFormData, getPowerWithValidityValidationSchema } from "./measurements/powerWithValidity.utils.js";
|
|
6
|
+
import { getInjectionActiveReactivePowerEditData, getInjectionActiveReactivePowerEditDataProperties, getInjectionActiveReactivePowerEmptyFormData, getInjectionActiveReactivePowerEmptyFormDataProperties, getInjectionActiveReactivePowerValidationSchema, getInjectionActiveReactivePowerValidationSchemaProperties } from "./measurements/injectionActiveReactivePowerForm.utils.js";
|
|
7
|
+
import { getBranchActiveReactivePowerEditData, getBranchActiveReactivePowerEditDataProperties, getBranchActiveReactivePowerEmptyFormData, getBranchActiveReactivePowerEmptyFormDataProperties, getBranchActiveReactivePowerValidationSchema, getBranchActiveReactivePowerValidationSchemaProperties } from "./measurements/branchActiveReactivePowerForm.utils.js";
|
|
8
|
+
import { PowerWithValidityForm } from "./measurements/PowerWithValidityForm.js";
|
|
9
|
+
import { PowerMeasurementsForm } from "./measurements/PowerMeasurementsForm.js";
|
|
10
|
+
import { BranchActiveReactivePowerMeasurementsForm } from "./measurements/BranchActiveReactivePowerMeasurementsForm.js";
|
|
11
|
+
import { getActivePowerSetPointSchema, getReactivePowerSetPointSchema, getSetPointsEmptyFormData, getSetPointsSchema, testValueWithinPowerInterval } from "./setpoints/setPoints.utils.js";
|
|
12
|
+
import { SetPointsForm } from "./setpoints/SetPointsForm.js";
|
|
13
|
+
import { createConnectivityData, getCon1andCon2WithPositionValidationSchema, getConnectivityBusBarSectionData, getConnectivityData, getConnectivityFormData, getConnectivityFormDataProps, getConnectivityPropertiesData, getConnectivityPropertiesEmptyFormData, getConnectivityPropertiesValidationSchema, getConnectivityVoltageLevelData, getConnectivityWithPositionEmptyFormData, getConnectivityWithPositionEmptyFormDataProps, getConnectivityWithPositionSchema, getConnectivityWithPositionValidationSchema, getConnectivityWithoutPositionEmptyFormData, getConnectivityWithoutPositionValidationSchema, getCont1Cont2WithPositionEmptyFormData, getNewVoltageLevelData } from "./connectivity/connectivityForm.utils.js";
|
|
14
|
+
import { ConnectivityForm } from "./connectivity/ConnectivityForm.js";
|
|
15
|
+
import { BranchConnectivityForm } from "./connectivity/BranchConnectivityForm.js";
|
|
5
16
|
export {
|
|
17
|
+
BranchActiveReactivePowerMeasurementsForm,
|
|
18
|
+
BranchConnectivityForm,
|
|
19
|
+
ConnectivityForm,
|
|
20
|
+
PowerMeasurementsForm,
|
|
21
|
+
PowerWithValidityForm,
|
|
6
22
|
PropertiesForm,
|
|
7
23
|
PropertyForm,
|
|
24
|
+
SetPointsForm,
|
|
8
25
|
copyEquipmentPropertiesForCreation,
|
|
26
|
+
createConnectivityData,
|
|
9
27
|
createPropertyModification,
|
|
10
28
|
creationPropertiesSchema,
|
|
11
29
|
emptyProperties,
|
|
12
30
|
fetchPredefinedProperties,
|
|
13
31
|
filledTextField,
|
|
32
|
+
getActivePowerSetPointSchema,
|
|
33
|
+
getBranchActiveReactivePowerEditData,
|
|
34
|
+
getBranchActiveReactivePowerEditDataProperties,
|
|
35
|
+
getBranchActiveReactivePowerEmptyFormData,
|
|
36
|
+
getBranchActiveReactivePowerEmptyFormDataProperties,
|
|
37
|
+
getBranchActiveReactivePowerValidationSchema,
|
|
38
|
+
getBranchActiveReactivePowerValidationSchemaProperties,
|
|
39
|
+
getCon1andCon2WithPositionValidationSchema,
|
|
14
40
|
getConcatenatedProperties,
|
|
41
|
+
getConnectivityBusBarSectionData,
|
|
42
|
+
getConnectivityData,
|
|
43
|
+
getConnectivityFormData,
|
|
44
|
+
getConnectivityFormDataProps,
|
|
45
|
+
getConnectivityPropertiesData,
|
|
46
|
+
getConnectivityPropertiesEmptyFormData,
|
|
47
|
+
getConnectivityPropertiesValidationSchema,
|
|
48
|
+
getConnectivityVoltageLevelData,
|
|
49
|
+
getConnectivityWithPositionEmptyFormData,
|
|
50
|
+
getConnectivityWithPositionEmptyFormDataProps,
|
|
51
|
+
getConnectivityWithPositionSchema,
|
|
52
|
+
getConnectivityWithPositionValidationSchema,
|
|
53
|
+
getConnectivityWithoutPositionEmptyFormData,
|
|
54
|
+
getConnectivityWithoutPositionValidationSchema,
|
|
55
|
+
getCont1Cont2WithPositionEmptyFormData,
|
|
15
56
|
getFilledPropertiesFromModification,
|
|
57
|
+
getInjectionActiveReactivePowerEditData,
|
|
58
|
+
getInjectionActiveReactivePowerEditDataProperties,
|
|
59
|
+
getInjectionActiveReactivePowerEmptyFormData,
|
|
60
|
+
getInjectionActiveReactivePowerEmptyFormDataProperties,
|
|
61
|
+
getInjectionActiveReactivePowerValidationSchema,
|
|
62
|
+
getInjectionActiveReactivePowerValidationSchemaProperties,
|
|
63
|
+
getNewVoltageLevelData,
|
|
64
|
+
getPowerWithValidityEditData,
|
|
65
|
+
getPowerWithValidityEmptyFormData,
|
|
66
|
+
getPowerWithValidityValidationSchema,
|
|
16
67
|
getPropertiesFromModification,
|
|
17
68
|
getPropertyValue,
|
|
69
|
+
getReactivePowerSetPointSchema,
|
|
70
|
+
getSetPointsEmptyFormData,
|
|
71
|
+
getSetPointsSchema,
|
|
18
72
|
initializedProperty,
|
|
19
73
|
italicFontTextField,
|
|
20
74
|
mergeModificationAndEquipmentProperties,
|
|
21
75
|
modificationPropertiesSchema,
|
|
22
76
|
standardTextField,
|
|
77
|
+
testValueWithinPowerInterval,
|
|
23
78
|
toModificationProperties
|
|
24
79
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PowerMeasurementsForm } from "./PowerMeasurementsForm.js";
|
|
3
|
+
import GridSection from "../../../grid/grid-section.js";
|
|
4
|
+
const styles = {
|
|
5
|
+
h3: {
|
|
6
|
+
marginTop: 0,
|
|
7
|
+
marginBottom: 0
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
function BranchActiveReactivePowerMeasurementsForm({
|
|
11
|
+
equipmentToModify
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(GridSection, { title: "MeasurementsSection", customStyle: styles.h3 }),
|
|
15
|
+
/* @__PURE__ */ jsx(GridSection, { title: "Side1", heading: 4 }),
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
PowerMeasurementsForm,
|
|
18
|
+
{
|
|
19
|
+
side: 1,
|
|
20
|
+
activePowerMeasurement: equipmentToModify?.measurementP1,
|
|
21
|
+
reactivePowerMeasurement: equipmentToModify?.measurementQ1
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ jsx(GridSection, { title: "Side2", heading: 4 }),
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
PowerMeasurementsForm,
|
|
27
|
+
{
|
|
28
|
+
side: 2,
|
|
29
|
+
activePowerMeasurement: equipmentToModify?.measurementP2,
|
|
30
|
+
reactivePowerMeasurement: equipmentToModify?.measurementQ2
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
BranchActiveReactivePowerMeasurementsForm
|
|
37
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MeasurementInfo } from './measurement.type';
|
|
2
|
+
interface PowerMeasurementsFormProps {
|
|
3
|
+
side?: 1 | 2;
|
|
4
|
+
activePowerMeasurement?: MeasurementInfo;
|
|
5
|
+
reactivePowerMeasurement?: MeasurementInfo;
|
|
6
|
+
reactivePowerOnly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function PowerMeasurementsForm({ side, activePowerMeasurement, reactivePowerMeasurement, reactivePowerOnly, }: Readonly<PowerMeasurementsFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid } from "@mui/material";
|
|
3
|
+
import { PowerWithValidityForm } from "./PowerWithValidityForm.js";
|
|
4
|
+
import GridItem from "../../../grid/grid-item.js";
|
|
5
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
6
|
+
import "../../../../utils/conversionUtils.js";
|
|
7
|
+
import "../../../../utils/types/equipmentType.js";
|
|
8
|
+
import { FieldType } from "../../../../utils/types/fieldType.js";
|
|
9
|
+
import "@mui/icons-material";
|
|
10
|
+
import "../../../../utils/yupConfig.js";
|
|
11
|
+
function PowerMeasurementsForm({
|
|
12
|
+
side,
|
|
13
|
+
activePowerMeasurement,
|
|
14
|
+
reactivePowerMeasurement,
|
|
15
|
+
reactivePowerOnly = false
|
|
16
|
+
}) {
|
|
17
|
+
const getActiveMeasurementType = (whichSide) => {
|
|
18
|
+
if (!whichSide) {
|
|
19
|
+
return FieldConstants.MEASUREMENT_P;
|
|
20
|
+
}
|
|
21
|
+
return whichSide === 1 ? FieldConstants.MEASUREMENT_P1 : FieldConstants.MEASUREMENT_P2;
|
|
22
|
+
};
|
|
23
|
+
const getReactiveMeasurementType = (whichSide) => {
|
|
24
|
+
if (!whichSide) {
|
|
25
|
+
return FieldConstants.MEASUREMENT_Q;
|
|
26
|
+
}
|
|
27
|
+
return whichSide === 1 ? FieldConstants.MEASUREMENT_Q1 : FieldConstants.MEASUREMENT_Q2;
|
|
28
|
+
};
|
|
29
|
+
const activePowerId = `${FieldConstants.STATE_ESTIMATION}.${getActiveMeasurementType(side)}`;
|
|
30
|
+
const reactivePowerId = `${FieldConstants.STATE_ESTIMATION}.${getReactiveMeasurementType(side)}`;
|
|
31
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
32
|
+
!reactivePowerOnly && /* @__PURE__ */ jsx(GridItem, { size: 12, children: /* @__PURE__ */ jsx(
|
|
33
|
+
PowerWithValidityForm,
|
|
34
|
+
{
|
|
35
|
+
id: activePowerId,
|
|
36
|
+
field: FieldType.ACTIVE_POWER,
|
|
37
|
+
measurement: activePowerMeasurement
|
|
38
|
+
}
|
|
39
|
+
) }),
|
|
40
|
+
/* @__PURE__ */ jsx(GridItem, { size: 12, children: /* @__PURE__ */ jsx(
|
|
41
|
+
PowerWithValidityForm,
|
|
42
|
+
{
|
|
43
|
+
id: reactivePowerId,
|
|
44
|
+
field: FieldType.REACTIVE_POWER,
|
|
45
|
+
measurement: reactivePowerMeasurement
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
PowerMeasurementsForm
|
|
52
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { Grid } from "@mui/material";
|
|
5
|
+
import GridItem from "../../../grid/grid-item.js";
|
|
6
|
+
import { CheckboxNullableInput } from "../../../inputs/reactHookForm/CheckboxNullableInput.js";
|
|
7
|
+
import "../../../overflowableText/OverflowableText.js";
|
|
8
|
+
import { ActivePowerAdornment, ReactivePowerAdornment } from "../../../../utils/constants/adornments.js";
|
|
9
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
10
|
+
import { convertInputValue } from "../../../../utils/conversionUtils.js";
|
|
11
|
+
import "../../../../utils/types/equipmentType.js";
|
|
12
|
+
import { FieldType } from "../../../../utils/types/fieldType.js";
|
|
13
|
+
import "@mui/icons-material";
|
|
14
|
+
import "../../../../utils/yupConfig.js";
|
|
15
|
+
import "react-hook-form";
|
|
16
|
+
import "localized-countries";
|
|
17
|
+
import "localized-countries/data/fr";
|
|
18
|
+
import "localized-countries/data/en";
|
|
19
|
+
import "notistack";
|
|
20
|
+
import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
21
|
+
import "yup";
|
|
22
|
+
import "../../../treeViewFinder/TreeViewFinder.js";
|
|
23
|
+
import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
24
|
+
import "../../../customAGGrid/customAggrid.js";
|
|
25
|
+
import "ag-grid-community";
|
|
26
|
+
import "react-papaparse";
|
|
27
|
+
import "react-csv-downloader";
|
|
28
|
+
import { FloatInput } from "../../../inputs/reactHookForm/numbers/FloatInput.js";
|
|
29
|
+
import "../../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
31
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
32
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
33
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
34
|
+
import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
35
|
+
import "@react-querybuilder/material";
|
|
36
|
+
import "../../../filter/expert/expertFilterConstants.js";
|
|
37
|
+
import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
38
|
+
import "uuid";
|
|
39
|
+
import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
40
|
+
import "react-querybuilder";
|
|
41
|
+
function PowerWithValidityForm({ id, field, measurement }) {
|
|
42
|
+
const intl = useIntl();
|
|
43
|
+
const previousValidityField = useMemo(() => {
|
|
44
|
+
if (measurement?.validity == null) {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
return measurement.validity ? intl.formatMessage({ id: "ValidMeasurement" }) : intl.formatMessage({ id: "InvalidMeasurement" });
|
|
48
|
+
}, [intl, measurement?.validity]);
|
|
49
|
+
const valueField = /* @__PURE__ */ jsx(
|
|
50
|
+
FloatInput,
|
|
51
|
+
{
|
|
52
|
+
name: `${id}.${FieldConstants.VALUE}`,
|
|
53
|
+
label: field === FieldType.ACTIVE_POWER ? "ActivePowerText" : "ReactivePowerText",
|
|
54
|
+
adornment: field === FieldType.ACTIVE_POWER ? ActivePowerAdornment : ReactivePowerAdornment,
|
|
55
|
+
previousValue: convertInputValue(field, measurement?.value),
|
|
56
|
+
clearable: true
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
const validityField = /* @__PURE__ */ jsx(
|
|
60
|
+
CheckboxNullableInput,
|
|
61
|
+
{
|
|
62
|
+
name: `${id}.${FieldConstants.VALIDITY}`,
|
|
63
|
+
label: "ValidMeasurement",
|
|
64
|
+
previousValue: previousValidityField
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(GridItem, { size: 6, children: valueField }),
|
|
69
|
+
/* @__PURE__ */ jsx(GridItem, { size: 6, children: validityField })
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
PowerWithValidityForm
|
|
74
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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 declare function getBranchActiveReactivePowerEmptyFormDataProperties(): {
|
|
8
|
+
[x: string]: {
|
|
9
|
+
value: null;
|
|
10
|
+
validity: null;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare function getBranchActiveReactivePowerEmptyFormData(id: string): {
|
|
14
|
+
[id]: {
|
|
15
|
+
[x: string]: {
|
|
16
|
+
value: null;
|
|
17
|
+
validity: null;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const getBranchActiveReactivePowerValidationSchemaProperties: () => {
|
|
22
|
+
[x: string]: import('yup').ObjectSchema<{
|
|
23
|
+
value: number | null | undefined;
|
|
24
|
+
validity: boolean | null | undefined;
|
|
25
|
+
}, import('yup').AnyObject, {
|
|
26
|
+
value: undefined;
|
|
27
|
+
validity: undefined;
|
|
28
|
+
}, "">;
|
|
29
|
+
};
|
|
30
|
+
export declare const getBranchActiveReactivePowerValidationSchema: (id: string) => {
|
|
31
|
+
[x: string]: import('yup').ObjectSchema<{
|
|
32
|
+
[x: string]: {
|
|
33
|
+
validity?: boolean | null | undefined;
|
|
34
|
+
value?: number | null | undefined;
|
|
35
|
+
};
|
|
36
|
+
}, import('yup').AnyObject, {
|
|
37
|
+
[x: string]: {
|
|
38
|
+
value: undefined;
|
|
39
|
+
validity: undefined;
|
|
40
|
+
};
|
|
41
|
+
}, "">;
|
|
42
|
+
};
|
|
43
|
+
export declare function getBranchActiveReactivePowerEditDataProperties(branchData: any): {
|
|
44
|
+
[x: string]: {
|
|
45
|
+
value: number;
|
|
46
|
+
validity: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare function getBranchActiveReactivePowerEditData(id: string, branchData: any): {
|
|
50
|
+
[id]: {
|
|
51
|
+
[x: string]: {
|
|
52
|
+
value: number;
|
|
53
|
+
validity: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { object } from "yup";
|
|
2
|
+
import { getPowerWithValidityValidationSchema, getPowerWithValidityEmptyFormData, getPowerWithValidityEditData } from "./powerWithValidity.utils.js";
|
|
3
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
4
|
+
import "../../../../utils/conversionUtils.js";
|
|
5
|
+
import "../../../../utils/types/equipmentType.js";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
import "../../../../utils/yupConfig.js";
|
|
9
|
+
function getBranchActiveReactivePowerEmptyFormDataProperties() {
|
|
10
|
+
return {
|
|
11
|
+
...getPowerWithValidityEmptyFormData(FieldConstants.MEASUREMENT_P1),
|
|
12
|
+
...getPowerWithValidityEmptyFormData(FieldConstants.MEASUREMENT_Q1),
|
|
13
|
+
...getPowerWithValidityEmptyFormData(FieldConstants.MEASUREMENT_P2),
|
|
14
|
+
...getPowerWithValidityEmptyFormData(FieldConstants.MEASUREMENT_Q2)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function getBranchActiveReactivePowerEmptyFormData(id) {
|
|
18
|
+
return {
|
|
19
|
+
[id]: {
|
|
20
|
+
...getBranchActiveReactivePowerEmptyFormDataProperties()
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const getBranchActiveReactivePowerValidationSchemaProperties = () => ({
|
|
25
|
+
...getPowerWithValidityValidationSchema(FieldConstants.MEASUREMENT_P1),
|
|
26
|
+
...getPowerWithValidityValidationSchema(FieldConstants.MEASUREMENT_Q1),
|
|
27
|
+
...getPowerWithValidityValidationSchema(FieldConstants.MEASUREMENT_P2),
|
|
28
|
+
...getPowerWithValidityValidationSchema(FieldConstants.MEASUREMENT_Q2)
|
|
29
|
+
});
|
|
30
|
+
const getBranchActiveReactivePowerValidationSchema = (id) => ({
|
|
31
|
+
[id]: object().shape({
|
|
32
|
+
...getBranchActiveReactivePowerValidationSchemaProperties()
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
function getBranchActiveReactivePowerEditDataProperties(branchData) {
|
|
36
|
+
return {
|
|
37
|
+
...getPowerWithValidityEditData(FieldConstants.MEASUREMENT_P1, {
|
|
38
|
+
value: branchData?.p1MeasurementValue?.value,
|
|
39
|
+
validity: branchData?.p1MeasurementValidity?.value
|
|
40
|
+
}),
|
|
41
|
+
...getPowerWithValidityEditData(FieldConstants.MEASUREMENT_Q1, {
|
|
42
|
+
value: branchData?.q1MeasurementValue?.value,
|
|
43
|
+
validity: branchData?.q1MeasurementValidity?.value
|
|
44
|
+
}),
|
|
45
|
+
...getPowerWithValidityEditData(FieldConstants.MEASUREMENT_P2, {
|
|
46
|
+
value: branchData?.p2MeasurementValue?.value,
|
|
47
|
+
validity: branchData?.p2MeasurementValidity?.value
|
|
48
|
+
}),
|
|
49
|
+
...getPowerWithValidityEditData(FieldConstants.MEASUREMENT_Q2, {
|
|
50
|
+
value: branchData?.q2MeasurementValue?.value,
|
|
51
|
+
validity: branchData?.q2MeasurementValidity?.value
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function getBranchActiveReactivePowerEditData(id, branchData) {
|
|
56
|
+
return {
|
|
57
|
+
[id]: {
|
|
58
|
+
...getBranchActiveReactivePowerEditDataProperties(branchData)
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
getBranchActiveReactivePowerEditData,
|
|
64
|
+
getBranchActiveReactivePowerEditDataProperties,
|
|
65
|
+
getBranchActiveReactivePowerEmptyFormData,
|
|
66
|
+
getBranchActiveReactivePowerEmptyFormDataProperties,
|
|
67
|
+
getBranchActiveReactivePowerValidationSchema,
|
|
68
|
+
getBranchActiveReactivePowerValidationSchemaProperties
|
|
69
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 './measurement.type';
|
|
8
|
+
export * from './powerWithValidity.utils';
|
|
9
|
+
export * from './injectionActiveReactivePowerForm.utils';
|
|
10
|
+
export * from './branchActiveReactivePowerForm.utils';
|
|
11
|
+
export * from './PowerWithValidityForm';
|
|
12
|
+
export * from './PowerMeasurementsForm';
|
|
13
|
+
export * from './BranchActiveReactivePowerMeasurementsForm';
|