-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gather all the unit conversions into one file #2447
Open
ghazwarhili
wants to merge
22
commits into
main
Choose a base branch
from
mutualize-unit-conversion-into-one-file
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e091acb
gather all the unit conversions into one file
ghazwarhili 16ef55e
add licence
ghazwarhili 302fe30
Merge branch 'main' into mutualize-unit-conversion-into-one-file
ghazwarhili 3e1df6c
Merge branch 'main' into mutualize-unit-conversion-into-one-file
thangqp 013ee58
Merge two fieldType from commons-ui and study
thangqp 537d481
Merge branch 'main' into mutualize-unit-conversion-into-one-file
ghazwarhili 1e7eb1f
fix fieldType
ghazwarhili 23264ff
Merge remote-tracking branch 'origin/mutualize-unit-conversion-into-o…
ghazwarhili bdfed42
revert conversion unit for result table
ghazwarhili 0865e4a
add conversion unit to modification by formula
ghazwarhili c1432f0
Merge branch 'main' into mutualize-unit-conversion-into-one-file
ghazwarhili 853950c
adapt the conversion unit to modifcation by tabular
ghazwarhili d841b7b
Merge remote-tracking branch 'origin/mutualize-unit-conversion-into-o…
ghazwarhili ebadd4a
fix converter unit input or output
ghazwarhili c38b717
enhance the name of the mapper function
ghazwarhili 724af3d
Merge branch 'main' into mutualize-unit-conversion-into-one-file
ghazwarhili 2df7d90
rename MAXIMUM_SUSCEPTANCE to MAX_SUSCEPTANCE
thangqp f0fa241
revert modif in package.json
thangqp ba8a934
Merge branch 'main' into mutualize-unit-conversion-into-one-file
thangqp 631011d
revert modif in package-lock.json
thangqp 7b7d98b
Ignore maxSusceptance and maxQAtNominalV conversion in tabular
thangqp 8eaab7c
Merge branch 'main' into mutualize-unit-conversion-into-one-file
ghazwarhili File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ | |
*/ | ||
|
||
import type { ReadonlyDeep } from 'type-fest'; | ||
import { DataType, FieldOptionType, FieldType } from './assignment.type'; | ||
import { DataType, FieldOptionType } from './assignment.type'; | ||
import { LOAD_TYPES } from '../../../../../network/constants'; | ||
import { EquipmentType, kiloUnitToUnit, microUnitToUnit, unitToKiloUnit, unitToMicroUnit } from '@gridsuite/commons-ui'; | ||
import { EquipmentType, FieldType } from '@gridsuite/commons-ui'; | ||
import { KILO_AMPERE, MICRO_SIEMENS } from '../../../../../utils/field-constants'; | ||
|
||
export const FIELD_OPTIONS = { | ||
|
@@ -102,21 +102,17 @@ export const FIELD_OPTIONS = { | |
label: 'sectionCount', | ||
dataType: DataType.INTEGER, | ||
}, | ||
MAXIMUM_SUSCEPTANCE: { | ||
id: FieldType.MAXIMUM_SUSCEPTANCE, | ||
MAX_SUSCEPTANCE: { | ||
id: FieldType.MAX_SUSCEPTANCE, | ||
label: 'maxSusceptance', | ||
unit: MICRO_SIEMENS, | ||
dataType: DataType.DOUBLE, | ||
outputConverter: (value) => microUnitToUnit(value), | ||
inputConverter: (value) => unitToMicroUnit(value), | ||
}, | ||
MAXIMUM_Q_AT_NOMINAL_VOLTAGE: { | ||
id: FieldType.MAXIMUM_Q_AT_NOMINAL_VOLTAGE, | ||
MAX_Q_AT_NOMINAL_V: { | ||
id: FieldType.MAX_Q_AT_NOMINAL_V, | ||
label: 'maxQAtNominalV', | ||
unit: MICRO_SIEMENS, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MVar and not Micro S There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same |
||
dataType: DataType.DOUBLE, | ||
outputConverter: (value) => microUnitToUnit(value), | ||
inputConverter: (value) => unitToMicroUnit(value), | ||
}, | ||
NOMINAL_VOLTAGE: { | ||
id: FieldType.NOMINAL_VOLTAGE, | ||
|
@@ -138,16 +134,12 @@ export const FIELD_OPTIONS = { | |
label: 'LowShortCircuitCurrentLimit', | ||
unit: KILO_AMPERE, | ||
dataType: DataType.DOUBLE, | ||
outputConverter: (value) => kiloUnitToUnit(value), | ||
inputConverter: (value) => unitToKiloUnit(value), | ||
}, | ||
HIGH_SHORT_CIRCUIT_CURRENT_LIMIT: { | ||
id: FieldType.HIGH_SHORT_CIRCUIT_CURRENT_LIMIT, | ||
label: 'HighShortCircuitCurrentLimit', | ||
unit: KILO_AMPERE, | ||
dataType: DataType.DOUBLE, | ||
outputConverter: (value) => kiloUnitToUnit(value), | ||
inputConverter: (value) => unitToKiloUnit(value), | ||
}, | ||
ACTIVE_POWER: { | ||
id: FieldType.ACTIVE_POWER, | ||
|
@@ -174,16 +166,12 @@ export const FIELD_OPTIONS = { | |
label: 'G', | ||
unit: MICRO_SIEMENS, | ||
dataType: DataType.DOUBLE, | ||
outputConverter: (value) => microUnitToUnit(value), | ||
inputConverter: (value) => unitToMicroUnit(value), | ||
}, | ||
B: { | ||
id: FieldType.B, | ||
label: 'B', | ||
unit: MICRO_SIEMENS, | ||
dataType: DataType.DOUBLE, | ||
outputConverter: (value) => microUnitToUnit(value), | ||
inputConverter: (value) => unitToMicroUnit(value), | ||
}, | ||
RATED_U1: { | ||
id: FieldType.RATED_U1, | ||
|
@@ -314,8 +302,8 @@ export const EQUIPMENTS_FIELDS = { | |
FIELD_OPTIONS.PROPERTY, | ||
FIELD_OPTIONS.MAXIMUM_SECTION_COUNT, | ||
FIELD_OPTIONS.SECTION_COUNT, | ||
FIELD_OPTIONS.MAXIMUM_SUSCEPTANCE, | ||
FIELD_OPTIONS.MAXIMUM_Q_AT_NOMINAL_VOLTAGE, | ||
FIELD_OPTIONS.MAX_SUSCEPTANCE, | ||
FIELD_OPTIONS.MAX_Q_AT_NOMINAL_V, | ||
], | ||
[EquipmentType.STATIC_VAR_COMPENSATOR]: [FIELD_OPTIONS.PROPERTY], | ||
[EquipmentType.HVDC_LINE]: [FIELD_OPTIONS.PROPERTY], | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MICRO_SIEMENS to SIEMENS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same