Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2023-11-13 10:58:47 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e1466ec37bac5cc1d4dd3e68d4502b910c77e28d
e1466ec3
1 parent
5b49a6c0
TelematicsMainViewController fixes
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
SwiftWarplyFramework/SwiftWarplyFramework/TelematicsMainViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/TelematicsMainViewController.swift
View file @
e1466ec
...
...
@@ -123,9 +123,9 @@ import CoreMotion
}
DispatchQueue
.
main
.
async
{
if
(
mIsTripStarted
==
true
)
{
if
(
self
.
mIsTripStarted
==
true
)
{
// Stop trip
stopTrip
()
s
elf
.
s
topTrip
()
}
else
{
// Start trip
...
...
@@ -139,16 +139,16 @@ import CoreMotion
// sampleTimeTextField.isEnabled = false
// Start location and sensor updates
requestLocationUpdates
()
self
.
requestLocationUpdates
()
// registerSensor()
mIsTripStarted
=
true
self
.
mIsTripStarted
=
true
// orientationCountLabel.text = "0"
// touchCountLabel.text = "0"
tripButton
.
setTitle
(
"Stop Trip"
,
for
:
.
normal
)
mStartTimestamp
=
String
(
Int
(
Date
()
.
timeIntervalSince1970
*
1000
))
// time in milliseconds since January 1, 1970
initializeOrientation
()
startTimer
()
self
.
tripButton
.
setTitle
(
"Stop Trip"
,
for
:
.
normal
)
self
.
mStartTimestamp
=
String
(
Int
(
Date
()
.
timeIntervalSince1970
*
1000
))
// time in milliseconds since January 1, 1970
self
.
initializeOrientation
()
s
elf
.
s
tartTimer
()
}
}
}
...
...
@@ -303,26 +303,26 @@ import CoreMotion
private
func
requestLocationUpdates
()
{
DispatchQueue
.
global
()
.
async
{
if
CLLocationManager
.
locationServicesEnabled
()
{
locationManager
.
desiredAccuracy
=
kCLLocationAccuracyBest
self
.
locationManager
.
desiredAccuracy
=
kCLLocationAccuracyBest
// locationManager.requestLocation()
if
(
!
locationServicesIsEnabled
())
{
onLocationServicesIsDisabled
();
}
else
if
(
authorizationStatusIsDenied
(
status
:
CLLocationManager
.
authorizationStatus
()))
{
onAuthorizationStatusIsDenied
();
if
(
!
self
.
locationServicesIsEnabled
())
{
self
.
onLocationServicesIsDisabled
();
}
else
if
(
authorizationStatusNeedRequest
(
status
:
CLLocationManager
.
authorizationStatus
()))
{
onAuthorizationStatusNeedRequest
();
else
if
(
self
.
authorizationStatusIsDenied
(
status
:
CLLocationManager
.
authorizationStatus
()))
{
self
.
onAuthorizationStatusIsDenied
();
}
else
if
(
authorizationStatusIsGranted
(
status
:
CLLocationManager
.
authorizationStatus
()))
{
onAuthorizationStatusIsGranted
();
else
if
(
self
.
authorizationStatusNeedRequest
(
status
:
CLLocationManager
.
authorizationStatus
()))
{
self
.
onAuthorizationStatusNeedRequest
();
}
else
if
(
self
.
authorizationStatusIsGranted
(
status
:
CLLocationManager
.
authorizationStatus
()))
{
self
.
onAuthorizationStatusIsGranted
();
}
}
else
{
self
.
onLocationServicesIsDisabled
();
}
}
}
private
func
stopLocationUpdates
()
{
locationManager
.
stopUpdatingLocation
()
...
...
Please
register
or
login
to post a comment