Skip to content

Commit

Permalink
#2
Browse files Browse the repository at this point in the history
Initial commit of GPS Watch example
  • Loading branch information
keithbrown committed Dec 5, 2012
1 parent 5c53e94 commit 9e64fff
Show file tree
Hide file tree
Showing 105 changed files with 34,271 additions and 0 deletions.
7 changes: 7 additions & 0 deletions applications/GPS Watch/.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="src" path="javasrc"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/MentorGraphics/BridgePoint/eclipse_extensions/BridgePoint/eclipse/plugins/com.mentor.nucleus.bp.core_3.6.0/core.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
444 changes: 444 additions & 0 deletions applications/GPS Watch/.cproject

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions applications/GPS Watch/.externalToolBuilders/Model Compiler.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${container}"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="MGLS_ATTR_DISPLAY" value="_2484"/>
</mapAttribute>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:/workspace/current/com.mentor.nucleus.bp.mc.c.binary/mc3020/bin/xtumlmc_build.exe"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value=" -home &quot;C:/workspace/current/com.mentor.nucleus.bp.mc.c.binary/&quot; -l3b -e -d code_generation -O ../../src/"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}/gen"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.qvt.oml.QvtBuilderTransformation">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="com.mentor.nucleus.bp.mc.c.binary.export_builder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="com.mentor.nucleus.bp.mc.xmiexport.XMIExportBuilder"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.qvt.oml.QvtBuilderTransformation">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.qvt.oml.QvtBuilderTransformation">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.cdt.managedbuilder.core.genmakebuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS">
<mapEntry key="org.eclipse.cdt.make.core.enableCleanBuild" value="true"/>
<mapEntry key="?name?" value=""/>
<mapEntry key="org.eclipse.cdt.make.core.append_environment" value="true"/>
<mapEntry key="org.eclipse.cdt.make.core.stopOnError" value="true"/>
<mapEntry key="org.eclipse.cdt.make.core.buildCommand" value="make"/>
<mapEntry key="org.eclipse.cdt.make.core.contents" value="org.eclipse.cdt.make.core.activeConfigSettings"/>
<mapEntry key="org.eclipse.cdt.make.core.buildLocation" value="${workspace_loc:/GPS Watch/Debug}"/>
<mapEntry key="org.eclipse.cdt.make.core.useDefaultBuildCmd" value="true"/>
<mapEntry key="org.eclipse.cdt.make.core.enableAutoBuild" value="false"/>
<mapEntry key="org.eclipse.cdt.make.core.enableFullBuild" value="true"/>
<mapEntry key="org.eclipse.cdt.make.core.buildArguments" value=""/>
</mapAttribute>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>
11 changes: 11 additions & 0 deletions applications/GPS Watch/.launches/GPS Watch UI.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/GPS Watch/javasrc/lib/WatchGui.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="lib.WatchGui"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="GPS Watch"/>
</launchConfiguration>
10 changes: 10 additions & 0 deletions applications/GPS Watch/.launches/GPS Watch.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.mentor.nucleus.bp.debug.ui.BPApplication">
<booleanAttribute key="com.mentor.nucleus.bp.debug.ui.BPApplication.activity" value="true"/>
<booleanAttribute key="com.mentor.nucleus.bp.debug.ui.BPApplication.deterministic" value="false"/>
<mapAttribute key="com.mentor.nucleus.bp.debug.ui.BPApplication.models">
<mapEntry key="GPS Watch" value="c77335f2-4175-474d-aa51-f34050086656_INTERNALTOKEN_1_INTERNALTOKEN_None_INTERNALTOKEN_enabled_TOKEN_3984a0e4-a3de-4098-b5c1-d83203889e21_INTERNALTOKEN_1_INTERNALTOKEN_None_INTERNALTOKEN_enabled_TOKEN_24c4c6ef-38db-4499-b7d5-e79f13beda8b_INTERNALTOKEN_1_INTERNALTOKEN_None_INTERNALTOKEN_enabled_TOKEN_6a0cc33b-29d6-416c-9738-4f8b906dc574_INTERNALTOKEN_1_INTERNALTOKEN_None_INTERNALTOKEN_enabled_TOKEN_"/>
</mapAttribute>
<booleanAttribute key="com.mentor.nucleus.bp.debug.ui.BPApplication.simtime" value="false"/>
<intAttribute key="com.mentor.nucleus.bp.debug.ui.BPApplication.timeout" value="0"/>
</launchConfiguration>
74 changes: 74 additions & 0 deletions applications/GPS Watch/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>GPS Watch</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/com.mentor.nucleus.bp.mc.xmiexport.XMIExportBuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/com.mentor.nucleus.bp.mc.c.binary.export_builder.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/Model Compiler.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.mentor.nucleus.bp.core.xtumlnature</nature>
<nature>com.mentor.nucleus.bp.mc.c.binary.MCNature</nature>
<nature>com.mentor.nucleus.bp.mc.xmiexport.XMIExportNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
68 changes: 68 additions & 0 deletions applications/GPS Watch/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
GPS WATCH PROJECT STRUCTURE
----------------------------
The project consists of three executable entities:

1. A Java based GUI
2. A model running in Verifier along with some Java that handles GUI I/O
3. A compiled program resulting from generated code plus some handwritten C that
does the equivalent of the Java code in 2


RUNNING THE PROJECT
--------------------
An execution configuration exists in order to launch the GUI. To create
run the Watch GUI:

* Open the C/C++ Projects perspective (Window > Open Perspective > Other... > C/C++)
* Run > Run Configurations...
* Expand the Java Application item
* Select "GPS Watch UI"
* Click Run

The GUI is designed to allow applications (Verifier sessions and generated code)
to connect interchangeably, meaning there is no need to restart the GUI between
various sessions. When a new connection is detected the GUI will simply drop any
existing connection and only service the recently detected connection.

You can now run either the already generated Windows executable, or run the
model in Verifier.

To run the EXE:
* Expand the Binaries item under the project
* Right-click on "GPS Watch.exe" and choose Open With > System Editor
* The application will connect to the GUI automatically. Click the START/STOP
button on the watch, you will see the watch execute on the GUI and in the
command prompt console. The MODE button causes GUI changes as well.

To run the model in Verifier:
* Switch to the xtUML Debugging Perspective (Window > Open Perspective > Other... > xtUML Debugging)
* Run > Debug Configurations...
* Expand the Model Verifier Application item
* Select "GPS Watch"
* Click Debug
* In Session Explorer, expand GPS Watch > GPS Watch::Library::UI > GPS Watch::Library::UI > UI
* Right-click 'connect', select Execute
* Now the GUI may be used to drive execution.


BUILDING THE PROJECT
---------------------
The project is pre-built so building the project is not necessary. But, there
might be warnings/errors in the project resulting from an unresolved build path.
The Java code that is used to extend Verifier depends on a BridgePoint jar file
called core.jar. To resolve the path to core.jar:

* Open the Java perspective: Window > Open Perspective > Java
* Right-click the project and select Build Path > Configure Build Path...
* In the wizard click the Libraries tab
* Select core.jar and click Edit...
* Locate core.jar:
<BridgePoint installation folder>\eclipse_extensions\BridgePoint\eclipse\plugins\com.mentor.nucleus.bp.core_<version>\core.jar
* OK all pop-ups

If you want to rebuild the project after modifying the model or a marking file:

* Switch to the C/C++ perspective
* Right-click on the project and choose 'Build Project' in the context menu

Have fun!
Loading

0 comments on commit 9e64fff

Please sign in to comment.