Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
andan67 committed Jan 7, 2022
1 parent 5cc510f commit 5fe6884
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
19 changes: 0 additions & 19 deletions connectiq/source/TrackView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,6 @@ class TrackView extends GenericView {
_yArray = Track.yArray;
_nPoints = Track.nPoints;

/*
System.println("_xArray.size(): " + _xArray.size());
System.println("_yArray.size(): " + _yArray.size());
System.println("_xCenter: " +_xCenter);
System.println("_yCenter: " +_yCenter);
System.println("_cosTransform: " +_cosTransform);
System.println("_sinTransform: " +_sinTransform);
*/
for(var i = 0; i < _nPoints; i++ ) {

if(i > 0) {
Expand Down Expand Up @@ -452,17 +444,6 @@ class TrackView extends GenericView {

if(isNewTrack) {
isNewTrack = false;

/*
if($.msgData != null) {
// Newly tansmitted track data exists.
// Handle this case in app base class outside update loop as this results in less peak memory
$.newTrackReceived = true;
return;
}
*/

setZoomLevel(null);
if(Track.hasElevationData) {
scaleEleX = eleWidth / Track.xyLength;
Expand Down
24 changes: 2 additions & 22 deletions connectiq/source/WormNavApp.mc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class WormNavApp extends Application.AppBase {

// onStart() is called on application start up
function onStart(state) {
//System.println("onStart");

// vivoactive stands for all devices with round screen shape
// ToDo: Implement resource/annotation based method to set device dependent settings
if(System.getDeviceSettings().screenShape == System.SCREEN_SHAPE_ROUND) {
Expand Down Expand Up @@ -128,8 +126,6 @@ class WormNavApp extends Application.AppBase {
// timer is used for data fields and auto lap
appTimer = new Timer.Timer();
appTimer.start(method(:onTimer), 1000, true);

//System.println("onStart finished");
}


Expand All @@ -149,7 +145,6 @@ class WormNavApp extends Application.AppBase {

// Return the initial view of your application here
function getInitialView() {
//System.println("getInitialView");
trackView = new TrackView();
if(Track.hasTrackData) {
trackView.isNewTrack = true;
Expand All @@ -158,7 +153,6 @@ class WormNavApp extends Application.AppBase {
if(Communications has :registerForPhoneAppMessages) {
Communications.registerForPhoneAppMessages( method(:onPhone));
}
//System.println("getInitialView finished");
return [trackView, viewDelegate];
}

Expand All @@ -170,27 +164,13 @@ class WormNavApp extends Application.AppBase {
}

function onPhone(msg) {
System.println("onPhone");
try {

// quick check if message is in correct format
msgData = msg.data;
//System.println("msgData.size(): " + msgData.size());
if(msgData[0][2] instanceof Lang.Number) {
//System.println("msgData[0][2]: " + msgData[0][2]);
/*
if(trackView != null) {
trackView.isNewTrack = true;
System.println("rackView.isNewTrack: " + trackView.isNewTrack );
page = -1;
WatchUi.switchToView(trackView, viewDelegate, WatchUi.SLIDE_IMMEDIATE);
}
*/
newTrackReceived = true;
}
} catch( ex ) {
//System.println("ex.getErrorMEssage:" + ex.getErrorMessage());
//ex.printStackTrace();
msgData = null;
}
}
Expand All @@ -204,7 +184,7 @@ class WormNavApp extends Application.AppBase {
newTrackReceived = false;
Track.deleteTrack();
clearTrackStorage();
Track.newTrack($.msgData[0], $.msgData[1], $.msgData[2], $.msgData.size() == 4 ? $.msgData[3] : null );
Track.newTrack(msgData[0], msgData[1], msgData[2], msgData.size() == 4 ? msgData[3] : null );
msgData = null;
if(trackStorage) {
setProperty("trackStats", Track.trackStats);
Expand All @@ -217,7 +197,7 @@ class WormNavApp extends Application.AppBase {
trackView.isNewTrack = true;
trackView.showElevationPlot = false;
page = -1;
WatchUi.switchToView($.trackView, viewDelegate, WatchUi.SLIDE_IMMEDIATE);
WatchUi.switchToView(trackView, viewDelegate, WatchUi.SLIDE_IMMEDIATE);
return;
}

Expand Down

0 comments on commit 5fe6884

Please # to comment.