Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 44 additions & 42 deletions src/components/tooltips/generator/generator-active-power-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Table, TableRow, TableContainer, Grid } from '@mui/material';
import { Table, TableRow, TableContainer, Grid, TableBody } from '@mui/material';
import { GeneratorEquipmentInfos } from '../equipment-popover-type';
import { formatValue, styles } from '../generic-equipment-popover-utils';
import { CellRender } from '../cell-render';
Expand All @@ -19,50 +19,52 @@ export const GeneratorActivePowerTable: React.FC<GeneratorActivePowerTableProps>
<Grid item sx={styles.grid}>
<TableContainer sx={styles.table}>
<Table size="small" sx={styles.layout}>
<TableRow>
<CellRender
isLabel
label="activePowerSetPointTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos.targetP && Math.round(equipmentInfos.targetP))}
colStyle={styles.cell}
/>
</TableRow>
<TableBody>
<TableRow>
<CellRender
isLabel
label="activePowerSetPointTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos.targetP && Math.round(equipmentInfos.targetP))}
colStyle={styles.cell}
/>
</TableRow>

<TableRow>
<CellRender
isLabel
label="MinimumActivePowerTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender value={formatValue(Math.round(equipmentInfos.minP))} colStyle={styles.cell} />
</TableRow>
<TableRow>
<CellRender
isLabel
label="MinimumActivePowerTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender value={formatValue(Math.round(equipmentInfos.minP))} colStyle={styles.cell} />
</TableRow>

<TableRow>
<CellRender
isLabel
label="MaximumActivePowerTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender value={formatValue(Math.round(equipmentInfos.maxP))} colStyle={styles.cell} />
</TableRow>
<TableRow>
<CellRender
isLabel
label="MaximumActivePowerTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender value={formatValue(Math.round(equipmentInfos.maxP))} colStyle={styles.cell} />
</TableRow>

<TableRow>
<CellRender
isLabel
label="plannedActivePowerSetPointTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(
equipmentInfos.plannedActivePowerSetPoint &&
Math.round(equipmentInfos.plannedActivePowerSetPoint)
)}
colStyle={styles.cell}
/>
</TableRow>
<TableRow>
<CellRender
isLabel
label="plannedActivePowerSetPointTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(
equipmentInfos.plannedActivePowerSetPoint &&
Math.round(equipmentInfos.plannedActivePowerSetPoint)
)}
colStyle={styles.cell}
/>
</TableRow>
</TableBody>
</Table>
</TableContainer>
</Grid>
Expand Down
44 changes: 25 additions & 19 deletions src/components/tooltips/generator/generator-popover-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Grid, Table, TableContainer, TableRow } from '@mui/material';
import { Grid, Table, TableBody, TableContainer, TableRow } from '@mui/material';
import { cellWithStatus, formatValue, styles } from '../generic-equipment-popover-utils';
import { CellRender } from '../cell-render';
import { GeneratorEquipmentInfos } from '../equipment-popover-type';
Expand All @@ -23,25 +23,31 @@ export const GeneratorPopoverContent: React.FC<GeneratorPopoverContentProps> = (
<Grid item sx={styles.grid}>
<TableContainer sx={styles.table}>
<Table size="small" sx={styles.layout}>
<TableRow>
<CellRender isLabel label="ActivePower" colStyle={{ ...styles.cell, fontWeight: 'bold' }} />
<CellRender
value={formatValue(equipmentInfos.p && Math.round(equipmentInfos.p))}
colStyle={cellWithStatus(loadFlowStatus)}
/>
</TableRow>
<TableBody>
<TableRow>
<CellRender
isLabel
label="ActivePower"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos.p && Math.round(equipmentInfos.p))}
colStyle={cellWithStatus(loadFlowStatus)}
/>
</TableRow>

