{
  "custom": {},
  "params": {
    "equipmentPath": "",
    "timePeriod": ""
  },
  "propConfig": {
    "params.equipmentPath": {
      "paramDirection": "input",
      "persistent": true
    },
    "params.timePeriod": {
      "paramDirection": "input",
      "persistent": true
    }
  },
  "props": {},
  "root": {
    "children": [
      {
        "meta": {
          "name": "EmbeddedView"
        },
        "propConfig": {
          "props.params.text": {
            "binding": {
              "config": {
                "expression": "{view.params.equipmentPath}"
              },
              "transforms": [
                {
                  "code": "\tif value \u003d\u003d \"\" or value is None:\n\t\treturn \"\"\n\treturn value.split(\u0027\\\\\u0027)[3]",
                  "type": "script"
                }
              ],
              "type": "expr"
            }
          }
        },
        "props": {
          "path": "Page/Embedded/Widget Title",
          "style": {
            "overflow": "hidden"
          }
        },
        "type": "ia.display.view"
      },
      {
        "meta": {
          "name": "PieChart"
        },
        "position": {
          "basis": "375px",
          "grow": 1
        },
        "propConfig": {
          "props.data": {
            "binding": {
              "config": {
                "path": "../mesAnalysisController.custom.data"
              },
              "type": "property"
            }
          }
        },
        "props": {
          "colors": [
            "#4FC86C",
            "#EC4B3D",
            "#3366CC",
            "#CCC233",
            "#E69300"
          ],
          "cutoutRadius": 50,
          "labels": {
            "bent": true
          },
          "showLegend": false,
          "valueFormat": {
            "showValueAsPercent": false
          }
        },
        "type": "ia.chart.pie"
      },
      {
        "custom": {
          "data": []
        },
        "meta": {
          "name": "mesAnalysisController"
        },
        "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.data": {
            "onChange": {
              "enabled": null,
              "script": "\tds \u003d currentValue.value\n\t\n\tdata \u003d []\n\tfor row in range(ds.getRowCount()):\n\t\tif ds.getValueAt(row,\"Line Target Count Variance\") \u003c 0:\n\t\t\tremaining \u003d abs(ds.getValueAt(row,\"Line Target Count Variance\"))\n\t\telse:\n\t\t\tremaining \u003d 0\n\t\tdata\u003d[\n\t\t  {\n\t\t    \"label\": \"Produced\",\n\t\t    \"count\": ds.getValueAt(row,\"OEE Outfeed Count\")\n\t\t  },\n\t\t  {\n\t\t    \"label\": \"Reject\",\n\t\t    \"count\": ds.getValueAt(row,\"OEE Reject Count\")\n\t\t  },\n\t\t  {\n\t\t    \"label\": \"Remaining\",\n\t\t\t\"count\": remaining\n\t\t  }\n\t\t]\n\tself.custom.data \u003d data"
            }
          },
          "props.filterParams[0].value": {
            "binding": {
              "config": {
                "path": "view.params.equipmentPath"
              },
              "type": "property"
            }
          }
        },
        "props": {
          "data": {
            "$": [
              "ds",
              192,
              1712785364369
            ],
            "$columns": []
          },
          "drillDownOptions": {
            "$": [
              "ds",
              192,
              1712785344942
            ],
            "$columns": []
          },
          "endDate": {
            "$": [
              "ts",
              192,
              1712785364114
            ],
            "$ts": 1712785364113
          },
          "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": "Line Production Goal",
          "startDate": {
            "$": [
              "ts",
              192,
              1712785364114
            ],
            "$ts": 1712785224962
          }
        },
        "type": "mes.production.mesAnalysisController"
      },
      {
        "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"
      }
    ],
    "events": {
      "system": {
        "onStartup": {
          "config": {
            "script": "\tself.getChild(\"mesAnalysisController\").custom.end \u003d system.date.now()"
          },
          "scope": "G",
          "type": "script"
        }
      }
    },
    "meta": {
      "name": "root"
    },
    "props": {
      "direction": "column",
      "style": {
        "overflow": "hidden"
      }
    },
    "type": "ia.container.flex"
  }
}