Manos Chorianopoulos

TelematicsMainViewController fixes

...@@ -123,9 +123,9 @@ import CoreMotion ...@@ -123,9 +123,9 @@ import CoreMotion
123 } 123 }
124 124
125 DispatchQueue.main.async { 125 DispatchQueue.main.async {
126 - if (mIsTripStarted == true) { 126 + if (self.mIsTripStarted == true) {
127 // Stop trip 127 // Stop trip
128 - stopTrip() 128 + self.stopTrip()
129 129
130 } else { 130 } else {
131 // Start trip 131 // Start trip
...@@ -139,16 +139,16 @@ import CoreMotion ...@@ -139,16 +139,16 @@ import CoreMotion
139 // sampleTimeTextField.isEnabled = false 139 // sampleTimeTextField.isEnabled = false
140 140
141 // Start location and sensor updates 141 // Start location and sensor updates
142 - requestLocationUpdates() 142 + self.requestLocationUpdates()
143 // registerSensor() 143 // registerSensor()
144 144
145 - mIsTripStarted = true 145 + self.mIsTripStarted = true
146 // orientationCountLabel.text = "0" 146 // orientationCountLabel.text = "0"
147 // touchCountLabel.text = "0" 147 // touchCountLabel.text = "0"
148 - tripButton.setTitle("Stop Trip", for: .normal) 148 + self.tripButton.setTitle("Stop Trip", for: .normal)
149 - mStartTimestamp = String(Int(Date().timeIntervalSince1970 * 1000)) // time in milliseconds since January 1, 1970 149 + self.mStartTimestamp = String(Int(Date().timeIntervalSince1970 * 1000)) // time in milliseconds since January 1, 1970
150 - initializeOrientation() 150 + self.initializeOrientation()
151 - startTimer() 151 + self.startTimer()
152 } 152 }
153 } 153 }
154 } 154 }
...@@ -303,24 +303,24 @@ import CoreMotion ...@@ -303,24 +303,24 @@ import CoreMotion
303 private func requestLocationUpdates() { 303 private func requestLocationUpdates() {
304 DispatchQueue.global().async { 304 DispatchQueue.global().async {
305 if CLLocationManager.locationServicesEnabled() { 305 if CLLocationManager.locationServicesEnabled() {
306 - locationManager.desiredAccuracy = kCLLocationAccuracyBest 306 + self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
307 // locationManager.requestLocation() 307 // locationManager.requestLocation()
308 308
309 - if (!locationServicesIsEnabled()) { 309 + if (!self.locationServicesIsEnabled()) {
310 - onLocationServicesIsDisabled(); 310 + self.onLocationServicesIsDisabled();
311 } 311 }
312 - else if (authorizationStatusIsDenied(status: CLLocationManager.authorizationStatus())) { 312 + else if (self.authorizationStatusIsDenied(status: CLLocationManager.authorizationStatus())) {
313 - onAuthorizationStatusIsDenied(); 313 + self.onAuthorizationStatusIsDenied();
314 } 314 }
315 - else if (authorizationStatusNeedRequest(status: CLLocationManager.authorizationStatus())) { 315 + else if (self.authorizationStatusNeedRequest(status: CLLocationManager.authorizationStatus())) {
316 - onAuthorizationStatusNeedRequest(); 316 + self.onAuthorizationStatusNeedRequest();
317 } 317 }
318 - else if (authorizationStatusIsGranted(status: CLLocationManager.authorizationStatus())) { 318 + else if (self.authorizationStatusIsGranted(status: CLLocationManager.authorizationStatus())) {
319 - onAuthorizationStatusIsGranted(); 319 + self.onAuthorizationStatusIsGranted();
320 } 320 }
321 + } else {
322 + self.onLocationServicesIsDisabled();
321 } 323 }
322 - } else {
323 - self.onLocationServicesIsDisabled();
324 } 324 }
325 } 325 }
326 326
......