Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit 7acc86a5 authored by Jean-Marc Ronck's avatar Jean-Marc Ronck
Browse files

Merge branch 'development' into 'master'

Version 0.1.0

See merge request !1
parents ba1a35b9 46a56b1b
Pipeline #64157 passed with stage
in 6 minutes and 59 seconds
# Project to compose the C&C-visualization with the MontiMath-PrettyPrinter using Hook Points
# 2D Visualization for EmbeddedMontiArcMath
# Version 1 (Integrate Math Code into C&C visualisation)
* this is already working: http://www.se-rwth.de/materials/ema_compiler/ObjectDetectorSVG/detection.objectDetector4.spectralClusterer[3].html
* see visualization project https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/visualisation
* this is what we want to have at the end: http://www.se-rwth.de/materials/ema_compiler/ObjectDetectorSimulink/ObjectDetector/webview.html#slwebview:15/SpectralClusterer:31
* the MontiMath code should be overlapped nicely ;)
<p align="center">
<a>
<img src="https://img.shields.io/badge/Version-0.1.0-blue.svg?longCache=true&style=flat-square"/>
</a>
<a href="https://rwth-aachen.sciebo.de/s/igDWzLpdO5zYHBj/download?path=%2Fshared%2F18.07.20.visualization-emam&files=visualization-emam.zip">
<img src="https://img.shields.io/badge/Download-18.07.20-blue.svg?longCache=true&style=flat-square"/>
</a>
</p>
# Version 2 (Integrate Syntax-Highlighter of EMA and MontiMath)
* the result should be like: http://www.se-rwth.de/materials/ema_compiler/emaCode/ObjectDetector4.htm
* also use hyperlinks to navigate between components
\ No newline at end of file
## Table of Contents
* [**Description**](#description)
* [**Demonstration**](#demonstration)
* [**Command Line Interface**](#command-line-interface)
* [**Requirements**](doc/Requirements.md)
* [**Browser Support**](#browser-support)
* [**License**](#license)
## Description
To be written.
## Demonstration
![](doc/media/videos/VisualizationEMAM.mp4)
[Try it out](https://embeddedmontiarc.github.io/VisualizationEMAM/)
## Command Line Interface
| Short | Long | Description |
| :---: | :---: | :--- |
| -m | --model | Qualified Name of the Main Component Instance. |
| -mp | --modelPath | Path to the package root of the models. |
| -out | --outputPath | Path to the output directory. |
## Browser Support
| ![Google Chrome](doc/media/images/chrome.png) | ![Mozilla Firefox](doc/media/images/firefox.png) | ![Safari](doc/media/images/safari.png) | ![Opera](doc/media/images/opera.png) | ![Microsoft Edge](doc/media/images/edge.png) | ![Internet Explorer](doc/media/images/ie.png) |
| :--------------------: | :--------------------: | :--------------------: | :--------------------: | :--------------------: | :---: |
| 57+ :heavy_check_mark: | 52+ :heavy_check_mark: | 11+ :heavy_check_mark: | 44+ :heavy_check_mark: | 16+ :heavy_check_mark: | :x: |
| ![PC](doc/media/images/pc.png) | ![Smartphones](doc/media/images/smartphone.png) | ![Tablets](doc/media/images/tablet.png) |
| :----------------------: | :---------------------------------------: | :-------------------------------: |
| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
## License
Copyright (C) 2018 SE RWTH.
A concrete license is to be discussed.
\ No newline at end of file
# Version 1 (Integrate Math Code into C&C visualisation)
* this is already working: http://www.se-rwth.de/materials/ema_compiler/ObjectDetectorSVG/detection.objectDetector4.spectralClusterer[3].html
* see visualization project https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/visualisation
* this is what we want to have at the end: http://www.se-rwth.de/materials/ema_compiler/ObjectDetectorSimulink/ObjectDetector/webview.html#slwebview:15/SpectralClusterer:31
* the MontiMath code should be overlapped nicely ;)
# Version 2 (Integrate Syntax-Highlighter of EMA and MontiMath)
* the result should be like: http://www.se-rwth.de/materials/ema_compiler/emaCode/ObjectDetector4.htm
* also use hyperlinks to navigate between components
\ No newline at end of file
......@@ -6,7 +6,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>visualization-emam</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>0.1.0</version>
<properties>
......@@ -22,6 +22,7 @@
<commons-exec.version>1.3</commons-exec.version>
<commons-io.version>2.4</commons-io.version>
<zip4j.version>1.3.2</zip4j.version>
<monticore.version>5.0.0</monticore.version>
<!-- .. Plugins ....................................................... -->
......@@ -104,14 +105,13 @@
<!-- .. MontiCore .................................................... -->
<!-- .. MontiMath .................................................... -->
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>math-pretty-printer</artifactId>
<version>${math-pretty-printer.version}</version>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.version}</version>
</dependency>
<!-- .. MontiMath .................................................... -->
<!-- .. Test Libraries ............................................... -->
<dependency>
......@@ -163,6 +163,31 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>de.monticore.lang.monticar.visualization.emam.application.Application</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Source Jar Configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
......@@ -9,6 +9,7 @@ import de.monticore.lang.monticar.visualization.emam.dependencies.DependenciesMo
import de.monticore.lang.monticar.visualization.emam.events.EventsModule;
import de.monticore.lang.monticar.visualization.emam.events.EventsService;
import de.monticore.lang.monticar.visualization.emam.executables.ExecutablesModule;
import de.monticore.lang.monticar.visualization.emam.generator.GeneratorModule;
import de.monticore.lang.monticar.visualization.emam.models.ModelsModule;
import de.monticore.lang.monticar.visualization.emam.options.OptionsModule;
import de.monticore.lang.monticar.visualization.emam.options.OptionsService;
......@@ -39,7 +40,10 @@ public class Application {
try {
this.configure();
this.prepare();
this.run(args);
if (args.length == 6) this.run(args);
else this.optionsService.printHelp();
this.stop();
} catch (ParseException exception) {
this.optionsService.printHelp();
......@@ -86,7 +90,7 @@ public class Application {
Injector injector = Guice.createInjector(
new ApplicationModule(), new DependenciesModule(), new ExecutablesModule(),
new OptionsModule(), new PathsModule(), new URLModule(), new ModelsModule(),
new EventsModule()
new EventsModule(), new GeneratorModule()
);
Application application = injector.getInstance(Application.class);
......
......@@ -4,6 +4,7 @@ import com.google.inject.AbstractModule;
import com.google.inject.multibindings.Multibinder;
import de.monticore.lang.monticar.visualization.emam.dependencies.DependenciesServiceImpl;
import de.monticore.lang.monticar.visualization.emam.executables.ExecutablesServiceImpl;
import de.monticore.lang.monticar.visualization.emam.generator.HTMLGeneratorImpl;
import de.monticore.lang.monticar.visualization.emam.models.ModelsServiceImpl;
import de.monticore.lang.monticar.visualization.emam.options.OptionsServiceImpl;
import de.monticore.lang.monticar.visualization.emam.paths.PathsServiceImpl;
......@@ -21,5 +22,6 @@ public class ApplicationModule extends AbstractModule {
contributions.addBinding().to(URLServiceImpl.class);
contributions.addBinding().to(PathsServiceImpl.class);
contributions.addBinding().to(ModelsServiceImpl.class);
contributions.addBinding().to(HTMLGeneratorImpl.class);
}
}
......@@ -3,8 +3,14 @@ package de.monticore.lang.monticar.visualization.emam.dependencies;
import com.google.inject.Inject;
import de.monticore.lang.monticar.visualization.emam.paths.PathsServiceImpl;
import de.monticore.lang.monticar.visualization.emam.url.URLService;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Path;
import java.util.logging.Logger;
public class MathPrettyPrinterDependency extends AbstractDependenciesContribution {
......@@ -15,31 +21,49 @@ public class MathPrettyPrinterDependency extends AbstractDependenciesContributio
@Override
public boolean isDownloaded() {
return false;
File mppZIP = this.pathsService.getPathAsFile("math-pretty-printer.zip");
return this.isInstalled() || mppZIP.exists();
}
@Override
public void download() {
public void download() throws IOException {
URL mppURL = this.urlService.getURL("math-pretty-printer.zip");
Path mppZIP = this.pathsService.getPath("math-pretty-printer.zip");
this.logger.info("Downloading \"math-pretty-printer.zip\"...");
FileUtils.copyURLToFile(mppURL, mppZIP.toFile());
}
@Override
public boolean isInstalled() {
return false;
File mppJAR = this.pathsService.getPathAsFile("math-pretty-printer.jar");
return mppJAR.exists();
}
@Override
public void install() {
public void install() throws ZipException {
File mppZIP = this.pathsService.getPathAsFile("math-pretty-printer.zip");
Path projectDirectory = this.pathsService.getPath("visualization-emam");
ZipFile zipFile = new ZipFile(mppZIP);
this.logger.info("Installing \"math-pretty-printer.zip\"...");
zipFile.extractAll(projectDirectory.toString());
}
@Override
public boolean isCleaned() {
return false;
File mppZIP = this.pathsService.getPathAsFile("math-pretty-printer.zip");
return !mppZIP.exists();
}
@Override
public void clean() throws IOException {
File mppZIP = this.pathsService.getPathAsFile("math-pretty-printer.zip");
this.logger.info("Deleting \"math-pretty-printer.zip\"...");
FileUtils.forceDelete(mppZIP);
}
}
package de.monticore.lang.monticar.visualization.emam.executables;
import java.io.IOException;
public interface ExecutablesContribution {
void execute(String[] arguments);
void prepare();
void execute() throws IOException;
}
package de.monticore.lang.monticar.visualization.emam.executables;
public class ExecutablesExecutedEvent {
}
package de.monticore.lang.monticar.visualization.emam.executables;
import java.io.IOException;
public interface ExecutablesService {
void prepare();
void execute() throws IOException;
}
package de.monticore.lang.monticar.visualization.emam.executables;
import com.google.common.eventbus.Subscribe;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import de.monticore.lang.monticar.visualization.emam.application.Application;
import de.monticore.lang.monticar.visualization.emam.application.ApplicationContribution;
import de.monticore.lang.monticar.visualization.emam.events.EventsService;
import de.monticore.lang.monticar.visualization.emam.models.ModelPathVisitedEvent;
import org.apache.commons.cli.ParseException;
import java.io.IOException;
import java.util.Set;
import java.util.logging.Logger;
@Singleton
public class ExecutablesServiceImpl implements ExecutablesService, ApplicationContribution {
protected final Logger logger;
protected final EventsService eventsService;
protected final Set<ExecutablesContribution> contributions;
@Inject
public ExecutablesServiceImpl(Logger logger, EventsService eventsService) {
public ExecutablesServiceImpl(Logger logger, EventsService eventsService,
Set<ExecutablesContribution> contributions) {
this.logger = logger;
this.eventsService = eventsService;
this.contributions = contributions;
}
@Override
public void prepare(Application application) {
this.eventsService.register(this);
}
@Override
public void prepare() {
for (ExecutablesContribution contribution : this.contributions) {
contribution.prepare();
}
}
@Override
public void execute() throws IOException {
for (ExecutablesContribution contribution : this.contributions) {
contribution.execute();
}
}
@Subscribe
public void onModelPathVisited(ModelPathVisitedEvent event) throws ParseException, IOException {
this.prepare();
this.execute();
this.eventsService.post(new ExecutablesExecutedEvent());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment