{
  "custom": {},
  "params": {
    "tagProps": [
      "",
      "value",
      "value",
      "value",
      "value",
      "value",
      "value",
      "value",
      "value",
      "value"
    ]
  },
  "propConfig": {
    "params.tagProps": {
      "paramDirection": "input",
      "persistent": true
    }
  },
  "props": {
    "defaultSize": {
      "height": 212,
      "width": 336
    }
  },
  "root": {
    "children": [
      {
        "meta": {
          "name": "Label_0"
        },
        "position": {
          "basis": "60px"
        },
        "propConfig": {
          "props.text": {
            "binding": {
              "config": {
                "path": "view.params.tagProps[0]"
              },
              "type": "property"
            }
          }
        },
        "props": {
          "style": {
            "backgroundColor": "#555555",
            "borderBottomLeftRadius": 5,
            "borderBottomRightRadius": 5,
            "borderTopLeftRadius": 5,
            "borderTopRightRadius": 5,
            "marginLeft": 0,
            "marginRight": 0,
            "marginTop": 0
          },
          "textStyle": {
            "textAlign": "start",
            "textIndent": 10
          }
        },
        "type": "ia.display.label"
      },
      {
        "children": [
          {
            "meta": {
              "name": "Label_0"
            },
            "position": {
              "basis": "50px"
            },
            "props": {
              "style": {
                "marginLeft": 10
              },
              "text": "AREA",
              "textStyle": {
                "fontFamily": "Roboto",
                "fontSize": 12
              }
            },
            "type": "ia.display.label"
          },
          {
            "meta": {
              "name": "Label"
            },
            "position": {
              "basis": "195px"
            },
            "propConfig": {
              "props.text": {
                "binding": {
                  "config": {
                    "fallbackDelay": 2.5,
                    "mode": "indirect",
                    "references": {
                      "0": "{view.params.tagProps[0]}"
                    },
                    "tagPath": "{0}/Config/cfg"
                  },
                  "transforms": [
                    {
                      "code": "    decode \u003d system.util.jsonDecode(value)\n    area \u003d decode.get(\"Area\")\n    sub_area \u003d decode.get(\"SubArea\")\n    area_label \u003d str(area) + \"/\" + str(sub_area)\n    return area_label\n\t",
                      "type": "script"
                    }
                  ],
                  "type": "tag"
                }
              }
            },
            "props": {
              "style": {
                "marginLeft": 50
              },
              "textStyle": {
                "fontSize": 12
              }
            },
            "type": "ia.display.label"
          }
        ],
        "meta": {
          "name": "FlexContainer_0"
        },
        "position": {
          "basis": "80px"
        },
        "props": {
          "style": {
            "borderBottomColor": "#555555",
            "borderBottomStyle": "solid",
            "borderBottomWidth": 0.5,
            "borderLeftColor": "#555555",
            "borderLeftStyle": "none",
            "borderLeftWidth": 0.5,
            "borderRightColor": "#555555",
            "borderRightStyle": "none",
            "borderRightWidth": 0.5,
            "borderTopColor": "#555555",
            "borderTopStyle": "solid",
            "borderTopWidth": 0.5
          }
        },
        "type": "ia.container.flex"
      },
      {
        "children": [
          {
            "meta": {
              "name": "Label_0"
            },
            "position": {
              "basis": "50px"
            },
            "props": {
              "style": {
                "marginLeft": 10
              },
              "text": "STATUS",
              "textStyle": {
                "fontFamily": "Roboto",
                "fontSize": 12
              }
            },
            "type": "ia.display.label"
          },
          {
            "events": {
              "dom": {
                "onClick": {
                  "config": {
                    "script": "\tself.session.custom.covert \u003d False\n\tnavigation.navigate_to_page.detailed_view(self, self.view.params.tagProps[0],self.view.params.tagProps[0], self.view.params.tagProps[3])"
                  },
                  "scope": "G",
                  "type": "script"
                }
              }
            },
            "meta": {
              "name": "Label"
            },
            "position": {
              "basis": "236px"
            },
            "propConfig": {
              "custom.status": {
                "binding": {
                  "config": {
                    "path": "/root.custom.status"
                  },
                  "type": "property"
                }
              },
              "props.style.classes": {
                "binding": {
                  "config": {
                    "path": "this.custom.status"
                  },
                  "transforms": [
                    {
                      "fallback": "State-Styles/State0",
                      "inputType": "scalar",
                      "mappings": [
                        {
                          "input": 1,
                          "output": "State-Styles/Background-Fill/State1"
                        },
                        {
                          "input": 2,
                          "output": "State-Styles/Background-Fill/State2"
                        },
                        {
                          "input": 3,
                          "output": "State-Styles/Background-Fill/State3"
                        },
                        {
                          "input": 4,
                          "output": "State-Styles/Background-Fill/State4"
                        },
                        {
                          "input": 5,
                          "output": "State-Styles/Background-Fill/State5"
                        },
                        {
                          "input": 6,
                          "output": "State-Styles/Background-Fill/State6"
                        },
                        {
                          "input": 0,
                          "output": "State-Styles/State0"
                        }
                      ],
                      "outputType": "style-list",
                      "type": "map"
                    }
                  ],
                  "type": "property"
                }
              },
              "props.text": {
                "binding": {
                  "config": {
                    "path": "this.custom.status"
                  },
                  "transforms": [
                    {
                      "fallback": null,
                      "inputType": "scalar",
                      "mappings": [
                        {
                          "input": 5,
                          "output": "HEALTHY"
                        },
                        {
                          "input": 4,
                          "output": "DIAGNOSTIC"
                        },
                        {
                          "input": 3,
                          "output": "PROCESS"
                        },
                        {
                          "input": 2,
                          "output": "STOPPED"
                        },
                        {
                          "input": 1,
                          "output": "FAULTED"
                        },
                        {
                          "input": 6,
                          "output": null
                        }
                      ],
                      "outputType": "scalar",
                      "type": "map"
                    }
                  ],
                  "type": "property"
                }
              }
            },
            "props": {
              "style": {
                "borderBottomLeftRadius": 5,
                "borderBottomRightRadius": 5,
                "borderColor": "#555555",
                "borderStyle": "solid",
                "borderTopLeftRadius": 5,
                "borderTopRightRadius": 5,
                "borderWidth": 2,
                "marginBottom": 10,
                "marginLeft": 50,
                "marginRight": 10,
                "marginTop": 10
              },
              "textStyle": {
                "fontSize": 12,
                "textAlign": "center"
              }
            },
            "type": "ia.display.label"
          }
        ],
        "meta": {
          "name": "FlexContainer_1"
        },
        "position": {
          "basis": "80px"
        },
        "props": {
          "style": {
            "borderBottomColor": "#555555",
            "borderBottomStyle": "solid",
            "borderBottomWidth": 0.5
          }
        },
        "type": "ia.container.flex"
      },
      {
        "children": [
          {
            "children": [
              {
                "events": {
                  "component": {
                    "onActionPerformed": {
                      "config": {
                        "script": "\ttags_to_read \u003d system.tag.readBlocking([\"Configuration/FC\"])\n\twhid \u003d tags_to_read[0].value\n\tcommandTarget\u003dself.view.params.tagProps[0]\n\tCommands.button_commands.send_request(whid, id, action)\n\tactionCode \u003d 1 #Start\n\tfunctionParameters\u003d{}\n\tfunctionParameters[\"commandTarget\"] \u003d commandTarget\n\tfunctionParameters[\"commandCode\"] \u003d actionCode\n\tfunctionParameters[\"commandParams\"] \u003d \"\"\n\tCommands.button_commands.send_request(whid,actionCode,functionParameters)"
                      },
                      "scope": "G",
                      "type": "script"
                    }
                  }
                },
                "meta": {
                  "name": "Start"
                },
                "position": {
                  "basis": "80px"
                },
                "props": {
                  "image": {
                    "height": 32,
                    "icon": {
                      "path": "material/not_started"
                    },
                    "position": "top",
                    "width": 32
                  },
                  "style": {
                    "classes": "Background-Styles/Controller",
                    "marginBottom": 15,
                    "marginLeft": 5,
                    "marginRight": 5,
                    "marginTop": 15
                  },
                  "text": "",
                  "textStyle": {
                    "fontSize": 12,
                    "fontWeight": "bold",
                    "textAlign": "center"
                  }
                },
                "type": "ia.input.button"
              },
              {
                "events": {
                  "component": {
                    "onActionPerformed": {
                      "config": {
                        "script": "\ttags_to_read \u003d system.tag.readBlocking([\"Configuration/FC\"])\n\twhid \u003d tags_to_read[0].value\n\tcommandTarget\u003dself.view.params.tagProps[0]\n\tCommands.button_commands.send_request(whid, id, action)\n\tactionCode \u003d 2 #Stop\n\tfunctionParameters\u003d{}\n\tfunctionParameters[\"commandTarget\"] \u003d commandTarget\n\tfunctionParameters[\"commandCode\"] \u003d actionCode\n\tfunctionParameters[\"commandParams\"] \u003d \"\"\n\tCommands.button_commands.send_request(whid,actionCode,functionParameters)"
                      },
                      "scope": "G",
                      "type": "script"
                    }
                  }
                },
                "meta": {
                  "name": "Stop"
                },
                "position": {
                  "basis": "80px"
                },
                "props": {
                  "image": {
                    "height": 32,
                    "icon": {
                      "path": "material/stop_circle"
                    },
                    "position": "top",
                    "width": 32
                  },
                  "style": {
                    "classes": "Background-Styles/Controller",
                    "marginBottom": 15,
                    "marginLeft": 5,
                    "marginRight": 5,
                    "marginTop": 15
                  },
                  "text": "",
                  "textStyle": {
                    "fontSize": 12,
                    "fontWeight": "bold",
                    "textAlign": "center"
                  }
                },
                "type": "ia.input.button"
              },
              {
                "events": {
                  "component": {
                    "onActionPerformed": {
                      "config": {
                        "script": "\ttags_to_read \u003d system.tag.readBlocking([\"Configuration/FC\"])\n\twhid \u003d tags_to_read[0].value\n\tcommandTarget\u003dself.view.params.tagProps[0]\n\tCommands.button_commands.send_request(whid, id, action)\n\tactionCode \u003d 3 #Reset\n\tfunctionParameters\u003d{}\n\tfunctionParameters[\"commandTarget\"] \u003d commandTarget\n\tfunctionParameters[\"commandCode\"] \u003d actionCode\n\tfunctionParameters[\"commandParams\"] \u003d \"\"\n\tCommands.button_commands.send_request(whid,actionCode,functionParameters)"
                      },
                      "scope": "G",
                      "type": "script"
                    }
                  }
                },
                "meta": {
                  "name": "Reset"
                },
                "position": {
                  "basis": "80px"
                },
                "props": {
                  "image": {
                    "height": 32,
                    "icon": {
                      "path": "material/refresh"
                    },
                    "position": "top",
                    "width": 32
                  },
                  "style": {
                    "classes": "Background-Styles/Controller",
                    "marginBottom": 15,
                    "marginLeft": 5,
                    "marginRight": 5,
                    "marginTop": 15
                  },
                  "text": "",
                  "textStyle": {
                    "fontSize": 12,
                    "fontWeight": "bold",
                    "textAlign": "center"
                  }
                },
                "type": "ia.input.button"
              },
              {
                "meta": {
                  "name": "JAM_Reset"
                },
                "position": {
                  "basis": "80px"
                },
                "props": {
                  "enabled": false,
                  "image": {
                    "height": 32,
                    "icon": {
                      "path": "material/sync_problem"
                    },
                    "position": "top",
                    "width": 32
                  },
                  "style": {
                    "classes": "Background-Styles/Controller",
                    "marginBottom": 15,
                    "marginLeft": 5,
                    "marginRight": 5,
                    "marginTop": 15
                  },
                  "text": "",
                  "textStyle": {
                    "fontSize": 12,
                    "fontWeight": "bold",
                    "textAlign": "center"
                  }
                },
                "type": "ia.input.button"
              }
            ],
            "meta": {
              "name": "FlexContainer"
            },
            "position": {
              "basis": "333px"
            },
            "type": "ia.container.flex"
          }
        ],
        "meta": {
          "name": "FlexContainer_3"
        },
        "position": {
          "basis": "160px"
        },
        "type": "ia.container.flex"
      }
    ],
    "meta": {
      "name": "root"
    },
    "propConfig": {
      "custom.has_role": {
        "binding": {
          "config": {
            "expression": "{session.custom.fc}"
          },
          "transforms": [
            {
              "code": "\trme_role \u003d value +\"-rme-all\"\n\troles \u003d (self.session.props.auth.user.roles)\n\tif (rme_role.lower() in roles \n\tor rme_role.upper() in roles):\n\t\treturn True\n\telse:\n\t\treturn False",
              "type": "script"
            }
          ],
          "type": "expr"
        }
      },
      "custom.status": {
        "binding": {
          "config": {
            "fallbackDelay": 2.5,
            "mode": "indirect",
            "references": {
              "0": "{view.params.tagProps[0]}",
              "fc": "{session.custom.fc}"
            },
            "tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
          },
          "transforms": [
            {
              "expression": "if(isNull({value}), 0, {value})",
              "type": "expression"
            },
            {
              "fallback": null,
              "inputType": "scalar",
              "mappings": [
                {
                  "input": 4,
                  "output": 1
                },
                {
                  "input": 3,
                  "output": 2
                },
                {
                  "input": 2,
                  "output": 3
                },
                {
                  "input": 1,
                  "output": 4
                },
                {
                  "input": 0,
                  "output": 5
                }
              ],
              "outputType": "scalar",
              "type": "map"
            }
          ],
          "type": "tag"
        }
      }
    },
    "props": {
      "direction": "column",
      "style": {
        "animationFillMode": "both",
        "borderBottomLeftRadius": 10,
        "borderBottomRightRadius": 10,
        "borderColor": "#555555",
        "borderStyle": "solid",
        "borderTopLeftRadius": 10,
        "borderTopRightRadius": 10,
        "borderWidth": 1,
        "classes": "Background-Styles/Controller"
      }
    },
    "type": "ia.container.flex"
  }
}