Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added arduino simulator. #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions plugins/fr.obeo.dsl.arduino.design/description/arduino.odesign
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:tool="http://www.eclipse.org/sirius/diagram/description/tool/1.1.0" xmlns:tool_1="http://www.eclipse.org/sirius/description/tool/1.1.0" name="arduino" version="8.1.0">
<ownedViewpoints name="Hardware Kit" modelFileExtension="arduino">
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="Hardware Kit Definition" domainClass="arduino.Project">
<metamodel href="../../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<metamodel href="viewpoint:/../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<defaultLayer name="Default">
<nodeMappings name="HL_InputModule" labelDirectEdit="//@ownedViewpoints[name='Hardware%20Kit']/@ownedRepresentations[name='Hardware%20Kit%20Definition']/@defaultLayer/@toolSections.0/@ownedTools[name='Edit%20Named%20Element']" domainClass="arduino.InputModule">
<style xsi:type="style:WorkspaceImageDescription" labelFormat="bold" showIcon="false" sizeComputationExpression="6" resizeKind="NSEW" workspacePath="/fr.obeo.dsl.arduino.design/images/digital_input.svg">
Expand Down Expand Up @@ -164,7 +164,7 @@
</ownedViewpoints>
<ownedViewpoints name="Arduino" modelFileExtension="arduino">
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="Hardware" titleExpression="Hardware" domainClass="arduino.Hardware" enablePopupBars="true">
<metamodel href="../../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<metamodel href="viewpoint:/../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<metamodel href="http://www.eclipse.org/sirius/1.1.0#//diagram"/>
<defaultLayer name="Default">
<nodeMappings name="HW_Platform" deletionDescription="//@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Hardware']/@defaultLayer/@toolSections.0/@ownedTools[name='Delete%20Platform']" semanticCandidatesExpression="feature:platforms" domainClass="arduino.Platform">
Expand Down Expand Up @@ -306,7 +306,7 @@
</defaultLayer>
</ownedRepresentations>
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="Dashboard" initialisation="true" domainClass="arduino.Project">
<metamodel href="../../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<metamodel href="viewpoint:/../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<defaultLayer name="Default">
<nodeMappings name="DB_Hardware" semanticCandidatesExpression="var:self" doubleClickDescription="//@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Dashboard']/@defaultLayer/@toolSections.0/@ownedTools[name='DB_Open_Hardware']" synchronizationLock="true" domainClass="arduino.Project">
<style xsi:type="style:WorkspaceImageDescription" labelSize="16" showIcon="false" labelExpression="1" tooltipExpression="Double click to see hardware" sizeComputationExpression="20" workspacePath="/fr.obeo.dsl.arduino.design/images/hardware.svg">
Expand Down Expand Up @@ -400,7 +400,7 @@
</defaultLayer>
</ownedRepresentations>
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="Sketch" titleExpression="Sketch" domainClass="arduino.Sketch" enablePopupBars="true">
<metamodel href="../../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<metamodel href="viewpoint:/../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<defaultLayer name="Default">
<nodeMappings name="SK_Loop" semanticCandidatesExpression="var:self" domainClass="arduino.Sketch">
<style xsi:type="style:WorkspaceImageDescription" labelFormat="italic" showIcon="false" labelExpression="Loop" hideLabelByDefault="true" workspacePath="/fr.obeo.dsl.arduino.design/images/loop.svg">
Expand Down Expand Up @@ -1334,7 +1334,7 @@
</defaultLayer>
</ownedRepresentations>
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="Function" domainClass="arduino.Function" enablePopupBars="true">
<metamodel href="../../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<metamodel href="viewpoint:/../fr.obeo.dsl.arduino/model/arduino.ecore#/"/>
<defaultLayer name="Default" reusedMappings="//@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Sketch']/@defaultLayer/@edgeMappings[name='SK_Link'] //@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Sketch']/@defaultLayer/@edgeMappings[name='SK_LinkMathOperatorLeft'] //@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Sketch']/@defaultLayer/@edgeMappings[name='SK_LinkMathOperatorRight'] //@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Sketch']/@defaultLayer/@edgeMappings[name='SK_LinkSetToValue'] //@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Sketch']/@defaultLayer/@edgeMappings[name='SK_LinkSetToVariable'] //@ownedViewpoints[name='Arduino']/@ownedRepresentations[name='Sketch']/@defaultLayer/@edgeMappings[name='SK_LinkWhileToCondition']">
<nodeMappings name="FU_Parameter_Definition" semanticCandidatesExpression="feature:paramDefs" domainClass="arduino.ParameterDefinition">
<conditionnalStyles predicateExpression="[type=arduino::ParameterType::Delay/]">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="ASCII"?>
<arduino:Project xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:arduino="http://www.obeo.fr/arduino">
<modules xsi:type="arduino:OutputModule" name="White LED" image="dfrobot/led.jpg" level="true"/>
<modules xsi:type="arduino:OutputModule" name="White LED" image="dfrobot/white_led.jpg" level="true"/>
<modules xsi:type="arduino:InputModule" name="Push button 1" image="dfrobot/push_button.jpg"/>
<modules xsi:type="arduino:OutputModule" name="Red LED" image="dfrobot/led.jpg" level="true"/>
<modules xsi:type="arduino:OutputModule" name="Blue LED" image="dfrobot/led.jpg" level="true"/>
<modules xsi:type="arduino:OutputModule" name="Red LED" image="dfrobot/res_led.jpg" level="true"/>
<modules xsi:type="arduino:OutputModule" name="Blue LED" image="dfrobot/blue_led.jpg" level="true"/>
<modules xsi:type="arduino:InputModule" name="Push button 2" image="dfrobot/push_button.jpg"/>
<modules xsi:type="arduino:OutputModule" name="Buzzer" image="dfrobot/buzzer.jpg"/>
<modules xsi:type="arduino:InputModule" name="Rotation sensor V1" kind="analog" image="dfrobot/rotation_sensor_v1.jpg"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package fr.obeo.dsl.arduino.design;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.sirius.ui.business.api.session.IEditingSession;
import org.eclipse.sirius.ui.business.api.session.SessionUIManager;

