-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix_Selection_Forms
- Loading branch information
Showing
24 changed files
with
1,307 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...ponents/dialogs/parameters/common/voltage-level-table/custom-voltage-level-table-cell.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
import { FunctionComponent } from 'react'; | ||
import { IColumnsDef } from '../limitreductions/columns-definitions'; | ||
import { TableCell } from '@mui/material'; | ||
import { FloatInput, RawReadOnlyInput } from '@gridsuite/commons-ui'; | ||
import { VOLTAGE_LEVEL } from '../../../../utils/field-constants'; | ||
|
||
export const CustomVoltageLevelTableCell: FunctionComponent<{ | ||
formName: string; | ||
rowIndex: number; | ||
column: IColumnsDef; | ||
}> = ({ formName, rowIndex, column }) => { | ||
return ( | ||
<TableCell sx={{ fontWeight: 'bold' }}> | ||
{column.dataKey === VOLTAGE_LEVEL ? ( | ||
<RawReadOnlyInput name={`${formName}[${rowIndex}].${column.dataKey}`} /> | ||
) : ( | ||
<FloatInput name={`${formName}[${rowIndex}].${column.dataKey}`} /> | ||
)} | ||
</TableCell> | ||
); | ||
}; |
36 changes: 36 additions & 0 deletions
36
...mponents/dialogs/parameters/common/voltage-level-table/custom-voltage-level-table-row.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
import { TableRow } from '@mui/material'; | ||
import { FunctionComponent } from 'react'; | ||
|
||
import { CustomVoltageLevelTableCell } from './custom-voltage-level-table-cell'; | ||
import { IColumnsDef } from '../limitreductions/columns-definitions'; | ||
|
||
interface TableRowComponentProps { | ||
formName: string; | ||
columnsDefinition: IColumnsDef[]; | ||
index: number; | ||
} | ||
|
||
export const CustomVoltageLevelTableRow: FunctionComponent<TableRowComponentProps> = ({ | ||
formName, | ||
columnsDefinition, | ||
index, | ||
}) => { | ||
return ( | ||
<TableRow> | ||
{columnsDefinition.map((column: IColumnsDef) => ( | ||
<CustomVoltageLevelTableCell | ||
key={`${column.dataKey}`} | ||
formName={formName} | ||
rowIndex={index} | ||
column={column} | ||
/> | ||
))} | ||
</TableRow> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/components/dialogs/parameters/state-estimation/state-estimation-general-parameters.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
import { Grid } from '@mui/material'; | ||
import { ESTIM_ALGO_TYPE, ESTIM_LOG_LEVEL, PRINCIPAL_OBSERVABLE_ZONE } from 'components/utils/field-constants'; | ||
import { estimAlgoTypeValues, estimLogLevelValues, TabValue } from './state-estimation-parameters-utils'; | ||
import { FieldLabel, MuiSelectInput, SwitchInput } from '@gridsuite/commons-ui'; | ||
import { styles } from '../parameters-style'; | ||
|
||
export const StateEstimationGeneralParameters = () => { | ||
return ( | ||
<Grid container> | ||
<Grid container item alignItems="center" spacing={2} direction={'row'}> | ||
<Grid item xs={10} sx={styles.parameterName}> | ||
<FieldLabel label={'StateEstimationParametersPrincipalObservableZoneLabel'} /> | ||
</Grid> | ||
<Grid item xs={2}> | ||
<SwitchInput name={`${TabValue.GENERAL}.${PRINCIPAL_OBSERVABLE_ZONE}`} /> | ||
</Grid> | ||
</Grid> | ||
|
||
<Grid container item spacing={1} paddingTop={3}> | ||
<Grid item xs={8} sx={styles.parameterName}> | ||
<FieldLabel label={'StateEstimationParametersLogLevelLabel'} /> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<MuiSelectInput | ||
name={`${TabValue.GENERAL}.${ESTIM_LOG_LEVEL}`} | ||
options={estimLogLevelValues} | ||
fullWidth | ||
/> | ||
</Grid> | ||
</Grid> | ||
<Grid container item spacing={1} paddingTop={3}> | ||
<Grid item xs={8} sx={styles.parameterName}> | ||
<FieldLabel label={'StateEstimationParametersAlgoTypeLabel'} /> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<MuiSelectInput | ||
name={`${TabValue.GENERAL}.${ESTIM_ALGO_TYPE}`} | ||
options={estimAlgoTypeValues} | ||
fullWidth | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
); | ||
}; |
62 changes: 62 additions & 0 deletions
62
...components/dialogs/parameters/state-estimation/state-estimation-loadbounds-parameters.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
import { FunctionComponent, useMemo } from 'react'; | ||
import { DEFAULT_BOUNDS, DEFAULT_FIXED_BOUNDS, VOLTAGE_LEVEL } from '../../../utils/field-constants'; | ||
import { loadboundsParametersFields, TabValue } from './state-estimation-parameters-utils'; | ||
import { IColumnsDef } from '../common/limitreductions/columns-definitions'; | ||
import { useIntl } from 'react-intl'; | ||
import { Box, Grid } from '@mui/material'; | ||
import LineSeparator from '../../commons/line-separator'; | ||
import GridSection from '../../commons/grid-section'; | ||
import CustomVoltageLevelTable from '../common/voltage-level-table/custom-voltage-level-table'; | ||
|
||
export const StateEstimationLoadboundsParameters: FunctionComponent = () => { | ||
const intl = useIntl(); | ||
|
||
const columnsDefinition = useMemo<IColumnsDef[]>(() => { | ||
const definition = [ | ||
{ | ||
dataKey: VOLTAGE_LEVEL, | ||
label: intl.formatMessage({ id: 'voltageRange' }), | ||
tooltip: intl.formatMessage({ id: 'voltageRange' }), | ||
}, | ||
]; | ||
definition.push( | ||
...loadboundsParametersFields.map((parameter) => { | ||
return { | ||
dataKey: parameter, | ||
label: intl.formatMessage({ id: parameter }), | ||
tooltip: intl.formatMessage({ id: parameter }), | ||
}; | ||
}) | ||
); | ||
return definition; | ||
}, [intl]); | ||
|
||
return ( | ||
<Grid container> | ||
<GridSection title="StateEstimationParametersDefaultBoundsSection" heading={4} /> | ||
|
||
<CustomVoltageLevelTable | ||
formName={`${TabValue.LOADBOUNDS}.${DEFAULT_BOUNDS}`} | ||
columnsDefinition={columnsDefinition} | ||
tableHeight={450} | ||
/> | ||
|
||
<Box my={2}> | ||
<LineSeparator /> | ||
</Box> | ||
<GridSection title="StateEstimationParametersDefaultFixedBoundsSection" heading={4} /> | ||
|
||
<CustomVoltageLevelTable | ||
formName={`${TabValue.LOADBOUNDS}.${DEFAULT_FIXED_BOUNDS}`} | ||
columnsDefinition={columnsDefinition} | ||
tableHeight={450} | ||
/> | ||
</Grid> | ||
); | ||
}; |
Oops, something went wrong.