<TableRow>
<CellRender
isLabel
label="reactivePowerTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos.q && Math.round(equipmentInfos.q))}
colStyle={cellWithStatus(loadFlowStatus)}
/>
</TableRow>
<TableRow>
<CellRender
isLabel
label="reactivePowerTooltip"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos.q && Math.round(equipmentInfos.q))}
colStyle={cellWithStatus(loadFlowStatus)}
/>
</TableRow>
</TableBody>
</Table>
</TableContainer>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Table, TableRow, TableContainer, Grid } from '@mui/material';
import { Table, TableRow, TableContainer, Grid, TableBody } from '@mui/material';
import { GeneratorEquipmentInfos } from '../equipment-popover-type';
import { styles } from '../generic-equipment-popover-utils';
import { CellRender } from '../cell-render';
Expand All @@ -19,18 +19,20 @@ export const GeneratorVoltageRegulationTable: React.FC<GeneratorVoltageRegulatio
<Grid item sx={styles.grid}>
<TableContainer sx={styles.table}>
<Table size="small" sx={styles.layout}>
<TableRow>
<CellRender
isLabel
label="VoltageRegulation"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
isLabel
label={equipmentInfos.voltageRegulatorOn ? 'yes' : 'no'}
colStyle={styles.cell}
/>
</TableRow>
<TableBody>
<TableRow>
<CellRender
isLabel
label="VoltageRegulation"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
isLabel
label={equipmentInfos.voltageRegulatorOn ? 'yes' : 'no'}
colStyle={styles.cell}
/>
</TableRow>
</TableBody>
</Table>
</TableContainer>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Grid, TableRow } from '@mui/material';
import { Grid, Table, TableBody, TableContainer, TableRow } from '@mui/material';
import { VoltageLevelTooltipBusInfos } from '../equipment-popover-type';
import { CellRender } from '../cell-render';
import { formatValue, styles as genericStyles } from '../generic-equipment-popover-utils';
Expand Down Expand Up @@ -51,39 +51,57 @@ export const VoltageLevelPopoverBusInfos = ({ buses }: { buses?: VoltageLevelToo

return (
<Grid item sx={genericStyles.grid}>
<TableRow>
<CellRender isLabel={true} label="" colStyle={{ ...genericStyles.cell, fontWeight: 'bold' }} />
{buses?.map((b) => (
<CellRender key={b.id} value={`${b.id}`} colStyle={{ ...genericStyles.cell, fontWeight: 'bold' }} />
))}
</TableRow>
<TableContainer>
<Table>
<TableBody>
<TableRow>
<CellRender
isLabel={true}
label=""
colStyle={{ ...genericStyles.cell, fontWeight: 'bold' }}
/>
{buses?.map((b) => (
<CellRender
key={b.id}
value={`${b.id}`}
colStyle={{ ...genericStyles.cell, fontWeight: 'bold' }}
/>
))}
</TableRow>

{renderSpecificRow('tooltip.u', (bus) => bus.u, isLoadflowInvalid ? styles.invalidComputation : undefined)}
{renderSpecificRow(
'tooltip.angle',
(bus) => bus.angle,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.generation',
(bus) => bus.generation,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.load',
(bus) => bus.load,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.balance',
(bus) => bus.balance,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.icc',
(bus) => bus.icc / 1000,
isShortcircuitInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.u',
(bus) => bus.u,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.angle',
(bus) => bus.angle,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.generation',
(bus) => bus.generation,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.load',
(bus) => bus.load,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.balance',
(bus) => bus.balance,
isLoadflowInvalid ? styles.invalidComputation : undefined
)}
{renderSpecificRow(
'tooltip.icc',
(bus) => bus.icc / 1000,
isShortcircuitInvalid ? styles.invalidComputation : undefined
)}
</TableBody>
</Table>
</TableContainer>
</Grid>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Grid, Table, TableContainer, TableRow } from '@mui/material';
import { Grid, Table, TableBody, TableContainer, TableRow } from '@mui/material';
import { CellRender } from '../cell-render';
import { formatValue, styles } from '../generic-equipment-popover-utils';
import { VoltageLevelTooltipInfos } from '../equipment-popover-type';
Expand All @@ -15,28 +15,30 @@ export const VoltageLevelPopoverInfos = ({ equipmentInfos }: { equipmentInfos?:
<Grid item sx={styles.grid}>
<TableContainer>
<Table size="small" sx={styles.layout}>
<TableRow>
<CellRender
isLabel={true}
label="tooltip.umin"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos?.umin, 2)}
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
</TableRow>
<TableRow>
<CellRender
isLabel={true}
label="tooltip.umax"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos?.umax, 2)}
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
</TableRow>
<TableBody>
<TableRow>
<CellRender
isLabel={true}
label="tooltip.umin"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos?.umin, 2)}
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
</TableRow>
<TableRow>
<CellRender
isLabel={true}
label="tooltip.umax"
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
<CellRender
value={formatValue(equipmentInfos?.umax, 2)}
colStyle={{ ...styles.cell, fontWeight: 'bold' }}
/>
</TableRow>
</TableBody>
</Table>
</TableContainer>
</Grid>
Expand Down
Loading