Skip to content
Snippets Groups Projects
Commit ce76d638 authored by miklosimate's avatar miklosimate
Browse files

please go up to the repo

parent 5b0cf46a
Branches
No related tags found
No related merge requests found
......@@ -489,6 +489,7 @@
INFOPLIST_KEY_NSFileProviderPresenceUsageDescription = "The app needs it to save files";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "The needs ot use senzor data";
INFOPLIST_KEY_NSMotionUsageDescription = "THe app need is";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
......@@ -526,6 +527,7 @@
INFOPLIST_KEY_NSFileProviderPresenceUsageDescription = "The app needs it to save files";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "The needs ot use senzor data";
INFOPLIST_KEY_NSMotionUsageDescription = "THe app need is";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
......
......@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSMotionUsageDescription</key>
<string>App mesasures sensors</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>hu.itk.ppke.backgroundTask</string>
......
......@@ -74,20 +74,15 @@ class SensorCollector: ObservableObject {
gyroStartRecording(motionManager: motionManager)
magStartRecording(motionManager: motionManager)
altStartRecording(altimeter: altimeter)
}
func stopAllRecording(motionManager: CMMotionManager, altimeter: CMAltimeter){
print("Sensors stopped all recording")
motionManager.stopAccelerometerUpdates()
motionManager.stopGyroUpdates()
motionManager.stopMagnetometerUpdates()
altimeter.stopRelativeAltitudeUpdates()
//many missing :/
print("Sensors stopped all recording")
for index in 0..<activeSensorsList.count {
activeSensorsList[index].isSensorActive = false
}
......@@ -130,9 +125,6 @@ class SensorCollector: ObservableObject {
func accStartRecording(motionManager: CMMotionManager){
//if there is an acc.meter available:
if(motionManager.isAccelerometerAvailable){
//changing the status of the sensor active in the list of sensors
//set accelerometer update frequency - to the maximum that the device is capable
motionManager.accelerometerUpdateInterval = motionManager.deviceMotionUpdateInterval
//start accelerometer update:
......
......@@ -72,8 +72,9 @@ struct StartingView: View {
}.padding().disabled(manager.state != "Ready").opacity(debug ? 0 : 1)
Button("STOP Iterations") {
sensor.stopAllRecording(motionManager: motionManager, altimeter: altimeter)
customTimer.stopTimer()
sensor.stopAllRecording(motionManager: motionManager, altimeter: altimeter)
}.padding().opacity(debug ? 0 : 1)
Text("\(manager.numberOfMeasurements - manager.timerIntervalValues.count >= 0 ? "\(manager.numberOfMeasurements - manager.timerIntervalValues.count)/\(manager.numberOfMeasurements)" : "Not initialised")")
......@@ -230,11 +231,11 @@ struct StartingView: View {
// }
// }
//----------------------------- NOTIFICAION HANDELING ---------------------------------
.alert("\(manager.numberOfMeasurements - manager.timerIntervalValues.count >= 0 ? "\(manager.numberOfMeasurements - manager.timerIntervalValues.count)/\(manager.numberOfMeasurements)" : "Not initialised") Measurement", isPresented: $customTimer.isFinished) {
.alert("\(manager.numberOfMeasurements - manager.timerIntervalValues.count >= -1 ? "\(manager.numberOfMeasurements - manager.timerIntervalValues.count)/\(manager.numberOfMeasurements)" : "Not initialised") Measurement", isPresented: $customTimer.isFinished) {
Button(manager.timerIntervalValues.count == 0 ? "End" : "Next" ,role: .cancel){
customTimer.stopTimer()
sensor.stopAllRecording(motionManager: motionManager, altimeter: altimeter)
customTimer.stopTimer()
saveAllToJson()
setNextMeasurement()
......@@ -244,16 +245,16 @@ struct StartingView: View {
}
}
Button("Stop", role: .destructive){
sensor.stopAllRecording(motionManager: motionManager, altimeter: altimeter)
customTimer.stopTimer()
sensor.stopAllRecording(motionManager: motionManager, altimeter: altimeter)
saveAllToJson()
}
}
//------------------ DEMO NOTIFICATION - MEASUREMENT STARTING ----------------------
.alert("Demo Alert - press start if you are ready to start!", isPresented: $demostart){
Button("Start",role: .cancel){
sensor.stopAllRecording(motionManager: motionManager, altimeter: altimeter)
customTimer.stopTimer()
sensor.stopAllRecording(motionManager: motionManager, altimeter: altimeter)
setNextMeasurement()
if customTimer.totalSeconds != 0 {
sensor.startAllRecording(motionManager: motionManager, altimeter: altimeter)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment