From b5070a8b7153663c4ed621b173c17ce0ef744bee Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Mon, 20 Jun 2016 16:45:04 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9D2016-06-20=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/device/CC2650/cc2650_accelerometer.js | 6 +- .../app/js/device/CC2650/cc2650_barometer.js | 108 ++++++++++------- .../app/js/device/CC2650/cc2650_humidity.js | 15 ++- .../app/js/device/CC2650/cc2650_luxometer.js | 2 +- .../app/js/device/CC2650/cc2650_thermopile.js | 50 +------- .../sensortoy/app/js/standards/capability.js | 27 +++-- .../app/partials/cc2650_barometer_dial.ejs | 68 +++++++++++ .../app/partials/cc2650_humidity.ejs | 41 +++++++ .../app/partials/cc2650_thermopile_dial.ejs | 37 +----- .../2.2.1/taskArtifacts/cache.properties.lock | Bin 17 -> 17 bytes .../2.2.1/taskArtifacts/fileHashes.bin | Bin 155035 -> 155257 bytes .../2.2.1/taskArtifacts/fileSnapshots.bin | Bin 11360782 -> 11360782 bytes .../2.2.1/taskArtifacts/taskArtifacts.bin | Bin 61031 -> 61031 bytes .../js/device/CC2650/cc2650_accelerometer.js | 6 +- .../www/js/device/CC2650/cc2650_barometer.js | 110 +++++++++++------- .../www/js/device/CC2650/cc2650_humidity.js | 15 ++- .../www/js/device/CC2650/cc2650_luxometer.js | 2 +- .../www/js/device/CC2650/cc2650_thermopile.js | 50 +------- .../assets/www/js/standards/capability.js | 27 +++-- .../www/partials/cc2650_barometer_dial.ejs | 68 +++++++++++ .../assets/www/partials/cc2650_humidity.ejs | 41 +++++++ .../www/partials/cc2650_thermopile_dial.ejs | 37 +----- 22 files changed, 436 insertions(+), 274 deletions(-) create mode 100644 sensortoy/sensortoy/app/partials/cc2650_barometer_dial.ejs create mode 100644 sensortoy/sensortoy/app/partials/cc2650_humidity.ejs create mode 100644 sensortoy/sensortoy/platforms/android/assets/www/partials/cc2650_barometer_dial.ejs create mode 100644 sensortoy/sensortoy/platforms/android/assets/www/partials/cc2650_humidity.ejs diff --git a/sensortoy/sensortoy/app/js/device/CC2650/cc2650_accelerometer.js b/sensortoy/sensortoy/app/js/device/CC2650/cc2650_accelerometer.js index 38b5d44..29783dc 100644 --- a/sensortoy/sensortoy/app/js/device/CC2650/cc2650_accelerometer.js +++ b/sensortoy/sensortoy/app/js/device/CC2650/cc2650_accelerometer.js @@ -370,17 +370,17 @@ CC2650_ACCEL = function(p) { row = $('
', {class: 'mui-row'}); $('
', { - class: 'mui-col-xs-4 mui--text-dark mui--text-center', + class: 'mui-col-xs-4 mui--text-light mui--text-center', text: '--', id: this.frames[modeID] + '-x' }).appendTo(row); $('
', { - class: 'mui-col-xs-4 mui--text-dark mui--text-center', + class: 'mui-col-xs-4 mui--text-light mui--text-center', text: '--', id: this.frames[modeID] + '-y' }).appendTo(row); $('
', { - class: 'mui-col-xs-4 mui--text-dark mui--text-center', + class: 'mui-col-xs-4 mui--text-light mui--text-center', text: '--', id: this.frames[modeID] + '-z' }).appendTo(row); diff --git a/sensortoy/sensortoy/app/js/device/CC2650/cc2650_barometer.js b/sensortoy/sensortoy/app/js/device/CC2650/cc2650_barometer.js index 2afb6b5..524fcd6 100644 --- a/sensortoy/sensortoy/app/js/device/CC2650/cc2650_barometer.js +++ b/sensortoy/sensortoy/app/js/device/CC2650/cc2650_barometer.js @@ -5,7 +5,7 @@ * Time: 10:13 * */ -/* global CAPABILITY, inheritsFrom, capabilityManager, device */ +/* global CAPABILITY, inheritsFrom, capabilityManager, EJS */ /* global ble */ /* jshint browser: true , devel: true*/ @@ -84,15 +84,22 @@ var CC2650_BAR = function(p) { }; this.animateGraph = function() { - this.simpleGraph(this.data.temp, 'temp'); - this.simpleGraph(this.data.pressure, 'pressure'); + /* This.simpleGraph(this.data.temp, 'temp'); + this.simpleGraph(this.data.pressure, 'pressure');*/ + + var arcTemp = this.frameID + 'temp-arc'; + var arcPressure = this.frameID + 'pressure-arc'; + this.updateArc(this.data.temp, 'temp' , arcTemp, '°C', 50); + this.updateArc(this.data.pressure, 'pressure' , arcPressure, 'hPa'); + + + }; this.insertFrame = function() { var self = this; - var blankChart; // Call the parent displayForm first... this.superClass_.insertFrame.call(self); @@ -100,63 +107,76 @@ var CC2650_BAR = function(p) { var temp = this.frameID + '-t'; var pressure = this.frameID + '-p'; + var arcB = this.frameID + 'temp-arcB'; + var arcTemp = this.frameID + 'temp-arc'; + + var pressureArcB = this.frameID + 'pressure-arcB'; + var arcPressure = this.frameID + 'pressure-arc'; + var settings = {data: {baseID: this.frameID}}; - var html = new EJS({url: './partials/cc2650_barometer.ejs'}).render(settings); + var html = new EJS({url: './partials/cc2650_barometer_dial.ejs'}).render(settings); - this.$id.append(html); + this.$id.append(html); - /* var row = $('
', {class: 'mui-row'}); + document.getElementById(arcB).setAttribute('d', this.describeArc(150, 150, 100, 0, 240)); + document.getElementById(arcTemp).setAttribute('d', this.describeArc(150, 150, 100, 0, this.setArc(0))); - $('
', { class: 'mui-col-xs-3 mui--text-accent mui--text-right', text: 'Temp:'}).appendTo(row); + document.getElementById(pressureArcB).setAttribute('d', this.describeArc(150, 150, 100, 0, 240)); + document.getElementById(arcPressure).setAttribute('d', this.describeArc(150, 150, 100, 0, this.setArc(0))); - $('
', { class: 'mui-col-xs-3 mui--text-dark', id: temp}).appendTo(row); - $('
', { class: 'mui-col-xs-3 mui--text-accent mui--text-right', text: 'Pressure:'}).appendTo(row); - $('
', { class: 'mui-col-xs-3 mui--text-dark', id: pressure}).appendTo(row); + /* Var row = $('
', {class: 'mui-row'}); - this.$id.append(row); + $('
', { class: 'mui-col-xs-3 mui--text-accent mui--text-right', text: 'Temp:'}).appendTo(row); - if (/ipad/i.test(device.model)) { + $('
', { class: 'mui-col-xs-3 mui--text-dark', id: temp}).appendTo(row); + $('
', { class: 'mui-col-xs-3 mui--text-accent mui--text-right', text: 'Pressure:'}).appendTo(row); - tabBody = $('
', {class: 'mui-row'}); + $('
', { class: 'mui-col-xs-3 mui--text-dark', id: pressure}).appendTo(row); - tabBody.append($('
',{class: 'mui-col-md-6'}).append(this.generateBlankGraph('temp'))) ; - tabBody.append($('
',{class: 'mui-col-md-6'}).append(this.generateBlankGraph('pressure'))) ; - this.$id.append(tabBody); + this.$id.append(row); - } else { + if (/ipad/i.test(device.model)) { - var tabBody = $('