Example usage for org.joda.time DateTime DateTime

List of usage examples for org.joda.time DateTime DateTime

Introduction

In this page you can find the example usage for org.joda.time DateTime DateTime.

Prototype

public DateTime(Object instant, Chronology chronology) 

Source Link

Document

Constructs an instance from an Object that represents a datetime, using the specified chronology.

Usage

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850MinimumActualPowerCommand.java

License:Open Source License

@Override
public MeasurementDto translate(final NodeContainer containingNode) {
    return new MeasurementDto(1, DataAttribute.MIN_ACTUAL_POWER.getDescription(),
            QualityConverter.toShort(containingNode.getQuality(SubDataAttribute.QUALITY).getValue()),
            new DateTime(containingNode.getDate(SubDataAttribute.TIME), DateTimeZone.UTC),
            containingNode.getChild(SubDataAttribute.MAGNITUDE).getFloat(SubDataAttribute.FLOAT).getFloat());
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850ModeCommand.java

License:Open Source License

@Override
public MeasurementDto translate(final NodeContainer containingNode) {
    return new MeasurementDto(1, DataAttribute.MODE.getDescription(),
            QualityConverter.toShort(containingNode.getQuality(SubDataAttribute.QUALITY).getValue()),
            new DateTime(containingNode.getDate(SubDataAttribute.TIME), DateTimeZone.UTC),
            containingNode.getByte(SubDataAttribute.STATE).getValue());
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850OperationalHoursCommand.java

License:Open Source License

@Override
public MeasurementDto translate(final NodeContainer containingNode) {
    return new MeasurementDto(1, DataAttribute.OPERATIONAL_HOURS.getDescription(),
            QualityConverter.toShort(containingNode.getQuality(SubDataAttribute.QUALITY).getValue()),
            new DateTime(containingNode.getDate(SubDataAttribute.TIME), DateTimeZone.UTC),
            containingNode.getInteger(SubDataAttribute.STATE).getValue());
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850StateCommand.java

License:Open Source License

@Override
public MeasurementDto translate(final NodeContainer containingNode) {
    return new MeasurementDto(1, DataAttribute.STATE.getDescription(),
            QualityConverter.toShort(containingNode.getQuality(SubDataAttribute.QUALITY).getValue()),
            new DateTime(containingNode.getDate(SubDataAttribute.TIME), DateTimeZone.UTC),
            containingNode.getByte(SubDataAttribute.STATE).getValue());
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850StateOfChargeCommand.java

License:Open Source License

@Override
public MeasurementDto translate(final NodeContainer containingNode) {
    return new MeasurementDto(1, DataAttribute.STATE_OF_CHARGE.getDescription(),
            QualityConverter.toShort(containingNode.getQuality(SubDataAttribute.QUALITY).getValue()),
            new DateTime(containingNode.getDate(SubDataAttribute.TIME), DateTimeZone.UTC),
            containingNode.getChild(SubDataAttribute.MAGNITUDE).getFloat(SubDataAttribute.FLOAT).getFloat());
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850TotalEnergyCommand.java

License:Open Source License

@Override
public MeasurementDto translate(final NodeContainer containingNode) {
    return new MeasurementDto(1, DataAttribute.TOTAL_ENERGY.getDescription(),
            QualityConverter.toShort(containingNode.getQuality(SubDataAttribute.QUALITY).getValue()),
            new DateTime(containingNode.getDate(SubDataAttribute.TIME), DateTimeZone.UTC),
            containingNode.getChild(SubDataAttribute.MAGNITUDE).getFloat(SubDataAttribute.FLOAT).getFloat());
}