Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/use-poten…
Browse files Browse the repository at this point in the history
…tiometer-for-angle-offset-calib
  • Loading branch information
saitenntaisei committed Sep 4, 2024
2 parents 0de1eb8 + 6616ff8 commit 7cade31
Show file tree
Hide file tree
Showing 76 changed files with 9,934 additions and 262 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ build_android_signed
*.DS_Store

res/firmwares/*/
/build
3 changes: 3 additions & 0 deletions QCodeEditor/resources/languages/lisp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
<name>append</name>
<name>mod</name>
<name>print</name>
<name>set-print-prefix</name>
<name>puts</name>
<name>range</name>
<name>length</name>
Expand Down Expand Up @@ -267,6 +268,8 @@
<name>get-est-ind</name>
<name>get-duty</name>
<name>get-rpm</name>
<name>get-rpm-fast</name>
<name>get-rpm-faster</name>
<name>get-temp-fet</name>
<name>get-temp-mot</name>
<name>get-speed</name>
Expand Down
17 changes: 17 additions & 0 deletions QCodeEditor/src/internal/QCodeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,23 @@ void QCodeEditor::keyPressEvent(QKeyEvent* e) {
return;
}

// Duplicate line
if (e->key() == Qt::Key_D &&
(e->modifiers() & Qt::ControlModifier) &&
(e->modifiers() & Qt::ShiftModifier)) {
auto tc = textCursor();
auto linepos = tc.positionInBlock();
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);
tc.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor);
auto line = tc.selectedText();
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);
tc.insertText(line);
tc.movePosition(QTextCursor::PreviousBlock, QTextCursor::MoveAnchor);
tc.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, linepos);
setTextCursor(tc);
return;
}

bool doSave = false;

if (e->modifiers() == Qt::ControlModifier) {
Expand Down
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

</application>

<uses-sdk android:minSdkVersion='"23"' android:targetSdkVersion='"31"'/>
<uses-sdk android:minSdkVersion='"23"' android:targetSdkVersion='"34"'/>
<supports-screens android:largeScreens='"true"' android:normalScreens='"true"' android:anyDensity='"true"' android:smallScreens='"true"'/>

<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Expand Down
4 changes: 2 additions & 2 deletions build_android
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ qmake -config release "CONFIG += release_android build_mobile" ANDROID_ABIS="arm
make clean
make -j8
make install INSTALL_ROOT=build/android/build
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-vesc_tool-deployment-settings.json --android-platform android-31
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-vesc_tool-deployment-settings.json --android-platform android-33
mv build/android/build/build/outputs/apk/debug/build-debug.apk build/android/vesc_tool_mobile.apk
rm -rf build/android/build
rm -rf build/android/obj
Expand All @@ -32,7 +32,7 @@ qmake -config release "CONFIG += release_android" ANDROID_ABIS="arm64-v8a" -spec
make clean
make -j8
make install INSTALL_ROOT=build/android/build
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-vesc_tool-deployment-settings.json --android-platform android-31
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-vesc_tool-deployment-settings.json --android-platform android-33
mv build/android/build/build/outputs/apk/debug/build-debug.apk build/android/vesc_tool_full.apk
rm -rf build/android/build
rm -rf build/android/obj
Expand Down
2 changes: 1 addition & 1 deletion build_test_versions
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ qmake -config release "CONFIG += release_android build_mobile vt_test_version" A
make clean
make -j8
make install INSTALL_ROOT=build/android/build
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-vesc_tool-deployment-settings.json --android-platform android-31
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-vesc_tool-deployment-settings.json --android-platform android-33
mv build/android/build/build/outputs/apk/debug/build-debug.apk build/test_all/vesc_tool_test_android.apk
rm -rf build/android/build
rm -rf build/android/obj
Expand Down
45 changes: 45 additions & 0 deletions checklist_release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- BLDC
* Create release branch and switch to it
* Set test version to 0
* Update changelog release date

- Express
* Create release branch and switch to it
* Set test version to 0

- VESC Tool
* Create release branch and switch to it
* Set test version to 0
* Update changelog release date
* Update android version numbers
* Update target api in build scripts
* Update target api in manifest
* Build STM firmwares in release branch
* Build ESP firmwares in release branch
* Build android signed versions and upload to google play
* Build VESC Project versions
* Ask Jeff to build ios and mac versions

- Other
* Update FW archive repo and rebuild archive QRC file

== Next beta ==

- VESC Tool
* Switch to master
* Sync release
* Update version number
* Add new version to changelog
* Add new config files to res
* Update ESP conf_general FW version

- BLDC
* Switch to master
* Sync release
* Update version number
* Add new version to changelog

- Express
* Switch to main
* Sync release
* Update version number
1 change: 1 addition & 0 deletions configparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <QObject>
#include <QHash>
#include <QStringList>
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include "configparam.h"
Expand Down
1 change: 1 addition & 0 deletions display_tool/dispeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QColor>
#include <QImage>
#include <QColorDialog>
#include <QMessageBox>

DispEditor::DispEditor(QWidget *parent) :
QWidget(parent),
Expand Down
6 changes: 3 additions & 3 deletions ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
<key>CFBundleIdentifier</key>
<string>com.vesc-project.vesc-tool</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<string>6.05</string>
<key>CFBundleName</key>
<string>VESC Tool</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.0</string>
<string>6.05</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6.0</string>
<string>6.05</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
Expand Down
2 changes: 2 additions & 0 deletions macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>VESC Tool uses bluetooth to connect to embedded devices</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>VESC Tool uses bluetooth to connect to embedded devices</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>VESC Tool can store various logs and data files for configuration</string>
<key>NSBluetoothAlwaysUsageDescription</key>
Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,8 @@ int main(int argc, char *argv[])
qCritical() << "Could not start TcpHub on port" << tcpPort;
qApp->quit();
}
} else if (downloadPackageArchive) {
return 0;
} else {
QApplication *a = new QApplication(argc, argv);
app = a;
Expand Down Expand Up @@ -1564,8 +1566,6 @@ int main(int argc, char *argv[])
} else if (useBoardSetupWindow){
bw = new BoardSetupWindow;
bw->show();
} else if (downloadPackageArchive) {
return 0;
} else {
QPixmapCache::setCacheLimit(256000);
w = new MainWindow;
Expand Down
10 changes: 10 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,16 @@ MainWindow::MainWindow(QWidget *parent) :
ui->actionDisconnect->setEnabled(mVesc->isPortConnected());
});

mSettingSyncTimer.start(10000);
connect(&mSettingSyncTimer, &QTimer::timeout, [this]() {
mPageEspProg->saveStateToSettings();
mPageFirmware->saveStateToSettings();
mPageLisp->saveStateToSettings();
mPageMotorComparison->saveStateToSettings();
mPageScripting->saveStateToSettings();
mPagePackage->saveStateToSettings();
});

// Restore size and position
if (mSettings.contains("mainwindow/size")) {
resize(mSettings.value("mainwindow/size").toSize());
Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ private slots:
QTimer mPollImuTimer;
QTimer mPollBmsTimer;
QTimer mPortTimer;
QTimer mSettingSyncTimer;

PageWelcome *mPageWelcome;
PageConnection *mPageConnection;
Expand Down
29 changes: 20 additions & 9 deletions mobile/CanScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ Item {
scanButton.enabled = VescIf.isPortConnected()
}

function scanIfEmpty() {
if (canList.count == 0 &&
VescIf.isPortConnected() &&
scanButton.enabled) {
scanButton.clicked()
}
}

function selectDeviceInList() {
if (mCommands.getSendCan()) {
for (var i = 0; i < canModel.count;i++) {
Expand All @@ -63,10 +71,17 @@ Item {
mCommands.setSendCan(false, -1)
canList.currentIndex = 0;
canModel.clear()
scanButton.enabled = VescIf.isPortConnected()
scanButton.enabled = false
} else {
selectDeviceInList()
}

if (VescIf.scanCanOnConnect() &&
scanButton.enabled && canList.count == 0 &&
VescIf.isPortConnected() &&
VescIf.fwRx() && VescIf.customConfigRxDone()) {
scanButton.clicked()
}
}
}

Expand Down Expand Up @@ -259,10 +274,6 @@ Item {

function onPortConnectedChanged() {
scanButton.enabled = VescIf.isPortConnected()

if (canList.count == 0 && VescIf.isPortConnected()) {
scanButton.clicked()
}
}
}

Expand All @@ -276,6 +287,7 @@ Item {

scanButton.enabled = true
scanButton.text = qsTr("Scan")

if (VescIf.isPortConnected()) {
canModel.clear()
var params = Utility.getFwVersionBlockingCan(VescIf, -1)
Expand Down Expand Up @@ -321,18 +333,17 @@ Item {
"deviceIconPath": devicePath,
"logoIconPath": logoPath})
}

canList.currentIndex = 0
if (!isTimeout){
scanButton.enabled = true

if (!isTimeout) {
VescIf.emitStatusMessage("CAN Scan Finished", true)
} else {
scanButton.enabled = true
VescIf.emitStatusMessage("CAN Scan Timed Out", false)
}

selectDeviceInList()
} else {
scanButton.enabled = true
VescIf.emitStatusMessage("Device not connected", false)
}
}
Expand Down
3 changes: 2 additions & 1 deletion mobile/ConfigPageApp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
contentWidth: column.width
contentHeight: scrollCol.preferredHeight
clip: true

GridLayout {
id: scrollCol
anchors.fill: parent
width: column.width
columns: isHorizontal ? 2 : 1
}
}
Expand Down
3 changes: 2 additions & 1 deletion mobile/ConfigPageCustom.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
contentWidth: column.width
contentHeight: scrollCol.preferredHeight
clip: true

GridLayout {
id: scrollCol
anchors.fill: parent
width: column.width
columns: isHorizontal ? 2 : 1
}
}
Expand Down
4 changes: 2 additions & 2 deletions mobile/ConfigPageMotor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Item {
property Commands mCommands: VescIf.commands()
property bool isHorizontal: width > height


ParamEditors {
id: editors
}
Expand Down Expand Up @@ -201,11 +200,12 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
contentWidth: column.width
contentHeight: scrollCol.preferredHeight
clip: true

GridLayout {
id: scrollCol
anchors.fill: parent
width: column.width
columns: isHorizontal ? 2 : 1
}
}
Expand Down
9 changes: 9 additions & 0 deletions mobile/Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ Item {
checked: VescIf.reconnectLastCan()
}

CheckBox {
id: scanCanConnectBox
Layout.fillWidth: true
text: "Scan CAN on connect"
checked: VescIf.scanCanOnConnect()
}

CheckBox {
id: darkModeBox
Layout.fillWidth: true
Expand All @@ -129,6 +136,7 @@ Item {
qmlUiBox.checked = VescIf.getLoadQmlUiOnConnect()
qmlUiAskBox.checked = VescIf.askQmlLoad()
reconnectLastCanBox.checked = VescIf.reconnectLastCan()
scanCanConnectBox.checked = VescIf.scanCanOnConnect()
}

onClosed: {
Expand All @@ -139,6 +147,7 @@ Item {
VescIf.setLoadQmlUiOnConnect(qmlUiBox.checked)
VescIf.setAskQmlLoad(qmlUiAskBox.checked)
VescIf.setReconnectLastCan(reconnectLastCanBox.checked)
VescIf.setScanCanOnConnect(scanCanConnectBox.checked)
VescIf.storeSettings()

Utility.keepScreenOn(VescIf.keepScreenOn())
Expand Down
6 changes: 6 additions & 0 deletions mobile/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ ApplicationWindow {
id: canScreen
anchors.fill: parent
}

onVisibleChanged: {
if (visible) {
canScreen.scanIfEmpty()
}
}
}
}

Expand Down
Loading

0 comments on commit 7cade31

Please sign in to comment.