From 6076f396761ce0a7a1d372ac4f43cca7681060bc Mon Sep 17 00:00:00 2001 From: Matthias Pfeil Date: Wed, 28 Nov 2018 17:56:24 +0100 Subject: [PATCH] fix(edit): Make SerialPort configurable in editing mode Serial port for fine particular matter sensor can be configured for senseBox MCU models. --- .../controllers/account.box.edit.script.js | 24 ++++++++++++++++++- app/views/account.box.edit.script.html | 16 +++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/app/scripts/controllers/account.box.edit.script.js b/app/scripts/controllers/account.box.edit.script.js index bc634d05..232b1675 100644 --- a/app/scripts/controllers/account.box.edit.script.js +++ b/app/scripts/controllers/account.box.edit.script.js @@ -9,14 +9,36 @@ function EditBoxScriptController (boxData, AccountService) { var vm = this; + vm.box = boxData; + + vm.serialPort = 'Serial1'; vm.boxScript = ''; + vm.showConfiguration = false; + + vm.changeSerialPort = changeSerialPort; activate(); //// function activate () { - return AccountService.getScript(boxData._id) + if (boxData.model.startsWith('homeV2')) { + vm.showConfiguration = true; + } + + return getScript(); + } + + function changeSerialPort () { + vm.boxScript = 'Neuer Sketch wird generiert...'; + + return getScript(); + } + + function getScript () { + return AccountService.getScript(boxData._id, { + serialPort: vm.serialPort + }) .then(function (response) { vm.boxScript = response; }) diff --git a/app/views/account.box.edit.script.html b/app/views/account.box.edit.script.html index 5bd1a056..baf5a65a 100644 --- a/app/views/account.box.edit.script.html +++ b/app/views/account.box.edit.script.html @@ -1,6 +1,22 @@

{{'EDIT_SCRIPT'|translate}}


+
+

Konfiguration

+
+
+ +
+ +
+
+
+
+