use of com.beanit.openiec61850.FcModelNode in project open-smart-grid-platform by OSGP.
the class Iec61850DeviceConnectionService method getModelNode.
private FcModelNode getModelNode(final String logicalDevice, final Iec61850Connection iec61850Connection, final String description) throws ProtocolAdapterException {
final ServerModel serverModel = iec61850Connection.getServerModel();
if (serverModel == null) {
final String msg = String.format("ServerModel is null for logicalDevice {%s}", logicalDevice);
throw new ProtocolAdapterException(msg);
}
final String objRef = description + logicalDevice + "/" + LogicalNode.LOGICAL_NODE_ZERO.getDescription() + "." + DataAttribute.NAME_PLATE.getDescription();
final FcModelNode modelNode = (FcModelNode) serverModel.findModelNode(objRef, Fc.DC);
if (modelNode == null) {
final String msg = String.format("ModelNode is null for {%s}", objRef);
throw new ProtocolAdapterException(msg);
}
return modelNode;
}
use of com.beanit.openiec61850.FcModelNode in project open-smart-grid-platform by OSGP.
the class Iec61850ClientRTUEventListener method processReport.
private void processReport(final Report report, final String reportDescription, final Iec61850ReportHandler reportHandler) throws ProtocolAdapterException {
final List<FcModelNode> dataSetMembers = report.getValues();
if (CollectionUtils.isEmpty(dataSetMembers)) {
this.logger.warn("No dataSet members available for {}", reportDescription);
return;
}
final List<MeasurementDto> measurements = this.processMeasurements(reportHandler, reportDescription, dataSetMembers);
final GetDataSystemIdentifierDto systemResult = reportHandler.createResult(measurements);
final List<GetDataSystemIdentifierDto> systems = new ArrayList<>();
systems.add(systemResult);
final ReportDto reportDto = new ReportDto(report.getSqNum(), new DateTime(report.getTimeOfEntry().getTimestampValue()), report.getRptId());
this.deviceManagementService.sendMeasurements(this.deviceIdentification, new GetDataResponseDto(systems, reportDto));
this.reportingService.storeLastReportEntry(report, this.deviceIdentification);
}
use of com.beanit.openiec61850.FcModelNode in project open-smart-grid-platform by OSGP.
the class Iec61850ClientSSLDEventListener method determineTriggerTypeNode.
private String determineTriggerTypeNode(final FcModelNode evnRpn) {
final BdaInt8U trgTypeNode = (BdaInt8U) evnRpn.getChild(EVENT_NODE_TRIGGER_TYPE);
if (trgTypeNode != null && trgTypeNode.getValue() > 0) {
final short trgType = trgTypeNode.getValue();
final String trigger = TRG_TYPE_DESCRIPTION_PER_CODE.get(trgType);
if (trigger == null) {
return "trgType=" + trgType;
} else {
return trigger;
}
}
return EMPTY;
}
use of com.beanit.openiec61850.FcModelNode in project open-smart-grid-platform by OSGP.
the class Iec61850ClientSSLDEventListener method determineEventTypeNode.
private String determineEventTypeNode(final FcModelNode evnRpn) {
final BdaInt8U evnTypeNode = (BdaInt8U) evnRpn.getChild(EVENT_NODE_EVENT_TYPE);
if (evnTypeNode != null && evnTypeNode.getValue() > 0) {
final short evnType = evnTypeNode.getValue();
final String event = EventType.forCode(evnType).getDescription();
if (event.startsWith("FUNCTION_FIRMWARE")) {
return "functional firmware";
} else if (event.startsWith("SECURITY_FIRMWARE")) {
return "security firmware";
}
}
return EMPTY;
}
use of com.beanit.openiec61850.FcModelNode in project open-smart-grid-platform by OSGP.
the class Iec61850ClientSSLDEventListener method logDataSetMembersDetails.
private void logDataSetMembersDetails(final Report report, final List<FcModelNode> dataSetMembers, final StringBuilder sb) {
if (dataSetMembers == null) {
sb.append("\t DataSet members:\tnull").append(System.lineSeparator());
} else {
sb.append("\t DataSet:\t").append(report.getDataSetRef()).append(System.lineSeparator());
if (!dataSetMembers.isEmpty()) {
sb.append("\t DataSet members:\t").append(dataSetMembers.size()).append(System.lineSeparator());
for (final FcModelNode member : dataSetMembers) {
sb.append("\t member:\t").append(member).append(System.lineSeparator());
this.checkNodeType(member, sb, "CSLC.EvnRpn");
}
}
}
}
Aggregations