@@ -132,9 +132,9 @@ public class Mappings {
132
132
private static final String PERMANENT_ACTIVE_POWER_LIMIT_1 = "permanentActivePowerLimit1" ;
133
133
private static final String PERMANENT_ACTIVE_POWER_LIMIT_2 = "permanentActivePowerLimit2" ;
134
134
private static final String VOLTAGE_REGULATOR_ON = "voltageRegulatorOn" ;
135
- private static final String MIN_MAX_REACIVE_LIMITS = "minMaxReactiveLimits" ;
136
- private static final String REACTIVE_CAPABILITY_CURVE = "reactiveCapabilityCurve" ;
137
135
private static final String REGULATION_TERMINAL = "regulatingTerminal" ;
136
+ private static final String MINQ = "minQ" ;
137
+ private static final String MAXQ = "maxQ" ;
138
138
139
139
public TableMapping getTableMapping (String table ) {
140
140
Objects .requireNonNull (table );
@@ -270,19 +270,21 @@ private void createGeneratorMappings() {
270
270
generatorMappings .addColumnMapping ("targetQ" , new ColumnMapping <>(Double .class , GeneratorAttributes ::getTargetQ , GeneratorAttributes ::setTargetQ ));
271
271
generatorMappings .addColumnMapping ("targetV" , new ColumnMapping <>(Double .class , GeneratorAttributes ::getTargetV , GeneratorAttributes ::setTargetV ));
272
272
generatorMappings .addColumnMapping (RATED_S , new ColumnMapping <>(Double .class , GeneratorAttributes ::getRatedS , GeneratorAttributes ::setRatedS ));
273
- generatorMappings .addColumnMapping (MIN_MAX_REACIVE_LIMITS , new ColumnMapping <>(ReactiveLimitsAttributes .class , ( GeneratorAttributes attributes ) ->
274
- attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? attributes .getReactiveLimits () : null ,
275
- (GeneratorAttributes attributes , ReactiveLimitsAttributes limits ) -> {
276
- if (limits instanceof MinMaxReactiveLimitsAttributes ) {
277
- attributes .setReactiveLimits (limits );
273
+ generatorMappings .addColumnMapping (MINQ , new ColumnMapping <>(Double .class ,
274
+ ( GeneratorAttributes attributes ) -> attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? (( MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()). getMinQ () : null ,
275
+ (GeneratorAttributes attributes , Double value ) -> {
276
+ if (attributes . getReactiveLimits () == null ) {
277
+ attributes .setReactiveLimits (new MinMaxReactiveLimitsAttributes () );
278
278
}
279
+ ((MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()).setMinQ (value );
279
280
}));
280
- generatorMappings .addColumnMapping (REACTIVE_CAPABILITY_CURVE , new ColumnMapping <>(ReactiveLimitsAttributes .class , ( GeneratorAttributes attributes ) ->
281
- attributes .getReactiveLimits () instanceof ReactiveCapabilityCurveAttributes ? attributes .getReactiveLimits () : null ,
282
- (GeneratorAttributes attributes , ReactiveLimitsAttributes limits ) -> {
283
- if (limits instanceof ReactiveCapabilityCurveAttributes ) {
284
- attributes .setReactiveLimits (limits );
281
+ generatorMappings .addColumnMapping (MAXQ , new ColumnMapping <>(Double .class ,
282
+ ( GeneratorAttributes attributes ) -> attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? (( MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()). getMaxQ () : null ,
283
+ (GeneratorAttributes attributes , Double value ) -> {
284
+ if (attributes . getReactiveLimits () == null ) {
285
+ attributes .setReactiveLimits (new MinMaxReactiveLimitsAttributes () );
285
286
}
287
+ ((MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()).setMaxQ (value );
286
288
}));
287
289
generatorMappings .addColumnMapping ("activePowerControl" , new ColumnMapping <>(ActivePowerControlAttributes .class , GeneratorAttributes ::getActivePowerControl , GeneratorAttributes ::setActivePowerControl ));
288
290
generatorMappings .addColumnMapping (REGULATION_TERMINAL , new ColumnMapping <>(TerminalRefAttributes .class , GeneratorAttributes ::getRegulatingTerminal , GeneratorAttributes ::setRegulatingTerminal ));
@@ -402,19 +404,21 @@ private void createBatteryMappings() {
402
404
batteryMappings .addColumnMapping ("p" , new ColumnMapping <>(Double .class , BatteryAttributes ::getP , BatteryAttributes ::setP ));
403
405
batteryMappings .addColumnMapping ("q" , new ColumnMapping <>(Double .class , BatteryAttributes ::getQ , BatteryAttributes ::setQ ));
404
406
batteryMappings .addColumnMapping (FICTITIOUS , new ColumnMapping <>(Boolean .class , BatteryAttributes ::isFictitious , BatteryAttributes ::setFictitious ));
405
- batteryMappings .addColumnMapping (MIN_MAX_REACIVE_LIMITS , new ColumnMapping <>(ReactiveLimitsAttributes .class , ( BatteryAttributes attributes ) ->
406
- attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? attributes .getReactiveLimits () : null ,
407
- (BatteryAttributes attributes , ReactiveLimitsAttributes limits ) -> {
408
- if (limits instanceof MinMaxReactiveLimitsAttributes ) {
409
- attributes .setReactiveLimits (limits );
407
+ batteryMappings .addColumnMapping (MINQ , new ColumnMapping <>(Double .class ,
408
+ ( BatteryAttributes attributes ) -> attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? (( MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()). getMinQ () : null ,
409
+ (BatteryAttributes attributes , Double value ) -> {
410
+ if (attributes . getReactiveLimits () == null ) {
411
+ attributes .setReactiveLimits (new MinMaxReactiveLimitsAttributes () );
410
412
}
413
+ ((MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()).setMinQ (value );
411
414
}));
412
- batteryMappings .addColumnMapping (REACTIVE_CAPABILITY_CURVE , new ColumnMapping <>(ReactiveLimitsAttributes .class , ( BatteryAttributes attributes ) ->
413
- attributes .getReactiveLimits () instanceof ReactiveCapabilityCurveAttributes ? attributes .getReactiveLimits () : null ,
414
- (BatteryAttributes attributes , ReactiveLimitsAttributes limits ) -> {
415
- if (limits instanceof ReactiveCapabilityCurveAttributes ) {
416
- attributes .setReactiveLimits (limits );
415
+ batteryMappings .addColumnMapping (MAXQ , new ColumnMapping <>(Double .class ,
416
+ ( BatteryAttributes attributes ) -> attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? (( MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()). getMaxQ () : null ,
417
+ (BatteryAttributes attributes , Double value ) -> {
418
+ if (attributes . getReactiveLimits () == null ) {
419
+ attributes .setReactiveLimits (new MinMaxReactiveLimitsAttributes () );
417
420
}
421
+ ((MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()).setMaxQ (value );
418
422
}));
419
423
batteryMappings .addColumnMapping ("activePowerControl" , new ColumnMapping <>(ActivePowerControlAttributes .class , BatteryAttributes ::getActivePowerControl , BatteryAttributes ::setActivePowerControl ));
420
424
batteryMappings .addColumnMapping ("node" , new ColumnMapping <>(Integer .class , BatteryAttributes ::getNode , BatteryAttributes ::setNode ));
@@ -559,19 +563,21 @@ private void createVscConverterStationMappings() {
559
563
vscConverterStationMappings .addColumnMapping ("reactivePowerSetPoint" , new ColumnMapping <>(Double .class , VscConverterStationAttributes ::getReactivePowerSetPoint , VscConverterStationAttributes ::setReactivePowerSetPoint ));
560
564
vscConverterStationMappings .addColumnMapping ("voltageSetPoint" , new ColumnMapping <>(Double .class , VscConverterStationAttributes ::getVoltageSetPoint , VscConverterStationAttributes ::setVoltageSetPoint ));
561
565
vscConverterStationMappings .addColumnMapping (FICTITIOUS , new ColumnMapping <>(Boolean .class , VscConverterStationAttributes ::isFictitious , VscConverterStationAttributes ::setFictitious ));
562
- vscConverterStationMappings .addColumnMapping (MIN_MAX_REACIVE_LIMITS , new ColumnMapping <>(ReactiveLimitsAttributes .class , ( VscConverterStationAttributes attributes ) ->
563
- attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? attributes .getReactiveLimits () : null ,
564
- (VscConverterStationAttributes attributes , ReactiveLimitsAttributes limits ) -> {
565
- if (limits instanceof MinMaxReactiveLimitsAttributes ) {
566
- attributes .setReactiveLimits (limits );
566
+ vscConverterStationMappings .addColumnMapping (MINQ , new ColumnMapping <>(Double .class ,
567
+ ( VscConverterStationAttributes attributes ) -> attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? (( MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()). getMinQ () : null ,
568
+ (VscConverterStationAttributes attributes , Double value ) -> {
569
+ if (attributes . getReactiveLimits () == null ) {
570
+ attributes .setReactiveLimits (new MinMaxReactiveLimitsAttributes () );
567
571
}
572
+ ((MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()).setMinQ (value );
568
573
}));
569
- vscConverterStationMappings .addColumnMapping (REACTIVE_CAPABILITY_CURVE , new ColumnMapping <>(ReactiveLimitsAttributes .class , ( VscConverterStationAttributes attributes ) ->
570
- attributes .getReactiveLimits () instanceof ReactiveCapabilityCurveAttributes ? attributes .getReactiveLimits () : null ,
571
- (VscConverterStationAttributes attributes , ReactiveLimitsAttributes limits ) -> {
572
- if (limits instanceof ReactiveCapabilityCurveAttributes ) {
573
- attributes .setReactiveLimits (limits );
574
+ vscConverterStationMappings .addColumnMapping (MAXQ , new ColumnMapping <>(Double .class ,
575
+ ( VscConverterStationAttributes attributes ) -> attributes .getReactiveLimits () instanceof MinMaxReactiveLimitsAttributes ? (( MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()). getMaxQ () : null ,
576
+ (VscConverterStationAttributes attributes , Double value ) -> {
577
+ if (attributes . getReactiveLimits () == null ) {
578
+ attributes .setReactiveLimits (new MinMaxReactiveLimitsAttributes () );
574
579
}
580
+ ((MinMaxReactiveLimitsAttributes ) attributes .getReactiveLimits ()).setMaxQ (value );
575
581
}));
576
582
vscConverterStationMappings .addColumnMapping ("node" , new ColumnMapping <>(Integer .class , VscConverterStationAttributes ::getNode , VscConverterStationAttributes ::setNode ));
577
583
vscConverterStationMappings .addColumnMapping (PROPERTIES , new ColumnMapping <>(Map .class , VscConverterStationAttributes ::getProperties , VscConverterStationAttributes ::setProperties ));
0 commit comments