@gridsuite/commons-ui 0.170.0 → 0.172.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.
Files changed (61) hide show
  1. package/dist/components/index.js +6 -1
  2. package/dist/components/inputs/reactHookForm/selectInputs/CountriesInput.js +13 -10
  3. package/dist/components/parameters/common/contingency-table/contingency-table.d.ts +4 -2
  4. package/dist/components/parameters/common/contingency-table/contingency-table.js +22 -11
  5. package/dist/components/parameters/common/contingency-table/types.d.ts +4 -0
  6. package/dist/components/parameters/common/parameters.js +1 -1
  7. package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +5 -5
  8. package/dist/components/parameters/index.js +6 -1
  9. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +8 -15
  10. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +2 -2
  11. package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +2 -4
  12. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +2 -3
  13. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +33 -43
  14. package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +7 -9
  15. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +4 -2
  16. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +5 -3
  17. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +4 -2
  18. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +5 -4
  19. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +1 -3
  20. package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +10 -11
  21. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +6 -7
  22. package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
  23. package/dist/components/parameters/short-circuit/constants.d.ts +5 -0
  24. package/dist/components/parameters/short-circuit/constants.js +10 -0
  25. package/dist/components/parameters/short-circuit/index.js +6 -1
  26. package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.d.ts +10 -0
  27. package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.js +206 -0
  28. package/dist/components/parameters/short-circuit/short-circuit-parameters-content.d.ts +7 -0
  29. package/dist/components/parameters/short-circuit/short-circuit-parameters-content.js +108 -0
  30. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +7 -14
  31. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +33 -30
  32. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
  33. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +5 -0
  34. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +72 -25
  35. package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.d.ts +2 -0
  36. package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +95 -0
  37. package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.d.ts +2 -0
  38. package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.js +143 -0
  39. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +5 -1
  40. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +34 -14
  41. package/dist/hooks/use-parameters-backend.d.ts +2 -3
  42. package/dist/hooks/use-parameters-backend.js +33 -110
  43. package/dist/index.js +8 -6
  44. package/dist/services/directory.js +1 -1
  45. package/dist/services/explore.js +1 -1
  46. package/dist/services/index.js +2 -5
  47. package/dist/services/loadflow.d.ts +0 -1
  48. package/dist/services/loadflow.js +1 -8
  49. package/dist/services/security-analysis.d.ts +0 -2
  50. package/dist/services/security-analysis.js +2 -23
  51. package/dist/services/sensitivity-analysis.d.ts +0 -1
  52. package/dist/services/sensitivity-analysis.js +1 -8
  53. package/dist/translations/en/parameters.d.ts +10 -8
  54. package/dist/translations/en/parameters.js +10 -8
  55. package/dist/translations/fr/parameters.d.ts +10 -9
  56. package/dist/translations/fr/parameters.js +10 -9
  57. package/dist/utils/constants/adornments.js +1 -1
  58. package/dist/utils/types/parameters.type.d.ts +16 -13
  59. package/package.json +1 -1
  60. package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +0 -10
  61. package/dist/components/parameters/short-circuit/short-circuit-fields.js +0 -276
