Translations:Rule Examples/219/en: различия между версиями

Материал из Wiren Board
(Новая страница: «When the CO2 concentration is over 1001, we flash red once a second. <div class="mw-collapsible mw-collapsed"; style="width:600px; overflow: hidden;"> <syntaxhighlight lang="ecmascript"> defineRule("msw3_co2", { whenChanged: "wb-msw-v3_97/CO2", then: function(newValue, devName, cellName) { var co2_good = newValue < 650; var co2_middle = newValue < 1000 && newValue > 651; var co2_bad = newValue > 1001;»)
 
(нет различий)

Текущая версия на 20:46, 21 сентября 2022

Определение сообщения (Rule Examples)
При концентрации CO2 свыше 1001 - раз в секунду мигаем красным.
<div class="mw-collapsible mw-collapsed"; style="width:600px; overflow: hidden;">
<syntaxhighlight lang="ecmascript">
defineRule("msw3_co2", {
   whenChanged: "wb-msw-v3_97/CO2",
   then: function(newValue, devName, cellName) {
       var co2_good = newValue < 650;
       var co2_middle = newValue < 1000 && newValue > 651;
       var co2_bad = newValue > 1001;

When the CO2 concentration is over 1001, we flash red once a second.

<syntaxhighlight lang="ecmascript"> defineRule("msw3_co2", {

   whenChanged: "wb-msw-v3_97/CO2",
   then: function(newValue, devName, cellName) {
       var co2_good = newValue < 650;
       var co2_middle = newValue < 1000 && newValue > 651;
       var co2_bad = newValue > 1001;