import fr.obeo.dsl.arduino.Project;

/**
* Utility for arduino designer.
*
* @author <a href="mailto:[email protected]">Yvan Lussaud</a>
*
*/
public final class ArduinoDesignerUtils {

/**
* Constructor.
*/
private ArduinoDesignerUtils() {
// nothing to do here
}

/**
* Gets the opened {@link Project}.
*
* @return the opened {@link Project} if nay, <code>null</code> otherwise
*/
public static Project getOpenedProject() {
Project res = null;

for (IEditingSession session : SessionUIManager.INSTANCE
.getUISessions()) {
for (Resource resource : session.getSession()
.getSemanticResources()) {
for (EObject eObj : resource.getContents()) {
if (eObj instanceof Project
&& eObj.eResource().getURI().isPlatformResource()) {
res = (Project) eObj;
break;
}
}
}
}

return res;
}

}
2 changes: 1 addition & 1 deletion plugins/fr.obeo.dsl.arduino.edit/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
Expand Down
2 changes: 1 addition & 1 deletion plugins/fr.obeo.dsl.arduino.edit/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ bin.includes = .,\
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src/
source.. = src-gen/
output.. = bin/
2 changes: 1 addition & 1 deletion plugins/fr.obeo.dsl.arduino.editor/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
Expand Down
2 changes: 1 addition & 1 deletion plugins/fr.obeo.dsl.arduino.editor/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ bin.includes = .,\
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src/
source.. = src-gen/
output.. = bin
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String getValue(Value value) {
public String getOperator(OperatorKind operator) {
switch (operator) {
case AND:
return "&";
return "&&";
case DIFF:
return "!=";
case DIV:
Expand Down
7 changes: 7 additions & 0 deletions plugins/fr.obeo.dsl.arduino.simulator.design/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
35 changes: 35 additions & 0 deletions plugins/fr.obeo.dsl.arduino.simulator.design/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fr.obeo.dsl.arduino.simulator.design</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.acceleo.ide.ui.acceleoBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.acceleo.ide.ui.acceleoNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
29 changes: 29 additions & 0 deletions plugins/fr.obeo.dsl.arduino.simulator.design/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: fr.obeo.dsl.arduino.simulator.design
Bundle-SymbolicName: fr.obeo.dsl.arduino.simulator.design;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: fr.obeo.dsl.arduino.simulator.design.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.sirius,
org.eclipse.sirius.common.acceleo.mtl,
fr.obeo.dsl.arduino.design;bundle-version="1.0.0",
fr.obeo.dsl.arduino.simulator;bundle-version="1.0.0",
fr.obeo.dsl.debug;bundle-version="1.0.0",
fr.obeo.dsl.debug.ide;bundle-version="1.0.0",
fr.obeo.dsl.debug.ide.ui;bundle-version="1.0.0",
fr.obeo.dsl.debug.ide.sirius.ui;bundle-version="1.0.0",
fr.obeo.dsl.debug.edit;bundle-version="1.0.0",
org.eclipse.debug.core;bundle-version="3.9.1",
org.eclipse.debug.ui;bundle-version="3.10.1",
fr.obeo.dsl.arduino;bundle-version="1.0.0",
fr.obeo.dsl.arduino.edit;bundle-version="1.0.0",
org.eclipse.emf.transaction
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: fr.obeo.dsl.arduino.simulator.design,
fr.obeo.dsl.arduino.simulator.design.action,
fr.obeo.dsl.arduino.simulator.design.launcher,
fr.obeo.dsl.arduino.simulator.design.services
8 changes: 8 additions & 0 deletions plugins/fr.obeo.dsl.arduino.simulator.design/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
description/,\
plugin.xml,\
icons/
customBuildCallbacks = build.acceleo
Loading