@@ -47,6 +47,8 @@ const parametersFr = {
47
47
  RealPercentage: "Cette valeur doit être comprise entre 0 et 1",
48
48
  General: "Général",
49
49
  LimitReductions: "Abattements",
50
+ StudyArea: "Zone d'étude",
51
+ PowerElectronics: "Electronique de puissance",
50
52
  IST: "IST",
51
53
  LimitVoltageInterval: "Entre IT{lowBound} et IT{highBound}",
52
54
  LimitVoltageAfterIST: "Entre IST et IT{highBound}",
@@ -106,6 +108,11 @@ const parametersFr = {
106
108
  ShortCircuitCharacteristics: "Caractéristiques prises en compte",
107
109
  ShortCircuitVoltageProfileMode: "Plan de tension initial",
108
110
  ShortCircuitStartedGeneratorsMode: "Démarrage des groupes",
111
+ ShortCircuitInClusterFilter: "Regroupements de la zone intérieure",
112
+ ShortCircuitInCluster: "Zone intérieure",
113
+ ShortCircuitOutCluster: "Zone extérieure",
114
+ startedGeneratorsInCalculationClusterThreshold: "Seuil",
115
+ startedGeneratorsOutsideCalculationClusterThreshold: "Seuil",
109
116
  ShortCircuitPowerElectronicsSection: "Modélisation des équipements raccordés par de l'électronique de puissance",
110
117
  ShortCircuitModelPowerElectronics: "Prise en compte des caractéristiques d'Icc suivantes",
111
118
  ShortCircuitIccActive: "Actif",
@@ -192,7 +199,9 @@ const parametersFr = {
192
199
  AddContingencyList: "Ajouter",
193
200
  DeleteContingencyList: "Supprimer",
194
201
  getContingencyListError: "Impossible de récupérer les listes d'aléas",
195
- xContingenciesWillBeSimulated: "{x} défauts à simuler",
202
+ xContingenciesWillBeSimulatedAndYNotFound: "{x, plural, =0 {aucun défaut} =1 {1 défaut} other {{x} défauts}} à simuler {y, plural, =0 {} =1 {et 1 non trouvé} other {et {y} non trouvés}}",
203
+ contingencyCountImpossibleOnUnbuiltNode: "Impossible d'estimer le nombre d'aléas sur un noeud non réalisé",
204
+ noContingency: "Aucun défaut",
196
205
  resultsThreshold: "Seuil minimal de sensibilité",
197
206
  SensitivityBranches: "Quadripôles",
198
207
  SensitivityInjectionsSet: "Par rapport à un ensemble d'injections :",
@@ -227,27 +236,19 @@ const parametersFr = {
227
236
  Optional: " (optionnel)",
228
237
  // Computed translations used in the snackbars
229
238
  // LoadFlow
230
- fetchDefaultLoadFlowProviderError: "Une erreur est survenue lors de la récupération du fournisseur de calcul de répartition par défaut",
231
239
  fetchLoadFlowParametersError: "Une erreur est survenue lors de la récupération des paramètres de calcul de répartition",
232
240
  fetchLoadFlowProviderError: "Une erreur est survenue lors de la récupération du fournisseur de calcul de répartition",
233
241
  fetchLoadFlowProvidersError: "Une erreur est survenue lors de la récupération des fournisseurs de calcul de répartition",
234
242
  fetchLoadFlowSpecificParametersError: "Une erreur est survenue lors de la récupération des paramètres spécifiques de calcul de répartition",
235
243
  updateLoadFlowParametersError: "Une erreur est survenue lors de la mise à jour des paramètres de calcul de répartition",
236
- updateLoadFlowProviderError: "Une erreur est survenue lors de la mise à jour du fournisseur courant de calcul de répartition",
237
244
  // SecurityAnalysis
238
- fetchDefaultSecurityAnalysisProviderError: "Une erreur est survenue lors de la récupération du fournisseur d'analyse de sécurité par défaut",
239
245
  fetchSecurityAnalysisParametersError: "Une erreur est survenue lors de la récupération des paramètres de l'analyse de sécurité",
240
- fetchSecurityAnalysisProviderError: "Une erreur est survenue lors de la récupération du fournisseur courant d'analyse de sécurité",
241
246
  fetchSecurityAnalysisProvidersError: "Une erreur est survenue lors de la récupération des fournisseurs d'analyse de sécurité",
242
247
  updateSecurityAnalysisParametersError: "Une erreur est survenue lors de la mise a jour des paramètres de l'analyse de sécurité",
243
- updateSecurityAnalysisProviderError: "Une erreur est survenue lors de la mise a jour du fournisseur courant d'analyse de sécurité",
244
248
  // SensitivityAnalysis
245
- fetchDefaultSensitivityAnalysisProviderError: "Une erreur est survenue lors de la récupération du fournisseur d'analyse de sensibilité par défaut",
246
249
  fetchSensitivityAnalysisParametersError: "Une erreur est survenue lors de la récupération des paramètres de l'analyse de sensibilité",
247
- fetchSensitivityAnalysisProviderError: "Une erreur est survenue lors de la récupération du fournisseur courant d'analyse de sensibilité",
248
250
  fetchSensitivityAnalysisProvidersError: "Une erreur est survenue lors de la récupération des fournisseurs d'analyse de sensibilité",
249
251
  updateSensitivityAnalysisParametersError: "Une erreur est survenue lors de la mise a jour des paramètres de l'analyse de sensibilité",
250
- updateSensitivityAnalysisProviderError: "Une erreur est survenue lors de la mise a jour du fournisseur courant d'analyse de sensibilité",
251
252
  getSensitivityAnalysisFactorsCountError: "Une erreur est survenue lors de l'estimation du nombre de calculs",
252
253
  // Other
253
254
  resetLoadFlowParametersWarning: "Impossible de récupérer les paramètres de calcul de répartition définis dans le profil utilisateur (les valeurs par défaut sont appliquées)",
@@ -1,4 +1,4 @@
1
- import { MICRO_SIEMENS, SIEMENS, OHM, AMPERE, KILO_AMPERE, MEGA_WATT, MEGA_VAR, MEGA_VOLT_AMPERE, KILO_VOLT, KILO_METER, PERCENTAGE } from "./unitsConstants.js";
1
+ import { MEGA_WATT, MICRO_SIEMENS, SIEMENS, OHM, AMPERE, KILO_AMPERE, MEGA_VAR, MEGA_VOLT_AMPERE, KILO_VOLT, KILO_METER, PERCENTAGE } from "./unitsConstants.js";
2
2
  const MicroSusceptanceAdornment = {
3
3
  position: "end",
4
4
  text: MICRO_SIEMENS
@@ -30,16 +30,19 @@ export type SpecificParametersDescription = Record<string, SpecificParameterInfo
30
30
  export type SpecificParametersValues = Record<string, any>;
31
31
  export type SpecificParametersPerProvider = Record<string, SpecificParametersValues>;
32
32
  export type ParametersInfos<T extends ComputingType> = T extends ComputingType.SENSITIVITY_ANALYSIS ? SensitivityAnalysisParametersInfos : T extends ComputingType.SECURITY_ANALYSIS ? SAParameters : T extends ComputingType.LOAD_FLOW ? LoadFlowParametersInfos : T extends ComputingType.DYNAMIC_SIMULATION ? DynamicSimulationParametersFetchReturn : T extends ComputingType.DYNAMIC_SECURITY_ANALYSIS ? DynamicSecurityAnalysisParametersFetchReturn : T extends ComputingType.DYNAMIC_MARGIN_CALCULATION ? DynamicMarginCalculationParametersInfos : T extends ComputingType.SHORT_CIRCUIT ? ShortCircuitParametersInfos : Record<string, any>;
33
- export type UseParametersBackendReturnProps<T extends ComputingType> = [
34
- Record<string, string>,
35
- string | undefined,
36
- (studyUuid: UUID) => void,
37
- (newProvider: string) => void,
38
- () => void,
39
- ParametersInfos<T> | null,
40
- (studyUuid: UUID) => void,
41
- (newParams: ParametersInfos<T>) => void,
42
- () => Promise<void> | undefined,
43
- SpecificParametersDescription | null,
44
- ILimitReductionsByVoltageLevel[]
45
- ];
33
+ export type BackendFunctions<T extends ComputingType> = {
34
+ backendFetchProviders?: (() => Promise<string[]>) | null;
35
+ backendFetchParameters: (paramsUuidOrStudyUuid: UUID) => Promise<ParametersInfos<T>>;
36
+ backendUpdateParameters?: (paramsUuidOrStudyUuid: UUID, newParam: ParametersInfos<T> | null) => Promise<any>;
37
+ backendFetchSpecificParametersDescription?: () => Promise<SpecificParametersDescription>;
38
+ backendFetchDefaultLimitReductions?: () => Promise<ILimitReductionsByVoltageLevel[]>;
39
+ };
40
+ export type UseParametersBackendReturnProps<T extends ComputingType> = {
41
+ providers: Record<string, string>;
42
+ params: ParametersInfos<T> | null;
43
+ fetchParameters: (paramsUuidOrStudyUuid: UUID) => void;
44
+ updateParameters: (newParams: ParametersInfos<T>) => void;
45
+ resetParameters: () => void;
46
+ specificParamsDescription: SpecificParametersDescription | null;
47
+ defaultLimitReductions: ILimitReductionsByVoltageLevel[];
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.170.0",
3
+ "version": "0.172.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -1,10 +0,0 @@
1
- import { PredefinedParameters } from './constants';
2
- export interface ShortCircuitFieldsProps {
3
- resetAll: (predefinedParams: PredefinedParameters) => void;
4
- isDeveloperMode: boolean;
5
- }
6
- export declare enum Status {
7
- SUCCESS = "SUCCESS",
8
- ERROR = "ERROR"
9
- }
10
- export declare function ShortCircuitFields({ resetAll, isDeveloperMode }: Readonly<ShortCircuitFieldsProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,276 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useState, useMemo, useEffect } from "react";
3
- import { Grid } from "@mui/material";
4
- import { green, red } from "@mui/material/colors";
5
- import { Lens } from "@mui/icons-material";
6
- import { useWatch, useFormContext } from "react-hook-form";
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_IN_CALCULATION_CLUSTER, intlPredefinedParametersOptions, intlInitialVoltageProfileMode, onlyStartedGeneratorsOptions, PredefinedParameters, InitialVoltage, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS } from "./constants.js";
9
- import { VoltageTable } from "./short-circuit-voltage-table.js";
10
- import GridItem from "../../grid/grid-item.js";
11
- import GridSection from "../../grid/grid-section.js";
12
- import { FieldLabel } from "../../inputs/reactHookForm/utils/FieldLabel.js";
13
- import "../../overflowableText/OverflowableText.js";
14
- import "../../../utils/conversionUtils.js";
15
- import "../../../utils/types/equipmentType.js";
16
- import "../../../utils/yupConfig.js";
17
- import "localized-countries";
18
- import "localized-countries/data/fr";
19
- import "localized-countries/data/en";
20
- import "notistack";
21
- import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
22
- import "yup";
23
- import "../../treeViewFinder/TreeViewFinder.js";
24
- import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
25
- import "../../customAGGrid/customAggrid.js";
26
- import "ag-grid-community";
27
- import "react-papaparse";
28
- import "react-csv-downloader";
29
- import { CheckboxInput } from "../../inputs/reactHookForm/booleans/CheckboxInput.js";
30
- import { RadioInput } from "../../inputs/reactHookForm/booleans/RadioInput.js";
31
- import { SwitchInput } from "../../inputs/reactHookForm/booleans/SwitchInput.js";
32
- import "../../inputs/reactHookForm/numbers/RangeInput.js";
33
- import { MuiSelectInput } from "../../inputs/reactHookForm/selectInputs/MuiSelectInput.js";
34
- import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
35
- import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
36
- import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
37
- import "@material-symbols/svg-400/outlined/add_notes.svg?react";
38
- import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
39
- import "@react-querybuilder/material";
40
- import "../../filter/expert/expertFilterConstants.js";
41
- import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
42
- import "uuid";
43
- import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
44
- import "react-querybuilder";
45
- import { COMMON_PARAMETERS, SPECIFIC_PARAMETERS } from "../common/constants.js";
46
- import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
47
- import "../common/widget/parameter-line-slider.js";
48
- import "../common/limitreductions/columns-definitions.js";
49
- import { ShortCircuitIccMaterialTable } from "./short-circuit-icc-material-table.js";
50
- import { COLUMNS_DEFINITIONS_ICC_MATERIALS, COLUMNS_DEFINITIONS_ICC_CLUSTERS } from "./columns-definition.js";
51
- import { ShortCircuitIccClusterTable } from "./short-circuit-icc-cluster-table.js";
52
- var Status = /* @__PURE__ */ ((Status2) => {
53
- Status2["SUCCESS"] = "SUCCESS";
54
- Status2["ERROR"] = "ERROR";
55
- return Status2;
56
- })(Status || {});
57
- const iccMaterialsColumnsDef = COLUMNS_DEFINITIONS_ICC_MATERIALS.map((col) => ({
58
- ...col,
59
- label: /* @__PURE__ */ jsx(FormattedMessage, { id: col.label }),
60
- tooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: col.tooltip })
61
- }));
62
- const iccClustersColumnsDef = COLUMNS_DEFINITIONS_ICC_CLUSTERS.map((col) => ({
63
- ...col,
64
- label: /* @__PURE__ */ jsx(FormattedMessage, { id: col.label }),
65
- tooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: col.tooltip })
66
- }));
67
- function createRows() {
68
- const rowData = {};
69
- iccClustersColumnsDef.forEach((column) => {
70
- rowData[column.dataKey] = column.initialValue;
71
- });
72
- return rowData;
73
- }
74
- function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
75
- const [status, setStatus] = useState(
76
- "SUCCESS"
77
- /* SUCCESS */
78
- );
79
- const watchInitialVoltageProfileMode = useWatch({
80
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`
81
- });
82
- const watchPredefinedParams = useWatch({
83
- name: SHORT_CIRCUIT_PREDEFINED_PARAMS
84
- });
85
- const watchLoads = useWatch({
86
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`
87
- });
88
- const watchShuntCompensators = useWatch({
89
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`
90
- });
91
- const watchVSC = useWatch({
92
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`
93
- });
94
- const watchNeutralPosition = useWatch({
95
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`
96
- });
97
- const watchSpecificParameters = useWatch({
98
- name: `${SPECIFIC_PARAMETERS}`
99
- });
100
- const isThereSpecificParameters = useMemo(
101
- () => Object.keys(watchSpecificParameters).length > 0 && watchSpecificParameters.constructor === Object,
102
- [watchSpecificParameters]
103
- );
104
- const watchOnlyStartedGeneratorsInCalculationCluster = useWatch({
105
- name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER}`
106
- });
107
- const isIccMinFeaturesDefaultConfiguration = useMemo(() => {
108
- return !watchLoads && !watchShuntCompensators && !watchVSC && !watchNeutralPosition && // if watchOnlyStartedGeneratorsInCalculationCluster is undefined, we consider IccMinFeaturesDefaultConfiguration as true
109
- (watchOnlyStartedGeneratorsInCalculationCluster ?? true);
110
- }, [
111
- watchLoads,
112
- watchShuntCompensators,
113
- watchVSC,
114
- watchNeutralPosition,
115
- watchOnlyStartedGeneratorsInCalculationCluster
116
- ]);
117
- const isIccMaxFeaturesDefaultConfiguration = useMemo(() => {
118
- return !watchLoads && !watchShuntCompensators && watchVSC && !watchNeutralPosition && // if watchOnlyStartedGeneratorsInCalculationCluster is undefined, we consider IccMaxFeaturesDefaultConfiguration as true
119
- !(watchOnlyStartedGeneratorsInCalculationCluster ?? false);
120
- }, [
121
- watchLoads,
122
- watchShuntCompensators,
123
- watchVSC,
124
- watchNeutralPosition,
125
- watchOnlyStartedGeneratorsInCalculationCluster
126
- ]);
127
- const predefinedParamsOptions = useMemo(() => {
128
- return intlPredefinedParametersOptions();
129
- }, []);
130
- const initialVoltageProfileMode = useMemo(() => {
131
- return intlInitialVoltageProfileMode();
132
- }, []);
133
- const statusColor = useMemo(
134
- () => ({ color: status === "SUCCESS" ? green[500] : red[500] }),
135
- [status]
136
- );
137
- const statusToShow = /* @__PURE__ */ jsx(Lens, { fontSize: "medium", sx: statusColor });
138
- const onPredefinedParametersManualChange = (event) => {
139
- const newPredefinedParameters = event.target.value;
140
- console.debug("onPredefinedParametersManualChange new:", newPredefinedParameters);
141
- resetAll(newPredefinedParameters);
142
- };
143
- const { setValue } = useFormContext();
144
- const feederResult = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
145
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "descWithFeederResult" }) }),
146
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_FEEDER_RESULT}` }) })
147
- ] });
148
- const predefinedParameters = /* @__PURE__ */ jsx(
149
- MuiSelectInput,
150
- {
151
- name: SHORT_CIRCUIT_PREDEFINED_PARAMS,
152
- options: predefinedParamsOptions,
153
- onChange: onPredefinedParametersManualChange,
154
- fullWidth: true
155
- }
156
- );
157
- const initialVoltageProfileModeField = /* @__PURE__ */ jsx(
158
- RadioInput,
159
- {
160
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`,
161
- options: Object.values(initialVoltageProfileMode)
162
- }
163
- );
164
- const loads = /* @__PURE__ */ jsx(CheckboxInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`, label: "shortCircuitLoads" });
165
- const vsc = /* @__PURE__ */ jsx(
166
- CheckboxInput,
167
- {
168
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`,
169
- label: "shortCircuitHvdc"
170
- }
171
- );
172
- const shuntCompensators = /* @__PURE__ */ jsx(
173
- CheckboxInput,
174
- {
175
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`,
176
- label: "shortCircuitShuntCompensators"
177
- }
178
- );
179
- const neutralPosition = /* @__PURE__ */ jsx(
180
- CheckboxInput,
181
- {
182
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`,
183
- label: "shortCircuitNeutralPosition"
184
- }
185
- );
186
- const onlyStartedGeneratorsInCalculationCluster = /* @__PURE__ */ jsx(
187
- RadioInput,
188
- {
189
- name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER}`,
190
- options: Object.values(onlyStartedGeneratorsOptions),
191
- formProps: {
192
- onChange: (_event, value) => {
193
- setValue(
194
- `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER}`,
195
- value === "true",
196
- {
197
- shouldDirty: true
198
- }
199
- );
200
- }
201
- }
202
- }
203
- );
204
- const modelPowerElectronics = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
205
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "ShortCircuitModelPowerElectronics" }) }),
206
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS}` }) })
207
- ] });
208
- useEffect(() => {
209
- const isIccMaxWithNominalVoltageMap = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP;
210
- const isIccMinWithNominal = watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP;
211
- const isInitialVoltageNominal = watchInitialVoltageProfileMode === InitialVoltage.NOMINAL;
212
- const isIccMaxNominalDefaultConfiguration = isIccMaxWithNominalVoltageMap && isInitialVoltageNominal;
213
- const isIccMinNominalDefaultConfiguration = isIccMinWithNominal && isInitialVoltageNominal;
214
- const isCEI909DefaultConfiguration = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_CEI909 && watchInitialVoltageProfileMode === InitialVoltage.CEI909;
215
- const isIccMaxDefaultConfiguration = (isIccMaxNominalDefaultConfiguration || isCEI909DefaultConfiguration) && isIccMaxFeaturesDefaultConfiguration;
216
- const isIccMinDefaultConfiguration = isIccMinNominalDefaultConfiguration && isIccMinFeaturesDefaultConfiguration;
217
- setStatus(
218
- isIccMaxDefaultConfiguration || isIccMinDefaultConfiguration ? "SUCCESS" : "ERROR"
219
- /* ERROR */
220
- );
221
- }, [
222
- watchInitialVoltageProfileMode,
223
- watchPredefinedParams,
224
- isIccMaxFeaturesDefaultConfiguration,
225
- isIccMinFeaturesDefaultConfiguration
226
- ]);
227
- return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, paddingLeft: 2, children: [
228
- /* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 2, xl: 6, children: /* @__PURE__ */ jsx(GridItem, { size: 10, children: feederResult }) }),
229
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPredefinedParameters", heading: 4 }),
230
- /* @__PURE__ */ jsxs(Grid, { xl: 6, container: true, spacing: 1, alignItems: "center", children: [
231
- /* @__PURE__ */ jsx(GridItem, { size: 9, children: predefinedParameters }),
232
- /* @__PURE__ */ jsx(GridItem, { size: 2, children: statusToShow })
233
- ] }),
234
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitCharacteristics", heading: 4 }),
235
- /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 5, children: [
236
- /* @__PURE__ */ jsxs(Grid, { item: true, children: [
237
- /* @__PURE__ */ jsx(GridItem, { children: loads }),
238
- /* @__PURE__ */ jsx(GridItem, { children: shuntCompensators })
239
- ] }),
240
- /* @__PURE__ */ jsxs(Grid, { item: true, xs: 8, children: [
241
- /* @__PURE__ */ jsx(GridItem, { children: vsc }),
242
- /* @__PURE__ */ jsx(GridItem, { children: neutralPosition })
243
- ] })
244
- ] }),
245
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitVoltageProfileMode", heading: 4 }),
246
- /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: initialVoltageProfileModeField }) }),
247
- /* @__PURE__ */ jsx(VoltageTable, { voltageProfileMode: watchInitialVoltageProfileMode }),
248
- isThereSpecificParameters && /* @__PURE__ */ jsxs(Fragment, { children: [
249
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitStartedGeneratorsMode", heading: 4 }),
250
- /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: onlyStartedGeneratorsInCalculationCluster }) }),
251
- isDeveloperMode && /* @__PURE__ */ jsxs(Fragment, { children: [
252
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPowerElectronicsSection", heading: 4 }),
253
- /* @__PURE__ */ jsx(Grid, { container: true, xl: 6, children: /* @__PURE__ */ jsx(GridItem, { size: 10, children: modelPowerElectronics }) }),
254
- /* @__PURE__ */ jsx(
255
- ShortCircuitIccMaterialTable,
256
- {
257
- formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS}`,
258
- columnsDefinition: iccMaterialsColumnsDef
259
- }
260
- ),
261
- /* @__PURE__ */ jsx(
262
- ShortCircuitIccClusterTable,
263
- {
264
- formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS}`,
265
- columnsDefinition: iccClustersColumnsDef,
266
- createRows
267
- }
268
- )
269
- ] })
270
- ] })
271
- ] });
272
- }
273
- export {
274
- ShortCircuitFields,
275
- Status
276
- };