da4631c0-e881-11ea-a452-0bb049e7ba49 |
1598545499868 |
raspberry_pi_gpio_panel |
gpio_widgets |
{“type”:”latest”,”sizeX”:7,”sizeY”:10.5,”resources”:[],”templateHtml”:” \n \n \n \n {{ cell.label }}\n \n {{cell.pin}}\n \n \n \n \n {{cell.pin}}\n \n {{ cell.label }}\n \n \n \n \n \n \n \n \n”,”templateCss”:”.error {\n font-size: 14px !important;\n color: maroon;/rgb(250,250,250);/\n background-color: transparent;\n padding: 6px;\n}\n\n.error span {\n margin: auto;\n}\n\n.gpio-panel {\n padding-top: 10px;\n white-space: nowrap;\n}\n\n.gpio-panel section[fxflex] {\n min-width: 0px;\n}\n\n.gpio-panel tb-led-light > div {\n margin: auto;\n}\n\n.led-panel {\n margin: 0;\n width: 66px;\n min-width: 66px;\n}\n\n.led-container {\n width: 48px;\n min-width: 48px;\n}\n\n.pin {\n margin-top: auto;\n margin-bottom: auto;\n color: white;\n font-size: 12px;\n width: 16px;\n min-width: 16px;\n}\n\n.led-panel.col-0 .pin {\n margin-left: auto;\n padding-left: 2px;\n text-align: right;\n}\n\n.led-panel.col-1 .pin {\n margin-right: auto;\n \n text-align: left;\n}\n\n.gpio-left-label {\n margin-right: 8px;\n}\n\n.gpio-right-label {\n margin-left: 8px;\n}”,”controllerScript”:”var namespace;\nvar cssParser = new cssjs();\n\nself.onInit = function() {\n var utils = self.ctx.$injector.get(self.ctx.servicesMap.get(‘utils’));\n namespace = ‘gpio-panel-‘ + utils.guid();\n cssParser.testMode = false;\n cssParser.cssPreviewNamespace = namespace;\n self.ctx.$container.addClass(namespace);\n self.ctx.ngZone.run(function() {\n init(); \n });\n}\n\nfunction init() {\n var i, gpio;\n \n var scope = self.ctx.$scope;\n var settings = self.ctx.settings;\n \n scope.gpioList = [];\n scope.gpioByPin = {};\n for (var g = 0; g < settings.gpioList.length; g++) {\n gpio = settings.gpioList[g];\n scope.gpioList.push(\n {\n row: gpio.row,\n col: gpio.col,\n pin: gpio.pin,\n label: gpio.label,\n enabled: false,\n colorOn: tinycolor(gpio.color).lighten(20).toHexString(),\n colorOff: tinycolor(gpio.color).darken().toHexString()\n }\n );\n scope.gpioByPin[gpio.pin] = scope.gpioList[scope.gpioList.length-1];\n }\n\n scope.ledPanelBackgroundColor = settings.ledPanelBackgroundColor || tinycolor(‘green’).lighten(2).toRgbString();\n\n scope.gpioCells = {};\n var rowCount = 0;\n for (i = 0; i < scope.gpioList.length; i++) {\n gpio = scope.gpioList[i];\n scope.gpioCells[gpio.row+’‘+gpio.col] = gpio;\n rowCount = Math.max(rowCount, gpio.row+1);\n }\n \n scope.prefferedRowHeight = 32;\n scope.rows = [];\n for (i = 0; i < rowCount; i++) {\n var row = [];\n for (var c =0; c<2;c++) {\n if (scope.gpioCells[i+’‘+c]) {\n row[c] = scope.gpioCells[i+’_’+c];\n } else {\n row[c] = null;\n }\n }\n scope.rows.push(row);\n } \n \n self.onResize();\n}\n\nself.onDataUpdated = function() {\n var changed = false;\n for (var d = 0; d < self.ctx.data.length; d++) {\n var cellData = self.ctx.data[d];\n var dataKey = cellData.dataKey;\n var gpio = self.ctx.$scope.gpioByPin[dataKey.label];\n if (gpio) {\n var enabled = false;\n if (cellData.data.length > 0) {\n var tvPair = cellData.data[cellData.data.length - 1];\n enabled = (tvPair[1] === true || tvPair[1] === ‘true’);\n }\n if (gpio.enabled != enabled) {\n changed = true;\n gpio.enabled = enabled;\n }\n }\n }\n if (changed) {\n self.ctx.detectChanges();\n } \n}\n\nself.onResize = function() {\n var rowCount = self.ctx.$scope.rows.length;\n var prefferedRowHeight = (self.ctx.height - 35)/rowCount;\n prefferedRowHeight = Math.min(32, prefferedRowHeight);\n prefferedRowHeight = Math.max(12, prefferedRowHeight);\n self.ctx.$scope.prefferedRowHeight = prefferedRowHeight;\n \n var ratio = prefferedRowHeight/32;\n \n var css = ‘.gpio-left-label, .gpio-right-label {\n’ +\n ‘ font-size: ‘ + 16_ratio+’px;\n’+\n ‘}\n’;\n var pinsFontSize = Math.max(9, 12_ratio);\n css += ‘.pin {\n’ +\n ‘ font-size: ‘ + pinsFontSize+’px;\n’+\n ‘}\n’;\n \n cssParser.createStyleElement(namespace, css); \n \n self.ctx.detectChanges();\n}\n\nself.onDestroy = function() {\n}\n”,”settingsSchema”:”{\n “schema”: {\n “type”: “object”,\n “title”: “Settings”,\n “properties”: {\n “gpioList”: {\n “title”: “Gpio leds”,\n “type”: “array”,\n “minItems” : 1,\n “items”: {\n “title”: “Gpio led”,\n “type”: “object”,\n “properties”: {\n “pin”: {\n “title”: “Pin”,\n “type”: “number”\n },\n “label”: {\n “title”: “Label”,\n “type”: “string”\n },\n “row”: {\n “title”: “Row”,\n “type”: “number”\n },\n “col”: {\n “title”: “Column”,\n “type”: “number”\n },\n “color”: {\n “title”: “Color”,\n “type”: “string”,\n “default”: “red”\n }\n },\n “required”: [“pin”, “label”, “row”, “col”, “color”]\n }\n },\n “ledPanelBackgroundColor”: {\n “title”: “LED panel background color”,\n “type”: “string”,\n “default”: “#008a00”\n } \n },\n “required”: [“gpioList”, \n “ledPanelBackgroundColor”]\n },\n “form”: [\n {\n “key”: “gpioList”,\n “items”: [\n “gpioList[].pin”,\n “gpioList[].label”,\n “gpioList[].row”,\n “gpioList[].col”,\n {\n “key”: “gpioList[].color”,\n “type”: “color”\n }\n ]\n },\n {\n “key”: “ledPanelBackgroundColor”,\n “type”: “color”\n }\n ]\n}”,”dataKeySettingsSchema”:”{}\n”,”defaultConfig”:”{“showTitle”:true,”backgroundColor”:”#fff”,”color”:”rgba(0, 0, 0, 0.87)”,”padding”:”0px”,”settings”:{“gpioList”:[{“pin”:1,”label”:”3.3V”,”row”:0,”col”:0,”color”:”#fc9700”,”_uniqueKey”:0},{“pin”:2,”label”:”5V”,”row”:0,”col”:1,”color”:”#fb0000”,”_uniqueKey”:1},{“pin”:3,”label”:”GPIO 2 (I2C1_SDA)”,”row”:1,”col”:0,”color”:”#02fefb”,”_uniqueKey”:2},{“color”:”#fb0000”,”pin”:4,”label”:”5V”,”row”:1,”col”:1},{“color”:”#02fefb”,”pin”:5,”label”:”GPIO 3 (I2C1_SCL)”,”row”:2,”col”:0},{“color”:”#000000”,”pin”:6,”label”:”GND”,”row”:2,”col”:1},{“color”:”#00fd00”,”pin”:7,”label”:”GPIO 4 (GPCLK0)”,”row”:3,”col”:0},{“color”:”#fdfb00”,”pin”:8,”label”:”GPIO 14 (UART_TXD)”,”row”:3,”col”:1},{“color”:”#000000”,”pin”:9,”label”:”GND”,”row”:4,”col”:0},{“color”:”#fdfb00”,”pin”:10,”label”:”GPIO 15 (UART_RXD)”,”row”:4,”col”:1},{“color”:”#00fd00”,”pin”:11,”label”:”GPIO 17”,”row”:5,”col”:0},{“color”:”#00fd00”,”pin”:12,”label”:”GPIO 18”,”row”:5,”col”:1},{“color”:”#00fd00”,”pin”:13,”label”:”GPIO 27”,”row”:6,”col”:0},{“color”:”#000000”,”pin”:14,”label”:”GND”,”row”:6,”col”:1},{“color”:”#00fd00”,”pin”:15,”label”:”GPIO 22”,”row”:7,”col”:0},{“color”:”#00fd00”,”pin”:16,”label”:”GPIO 23”,”row”:7,”col”:1},{“color”:”#fc9700”,”pin”:17,”label”:”3.3V”,”row”:8,”col”:0},{“color”:”#00fd00”,”pin”:18,”label”:”GPIO 24”,”row”:8,”col”:1},{“color”:”#fd01fd”,”pin”:19,”label”:”GPIO 10 (SPI_MOSI)”,”row”:9,”col”:0},{“color”:”#000000”,”pin”:20,”label”:”GND”,”row”:9,”col”:1},{“color”:”#fd01fd”,”pin”:21,”label”:”GPIO 9 (SPI_MISO)”,”row”:10,”col”:0},{“color”:”#00fd00”,”pin”:22,”label”:”GPIO 25”,”row”:10,”col”:1},{“color”:”#fd01fd”,”pin”:23,”label”:”GPIO 11 (SPI_SCLK)”,”row”:11,”col”:0},{“color”:”#fd01fd”,”pin”:24,”label”:”GPIO 8 (SPI_CE0)”,”row”:11,”col”:1},{“color”:”#000000”,”pin”:25,”label”:”GND”,”row”:12,”col”:0},{“color”:”#fd01fd”,”pin”:26,”label”:”GPIO 7 (SPI_CE1)”,”row”:12,”col”:1},{“color”:”#ffffff”,”pin”:27,”label”:”ID_SD”,”row”:13,”col”:0},{“color”:”#ffffff”,”pin”:28,”label”:”ID_SC”,”row”:13,”col”:1},{“color”:”#00fd00”,”pin”:29,”label”:”GPIO 5”,”row”:14,”col”:0},{“color”:”#000000”,”pin”:30,”label”:”GND”,”row”:14,”col”:1},{“color”:”#00fd00”,”pin”:31,”label”:”GPIO 6”,”row”:15,”col”:0},{“color”:”#00fd00”,”pin”:32,”label”:”GPIO 12”,”row”:15,”col”:1},{“color”:”#00fd00”,”pin”:33,”label”:”GPIO 13”,”row”:16,”col”:0},{“color”:”#000000”,”pin”:34,”label”:”GND”,”row”:16,”col”:1},{“color”:”#00fd00”,”pin”:35,”label”:”GPIO 19”,”row”:17,”col”:0},{“color”:”#00fd00”,”pin”:36,”label”:”GPIO 16”,”row”:17,”col”:1},{“color”:”#00fd00”,”pin”:37,”label”:”GPIO 26”,”row”:18,”col”:0},{“color”:”#00fd00”,”pin”:38,”label”:”GPIO 20”,”row”:18,”col”:1},{“color”:”#000000”,”pin”:39,”label”:”GND”,”row”:19,”col”:0},{“color”:”#00fd00”,”pin”:40,”label”:”GPIO 21”,”row”:19,”col”:1}],”ledPanelBackgroundColor”:”#008a00”},”title”:”Raspberry Pi GPIO Panel”,”datasources”:[{“type”:”function”,”name”:”function”,”dataKeys”:[{“name”:”f(x)”,”type”:”function”,”label”:”7”,”color”:”#2196f3”,”settings”:{},”_hash”:0.22518255793320163,”funcBody”:”var period = time % 1500;\nreturn period < 500;”},{“name”:”f(x)”,”type”:”function”,”label”:”11”,”color”:”#4caf50”,”settings”:{},”_hash”:0.7008206860666621,”funcBody”:”var period = time % 1500;\nreturn period >= 500 && period < 1000;”},{“name”:”f(x)”,”type”:”function”,”label”:”12”,”color”:”#f44336”,”settings”:{},”_hash”:0.42600325102193426,”funcBody”:”var period = time % 1500;\nreturn period >= 1000;”},{“name”:”f(x)”,”type”:”function”,”label”:”13”,”color”:”#ffc107”,”settings”:{},”_hash”:0.48362241571415243,”funcBody”:”var period = time % 1500;\nreturn period < 500;”},{“name”:”f(x)”,”type”:”function”,”label”:”29”,”color”:”#607d8b”,”settings”:{},”_hash”:0.7217670147518815,”funcBody”:”var period = time % 1500;\nreturn period >= 500 && period < 1000;”}]}],”timewindow”:{“realtime”:{“timewindowMs”:60000}}}”} |
Raspberry Pi GPIO Panel |
13814000-1dd2-11b2-8080-808080808080 |
da47b860-e881-11ea-a452-0bb049e7ba49 |
1598545499878 |
raspberry_pi_gpio_control |
gpio_widgets |
{“type”:”rpc”,”sizeX”:6,”sizeY”:10.5,”resources”:[],”templateHtml”:” |
Raspberry Pi GPIO Control |
13814000-1dd2-11b2-8080-808080808080 |
da434b90-e881-11ea-a452-0bb049e7ba49 |
1598545499849 |
basic_gpio_control |
gpio_widgets |
{“type”:”rpc”,”sizeX”:4,”sizeY”:2,”resources”:[],”templateHtml”:” |
Basic GPIO Control |
13814000-1dd2-11b2-8080-808080808080 |
da44f940-e881-11ea-a452-0bb049e7ba49 |
1598545499860 |
gpio_panel |
gpio_widgets |
{“type”:”latest”,”sizeX”:5,”sizeY”:2,”resources”:[],”templateHtml”:” \n \n \n \n {{ cell.label }}\n \n {{cell.pin}}\n \n \n \n \n {{cell.pin}}\n \n {{ cell.label }}\n \n \n \n \n \n \n \n \n”,”templateCss”:”.error {\n font-size: 14px !important;\n color: maroon;/rgb(250,250,250);/\n background-color: transparent;\n padding: 6px;\n}\n\n.error span {\n margin: auto;\n}\n\n.gpio-panel {\n padding-top: 10px;\n white-space: nowrap;\n}\n\n.gpio-panel section[fxflex] {\n min-width: 0px;\n}\n\n\n.gpio-panel tb-led-light > div {\n margin: auto;\n}\n\n.led-panel {\n margin: 0;\n width: 66px;\n min-width: 66px;\n}\n\n.led-container {\n width: 48px;\n min-width: 48px;\n}\n\n.pin {\n margin-top: auto;\n margin-bottom: auto;\n color: white;\n font-size: 12px;\n width: 16px;\n min-width: 16px;\n}\n\n.led-panel.col-0 .pin {\n margin-left: auto;\n padding-left: 2px;\n text-align: right;\n}\n\n.led-panel.col-1 .pin {\n margin-right: auto;\n \n text-align: left;\n}\n\n.gpio-left-label {\n margin-right: 8px;\n}\n\n.gpio-right-label {\n margin-left: 8px;\n}”,”controllerScript”:”var namespace;\nvar cssParser = new cssjs();\n\nself.onInit = function() {\n var utils = self.ctx.$injector.get(self.ctx.servicesMap.get(‘utils’));\n namespace = ‘gpio-panel-‘ + utils.guid();\n cssParser.testMode = false;\n cssParser.cssPreviewNamespace = namespace;\n self.ctx.$container.addClass(namespace);\n self.ctx.ngZone.run(function() {\n init(); \n });\n}\n\nfunction init() {\n var i, gpio;\n \n var scope = self.ctx.$scope;\n var settings = self.ctx.settings;\n \n scope.gpioList = [];\n scope.gpioByPin = {};\n for (var g = 0; g < settings.gpioList.length; g++) {\n gpio = settings.gpioList[g];\n scope.gpioList.push(\n {\n row: gpio.row,\n col: gpio.col,\n pin: gpio.pin,\n label: gpio.label,\n enabled: false,\n colorOn: tinycolor(gpio.color).lighten(20).toHexString(),\n colorOff: tinycolor(gpio.color).darken().toHexString()\n }\n );\n scope.gpioByPin[gpio.pin] = scope.gpioList[scope.gpioList.length-1];\n }\n\n scope.ledPanelBackgroundColor = settings.ledPanelBackgroundColor || tinycolor(‘green’).lighten(2).toRgbString();\n\n scope.gpioCells = {};\n var rowCount = 0;\n for (i = 0; i < scope.gpioList.length; i++) {\n gpio = scope.gpioList[i];\n scope.gpioCells[gpio.row+’‘+gpio.col] = gpio;\n rowCount = Math.max(rowCount, gpio.row+1);\n }\n \n scope.prefferedRowHeight = 32;\n scope.rows = [];\n for (i = 0; i < rowCount; i++) {\n var row = [];\n for (var c =0; c<2;c++) {\n if (scope.gpioCells[i+’‘+c]) {\n row[c] = scope.gpioCells[i+’_’+c];\n } else {\n row[c] = null;\n }\n }\n scope.rows.push(row);\n } \n \n self.onResize();\n}\n\nself.onDataUpdated = function() {\n var changed = false;\n for (var d = 0; d < self.ctx.data.length; d++) {\n var cellData = self.ctx.data[d];\n var dataKey = cellData.dataKey;\n var gpio = self.ctx.$scope.gpioByPin[dataKey.label];\n if (gpio) {\n var enabled = false;\n if (cellData.data.length > 0) {\n var tvPair = cellData.data[cellData.data.length - 1];\n enabled = (tvPair[1] === true || tvPair[1] === ‘true’);\n }\n if (gpio.enabled != enabled) {\n changed = true;\n gpio.enabled = enabled;\n }\n }\n }\n if (changed) {\n self.ctx.detectChanges();\n } \n}\n\nself.onResize = function() {\n var rowCount = self.ctx.$scope.rows.length;\n var prefferedRowHeight = (self.ctx.height - 35)/rowCount;\n prefferedRowHeight = Math.min(32, prefferedRowHeight);\n prefferedRowHeight = Math.max(12, prefferedRowHeight);\n self.ctx.$scope.prefferedRowHeight = prefferedRowHeight;\n \n var ratio = prefferedRowHeight/32;\n \n var css = ‘.gpio-left-label, .gpio-right-label {\n’ +\n ‘ font-size: ‘ + 16_ratio+’px;\n’+\n ‘}\n’;\n var pinsFontSize = Math.max(9, 12_ratio);\n css += ‘.pin {\n’ +\n ‘ font-size: ‘ + pinsFontSize+’px;\n’+\n ‘}\n’;\n \n cssParser.createStyleElement(namespace, css); \n \n self.ctx.detectChanges();\n}\n\nself.onDestroy = function() {\n}\n”,”settingsSchema”:”{\n “schema”: {\n “type”: “object”,\n “title”: “Settings”,\n “properties”: {\n “gpioList”: {\n “title”: “Gpio leds”,\n “type”: “array”,\n “minItems” : 1,\n “items”: {\n “title”: “Gpio led”,\n “type”: “object”,\n “properties”: {\n “pin”: {\n “title”: “Pin”,\n “type”: “number”\n },\n “label”: {\n “title”: “Label”,\n “type”: “string”\n },\n “row”: {\n “title”: “Row”,\n “type”: “number”\n },\n “col”: {\n “title”: “Column”,\n “type”: “number”\n },\n “color”: {\n “title”: “Color”,\n “type”: “string”,\n “default”: “red”\n }\n },\n “required”: [“pin”, “label”, “row”, “col”, “color”]\n }\n },\n “ledPanelBackgroundColor”: {\n “title”: “LED panel background color”,\n “type”: “string”,\n “default”: “#008a00”\n } \n },\n “required”: [“gpioList”, \n “ledPanelBackgroundColor”]\n },\n “form”: [\n {\n “key”: “gpioList”,\n “items”: [\n “gpioList[].pin”,\n “gpioList[].label”,\n “gpioList[].row”,\n “gpioList[].col”,\n {\n “key”: “gpioList[].color”,\n “type”: “color”\n }\n ]\n },\n {\n “key”: “ledPanelBackgroundColor”,\n “type”: “color”\n }\n ]\n}”,”dataKeySettingsSchema”:”{}\n”,”defaultConfig”:”{“showTitle”:true,”backgroundColor”:”#fff”,”color”:”rgba(0, 0, 0, 0.87)”,”padding”:”0px”,”settings”:{“gpioList”:[{“pin”:1,”label”:”GPIO 1”,”row”:0,”col”:0,”color”:”#008000”,”_uniqueKey”:0},{“pin”:2,”label”:”GPIO 2”,”row”:0,”col”:1,”color”:”#ffff00”,”_uniqueKey”:1},{“pin”:3,”label”:”GPIO 3”,”row”:1,”col”:0,”color”:”#cf006f”,”_uniqueKey”:2}],”ledPanelBackgroundColor”:”#b71c1c”},”title”:”Basic GPIO Panel”,”datasources”:[{“type”:”function”,”name”:”function”,”dataKeys”:[{“name”:”f(x)”,”type”:”function”,”label”:”1”,”color”:”#2196f3”,”settings”:{},”_hash”:0.22518255793320163,”funcBody”:”var period = time % 1500;\nreturn period < 500;”},{“name”:”f(x)”,”type”:”function”,”label”:”2”,”color”:”#4caf50”,”settings”:{},”_hash”:0.7008206860666621,”funcBody”:”var period = time % 1500;\nreturn period >= 500 && period < 1000;”},{“name”:”f(x)”,”type”:”function”,”label”:”3”,”color”:”#f44336”,”settings”:{},”_hash”:0.42600325102193426,”funcBody”:”var period = time % 1500;\nreturn period >= 1000;”}]}],”timewindow”:{“realtime”:{“timewindowMs”:60000}}}”} |
Basic GPIO Panel |
13814000-1dd2-11b2-8080-808080808080 |