Skip to content

Commit

Permalink
#27, #33 - Tracking component now obtains location data synchronously
Browse files Browse the repository at this point in the history
with each tick of the workout timer.  However, there is still a bit of
jitter in the time stamps on track points.
  • Loading branch information
John Wolfe committed Jun 17, 2014
1 parent b260b48 commit f2fee8f
Show file tree
Hide file tree
Showing 13 changed files with 354 additions and 885 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,23 +311,6 @@ INSERT INTO C_P
'Unnamed Interface',
'',
'Location::LOC::LocationProvider');
INSERT INTO SPR_PEP
VALUES ("cf211cfa-7c9b-483f-b703-e845a95639d6",
"c85ccd2f-994b-4dac-99c9-6e4b96e73d3d",
"f5aac2f0-f369-43f5-9c93-082599586590");
INSERT INTO SPR_PS
VALUES ("cf211cfa-7c9b-483f-b703-e845a95639d6",
'locationUpdate',
'',
'',
1);
INSERT INTO C_EP_PROXY
VALUES ("c85ccd2f-994b-4dac-99c9-6e4b96e73d3d",
"de38d4b0-e70e-49ee-a5b9-590645243ae5",
-1,
'locationUpdate',
'',
'../../LocationInterfaces/LocationProvider/LocationProvider.xtuml');
INSERT INTO SPR_PEP
VALUES ("55d56674-a44b-4b05-8204-464a33fc6490",
"9ddd9205-9116-4aff-b118-91037de23593",
Expand Down Expand Up @@ -362,6 +345,28 @@ INSERT INTO C_EP_PROXY
'unregisterListener',
'',
'../../LocationInterfaces/LocationProvider/LocationProvider.xtuml');
INSERT INTO SPR_PEP
VALUES ("3b51d452-6b02-4bcf-bc83-8fccc1fa18a9",
"244d2b45-5908-40ff-99d3-a37dc791609a",
"f5aac2f0-f369-43f5-9c93-082599586590");
INSERT INTO SPR_PO
VALUES ("3b51d452-6b02-4bcf-bc83-8fccc1fa18a9",
'getLocation',
'',
'// Return, via reference arguments, the current position of the singleton
// instance of the simulated GPS.

select any gps from instances of GPS;
param.latitude = gps.currentLatitude;
param.longitude = gps.currentLongitude;',
1);
INSERT INTO C_EP_PROXY
VALUES ("244d2b45-5908-40ff-99d3-a37dc791609a",
"de38d4b0-e70e-49ee-a5b9-590645243ae5",
-1,
'getLocation',
'',
'../../LocationInterfaces/LocationProvider/LocationProvider.xtuml');
INSERT INTO C_I_PROXY
VALUES ("de38d4b0-e70e-49ee-a5b9-590645243ae5",
"00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ INSERT INTO SM_ACT
select any gps from instances of GPS;
gps.currentLongitude = gps.currentLongitude + longitudeIncrement;
gps.currentLatitude = gps.currentLatitude + latitudeIncrement;

// Send the new location out through the port.
send LocationProvider::locationUpdate( latitude: gps.currentLatitude, longitude: gps.currentLongitude );
',
'');
INSERT INTO SM_TAH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ INSERT INTO O_OBJ
'GPS',
1,
'GPS',
'',
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000",
'Simulates a GPS.',
"00000000-0000-0000-0000-000000000000");
INSERT INTO O_NBATTR
VALUES ("a7624bef-089d-40e2-9e32-c7762a24111c",
Expand Down Expand Up @@ -38,7 +36,7 @@ INSERT INTO O_ATTR
"0679851b-cc52-42de-bb1e-f7d26a404f38",
"00000000-0000-0000-0000-000000000000",
'currentLatitude',
'',
'Current latitude, expressed in decimal degrees, of the simulated GPS.',
'',
'currentLatitude',
0,
Expand All @@ -56,7 +54,7 @@ INSERT INTO O_ATTR
"0679851b-cc52-42de-bb1e-f7d26a404f38",
"89922d9d-dc0d-48d2-9b3b-64ad81cbabc7",
'currentLongitude',
'',
'Current longitude, expressed in decimal degrees, of the simulated GPS.',
'',
'currentLongitude',
0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- BP 7.1 content: Package syschar: 3 persistence-version: 7.1.6
-- BP 7.1.6 content: Package syschar: 3 persistence-version: 7.1.6

INSERT INTO EP_PKG
VALUES ("7501c561-d515-4ee0-9d06-282c52269a7f",
Expand All @@ -21,10 +21,10 @@ INSERT INTO GD_MD
1,
0,
0,
200,
150,
0,
0,
0,
'',
'4.1.12',
'GPS Watch::Library::Location::Location');
INSERT INTO GD_GE
VALUES ("7785dee5-b8c0-4d4c-be29-7f805f4d2541",
Expand All @@ -50,13 +50,132 @@ INSERT INTO DIM_ELE
VALUES ("7785dee5-b8c0-4d4c-be29-7f805f4d2541",
0,
"00000000-0000-0000-0000-000000000000");
INSERT INTO GD_GE
VALUES ("9e08ff6a-7088-49f6-916c-7f35f8751f98",
"e632c2f7-b1cd-4da2-b80b-d19effa216e0",
"291a1bdd-8306-4028-86cd-35d0f4a56a24",
109,
0,
'GPS Watch::Library::Location::Location::simulatedGPS');
INSERT INTO GD_SHP
VALUES ("9e08ff6a-7088-49f6-916c-7f35f8751f98");
INSERT INTO GD_NCS
VALUES ("9e08ff6a-7088-49f6-916c-7f35f8751f98");
INSERT INTO DIM_ND
VALUES (200.000000,
150.000000,
"9e08ff6a-7088-49f6-916c-7f35f8751f98");
INSERT INTO DIM_GE
VALUES (4536.000000,
3132.000000,
"9e08ff6a-7088-49f6-916c-7f35f8751f98",
"00000000-0000-0000-0000-000000000000");
INSERT INTO DIM_ELE
VALUES ("9e08ff6a-7088-49f6-916c-7f35f8751f98",
0,
"00000000-0000-0000-0000-000000000000");
INSERT INTO DIM_DIA
VALUES ("e632c2f7-b1cd-4da2-b80b-d19effa216e0",
'',
1.000000,
4000.000000,
3048.000000,
"00000000-0000-0000-0000-000000000000");
INSERT INTO CNST_CSP
VALUES ("291a1bdd-8306-4028-86cd-35d0f4a56a24",
'simulatedGPS',
'Constants specifying the behavior of the simulated GPS.

initialLatitude and initialLongitude specify, as decimal degrees,
the initial location of the simulated GPS.

latitudeIncrement and longitudeIncrement specify, as decimal degrees,
the distance the simulated GPS moves during each update period.

updatePeriod specifies, in microseconds, the update period for the
simulated GPS. In other words, the simulated GPS updates its location
once per updatePeriod.');
INSERT INTO CNST_SYC
VALUES ("17428465-2629-4802-ba94-b302daa48033",
'longitudeIncrement',
'',
"ba5eda7a-def5-0000-0000-000000000003",
"291a1bdd-8306-4028-86cd-35d0f4a56a24",
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000");
INSERT INTO CNST_LFSC
VALUES ("17428465-2629-4802-ba94-b302daa48033",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LSC
VALUES ("17428465-2629-4802-ba94-b302daa48033",
"ba5eda7a-def5-0000-0000-000000000003",
'0.00002');
INSERT INTO CNST_SYC
VALUES ("60539beb-075a-4695-8dbd-9f735ffecafd",
'latitudeIncrement',
'',
"ba5eda7a-def5-0000-0000-000000000003",
"291a1bdd-8306-4028-86cd-35d0f4a56a24",
"17428465-2629-4802-ba94-b302daa48033",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LFSC
VALUES ("60539beb-075a-4695-8dbd-9f735ffecafd",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LSC
VALUES ("60539beb-075a-4695-8dbd-9f735ffecafd",
"ba5eda7a-def5-0000-0000-000000000003",
'0.00001');
INSERT INTO CNST_SYC
VALUES ("2415bfeb-ef6c-4d7e-85ce-7649d6212f04",
'initialLatitude',
'',
"ba5eda7a-def5-0000-0000-000000000003",
"291a1bdd-8306-4028-86cd-35d0f4a56a24",
"60539beb-075a-4695-8dbd-9f735ffecafd",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LFSC
VALUES ("2415bfeb-ef6c-4d7e-85ce-7649d6212f04",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LSC
VALUES ("2415bfeb-ef6c-4d7e-85ce-7649d6212f04",
"ba5eda7a-def5-0000-0000-000000000003",
'32.432237');
INSERT INTO CNST_SYC
VALUES ("4912159d-3471-4a8c-9d31-c5826d1e4b90",
'initialLongitude',
'',
"ba5eda7a-def5-0000-0000-000000000003",
"291a1bdd-8306-4028-86cd-35d0f4a56a24",
"2415bfeb-ef6c-4d7e-85ce-7649d6212f04",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LFSC
VALUES ("4912159d-3471-4a8c-9d31-c5826d1e4b90",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LSC
VALUES ("4912159d-3471-4a8c-9d31-c5826d1e4b90",
"ba5eda7a-def5-0000-0000-000000000003",
'-110.812283');
INSERT INTO CNST_SYC
VALUES ("3d086599-14c3-4e36-af45-84aa22121b91",
'updatePeriod',
'',
"ba5eda7a-def5-0000-0000-000000000002",
"291a1bdd-8306-4028-86cd-35d0f4a56a24",
"4912159d-3471-4a8c-9d31-c5826d1e4b90",
"ba5eda7a-def5-0000-0000-000000000003");
INSERT INTO CNST_LFSC
VALUES ("3d086599-14c3-4e36-af45-84aa22121b91",
"ba5eda7a-def5-0000-0000-000000000002");
INSERT INTO CNST_LSC
VALUES ("3d086599-14c3-4e36-af45-84aa22121b91",
"ba5eda7a-def5-0000-0000-000000000002",
'500000');
INSERT INTO PE_PE
VALUES ("291a1bdd-8306-4028-86cd-35d0f4a56a24",
1,
"7501c561-d515-4ee0-9d06-282c52269a7f",
"00000000-0000-0000-0000-000000000000",
10);
INSERT INTO PE_PE
VALUES ("7501c561-d515-4ee0-9d06-282c52269a7f",
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ INSERT INTO GD_MD
1,
0,
0,
0,
0,
200,
150,
0,
'',
'GPS Watch::Library::Tracking');
Expand Down Expand Up @@ -499,6 +499,30 @@ INSERT INTO DIM_ELE
VALUES ("d8677561-de3d-426c-bcce-92e25ff4e087",
0,
"1f51b134-2b1d-4529-91cb-a5458f99aff4");
INSERT INTO GD_GE
VALUES ("f9c3ec82-219d-4f4c-86e6-14892d5f2124",
"af703f34-a5d6-467e-ad32-c2fc2af9ed45",
"37e62abd-d1c2-4241-a4cb-9aa88fabd6e8",
108,
0,
'GPS Watch::Library::Tracking::TrackingDataTypes');
INSERT INTO GD_SHP
VALUES ("f9c3ec82-219d-4f4c-86e6-14892d5f2124");
INSERT INTO GD_NCS
VALUES ("f9c3ec82-219d-4f4c-86e6-14892d5f2124");
INSERT INTO DIM_ND
VALUES (200.000000,
150.000000,
"f9c3ec82-219d-4f4c-86e6-14892d5f2124");
INSERT INTO DIM_GE
VALUES (2240.000000,
1344.000000,
"f9c3ec82-219d-4f4c-86e6-14892d5f2124",
"00000000-0000-0000-0000-000000000000");
INSERT INTO DIM_ELE
VALUES ("f9c3ec82-219d-4f4c-86e6-14892d5f2124",
0,
"1f51b134-2b1d-4529-91cb-a5458f99aff4");
INSERT INTO DIM_DIA
VALUES ("af703f34-a5d6-467e-ad32-c2fc2af9ed45",
'',
Expand All @@ -523,34 +547,6 @@ INSERT INTO C_R
'',
'Unnamed Interface',
'Tracking::LOC::LocationProvider');
INSERT INTO SPR_REP
VALUES ("6ad4a18f-34d4-4d38-b701-6d95cc9cb6b3",
"c85ccd2f-994b-4dac-99c9-6e4b96e73d3d",
"b945d9de-e8b2-4a09-8727-391d7b0799a6");
INSERT INTO SPR_RS
VALUES ("6ad4a18f-34d4-4d38-b701-6d95cc9cb6b3",
'locationUpdate',
'',
'// Log the newly received location data.
LOG::LogInfo(message: "location updated: ");
LOG::LogReal(message: "longitude", r: param.longitude);
LOG::LogReal(message: "latitude", r: param.latitude );

// Add a track point to track log related to the singleton instance of
// the workout session.
select any session from instances of WorkoutSession;
if ( not empty session )
select one trackLog related by session->TrackLog[R4.''captures path in''];
trackLog.addTrackPoint( latitude: param.latitude, longitude: param.longitude );
end if;',
1);
INSERT INTO C_EP_PROXY
VALUES ("c85ccd2f-994b-4dac-99c9-6e4b96e73d3d",
"de38d4b0-e70e-49ee-a5b9-590645243ae5",
-1,
'locationUpdate',
'',
'../../LocationInterfaces/LocationProvider/LocationProvider.xtuml');
INSERT INTO SPR_REP
VALUES ("7ba2b57b-db0c-47c6-ab55-14027d26ae91",
"9ddd9205-9116-4aff-b118-91037de23593",
Expand Down Expand Up @@ -585,6 +581,23 @@ INSERT INTO C_EP_PROXY
'unregisterListener',
'',
'../../LocationInterfaces/LocationProvider/LocationProvider.xtuml');
INSERT INTO SPR_REP
VALUES ("569e79bb-0bb1-4721-9f91-36a7d72204b2",
"244d2b45-5908-40ff-99d3-a37dc791609a",
"b945d9de-e8b2-4a09-8727-391d7b0799a6");
INSERT INTO SPR_RO
VALUES ("569e79bb-0bb1-4721-9f91-36a7d72204b2",
'getLocation',
'',
'',
3);
INSERT INTO C_EP_PROXY
VALUES ("244d2b45-5908-40ff-99d3-a37dc791609a",
"de38d4b0-e70e-49ee-a5b9-590645243ae5",
-1,
'getLocation',
'',
'../../LocationInterfaces/LocationProvider/LocationProvider.xtuml');
INSERT INTO C_I_PROXY
VALUES ("de38d4b0-e70e-49ee-a5b9-590645243ae5",
"00000000-0000-0000-0000-000000000000",
Expand Down Expand Up @@ -889,7 +902,7 @@ INSERT INTO SPR_REP
INSERT INTO SPR_RO
VALUES ("051452c4-19ef-40e2-a973-335f648d5010",
'getDistance',
'Returns distance, in kilometers, between the "from" and "to" coordinates passed as parameters.
'Returns distance, in kilometers, between the "from" and "to" coordinates passed as parameters.
The coordinates must be passed as decimal degrees.',
'return 1;',
0);
Expand All @@ -898,7 +911,7 @@ INSERT INTO C_EP_PROXY
"b65a1f3e-0be2-4ec7-867b-c71757895c44",
-1,
'getDistance',
'Returns distance, in kilometers, between the "from" and "to" coordinates passed as parameters.
'Returns distance, in kilometers, between the "from" and "to" coordinates passed as parameters.
The coordinates must be passed as decimal degrees.',
'../../LocationInterfaces/LocationUtil/LocationUtil.xtuml');
INSERT INTO C_I_PROXY
Expand Down
Loading

0 comments on commit f2fee8f

Please sign in to comment.