Search in sources :

Example 1 with RelayMatrixDto

use of com.alliander.osgp.dto.valueobjects.RelayMatrixDto in project Protocol-Adapter-OSLP by OSGP.

the class RelayMatrixConverter method convertFrom.

@Override
public RelayMatrixDto convertFrom(final com.alliander.osgp.oslp.Oslp.RelayMatrix source, final Type<RelayMatrixDto> destinationType, final MappingContext context) {
    final Integer masterRelayIndex = this.mapperFacade.map(source.getMasterRelayIndex(), Integer.class);
    final boolean isMasterRelayOn = source.getMasterRelayOn();
    final List<Integer> indicesOfControlledRelaysOn = this.convertByteStringToListOfIntegers(source.getIndicesOfControlledRelaysOn());
    final List<Integer> indicesOfControlledRelaysOff = this.convertByteStringToListOfIntegers(source.getIndicesOfControlledRelaysOff());
    final RelayMatrixDto relayMatrix = new RelayMatrixDto(masterRelayIndex, isMasterRelayOn);
    relayMatrix.setIndicesOfControlledRelaysOn(indicesOfControlledRelaysOn);
    relayMatrix.setIndicesOfControlledRelaysOff(indicesOfControlledRelaysOff);
    return relayMatrix;
}
Also used : RelayMatrixDto(com.alliander.osgp.dto.valueobjects.RelayMatrixDto)

Aggregations

RelayMatrixDto (com.alliander.osgp.dto.valueobjects.RelayMatrixDto)1