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 = $('