SmartGridready / SGrJava

SmartGridready communication handler in Java
0 stars 0 forks source link

SGrJava

Index

Summary
Description
Build and publish for development
Build and publish a release
Generate emfEI4Modbus classes

Summary

SGrJava is home for the SmartgridReady core components, the communication handler implementations. Current list of communication handlers:

A communication handler maps the SmartgridReady generic interface to a device/product specific interface. The interface mapping is defined within an external interface description in XML. (see https://github.com/SmartgridReady/SGrSpecifications/tree/master/XMLInstances/ExtInterfaces)

The external interface description XML describes for every functionalprofile-datapoint tuple the properties needed to read/write date from/to the datapoint.

Description

SGrJava conists of two subprojects:

Commhandler4Modbus

Commhandler4Modbus is the realization of the commmunication-handler for modbus RTU and TCP. It depends in emfEI4Modbus, that provides the classes needed to load XML device descriptions. The basic implementation class is SGrDevice, that implements all the generic interface methods to access an SGr compliant device.

emfEI4Modbus

emfEI4Modbus provides the Java-XML binding of XML device descriptions. The classes can be generated from an XML-Schema that provides the model for the device descriptions. Eclipse EMF (Eclipse Modeling Framework) tools are then used to generate the generate Java classes. For details see Generate emfEI4Modbus classes.

Build and publish for development

Prerequisites

Rem: You can use a different IDE such as IntelliJ, however Eclipse must be additionally installed to allow automatic code-generation using Eclipse EMF.

Configure gradle.propertiesS

The project relies on automatic code generation using Eclipse EMF and Gradle. Gradle needs to know the location your Eclipse installation and the root XSD-file of the SGrSpecification. Edit your gradle.properties file and add the new entries as follows. By default, the gradle.properties file can be found on:

New entries to add:

xsd2java.eclipse.home=<<path to your Eclipse installation where exlipse.exe resides>>
xsd2java.xsd.resource=<<your SGrSpecifications root folder>>/SchemaDatabase/SGr/SGrIncluder.xsd

Example:

xsd2java.eclipse.home=c:/java/eclipse-2020-12
xsd2java.xsd.resource=c:/dev/SGrSpecifications/SchemaDatabase/SGr/SGrIncluder.xsd

Run the gradle build and publish to the local maven repository

When using an IDE (Intellij/Eclipse) you can also use the IDE's Gradle integration to run 'publishToMavenLocal'. The steps above will compile, build the library jar and publish the library to the local maven repository.

Build and publish a release

Manually creating the emfEI4Modbus classes after XML-Schema updates (deprecated)

The code for the emfEI4Modbus classes is now automatically generated by the Gradle build as soon as the XML-Schema changes.
Additionally you can generate the classes manually from the Eclipse IDE if needed. This section describes how to generate the classes manually from the Eclipse menu: