[
    {
        "id": "8381c865.236028",
        "type": "subflow",
        "name": "Single value",
        "info": "The 'single value' subflow allows to extract data from processing node.\r\n\r\n * Filter Data to extract only one variable after the \"processing node\" step .\r\n * Modify the message to fit with standard widgets such as gauges.\r\n * Limit the number of messages to a maximum of 10 msg per second.\r\n\r\n### **Input**\r\n\r\nThe subflow 'single value' takes in input the `msg.payload`\r\nfrom the processing output. All the messages sent by the processing node have the same structure.\r\n\r\n    \"payload\": {\r\n        \"groupname\": \"Snapshot2\",\r\n        \"variabledata\": [\r\n            {\r\n                \"y\": \"9\",\r\n                \"x\": \"1567509421459\"\r\n            },\r\n            {\r\n                \"y\": \"9\",\r\n                \"x\": \"1567509421459\"\r\n            },\r\n            {\r\n                \"y\": \"9\",\r\n                \"x\": \"1567509421459\"\r\n            }\r\n        ],\r\n        \"variablename\": \"int2\"\r\n      }\r\n    }\r\n\r\n### **Filter on selected variable**\r\nSeveral messages are sent by the processing node for each variable, so the first step of this 'single value' subflow is to filter and keep only messages related to the selected variable.\r\nThe 'filter variable' node will only keep messages with the right `variablename` key.\r\n\r\n### **Extract duplets table**\r\n\r\nThe received message is an Object containing {groupname, variabledata[array], variablename}.  \r\nThe array contains two variables :\r\n - `y` the value \r\n - `x` the time\r\n\r\nA single message contains multiple pairs of values extract at a regular time interval.\r\nThe time interval depends on the acquisition frequency.\r\nWith the 'change' node and the `set` property, the `msg.payload` is set to \r\n`msg.payload.variabledata`, only the data variable array is set into msg.payload.\r\n\r\n    \"payload\": {\r\n        \"variabledata\": [\r\n            {\r\n                \"y\": \"9\",\r\n                \"x\": \"1567509421459\"\r\n            },\r\n            {\r\n                \"y\": \"9\",\r\n                \"x\": \"1567509421459\"\r\n            },\r\n            {\r\n                \"y\": \"9\",\r\n                \"x\": \"1567509421459\"\r\n            }\r\n        ]\r\n    }\r\n\r\n### **Split duplets table**\r\n\r\nThe data variable array is split with a length of one in smaller objects by the 'split' node.\r\nEach new object contains two subvariables : `y` and `x`.\r\n\r\n    \"payload\": {\r\n        \"y\": \"9\",\r\n        \"x\": \"1567509421459\"\r\n    }\r\n\r\n\r\n### **Limit the number of messages**\r\n\r\nThe 'delay' node allows to limit the maximum number of message per second.\r\nIn the 'single value' subflow, one message is extracted per second.\r\n\r\n>_Be careful, a dashboard saturation risk exists if too many messages are received per second._\r\n\r\n### **Extract only y values**\r\n\r\nThe `msg.payload` is set to `msg.payload.y` with the `set` property. \r\nOnly `y` variable is set into msg.payload as single value.\r\n\r\n    \"payload\": { \r\n        \"y\": \"9\" \r\n    }\r\n\r\n### **Output** \r\n\r\nSome widgets such as the gauge and the text node are using the `msg.payload` property.  \r\nThe output node is linked to a gauge that allows to see the evolution \r\nof the `y` variable as a function of time.\r\n\r\n\r\n![subflow_gauge](images/subflow_gauge.png)\r\n\r\n### **Details**\r\n\r\nNote : The debug node allows to see clearly and easily the \r\nmessage at the node output.  \r\n\r\n\r\n> More details on : [Node-Red](https://nodered.org/docs/user-guide/editor/workspace/subflows)\r\n\r\n\r\n-------\r\n\r\n",
        "category": "",
        "in": [
            {
                "x": 40,
                "y": 60,
                "wires": [
                    {
                        "id": "3c5ffe0d.9063b2"
                    }
                ]
            }
        ],
        "out": [
            {
                "x": 780,
                "y": 140,
                "wires": [
                    {
                        "id": "66397fd3.d8111",
                        "port": 0
                    }
                ]
            }
        ],
        "env": [
            {
                "name": "varfilter",
                "type": "str",
                "value": "",
                "ui": {
                    "icon": "font-awesome/fa-filter",
                    "label": {
                        "en-US": "Variable"
                    },
                    "type": "input",
                    "opts": {
                        "types": [
                            "str"
                        ]
                    }
                }
            }
        ],
        "color": "#3CB4E6"
    },
    {
        "id": "3c5ffe0d.9063b2",
        "type": "switch",
        "z": "8381c865.236028",
        "name": "filter variable",
        "property": "payload.variablename",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "varfilter",
                "vt": "env"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 170,
        "y": 60,
        "wires": [
            [
                "4e5ba7a5.14dec8"
            ]
        ]
    },
    {
        "id": "4e5ba7a5.14dec8",
        "type": "change",
        "z": "8381c865.236028",
        "name": "keep only table of duplets",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.variabledata",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 430,
        "y": 60,
        "wires": [
            [
                "42bc6ed.5b20d9"
            ]
        ]
    },
    {
        "id": "42bc6ed.5b20d9",
        "type": "split",
        "z": "8381c865.236028",
        "name": "Split a table[1..n] of duplets in n msg of single duplet",
        "splt": "\\n",
        "spltType": "str",
        "arraySplt": 1,
        "arraySpltType": "len",
        "stream": false,
        "addname": "",
        "x": 800,
        "y": 60,
        "wires": [
            [
                "8b8ddb84.6fb208"
            ]
        ]
    },
    {
        "id": "8b8ddb84.6fb208",
        "type": "delay",
        "z": "8381c865.236028",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "10",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "outputs": 1,
        "x": 200,
        "y": 140,
        "wires": [
            [
                "66397fd3.d8111"
            ]
        ]
    },
    {
        "id": "66397fd3.d8111",
        "type": "change",
        "z": "8381c865.236028",
        "name": "keep only value and delete timestamp",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.y",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 490,
        "y": 140,
        "wires": [
            []
        ]
    },
    {
        "id": "7b9ed63e.2138f8",
        "type": "tab",
        "label": "Basic_Flow",
        "disabled": false,
        "info": "# Basic flow to start with STM32CubeMonitor."
    },
    {
        "id": "1ebbb430.dac7dc",
        "type": "ui_chartst",
        "z": "7b9ed63e.2138f8",
        "group": "f9c34dde.1e2f4",
        "name": "myChart",
        "order": 4,
        "width": 15,
        "height": 9,
        "chartType": "line",
        "curveType": "linear",
        "duration": "10",
        "ymin": "",
        "ymax": "",
        "x": 380,
        "y": 420,
        "wires": []
    },
    {
        "id": "6013fb0b.5b7504",
        "type": "acquisition out",
        "z": "7b9ed63e.2138f8",
        "name": "myProbe_Out",
        "probeconfig": "d5c3db8d7cee9f68",
        "x": 540,
        "y": 100,
        "wires": []
    },
    {
        "id": "4a573fb0.4bc99",
        "type": "acquisition in",
        "z": "7b9ed63e.2138f8",
        "name": "myProbe_In",
        "probeconfig": "d5c3db8d7cee9f68",
        "x": 130,
        "y": 280,
        "wires": [
            [
                "a7c3e070.5a6c"
            ],
            []
        ]
    },
    {
        "id": "d59587ff.cd1748",
        "type": "variables",
        "z": "7b9ed63e.2138f8",
        "groupname": "myVariables",
        "accesspoint": 0,
        "execonfig": "02d25fe18ff3ce0c",
        "variablelist": [],
        "triggerstartmode": "manual",
        "triggername": "ADout[3]",
        "triggerthreshold": "30000",
        "frequency": "",
        "frequencyType": "10",
        "snapshotheader": "",
        "mode": "direct",
        "lastImportedTime": 1651751659443,
        "openStatus": true,
        "x": 330,
        "y": 120,
        "wires": [
            [
                "6013fb0b.5b7504"
            ],
            [
                "f14d0398.f1861"
            ]
        ]
    },
    {
        "id": "fc00295e.79ada8",
        "type": "ui_button",
        "z": "7b9ed63e.2138f8",
        "name": "",
        "group": "f9c34dde.1e2f4",
        "order": 3,
        "width": 5,
        "height": 1,
        "passthru": false,
        "label": "Clear Graphs",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "clear",
        "x": 140,
        "y": 420,
        "wires": [
            [
                "1ebbb430.dac7dc"
            ]
        ]
    },
    {
        "id": "5fd51c96.2330e4",
        "type": "ui_button",
        "z": "7b9ed63e.2138f8",
        "name": "",
        "group": "f9c34dde.1e2f4",
        "order": 1,
        "width": 5,
        "height": 1,
        "passthru": false,
        "label": "START Acquisition",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "start",
        "x": 110,
        "y": 80,
        "wires": [
            [
                "d59587ff.cd1748"
            ]
        ]
    },
    {
        "id": "52eadfe3.2c8cc",
        "type": "ui_button",
        "z": "7b9ed63e.2138f8",
        "name": "",
        "group": "f9c34dde.1e2f4",
        "order": 2,
        "width": 5,
        "height": 1,
        "passthru": true,
        "label": "STOP Acquisition",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "stop",
        "x": 110,
        "y": 160,
        "wires": [
            [
                "d59587ff.cd1748"
            ]
        ]
    },
    {
        "id": "a7c3e070.5a6c",
        "type": "processing",
        "z": "7b9ed63e.2138f8",
        "groupname": "myVariables",
        "groupid": "d59587ff.cd1748",
        "expressions": [],
        "statistics": [],
        "logmode": "no",
        "logformat": "stcm",
        "x": 330,
        "y": 260,
        "wires": [
            [
                "1ebbb430.dac7dc",
                "34dbb5d7d2e367be",
                "9459f13042ba94c7",
                "260a3b9a7e449d29",
                "ba9a7cf5f539d5c7"
            ],
            []
        ]
    },
    {
        "id": "f14d0398.f1861",
        "type": "ui_toast",
        "z": "7b9ed63e.2138f8",
        "position": "top right",
        "displayTime": "3",
        "highlight": "",
        "sendall": true,
        "outputs": 0,
        "ok": "OK",
        "cancel": "",
        "raw": false,
        "topic": "",
        "name": "",
        "x": 530,
        "y": 160,
        "wires": []
    },
    {
        "id": "34dbb5d7d2e367be",
        "type": "subflow:8381c865.236028",
        "z": "7b9ed63e.2138f8",
        "name": "A3",
        "env": [
            {
                "name": "varfilter",
                "value": "ADout[3]",
                "type": "str"
            }
        ],
        "x": 570,
        "y": 480,
        "wires": [
            [
                "cc2ef2f52d2c5d62"
            ]
        ]
    },
    {
        "id": "540def5f049f6cd9",
        "type": "ui_text",
        "z": "7b9ed63e.2138f8",
        "group": "f9c34dde.1e2f4",
        "order": 4,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "A0:",
        "format": "{{msg.payload}}",
        "layout": "row-left",
        "className": "",
        "x": 750,
        "y": 300,
        "wires": []
    },
    {
        "id": "9459f13042ba94c7",
        "type": "subflow:8381c865.236028",
        "z": "7b9ed63e.2138f8",
        "name": "A0",
        "env": [
            {
                "name": "varfilter",
                "value": "ADout[0]",
                "type": "str"
            }
        ],
        "x": 570,
        "y": 300,
        "wires": [
            [
                "540def5f049f6cd9"
            ]
        ]
    },
    {
        "id": "260a3b9a7e449d29",
        "type": "subflow:8381c865.236028",
        "z": "7b9ed63e.2138f8",
        "name": "A1",
        "env": [
            {
                "name": "varfilter",
                "value": "ADout[1]",
                "type": "str"
            }
        ],
        "x": 570,
        "y": 360,
        "wires": [
            [
                "2744a3b4e7a82989"
            ]
        ]
    },
    {
        "id": "ba9a7cf5f539d5c7",
        "type": "subflow:8381c865.236028",
        "z": "7b9ed63e.2138f8",
        "name": "A2",
        "env": [
            {
                "name": "varfilter",
                "value": "ADout[2]",
                "type": "str"
            }
        ],
        "x": 570,
        "y": 420,
        "wires": [
            [
                "54c0e32b5ed6328e"
            ]
        ]
    },
    {
        "id": "2744a3b4e7a82989",
        "type": "ui_text",
        "z": "7b9ed63e.2138f8",
        "group": "f9c34dde.1e2f4",
        "order": 5,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "A1:",
        "format": "{{msg.payload}}",
        "layout": "row-left",
        "className": "",
        "x": 750,
        "y": 360,
        "wires": []
    },
    {
        "id": "54c0e32b5ed6328e",
        "type": "ui_text",
        "z": "7b9ed63e.2138f8",
        "group": "f9c34dde.1e2f4",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "A2:",
        "format": "{{msg.payload}}",
        "layout": "row-left",
        "className": "",
        "x": 750,
        "y": 420,
        "wires": []
    },
    {
        "id": "cc2ef2f52d2c5d62",
        "type": "ui_text",
        "z": "7b9ed63e.2138f8",
        "group": "f9c34dde.1e2f4",
        "order": 7,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "A3:",
        "format": "{{msg.payload}}",
        "layout": "row-left",
        "className": "",
        "x": 750,
        "y": 480,
        "wires": []
    },
    {
        "id": "f9c34dde.1e2f4",
        "type": "ui_group",
        "name": "Chart",
        "tab": "17d09b07.741a55",
        "order": 1,
        "disp": true,
        "width": 15,
        "collapse": false
    },
    {
        "id": "d5c3db8d7cee9f68",
        "type": "probe",
        "probeid": "50FF69066675545717251887",
        "probename": "ST-Link v2 (...51887)",
        "protocol": "SWD",
        "frequency": "1.8 MHz - Default",
        "probeproperty": "{\"SWD\":[\"4.6 MHz\",\"1.8 MHz - Default\",\"950 kHz\",\"400 kHz\",\"150 kHz\"],\"JTAG\":[\"18 MHz\",\"9 MHz\",\"4.5 MHz\",\"2.25 MHz\",\"1.12 MHz - Default\",\"560 kHz\",\"280 kHz\",\"140 kHz\"]}",
        "probeversion": "ST Link firmware version V2.J39",
        "connectionType": "p2p"
    },
    {
        "id": "02d25fe18ff3ce0c",
        "type": "exe-config",
        "name": "mon",
        "exefile": "d:\\dokumenty\\vyuka\\09-DP-RP\\2021-2022\\06-Lukac\\07-deska\\03-SW\\02-mon\\Debug\\st_mon.elf",
        "exefolder": "d:\\dokumenty\\vyuka\\09-DP-RP\\2021-2022\\06-Lukac\\07-deska\\03-SW\\02-mon\\Debug\\",
        "exevariablelist": [
            {
                "address": "0x2000007c",
                "name": "ADout[0]",
                "type": 9,
                "checked": true
            },
            {
                "address": "0x20000080",
                "name": "ADout[1]",
                "type": 9,
                "checked": true
            },
            {
                "address": "0x20000084",
                "name": "ADout[2]",
                "type": 9,
                "checked": true
            },
            {
                "address": "0x20000088",
                "name": "ADout[3]",
                "type": 9,
                "checked": true
            },
            {
                "address": "0x20000068",
                "name": "ADraw[0]",
                "type": 5,
                "checked": false
            },
            {
                "address": "0x2000006c",
                "name": "ADraw[1]",
                "type": 5,
                "checked": false
            },
            {
                "address": "0x20000070",
                "name": "ADraw[2]",
                "type": 5,
                "checked": false
            },
            {
                "address": "0x20000074",
                "name": "ADraw[3]",
                "type": 5,
                "checked": false
            },
            {
                "address": "0x080021d4",
                "name": "AHBPrescTable[0]",
                "type": 1
            },
            {
                "address": "0x080021de",
                "name": "AHBPrescTable[10]",
                "type": 1
            },
            {
                "address": "0x080021df",
                "name": "AHBPrescTable[11]",
                "type": 1
            },
            {
                "address": "0x080021e0",
                "name": "AHBPrescTable[12]",
                "type": 1
            },
            {
                "address": "0x080021e1",
                "name": "AHBPrescTable[13]",
                "type": 1
            },
            {
                "address": "0x080021e2",
                "name": "AHBPrescTable[14]",
                "type": 1
            },
            {
                "address": "0x080021e3",
                "name": "AHBPrescTable[15]",
                "type": 1
            },
            {
                "address": "0x080021d5",
                "name": "AHBPrescTable[1]",
                "type": 1
            },
            {
                "address": "0x080021d6",
                "name": "AHBPrescTable[2]",
                "type": 1
            },
            {
                "address": "0x080021d7",
                "name": "AHBPrescTable[3]",
                "type": 1
            },
            {
                "address": "0x080021d8",
                "name": "AHBPrescTable[4]",
                "type": 1
            },
            {
                "address": "0x080021d9",
                "name": "AHBPrescTable[5]",
                "type": 1
            },
            {
                "address": "0x080021da",
                "name": "AHBPrescTable[6]",
                "type": 1
            },
            {
                "address": "0x080021db",
                "name": "AHBPrescTable[7]",
                "type": 1
            },
            {
                "address": "0x080021dc",
                "name": "AHBPrescTable[8]",
                "type": 1
            },
            {
                "address": "0x080021dd",
                "name": "AHBPrescTable[9]",
                "type": 1
            },
            {
                "address": "0x20000078",
                "name": "chcnt",
                "type": 5
            },
            {
                "address": "0x20000058",
                "name": "hadc.DMA_Handle",
                "type": 5
            },
            {
                "address": "0x20000064",
                "name": "hadc.ErrorCode",
                "type": 5
            },
            {
                "address": "0x2000002c",
                "name": "hadc.Init.ClockPrescaler",
                "type": 5
            },
            {
                "address": "0x20000042",
                "name": "hadc.Init.ContinuousConvMode",
                "type": 2
            },
            {
                "address": "0x20000034",
                "name": "hadc.Init.DataAlign",
                "type": 5
            },
            {
                "address": "0x20000043",
                "name": "hadc.Init.DiscontinuousConvMode",
                "type": 2
            },
            {
                "address": "0x2000004c",
                "name": "hadc.Init.DMAContinuousRequests",
                "type": 2
            },
            {
                "address": "0x2000003c",
                "name": "hadc.Init.EOCSelection",
                "type": 5
            },
            {
                "address": "0x20000044",
                "name": "hadc.Init.ExternalTrigConv",
                "type": 5
            },
            {
                "address": "0x20000048",
                "name": "hadc.Init.ExternalTrigConvEdge",
                "type": 5
            },
            {
                "address": "0x20000041",
                "name": "hadc.Init.LowPowerAutoPowerOff",
                "type": 2
            },
            {
                "address": "0x20000040",
                "name": "hadc.Init.LowPowerAutoWait",
                "type": 2
            },
            {
                "address": "0x20000050",
                "name": "hadc.Init.Overrun",
                "type": 5
            },
            {
                "address": "0x20000030",
                "name": "hadc.Init.Resolution",
                "type": 5
            },
            {
                "address": "0x20000054",
                "name": "hadc.Init.SamplingTimeCommon",
                "type": 5
            },
            {
                "address": "0x20000038",
                "name": "hadc.Init.ScanConvMode",
                "type": 5
            },
            {
                "address": "0x20000028",
                "name": "hadc.Instance",
                "type": 5
            },
            {
                "address": "0x2000005c",
                "name": "hadc.Lock",
                "type": 2
            },
            {
                "address": "0x20000060",
                "name": "hadc.State",
                "type": 5
            },
            {
                "address": "0x20000000",
                "name": "SystemCoreClock",
                "type": 5
            },
            {
                "address": "0x2000008c",
                "name": "uwTick",
                "type": 5
            },
            {
                "address": "0x20000008",
                "name": "uwTickFreq",
                "type": 2
            },
            {
                "address": "0x20000004",
                "name": "uwTickPrio",
                "type": 5
            }
        ],
        "expand": true,
        "filename": "st_mon.elf",
        "exeModifiedTime": 1651751591481,
        "configLastUpdate": 1651751659122
    },
    {
        "id": "17d09b07.741a55",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]