Translations:Битовые операции/36/en — различия между версиями

Материал из WebHMI Wiki
Перейти к: навигация, поиск
(Новая страница: «Then the script that will handle all these situations and generate the necessary flags in their places can look like this: <syntaxhighlight lang = lua> allAlerts…»)
 
 
Строка 2: Строка 2:
 
<syntaxhighlight lang = lua>
 
<syntaxhighlight lang = lua>
 
allAlerts = {          -- регистр    бит - код ошибки    тип операции
 
allAlerts = {          -- регистр    бит - код ошибки    тип операции
               {srcAlias = "pv1Status", bits = {[1] = 1}, "bit9"},
+
               {srcAlias = "pv1Status", bits = {[1] = 1}, checktype = "bit9"},
               {srcAlias = "vfdStatus_1", bits = {[2] =  10, [3] = 20, [4] = 30, [5] = 40}, "=="},
+
               {srcAlias = "vfdStatus_1", bits = {[2] =  10, [3] = 20, [4] = 30, [5] = 40}, checktype = "=="},
               {srcAlias = "vfdStatus_2",  bits = {[6] =  10, [7] = 20, [8] = 30, [9] = 40}, "=="},
+
               {srcAlias = "vfdStatus_2",  bits = {[6] =  10, [7] = 20, [8] = 30, [9] = 40}, checktype = "=="},
               {srcAlias = "pv1ZoneHumidity", bits = {[10] = 90}, ">="}
+
               {srcAlias = "pv1ZoneHumidity", bits = {[10] = 90}, checktype = ">="}
 
  }
 
  }

Текущая версия на 12:38, 31 мая 2018

Информация о сообщении (править)
Это сообщение не имеет описания. Если вы знаете, где или как это сообщение используется, то можете помочь другим переводчикам, добавив к нему описание.
Формулировка сообщения (Битовые операции)
Тогда скрипт, который обработает все эти ситуации и сформирует нужные флаги на своих местах может выглядеть так:
<syntaxhighlight lang = lua>
allAlerts = {          -- регистр    бит - код ошибки    тип операции
             {srcAlias = "pv1Status", bits = {[1] = 1}, checktype = "bit9"},
             {srcAlias = "vfdStatus_1", bits = {[2] =  10, [3] = 20, [4] = 30, [5] = 40}, checktype = "=="},
             {srcAlias = "vfdStatus_2",  bits = {[6] =  10, [7] = 20, [8] = 30, [9] = 40}, checktype = "=="},
             {srcAlias = "pv1ZoneHumidity", bits = {[10] = 90}, checktype = ">="}
 }
ПереводThen the script that will handle all these situations and generate the necessary flags in their places can look like this:
<syntaxhighlight lang = lua>
allAlerts = {          -- регистр    бит - код ошибки    тип операции
             {srcAlias = "pv1Status", bits = {[1] = 1}, checktype = "bit9"},
             {srcAlias = "vfdStatus_1", bits = {[2] =  10, [3] = 20, [4] = 30, [5] = 40}, checktype = "=="},
             {srcAlias = "vfdStatus_2",  bits = {[6] =  10, [7] = 20, [8] = 30, [9] = 40}, checktype = "=="},
             {srcAlias = "pv1ZoneHumidity", bits = {[10] = 90}, checktype = ">="}
 }

Then the script that will handle all these situations and generate the necessary flags in their places can look like this:

allAlerts = {          -- регистр    бит - код ошибки    тип операции
              {srcAlias = "pv1Status", bits = {[1] = 1}, checktype = "bit9"},
              {srcAlias = "vfdStatus_1", bits = {[2] =  10, [3] = 20, [4] = 30, [5] = 40}, checktype = "=="},
              {srcAlias = "vfdStatus_2",   bits = {[6] =  10, [7] = 20, [8] = 30, [9] = 40}, checktype = "=="},
              {srcAlias = "pv1ZoneHumidity", bits = {[10] = 90}, checktype = ">="}
 }