Skip to content

Commit

Permalink
#27, #33 - Add MATH support for calculating distance. This version has
Browse files Browse the repository at this point in the history
a compile error in UI.java.
  • Loading branch information
John Wolfe committed Jun 13, 2014
1 parent 5efe9b1 commit d1e6d56
Show file tree
Hide file tree
Showing 48 changed files with 755 additions and 686 deletions.
2 changes: 1 addition & 1 deletion applications/gps/GPS Watch/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="src" path="javasrc"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/MentorGraphics/BridgePoint4.1.10release/eclipse_extensions/BridgePoint/eclipse/plugins/com.mentor.nucleus.bp.core_4.1.10/core.jar"/>
<classpathentry kind="lib" path="C:/MGC4110/BridgePoint/eclipse_extensions/BridgePoint/eclipse/plugins/com.mentor.nucleus.bp.core_4.1.10/core.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<?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="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; id=&quot;1349978509510_8&quot; label=&quot;working set&quot; name=&quot;working set&quot;&gt;&#13;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/GPS Watch&quot; type=&quot;4&quot;/&gt;&#13;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="" value="Console"/>
</mapAttribute>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:/MentorGraphics/BP410/eclipse_extensions/BridgePoint/eclipse/plugins/com.mentor.nucleus.bp.mc.c.binary_4.1.10/mc3020/bin/xtumlmc_build.exe"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:/MGC4110/BridgePoint/eclipse_extensions/BridgePoint/eclipse/plugins/com.mentor.nucleus.bp.mc.c.binary_4.1.10/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:/MentorGraphics/BP410/eclipse_extensions/BridgePoint/eclipse/plugins/com.mentor.nucleus.bp.mc.c.binary_4.1.10/&quot; -l3b -e -d code_generation -O ../../src/"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value=" -home &quot;C:/MGC4110/BridgePoint/eclipse_extensions/BridgePoint/eclipse/plugins/com.mentor.nucleus.bp.mc.c.binary_4.1.10/&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"/>
<mapAttribute key="org.eclipse.debug.core.environmentVariables"><mapEntry value="Console"/></mapAttribute></launchConfiguration>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.qvt.oml.QvtBuilderTransformation">
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<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"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.qvt.oml.QvtBuilderTransformation">
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<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"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2m.qvt.oml.QvtBuilderTransformation">
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<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.buildArguments" value=""/>
<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.contents" value="org.eclipse.cdt.make.core.activeConfigSettings"/>
<mapEntry key="org.eclipse.cdt.make.core.enableAutoBuild" value="false"/>
<mapEntry key="org.eclipse.cdt.make.core.enableCleanBuild" value="true"/>
<mapEntry key="org.eclipse.cdt.make.core.enableFullBuild" value="true"/>
<mapEntry key="org.eclipse.cdt.make.core.buildArguments" value=""/>
<mapEntry key="org.eclipse.cdt.make.core.stopOnError" value="true"/>
<mapEntry key="org.eclipse.cdt.make.core.useDefaultBuildCmd" value="true"/>
</mapAttribute>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>
62 changes: 16 additions & 46 deletions applications/gps/GPS Watch/.project
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
</projects>
<buildSpec>
<buildCommand>
<name>com.mentor.nucleus.bp.mc.c.binary.export_builder</name>
<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>
Expand All @@ -21,52 +26,12 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/GPS Watch/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
Expand All @@ -76,8 +41,13 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<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>
Expand Down
Binary file modified applications/gps/GPS Watch/Debug/GPSWatch.exe
Binary file not shown.
Binary file not shown.
Binary file modified applications/gps/GPS Watch/bin/lib/WatchGui$ButtonListener.class
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- BP 7.1 content: Component syschar: 3 persistence-version: 7.1.6
-- BP 7.1.6 content: Component syschar: 3 persistence-version: 7.1.6

