@gridsuite/commons-ui 0.106.1 → 0.107.1
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/directoryItemSelector/DirectoryItemSelector.js +1 -0
- package/dist/components/filter/expert/expertFilterConstants.d.ts +15 -0
- package/dist/components/filter/expert/expertFilterConstants.js +28 -0
- package/dist/components/filter/expert/expertFilterUtils.js +1 -1
- package/dist/components/grid/grid-item.d.ts +8 -0
- package/dist/components/grid/grid-item.js +8 -0
- package/dist/components/grid/grid-section.d.ts +8 -0
- package/dist/components/grid/grid-section.js +9 -0
- package/dist/components/grid/index.d.ts +8 -0
- package/dist/components/grid/index.js +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +19 -0
- package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +4 -2
- package/dist/components/parameters/common/index.d.ts +1 -0
- package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +14 -0
- package/dist/components/parameters/common/parameters-edition-dialog-props.js +1 -0
- package/dist/components/parameters/index.d.ts +1 -0
- package/dist/components/parameters/index.js +16 -0
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +1 -14
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +0 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +0 -35
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +1 -2
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +4 -4
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.d.ts +2 -14
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +7 -1
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +7 -1
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.d.ts +16 -2
- package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +15 -6
- package/dist/components/parameters/short-circuit/constants.d.ts +37 -0
- package/dist/components/parameters/short-circuit/constants.js +58 -0
- package/dist/components/parameters/short-circuit/index.d.ts +10 -0
- package/dist/components/parameters/short-circuit/index.js +18 -0
- package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +9 -0
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +169 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +2 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +91 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.d.ts +9 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +69 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +8 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +147 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters.type.d.ts +38 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters.type.js +1 -0
- package/dist/components/parameters/short-circuit/short-circuit-voltage-table.d.ts +5 -0
- package/dist/components/parameters/short-circuit/short-circuit-voltage-table.js +38 -0
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +29 -0
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +222 -0
- package/dist/components/treeViewFinder/TreeViewFinder.d.ts +2 -0
- package/dist/index.js +23 -1
- package/dist/services/index.js +4 -1
- package/dist/services/short-circuit-analysis.d.ts +2 -0
- package/dist/services/short-circuit-analysis.js +13 -0
- package/dist/services/study.d.ts +4 -0
- package/dist/services/study.js +25 -1
- package/dist/translations/en/filterExpertEn.d.ts +3 -0
- package/dist/translations/en/filterExpertEn.js +4 -1
- package/dist/translations/en/parameters.d.ts +28 -0
- package/dist/translations/en/parameters.js +29 -1
- package/dist/translations/fr/filterExpertFr.d.ts +3 -0
- package/dist/translations/fr/filterExpertFr.js +4 -1
- package/dist/translations/fr/parameters.d.ts +28 -0
- package/dist/translations/fr/parameters.js +29 -1
- package/dist/utils/types/fieldType.d.ts +3 -0
- package/dist/utils/types/fieldType.js +3 -0
- package/package.json +1 -1
|
@@ -34,9 +34,15 @@ import "react-querybuilder";
|
|
|
34
34
|
import { NetworkVisualizationTabValues, PARAM_INIT_NAD_WITH_GEO_DATA, PARAM_COMPONENT_LIBRARY, PARAM_SUBSTATION_LAYOUT, PARAM_CENTER_LABEL, PARAM_DIAGONAL_LABEL, PARAM_MAP_BASEMAP, PARAM_MAP_MANUAL_REFRESH, PARAM_LINE_FLOW_MODE, PARAM_LINE_PARALLEL_PATH, PARAM_LINE_FULL_PATH } from "./constants.js";
|
|
35
35
|
import "../../filter/HeaderFilterForm.js";
|
|
36
36
|
import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
37
|
-
const useNetworkVisualizationParametersForm = (
|
|
37
|
+
const useNetworkVisualizationParametersForm = ({
|
|
38
|
+
parametersUuid,
|
|
39
|
+
name,
|
|
40
|
+
description,
|
|
41
|
+
studyUuid,
|
|
42
|
+
parameters
|
|
43
|
+
}) => {
|
|
38
44
|
const [selectedTab, setSelectedTab] = useState(NetworkVisualizationTabValues.MAP);
|
|
39
|
-
const [
|
|
45
|
+
const [paramsLoading, setParamsLoading] = useState(false);
|
|
40
46
|
const { snackError } = useSnackMessage();
|
|
41
47
|
const handleTabChange = useCallback((event, newValue) => {
|
|
42
48
|
setSelectedTab(newValue);
|
|
@@ -118,22 +124,25 @@ const useNetworkVisualizationParametersForm = (parametersUuid, studyUuid, parame
|
|
|
118
124
|
);
|
|
119
125
|
useEffect(() => {
|
|
120
126
|
if (parametersUuid) {
|
|
121
|
-
|
|
127
|
+
const timer = setTimeout(() => {
|
|
128
|
+
setParamsLoading(true);
|
|
129
|
+
}, 700);
|
|
122
130
|
getNetworkVisualizationsParameters(parametersUuid).then((params) => {
|
|
123
131
|
reset(params);
|
|
124
|
-
setParamsLoaded(true);
|
|
125
132
|
}).catch((error) => {
|
|
126
133
|
snackError({
|
|
127
134
|
messageTxt: error.message,
|
|
128
135
|
headerId: "getNetworkVisualizationsParametersError"
|
|
129
136
|
});
|
|
137
|
+
}).finally(() => {
|
|
138
|
+
clearTimeout(timer);
|
|
139
|
+
setParamsLoading(false);
|
|
130
140
|
});
|
|
131
141
|
}
|
|
132
142
|
}, [parametersUuid, reset, snackError]);
|
|
133
143
|
useEffect(() => {
|
|
134
144
|
if (parameters) {
|
|
135
145
|
reset(parameters);
|
|
136
|
-
setParamsLoaded(true);
|
|
137
146
|
}
|
|
138
147
|
}, [parameters, reset]);
|
|
139
148
|
return {
|
|
@@ -141,7 +150,7 @@ const useNetworkVisualizationParametersForm = (parametersUuid, studyUuid, parame
|
|
|
141
150
|
formSchema,
|
|
142
151
|
selectedTab,
|
|
143
152
|
handleTabChange,
|
|
144
|
-
|
|
153
|
+
paramsLoading,
|
|
145
154
|
onSaveInline,
|
|
146
155
|
onSaveDialog
|
|
147
156
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024, 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 enum InitialVoltage {
|
|
8
|
+
NOMINAL = "NOMINAL",
|
|
9
|
+
CEI909 = "CEI909",
|
|
10
|
+
CONFIGURED = "CONFIGURED"
|
|
11
|
+
}
|
|
12
|
+
export declare enum PredefinedParameters {
|
|
13
|
+
ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP = "ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP",
|
|
14
|
+
ICC_MAX_WITH_CEI909 = "ICC_MAX_WITH_CEI909",
|
|
15
|
+
ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP = "ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP"
|
|
16
|
+
}
|
|
17
|
+
export declare const SHORT_CIRCUIT_WITH_FEEDER_RESULT = "withFeederResult";
|
|
18
|
+
export declare const SHORT_CIRCUIT_PREDEFINED_PARAMS = "predefinedParameters";
|
|
19
|
+
export declare const SHORT_CIRCUIT_WITH_LOADS = "withLoads";
|
|
20
|
+
export declare const SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS = "withVSCConverterStations";
|
|
21
|
+
export declare const SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS = "withShuntCompensators";
|
|
22
|
+
export declare const SHORT_CIRCUIT_WITH_NEUTRAL_POSITION = "withNeutralPosition";
|
|
23
|
+
export declare const SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE = "initialVoltageProfileMode";
|
|
24
|
+
export declare const intlPredefinedParametersOptions: () => {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
}[];
|
|
28
|
+
export declare const intlInitialVoltageProfileMode: () => {
|
|
29
|
+
NOMINAL: {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
};
|
|
33
|
+
CEI909: {
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var InitialVoltage = /* @__PURE__ */ ((InitialVoltage2) => {
|
|
2
|
+
InitialVoltage2["NOMINAL"] = "NOMINAL";
|
|
3
|
+
InitialVoltage2["CEI909"] = "CEI909";
|
|
4
|
+
InitialVoltage2["CONFIGURED"] = "CONFIGURED";
|
|
5
|
+
return InitialVoltage2;
|
|
6
|
+
})(InitialVoltage || {});
|
|
7
|
+
var PredefinedParameters = /* @__PURE__ */ ((PredefinedParameters2) => {
|
|
8
|
+
PredefinedParameters2["ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP"] = "ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP";
|
|
9
|
+
PredefinedParameters2["ICC_MAX_WITH_CEI909"] = "ICC_MAX_WITH_CEI909";
|
|
10
|
+
PredefinedParameters2["ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP"] = "ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP";
|
|
11
|
+
return PredefinedParameters2;
|
|
12
|
+
})(PredefinedParameters || {});
|
|
13
|
+
const SHORT_CIRCUIT_WITH_FEEDER_RESULT = "withFeederResult";
|
|
14
|
+
const SHORT_CIRCUIT_PREDEFINED_PARAMS = "predefinedParameters";
|
|
15
|
+
const SHORT_CIRCUIT_WITH_LOADS = "withLoads";
|
|
16
|
+
const SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS = "withVSCConverterStations";
|
|
17
|
+
const SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS = "withShuntCompensators";
|
|
18
|
+
const SHORT_CIRCUIT_WITH_NEUTRAL_POSITION = "withNeutralPosition";
|
|
19
|
+
const SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE = "initialVoltageProfileMode";
|
|
20
|
+
const intlPredefinedParametersOptions = () => [
|
|
21
|
+
{
|
|
22
|
+
id: "ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP",
|
|
23
|
+
label: "iccMawWithNominalVoltageMapPredefinedParams"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "ICC_MAX_WITH_CEI909",
|
|
27
|
+
label: "iccMaxWithCEIPredefinedParams"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP",
|
|
31
|
+
label: "iscMinWithNominalVoltageMapPredefinedParams"
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
const intlInitialVoltageProfileMode = () => {
|
|
35
|
+
return {
|
|
36
|
+
NOMINAL: {
|
|
37
|
+
id: "NOMINAL",
|
|
38
|
+
label: "nominalInitialVoltageProfileMode"
|
|
39
|
+
},
|
|
40
|
+
CEI909: {
|
|
41
|
+
id: "CEI909",
|
|
42
|
+
label: "cei909InitialVoltageProfileMode"
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
InitialVoltage,
|
|
48
|
+
PredefinedParameters,
|
|
49
|
+
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
50
|
+
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
51
|
+
SHORT_CIRCUIT_WITH_FEEDER_RESULT,
|
|
52
|
+
SHORT_CIRCUIT_WITH_LOADS,
|
|
53
|
+
SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
|
|
54
|
+
SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
|
|
55
|
+
SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
|
|
56
|
+
intlInitialVoltageProfileMode,
|
|
57
|
+
intlPredefinedParametersOptions
|
|
58
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 https://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './constants';
|
|
8
|
+
export * from './short-circuit-parameters.type';
|
|
9
|
+
export * from './short-circuit-parameters-inline';
|
|
10
|
+
export * from './short-circuit-parameters-dialog';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions } from "./constants.js";
|
|
2
|
+
import { ShortCircuitParametersInLine } from "./short-circuit-parameters-inline.js";
|
|
3
|
+
import { ShortCircuitParametersEditionDialog } from "./short-circuit-parameters-dialog.js";
|
|
4
|
+
export {
|
|
5
|
+
InitialVoltage,
|
|
6
|
+
PredefinedParameters,
|
|
7
|
+
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
8
|
+
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
9
|
+
SHORT_CIRCUIT_WITH_FEEDER_RESULT,
|
|
10
|
+
SHORT_CIRCUIT_WITH_LOADS,
|
|
11
|
+
SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
|
|
12
|
+
SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
|
|
13
|
+
SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
|
|
14
|
+
ShortCircuitParametersEditionDialog,
|
|
15
|
+
ShortCircuitParametersInLine,
|
|
16
|
+
intlInitialVoltageProfileMode,
|
|
17
|
+
intlPredefinedParametersOptions
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PredefinedParameters } from './constants';
|
|
2
|
+
export interface ShortCircuitFieldsProps {
|
|
3
|
+
resetAll: (predefinedParams: PredefinedParameters) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare enum Status {
|
|
6
|
+
SUCCESS = "SUCCESS",
|
|
7
|
+
ERROR = "ERROR"
|
|
8
|
+
}
|
|
9
|
+
export declare function ShortCircuitFields({ resetAll }: Readonly<ShortCircuitFieldsProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, useEffect } from "react";
|
|
3
|
+
import { Grid } from "@mui/material";
|
|
4
|
+
import { red, green } from "@mui/material/colors";
|
|
5
|
+
import { Lens } from "@mui/icons-material";
|
|
6
|
+
import { useWatch } from "react-hook-form";
|
|
7
|
+
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, intlPredefinedParametersOptions, intlInitialVoltageProfileMode, PredefinedParameters, InitialVoltage, SHORT_CIRCUIT_WITH_FEEDER_RESULT } from "./constants.js";
|
|
8
|
+
import { VoltageTable } from "./short-circuit-voltage-table.js";
|
|
9
|
+
import GridItem from "../../grid/grid-item.js";
|
|
10
|
+
import GridSection from "../../grid/grid-section.js";
|
|
11
|
+
import "react-intl";
|
|
12
|
+
import { FieldLabel } from "../../inputs/reactHookForm/utils/FieldLabel.js";
|
|
13
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
14
|
+
import "yup";
|
|
15
|
+
import "notistack";
|
|
16
|
+
import "../../overflowableText/OverflowableText.js";
|
|
17
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
18
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
19
|
+
import "../../customAGGrid/customAggrid.js";
|
|
20
|
+
import "ag-grid-community";
|
|
21
|
+
import "react-papaparse";
|
|
22
|
+
import "react-csv-downloader";
|
|
23
|
+
import { CheckboxInput } from "../../inputs/reactHookForm/booleans/CheckboxInput.js";
|
|
24
|
+
import { RadioInput } from "../../inputs/reactHookForm/booleans/RadioInput.js";
|
|
25
|
+
import { SwitchInput } from "../../inputs/reactHookForm/booleans/SwitchInput.js";
|
|
26
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
27
|
+
import "localized-countries";
|
|
28
|
+
import "localized-countries/data/fr";
|
|
29
|
+
import "localized-countries/data/en";
|
|
30
|
+
import { MuiSelectInput } from "../../inputs/reactHookForm/selectInputs/MuiSelectInput.js";
|
|
31
|
+
import "../../../utils/conversionUtils.js";
|
|
32
|
+
import "../../../utils/types/equipmentType.js";
|
|
33
|
+
import "../../../utils/yupConfig.js";
|
|
34
|
+
import "@react-querybuilder/material";
|
|
35
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
36
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
37
|
+
import "uuid";
|
|
38
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
39
|
+
import "react-querybuilder";
|
|
40
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
41
|
+
Status2["SUCCESS"] = "SUCCESS";
|
|
42
|
+
Status2["ERROR"] = "ERROR";
|
|
43
|
+
return Status2;
|
|
44
|
+
})(Status || {});
|
|
45
|
+
function ShortCircuitFields({ resetAll }) {
|
|
46
|
+
const [status, setStatus] = useState(
|
|
47
|
+
"SUCCESS"
|
|
48
|
+
/* SUCCESS */
|
|
49
|
+
);
|
|
50
|
+
const watchInitialVoltageProfileMode = useWatch({
|
|
51
|
+
name: SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE
|
|
52
|
+
});
|
|
53
|
+
const watchPredefinedParams = useWatch({
|
|
54
|
+
name: SHORT_CIRCUIT_PREDEFINED_PARAMS
|
|
55
|
+
});
|
|
56
|
+
const watchLoads = useWatch({
|
|
57
|
+
name: SHORT_CIRCUIT_WITH_LOADS
|
|
58
|
+
});
|
|
59
|
+
const watchShuntCompensators = useWatch({
|
|
60
|
+
name: SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS
|
|
61
|
+
});
|
|
62
|
+
const watchVSC = useWatch({
|
|
63
|
+
name: SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS
|
|
64
|
+
});
|
|
65
|
+
const watchNeutralPosition = useWatch({
|
|
66
|
+
name: SHORT_CIRCUIT_WITH_NEUTRAL_POSITION
|
|
67
|
+
});
|
|
68
|
+
const isIccMinFeaturesDefaultConfiguration = useMemo(() => {
|
|
69
|
+
return !watchLoads && !watchShuntCompensators && !watchVSC && !watchNeutralPosition;
|
|
70
|
+
}, [watchLoads, watchShuntCompensators, watchVSC, watchNeutralPosition]);
|
|
71
|
+
const isIccMaxFeaturesDefaultConfiguration = useMemo(() => {
|
|
72
|
+
return !watchLoads && !watchShuntCompensators && watchVSC && !watchNeutralPosition;
|
|
73
|
+
}, [watchLoads, watchShuntCompensators, watchVSC, watchNeutralPosition]);
|
|
74
|
+
const predefinedParamsOptions = useMemo(() => {
|
|
75
|
+
return intlPredefinedParametersOptions();
|
|
76
|
+
}, []);
|
|
77
|
+
const initialVoltageProfileMode = useMemo(() => {
|
|
78
|
+
return intlInitialVoltageProfileMode();
|
|
79
|
+
}, []);
|
|
80
|
+
const getStatus = (state, styles) => {
|
|
81
|
+
const color = state === "SUCCESS" ? styles.succeed : styles.fail;
|
|
82
|
+
return /* @__PURE__ */ jsx(Lens, { fontSize: "medium", sx: color });
|
|
83
|
+
};
|
|
84
|
+
const statusToShow = useMemo(() => {
|
|
85
|
+
const styles = {
|
|
86
|
+
succeed: {
|
|
87
|
+
color: green[500]
|
|
88
|
+
},
|
|
89
|
+
fail: {
|
|
90
|
+
color: red[500]
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return getStatus(status, styles);
|
|
94
|
+
}, [status]);
|
|
95
|
+
const onPredefinedParametersManualChange = (event) => {
|
|
96
|
+
const newPredefinedParameters = event.target.value;
|
|
97
|
+
console.debug("onPredefinedParametersManualChange new:", newPredefinedParameters);
|
|
98
|
+
resetAll(newPredefinedParameters);
|
|
99
|
+
};
|
|
100
|
+
const feederResult = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
|
|
101
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "descWithFeederResult" }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: SHORT_CIRCUIT_WITH_FEEDER_RESULT }) })
|
|
103
|
+
] });
|
|
104
|
+
const predefinedParameters = /* @__PURE__ */ jsx(
|
|
105
|
+
MuiSelectInput,
|
|
106
|
+
{
|
|
107
|
+
name: SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
108
|
+
options: predefinedParamsOptions,
|
|
109
|
+
onChange: onPredefinedParametersManualChange,
|
|
110
|
+
fullWidth: true
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
const initialVoltageProfileModeField = /* @__PURE__ */ jsx(
|
|
114
|
+
RadioInput,
|
|
115
|
+
{
|
|
116
|
+
name: SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
117
|
+
options: Object.values(initialVoltageProfileMode)
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
const loads = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_LOADS, label: "shortCircuitLoads" });
|
|
121
|
+
const vsc = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, label: "shortCircuitHvdc" });
|
|
122
|
+
const shuntCompensators = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, label: "shortCircuitShuntCompensators" });
|
|
123
|
+
const neutralPosition = /* @__PURE__ */ jsx(CheckboxInput, { name: SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, label: "shortCircuitNeutralPosition" });
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
const isIccMaxWithNominalVoltageMap = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP;
|
|
126
|
+
const isIccMinWithNominal = watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP;
|
|
127
|
+
const isInitialVoltageNominal = watchInitialVoltageProfileMode === InitialVoltage.NOMINAL;
|
|
128
|
+
const isIccMaxNominalDefaultConfiguration = isIccMaxWithNominalVoltageMap && isInitialVoltageNominal;
|
|
129
|
+
const isIccMinNominalDefaultConfiguration = isIccMinWithNominal && isInitialVoltageNominal;
|
|
130
|
+
const isCEI909DefaultConfiguration = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_CEI909 && watchInitialVoltageProfileMode === InitialVoltage.CEI909;
|
|
131
|
+
const isIccMaxDefaultConfiguration = (isIccMaxNominalDefaultConfiguration || isCEI909DefaultConfiguration) && isIccMaxFeaturesDefaultConfiguration;
|
|
132
|
+
const isIccMinDefaultConfiguration = isIccMinNominalDefaultConfiguration && isIccMinFeaturesDefaultConfiguration;
|
|
133
|
+
setStatus(
|
|
134
|
+
isIccMaxDefaultConfiguration || isIccMinDefaultConfiguration ? "SUCCESS" : "ERROR"
|
|
135
|
+
/* ERROR */
|
|
136
|
+
);
|
|
137
|
+
}, [
|
|
138
|
+
watchInitialVoltageProfileMode,
|
|
139
|
+
watchPredefinedParams,
|
|
140
|
+
isIccMaxFeaturesDefaultConfiguration,
|
|
141
|
+
isIccMinFeaturesDefaultConfiguration
|
|
142
|
+
]);
|
|
143
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, paddingLeft: 2, children: [
|
|
144
|
+
/* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 2, xl: 6, children: /* @__PURE__ */ jsx(GridItem, { size: 10, children: feederResult }) }),
|
|
145
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPredefinedParameters", heading: 4 }),
|
|
146
|
+
/* @__PURE__ */ jsxs(Grid, { xl: 6, container: true, spacing: 1, alignItems: "center", children: [
|
|
147
|
+
/* @__PURE__ */ jsx(GridItem, { size: 9, children: predefinedParameters }),
|
|
148
|
+
/* @__PURE__ */ jsx(GridItem, { size: 2, children: statusToShow })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitCharacteristics", heading: 4 }),
|
|
151
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 5, children: [
|
|
152
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, children: [
|
|
153
|
+
/* @__PURE__ */ jsx(GridItem, { children: loads }),
|
|
154
|
+
/* @__PURE__ */ jsx(GridItem, { children: shuntCompensators })
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 8, children: [
|
|
157
|
+
/* @__PURE__ */ jsx(GridItem, { children: vsc }),
|
|
158
|
+
/* @__PURE__ */ jsx(GridItem, { children: neutralPosition })
|
|
159
|
+
] })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitVoltageProfileMode", heading: 4 }),
|
|
162
|
+
/* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: initialVoltageProfileModeField }) }),
|
|
163
|
+
/* @__PURE__ */ jsx(VoltageTable, { voltageProfileMode: watchInitialVoltageProfileMode })
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
166
|
+
export {
|
|
167
|
+
ShortCircuitFields,
|
|
168
|
+
Status
|
|
169
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ParametersEditionDialogProps } from '../common';
|
|
2
|
+
export declare function ShortCircuitParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, language, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CustomMuiDialog } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
3
|
+
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
4
|
+
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "@mui/material";
|
|
7
|
+
import "react-intl";
|
|
8
|
+
import "react-hook-form";
|
|
9
|
+
import "@mui/icons-material";
|
|
10
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
11
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
12
|
+
import "notistack";
|
|
13
|
+
import "../../../utils/conversionUtils.js";
|
|
14
|
+
import "../../../utils/types/equipmentType.js";
|
|
15
|
+
import "../../../utils/yupConfig.js";
|
|
16
|
+
import { NameElementEditorForm } from "../common/name-element-editor/name-element-editor-form.js";
|
|
17
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
18
|
+
import "yup";
|
|
19
|
+
import "../../overflowableText/OverflowableText.js";
|
|
20
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
21
|
+
import "../../customAGGrid/customAggrid.js";
|
|
22
|
+
import "ag-grid-community";
|
|
23
|
+
import "react-papaparse";
|
|
24
|
+
import "react-csv-downloader";
|
|
25
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
26
|
+
import "localized-countries";
|
|
27
|
+
import "localized-countries/data/fr";
|
|
28
|
+
import "localized-countries/data/en";
|
|
29
|
+
import "@react-querybuilder/material";
|
|
30
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
31
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
32
|
+
import "uuid";
|
|
33
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
34
|
+
import "react-querybuilder";
|
|
35
|
+
import { useShortCircuitParametersForm } from "./use-short-circuit-parameters-form.js";
|
|
36
|
+
import { ShortCircuitParametersForm } from "./short-circuit-parameters-form.js";
|
|
37
|
+
function ShortCircuitParametersEditionDialog({
|
|
38
|
+
id,
|
|
39
|
+
open,
|
|
40
|
+
onClose,
|
|
41
|
+
titleId,
|
|
42
|
+
name,
|
|
43
|
+
description,
|
|
44
|
+
activeDirectory,
|
|
45
|
+
language
|
|
46
|
+
}) {
|
|
47
|
+
const shortCircuitMethods = useShortCircuitParametersForm({
|
|
48
|
+
parametersUuid: id,
|
|
49
|
+
name,
|
|
50
|
+
description,
|
|
51
|
+
studyUuid: null,
|
|
52
|
+
studyShortCircuitParameters: null
|
|
53
|
+
});
|
|
54
|
+
const {
|
|
55
|
+
formState: { errors, dirtyFields }
|
|
56
|
+
} = shortCircuitMethods.formMethods;
|
|
57
|
+
const disableSave = Object.keys(errors).length > 0 || Object.keys(dirtyFields).length === 0;
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
CustomMuiDialog,
|
|
60
|
+
{
|
|
61
|
+
open,
|
|
62
|
+
onClose,
|
|
63
|
+
onSave: shortCircuitMethods.onSaveDialog,
|
|
64
|
+
formSchema: shortCircuitMethods.formSchema,
|
|
65
|
+
formMethods: shortCircuitMethods.formMethods,
|
|
66
|
+
titleId,
|
|
67
|
+
removeOptional: true,
|
|
68
|
+
language,
|
|
69
|
+
disabledSave: disableSave,
|
|
70
|
+
children: /* @__PURE__ */ jsx(
|
|
71
|
+
ShortCircuitParametersForm,
|
|
72
|
+
{
|
|
73
|
+
shortCircuitMethods,
|
|
74
|
+
renderTitleFields: () => {
|
|
75
|
+
return /* @__PURE__ */ jsx(
|
|
76
|
+
NameElementEditorForm,
|
|
77
|
+
{
|
|
78
|
+
initialElementName: name,
|
|
79
|
+
activeDirectory,
|
|
80
|
+
elementType: ElementType.SHORT_CIRCUIT_PARAMETERS
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
ShortCircuitParametersEditionDialog
|
|
91
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseShortCircuitParametersFormReturn } from './use-short-circuit-parameters-form';
|
|
3
|
+
interface ShortCircuitParametersFormProps {
|
|
4
|
+
shortCircuitMethods: UseShortCircuitParametersFormReturn;
|
|
5
|
+
renderTitleFields?: () => ReactNode;
|
|
6
|
+
renderActions?: () => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function ShortCircuitParametersForm({ shortCircuitMethods, renderTitleFields, renderActions, }: Readonly<ShortCircuitParametersFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Grid, LinearProgress } from "@mui/material";
|
|
3
|
+
import "react-intl";
|
|
4
|
+
import "@mui/icons-material";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-hook-form";
|
|
7
|
+
import { CustomFormProvider } from "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
8
|
+
import "yup";
|
|
9
|
+
import "notistack";
|
|
10
|
+
import "../../overflowableText/OverflowableText.js";
|
|
11
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
12
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
13
|
+
import "../../customAGGrid/customAggrid.js";
|
|
14
|
+
import "ag-grid-community";
|
|
15
|
+
import "react-papaparse";
|
|
16
|
+
import "react-csv-downloader";
|
|
17
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
18
|
+
import "localized-countries";
|
|
19
|
+
import "localized-countries/data/fr";
|
|
20
|
+
import "localized-countries/data/en";
|
|
21
|
+
import "../../../utils/conversionUtils.js";
|
|
22
|
+
import "../../../utils/types/equipmentType.js";
|
|
23
|
+
import "../../../utils/yupConfig.js";
|
|
24
|
+
import "@react-querybuilder/material";
|
|
25
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
26
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
27
|
+
import "uuid";
|
|
28
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
29
|
+
import "react-querybuilder";
|
|
30
|
+
import { parametersStyles } from "../parameters-style.js";
|
|
31
|
+
import { ShortCircuitFields } from "./short-circuit-fields.js";
|
|
32
|
+
function ShortCircuitParametersForm({
|
|
33
|
+
shortCircuitMethods,
|
|
34
|
+
renderTitleFields,
|
|
35
|
+
renderActions
|
|
36
|
+
}) {
|
|
37
|
+
const { formMethods, formSchema, paramsLoading, resetAll } = shortCircuitMethods;
|
|
38
|
+
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(
|
|
39
|
+
Box,
|
|
40
|
+
{
|
|
41
|
+
sx: {
|
|
42
|
+
height: "100%",
|
|
43
|
+
display: "flex",
|
|
44
|
+
position: "relative",
|
|
45
|
+
flexDirection: "column"
|
|
46
|
+
},
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields == null ? void 0 : renderTitleFields() }),
|
|
49
|
+
paramsLoading ? /* @__PURE__ */ jsx(LinearProgress, {}) : /* @__PURE__ */ jsx(Grid, { sx: parametersStyles.scrollableGrid, children: /* @__PURE__ */ jsx(ShortCircuitFields, { resetAll }) }),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
Grid,
|
|
52
|
+
{
|
|
53
|
+
item: true,
|
|
54
|
+
container: true,
|
|
55
|
+
direction: "column",
|
|
56
|
+
sx: {
|
|
57
|
+
position: "absolute",
|
|
58
|
+
bottom: "15px"
|
|
59
|
+
},
|
|
60
|
+
children: renderActions == null ? void 0 : renderActions()
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
) });
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
ShortCircuitParametersForm
|
|
69
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { UUID } from 'crypto';
|
|
3
|
+
import { ShortCircuitParametersInfos } from './short-circuit-parameters.type';
|
|
4
|
+
export declare function ShortCircuitParametersInLine({ studyUuid, setHaveDirtyFields, shortCircuitParameters, }: Readonly<{
|
|
5
|
+
studyUuid: UUID | null;
|
|
6
|
+
setHaveDirtyFields: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
shortCircuitParameters: ShortCircuitParametersInfos | null;
|
|
8
|
+
}>): import("react/jsx-runtime").JSX.Element;
|