Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
|
COVID19 Pandemic has been periling the World since January 2020. As of 9 July 2020, more than 12.1 million caseshave been reported across 188 countries and territories, resulting in more than 552, 000 deaths and a Vaccine is is not expected until 2021 at the earliest. So there comes our part of Maintaining Social Distancing, Hand Sanitizing and much more. So we will be using InfluxDB and Grafana Dashboard to plot the Air TVOC and CO2 Concentration, in order to alert the people of a specific area where this System is Located.
Idea and Working Prototype💡- In order to achieve this project, we will be using NXP Rapid IoT Kit which will read the Air TVOC and CO2 concentration, and a BalenaFin for data logging and visualization. So without further due, lets get started.
- For providing a 24/4*365 Internet Connect, I choose Soracom 3G IoT SIM card and a Huawei MS2131 USB Stick
- In the Raspbian Stretch desktop, open up a terminal, let’s configure the 3G USB modem.
$ sudo curl -O https://soracom-files.s3.amazonaws.com/starterkit/setup.sh
$ sudo chmod +x setup.sh
$ sudo ./setup.sh # Run the Setup Script
Package Dependencies:
Get the latest of all known packages from sources
$ sudo apt-get update
$ sudo apt-get full-upgrade
$ sudo pip3 install --upgrade pip
Prerequisites: Docker, Docker-Compose, bluepy
$ curl -sSL https://get.docker.com | sh
$ sudo apt-get install docker-compose
$ sudo pip3 install bluepy
$ sudo pip3 install influxdb
Atmosphere IoT Project And Setting up BalenaFin for obtaining Data:- Next, we need to make our
Air TVOC and CO2
Reader for NXP Rapid IoT Kit using Atmosphere IoT Studio.
- We have used 2 BLE GATT Characteristic features to publish our
Air TVOC and CO2
Readings every Second. The sensor values are also displayed on the Home Page. The touch sensor is used to navigate between the pages. - The Atmosphere Project is saved as
.atmo
but for the IoT Kit to read it, it will be compiled in.bin
file. - Download the
.bin
firmware file and load it onto the NXP Rapid IoT Kit. (For more information on how-to-program, refer here). - Note: For obtaining BLE data, we will need the 128-BIT UUID CHARACTERISTIC of
TVOCChar
andCO2Char.
Note the UUID, for example UUID for this Kit is:
Air TVOC Data UUID : 1c937954-8c8e-433b-b06d-2ec5ad18ca9d
CO2 Data UUID : 1c937954-8c8e-433b-b06d-2ec5ad18ca9e
- Next we will need to pair the Rapid IoT Kit and BalenaFin, for that open up a terminal and use
bluetoothctl.
Now to start Discovering Bluetooth Device usescan on
.
Now lets configure the BalenaFin for using BLE Data onto InfluxDB and Grafana. The Best way to get your hands dirty with InfluxDB and Grafana is by using Docker Containers. Thanks to gonzalo123 for docker compose images build for Raspberry Pi.
- Start by cloning the iot.grafana Github Repository
$ git clone https://github.com/gonzalo123/iot.grafana.git
$ cd iot.grafana
- Now to start the Docker Images, run:
$ sudo service docker start
$ sudo docker-compose up
- After Starting, this will host our InfluxDB and Grafana at the following URLs
InfluxDB - http://localhost:8086/
Grafana - http://localhost:3000/
- Now, we will need to create a database to store our AIR TVOC and CO2 Concentration:
$ curl -i -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE TVOC_CO2"
By
this, our Database will be up and running and so we need to feed it with our data from the Rapid IoT Kit. For this we will usenohup
with ourInfluxDB.py,
that will feed the data into our database.- To start the code, the following bash command can be used:
$ nohup python3 InfluxDB.py <MBL> &
Replace <MBL>
with the Mac id of your Rapid IoT Kit.
- Now to setup the Grafana Dashboard, head to
http://localhost:3000/
and then log in using your credentials. Then Add your Data Source, in our case the InfluxDB.
- Therefore we can create dashboards of Air TVOC and CO2 and this could be streamed using Python Flask Server for real time observation of Air Quality.
- This way the People can find out which place is polluted, i.e vulnerable to spread virus and those places can be avoided.
Slainte!
import sys
import binascii
import struct
import time
from bluepy.btle import UUID, Peripheral
from influxdb import InfluxDBClient
import datetime
import logging
def persists(measurement, value):
json_body = [
{
"measurement": measurement,
"tags": {
"ble_address" : sys.argv[1]
},
"time": datetime.datetime.utcnow().isoformat(),
"fields": {
"value": value
}
}
]
logging.info(json_body)
influx_client.write_points(json_body)
logging.basicConfig(level=logging.INFO)
influx_client = InfluxDBClient('localhost', 8086, database='TVOC_CO2')
service_uuid = UUID("1c937954-8c8e-433b-b06d-2ec5ad18ca9c")
char_TVOC_uuid = UUID("1c937954-8c8e-433b-b06d-2ec5ad18ca9d")
char_CO2_uuid = UUID("1c937954-8c8e-433b-b06d-2ec5ad18ca9e")
if len(sys.argv) != 2:
print("Fatal, must pass device address:", sys.argv[0], "<device address="">")
quit()
p = Peripheral(sys.argv[1])
print("Connected")
#for service in p.getServices():
# print(service.uuid)
ButtonService=p.getServiceByUUID(service_uuid)
print("Got service")
try:
ch_TVOC = ButtonService.getCharacteristics(char_TVOC_uuid)[0]
ch_CO2 = ButtonService.getCharacteristics(char_CO2_uuid)[0]
print("Fetched Characteristics")
while 1:
print("read")
TVOCVal = struct.unpack('<f', ch_TVOC.read())[0]
CO2Val = struct.unpack('<f', ch_CO2.read())[0]
print (TVOCVal)
print (CO2Val)
persists("Air TVOO", TVOCVal);
persists("CO2", CO2Val);
time.sleep(1)
finally:
p.disconnect()
{
"name": "Air Quality Logger",
"createVersion": "2020-24-01",
"description": "Air Quality Logger\nCopyright 2019 - ElectronicsVille Foundation",
"lastModified": "2020-02-10T17:54:00.634Z",
"created": "2020-02-10T17:54:00.634Z",
"meta": {
"projectTypeName": "NXP Rapid IoT",
"projectTypeId": "NxpRpk"
},
"planes": {
"NXP Rapid IoT": {
"type": "mcuxpresso",
"compilerVersion": "latest",
"variants": [
"NxpRpk"
],
"meta": {},
"elements": [
{
"name": "EmbeddedNxpRpkUserButtons",
"type": "EmbeddedNxpRpkUserButtons",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n ATMO_MK64F_GPIO_EnableResetCombo(ATMO_PROPERTY(EmbeddedNxpRpkUserButtons, enableResetCombo));\n ATMO_MK64F_GPIO_EnableDisplayToggleCombo(ATMO_PROPERTY(EmbeddedNxpRpkUserButtons, enableDisplayToggleCombo));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW1_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, topRightPushed));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW2_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, bottomRightPushed));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW3_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, topLeftPushed));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW4_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, bottomLeftPushed));\n\treturn ATMO_Status_Success;\n\t",
"topRightPushed": "\n\treturn ATMO_Status_Success;\n ",
"bottomRightPushed": "\n\treturn ATMO_Status_Success;\n ",
"topLeftPushed": "\n\treturn ATMO_Status_Success;\n ",
"bottomLeftPushed": "\n\treturn ATMO_Status_Success;\n "
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"topRightPushed": false,
"bottomRightPushed": false,
"topLeftPushed": false,
"bottomLeftPushed": false
},
"enableResetCombo": true,
"enableDisplayToggleCombo": true
},
"meta": {
"editorX": 73,
"editorY": 26,
"lastTrigger": "bottomLeftPushed"
},
"triggers": {
"triggered": [],
"topRightPushed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "processTopRightButton"
}
],
"bottomRightPushed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "processBottomRightButton"
}
],
"topLeftPushed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "processTopLeftButton"
}
],
"bottomLeftPushed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "processBottomLeftButton"
}
]
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"topRightPushed": false,
"bottomRightPushed": false,
"topLeftPushed": false,
"bottomLeftPushed": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "topRightPushed",
"triggers": [
"topRightPushed"
]
},
{
"name": "bottomRightPushed",
"triggers": [
"bottomRightPushed"
]
},
{
"name": "topLeftPushed",
"triggers": [
"topLeftPushed"
]
},
{
"name": "bottomLeftPushed",
"triggers": [
"bottomLeftPushed"
]
}
]
},
{
"name": "SX9500Touch",
"type": "EmbeddedSX9500",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\tATMO_SX9500_Config_t config;\n\tconfig.address = ATMO_PROPERTY(SX9500Touch, i2cAddress);\n\tconfig.i2cDriverInstance = ATMO_PROPERTY(SX9500Touch, i2cInstance);\n\tconfig.gpioDriverInstance = ATMO_PROPERTY(SX9500Touch, gpioInstance);\n\tconfig.interruptEnabled = ATMO_PROPERTY(SX9500Touch, interruptEnabled);\n\tconfig.interruptPin = ATMO_PROPERTY(SX9500Touch, interruptGpio);\n\tATMO_SX9500_Init(&config);\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Up, ATMO_ABILITY(SX9500Touch, pressUp));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Down, ATMO_ABILITY(SX9500Touch, pressDown));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Left, ATMO_ABILITY(SX9500Touch, pressLeft));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Right, ATMO_ABILITY(SX9500Touch, pressRight));\n\treturn ATMO_Status_Success;",
"getTouchData": "",
"pressUp": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
"pressDown": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
"pressLeft": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
"pressRight": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"getTouchData": false,
"pressUp": false,
"pressDown": false,
"pressLeft": false,
"pressRight": false
},
"i2cInstance": "ATMO_DRIVERINSTANCE_I2C_I2C2",
"gpioInstance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
"interruptEnabled": true,
"interruptGpio": "PTA9",
"i2cAddress": "0x28"
},
"meta": {
"editorX": 72,
"editorY": 163,
"lastTrigger": "rightPressed"
},
"triggers": {
"triggered": [],
"touchDataRead": [],
"upPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "navigateUp"
}
],
"downPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "navigateDown"
}
],
"leftPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "navigateLeft"
}
],
"rightPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedPageController",
"targetAbility": "navigateRight"
}
]
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"getTouchData": false,
"pressUp": false,
"pressDown": false,
"pressLeft": false,
"pressRight": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "getTouchData",
"triggers": [
"touchDataRead"
]
},
{
"name": "pressUp",
"triggers": [
"upPressed",
"touchDataRead"
]
},
{
"name": "pressDown",
"triggers": [
"downPressed",
"touchDataRead"
]
},
{
"name": "pressLeft",
"triggers": [
"leftPressed",
"touchDataRead"
]
},
{
"name": "pressRight",
"triggers": [
"rightPressed",
"touchDataRead"
]
}
]
},
{
"name": "EmbeddedPageController",
"type": "EmbeddedPageController",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_UI_PAGE_CONTROLLER_Config_t config;\n\tconfig.enableUpDownNavLabels = ATMO_PROPERTY(EmbeddedPageController, upDownNavigationLabelsEnabled);\n\tconfig.enableLeftRightNavLabels = ATMO_PROPERTY(EmbeddedPageController, leftRightNavigationLabelsEnabled);\n\tATMO_UI_Page_SetConfiguration(&config);\n return ATMO_Status_Success;\n\t",
"displayRootPage": "\n\t\n\tATMO_UI_Page_DisplayRootPage();\n\treturn ATMO_Status_Success;\n\t",
"navigateUp": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_UP);\n\treturn ATMO_Status_Success;\n\t",
"navigateDown": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_DOWN);\n\treturn ATMO_Status_Success;\n\t",
"navigateLeft": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_LEFT);\n\treturn ATMO_Status_Success;\n\t",
"navigateRight": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_RIGHT);\n\treturn ATMO_Status_Success;\n\t",
"processTopRightButton": "\n\tATMO_UI_Page_ProcessUserButton(1);\n\treturn ATMO_Status_Success;\n\t",
"processBottomRightButton": "\n\tATMO_UI_Page_ProcessUserButton(2);\n\treturn ATMO_Status_Success;\n\t",
"processTopLeftButton": "\n\tATMO_UI_Page_ProcessUserButton(3);\n\treturn ATMO_Status_Success;\n\t",
"processBottomLeftButton": "\n\tATMO_UI_Page_ProcessUserButton(4);\n\treturn ATMO_Status_Success;\n\t"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"displayRootPage": false,
"navigateUp": false,
"navigateDown": false,
"navigateLeft": false,
"navigateRight": false,
"processTopRightButton": false,
"processBottomRightButton": false,
"processTopLeftButton": false,
"processBottomLeftButton": false
},
"upDownNavigationLabelsEnabled": true,
"leftRightNavigationLabelsEnabled": true
},
"meta": {
"editorX": 250,
"editorY": 95,
"lastTrigger": "triggered"
},
"triggers": {
"triggered": [],
"navigateUp": [],
"navigateDown": [],
"navigateLeft": [],
"navigateRight": [],
"processTopRightButton": [],
"processBottomRightButton": [],
"processTopLeftButton": [],
"processBottomLeftButton": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"displayRootPage": false,
"navigateUp": false,
"navigateDown": false,
"navigateLeft": false,
"navigateRight": false,
"processTopRightButton": false,
"processBottomRightButton": false,
"processTopLeftButton": false,
"processBottomLeftButton": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "displayRootPage",
"triggers": []
},
{
"name": "navigateUp",
"triggers": [
"navigateUp"
]
},
{
"name": "navigateDown",
"triggers": [
"navigateDown"
]
},
{
"name": "navigateLeft",
"triggers": [
"navigateLeft"
]
},
{
"name": "navigateRight",
"triggers": [
"navigateRight"
]
},
{
"name": "processTopRightButton",
"triggers": [
"processTopRightButton"
]
},
{
"name": "processBottomRightButton",
"triggers": [
"processBottomRightButton"
]
},
{
"name": "processTopLeftButton",
"triggers": [
"processTopLeftButton"
]
},
{
"name": "processBottomLeftButton",
"triggers": [
"processBottomLeftButton"
]
}
]
},
{
"name": "DisplayTVOC",
"type": "EmbeddedIconLinesDisplay",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(DisplayTVOC, x), ATMO_PROPERTY(DisplayTVOC, y), false);\n\treturn ATMO_Status_Success;\n\t",
"onDisplayed": "\n\treturn ATMO_Status_Success;\n ",
"onLeave": "\n\treturn ATMO_Status_Success;\n\t",
"setIconLabelAndColor": "\n struct {\n char str[32];\n GUI_COLOR color;\n } icon_data;\n \n ATMO_GetBinary(in, &icon_data, sizeof(icon_data));\n ATMO_UI_ICONLINES_SetIconLabelColor(ATMO_VARIABLE(DisplayTVOC, pageHandle), icon_data.str, icon_data.color);\n return ATMO_Status_Success;\n ",
"setIconLabel": "\n char str[32];\n ATMO_GetString(in, str, 32);\n ATMO_UI_ICONLINES_SetIconLabel(ATMO_VARIABLE(DisplayTVOC, pageHandle), str);\n return ATMO_Status_Success;\n ",
"setup": "\n ATMO_UI_PAGE_Config_t config;\n config.hidden = ATMO_PROPERTY(DisplayTVOC, pageHidden);\n config.textColor = ATMO_PROPERTY(DisplayTVOC, textColor);\n config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(DisplayTVOC, topRightButtonEnabled),\n ATMO_PROPERTY(DisplayTVOC,bottomRightButtonEnabled), ATMO_PROPERTY(DisplayTVOC, topLeftButtonEnabled), ATMO_PROPERTY(DisplayTVOC, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(DisplayTVOC, x);\n config.y = ATMO_PROPERTY(DisplayTVOC, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(DisplayTVOC, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(DisplayTVOC, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(DisplayTVOC, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(DisplayTVOC, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n config.spanX = ATMO_PROPERTY(DisplayTVOC, spanX);\n\tconfig.spanY = ATMO_PROPERTY(DisplayTVOC, spanY);\n config.title = ATMO_PROPERTY(DisplayTVOC, pageTitle);\n config.titleHidden = ATMO_PROPERTY(DisplayTVOC, titleHidden);\n\tATMO_UI_ICONLINES_Init(&config, ATMO_PROPERTY(DisplayTVOC, numLines), false);\n\tATMO_VARIABLE(DisplayTVOC, pageHandle) = config.templateInstance;\n ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 0, ATMO_PROPERTY(DisplayTVOC, line1Text));\n ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 1, ATMO_PROPERTY(DisplayTVOC, line2Text));\n ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 2, ATMO_PROPERTY(DisplayTVOC, line3Text));\n ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 3, ATMO_PROPERTY(DisplayTVOC, line4Text));\n ATMO_UI_ICONLINES_SetIconLabel(config.templateInstance, ATMO_PROPERTY(DisplayTVOC, iconLabel));\n ATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 1, ATMO_ABILITY(DisplayTVOC, topRightButtonPressed));\n\tATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 2, ATMO_ABILITY(DisplayTVOC, bottomRightButtonPressed));\n\tATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 3, ATMO_ABILITY(DisplayTVOC, topLeftButtonPressed));\n ATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 4, ATMO_ABILITY(DisplayTVOC, bottomLeftButtonPressed));\n ATMO_UI_ICONLINES_SetIcon(config.templateInstance, ATMO_PROPERTY(DisplayTVOC, icon));\n ATMO_UI_ICONLINES_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), ATMO_ABILITY(DisplayTVOC, onDisplayed));\n ATMO_UI_ICONLINES_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(DisplayTVOC, onLeave));\n return ATMO_Status_Success;\n ",
"setLine1Text": "\n char label[32];\n if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n {\n ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 0, label);\n }\n else\n {\n return ATMO_Status_Fail;\n }\n\n return ATMO_Status_Success;\n ",
"setLine2Text": "\n char label[32];\n if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n {\n ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 1, label);\n }\n else\n {\n return ATMO_Status_Fail;\n }\n\n return ATMO_Status_Success;\n ",
"setLine3Text": "\n char label[32];\n if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n {\n ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 2, label);\n }\n else\n {\n return ATMO_Status_Fail;\n }\n\n return ATMO_Status_Success;\n ",
"setLine4Text": "\n char label[32];\n if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n {\n ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 3, label);\n }\n else\n {\n return ATMO_Status_Fail;\n }\n\n return ATMO_Status_Success;\n ",
"topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t"
},
"variables": {
"pageHandle": {
"type": "ATMO_DriverInstanceHandle_t"
}
},
"embeddedPropertyConversions": {
"pageTitle": "string",
"topRightButtonLabel": "string",
"bottomRightButtonLabel": "string",
"topLeftButtonLabel": "string",
"bottomLeftButtonLabel": "string",
"iconLabel": "string",
"line1Text": "string",
"line2Text": "string",
"line3Text": "string",
"line4Text": "string"
},
"codeUserChanged": {
"displayPage": false,
"onDisplayed": false,
"onLeave": false,
"setIconLabelAndColor": false,
"setIconLabel": false,
"setup": false,
"setLine1Text": false,
"setLine2Text": false,
"setLine3Text": false,
"setLine4Text": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false
},
"textColor": "GUI_BLACK",
"pageTitle": "Air Quality",
"titleHidden": false,
"pageHidden": false,
"topRightButtonLabel": "",
"topRightButtonEnabled": false,
"bottomRightButtonLabel": "BK ON",
"bottomRightButtonEnabled": true,
"topLeftButtonLabel": "",
"topLeftButtonEnabled": false,
"bottomLeftButtonLabel": "BK OFF",
"bottomLeftButtonEnabled": true,
"x": 0,
"y": 0,
"spanX": 1,
"spanY": 1,
"icon": "icon_applications_airq",
"iconLabel": "",
"numLines": "4",
"line1Text": "TVOCs",
"line2Text": "",
"line3Text": "CO2",
"line4Text": ""
},
"meta": {
"editorX": 870,
"editorY": 102,
"lastTrigger": "topRightButtonPressed"
},
"triggers": {
"triggered": [],
"onDisplayed": [],
"onLeave": [],
"topRightButtonPressed": [],
"bottomRightButtonPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "BacklightOnOff",
"targetAbility": "setOn"
}
],
"topLeftButtonPressed": [],
"bottomLeftButtonPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "BacklightOnOff",
"targetAbility": "setOff"
}
]
},
"interruptAbilities": {
"trigger": false,
"displayPage": false,
"onDisplayed": false,
"onLeave": false,
"setIconLabelAndColor": false,
"setIconLabel": false,
"setup": false,
"setLine1Text": false,
"setLine2Text": false,
"setLine3Text": false,
"setLine4Text": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "displayPage",
"triggers": []
},
{
"name": "onDisplayed",
"triggers": [
"onDisplayed"
]
},
{
"name": "onLeave",
"triggers": [
"onLeave"
]
},
{
"name": "setIconLabelAndColor",
"triggers": []
},
{
"name": "setIconLabel",
"triggers": []
},
{
"name": "setup",
"triggers": []
},
{
"name": "setLine1Text",
"triggers": []
},
{
"name": "setLine2Text",
"triggers": []
},
{
"name": "setLine3Text",
"triggers": []
},
{
"name": "setLine4Text",
"triggers": []
},
{
"name": "topRightButtonPressed",
"triggers": [
"topRightButtonPressed"
]
},
{
"name": "bottomRightButtonPressed",
"triggers": [
"bottomRightButtonPressed"
]
},
{
"name": "topLeftButtonPressed",
"triggers": [
"topLeftButtonPressed"
]
},
{
"name": "bottomLeftButtonPressed",
"triggers": [
"bottomLeftButtonPressed"
]
}
]
},
{
"name": "BacklightOnOff",
"type": "EmbeddedOnOffDisplay",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(BacklightOnOff, x), ATMO_PROPERTY(BacklightOnOff, y), false);\n\treturn ATMO_Status_Success;\n\t",
"onDisplayed": "\n\treturn ATMO_Status_Success;\n ",
"topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"setup": "\n ATMO_UI_PAGE_Config_t config;\n config.hidden = ATMO_PROPERTY(BacklightOnOff, pageHidden);\n config.textColor = ATMO_PROPERTY(BacklightOnOff, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(BacklightOnOff, topRightButtonEnabled),\n\t\tATMO_PROPERTY(BacklightOnOff,bottomRightButtonEnabled), ATMO_PROPERTY(BacklightOnOff, topLeftButtonEnabled), ATMO_PROPERTY(BacklightOnOff, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(BacklightOnOff, x);\n config.y = ATMO_PROPERTY(BacklightOnOff, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(BacklightOnOff, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(BacklightOnOff, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(BacklightOnOff, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(BacklightOnOff, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n config.spanX = ATMO_PROPERTY(BacklightOnOff, spanX);\n\tconfig.spanY = ATMO_PROPERTY(BacklightOnOff, spanY);\n config.title = ATMO_PROPERTY(BacklightOnOff, pageTitle);\n config.titleHidden = ATMO_PROPERTY(BacklightOnOff, titleHidden);\n ATMO_UI_SELECTICON_Init(&config, 2, true, ATMO_PROPERTY(BacklightOnOff, persist), ATMO_PROPERTY(BacklightOnOff, differentStartup));\n ATMO_VARIABLE(BacklightOnOff, pageHandle) = config.templateInstance;\n ATMO_UI_SELECTICON_SetIcon(config.templateInstance, ATMO_PROPERTY(BacklightOnOff,icon));\n ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 0, \"Off\", !ATMO_PROPERTY(BacklightOnOff, initialValue));\n ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 1, \"On\", ATMO_PROPERTY(BacklightOnOff, initialValue));\n ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(BacklightOnOff, offSet));\n ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(BacklightOnOff, onSet));\n ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(BacklightOnOff, offSetStartup));\n ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(BacklightOnOff, onSetStartup));\n ATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), 1, ATMO_ABILITY(BacklightOnOff, topRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), 2, ATMO_ABILITY(BacklightOnOff, bottomRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), 3, ATMO_ABILITY(BacklightOnOff, topLeftButtonPressed));\n ATMO_UI_SELECTICON_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), ATMO_ABILITY(BacklightOnOff, onDisplayed));\n ATMO_UI_SELECTICON_OverlaySaved(ATMO_VARIABLE(BacklightOnOff, pageHandle));\n return ATMO_Status_Success;\n ",
"setOff": "\n ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(BacklightOnOff,pageHandle), 0, true);\n ATMO_CreateValueBool(out, false);\n return ATMO_Status_Success;\n ",
"setOn": "\n ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(BacklightOnOff,pageHandle), 0, false);\n ATMO_CreateValueBool(out, true);\n return ATMO_Status_Success;\n ",
"offSet": "\n ATMO_CreateValueBool(out, false);\n return ATMO_Status_Success;\n ",
"onSet": "\n ATMO_CreateValueBool(out, true);\n return ATMO_Status_Success;\n ",
"offSetStartup": "\treturn ATMO_Status_Success;",
"onSetStartup": "\treturn ATMO_Status_Success;"
},
"variables": {
"pageHandle": {
"type": "ATMO_DriverInstanceHandle_t"
}
},
"embeddedPropertyConversions": {
"pageTitle": "string",
"topRightButtonLabel": "string",
"bottomRightButtonLabel": "string",
"topLeftButtonLabel": "string",
"bottomLeftButtonLabel": "string",
"label": "string"
},
"codeUserChanged": {
"displayPage": false,
"onDisplayed": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"setup": false,
"setOff": false,
"setOn": false,
"offSet": false,
"onSet": false,
"offSetStartup": false,
"onSetStartup": false
},
"textColor": "GUI_BLACK",
"pageTitle": "Backlight",
"titleHidden": false,
"pageHidden": false,
"topRightButtonLabel": "",
"topRightButtonEnabled": false,
"bottomRightButtonLabel": "",
"bottomRightButtonEnabled": false,
"topLeftButtonLabel": "",
"topLeftButtonEnabled": false,
"bottomLeftButtonLabel": "Toggle",
"bottomLeftButtonEnabled": true,
"x": "1",
"y": "3",
"spanX": 1,
"spanY": 1,
"icon": "icon_settings_backlight",
"initialValue": true,
"persist": true,
"differentStartup": false
},
"meta": {
"editorX": 1010,
"editorY": 72,
"lastTrigger": "offSet"
},
"triggers": {
"triggered": [],
"onDisplayed": [],
"topRightButtonPressed": [],
"bottomRightButtonPressed": [],
"topLeftButtonPressed": [],
"offSet": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "BacklightOff",
"targetAbility": "trigger"
}
],
"setOn": [],
"onSet": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "BacklightOn",
"targetAbility": "trigger"
}
],
"offSetStartup": [],
"onSetStartup": []
},
"interruptAbilities": {
"trigger": false,
"displayPage": false,
"onDisplayed": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"setup": false,
"setOff": false,
"setOn": false,
"offSet": false,
"onSet": false,
"offSetStartup": false,
"onSetStartup": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "displayPage",
"triggers": []
},
{
"name": "onDisplayed",
"triggers": [
"onDisplayed"
]
},
{
"name": "topRightButtonPressed",
"triggers": [
"topRightButtonPressed"
]
},
{
"name": "bottomRightButtonPressed",
"triggers": [
"bottomRightButtonPressed"
]
},
{
"name": "topLeftButtonPressed",
"triggers": [
"topLeftButtonPressed"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "setOff",
"triggers": [
"offSet"
]
},
{
"name": "setOn",
"triggers": [
"setOn"
]
},
{
"name": "offSet",
"triggers": [
"offSet"
]
},
{
"name": "onSet",
"triggers": [
"onSet"
]
},
{
"name": "offSetStartup",
"triggers": [
"offSetStartup"
]
},
{
"name": "onSetStartup",
"triggers": [
"onSetStartup"
]
}
]
},
{
"name": "SettingsDisplay",
"type": "EmbeddedIconLabelDisplay",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(SettingsDisplay, x), ATMO_PROPERTY(SettingsDisplay, y), false);\n\treturn ATMO_Status_Success;\n\t",
"onDisplayed": "\n\treturn ATMO_Status_Success;\n ",
"topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"setup": "\n ATMO_UI_PAGE_Config_t config;\n\tconfig.hidden = ATMO_PROPERTY(SettingsDisplay, pageHidden);\n\tconfig.textColor = ATMO_PROPERTY(SettingsDisplay, textColor);\n config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(SettingsDisplay, topRightButtonEnabled),\n ATMO_PROPERTY(SettingsDisplay,bottomRightButtonEnabled), ATMO_PROPERTY(SettingsDisplay, topLeftButtonEnabled), ATMO_PROPERTY(SettingsDisplay, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(SettingsDisplay, x);\n config.x = ATMO_PROPERTY(SettingsDisplay, x);\n config.y = ATMO_PROPERTY(SettingsDisplay, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(SettingsDisplay, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(SettingsDisplay, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(SettingsDisplay, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(SettingsDisplay, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n config.spanX = ATMO_PROPERTY(SettingsDisplay, spanX);\n\tconfig.spanY = ATMO_PROPERTY(SettingsDisplay, spanY);\n config.title = ATMO_PROPERTY(SettingsDisplay, pageTitle);\n config.titleHidden = ATMO_PROPERTY(SettingsDisplay, titleHidden);\n\tATMO_UI_SINGLEICONTEXT_Init(&config);\n\tATMO_VARIABLE(SettingsDisplay, pageHandle) = config.templateInstance;\n ATMO_UI_SINGLEICONTEXT_SetMainText(config.templateInstance, ATMO_PROPERTY(SettingsDisplay, label));\n ATMO_UI_SINGLEICONTEXT_SetIcon(config.templateInstance, ATMO_PROPERTY(SettingsDisplay, icon));\n ATMO_UI_SINGLEICONTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), ATMO_ABILITY(SettingsDisplay, onDisplayed));\n ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 1, ATMO_ABILITY(SettingsDisplay, topRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 2, ATMO_ABILITY(SettingsDisplay, bottomRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 3, ATMO_ABILITY(SettingsDisplay, topLeftButtonPressed));\n ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 4, ATMO_ABILITY(SettingsDisplay, bottomLeftButtonPressed));\n ATMO_UI_SINGLEICONTEXT_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(SettingsDisplay, onLeave));\n\treturn ATMO_Status_Success;\n ",
"onLeave": "\n\treturn ATMO_Status_Success;\n\t",
"setLabel": "\n char label[32];\n if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n {\n ATMO_UI_SINGLEICONTEXT_SetMainText(ATMO_VARIABLE(SettingsDisplay,pageHandle), label);\n }\n else\n {\n return ATMO_Status_Fail;\n }\n\n return ATMO_Status_Success;\n "
},
"variables": {
"pageHandle": {
"type": "ATMO_DriverInstanceHandle_t"
}
},
"embeddedPropertyConversions": {
"pageTitle": "string",
"topRightButtonLabel": "string",
"bottomRightButtonLabel": "string",
"topLeftButtonLabel": "string",
"bottomLeftButtonLabel": "string",
"label": "string"
},
"codeUserChanged": {
"displayPage": false,
"onDisplayed": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false,
"setup": false,
"onLeave": false,
"setLabel": false
},
"textColor": "GUI_BLACK",
"pageTitle": "Settings",
"titleHidden": false,
"pageHidden": false,
"topRightButtonLabel": "",
"topRightButtonEnabled": false,
"bottomRightButtonLabel": "",
"bottomRightButtonEnabled": false,
"topLeftButtonLabel": "",
"topLeftButtonEnabled": false,
"bottomLeftButtonLabel": "",
"bottomLeftButtonEnabled": false,
"x": 0,
"y": "1",
"spanX": 1,
"spanY": 1,
"icon": "icon_settings",
"label": ""
},
"meta": {
"editorX": 71,
"editorY": 292,
"lastTrigger": "onDisplayed"
},
"triggers": {
"triggered": [],
"onDisplayed": [],
"topRightButtonPressed": [],
"bottomRightButtonPressed": [],
"topLeftButtonPressed": [],
"bottomLeftButtonPressed": [],
"onLeave": []
},
"interruptAbilities": {
"trigger": false,
"displayPage": false,
"onDisplayed": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false,
"setup": false,
"onLeave": false,
"setLabel": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "displayPage",
"triggers": []
},
{
"name": "onDisplayed",
"triggers": [
"onDisplayed"
]
},
{
"name": "topRightButtonPressed",
"triggers": [
"topRightButtonPressed"
]
},
{
"name": "bottomRightButtonPressed",
"triggers": [
"bottomRightButtonPressed"
]
},
{
"name": "topLeftButtonPressed",
"triggers": [
"topLeftButtonPressed"
]
},
{
"name": "bottomLeftButtonPressed",
"triggers": [
"bottomLeftButtonPressed"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "onLeave",
"triggers": [
"onLeave"
]
},
{
"name": "setLabel",
"triggers": []
}
]
},
{
"name": "InfoDisplay",
"type": "EmbeddedIconLabelDisplay",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(InfoDisplay, x), ATMO_PROPERTY(InfoDisplay, y), false);\n\treturn ATMO_Status_Success;\n\t",
"onDisplayed": "\n\treturn ATMO_Status_Success;\n ",
"topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"setup": "\n ATMO_UI_PAGE_Config_t config;\n\tconfig.hidden = ATMO_PROPERTY(InfoDisplay, pageHidden);\n\tconfig.textColor = ATMO_PROPERTY(InfoDisplay, textColor);\n config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(InfoDisplay, topRightButtonEnabled),\n ATMO_PROPERTY(InfoDisplay,bottomRightButtonEnabled), ATMO_PROPERTY(InfoDisplay, topLeftButtonEnabled), ATMO_PROPERTY(InfoDisplay, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(InfoDisplay, x);\n config.x = ATMO_PROPERTY(InfoDisplay, x);\n config.y = ATMO_PROPERTY(InfoDisplay, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(InfoDisplay, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(InfoDisplay, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(InfoDisplay, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(InfoDisplay, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n config.spanX = ATMO_PROPERTY(InfoDisplay, spanX);\n\tconfig.spanY = ATMO_PROPERTY(InfoDisplay, spanY);\n config.title = ATMO_PROPERTY(InfoDisplay, pageTitle);\n config.titleHidden = ATMO_PROPERTY(InfoDisplay, titleHidden);\n\tATMO_UI_SINGLEICONTEXT_Init(&config);\n\tATMO_VARIABLE(InfoDisplay, pageHandle) = config.templateInstance;\n ATMO_UI_SINGLEICONTEXT_SetMainText(config.templateInstance, ATMO_PROPERTY(InfoDisplay, label));\n ATMO_UI_SINGLEICONTEXT_SetIcon(config.templateInstance, ATMO_PROPERTY(InfoDisplay, icon));\n ATMO_UI_SINGLEICONTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), ATMO_ABILITY(InfoDisplay, onDisplayed));\n ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 1, ATMO_ABILITY(InfoDisplay, topRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 2, ATMO_ABILITY(InfoDisplay, bottomRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 3, ATMO_ABILITY(InfoDisplay, topLeftButtonPressed));\n ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 4, ATMO_ABILITY(InfoDisplay, bottomLeftButtonPressed));\n ATMO_UI_SINGLEICONTEXT_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(InfoDisplay, onLeave));\n\treturn ATMO_Status_Success;\n ",
"onLeave": "\n\treturn ATMO_Status_Success;\n\t",
"setLabel": "\n char label[32];\n if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n {\n ATMO_UI_SINGLEICONTEXT_SetMainText(ATMO_VARIABLE(InfoDisplay,pageHandle), label);\n }\n else\n {\n return ATMO_Status_Fail;\n }\n\n return ATMO_Status_Success;\n "
},
"variables": {
"pageHandle": {
"type": "ATMO_DriverInstanceHandle_t"
}
},
"embeddedPropertyConversions": {
"pageTitle": "string",
"topRightButtonLabel": "string",
...
This file has been truncated, please download it to see its full contents.
Comments