Search in sources :

Example 6 with ObisCodeValues

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues in project open-smart-grid-platform by OSGP.

the class PushSetupAlarmMappingTest method createPushObjectList.

private static List<PushObject> createPushObjectList() {
    final PushObject pushObject = new PushObject();
    final ObisCodeValues obisCode = new ObisCodeValues();
    obisCode.setA((short) PUSH_OBJECT_OBIS_CODE.getA());
    obisCode.setB((short) PUSH_OBJECT_OBIS_CODE.getB());
    obisCode.setC((short) PUSH_OBJECT_OBIS_CODE.getC());
    obisCode.setD((short) PUSH_OBJECT_OBIS_CODE.getD());
    obisCode.setE((short) PUSH_OBJECT_OBIS_CODE.getE());
    obisCode.setF((short) PUSH_OBJECT_OBIS_CODE.getF());
    pushObject.setClassId(PUSH_OBJECT_CLASS_ID);
    pushObject.setLogicalName(obisCode);
    pushObject.setAttributeIndex((byte) PUSH_OBJECT_ATTRIBUTE_ID);
    pushObject.setDataIndex(PUSH_OBJECT_DATA_INDEX);
    return Collections.singletonList(pushObject);
}
Also used : ObisCodeValues(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues) PushObject(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.PushObject)

Example 7 with ObisCodeValues

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues in project open-smart-grid-platform by OSGP.

the class GetSpecificAttributeValueRequestMappingTest method makeRequest.

private GetSpecificAttributeValueRequest makeRequest() {
    final GetSpecificAttributeValueRequest result = new GetSpecificAttributeValueRequest();
    final ObisCodeValues obiscode = new ObisCodeValues();
    obiscode.setA((short) 1);
    result.setObisCode(obiscode);
    result.setDeviceIdentification("12345");
    return result;
}
Also used : ObisCodeValues(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues) GetSpecificAttributeValueRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetSpecificAttributeValueRequest)

Example 8 with ObisCodeValues

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues in project open-smart-grid-platform by OSGP.

the class PushObjectConverter method convertTo.

@Override
public PushObject convertTo(final CosemObjectDefinition source, final Type<PushObject> destinationType, final MappingContext context) {
    if (source == null) {
        return null;
    }
    final ObisCodeValues obisCodeValues = this.mapperFacade.map(source.getLogicalName(), ObisCodeValues.class);
    final PushObject convertedPushObject = new PushObject();
    convertedPushObject.setClassId(source.getClassId());
    convertedPushObject.setLogicalName(obisCodeValues);
    convertedPushObject.setAttributeIndex((byte) source.getAttributeIndex());
    convertedPushObject.setDataIndex(source.getDataIndex());
    return convertedPushObject;
}
Also used : ObisCodeValues(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues) PushObject(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.PushObject)

Example 9 with ObisCodeValues

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues in project open-smart-grid-platform by OSGP.

the class ObisCodeValuesConverter method convertFrom.

@Override
public ObisCodeValues convertFrom(final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ObisCodeValues source, final Type<ObisCodeValues> destinationType, final MappingContext context) {
    final ObisCodeValues result = new ObisCodeValues();
    result.setA((short) (source.getA() & 0xFF));
    result.setB((short) (source.getB() & 0xFF));
    result.setC((short) (source.getC() & 0xFF));
    result.setD((short) (source.getD() & 0xFF));
    result.setE((short) (source.getE() & 0xFF));
    result.setF((short) (source.getF() & 0xFF));
    return result;
}
Also used : ObisCodeValues(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues)

Example 10 with ObisCodeValues

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues in project open-smart-grid-platform by OSGP.

the class SetPushSetupSms method getObisCodeValues.

private ObisCodeValues getObisCodeValues() {
    final ObisCodeValues values = new ObisCodeValues();
    values.setA((short) 0);
    values.setB((short) 2);
    values.setC((short) 25);
    values.setD((short) 9);
    values.setE((short) 0);
    values.setF((short) 255);
    return values;
}
Also used : ObisCodeValues(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues)

Aggregations

ObisCodeValues (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.ObisCodeValues)15 Test (org.junit.jupiter.api.Test)2 PushObject (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.PushObject)2 BigInteger (java.math.BigInteger)1 GetSpecificAttributeValueRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.GetSpecificAttributeValueRequest)1 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)1