Index: .gitignore =================================================================== diff -u -rd5ed5f9460543b58a9195a6e33668b8058f9893a -r757a01c42a7a611704a67869a74c68f53edab20f --- .gitignore (.../.gitignore) (revision d5ed5f9460543b58a9195a6e33668b8058f9893a) +++ .gitignore (.../.gitignore) (revision 757a01c42a7a611704a67869a74c68f53edab20f) @@ -2,3 +2,4 @@ common tags scripts/denali +settings Index: denali.pro =================================================================== diff -u -rdf74454a7a75eb63ac577739c1fd0f179e479f44 -r757a01c42a7a611704a67869a74c68f53edab20f --- denali.pro (.../denali.pro) (revision df74454a7a75eb63ac577739c1fd0f179e479f44) +++ denali.pro (.../denali.pro) (revision 757a01c42a7a611704a67869a74c68f53edab20f) @@ -20,6 +20,16 @@ # deprecated API to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS +linux-g++ { + message("Building for desktop") + DEFINES += BUILD_FOR_DESKTOP +} + +linux-oe-generic-g++ { + message("Building for target") + DEFINES += BUILD_FOR_TARGET +} + # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. Index: denali.pro.user =================================================================== diff -u -r510ea07f96362a18f9961f41b5b91740df075c1f -r757a01c42a7a611704a67869a74c68f53edab20f --- denali.pro.user (.../denali.pro.user) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) +++ denali.pro.user (.../denali.pro.user) (revision 757a01c42a7a611704a67869a74c68f53edab20f) @@ -1,14 +1,14 @@ - + EnvironmentId {67370740-e20f-4fc6-be45-6652e866a8bf} ProjectExplorer.Project.ActiveTarget - 0 + 1 ProjectExplorer.Project.EditorSettings @@ -89,7 +89,7 @@ Desktop Qt 5.12.5 GCC 64bit Desktop Qt 5.12.5 GCC 64bit qt.qt5.5125.gcc_64_kit - 1 + 0 0 0 @@ -1176,7 +1176,7 @@ denali Qt4ProjectManager.Qt4RunConfiguration:/home/denali/Projects/application/denali.pro - + -l 3768 false true @@ -1185,7 +1185,7 @@ false true - /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Release + /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Debug 1 Index: scripts/run.sh =================================================================== diff -u -r8ec5969db5d688c89ff99a4911112da53e0a9408 -r757a01c42a7a611704a67869a74c68f53edab20f --- scripts/run.sh (.../run.sh) (revision 8ec5969db5d688c89ff99a4911112da53e0a9408) +++ scripts/run.sh (.../run.sh) (revision 757a01c42a7a611704a67869a74c68f53edab20f) @@ -71,7 +71,7 @@ #fi # setup bluetooth -mkdir -p "$SDCARD_MNT/treatment" +mkdir -p "$HOME/settings" sleep 5 killall connmand /usr/share/silex-uart/silex-uart.sh start Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r5220c64dd3a0fc9c322a68884e73503bb7893d12 -r757a01c42a7a611704a67869a74c68f53edab20f --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 5220c64dd3a0fc9c322a68884e73503bb7893d12) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 757a01c42a7a611704a67869a74c68f53edab20f) @@ -40,7 +40,11 @@ const char *Treatment_Parameter_Ranges_Path_JSON = "/media/sd-card/treatment/denali.conf"; // Bluetooth - const char *Bluetooth_Saved_Devices_Path_JSON = "/media/sd-card/treatment/bledevices.conf"; +#ifdef BUILD_FOR_DESKTOP + const char *Bluetooth_Saved_Devices_Path_JSON = "/home/denali/Projects/application/settings/bledevices.conf"; +#elif BUILD_FOR_TARGET + const char *Bluetooth_Saved_Devices_Path_JSON = "/home/root/settings/bledevices.conf"; +#endif const char *SDCard_Base_Path_Name = "/media/sd-card/"; } Index: sources/view/VBluetooth.cpp =================================================================== diff -u -r510ea07f96362a18f9961f41b5b91740df075c1f -r757a01c42a7a611704a67869a74c68f53edab20f --- sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) +++ sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision 757a01c42a7a611704a67869a74c68f53edab20f) @@ -59,7 +59,7 @@ */ void VBluetooth::doScanForDevices() { - onUpdateStatus(tr("Scanning...")); + notifyStatusUpdate(tr("Scanning...")); _unpairedDevices.clear(); emit didDevicesChanged(); emit didRequestScanForDevices(); @@ -75,10 +75,10 @@ { switch (error) { case QBluetoothDeviceDiscoveryAgent::PoweredOffError: - onUpdateStatus(tr("Error: Bluetooth module is powered off.")); + notifyStatusUpdate(tr("Error: Bluetooth module is powered off.")); break; default: - onUpdateStatus(tr("Error: Scan for devices error.")); + notifyStatusUpdate(tr("Error: Scan for devices error.")); break; } } @@ -104,7 +104,7 @@ void VBluetooth::onScanForDevicesFinished() { emit didScanFinished(); - onUpdateStatus(tr("Scan Finished.")); + notifyStatusUpdate(tr("Scan Finished.")); } /*! @@ -146,11 +146,11 @@ } /*! - * \brief onUpdateStatus + * \brief notifyStatusUpdate * Updates the status and emits a signal to notify the QML * \param message */ -void VBluetooth::onUpdateStatus(const QString &message) +void VBluetooth::notifyStatusUpdate(const QString &message) { _status = message; emit didStatusChanged(); @@ -162,7 +162,7 @@ */ void VBluetooth::onConnectingToDevice() { - onUpdateStatus(tr("Connecting...")); + notifyStatusUpdate(tr("Connecting...")); } /*! @@ -215,7 +215,7 @@ */ void VBluetooth::onControllerError(QLowEnergyController::Error error) { - onUpdateStatus(controllerErrorToString(error)); + notifyStatusUpdate(controllerErrorToString(error)); } /*! @@ -276,7 +276,7 @@ removeFromDevices(info); } - onUpdateStatus(tr("Paired, Connected.")); + notifyStatusUpdate(tr("Paired, Connected.")); } /*! @@ -314,7 +314,7 @@ { setDeviceConnected(deviceInfo, false); emit didPairedDevicesChanged(); - onUpdateStatus(tr("Paired, Not Connected.")); + notifyStatusUpdate(tr("Paired, Not Connected.")); } /*! Index: sources/view/VBluetooth.h =================================================================== diff -u -rd9c602dc1f1e5ba34bc665264d739ce6509e0198 -r757a01c42a7a611704a67869a74c68f53edab20f --- sources/view/VBluetooth.h (.../VBluetooth.h) (revision d9c602dc1f1e5ba34bc665264d739ce6509e0198) +++ sources/view/VBluetooth.h (.../VBluetooth.h) (revision 757a01c42a7a611704a67869a74c68f53edab20f) @@ -65,13 +65,13 @@ bool isDeviceAlreadyPaired(const QBluetoothDeviceInfo &deviceInfo); void removeFromDevices(const VBluetoothDeviceInfo *info); void setDeviceConnected(const QBluetoothDeviceInfo &deviceInfo, const bool &connected); + void notifyStatusUpdate(const QString &message); private slots: void onScanForDevicesError(QBluetoothDeviceDiscoveryAgent::Error error); void onScanForDevicesFinished(); void onDeviceDiscovered(const QBluetoothDeviceInfo &device); void onConnectingToDevice(); - void onUpdateStatus(const QString &message); void onControllerError(QLowEnergyController::Error error); void onConnectedToDevice(const QBluetoothDeviceInfo &deviceInfo); void onDisconnectedFromDevice(const QBluetoothDeviceInfo &deviceInfo);