mirror of
https://github.com/sensebox/blockly-app
synced 2025-07-02 01:30:24 +02:00
debug checkbox
This commit is contained in:
parent
e02014cb78
commit
922814fb09
5 changed files with 16 additions and 15 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
// Uncomment the next line to get debugging messages printed on the Serial port
|
// Uncomment the next line to get debugging messages printed on the Serial port
|
||||||
// Do not leave this enabled for long time use
|
// Do not leave this enabled for long time use
|
||||||
// #define ENABLE_DEBUG
|
@{DEBUG_ENABLED}@
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG
|
#ifdef ENABLE_DEBUG
|
||||||
#define DEBUG(str) Serial.println(str)
|
#define DEBUG(str) Serial.println(str)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar color="secondary">
|
<ion-toolbar color="secondary">
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Add Item
|
Add sensor
|
||||||
</ion-title>
|
</ion-title>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<button ion-button icon-only (click)="close()"><ion-icon name="close"></ion-icon></button>
|
<button ion-button icon-only (click)="close()"><ion-icon name="close"></ion-icon></button>
|
||||||
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label floating>Phenomenon</ion-label>
|
<ion-label floating>Phenomenon</ion-label>
|
||||||
<ion-select [(ngModel)]="typ">
|
<ion-select [(ngModel)]="typ">
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { IonicPage, NavController, ViewController } from 'ionic-angular';
|
||||||
templateUrl: 'add-item.html',
|
templateUrl: 'add-item.html',
|
||||||
})
|
})
|
||||||
export class AddItemPage {
|
export class AddItemPage {
|
||||||
|
|
||||||
title:string;
|
title:string;
|
||||||
typ:string;
|
typ:string;
|
||||||
id:string;
|
id:string;
|
||||||
|
|
|
@ -57,6 +57,12 @@
|
||||||
<ion-icon name="add" item-start></ion-icon>
|
<ion-icon name="add" item-start></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<ion-row>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Enable debug</ion-label>
|
||||||
|
<ion-checkbox [(ngModel)]="DEBUG_ENABLED"></ion-checkbox>
|
||||||
|
</ion-item>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<button ion-item (click)="uploadStandardSketch()">
|
<button ion-item (click)="uploadStandardSketch()">
|
||||||
|
|
|
@ -18,16 +18,9 @@ import { SensorDetailPage } from '../sensor-detail/sensor-detail';
|
||||||
})
|
})
|
||||||
export class ConfigurationPage {
|
export class ConfigurationPage {
|
||||||
public sensors = [];
|
public sensors = [];
|
||||||
temp: string;
|
ssid:string;
|
||||||
humi: string;
|
pw:string;
|
||||||
lux: string;
|
DEBUG_ENABLED:boolean;
|
||||||
uv: string;
|
|
||||||
pm10: string;
|
|
||||||
pm25: string;
|
|
||||||
ssid: string;
|
|
||||||
pw: string;
|
|
||||||
pressure: string;
|
|
||||||
rain: string;
|
|
||||||
senseboxid: string;
|
senseboxid: string;
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams, private http: HttpClient, public modalCtrl: ModalController) {
|
constructor(public navCtrl: NavController, public navParams: NavParams, private http: HttpClient, public modalCtrl: ModalController) {
|
||||||
}
|
}
|
||||||
|
@ -53,6 +46,7 @@ export class ConfigurationPage {
|
||||||
INGRESS_DOMAIN: "ingress.opensensemap.org",
|
INGRESS_DOMAIN: "ingress.opensensemap.org",
|
||||||
SENSEBOX_ID: this.senseboxid,
|
SENSEBOX_ID: this.senseboxid,
|
||||||
defineSensors: this.buildDefines(),
|
defineSensors: this.buildDefines(),
|
||||||
|
DEBUG_ENABLED:this.DEBUG_ENABLED?"#define ENABLE_DEBUG":"//#define ENABLE_DEBUG",
|
||||||
NUM_SENSORS: this.sensors.length,
|
NUM_SENSORS: this.sensors.length,
|
||||||
};
|
};
|
||||||
this.sensors.map((sensor)=>{
|
this.sensors.map((sensor)=>{
|
||||||
|
@ -92,8 +86,10 @@ export class ConfigurationPage {
|
||||||
this.sensors.map((sensor) => {
|
this.sensors.map((sensor) => {
|
||||||
defineString += "#define " + sensor.typ + "_CONNECTED\n"
|
defineString += "#define " + sensor.typ + "_CONNECTED\n"
|
||||||
})
|
})
|
||||||
|
|
||||||
return defineString;
|
return defineString;
|
||||||
}
|
}
|
||||||
|
|
||||||
addSensor() {
|
addSensor() {
|
||||||
let addModal = this.modalCtrl.create(AddItemPage);
|
let addModal = this.modalCtrl.create(AddItemPage);
|
||||||
|
|
||||||
|
@ -126,7 +122,7 @@ export class ConfigurationPage {
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
this.sensors = [
|
this.sensors = [
|
||||||
{ typ: "HDC1080", id: "5bb610bf043f3f001b6a4c55" },
|
{ typ: "HDC1080", id: "5ca1e336cbf9ae001a6f1d88" },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue