Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

V1.0.1 - updated flot.js, fixed issue with QML initialisation being b…

…locked by BT scanning at 10.2.1
  • Loading branch information...
commit d85ba7a2b9190b61d74d682170148f6a6d88bc46 1 parent b7fa0e6
mdwoolley authored
View
4 CscMonitor/.project
@@ -63,7 +63,7 @@
</arguments>
</buildCommand>
<buildCommand>
- <name>com.rim.tad.tools.wst.jsdt.core.javascriptValidator</name>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
@@ -85,7 +85,7 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>com.rim.tad.tools.wst.jsdt.core.jsNature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
View
4 CscMonitor/README.md
@@ -20,6 +20,10 @@ The sample code for this application is Open Source under the [Apache 2.0 Licens
**Release History**
* **V1.0.0** - Initial release
+* **V1.0.1** - Updated FLOT to version 0.8.2.
+ Trigger device scanning on start now performed in C++ instead of QML as this was blocking completion of QML loading/rendering at 10.2.1.
+ Added ActivityIndicator to indicate scanning activity
+
**Dependencies**
View
29 CscMonitor/assets/.assets.index
@@ -1,61 +1,34 @@
1
-66
+39
AboutSheet.qml
common/DeviceItem.qml
common/SessionItem.qml
-cover.qml
images/about.png
images/BikeWheel_orange.png
-images/bluegreen0.gif
images/bluegreen0.png
-images/bluegreen1.gif
images/bluegreen1.png
-images/bluegreen2.gif
images/bluegreen2.png
-images/bluegreen3.gif
images/bluegreen3.png
-images/bluegreen4.gif
images/bluegreen4.png
-images/bluegreen5.gif
images/bluegreen5.png
-images/bluegreen6.gif
images/bluegreen6.png
-images/bluegreen7.gif
images/bluegreen7.png
-images/bluegreen8.gif
images/bluegreen8.png
-images/bluegreen9.gif
images/bluegreen9.png
images/crank5_cyan.png
-images/device.png
-images/geek.png
-images/heart.png
images/history.png
images/ic_previous.png
images/monitor.png
-images/orange0.gif
images/orange0.png
-images/orange1.gif
images/orange1.png
-images/orange2.gif
images/orange2.png
-images/orange3.gif
images/orange3.png
-images/orange4.gif
images/orange4.png
-images/orange5.gif
images/orange5.png
-images/orange6.gif
images/orange6.png
-images/orange7.gif
images/orange7.png
-images/orange8.gif
images/orange8.png
-images/orange9.gif
images/orange9.png
-images/Originals/history.png
-images/Originals/monitor.png
-images/Originals/scan.png
images/save.png
images/scan.png
images/white_item_bg.png
View
81 CscMonitor/assets/main.qml
@@ -34,30 +34,39 @@ TabbedPane {
property int p_monitor_tab: 0
property int p_scan_tab: 1
property int p_about_tab: 2
- property variant digit_orange: [
- "asset:///images/orange0.png",
- "asset:///images/orange1.png",
- "asset:///images/orange2.png",
- "asset:///images/orange3.png",
- "asset:///images/orange4.png",
- "asset:///images/orange5.png",
- "asset:///images/orange6.png",
- "asset:///images/orange7.png",
- "asset:///images/orange8.png",
- "asset:///images/orange9.png"
- ]
- property variant digit_bluegreen: [
- "asset:///images/bluegreen0.png",
- "asset:///images/bluegreen1.png",
- "asset:///images/bluegreen2.png",
- "asset:///images/bluegreen3.png",
- "asset:///images/bluegreen4.png",
- "asset:///images/bluegreen5.png",
- "asset:///images/bluegreen6.png",
- "asset:///images/bluegreen7.png",
- "asset:///images/bluegreen8.png",
- "asset:///images/bluegreen9.png"
- ]
+ property variant digit_orange: [ "asset:///images/orange0.png", "asset:///images/orange1.png", "asset:///images/orange2.png",
+ "asset:///images/orange3.png", "asset:///images/orange4.png", "asset:///images/orange5.png",
+ "asset:///images/orange6.png", "asset:///images/orange7.png", "asset:///images/orange8.png",
+ "asset:///images/orange9.png" ]
+ property variant digit_bluegreen: [ "asset:///images/bluegreen0.png", "asset:///images/bluegreen1.png", "asset:///images/bluegreen2.png",
+ "asset:///images/bluegreen3.png", "asset:///images/bluegreen4.png", "asset:///images/bluegreen5.png",
+ "asset:///images/bluegreen6.png", "asset:///images/bluegreen7.png", "asset:///images/bluegreen8.png",
+ "asset:///images/bluegreen9.png" ]
+
+ function onShowTab(tab_index) {
+ switch (tab_index) {
+ case 0:
+ tabbedPane.activeTab = monitor_tab
+ break;
+ case 1:
+ tabbedPane.activeTab = scan_tab
+ break;
+ case 2:
+ tabbedPane.activeTab = about_tab
+ break;
+ default:
+ console.log("QQQQ onShowTab(" + tab_index + ") - invalid tab index");
+ }
+ }
+
+ function startActivityIndicator() {
+ activityIndicator.start();
+ }
+
+ function stopActivityIndicator() {
+ activityIndicator.stop();
+ }
+
function monitor(device_addr, device_name) {
console.log("XXXX device selected");
_scan.setRemoteDevice(device_addr);
@@ -159,18 +168,6 @@ TabbedPane {
lblAvgCrankRpm.text = "Avg: " + avg_crank_rpm;
console.log("XXXX:QML done updating stats");
}
- onCreationCompleted: {
- console.log("YYYY current device name:" + _cscdc.getCurrentDeviceName());
- console.log("YYYY current device addr:" + _cscdc.getCurrentDeviceAddr());
- if (_cscdc.getCurrentDeviceAddr() != "") {
- tabbedPane.activeTab = monitor_tab;
- } else {
- tabbedPane.activeTab = scan_tab;
- _scan.deviceListing.discover();
- }
- }
- onActiveTabChanged: {
- }
Tab {
id: monitor_tab
title: "Monitor"
@@ -407,8 +404,8 @@ TabbedPane {
title: "Scan"
imageSource: "asset:///images/scan.png"
onTriggered: {
- _scan.deviceListing.discover();
- _scan.deviceListing.update();
+ console.log("QQQQ scan_tab onTriggered");
+ _cscm.scanForDevices();
}
Page {
actionBarVisibility: ChromeVisibility.Visible
@@ -437,6 +434,12 @@ TabbedPane {
}
horizontalAlignment: HorizontalAlignment.Center
}
+ ActivityIndicator {
+ id: activityIndicator
+ preferredWidth: 300
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+ }
Container {
topPadding: 20
leftPadding: 20
@@ -506,7 +509,7 @@ TabbedPane {
title: "About"
imageSource: "asset:///images/about.png"
onTriggered: {
- aboutInfo.open();
+ aboutInfo.open();
}
Page {
}
View
2,116 CscMonitor/assets/webview/js/jquery.flot.js
1,327 additions, 789 deletions not shown
View
10,312 CscMonitor/assets/webview/js/jquery.js
5,734 additions, 4,578 deletions not shown
View
2  CscMonitor/buildnum
@@ -1 +1 @@
-32
+36
View
14 CscMonitor/config.pri
@@ -91,7 +91,19 @@ lupdate_inclusion {
$$quote($$BASEDIR/../src/*.cxx) \
$$quote($$BASEDIR/../assets/*.qml) \
$$quote($$BASEDIR/../assets/*.js) \
- $$quote($$BASEDIR/../assets/*.qs)
+ $$quote($$BASEDIR/../assets/*.qs) \
+ $$quote($$BASEDIR/../assets/common/*.qml) \
+ $$quote($$BASEDIR/../assets/common/*.js) \
+ $$quote($$BASEDIR/../assets/common/*.qs) \
+ $$quote($$BASEDIR/../assets/images/*.qml) \
+ $$quote($$BASEDIR/../assets/images/*.js) \
+ $$quote($$BASEDIR/../assets/images/*.qs) \
+ $$quote($$BASEDIR/../assets/webview/*.qml) \
+ $$quote($$BASEDIR/../assets/webview/*.js) \
+ $$quote($$BASEDIR/../assets/webview/*.qs) \
+ $$quote($$BASEDIR/../assets/webview/js/*.qml) \
+ $$quote($$BASEDIR/../assets/webview/js/*.js) \
+ $$quote($$BASEDIR/../assets/webview/js/*.qs)
HEADERS += $$quote($$BASEDIR/../src/*.h) \
$$quote($$BASEDIR/../src/*.h++) \
View
4 CscMonitor/src/BluetoothHandler.cpp
@@ -416,3 +416,7 @@ void BluetoothHandler::stopCscNotifications() {
}
}
+
+void BluetoothHandler::discover() {
+ _deviceListing->discover();
+}
View
2  CscMonitor/src/BluetoothHandler.hpp
@@ -49,6 +49,8 @@ class BluetoothHandler: public QObject {
virtual ~BluetoothHandler();
void receiveCscNotifications();
void stopCscNotifications();
+ void discover();
+
private:
LocalDeviceInfo *_localDeviceInfo;
View
24 CscMonitor/src/CscMonitor.cpp
@@ -60,7 +60,9 @@ CscMonitor::CscMonitor(bb::cascades::Application *app) :
if (cscdc->getCurrentDeviceAddr() != NULL) {
monitor(cscdc->getCurrentDeviceAddr(), cscdc->getCurrentDeviceName());
- }
+ } else {
+ scanForDevices();
+ }
}
void CscMonitor::monitor(QString device_addr, QString device_name) {
@@ -101,3 +103,23 @@ void CscMonitor::logCscData(const QVariant &wheel,const QVariant &crank) {
void CscMonitor::cscDevicesFound() {
qDebug() << "YYYY CSC devices were found!";
}
+
+void CscMonitor::showTab(int tab_index)
+{
+ QMetaObject::invokeMethod(_root, "onShowTab", Q_ARG(QVariant, tab_index));
+}
+
+void CscMonitor::startActivityIndicator() {
+ QMetaObject::invokeMethod(_root, "startActivityIndicator");
+}
+
+void CscMonitor::stopActivityIndicator() {
+ QMetaObject::invokeMethod(_root, "stopActivityIndicator");
+}
+
+void CscMonitor::scanForDevices() {
+ showTab(1);
+ startActivityIndicator();
+ _handler->discover();
+ stopActivityIndicator();
+}
View
4 CscMonitor/src/CscMonitor.hpp
@@ -27,6 +27,7 @@ class CscMonitor : public QObject
// Q_INVOKABLE int getMinHr();
// Q_INVOKABLE int getMaxHr();
// Q_INVOKABLE int getAvgHr();
+ Q_INVOKABLE void scanForDevices();
bb::cascades::Application* _app;
private:
@@ -35,6 +36,9 @@ class CscMonitor : public QObject
QFuture<void> *_future;
QFutureWatcher<void> *_watcher;
QMutex _mutex;
+ void showTab(int tab_index);
+ void startActivityIndicator();
+ void stopActivityIndicator();
public slots:
void logCscData(const QVariant &wheel,const QVariant &crank);
View
289 CscMonitor/translations/CscMonitor.ts
@@ -35,24 +35,305 @@
</message>
</context>
<context>
+ <name>DeviceListing</name>
+ <message>
+ <location filename="../src/DeviceListing.cpp" line="61"/>
+ <source>Paired Bluetooth Devices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/DeviceListing.cpp" line="77"/>
+ <source>Searching for Bluetooth CSC Monitors ... please wait until search has completed ...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/DeviceListing.cpp" line="85"/>
+ <source>Search completed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/DeviceListing.cpp" line="116"/>
+ <source>Bluetooth Devices Nearby</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>LocalDeviceInfo</name>
+ <message>
+ <location filename="../src/LocalDeviceInfo.cpp" line="33"/>
+ <source>Unknown</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/LocalDeviceInfo.cpp" line="34"/>
+ <source>N/A</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/LocalDeviceInfo.cpp" line="49"/>
+ <location filename="../src/LocalDeviceInfo.cpp" line="50"/>
+ <source>true</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/LocalDeviceInfo.cpp" line="49"/>
+ <location filename="../src/LocalDeviceInfo.cpp" line="50"/>
+ <source>false</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/LocalDeviceInfo.cpp" line="53"/>
+ <source>Low energy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/LocalDeviceInfo.cpp" line="53"/>
+ <source>Regular</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>RemoteDeviceInfo</name>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="42"/>
+ <source>Unknown</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="43"/>
+ <source>N/A</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="61"/>
+ <source>Low energy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="61"/>
+ <source>Regular</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="64"/>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="69"/>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="72"/>
+ <source>true</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="64"/>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="69"/>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="72"/>
+ <source>false</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="104"/>
+ <source>Bluetooth BR/EDR Services</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="121"/>
+ <source>Bluetooth LE GATT Services</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="175"/>
+ <source>SDP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="177"/>
+ <source>RFCOMM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="179"/>
+ <source>OBEX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="181"/>
+ <source>HTTP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="183"/>
+ <source>L2CAP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="185"/>
+ <source>BNEP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="187"/>
+ <source>Service Discovery</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="189"/>
+ <source>Browse Group Descriptor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="191"/>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="195"/>
+ <source>Public Browse Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="193"/>
+ <source>Serial Port</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="197"/>
+ <source>OBEX Object Push</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="199"/>
+ <source>OBEX File Transfer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="201"/>
+ <source>Personal Area Networking</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="203"/>
+ <source>Network Access Point</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="205"/>
+ <source>Group Network</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="207"/>
+ <source>Generic Access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="209"/>
+ <source>Generic Attribute</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="211"/>
+ <source>ImmediateAlert</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="213"/>
+ <source>Link Loss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="215"/>
+ <source>Tx Power</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="217"/>
+ <source>Current Time Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="219"/>
+ <source>Reference Time Update Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="221"/>
+ <source>Next DST Change Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="223"/>
+ <source>Glucose</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="225"/>
+ <source>Health Thermometer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="227"/>
+ <source>Device Information</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="229"/>
+ <source>Heart Rate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="231"/>
+ <source>:Phone Alert Status Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="233"/>
+ <source>Battery Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="235"/>
+ <source>Blood Pressure</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="237"/>
+ <source>Alert Notification Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="239"/>
+ <source>Human Interface Device</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="241"/>
+ <source>Scan Parameters</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="243"/>
+ <source>Running Speed and Cadance</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/RemoteDeviceInfo.cpp" line="245"/>
+ <source>Other</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>main</name>
<message>
- <location filename="../assets/main.qml" line="187"/>
+ <location filename="../assets/main.qml" line="184"/>
<source>Cycling Monitor</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../assets/main.qml" line="425"/>
+ <location filename="../assets/main.qml" line="422"/>
<source>Available Monitors</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../assets/main.qml" line="484"/>
+ <location filename="../assets/main.qml" line="487"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../assets/main.qml" line="494"/>
+ <location filename="../assets/main.qml" line="497"/>
<source>Log Notifications</source>
<translation type="unfinished"></translation>
</message>
Please sign in to comment.
Something went wrong with that request. Please try again.