Line 27: |
Line 27: |
| prf="prf('TEXT %[flags][wigth][.precision]type', STATUS)" | | prf="prf('TEXT %[flags][wigth][.precision]type', STATUS)" |
| | | |
− | *TEXT – unchangeable text to be displayed; | + | *TEXT – отображаемый неизменяемый текст; |
− | *flags, wigth, precision, type – status formatting description, see sprintf. | + | *flags, with, precision, type — описание форматирования статуса, см. sprintf. |
− | *STATUS – status description | + | *STATUS – описание статуса |
− | **id() – device id, u16 | + | **id() – идентификатор устройства, u16 |
− | **subId() – device subId, u8 | + | **subId() — subId устройства, u8 |
− | **addr() – device address, u32 | + | **addr() — адрес устройства, u32 |
− | **addrString() – device address textually | + | **addrString() – текстовый адрес устройства |
− | **statusStringHex() – device status string as hexadecimal notation | + | **statusStringHex() – строка состояния устройства в шестнадцатеричном виде. |
− | **statusString() – string with the device status | + | **statusString() – строка со статусом устройства |
− | **statusString(u32 byteOffset = 0) – string with the device status with byteOffset offset | + | **statusString(u32 byteOffset = 0) – строка со статусом устройства со смещением byteOffset |
− | **statusString(u32 byteOffset=0, u32 len=0) – string with the device status with byteOffset offset and length len | + | **statusString(u32 byteOffset=0, u32 len=0) – строка со статусом устройства со смещением byteOffset и длиной len |
− | **status() – device status, i8 | + | **status() — статус устройства, i8 |
− | **status(u32 byteOffset = 0) – device status with byteOffset offset, i8 | + | **status(u32 byteOffset = 0) — статус устройства со смещением byteOffset, i8 |
− | **statusU() – device status, u8 | + | **statusU() — статус устройства, u8 |
− | **statusBit1Count() – number of status bit(?) | + | **statusBit1Count() – количество бит состояния(?) |
− | **statusRgb() – RGB status, 0xRRGGBB | + | **statusRgb() — статус RGB, 0xRRGGBB |
− | **statusU16(u32 byteOffset=0) – device status, u16 | + | **statusU16(u32 byteOffset=0) – статус устройства, u16 |
− | **statusU32(u32 byteOffset=0) – device status, u32 | + | **statusU32(u32 byteOffset=0) – статус устройства, u32 |
− | **statusBit(u32 byteOffset=0, u32 bitOffset=0) – state of status bit with bitOffset offset, with byteOffset byte offset, | + | **statusBit(u32 byteOffset=0, u32 bitOffset=0) – состояние бита состояния со смещением bitOffset, с байтовым смещением byteOffset, |
− | **statusBit(u32 bitOffset=0) – state of status bit with bitOffset offset | + | **statusBit(u32 bitOffset=0) – состояние бита состояния со смещением bitOffset |
− | **statusBits(u32 byteOffset=0, u32 bitOffset=0, u32 len=0) – len bit status starting from bitOffset of byteOffset byte | + | **statusBits(u32 byteOffset=0, u32 bitOffset=0, u32 len=0) – статус бита len, начиная с bitOffset байта byteOffset |
− | **statusBits(u32 bitOffset=0, u32 len=0) – len bit status starting from bitOffset | + | **statusBits(u32 bitOffset=0, u32 len=0) – статус бита len, начиная с bitOffset |
− | **statusFloat() – status fractional (status/250) | + | **statusFloat() — дробный статус (status/250) |
− | **statusFloat() – status unsigned fractional (status/250) | + | **statusFloat() – беззнаковая дробная часть состояния (status/250) |
− | **statusFloat2(u32 byteOffset=0) – status fractional (status/256) | + | **statusFloat2(u32 byteOffset=0) – статус дробный (status/256) |
− | **statusFloat2U(u32 byteOffset=0) – status unsigned fractional (status/256) with byteOffset offset | + | **statusFloat2U(u32 byteOffset=0) – беззнаковая дробь состояния (status/256) со смещением byteOffset |
− | **statusFloat(u32 byteOffset=0) – status fractional (status/250) with byteOffset offset | + | **statusFloat(u32 byteOffset=0) – дробный статус (status/250) со смещением byteOffset |
− | **statusLevel() – level (for example, dimmer) | + | **statusLevel() — уровень (например, диммер) |
− | **statusFloatString() – string with status fractional (status/250) | + | **statusFloatString() – строка с дробным статусом (status/250) |
− | **statusFloatString(u32 byteOffset = 0) – string with status fractional (status/250) with byteOffset offset | + | **statusFloatString(u32 byteOffset = 0) — строка с дробным статусом (status/250) со смещением byteOffset |
− | **statusFloatString2() – string with status fractional (status/256) | + | **statusFloatString2() – строка с дробным статусом (status/256) |
− | **statusFloatString2(u32 byteOffset=0) – string with status fractional (status/256) with byteOffset offset | + | **statusFloatString2(u32 byteOffset=0) – строка с дробным статусом (status/256) со смещением byteOffset |
| | | |
| | | |
− | It is also possible to specify the conditions, for example:
| + | Также можно указать условия, например: |
| | | |
| prf=" prf('Text%s', status(0)?'Yes':'No') | | prf=" prf('Text%s', status(0)?'Yes':'No') |
| | | |
− | if status(0) is true "Text Yes" will be displayed, otherwise "Text No" appears
| + | если статус (0) равен true, будет отображаться "Text Yes", в противном случае отображается "Text No" |
| | | |
− | Or receive the devices status. For example, there is a curtain 343:22 and a lamp 299:1:
| + | Или получить статус устройств. Например, есть штора 343:22 и лампа 299:1: |
| | | |
| <syntaxhighlight lang="cpp" line> | | <syntaxhighlight lang="cpp" line> |
Line 73: |
Line 73: |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | Status setting for such an element is the following: setStatus(299:201,{134,"Text"});
| + | Установка статуса для такого элемента следующая: setStatus(299:201,{134,"Text"}); |
| | | |
− | After status setting in the text field the following will be displayed:
| + | После установки статуса в текстовом поле будет отображаться следующее: |
| | | |
| "Curtain is opening | | "Curtain is opening |
Line 82: |
Line 82: |
| String Text" | | String Text" |
| | | |
− | "Curtain" will depend on curtain status, | + | "Curtain" будет зависеть от статуса шторы, |
| | | |
− | "Status" will be "Off" if 0 byte with mask of 7 status 299:21 equals to zero, otherwise "Status" will be "On"
| + | Статус будет "Off", если 0 байт с маской 7 статуса 299:21 равен нулю, иначе Статус будет "On" |