Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattsse/plcopen-xml-xcore
The PlcOpen Xml Standard implemented as Xcore model and with full gradle and maven support
https://github.com/mattsse/plcopen-xml-xcore
ecore emf java plcopen xcore
Last synced: 2 months ago
JSON representation
The PlcOpen Xml Standard implemented as Xcore model and with full gradle and maven support
- Host: GitHub
- URL: https://github.com/mattsse/plcopen-xml-xcore
- Owner: mattsse
- License: epl-2.0
- Created: 2018-02-25T18:05:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T09:16:59.000Z (about 4 years ago)
- Last Synced: 2024-10-04T17:45:59.931Z (3 months ago)
- Topics: ecore, emf, java, plcopen, xcore
- Language: Java
- Homepage:
- Size: 125 KB
- Stars: 12
- Watchers: 6
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PlcOpen-Xml Xcore
[![Build Status](https://travis-ci.com/MattsSe/plcopen-xml-xcore.svg?branch=master)](https://travis-ci.com/MattsSe/plcopen-xml-xcore)
Xcore model of the PlcOpen Xml Standard.
## Installation
Clone the repo:
```java
git clone https://github.com/MattsSe/plcopen-xml-xcore
cd plcopen-xml-xcore
```This project comes with automated build support for the xcore model. All Java code will be generated during build using either:
* **maven:** `mvn clean install`
* **gradle:** `./gradlew clean build`## Usage
### Load XML
Parse a PlcOpen XML file
```java
File xmlFile = new new File("path.xml");
PlcOpenSerializer serde = new PlcOpenSerializer();
Resource plcResource = serde.loadXmlResource(xmlFile);```
### Write Xml
Create a model first, thenn save as PlcOpen XML.
```java
// build project
Project project = Tc6021Factory.eInstance.createProject();
...Resource resourceSet = new ResourceSetImpl();
Resource resource = new ResourceImpl();
resourceSet.getResources().add(resource);
resource.getContents().add(project);PlcOpenSerializer serde = new PlcOpenSerializer();
serde.writeXML(resource, "output/plcopen.xml");
```Reading/Writing XMI models using the analogous methods of the `PlcOpenSerializer`.
See [More demos in the `PlcOpenSerializeTest` test.](src/test/java/org/plcopen/xcore/serde/PlcOpenSerializeTest.java)
To Access any components inside the project utilize the EMF API.
## License
Licensed under Eclipse Public License 2.0