From 60e5131850e9adf0eb144d3bd8899f7ee87ad89e Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Mon, 26 Feb 2018 23:17:03 +0100 Subject: [PATCH] Added description for flows and turn on and off option --- arduino/HalMultiSensor/HalConfiguration.h | 4 +- arduino/HalMultiSensor/Interrupt.cpp | 7 +- hal-default.db | Bin 23552 -> 23552 bytes resource/web/css/hal.css | 4 ++ resource/web/trigger.tmpl | 75 +++++++++++++++++++--- src/se/hal/page/TriggerHttpPage.java | 5 ++ src/se/hal/struct/TriggerFlow.java | 23 +++++-- 7 files changed, 99 insertions(+), 19 deletions(-) diff --git a/arduino/HalMultiSensor/HalConfiguration.h b/arduino/HalMultiSensor/HalConfiguration.h index 4fbe1342..aaeec5ce 100755 --- a/arduino/HalMultiSensor/HalConfiguration.h +++ b/arduino/HalMultiSensor/HalConfiguration.h @@ -6,7 +6,7 @@ #define TIMER_MILLISECOND 60000 // poling in minutes #define INDICATOR_PIN 13 // diode -#define DEVICE_BASE_ID 20 +#define DEVICE_BASE_ID 98 // POWER CONSUMPTION SENSOR //#define POWERCON_ENABLED // comment out to disable sensor @@ -21,7 +21,7 @@ #define TEMPERATURE_TIMER_MULTIPLIER 10 // LIGHT SENSOR -#define LIGHT_ENABLED // comment out to disable sensor +//#define LIGHT_ENABLED // comment out to disable sensor #define LIGHT_SENSOR SensorBH1750() #define LIGHT_PROTOCOL ProtocolOregon(11, DEVICE_BASE_ID + 3) #define LIGHT_TIMER_MULTIPLIER 10 diff --git a/arduino/HalMultiSensor/Interrupt.cpp b/arduino/HalMultiSensor/Interrupt.cpp index 4389e570..009af7e7 100755 --- a/arduino/HalMultiSensor/Interrupt.cpp +++ b/arduino/HalMultiSensor/Interrupt.cpp @@ -36,13 +36,14 @@ void Interrupt::sleep() sleep_enable(); // enables the sleep bit in the mcucr register // so sleep is possible. just a safety pin - power_adc_disable(); + //power_adc_disable(); //power_spi_disable(); + //power_usart0_disable(); //power_timer0_disable(); //power_timer1_disable(); //power_timer2_disable(); //power_twi_disable(); - //power_all_disable() + //power_all_disable(); while( ! Interrupt::wakeUpNow) { @@ -52,7 +53,7 @@ void Interrupt::sleep() sleep_disable(); // first thing after waking from sleep: // disable sleep... - power_adc_enable(); + //power_adc_enable(); //power_spi_enable(); //power_usart0_enable(); //power_timer0_enable(); diff --git a/hal-default.db b/hal-default.db index f68f708a724d763a89f3e8bde8abd376ae489d71..cbdd384b4c430bc3cb112edf54f1448e2a2b6f2c 100755 GIT binary patch delta 271 zcmZqJ!Pu~aae}nq9tH*maUd22VkQO#M!|_X#;ki7^cbTyrici$=rf0NO!l`^W#ZT0 zyjVDfgVA)845NlIP%#^0Cj)aLvkB8ArewxLjGc^PjAB4xG|-qC$}S!r&e&u)Io8FW zQE>8Fmpm>VF3yD1yu_rO)X4|6Bv`mKGs7m!yJqkU12sE>3@{I46Zck~d{9ARa=N<| zw{W8z&=gfw#>V=|-R`nLQ&zf%qM5?MrKxMfChjN=(zSV+Yds?m7sx0U5Wyh0S&-#D X^TYtwMI0;>1K3#^fnp+Xu@DXb`?xuo delta 317 zcmZqJ!Pu~aae}nqP6h@BaUd23VkRJdH&Mr!bti-F#~m9}M1)yXn8P_H``f89@vCfJ zEF8nZXtGI$Q6q*~m4S`1gMq1yDUxwJV+V5+vnQi0qbx&Xr8T>FcsOHIU`b+9PHJ&s zPG(7JQc-?+acWU~QEFadV}vb40Y938Mt6I#L}Tt`FFP%em5d^jOYK}IpLEgW;L^-= zU=yzmpL|e3VzP;=54)(Y4V$>5G>E^s(XF0Q3+QqcZ&gNy%se)GHXw(A!Q75b93qmE zS^;*5InWGmRj?V$U8T50Yk)SYsxmfOPd?)+3$$&6o9N{Kt`2-$nqUJM7#M-H;ATOe RFU*@PxLFuQz|2J<8~{F;Q+@yd diff --git a/resource/web/css/hal.css b/resource/web/css/hal.css index ab56ffac..b34f6adb 100755 --- a/resource/web/css/hal.css +++ b/resource/web/css/hal.css @@ -99,6 +99,10 @@ body { box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) } +.disabled { + background-color: lightgray; + opacity: .6; +} /* * Placeholder dashboard ideas diff --git a/resource/web/trigger.tmpl b/resource/web/trigger.tmpl index 1b90bda3..b5d77455 100755 --- a/resource/web/trigger.tmpl +++ b/resource/web/trigger.tmpl @@ -13,16 +13,18 @@
-
- -
- -
-
+ {{.getName()}} +
+ +
-
+
@@ -138,9 +140,63 @@ $(function(){ initDynamicModalForm("triggerModal", "trigger-data-conf", "trigger-data-conf-template"); initDynamicModalForm("actionModal", "action-data-conf", "action-data-conf-template"); + + $("#flowModal").on('show.bs.modal', function (event) { + var button = $(event.relatedTarget); + var modal = $(this); + modal.find("input[type=text]").val(""); // Reset all inputs + + modal.find("input[name=flow-id]").val(button.data("flow-id")); + modal.find("input[name=name]").val(button.data("name")); + modal.find("input[name=enabled]").prop('checked', button.data("enabled")); + modal.find("input[name=enabled]").bootstrapSwitch('state', button.data("enabled"), true); + }); }); + +