Search in sources :

Example 1 with Meter

use of io.openems.impl.controller.thermalpowerstation.Meter in project openems by OpenEMS.

the class ThermalPowerStationTest method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws Exception {
    ess = new UnitTestAsymmetricEssNature("ess0");
    meter = new UnitTestSymmetricMeterNature("meter0");
    controller = new ThermalPowerStationController();
    outputChannel = new UnitTestWriteChannel<>("0", new Thing() {

        @Override
        public String id() {
            return "output0";
        }

        @Override
        public ThingStateChannels getStateChannel() {
            return null;
        }
    });
    essThingMap = new Ess(ess);
    meterThingMap = new Meter(meter);
    controller.ess.updateValue(essThingMap, true);
    List<Meter> meters = new ArrayList<>();
    meters.add(meterThingMap);
    controller.meters.updateValue(meters, true);
    controller.outputChannelOpt = Optional.of(outputChannel);
    controller.productionLimit.updateValue(1000L, true);
    controller.limitTimeRange.updateValue(1L, true);
    controller.minSoc.updateValue(15L, true);
    controller.maxSoc.updateValue(95L, true);
    controller.invertOutput.updateValue(false, true);
}
Also used : Ess(io.openems.impl.controller.thermalpowerstation.Ess) ThermalPowerStationController(io.openems.impl.controller.thermalpowerstation.ThermalPowerStationController) Meter(io.openems.impl.controller.thermalpowerstation.Meter) ArrayList(java.util.ArrayList) UnitTestAsymmetricEssNature(io.openems.test.utils.devicenatures.UnitTestAsymmetricEssNature) UnitTestSymmetricMeterNature(io.openems.test.utils.devicenatures.UnitTestSymmetricMeterNature) Thing(io.openems.api.thing.Thing) BeforeClass(org.junit.BeforeClass)

Aggregations

Thing (io.openems.api.thing.Thing)1 Ess (io.openems.impl.controller.thermalpowerstation.Ess)1 Meter (io.openems.impl.controller.thermalpowerstation.Meter)1 ThermalPowerStationController (io.openems.impl.controller.thermalpowerstation.ThermalPowerStationController)1 UnitTestAsymmetricEssNature (io.openems.test.utils.devicenatures.UnitTestAsymmetricEssNature)1 UnitTestSymmetricMeterNature (io.openems.test.utils.devicenatures.UnitTestSymmetricMeterNature)1 ArrayList (java.util.ArrayList)1 BeforeClass (org.junit.BeforeClass)1