INSERT INTO C_C
VALUES ("2a5126a3-4272-42f2-810c-07c57c5a58d1",
Expand Down Expand Up @@ -393,7 +393,12 @@ INSERT INTO SPR_PO
VALUES ("409338b4-1ff4-4ce9-893d-a58f09bbf50d",
'getDistance',
'',
'return param.fromLocation.longitude + param.toLocation.latitude;',
'// Return the straight-line distance between the two points passed as parameters.

deltaLat = param.toLocation.latitude - param.fromLocation.latitude;
deltaLong = param.toLocation.longitude - param.fromLocation.longitude;
sumSquares = (deltaLat * deltaLat) + (deltaLong * deltaLong);
return ( MATH::sqrt( x: sumSquares ) );',
1);
INSERT INTO C_EP_PROXY
VALUES ("dea2904d-4d56-4426-a11d-768d3893878f",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,30 @@ INSERT INTO DIM_ELE
VALUES ("ed2378f9-f7d2-456a-893c-8bf0e1ad7b86",
0,
"00000000-0000-0000-0000-000000000000");
INSERT INTO GD_GE
VALUES ("1daba071-19f6-4afe-a4ce-654ea86289b0",
"d77faeb8-2de2-4db0-8c70-2c24abd0a775",
"7b1471bf-ad62-4d6f-8b08-7bffc665e35e",
12,
0,
'GPS Watch::Shared EEs::Math');
INSERT INTO GD_SHP
VALUES ("1daba071-19f6-4afe-a4ce-654ea86289b0");
INSERT INTO GD_NCS
VALUES ("1daba071-19f6-4afe-a4ce-654ea86289b0");
INSERT INTO DIM_ND
VALUES (200.000000,
150.000000,
"1daba071-19f6-4afe-a4ce-654ea86289b0");
INSERT INTO DIM_GE
VALUES (660.000000,
0.000000,
"1daba071-19f6-4afe-a4ce-654ea86289b0",
"00000000-0000-0000-0000-000000000000");
INSERT INTO DIM_ELE
VALUES ("1daba071-19f6-4afe-a4ce-654ea86289b0",
0,
"00000000-0000-0000-0000-000000000000");
INSERT INTO DIM_DIA
VALUES ("d77faeb8-2de2-4db0-8c70-2c24abd0a775",
'',
Expand Down Expand Up @@ -682,6 +706,40 @@ INSERT INTO PE_PE
"17c3020a-fcc0-4d49-8947-26d397cdf2f0",
"00000000-0000-0000-0000-000000000000",
5);
INSERT INTO S_EE
VALUES ("7b1471bf-ad62-4d6f-8b08-7bffc665e35e",
'Math',
'',
'MATH',
"00000000-0000-0000-0000-000000000000",
'',
'Math',
1);
INSERT INTO S_BRG
VALUES ("9f5d7119-2d9e-42c5-942c-aad594e31285",
"7b1471bf-ad62-4d6f-8b08-7bffc665e35e",
'sqrt',
'',
0,
"ba5eda7a-def5-0000-0000-000000000003",
'',
3,
'');
INSERT INTO S_BPARM
VALUES ("a996ed4d-bbde-4282-94b9-8777dc1e576b",
"9f5d7119-2d9e-42c5-942c-aad594e31285",
'x',
"ba5eda7a-def5-0000-0000-000000000003",
0,
'',
"00000000-0000-0000-0000-000000000000",
'');
INSERT INTO PE_PE
VALUES ("7b1471bf-ad62-4d6f-8b08-7bffc665e35e",
1,
"17c3020a-fcc0-4d49-8947-26d397cdf2f0",
"00000000-0000-0000-0000-000000000000",
5);
INSERT INTO PE_PE
VALUES ("17c3020a-fcc0-4d49-8947-26d397cdf2f0",
1,
Expand Down
8 changes: 4 additions & 4 deletions applications/gps/GPS Watch/src/GPSWatch_sys_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*--------------------------------------------------------------------------*/

#include "GPSWatch_sys_types.h"
#include "HeartRateMonitor_classes.h"
#include "Location_classes.h"
#include "Tracking_classes.h"
#include "UI_classes.h"
#include "Location_classes.h"
#include "HeartRateMonitor_classes.h"

/*
* Run application level initialization by initializing the
Expand Down Expand Up @@ -52,10 +52,10 @@ main( int argc, char ** argv )
InitializeOoaEventPool();
ApplicationLevelInitialization();
UserPreOoaInitializationCallout();
HeartRateMonitor_execute_initialization();
Location_execute_initialization();
Tracking_execute_initialization();
UI_execute_initialization();
Location_execute_initialization();
HeartRateMonitor_execute_initialization();
UserPostOoaInitializationCallout();
Escher_xtUML_run(); /* This is the primary event dispatch loop. */
UserPreShutdownCallout();
Expand Down
25 changes: 12 additions & 13 deletions applications/gps/GPS Watch/src/GPSWatch_sys_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* System ID: 1
* Model Compiler Product Information:
* Product:
* Version:
* S/N:
* System default/colored values:
* MaxStringLen: 32
* MaxObjExtent: 0
Expand All @@ -27,9 +25,9 @@
* PersistInstanceCacheDepth: 128
* PersistLinkCacheDepth: 128
*
* Component Name: HeartRateMonitor
* MaxObjExtent: 200
* MaxRelExtent: 0
* Component Name: Tracking
* MaxObjExtent: 1400
* MaxRelExtent: 400
* MaxSelectExtent: 200
* MaxSelfEvents: 2
* MaxNonSelfEvents: 5
Expand All @@ -41,8 +39,8 @@
* InterleavedDataSize: 8
* CollectionsFlavor: 0
*
* Component Name: Location
* MaxObjExtent: 200
* Component Name: UI
* MaxObjExtent: 400
* MaxRelExtent: 0
* MaxSelectExtent: 200
* MaxSelfEvents: 2
Expand All @@ -55,9 +53,9 @@
* InterleavedDataSize: 8
* CollectionsFlavor: 0
*
* Component Name: Tracking
* MaxObjExtent: 1200
* MaxRelExtent: 400
* Component Name: Location
* MaxObjExtent: 200
* MaxRelExtent: 0
* MaxSelectExtent: 200
* MaxSelfEvents: 2
* MaxNonSelfEvents: 5
Expand All @@ -69,8 +67,8 @@
* InterleavedDataSize: 8
* CollectionsFlavor: 0
*
* Component Name: UI
* MaxObjExtent: 400
* Component Name: HeartRateMonitor
* MaxObjExtent: 200
* MaxRelExtent: 0
* MaxSelectExtent: 200
* MaxSelfEvents: 2
Expand Down Expand Up @@ -151,13 +149,14 @@ typedef unsigned long u4_t;
typedef double r_t;
typedef float r4_t;
typedef double r8_t;
typedef /*size_t*/ u4_t Escher_size_t;

/*
* These are some of the fundamental types used universally.
*/
typedef u1_t Escher_DomainNumber_t;
typedef u2_t Escher_ClassNumber_t;
typedef u2_t Escher_ClassSize_t;
typedef Escher_size_t Escher_ClassSize_t;
typedef u2_t Escher_InstanceIndex_t;
typedef u1_t Escher_StateNumber_t;
typedef u1_t Escher_EventNumber_t;
Expand Down
8 changes: 4 additions & 4 deletions applications/gps/GPS Watch/src/HeartRateMonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@

#include "GPSWatch_sys_types.h"
#include "HeartRateMonitor.h"
#include "LOG_bridge.h"
#include "MATH_bridge.h"
#include "TIM_bridge.h"
#include "LOG_bridge.h"
#include "Tracking.h"
#include "HeartRateMonitor_classes.h"

/*
Expand All @@ -22,7 +24,7 @@
* From Provider Message: heartRateChanged
*/
void
HeartRateMonitor_HR_heartRateChanged( const r_t p_heartRate)
HeartRateMonitor_HR_heartRateChanged( const i_t p_heartRate )
{
Tracking_HR_heartRateChanged( p_heartRate );
}
Expand Down Expand Up @@ -59,13 +61,11 @@ HeartRateMonitor_HR_unregisterListener()
* UML Domain Functions (Synchronous Services)
*/

#if HeartRateMonitor_MAX_CLASS_NUMBERS > 0
/* xtUML class info (collections, sizes, etc.) */
Escher_Extent_t * const HeartRateMonitor_class_info[ HeartRateMonitor_MAX_CLASS_NUMBERS ] = {
&pG_HeartRateMonitor_HeartRateMonitor_extent,
0
};
#endif

/*
* Array of pointers to the class event dispatcher method.
Expand Down
2 changes: 1 addition & 1 deletion applications/gps/GPS Watch/src/HeartRateMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Simulates a pulse monitor hardware/firmware. This component is only behavioral a
*/

#include "GPSWatch_sys_types.h"
void HeartRateMonitor_HR_heartRateChanged( const r_t );
void HeartRateMonitor_HR_heartRateChanged( const i_t );
void HeartRateMonitor_HR_registerListener( void );
void HeartRateMonitor_HR_unregisterListener( void );

Expand Down
Loading

0 comments on commit d1e6d56

Please sign in to comment.