Skip to content

Commit

Permalink
add subtype
Browse files Browse the repository at this point in the history
  • Loading branch information
ghazwarhili committed Jan 30, 2025
1 parent 3f3542b commit 3acc8cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/utils/types/equipmentType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,17 @@ export enum EquipmentType {
BREAKER = 'BREAKER',
}

export enum HvdcType {
LCC = 'LCC',
VSC = 'VSC',
ALL = 'ALL',
}

// Must be equivalent as the back enum
export const EQUIPMENT_TYPE: Record<EquipmentType, { name: EquipmentType; tagLabel: string } | undefined> = {
export const EQUIPMENT_TYPE: Record<
EquipmentType,
{ name: EquipmentType; subtype?: HvdcType; tagLabel: string } | undefined
> = {
[EquipmentType.SUBSTATION]: {
name: EquipmentType.SUBSTATION,
tagLabel: 'equipment_search/substationTag',
Expand All @@ -102,6 +111,7 @@ export const EQUIPMENT_TYPE: Record<EquipmentType, { name: EquipmentType; tagLab
},
[EquipmentType.HVDC_LINE]: {
name: EquipmentType.HVDC_LINE,
subtype: HvdcType.ALL,
tagLabel: 'equipment_search/hvdcLineTag',
},
[EquipmentType.GENERATOR]: {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/types/equipmentTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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 { HvdcType } from './equipmentType';

export const Line = { label: 'Lines', type: 'LINE' };
export const Generator = { label: 'Generators', type: 'GENERATOR' };
Expand All @@ -22,7 +23,7 @@ export const VSC = {
label: 'VscConverterStations',
type: 'VSC_CONVERTER_STATION',
};
export const Hvdc = { label: 'HvdcLines', type: 'HVDC_LINE' };
export const Hvdc = { label: 'HvdcLines', type: 'HVDC_LINE', subtype: HvdcType };
export const BusBar = { label: 'BusBarSections', type: 'BUSBAR_SECTION' };
export const TwoWindingTransfo = {
label: 'TwoWindingsTransformers',
Expand Down

0 comments on commit 3acc8cb

Please sign in to comment.