@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.
- package/dist/components/index.js +6 -1
- package/dist/components/inputs/reactHookForm/selectInputs/CountriesInput.js +13 -10
- package/dist/components/parameters/common/contingency-table/contingency-table.d.ts +4 -2
- package/dist/components/parameters/common/contingency-table/contingency-table.js +22 -11
- package/dist/components/parameters/common/contingency-table/types.d.ts +4 -0
- package/dist/components/parameters/common/parameters.js +1 -1
- package/dist/components/parameters/dynamic-margin-calculation/dynamic-margin-calculation-inline.js +5 -5
- package/dist/components/parameters/index.js +6 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +8 -15
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +2 -4
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +2 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +33 -43
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +7 -9
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +4 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +5 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +4 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +5 -4
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.d.ts +1 -3
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +10 -11
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +6 -7
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
- package/dist/components/parameters/short-circuit/constants.d.ts +5 -0
- package/dist/components/parameters/short-circuit/constants.js +10 -0
- package/dist/components/parameters/short-circuit/index.js +6 -1
- package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.d.ts +10 -0
- package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.js +206 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-content.d.ts +7 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-content.js +108 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +7 -14
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +33 -30
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +5 -0
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +72 -25
- package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.d.ts +2 -0
- package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +95 -0
- package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.d.ts +2 -0
- package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.js +143 -0
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +5 -1
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +34 -14
- package/dist/hooks/use-parameters-backend.d.ts +2 -3
- package/dist/hooks/use-parameters-backend.js +33 -110
- package/dist/index.js +8 -6
- package/dist/services/directory.js +1 -1
- package/dist/services/explore.js +1 -1
- package/dist/services/index.js +2 -5
- package/dist/services/loadflow.d.ts +0 -1
- package/dist/services/loadflow.js +1 -8
- package/dist/services/security-analysis.d.ts +0 -2
- package/dist/services/security-analysis.js +2 -23
- package/dist/services/sensitivity-analysis.d.ts +0 -1
- package/dist/services/sensitivity-analysis.js +1 -8
- package/dist/translations/en/parameters.d.ts +10 -8
- package/dist/translations/en/parameters.js +10 -8
- package/dist/translations/fr/parameters.d.ts +10 -9
- package/dist/translations/fr/parameters.js +10 -9
- package/dist/utils/constants/adornments.js +1 -1
- package/dist/utils/types/parameters.type.d.ts +16 -13
- package/package.json +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +0 -10
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +0 -276
package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useForm } from "react-hook-form";
|
|
2
|
-
import {
|
|
2
|
+
import { useRef, useMemo, useCallback, useEffect } from "react";
|
|
3
3
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
4
4
|
import "../../../utils/conversionUtils.js";
|
|
5
5
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
@@ -45,8 +45,8 @@ import { getNameElementEditorEmptyFormData } from "../common/name-element-editor
|
|
|
45
45
|
import { getSAParametersFormSchema, toFormValueSaParameters } from "./columns-definitions.js";
|
|
46
46
|
import { ACTIVATED, DESCRIPTION, NAME, ID } from "../common/parameter-table/constants.js";
|
|
47
47
|
const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, name, description) => {
|
|
48
|
-
const
|
|
49
|
-
const
|
|
48
|
+
const { providers, params, updateParameters, defaultLimitReductions } = parametersBackend;
|
|
49
|
+
const previousWatchProviderRef = useRef(void 0);
|
|
50
50
|
const { snackError } = useSnackMessage();
|
|
51
51
|
const formattedProviders = useMemo(() => {
|
|
52
52
|
return Object.entries(providers).filter(([key]) => !key.includes("DynaFlow")).map(([key, value]) => ({
|
|
@@ -54,14 +54,13 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
54
54
|
label: value
|
|
55
55
|
}));
|
|
56
56
|
}, [providers]);
|
|
57
|
-
const paramsLoaded = useMemo(() => !!params && !!currentProvider, [currentProvider, params]);
|
|
58
57
|
const formSchema = useMemo(() => {
|
|
59
58
|
return getSAParametersFormSchema(name, params?.limitReductions);
|
|
60
59
|
}, [name, params?.limitReductions]);
|
|
61
60
|
const formMethods = useForm({
|
|
62
61
|
defaultValues: {
|
|
63
62
|
...getNameElementEditorEmptyFormData(name, description),
|
|
64
|
-
[PARAM_SA_PROVIDER]: provider,
|
|
63
|
+
[PARAM_SA_PROVIDER]: params?.provider,
|
|
65
64
|
[CONTINGENCY_LISTS_INFOS]: [],
|
|
66
65
|
[LIMIT_REDUCTIONS_FORM]: [],
|
|
67
66
|
[PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD]: null,
|
|
@@ -74,6 +73,7 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
74
73
|
});
|
|
75
74
|
const { reset, watch } = formMethods;
|
|
76
75
|
const watchProvider = watch(PARAM_SA_PROVIDER);
|
|
76
|
+
const paramsLoaded = useMemo(() => !!params && !!watchProvider, [watchProvider, params]);
|
|
77
77
|
const toContingencyListsInfos = useCallback(
|
|
78
78
|
(formContingencyListsInfos) => {
|
|
79
79
|
if (!formContingencyListsInfos) {
|
|
@@ -149,9 +149,8 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
149
149
|
[parametersUuid, formatNewParams, snackError]
|
|
150
150
|
);
|
|
151
151
|
useEffect(() => {
|
|
152
|
-
if (watchProvider !==
|
|
153
|
-
|
|
154
|
-
if (watchProvider !== void 0 && currentProvider !== void 0) {
|
|
152
|
+
if (watchProvider !== void 0 && watchProvider !== previousWatchProviderRef.current) {
|
|
153
|
+
if (previousWatchProviderRef.current !== void 0) {
|
|
155
154
|
if (params !== null) {
|
|
156
155
|
params.limitReductions = defaultLimitReductions;
|
|
157
156
|
}
|
|
@@ -160,8 +159,9 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
160
159
|
toFormValuesLimitReductions(defaultLimitReductions)[LIMIT_REDUCTIONS_FORM]
|
|
161
160
|
);
|
|
162
161
|
}
|
|
162
|
+
previousWatchProviderRef.current = watchProvider;
|
|
163
163
|
}
|
|
164
|
-
}, [watchProvider,
|
|
164
|
+
}, [watchProvider, formMethods, defaultLimitReductions, params]);
|
|
165
165
|
useEffect(() => {
|
|
166
166
|
if (!params) {
|
|
167
167
|
return;
|
|
@@ -176,8 +176,7 @@ const useSecurityAnalysisParametersForm = (parametersBackend, parametersUuid, na
|
|
|
176
176
|
toFormValueSaParameters,
|
|
177
177
|
formatNewParams,
|
|
178
178
|
params,
|
|
179
|
-
|
|
180
|
-
setCurrentProvider,
|
|
179
|
+
watchProvider,
|
|
181
180
|
paramsLoaded,
|
|
182
181
|
onSaveInline,
|
|
183
182
|
onSaveDialog
|
|
@@ -39,7 +39,7 @@ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
|
39
39
|
import "react-querybuilder";
|
|
40
40
|
import "../common/widget/parameter-line-slider.js";
|
|
41
41
|
import "../common/limitreductions/columns-definitions.js";
|
|
42
|
-
import {
|
|
42
|
+
import { fetchSensitivityAnalysisProviders, fetchSensitivityAnalysisParameters, updateSensitivityAnalysisParameters } from "../../../services/sensitivity-analysis.js";
|
|
43
43
|
import { NameElementEditorForm } from "../common/name-element-editor/name-element-editor-form.js";
|
|
44
44
|
import { useSensitivityAnalysisParametersForm } from "./use-sensitivity-analysis-parameters.js";
|
|
45
45
|
import { SensitivityAnalysisParametersForm } from "./sensitivity-analysis-parameters-form.js";
|
|
@@ -60,12 +60,11 @@ function SensitivityAnalysisParametersDialog({
|
|
|
60
60
|
id,
|
|
61
61
|
ComputingType.SENSITIVITY_ANALYSIS,
|
|
62
62
|
OptionalServicesStatus.Up,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
updateSensitivityAnalysisParameters
|
|
63
|
+
{
|
|
64
|
+
backendFetchProviders: fetchSensitivityAnalysisProviders,
|
|
65
|
+
backendFetchParameters: fetchSensitivityAnalysisParameters,
|
|
66
|
+
backendUpdateParameters: updateSensitivityAnalysisParameters
|
|
67
|
+
}
|
|
69
68
|
);
|
|
70
69
|
const sensitivityAnalysisMethods = useSensitivityAnalysisParametersForm({
|
|
71
70
|
studyUuid: null,
|
|
@@ -56,7 +56,7 @@ const useSensitivityAnalysisParametersForm = ({
|
|
|
56
56
|
name,
|
|
57
57
|
description
|
|
58
58
|
}) => {
|
|
59
|
-
const
|
|
59
|
+
const { providers, params, updateParameters } = parametersBackend;
|
|
60
60
|
const [sensitivityAnalysisParams, setSensitivityAnalysisParams] = useState(params);
|
|
61
61
|
const { snackError } = useSnackMessage();
|
|
62
62
|
const [factorsCount, setFactorsCount] = useState(DEFAULT_FACTOR_COUNT);
|
|
@@ -23,9 +23,14 @@ export declare const SHORT_CIRCUIT_WITH_NEUTRAL_POSITION = "withNeutralPosition"
|
|
|
23
23
|
export declare const SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE = "initialVoltageProfileMode";
|
|
24
24
|
export declare const SHORT_CIRCUIT_VOLTAGE_RANGES = "voltageRanges";
|
|
25
25
|
export declare const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER = "onlyStartedGeneratorsInCalculationCluster";
|
|
26
|
+
export declare const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER = "onlyStartedGeneratorsOutsideCalculationCluster";
|
|
27
|
+
export declare const NODE_CLUSTER = "nodeCluster";
|
|
28
|
+
export declare const NODE_CLUSTER_FILTER_IDS = "nodeClusterFilterIds";
|
|
26
29
|
export declare const SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS = "modelPowerElectronics";
|
|
27
30
|
export declare const SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS = "powerElectronicsMaterials";
|
|
28
31
|
export declare const SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS = "powerElectronicsClusters";
|
|
32
|
+
export declare const STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD = "startedGeneratorsInCalculationClusterThreshold";
|
|
33
|
+
export declare const STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD = "startedGeneratorsOutsideCalculationClusterThreshold";
|
|
29
34
|
export declare const intlPredefinedParametersOptions: () => {
|
|
30
35
|
id: string;
|
|
31
36
|
label: string;
|
|
@@ -19,9 +19,14 @@ const SHORT_CIRCUIT_WITH_NEUTRAL_POSITION = "withNeutralPosition";
|
|
|
19
19
|
const SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE = "initialVoltageProfileMode";
|
|
20
20
|
const SHORT_CIRCUIT_VOLTAGE_RANGES = "voltageRanges";
|
|
21
21
|
const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER = "onlyStartedGeneratorsInCalculationCluster";
|
|
22
|
+
const SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER = "onlyStartedGeneratorsOutsideCalculationCluster";
|
|
23
|
+
const NODE_CLUSTER = "nodeCluster";
|
|
24
|
+
const NODE_CLUSTER_FILTER_IDS = "nodeClusterFilterIds";
|
|
22
25
|
const SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS = "modelPowerElectronics";
|
|
23
26
|
const SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS = "powerElectronicsMaterials";
|
|
24
27
|
const SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS = "powerElectronicsClusters";
|
|
28
|
+
const STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD = "startedGeneratorsInCalculationClusterThreshold";
|
|
29
|
+
const STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD = "startedGeneratorsOutsideCalculationClusterThreshold";
|
|
25
30
|
const intlPredefinedParametersOptions = () => [
|
|
26
31
|
{
|
|
27
32
|
id: "ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP",
|
|
@@ -60,10 +65,13 @@ const onlyStartedGeneratorsOptions = {
|
|
|
60
65
|
};
|
|
61
66
|
export {
|
|
62
67
|
InitialVoltage,
|
|
68
|
+
NODE_CLUSTER,
|
|
69
|
+
NODE_CLUSTER_FILTER_IDS,
|
|
63
70
|
PredefinedParameters,
|
|
64
71
|
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
65
72
|
SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
|
|
66
73
|
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
|
|
74
|
+
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER,
|
|
67
75
|
SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
|
|
68
76
|
SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
|
|
69
77
|
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
@@ -73,6 +81,8 @@ export {
|
|
|
73
81
|
SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
|
|
74
82
|
SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
|
|
75
83
|
SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
|
|
84
|
+
STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD,
|
|
85
|
+
STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD,
|
|
76
86
|
intlInitialVoltageProfileMode,
|
|
77
87
|
intlPredefinedParametersOptions,
|
|
78
88
|
onlyStartedGeneratorsOptions
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, 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, onlyStartedGeneratorsOptions } from "./constants.js";
|
|
1
|
+
import { InitialVoltage, NODE_CLUSTER, NODE_CLUSTER_FILTER_IDS, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, 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, STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD, STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./constants.js";
|
|
2
2
|
import { ShortCircuitParametersInLine } from "./short-circuit-parameters-inline.js";
|
|
3
3
|
import { ShortCircuitParametersEditionDialog } from "./short-circuit-parameters-dialog.js";
|
|
4
4
|
export {
|
|
5
5
|
InitialVoltage,
|
|
6
|
+
NODE_CLUSTER,
|
|
7
|
+
NODE_CLUSTER_FILTER_IDS,
|
|
6
8
|
PredefinedParameters,
|
|
7
9
|
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
8
10
|
SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
|
|
9
11
|
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
|
|
12
|
+
SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER,
|
|
10
13
|
SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
|
|
11
14
|
SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
|
|
12
15
|
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
@@ -16,6 +19,8 @@ export {
|
|
|
16
19
|
SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
|
|
17
20
|
SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
|
|
18
21
|
SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
|
|
22
|
+
STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD,
|
|
23
|
+
STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD,
|
|
19
24
|
ShortCircuitParametersEditionDialog,
|
|
20
25
|
ShortCircuitParametersInLine,
|
|
21
26
|
intlInitialVoltageProfileMode,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TabPanelProps } from '@mui/lab';
|
|
2
|
+
import { PredefinedParameters } from './constants';
|
|
3
|
+
export interface ShortCircuitFieldsProps extends TabPanelProps {
|
|
4
|
+
resetAll: (predefinedParams: PredefinedParameters) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare enum Status {
|
|
7
|
+
SUCCESS = "SUCCESS",
|
|
8
|
+
ERROR = "ERROR"
|
|
9
|
+
}
|
|
10
|
+
export declare const ShortCircuitGeneralTabPanel: import('react').ForwardRefExoticComponent<Omit<Readonly<ShortCircuitFieldsProps>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, 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 } 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, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, 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 "../../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 { TabPanel } from "../common/parameters.js";
|
|
47
|
+
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
48
|
+
import "../common/widget/parameter-line-slider.js";
|
|
49
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
50
|
+
import { ShortCircuitParametersTabValues } from "./short-circuit-parameters-utils.js";
|
|
51
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
52
|
+
Status2["SUCCESS"] = "SUCCESS";
|
|
53
|
+
Status2["ERROR"] = "ERROR";
|
|
54
|
+
return Status2;
|
|
55
|
+
})(Status || {});
|
|
56
|
+
const ShortCircuitGeneralTabPanel = forwardRef(
|
|
57
|
+
({ resetAll, ...othersTabPanelProps }, ref) => {
|
|
58
|
+
const [status, setStatus] = useState(
|
|
59
|
+
"SUCCESS"
|
|
60
|
+
/* SUCCESS */
|
|
61
|
+
);
|
|
62
|
+
const watchInitialVoltageProfileMode = useWatch({
|
|
63
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`
|
|
64
|
+
});
|
|
65
|
+
const watchPredefinedParams = useWatch({
|
|
66
|
+
name: SHORT_CIRCUIT_PREDEFINED_PARAMS
|
|
67
|
+
});
|
|
68
|
+
const watchLoads = useWatch({
|
|
69
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`
|
|
70
|
+
});
|
|
71
|
+
const watchShuntCompensators = useWatch({
|
|
72
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`
|
|
73
|
+
});
|
|
74
|
+
const watchVSC = useWatch({
|
|
75
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`
|
|
76
|
+
});
|
|
77
|
+
const watchNeutralPosition = useWatch({
|
|
78
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`
|
|
79
|
+
});
|
|
80
|
+
const watchOnlyStartedGeneratorsInCalculationCluster = useWatch({
|
|
81
|
+
name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER}`
|
|
82
|
+
});
|
|
83
|
+
const isIccMinFeaturesDefaultConfiguration = useMemo(() => {
|
|
84
|
+
return !watchLoads && !watchShuntCompensators && !watchVSC && !watchNeutralPosition && // if watchOnlyStartedGeneratorsInCalculationCluster is undefined, we consider IccMinFeaturesDefaultConfiguration as true
|
|
85
|
+
(watchOnlyStartedGeneratorsInCalculationCluster ?? true);
|
|
86
|
+
}, [
|
|
87
|
+
watchLoads,
|
|
88
|
+
watchShuntCompensators,
|
|
89
|
+
watchVSC,
|
|
90
|
+
watchNeutralPosition,
|
|
91
|
+
watchOnlyStartedGeneratorsInCalculationCluster
|
|
92
|
+
]);
|
|
93
|
+
const isIccMaxFeaturesDefaultConfiguration = useMemo(() => {
|
|
94
|
+
return !watchLoads && !watchShuntCompensators && watchVSC && !watchNeutralPosition && // if watchOnlyStartedGeneratorsInCalculationCluster is undefined, we consider IccMaxFeaturesDefaultConfiguration as true
|
|
95
|
+
!(watchOnlyStartedGeneratorsInCalculationCluster ?? false);
|
|
96
|
+
}, [
|
|
97
|
+
watchLoads,
|
|
98
|
+
watchShuntCompensators,
|
|
99
|
+
watchVSC,
|
|
100
|
+
watchNeutralPosition,
|
|
101
|
+
watchOnlyStartedGeneratorsInCalculationCluster
|
|
102
|
+
]);
|
|
103
|
+
const predefinedParamsOptions = useMemo(() => {
|
|
104
|
+
return intlPredefinedParametersOptions();
|
|
105
|
+
}, []);
|
|
106
|
+
const initialVoltageProfileMode = useMemo(() => {
|
|
107
|
+
return intlInitialVoltageProfileMode();
|
|
108
|
+
}, []);
|
|
109
|
+
const statusColor = useMemo(
|
|
110
|
+
() => ({ color: status === "SUCCESS" ? green[500] : red[500] }),
|
|
111
|
+
[status]
|
|
112
|
+
);
|
|
113
|
+
const statusToShow = /* @__PURE__ */ jsx(Lens, { fontSize: "medium", sx: statusColor });
|
|
114
|
+
const onPredefinedParametersManualChange = (event) => {
|
|
115
|
+
const newPredefinedParameters = event.target.value;
|
|
116
|
+
resetAll(newPredefinedParameters);
|
|
117
|
+
};
|
|
118
|
+
const feederResult = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
|
|
119
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "descWithFeederResult" }) }),
|
|
120
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_FEEDER_RESULT}` }) })
|
|
121
|
+
] });
|
|
122
|
+
const predefinedParameters = /* @__PURE__ */ jsx(
|
|
123
|
+
MuiSelectInput,
|
|
124
|
+
{
|
|
125
|
+
name: SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
126
|
+
options: predefinedParamsOptions,
|
|
127
|
+
onChange: onPredefinedParametersManualChange,
|
|
128
|
+
fullWidth: true
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
const initialVoltageProfileModeField = /* @__PURE__ */ jsx(
|
|
132
|
+
RadioInput,
|
|
133
|
+
{
|
|
134
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`,
|
|
135
|
+
options: Object.values(initialVoltageProfileMode)
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
const loads = /* @__PURE__ */ jsx(CheckboxInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`, label: "shortCircuitLoads" });
|
|
139
|
+
const vsc = /* @__PURE__ */ jsx(
|
|
140
|
+
CheckboxInput,
|
|
141
|
+
{
|
|
142
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`,
|
|
143
|
+
label: "shortCircuitHvdc"
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
const shuntCompensators = /* @__PURE__ */ jsx(
|
|
147
|
+
CheckboxInput,
|
|
148
|
+
{
|
|
149
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`,
|
|
150
|
+
label: "shortCircuitShuntCompensators"
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
const neutralPosition = /* @__PURE__ */ jsx(
|
|
154
|
+
CheckboxInput,
|
|
155
|
+
{
|
|
156
|
+
name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`,
|
|
157
|
+
label: "shortCircuitNeutralPosition"
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
const isIccMaxWithNominalVoltageMap = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP;
|
|
162
|
+
const isIccMinWithNominal = watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP;
|
|
163
|
+
const isInitialVoltageNominal = watchInitialVoltageProfileMode === InitialVoltage.NOMINAL;
|
|
164
|
+
const isIccMaxNominalDefaultConfiguration = isIccMaxWithNominalVoltageMap && isInitialVoltageNominal;
|
|
165
|
+
const isIccMinNominalDefaultConfiguration = isIccMinWithNominal && isInitialVoltageNominal;
|
|
166
|
+
const isCEI909DefaultConfiguration = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_CEI909 && watchInitialVoltageProfileMode === InitialVoltage.CEI909;
|
|
167
|
+
const isIccMaxDefaultConfiguration = (isIccMaxNominalDefaultConfiguration || isCEI909DefaultConfiguration) && isIccMaxFeaturesDefaultConfiguration;
|
|
168
|
+
const isIccMinDefaultConfiguration = isIccMinNominalDefaultConfiguration && isIccMinFeaturesDefaultConfiguration;
|
|
169
|
+
setStatus(
|
|
170
|
+
isIccMaxDefaultConfiguration || isIccMinDefaultConfiguration ? "SUCCESS" : "ERROR"
|
|
171
|
+
/* ERROR */
|
|
172
|
+
);
|
|
173
|
+
}, [
|
|
174
|
+
watchInitialVoltageProfileMode,
|
|
175
|
+
watchPredefinedParams,
|
|
176
|
+
isIccMaxFeaturesDefaultConfiguration,
|
|
177
|
+
isIccMinFeaturesDefaultConfiguration
|
|
178
|
+
]);
|
|
179
|
+
return /* @__PURE__ */ jsx(TabPanel, { index: ShortCircuitParametersTabValues.GENERAL, ref, ...othersTabPanelProps, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, paddingLeft: 2, children: [
|
|
180
|
+
/* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 2, xl: 6, children: /* @__PURE__ */ jsx(GridItem, { size: 10, children: feederResult }) }),
|
|
181
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPredefinedParameters", heading: 4 }),
|
|
182
|
+
/* @__PURE__ */ jsxs(Grid, { xl: 6, container: true, spacing: 1, alignItems: "center", children: [
|
|
183
|
+
/* @__PURE__ */ jsx(GridItem, { size: 9, children: predefinedParameters }),
|
|
184
|
+
/* @__PURE__ */ jsx(GridItem, { size: 2, children: statusToShow })
|
|
185
|
+
] }),
|
|
186
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitCharacteristics", heading: 4 }),
|
|
187
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 5, children: [
|
|
188
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, children: [
|
|
189
|
+
/* @__PURE__ */ jsx(GridItem, { children: loads }),
|
|
190
|
+
/* @__PURE__ */ jsx(GridItem, { children: shuntCompensators })
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 8, children: [
|
|
193
|
+
/* @__PURE__ */ jsx(GridItem, { children: vsc }),
|
|
194
|
+
/* @__PURE__ */ jsx(GridItem, { children: neutralPosition })
|
|
195
|
+
] })
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitVoltageProfileMode", heading: 4 }),
|
|
198
|
+
/* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: initialVoltageProfileModeField }) }),
|
|
199
|
+
/* @__PURE__ */ jsx(VoltageTable, { voltageProfileMode: watchInitialVoltageProfileMode })
|
|
200
|
+
] }) });
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
export {
|
|
204
|
+
ShortCircuitGeneralTabPanel,
|
|
205
|
+
Status
|
|
206
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseShortCircuitParametersFormReturn } from './use-short-circuit-parameters-form';
|
|
2
|
+
type ShortCircuitParametersContentProps = {
|
|
3
|
+
shortCircuitMethods: UseShortCircuitParametersFormReturn;
|
|
4
|
+
isDeveloperMode: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare function ShortCircuitParametersContent({ shortCircuitMethods, isDeveloperMode, }: Readonly<ShortCircuitParametersContentProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ShortCircuitParametersContent;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useWatch } from "react-hook-form";
|
|
4
|
+
import { Grid, Tabs, Tab, Box } from "@mui/material";
|
|
5
|
+
import { FormattedMessage } from "react-intl";
|
|
6
|
+
import { getTabStyle, parametersStyles } from "../parameters-style.js";
|
|
7
|
+
import { ShortCircuitParametersTabValues } from "./short-circuit-parameters-utils.js";
|
|
8
|
+
import { ShortCircuitGeneralTabPanel } from "./short-circuit-general-tab-panel.js";
|
|
9
|
+
import { ShortCircuitStudyAreaTabPanel } from "./short-circuit-study-area-tab-panel.js";
|
|
10
|
+
import { ShortCircuitPowerElectronicsTabPanel } from "./short-circuit-power-electronics-tab-panel.js";
|
|
11
|
+
import { SPECIFIC_PARAMETERS } from "../common/constants.js";
|
|
12
|
+
import "../../../utils/conversionUtils.js";
|
|
13
|
+
import "../../../utils/types/equipmentType.js";
|
|
14
|
+
import "@mui/icons-material";
|
|
15
|
+
import "../../../utils/yupConfig.js";
|
|
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 "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
22
|
+
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
23
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
24
|
+
import "../../overflowableText/OverflowableText.js";
|
|
25
|
+
import "yup";
|
|
26
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
27
|
+
import "../../customAGGrid/customAggrid.js";
|
|
28
|
+
import "ag-grid-community";
|
|
29
|
+
import "react-papaparse";
|
|
30
|
+
import "react-csv-downloader";
|
|
31
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
32
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
33
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
34
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
35
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
36
|
+
import "@react-querybuilder/material";
|
|
37
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
38
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
39
|
+
import "uuid";
|
|
40
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
41
|
+
import "react-querybuilder";
|
|
42
|
+
import "../common/widget/parameter-line-slider.js";
|
|
43
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
44
|
+
const styles = {
|
|
45
|
+
container: {
|
|
46
|
+
...parametersStyles.scrollableGrid,
|
|
47
|
+
maxHeight: "100%"
|
|
48
|
+
},
|
|
49
|
+
maxWidth: {
|
|
50
|
+
width: "100%"
|
|
51
|
+
},
|
|
52
|
+
wrapper: {
|
|
53
|
+
flexGrow: 1,
|
|
54
|
+
overflow: "auto",
|
|
55
|
+
paddingLeft: 1
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
function ShortCircuitParametersContent({
|
|
59
|
+
shortCircuitMethods,
|
|
60
|
+
isDeveloperMode
|
|
61
|
+
}) {
|
|
62
|
+
const { resetAll, selectedTab, handleTabChange, tabIndexesWithError } = shortCircuitMethods;
|
|
63
|
+
const watchSpecificParameters = useWatch({
|
|
64
|
+
name: `${SPECIFIC_PARAMETERS}`
|
|
65
|
+
});
|
|
66
|
+
const isThereSpecificParameters = useMemo(
|
|
67
|
+
() => Object.keys(watchSpecificParameters).length > 0 && watchSpecificParameters.constructor === Object,
|
|
68
|
+
[watchSpecificParameters]
|
|
69
|
+
);
|
|
70
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Grid, { item: true, sx: { width: "100%" }, children: /* @__PURE__ */ jsxs(Tabs, { value: selectedTab, onChange: handleTabChange, children: [
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
Tab,
|
|
74
|
+
{
|
|
75
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: ShortCircuitParametersTabValues.GENERAL }),
|
|
76
|
+
value: ShortCircuitParametersTabValues.GENERAL,
|
|
77
|
+
sx: getTabStyle(tabIndexesWithError, ShortCircuitParametersTabValues.GENERAL)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
isThereSpecificParameters && isDeveloperMode && /* @__PURE__ */ jsx(
|
|
81
|
+
Tab,
|
|
82
|
+
{
|
|
83
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: ShortCircuitParametersTabValues.STUDY_AREA }),
|
|
84
|
+
value: ShortCircuitParametersTabValues.STUDY_AREA,
|
|
85
|
+
sx: getTabStyle(tabIndexesWithError, ShortCircuitParametersTabValues.STUDY_AREA)
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
isThereSpecificParameters && isDeveloperMode && /* @__PURE__ */ jsx(
|
|
89
|
+
Tab,
|
|
90
|
+
{
|
|
91
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: ShortCircuitParametersTabValues.POWER_ELECTRONICS }),
|
|
92
|
+
value: ShortCircuitParametersTabValues.POWER_ELECTRONICS,
|
|
93
|
+
sx: getTabStyle(tabIndexesWithError, ShortCircuitParametersTabValues.POWER_ELECTRONICS)
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }) }),
|
|
97
|
+
/* @__PURE__ */ jsx(Box, { sx: styles.wrapper, children: /* @__PURE__ */ jsx(Grid, { container: true, sx: styles.container, children: /* @__PURE__ */ jsxs(Grid, { item: true, sx: styles.maxWidth, children: [
|
|
98
|
+
/* @__PURE__ */ jsx(ShortCircuitGeneralTabPanel, { resetAll, value: selectedTab }),
|
|
99
|
+
isThereSpecificParameters && isDeveloperMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx(ShortCircuitStudyAreaTabPanel, { value: selectedTab }),
|
|
101
|
+
/* @__PURE__ */ jsx(ShortCircuitPowerElectronicsTabPanel, { value: selectedTab })
|
|
102
|
+
] })
|
|
103
|
+
] }) }) })
|
|
104
|
+
] });
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
ShortCircuitParametersContent as default
|
|
108
|
+
};
|
|
@@ -7,7 +7,7 @@ import { ElementType } from "../../../utils/types/elementType.js";
|
|
|
7
7
|
import "../../../utils/types/equipmentType.js";
|
|
8
8
|
import "@mui/icons-material";
|
|
9
9
|
import "../../../utils/yupConfig.js";
|
|
10
|
-
import {
|
|
10
|
+
import { fetchShortCircuitParameters, updateShortCircuitParameters, getShortCircuitSpecificParametersDescription } from "../../../services/short-circuit-analysis.js";
|
|
11
11
|
import "react";
|
|
12
12
|
import "@mui/material";
|
|
13
13
|
import "react-intl";
|
|
@@ -55,19 +55,11 @@ function ShortCircuitParametersEditionDialog({
|
|
|
55
55
|
language,
|
|
56
56
|
isDeveloperMode
|
|
57
57
|
}) {
|
|
58
|
-
const parametersBackend = useParametersBackend(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
null,
|
|
64
|
-
null,
|
|
65
|
-
null,
|
|
66
|
-
null,
|
|
67
|
-
fetchShortCircuitParameters,
|
|
68
|
-
updateShortCircuitParameters,
|
|
69
|
-
getShortCircuitSpecificParametersDescription
|
|
70
|
-
);
|
|
58
|
+
const parametersBackend = useParametersBackend(user, id, ComputingType.SHORT_CIRCUIT, OptionalServicesStatus.Up, {
|
|
59
|
+
backendFetchParameters: fetchShortCircuitParameters,
|
|
60
|
+
backendUpdateParameters: updateShortCircuitParameters,
|
|
61
|
+
backendFetchSpecificParametersDescription: getShortCircuitSpecificParametersDescription
|
|
62
|
+
});
|
|
71
63
|
const shortCircuitMethods = useShortCircuitParametersForm({
|
|
72
64
|
parametersBackend,
|
|
73
65
|
parametersUuid: id,
|
|
@@ -93,6 +85,7 @@ function ShortCircuitParametersEditionDialog({
|
|
|
93
85
|
},
|
|
94
86
|
titleId,
|
|
95
87
|
disabledSave: disableSave,
|
|
88
|
+
maxWidth: "lg",
|
|
96
89
|
children: /* @__PURE__ */ jsx(
|
|
97
90
|
ShortCircuitParametersForm,
|
|
98
91
|
{
|
|
@@ -33,42 +33,45 @@ import "uuid";
|
|
|
33
33
|
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
34
34
|
import "react-querybuilder";
|
|
35
35
|
import { parametersStyles } from "../parameters-style.js";
|
|
36
|
-
import
|
|
36
|
+
import ShortCircuitParametersContent from "./short-circuit-parameters-content.js";
|
|
37
|
+
const styles = {
|
|
38
|
+
shortCircuitParameters: {
|
|
39
|
+
height: "100%",
|
|
40
|
+
display: "flex",
|
|
41
|
+
position: "relative",
|
|
42
|
+
flexDirection: "column"
|
|
43
|
+
}
|
|
44
|
+
};
|
|
37
45
|
function ShortCircuitParametersForm({
|
|
38
46
|
shortCircuitMethods,
|
|
39
47
|
renderTitleFields,
|
|
40
48
|
renderActions,
|
|
41
49
|
isDeveloperMode
|
|
42
50
|
}) {
|
|
43
|
-
const { formMethods, formSchema, paramsLoaded
|
|
44
|
-
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
) });
|
|
51
|
+
const { formMethods, formSchema, paramsLoaded } = shortCircuitMethods;
|
|
52
|
+
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(Box, { sx: styles.shortCircuitParameters, children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields?.() }),
|
|
54
|
+
paramsLoaded ? /* @__PURE__ */ jsx(Grid, { sx: parametersStyles.scrollableGrid, children: /* @__PURE__ */ jsx(
|
|
55
|
+
ShortCircuitParametersContent,
|
|
56
|
+
{
|
|
57
|
+
isDeveloperMode,
|
|
58
|
+
shortCircuitMethods
|
|
59
|
+
}
|
|
60
|
+
) }) : /* @__PURE__ */ jsx(LinearProgress, {}),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
Grid,
|
|
63
|
+
{
|
|
64
|
+
item: true,
|
|
65
|
+
container: true,
|
|
66
|
+
direction: "column",
|
|
67
|
+
sx: {
|
|
68
|
+
position: "absolute",
|
|
69
|
+
bottom: "15px"
|
|
70
|
+
},
|
|
71
|
+
children: renderActions?.()
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] }) });
|
|
72
75
|
}
|
|
73
76
|
export {
|
|
74
77
|
ShortCircuitParametersForm
|