Skip to content

Commit

Permalink
Merge pull request #213 from Jfriesen222/release_3_01
Browse files Browse the repository at this point in the history
added a few timers to avoid ui freezes on ios
  • Loading branch information
vedderb authored Mar 30, 2022
2 parents 2d5ba76 + 68c368d commit d796090
Show file tree
Hide file tree
Showing 7 changed files with 493 additions and 336 deletions.
205 changes: 102 additions & 103 deletions ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,108 +2,107 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>$(Vesc Tool)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>com.vesc-project.vesc-tool</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>Debug-iphoneos</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSFileQuarantineEnabled</key>
<true/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Need access to connect to VESC</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>$(PRODUCT_NAME) searches Bluetooth LE Devices (WaiterLock, Barcode Scanner, eGK)</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>Saves log files here</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Used for Ride Tracking</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Used for Ride Tracking</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used for Ride Tracking</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) uses photos</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
<string>external-accessory</string>
<string>bluetooth-central</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{360, 640}</string>
</dict>
</array>
<key>UILaunchStoryboardName</key>
<string>MyLaunchScreen</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportsDocumentBrowser</key>
<true/>
<key>UIViewEdgeAntialiasing</key>
<true/>
<key>CFBundleDisplayName</key>
<string>$(Vesc Tool)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSFileQuarantineEnabled</key>
<true/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Need access to connect to VESC</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>$(PRODUCT_NAME) searches Bluetooth LE Devices (WaiterLock, Barcode Scanner, eGK)</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>Saves log files here</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Used for Ride Tracking</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Used for Ride Tracking</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used for Ride Tracking</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) uses photos</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
<string>bluetooth-central</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>LaunchImage</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{360, 640}</string>
</dict>
</array>
<key>UILaunchStoryboardName</key>
<string>MyLaunchScreen</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportsDocumentBrowser</key>
<true/>
<key>UIViewEdgeAntialiasing</key>
<true/>
</dict>
</plist>
16 changes: 13 additions & 3 deletions mobile/ConnectScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ Item {
preferredDialog.open()
} else {
disableDialog()
VescIf.connectBle(bleAddr)
preferredDialog.bleAddr = bleAddr
workaroundTimerConnectPref.start()
}
}
}
Expand Down Expand Up @@ -510,12 +511,21 @@ Item {
bleModel.clear()
mBle.emitScanDone()
disableDialog()
VescIf.connectBle(bleAddr)
workaroundTimerConnectPref.start()
}

onRejected: {
disableDialog()
VescIf.connectBle(bleAddr)
workaroundTimerConnectPref.start()
}
Timer {
id: workaroundTimerConnectPref
interval: 0
repeat: false
running: false
onTriggered: {
VescIf.connectBle(preferredDialog.bleAddr)
}
}
}

Expand Down
51 changes: 44 additions & 7 deletions mobile/DirectionSetup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ Item {

function scanCan() {
disableDialog()
setCanDevs(Utility.scanCanVescOnly(VescIf))
workaroundTimerCanScan.start()
}
Timer {
id: workaroundTimerCanScan
interval: 0
repeat: false
running: false
onTriggered: {
setCanDevs(Utility.scanCanVescOnly(VescIf))
}
}

function setCanDevs(canDevs) {
Expand Down Expand Up @@ -142,13 +151,23 @@ Item {
}

Switch {
id: invertSwitch
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
enabled: true
checked: isInv
onToggled: {
disableDialog()
Utility.setInvertDirection(VescIf, isCan ? canId : -1, checked)
enableDialog()
workaroundTimerInvertSwitch.start()
}
Timer {
id: workaroundTimerInvertSwitch
interval: 0
repeat: false
running: false
onTriggered: {
Utility.setInvertDirection(VescIf, isCan ? canId : -1, invertSwitch.checked)
enableDialog()
}
}
}
}
Expand All @@ -165,8 +184,17 @@ Item {

onClicked: {
disableDialog()
Utility.testDirection(VescIf, isCan ? canId : -1, 0.1, 2000)
enableDialog()
workaroundTimerFWD.start()
}
Timer {
id: workaroundTimerFWD
interval: 0
repeat: false
running: false
onTriggered: {
Utility.testDirection(VescIf, isCan ? canId : -1, 0.1, 2000)
enableDialog()
}
}
}

Expand All @@ -178,8 +206,17 @@ Item {

onClicked: {
disableDialog()
Utility.testDirection(VescIf, isCan ? canId : -1, -0.1, 2000)
enableDialog()
workaroundTimerBWD.start()
}
Timer {
id: workaroundTimerBWD
interval: 0
repeat: false
running: false
onTriggered: {
Utility.testDirection(VescIf, isCan ? canId : -1, -0.1, 2000)
enableDialog()
}
}
}
}
Expand Down
Loading

0 comments on commit d796090

Please sign in to comment.