{
  "custom": {},
  "params": {},
  "permissions": {
    "securityLevels": [
      {
        "children": [],
        "name": "Authenticated"
      }
    ],
    "type": "AllOf"
  },
  "props": {
    "defaultSize": {
      "width": 963
    }
  },
  "root": {
    "children": [
      {
        "children": [
          {
            "children": [
              {
                "events": {
                  "component": {
                    "onActionPerformed": {
                      "config": {
                        "script": "\tgoodFeedBack \u003d \"\"\n\tbadFeedBack \u003d \"\"\n\tlogger \u003d system.util.getLogger(\u0027Onboarding\u0027)\n\t\n\tlogger.info(\u0027Adding auto update menu on line save\u0027)\n\tFeedBackTittle \u003d \"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003dadding isManual\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\\n\"\n\tFeedBack \u003d shared.onboarding.init._create_mes_object_save_script()\n\tlogger.info(\u0027finished adding Adding auto update menu on line save\u0027)\n\tif  \"ERROR:\" in FeedBack:\n\t\tbadFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\telse:\n\t\tgoodFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\t\n\t\n\tlogger.info(\u0027adding isManual property to lines\u0027)\n\tFeedBackTittle \u003d \"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003dadding isManual\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\\n\"\n\tFeedBack \u003d shared.onboarding.Equipment.addIsManualPropertyToLines()\n\tlogger.info(\u0027finished adding isManual property to lines\u0027)\n\tif  \"ERROR:\" in FeedBack:\n\t\tbadFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\telse:\n\t\tgoodFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\t\t\n\tlogger.info(\u0027adding live analysis to equipment\u0027)\n\tFeedBackTittle \u003d \"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003dadding live analysis\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\"\n\tFeedBack \u003d shared.onboarding.Analysis.createAllLiveAnalysis()\n\tlogger.info(\u0027finished adding live analysis to equipment\u0027)\n\tif  \"ERROR:\" in FeedBack:\n\t\tbadFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\telse:\n\t\tgoodFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\t\t\n\tlogger.info(\u0027adding stock analysis lines\u0027)\n\tFeedBackTittle \u003d \"\\n\u003d\u003d\u003d\u003d\u003d\u003d\u003dadding stock analysis\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\\n\"\n\tFeedBack \u003d shared.onboarding.Analysis.createLinesStockAnalyses()\n\tlogger.info(\u0027finished adding stock analysis lines\u0027)\n\tif  \"ERROR:\" in FeedBack:\n\t\tbadFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\telse:\n\t\tgoodFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\tlogger.info(\u0027adding site home screens\u0027)\n\tFeedBackTittle \u003d \"\\n\u003d\u003d\u003d\u003d\u003dadding site home screens\u003d\u003d\u003d\u003d\u003d\u003d\u003d\\n\"\n\tFeedBack \u003d shared.onboarding.init._create_line_home_screen()\n\tlogger.info(\u0027finished adding stock analysis lines\u0027)\n\tif  \"ERROR:\" in FeedBack:\n\t\tbadFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\telse:\n\t\tgoodFeedBack +\u003d FeedBackTittle + FeedBack + \"\\n\"\n\t\n\tself.parent.parent.getChild(\"goodFeedBack\").props.text \u003d goodFeedBack\n\tself.parent.parent.getChild(\"badFeedBack\").props.text \u003d badFeedBack "
                      },
                      "scope": "G",
                      "type": "script"
                    }
                  }
                },
                "meta": {
                  "name": "update equipment"
                },
                "position": {
                  "basis": "293px"
                },
                "props": {
                  "text": "Refresh Analysis for all Equipment"
                },
                "type": "ia.input.button"
              }
            ],
            "meta": {
              "name": "RefreshAnalysisFlexContainer"
            },
            "position": {
              "basis": "54px"
            },
            "type": "ia.container.flex"
          },
          {
            "meta": {
              "name": "InitializeSiteLabel"
            },
            "position": {
              "basis": "32px"
            },
            "props": {
              "text": "Add Site Location for Map"
            },
            "type": "ia.display.label"
          },
          {
            "children": [
              {
                "events": {
                  "component": {
                    "objectSelected": {
                      "config": {
                        "script": "\tsiteObj \u003d system.mes.loadMESObject(self.props.selectedMESObject.mesObjectUUID)\n\tproperties \u003d siteObj.getCustomPropertiesFull()\n\tif \u0027lat\u0027 in properties:\n\t\tself.getSibling(\"Latitude\").props.value \u003d siteObj.getPropertyValue(\u0027lat\u0027)\n\telse:\n\t\tself.getSibling(\"Latitude\").props.value \u003d 0.0\n\tif \u0027lng\u0027 in properties:\n\t\tself.getSibling(\"Longtitude\").props.value \u003d siteObj.getPropertyValue(\u0027lng\u0027)\n\telse:\n\t\tself.getSibling(\"Longtitude\").props.value \u003d 0.0"
                      },
                      "scope": "G",
                      "type": "script"
                    }
                  }
                },
                "meta": {
                  "name": "LineObjectSelector"
                },
                "position": {
                  "basis": "470px"
                },
                "props": {
                  "displayText": "Select Site",
                  "includeMESSiteObjects": true,
                  "showEquipmentPath": true
                },
                "type": "mes.production.mesObjectSelector"
              },
              {
                "meta": {
                  "name": "lbl_lat"
                },
                "position": {
                  "basis": "33px"
                },
                "props": {
                  "style": {
                    "marginLeft": 10
                  },
                  "text": "Lat:"
                },
                "type": "ia.display.label"
              },
              {
                "meta": {
                  "name": "Latitude"
                },
                "position": {
                  "basis": "120px"
                },
                "props": {
                  "format": "0,0.0000000",
                  "inputBounds": {
                    "maximum": 90,
                    "minimum": -90
                  },
                  "placeholder": "Enter Latitude...",
                  "spinner": {
                    "enabled": false
                  },
                  "style": {
                    "marginBottom": 15,
                    "marginRight": 10,
                    "marginTop": 15
                  },
                  "value": "38.63697"
                },
                "type": "ia.input.numeric-entry-field"
              },
              {
                "meta": {
                  "name": "lbl_lng"
                },
                "position": {
                  "basis": "50px"
                },
                "props": {
                  "text": "Long:"
                },
                "type": "ia.display.label"
              },
              {
                "meta": {
                  "name": "Longtitude"
                },
                "position": {
                  "basis": "120px"
                },
                "props": {
                  "format": "0,0.0000000",
                  "inputBounds": {
                    "maximum": 180,
                    "minimum": -180
                  },
                  "placeholder": "Enter Longtitude...",
                  "spinner": {
                    "enabled": false
                  },
                  "style": {
                    "marginBottom": 15,
                    "marginRight": 10,
                    "marginTop": 15
                  },
                  "value": "-121.06573"
                },
                "type": "ia.input.numeric-entry-field"
              },
              {
                "events": {
                  "component": {
                    "onActionPerformed": {
                      "config": {
                        "script": "\t\n\teqPath \u003d self.getSibling(\"LineObjectSelector\").props.selectedMESObject.equipmentPath\n\t\n\t\n\tlat \u003d self.getSibling(\"Latitude\").props.value\n\tlng \u003d self.getSibling(\"Longtitude\").props.value\n\tFeedBack \u003d shared.onboarding.Equipment.siteCustomPropertyInit(eqPath, lat,lng)\n\t\n\tif FeedBack is not None and FeedBack[0:6] \u003d\u003d \"ERROR:\":\n\t\tself.parent.parent.getChild(\"goodFeedBack\").props.text \u003d \"\"\n\t\tself.parent.parent.getChild(\"badFeedBack\").props.text \u003d FeedBack \n\telse:\n\t\tself.parent.parent.getChild(\"goodFeedBack\").props.text \u003d FeedBack\n\t\tself.parent.parent.getChild(\"badFeedBack\").props.text \u003d \"\"\n"
                      },
                      "scope": "G",
                      "type": "script"
                    }
                  }
                },
                "meta": {
                  "name": "Button"
                },
                "position": {
                  "basis": "80px"
                },
                "props": {
                  "text": "Save"
                },
                "type": "ia.input.button"
              },
              {
                "events": {
                  "dom": {
                    "onClick": {
                      "config": {
                        "draggable": true,
                        "id": "LsJNGYwk",
                        "modal": true,
                        "overlayDismiss": true,
                        "position": {
                          "height": 600,
                          "relativeLocation": "center",
                          "width": 600
                        },
                        "positionType": "relative",
                        "resizable": true,
                        "showCloseIcon": true,
                        "type": "open",
                        "viewPath": "Page/Enterprise/Map View",
                        "viewportBound": true
                      },
                      "scope": "C",
                      "type": "popup"
                    }
                  }
                },
                "meta": {
                  "name": "Icon",
                  "tooltip": {
                    "enabled": true,
                    "text": "View Map"
                  }
                },
                "position": {
                  "basis": "30px"
                },
                "props": {
                  "path": "material/remove_red_eye"
                },
                "type": "ia.display.icon"
              }
            ],
            "meta": {
              "name": "InitializeSiteFlexContainer"
            },
            "position": {
              "basis": "60px",
              "shrink": 0
            },
            "props": {
              "style": {
                "borderBottomStyle": "solid",
                "borderBottomWidth": 1,
                "borderLeftStyle": "none",
                "borderRightStyle": "none",
                "borderTopStyle": "none",
                "overflow": "visible"
              }
            },
            "type": "ia.container.flex"
          },
          {
            "meta": {
              "name": "InitializeLineLabel"
            },
            "position": {
              "basis": "32px",
              "display": false
            },
            "props": {
              "text": "Initialize Line Custom Property"
            },
            "type": "ia.display.label"
          },
          {
            "children": [
              {
                "meta": {
                  "name": "LineObjectSelector"
                },
                "position": {
                  "basis": "470px"
                },
                "props": {
                  "displayText": "Select Line",
                  "includeMESLineObjects": true,
                  "selectedMESObject": {
                    "childCount": -1
                  },
                  "showEquipmentPath": true
                },
                "type": "mes.production.mesObjectSelector"
              },
              {
                "meta": {
                  "name": "isManualCheckbox"
                },
                "props": {
                  "text": "isManual",
                  "textPosition": "left"
                },
                "type": "ia.input.checkbox"
              },
              {
                "events": {
                  "component": {
                    "onActionPerformed": {
                      "config": {
                        "script": "\t\n\teqPath \u003d self.getSibling(\"LineObjectSelector\").props.selectedMESObject.equipmentPath\n\t\n\tisManul \u003d self.getSibling(\"isManualCheckbox\").props.selected\n\n\tFeedBack \u003d shared.onboarding.Equipment.lineCustomPropertyInit(eqPath, isManul)\n\t\n\tif FeedBack is not None and FeedBack[0:6] \u003d\u003d \"ERROR:\":\n\t\tself.parent.parent.getChild(\"goodFeedBack\").props.text \u003d \"\"\n\t\tself.parent.parent.getChild(\"badFeedBack\").props.text \u003d FeedBack \n\telse:\n\t\tself.parent.parent.getChild(\"goodFeedBack\").props.text \u003d FeedBack\n\t\tself.parent.parent.getChild(\"badFeedBack\").props.text \u003d \"\"\n"
                      },
                      "scope": "G",
                      "type": "script"
                    }
                  }
                },
                "meta": {
                  "name": "Button"
                },
                "position": {
                  "basis": "80px"
                },
                "props": {
                  "text": "Save"
                },
                "type": "ia.input.button"
              }
            ],
            "meta": {
              "name": "InitializeLineFlexContainer"
            },
            "position": {
              "basis": "60px",
              "display": false
            },
            "props": {
              "style": {
                "borderBottomStyle": "solid",
                "borderBottomWidth": 1,
                "overflow": "visible"
              }
            },
            "type": "ia.container.flex"
          },
          {
            "meta": {
              "name": "createUDTForLine"
            },
            "position": {
              "basis": "40px",
              "shrink": 0
            },
            "props": {
              "text": "Create UDT For Line"
            },
            "type": "ia.display.label"
          },
          {
            "children": [
              {
                "meta": {
                  "name": "Label_1"
                },
                "position": {
                  "basis": "30px"
                },
                "props": {
                  "text": "Select Line"
                },
                "type": "ia.display.label"
              },
              {
                "meta": {
                  "name": "mos_line"
                },
                "position": {
                  "basis": "50px"
                },
                "props": {
                  "displayText": "Select Line",
                  "includeMESLineObjects": true,
                  "selectedMESObject": {
                    "childCount": -1
                  },
                  "showEquipmentPath": true
                },
                "type": "mes.production.mesObjectSelector"
              },
              {
                "meta": {
                  "name": "Label"
                },
                "position": {
                  "basis": "40px",
                  "shrink": 0
                },
                "props": {
                  "text": "Select Infeed Equipment"
                },
                "type": "ia.display.label"
              },
              {
                "meta": {
                  "name": "mos_infeedEq"
                },
                "position": {
                  "basis": "50px"
                },
                "propConfig": {
                  "props.includeMESLineCellObjects": {
                    "binding": {
                      "config": {
                        "path": "../mos_line.props.selectedMESObject.equipmentPath"
                      },
                      "transforms": [
                        {
                          "code": "\treturn value !\u003d \u0027\u0027",
                          "type": "script"
                        }
                      ],
                      "type": "property"
                    }
                  },
                  "props.parentMESObjectFilter": {
                    "binding": {
                      "config": {
                        "path": "../mos_line.props.selectedMESObject"
                      },
                      "type": "property"
                    }
                  }
                },
                "props": {
                  "displayText": "Select Outfeed Equipment"
                },
                "type": "mes.production.mesObjectSelector"
              },
              {
                "meta": {
                  "name": "Label_0"
                },
                "position": {
                  "basis": "40px",
                  "shrink": 0
                },
                "props": {
                  "text": "Select Outfeed Equipment"
                },
                "type": "ia.display.label"
              },
              {
                "meta": {
                  "name": "mos_outfeedEq"
                },
                "position": {
                  "basis": "50px",
                  "shrink": 0
                },
                "propConfig": {
                  "props.includeMESLineCellObjects": {
                    "binding": {
                      "config": {
                        "path": "../mos_line.props.selectedMESObject.equipmentPath"
                      },
                      "transforms": [
                        {
                          "code": "\treturn value !\u003d \u0027\u0027",
                          "type": "script"
                        }
                      ],
                      "type": "property"
                    }
                  },
                  "props.parentMESObjectFilter": {
                    "binding": {
                      "config": {
                        "path": "../mos_line.props.selectedMESObject"
                      },
                      "type": "property"
                    }
                  }
                },
                "props": {
                  "displayText": "Select Infeed Equipment"
                },
                "type": "mes.production.mesObjectSelector"
              },
              {
                "children": [
                  {
                    "events": {
                      "component": {
                        "onActionPerformed": {
                          "config": {
                            "script": "\tself.parent.parent.parent.getChild(\"goodFeedBack\").props.text \u003d \u0027\u0027\n\tself.parent.parent.parent.getChild(\"badFeedBack\").props.text \u003d \u0027\u0027\n\t \n\tlinePath \u003d self.parent.parent.getChild(\"mos_line\").props.selectedMESObject.equipmentPath\n\tinfeedPath \u003d self.parent.parent.getChild(\"mos_infeedEq\").props.selectedMESObject.mesObjectUUID\n\toutfeedPath \u003d self.parent.parent.getChild(\"mos_outfeedEq\").props.selectedMESObject.mesObjectUUID\n\t\n\tif linePath \u003d\u003d \u0027\u0027 or infeedPath \u003d\u003d \u0027\u0027 or outfeedPath \u003d\u003d \u0027\u0027:\n\t\tself.parent.parent.parent.getChild(\"badFeedBack\").props.text \u003d \u0027Must Select Line, Infeed, and Outfeed Equipment.\u0027\n\telse:\n\t\ttry:\n\t\t\tshared.onboarding.Equipment.createSimUDTInstance(linePath, infeedPath, outfeedPath, True)\n\t\t\tself.parent.parent.parent.getChild(\"goodFeedBack\").props.text \u003d \u0027Successfully created UDT for \u0027 + linePath\n\t\texcept:\n\t\t\tself.parent.parent.parent.getChild(\"badFeedBack\").props.text \u003d \u0027Something went wrong creating UDT.  Check Ignition logs for details\u0027"
                          },
                          "scope": "G",
                          "type": "script"
                        }
                      }
                    },
                    "meta": {
                      "name": "btn_save"
                    },
                    "position": {
                      "basis": "129px"
                    },
                    "props": {
                      "style": {
                        "marginBottom": 5,
                        "marginTop": 5
                      },
                      "text": "Create UDT"
                    },
                    "type": "ia.input.button"
                  }
                ],
                "meta": {
                  "name": "flx_saveUDT"
                },
                "position": {
                  "basis": "75px"
                },
                "props": {
                  "justify": "center"
                },
                "type": "ia.container.flex"
              }
            ],
            "meta": {
              "name": "CreateUDTForLineFlexContainer"
            },
            "position": {
              "basis": "350px",
              "shrink": 0
            },
            "props": {
              "alignContent": "flex-end",
              "direction": "column",
              "style": {
                "borderBottomLeftRadius": 10,
                "borderBottomRightRadius": 10,
                "borderStyle": "solid",
                "borderTopLeftRadius": 10,
                "borderTopRightRadius": 10,
                "borderWidth": 1.5,
                "marginLeft": 50,
                "marginRight": 50
              }
            },
            "type": "ia.container.flex"
          },
          {
            "meta": {
              "name": "FeedbackLabel"
            },
            "position": {
              "basis": "32px"
            },
            "props": {
              "text": "Feedback:"
            },
            "type": "ia.display.label"
          },
          {
            "meta": {
              "name": "goodFeedBack"
            },
            "position": {
              "basis": "160px",
              "grow": 1
            },
            "props": {
              "style": {
                "color": "green"
              }
            },
            "type": "ia.input.text-area"
          },
          {
            "meta": {
              "name": "badFeedBack"
            },
            "position": {
              "basis": "160px",
              "grow": 1
            },
            "props": {
              "style": {
                "color": "red"
              }
            },
            "type": "ia.input.text-area"
          }
        ],
        "meta": {
          "name": "flx_tablesCreated"
        },
        "position": {
          "basis": "200px",
          "grow": 1
        },
        "propConfig": {
          "position.display": {
            "binding": {
              "config": {
                "struct": {
                  "isCustomTablesCreated": "{parent.custom.customTablesCreated}"
                },
                "waitOnAll": true
              },
              "transforms": [
                {
                  "code": "\treturn value[\u0027isCustomTablesCreated\u0027]",
                  "type": "script"
                }
              ],
              "type": "expr-struct"
            }
          }
        },
        "props": {
          "direction": "column"
        },
        "type": "ia.container.flex"
      },
      {
        "children": [
          {
            "meta": {
              "name": "Label"
            },
            "position": {
              "basis": "114px"
            },
            "propConfig": {
              "props.text": {
                "binding": {
                  "config": {
                    "struct": {
                      "isCustomTablesCreated": "{/root.custom.customTablesCreated}",
                      "isProductionStarted": "{/root.custom.isProductionStarted}"
                    },
                    "waitOnAll": true
                  },
                  "transforms": [
                    {
                      "code": "\tif value[\u0027isProductionStarted\u0027] \u003d\u003d False:\n\t\treturn \u0027Production is not started.  Ensure install steps are complete.\u0027\n\tif value[\u0027isCustomTablesCreated\u0027] \u003d\u003d False:\n\t\treturn \u0027Custom tables are required to run this demo project.  Click the button below to create required tables.\u0027",
                      "type": "script"
                    }
                  ],
                  "type": "expr-struct"
                }
              }
            },
            "type": "ia.display.label"
          },
          {
            "events": {
              "component": {
                "onActionPerformed": {
                  "config": {
                    "script": "\tshared.onboarding.init.startup_script()\n\n\tpayload \u003d {\u0027update\u0027:\u0027update\u0027}\n\tsystem.util.sendMessage(\u0027MESGateway\u0027,\u0027updateMenu\u0027,scope\u003d\u0027S\u0027, payload\u003dpayload)\n\tsystem.perspective.navigate(\u0027/getting-started\u0027)"
                  },
                  "scope": "G",
                  "type": "script"
                }
              }
            },
            "meta": {
              "name": "bnt_createTables"
            },
            "position": {
              "basis": "35px"
            },
            "propConfig": {
              "props.enabled": {
                "binding": {
                  "config": {
                    "path": "/root.custom.isProductionStarted"
                  },
                  "type": "property"
                }
              }
            },
            "props": {
              "image": {
                "height": 30,
                "width": 30
              },
              "text": "Create"
            },
            "type": "ia.input.button"
          }
        ],
        "meta": {
          "name": "flx_tablesNotCreated"
        },
        "position": {
          "basis": "200px"
        },
        "propConfig": {
          "position.display": {
            "binding": {
              "config": {
                "struct": {
                  "isCustomTablesCreated": "{parent.custom.customTablesCreated}"
                },
                "waitOnAll": true
              },
              "transforms": [
                {
                  "code": "\treturn not(value[\u0027isCustomTablesCreated\u0027])",
                  "type": "script"
                }
              ],
              "type": "expr-struct"
            }
          }
        },
        "props": {
          "alignItems": "center",
          "direction": "column"
        },
        "type": "ia.container.flex"
      }
    ],
    "meta": {
      "name": "root"
    },
    "propConfig": {
      "custom.customTablesCreated": {
        "binding": {
          "config": {
            "path": "this.custom.now"
          },
          "transforms": [
            {
              "code": "\tfrom shared.mes.util import DB_TYPE\n\ttry:\n\t\tSCREEN_TABLE_CREATED \u003d system.db.runNamedQuery(DB_TYPE + \u0027/init/check\u0027).getRowCount() \u003e 0\n\t\treturn True\n\texcept:\n\t\treturn False",
              "type": "script"
            }
          ],
          "type": "property"
        }
      },
      "custom.isProductionStarted": {
        "binding": {
          "config": {
            "path": "this.custom.now"
          },
          "transforms": [
            {
              "code": "\treturn shared.mes.util.isProductionStarted()",
              "type": "script"
            }
          ],
          "type": "property"
        }
      },
      "custom.now": {
        "binding": {
          "config": {
            "expression": "now(1000)"
          },
          "type": "expr"
        }
      }
    },
    "props": {
      "direction": "column",
      "style": {
        "padding": "10px"
      }
    },
    "type": "ia.container.flex"
  }
}