@gridsuite/commons-ui 0.148.0 → 0.149.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.
|
@@ -5,7 +5,7 @@ import { green, red } from "@mui/material/colors";
|
|
|
5
5
|
import { Lens } from "@mui/icons-material";
|
|
6
6
|
import { useWatch, useFormContext } from "react-hook-form";
|
|
7
7
|
import { FormattedMessage } from "react-intl";
|
|
8
|
-
import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS, intlPredefinedParametersOptions,
|
|
8
|
+
import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS, intlPredefinedParametersOptions, intlInitialVoltageProfileMode, onlyStartedGeneratorsOptions, PredefinedParameters, InitialVoltage, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS } from "./constants.js";
|
|
9
9
|
import { VoltageTable } from "./short-circuit-voltage-table.js";
|
|
10
10
|
import GridItem from "../../grid/grid-item.js";
|
|
11
11
|
import GridSection from "../../grid/grid-section.js";
|
|
@@ -94,12 +94,8 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
|
|
|
94
94
|
return !watchLoads && !watchShuntCompensators && watchVSC && !watchNeutralPosition && !watchOnlyStartedGenerators;
|
|
95
95
|
}, [watchLoads, watchShuntCompensators, watchVSC, watchNeutralPosition, watchOnlyStartedGenerators]);
|
|
96
96
|
const predefinedParamsOptions = useMemo(() => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return options.filter((opt) => opt.id !== PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP);
|
|
100
|
-
}
|
|
101
|
-
return options;
|
|
102
|
-
}, [isDeveloperMode]);
|
|
97
|
+
return intlPredefinedParametersOptions();
|
|
98
|
+
}, []);
|
|
103
99
|
const initialVoltageProfileMode = useMemo(() => {
|
|
104
100
|
return intlInitialVoltageProfileMode();
|
|
105
101
|
}, []);
|
|
@@ -114,16 +110,6 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
|
|
|
114
110
|
resetAll(newPredefinedParameters);
|
|
115
111
|
};
|
|
116
112
|
const { setValue } = useFormContext();
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
if (!isDeveloperMode) {
|
|
119
|
-
if (watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP) {
|
|
120
|
-
setValue(SHORT_CIRCUIT_PREDEFINED_PARAMS, PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP, {
|
|
121
|
-
shouldDirty: false,
|
|
122
|
-
shouldValidate: true
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, [isDeveloperMode, watchPredefinedParams, setValue]);
|
|
127
113
|
const feederResult = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
|
|
128
114
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "descWithFeederResult" }) }),
|
|
129
115
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_FEEDER_RESULT}` }) })
|
|
@@ -230,16 +216,18 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
|
|
|
230
216
|
isThereSpecificParameters && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
231
217
|
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitStartedGeneratorsMode", heading: 4 }),
|
|
232
218
|
/* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: onlyStartedGenerators }) }),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
219
|
+
isDeveloperMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
220
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPowerElectronicsSection", heading: 4 }),
|
|
221
|
+
/* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: modelPowerElectronics }) }),
|
|
222
|
+
/* @__PURE__ */ jsx(
|
|
223
|
+
ShortCircuitIccMaterialTable,
|
|
224
|
+
{
|
|
225
|
+
formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS}`,
|
|
226
|
+
tableHeight: 300,
|
|
227
|
+
columnsDefinition: columnsDef
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] })
|
|
243
231
|
] })
|
|
244
232
|
] });
|
|
245
233
|
}
|