Search in sources :

Example 1 with AdjacentCellInfo

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.AdjacentCellInfo in project open-smart-grid-platform by OSGP.

the class Smr51Profile method gsmGprsDiagnostic.

@Bean
public GsmDiagnostic gsmGprsDiagnostic() {
    final CellInfo cellInfo = new CellInfo(this.gsmDiagnosticCellInfoCellId, this.gsmDiagnosticCellInfoLocationId, this.gsmDiagnosticCellInfoSignalQuality, this.gsmDiagnosticCellInfoBer, this.gsmDiagnosticCellInfoMcc, this.gsmDiagnosticCellInfoMnc, this.gsmDiagnosticCellInfoChannelNumber);
    final List<AdjacentCellInfo> adjacentCellInfos = IntStream.range(0, this.gsmDiagnosticAdjacentCellsCellIds.size()).mapToObj(i -> new AdjacentCellInfo(this.gsmDiagnosticAdjacentCellsCellIds.get(i), this.gsmDiagnosticAdjacentCellsSignalQualities.get(i))).collect(Collectors.toList());
    final CosemDateTime captureTime = new CosemDateTime(this.gsmDiagnosticYear, this.gsmDiagnosticMonth, this.gsmDiagnosticDayOfMonth, this.gsmDiagnosticDayOfWeek, this.gsmDiagnosticHour, this.gsmDiagnosticMinute, this.gsmDiagnosticSecond, this.gsmDiagnosticHundredths, this.gsmDiagnosticDeviation, ClockStatus.clockStatusFrom(this.gsmDiagnosticClockStatus).toArray(new ClockStatus[0]));
    return new GsmDiagnostic("0.0.25.6.0.255", this.gsmDiagnosticOperator, this.gsmDiagnosticStatus, this.gsmDiagnosticCsAttachment, this.gsmDiagnosticPsStatus, cellInfo, adjacentCellInfos, captureTime);
}
Also used : IntStream(java.util.stream.IntStream) MBusClearStatusMask(org.opensmartgridplatform.simulator.protocol.dlms.cosem.MBusClearStatusMask) MBusReadStatus(org.opensmartgridplatform.simulator.protocol.dlms.cosem.MBusReadStatus) Collectors(java.util.stream.Collectors) Profile(org.springframework.context.annotation.Profile) CosemDateTime(org.openmuc.jdlms.datatypes.CosemDateTime) AdjacentCellInfo(org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.AdjacentCellInfo) Value(org.springframework.beans.factory.annotation.Value) Configuration(org.springframework.context.annotation.Configuration) List(java.util.List) Calendar(java.util.Calendar) AuxiliaryEventLog(org.opensmartgridplatform.simulator.protocol.dlms.cosem.AuxiliaryEventLog) CellInfo(org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.CellInfo) Bean(org.springframework.context.annotation.Bean) GsmDiagnostic(org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic) ClockStatus(org.openmuc.jdlms.datatypes.CosemDateTime.ClockStatus) AdjacentCellInfo(org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.AdjacentCellInfo) CellInfo(org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.CellInfo) ClockStatus(org.openmuc.jdlms.datatypes.CosemDateTime.ClockStatus) CosemDateTime(org.openmuc.jdlms.datatypes.CosemDateTime) GsmDiagnostic(org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic) AdjacentCellInfo(org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.AdjacentCellInfo) Bean(org.springframework.context.annotation.Bean)

Aggregations

Calendar (java.util.Calendar)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 IntStream (java.util.stream.IntStream)1 CosemDateTime (org.openmuc.jdlms.datatypes.CosemDateTime)1 ClockStatus (org.openmuc.jdlms.datatypes.CosemDateTime.ClockStatus)1 AuxiliaryEventLog (org.opensmartgridplatform.simulator.protocol.dlms.cosem.AuxiliaryEventLog)1 GsmDiagnostic (org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic)1 AdjacentCellInfo (org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.AdjacentCellInfo)1 CellInfo (org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.CellInfo)1 MBusClearStatusMask (org.opensmartgridplatform.simulator.protocol.dlms.cosem.MBusClearStatusMask)1 MBusReadStatus (org.opensmartgridplatform.simulator.protocol.dlms.cosem.MBusReadStatus)1 Value (org.springframework.beans.factory.annotation.Value)1 Bean (org.springframework.context.annotation.Bean)1 Configuration (org.springframework.context.annotation.Configuration)1 Profile (org.springframework.context.annotation.Profile)1