{
  "custom": {},
  "params": {
    "configuring": false,
    "equipmentPath": "",
    "timePeriod": "",
    "title": "Downtime Duration By Reason"
  },
  "propConfig": {
    "params.configuring": {
      "onChange": {
        "enabled": null,
        "script": "\tviewParams\u003dself.params\n\tconfigParams\u003dself.getChild(\"root/configuration\").props.params\n\tif currentValue.value:\n\t\tconfigParams.equipmentPathIn \u003d viewParams.equipmentPath\t\n\t\tconfigParams.timePeriodIn \u003d viewParams.timePeriod\n\t\tconfigParams.titleIn \u003d viewParams.title\n\telif previousValue is not None and previousValue.value:\n\t\tviewParams.equipmentPath \u003d configParams.equipmentPathOut\n\t\tviewParams.timePeriod \u003d configParams.timePeriodOut\n\t\tviewParams.title \u003d configParams.titleOut "
      },
      "paramDirection": "input",
      "persistent": true
    },
    "params.equipmentPath": {
      "paramDirection": "inout",
      "persistent": true
    },
    "params.timePeriod": {
      "paramDirection": "inout",
      "persistent": true
    },
    "params.title": {
      "paramDirection": "inout",
      "persistent": true
    }
  },
  "props": {
    "defaultSize": {
      "height": 450,
      "width": 700
    }
  },
  "root": {
    "children": [
      {
        "children": [
          {
            "meta": {
              "name": "mesAnalysisController",
              "visible": false
            },
            "position": {
              "basis": "64px",
              "display": false
            },
            "propConfig": {
              "custom.end": {
                "binding": {
                  "config": {
                    "fallbackDelay": 2.5,
                    "mode": "expression",
                    "tagPath": "runScript(\u0027shared.mes.schedule.getTagPathForTimePeriodEnd\u0027, 0, {view.params.timePeriod}, {view.params.equipmentPath})"
                  },
                  "transforms": [
                    {
                      "code": "\tif not value:\n\t\treturn system.date.now()\n\treturn value",
                      "type": "script"
                    }
                  ],
                  "type": "tag"
                }
              },
              "custom.start": {
                "binding": {
                  "config": {
                    "fallbackDelay": 2.5,
                    "mode": "expression",
                    "tagPath": "runScript(\u0027shared.mes.schedule.getTagPathForTimePeriodStart\u0027, 0, {view.params.timePeriod}, {view.params.equipmentPath})"
                  },
                  "transforms": [
                    {
                      "code": "\tif not value:\n\t\treturn system.date.addMinutes(system.date.now(), -2)\n\treturn value",
                      "type": "script"
                    }
                  ],
                  "type": "tag"
                }
              },
              "custom.update": {
                "binding": {
                  "config": {
                    "struct": {
                      "end": "{this.custom.end}",
                      "eqPath": "{view.params.equipmentPath}",
                      "period": "{view.params.timePeriod}",
                      "start": "{this.custom.start}"
                    },
                    "waitOnAll": true
                  },
                  "transforms": [
                    {
                      "code": "\tself.props.endDate  \u003d value[\"end\"]\n\tself.props.startDate \u003d value[\"start\"]\n\treturn value",
                      "type": "script"
                    }
                  ],
                  "type": "expr-struct"
                }
              },
              "props.endDate": {
                "persistent": true
              },
              "props.filterParams[0].value": {
                "binding": {
                  "config": {
                    "path": "view.params.equipmentPath"
                  },
                  "type": "property"
                },
                "persistent": false
              },
              "props.startDate": {
                "persistent": true
              }
            },
            "props": {
              "data": {
                "$": [
                  "ds",
                  192,
                  1712785298906
                ],
                "$columns": []
              },
              "drillDownOptions": {
                "$": [
                  "ds",
                  192,
                  1712785275105
                ],
                "$columns": []
              },
              "endDate": {
                "$": [
                  "ts",
                  192,
                  1712785298651
                ],
                "$ts": 1712785298650
              },
              "filterParams": [
                {
                  "param": "eqPath",
                  "type": "string"
                }
              ],
              "message": "Error executing analysis, check Gateway log for full stacktrace: The value for the (Equipment Path) filter item cannot be blank.",
              "refreshOnSettingsChange": true,
              "selectedAnalysisName": "Downtime Pareto",
              "startDate": {
                "$": [
                  "ts",
                  192,
                  1712785298651
                ],
                "$ts": 1712785155129
              }
            },
            "type": "mes.production.mesAnalysisController"
          },
          {
            "meta": {
              "name": "title"
            },
            "position": {
              "shrink": 0
            },
            "propConfig": {
              "position.display": {
                "binding": {
                  "config": {
                    "expression": "coalesce({view.params.title},\u0027\u0027)!\u003d\u0027\u0027"
                  },
                  "type": "expr"
                }
              },
              "props.params.text": {
                "binding": {
                  "config": {
                    "path": "view.params.title"
                  },
                  "type": "property"
                }
              }
            },
            "props": {
              "path": "Page/Embedded/Widget Title"
            },
            "type": "ia.display.view"
          },
          {
            "meta": {
              "name": "PieChart"
            },
            "position": {
              "basis": "350 px",
              "grow": 1
            },
            "propConfig": {
              "props.data": {
                "binding": {
                  "config": {
                    "path": "../mesAnalysisController.props.data"
                  },
                  "overlayOptOut": true,
                  "transforms": [
                    {
                      "code": "\tdef createLabel(name, var):\n\t\treturn {\"label\" : name, \"var\" : round(var,1)}\n\t\t\n\t# convert the incoming value data\n\tpyData \u003d system.dataset.toPyDataSet(value)\n\t# get the header names\n\theader \u003d pyData.getColumnNames()\n\t# create a blank list so we can append later\n\tnewList \u003d []\n\t \n\t# step through the rows\n\tfor row in pyData:\n\t    # create a new blank dictionary for each row of the data\n\t    newDict \u003d {}\n\t    # use an index to step through each column of the data\n\t    for i in range(len(row)):\n\t        # set name/value pairs\n\t        newDict[ header[i] ] \u003d row[i]\n\t     \n\t    # append the dictionary to list\n\t    newList.append(createLabel(newDict[\"Line Downtime Reason\"], newDict[\"Line State Duration\"]))\n\t     \n\t# return the results\n\treturn newList",
                      "type": "script"
                    }
                  ],
                  "type": "property"
                }
              }
            },
            "props": {
              "colors": [
                "#4C9C2E",
                "#004A98",
                "#FFCD00",
                "#D48232"
              ],
              "cutoutRadius": 50,
              "labels": {
                "align": false,
                "wrap": {
                  "enabled": true,
                  "maxWidth": 150
                }
              },
              "legend": {
                "fontSize": 15
              },
              "sectionOutline": {
                "color": "#FFFDFD"
              },
              "showLabels": false,
              "style": {
                "margin": 0,
                "opacity": "1",
                "overflowX": "visible",
                "overflowY": "visible",
                "padding": 0
              },
              "valueFormat": {
                "showValueAsPercent": false
              }
            },
            "type": "ia.chart.pie"
          },
          {
            "meta": {
              "name": "timePeriodLabel"
            },
            "position": {
              "basis": "32px"
            },
            "propConfig": {
              "position.display": {
                "binding": {
                  "config": {
                    "struct": {
                      "eqPath": "{view.params.equipmentPath}",
                      "timePeriod": "{view.params.timePeriod}"
                    },
                    "waitOnAll": true
                  },
                  "transforms": [
                    {
                      "code": "\tif value[\"eqPath\"] \u003d\u003d None or value[\"eqPath\"] \u003d\u003d \"\" or value[\"timePeriod\"] \u003d\u003d \"\" or value[\"timePeriod\"] \u003d\u003d None:\n\t\treturn False \n\treturn True",
                      "type": "script"
                    }
                  ],
                  "type": "expr-struct"
                }
              },
              "props.text": {
                "binding": {
                  "config": {
                    "path": "view.params.timePeriod"
                  },
                  "transforms": [
                    {
                      "code": "\treturn \"(Based on \" +value + \")\"",
                      "type": "script"
                    }
                  ],
                  "type": "property"
                }
              }
            },
            "props": {
              "style": {
                "color": "#808080",
                "fontFamily": "Roboto",
                "fontSize": 12,
                "textAlign": "center"
              }
            },
            "type": "ia.display.label"
          }
        ],
        "meta": {
          "name": "runtime"
        },
        "position": {
          "basis": "200px",
          "grow": 1,
          "shrink": 0
        },
        "propConfig": {
          "position.display": {
            "binding": {
              "config": {
                "expression": "!{view.params.configuring}"
              },
              "type": "expr"
            }
          }
        },
        "props": {
          "alignContent": "center",
          "direction": "column",
          "style": {
            "overflow": "hidden"
          }
        },
        "type": "ia.container.flex"
      },
      {
        "meta": {
          "name": "configuration"
        },
        "position": {
          "basis": "320px",
          "grow": 1
        },
        "propConfig": {
          "position.display": {
            "binding": {
              "config": {
                "path": "view.params.configuring"
              },
              "type": "property"
            }
          },
          "props.params.equipmentPathIn": {
            "persistent": true
          },
          "props.params.timePeriodIn": {
            "persistent": true
          }
        },
        "props": {
          "params": {
            "equipmentPathIn": "",
            "equipmentPathOut": "",
            "timePeriodIn": "",
            "timePeriodOut": "",
            "titleIn": "Downtime Duration By Reason",
            "titleOut": "Downtime Duration By Reason"
          },
          "path": "Page/Widgets/Configuration/Equipment Path, Time Period, Title"
        },
        "type": "ia.display.view"
      }
    ],
    "events": {
      "system": {
        "onStartup": {
          "config": {
            "script": "\t\tself.getChild(\"runtime\").getChild(\"mesAnalysisController\").custom.end \u003d system.date.now()\n\t\t"
          },
          "scope": "G",
          "type": "script"
        }
      }
    },
    "meta": {
      "name": "root"
    },
    "props": {
      "alignContent": "center",
      "direction": "column",
      "style": {
        "overflow": "visible"
      }
    },
    "type": "ia.container.flex"
  }
}