mirror of
https://github.com/sensebox/blockly-app
synced 2025-07-01 08:30:26 +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
|
||||
// Do not leave this enabled for long time use
|
||||
// #define ENABLE_DEBUG
|
||||
@{DEBUG_ENABLED}@
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
#define DEBUG(str) Serial.println(str)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<ion-header>
|
||||
<ion-toolbar color="secondary">
|
||||
<ion-title>
|
||||
Add Item
|
||||
Add sensor
|
||||
</ion-title>
|
||||
<ion-buttons end>
|
||||
<button ion-button icon-only (click)="close()"><ion-icon name="close"></ion-icon></button>
|
||||
|
@ -11,7 +11,6 @@
|
|||
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
|
||||
<ion-item>
|
||||
<ion-label floating>Phenomenon</ion-label>
|
||||
<ion-select [(ngModel)]="typ">
|
||||
|
|
|
@ -14,7 +14,7 @@ import { IonicPage, NavController, ViewController } from 'ionic-angular';
|
|||
templateUrl: 'add-item.html',
|
||||
})
|
||||
export class AddItemPage {
|
||||
|
||||
|
||||
title:string;
|
||||
typ:string;
|
||||
id:string;
|
||||
|
|
|
@ -57,6 +57,12 @@
|
|||
<ion-icon name="add" item-start></ion-icon>
|
||||
</button>
|
||||
</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>
|
||||
<button ion-item (click)="uploadStandardSketch()">
|
||||
|
|
|
@ -18,16 +18,9 @@ import { SensorDetailPage } from '../sensor-detail/sensor-detail';
|
|||
})
|
||||
export class ConfigurationPage {
|
||||
public sensors = [];
|
||||
temp: string;
|
||||
humi: string;
|
||||
lux: string;
|
||||
uv: string;
|
||||
pm10: string;
|
||||
pm25: string;
|
||||
ssid: string;
|
||||
pw: string;
|
||||
pressure: string;
|
||||
rain: string;
|
||||
ssid:string;
|
||||
pw:string;
|
||||
DEBUG_ENABLED:boolean;
|
||||
senseboxid: string;
|
||||
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",
|
||||
SENSEBOX_ID: this.senseboxid,
|
||||
defineSensors: this.buildDefines(),
|
||||
DEBUG_ENABLED:this.DEBUG_ENABLED?"#define ENABLE_DEBUG":"//#define ENABLE_DEBUG",
|
||||
NUM_SENSORS: this.sensors.length,
|
||||
};
|
||||
this.sensors.map((sensor)=>{
|
||||
|
@ -92,8 +86,10 @@ export class ConfigurationPage {
|
|||
this.sensors.map((sensor) => {
|
||||
defineString += "#define " + sensor.typ + "_CONNECTED\n"
|
||||
})
|
||||
|
||||
return defineString;
|
||||
}
|
||||
|
||||
addSensor() {
|
||||
let addModal = this.modalCtrl.create(AddItemPage);
|
||||
|
||||
|
@ -126,7 +122,7 @@ export class ConfigurationPage {
|
|||
|
||||
ionViewDidLoad() {
|
||||
this.sensors = [
|
||||
{ typ: "HDC1080", id: "5bb610bf043f3f001b6a4c55" },
|
||||
{ typ: "HDC1080", id: "5ca1e336cbf9ae001a6f1d88" },
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue