-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndustryMonitor_QuickSetup
More file actions
1 lines (1 loc) · 3.38 KB
/
Copy pathIndustryMonitor_QuickSetup
File metadata and controls
1 lines (1 loc) · 3.38 KB
1
{"slots":{"0":{"name":"screen","type":{"events":[],"methods":[]}},"1":{"name":"Electronics_Industry","type":{"events":[],"methods":[]}},"2":{"name":"Chemical_Industry","type":{"events":[],"methods":[]}},"3":{"name":"Smelter","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"-- Turn Off Screen\n\nscreen.deactivate()","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"0"},{"code":"function startTimer(name,seconds) \n unit.setTimer(name,seconds) \nend\n\nfunction stopTimer(name)\n unit.stopTimer(name)\nend\n\n-- Start Timer\n\nstartTimer(\"screen\", 1)\n\n-- Turn On Screen\n\nscreen.activate()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"1"},{"code":"--[[ FUNCTIONS ]]--\n\nfunction round(number,decimals)\n local power = 100^decimals\n return math.floor((number/10000) * power)\nend\n\n--[[ EXPORTED VARIABLES ]]--\n\nlocal tableName = \"Machine Status\" --export:\nlocal tableNameFontsize = \"15em\" --export:\nlocal tableFontSize = \"20px\" --export:\nlocal tableWidth = \"100%\" --export:\nlocal tableHeight = \"100%\" --export:\nlocal BGColor = \"#252525\" --export: This sets the screen background color\n\n--[[ Electronics Industry ]]--\n\nlocal EI_Status = Electronics_Industry.getStatus()\nlocal EI_Efficiency = round(math.ceil(Electronics_Industry.getEfficiency()),3)\n\n--[[ Chemical Industry ]]--\n\nlocal CI_Status = Chemical_Industry.getStatus()\nlocal CI_Efficiency = round(math.ceil(Chemical_Industry.getEfficiency()),3)\n\n--[[ Smelter ]]--\n\nlocal Smelter_Status = Smelter.getStatus()\nlocal Smelter_Efficiency = round(math.ceil(Smelter.getEfficiency()),3)\n\n--[[ HTML CODE STARTS HERE ]]--\n\nhtml = [[\n<body>\n\n<div class=\"bootstrap\">\n<table\n\t<tr style=\"\n\t\twidth: 100%;\n\t\tcolor: white;\n\t\">\n\t<th>]]..tableName..[[</th>\n\n\t<tr style=\"\n\t\twidth: 100%;\n\t\tmargin-bottom: 25px;\n\t\tbackground-color: white;\n\t\tcolor: black;\n\t\">\n\t\t<th>Machine</th>\n\t\t<th>Efficiency</th>\n\t\t<th>Status</th>\n\t<tr>\n\t\t<th>Electronics Industry</th>\n\t\t<th>]]..EI_Efficiency..[[%</th>\n\t\t<th>]]..EI_Status..[[</th>\n\t</tr>\n\t<tr>\n\t\t<th>Chemical Industry</th>\n\t\t<th>]]..CI_Efficiency..[[%</th>\n\t\t<th>]]..CI_Status..[[</th>\n\t</tr>\n\t<tr>\n\t\t<th>Smelter</th>\n\t\t<th>]]..Smelter_Efficiency..[[%</th>\n\t\t<th>]]..Smelter_Status..[[</th>\n\t</tr>\n\n</table>\n\n<style>\nbody {\n\tbackground-color: ]]..BGColor..[[;\n}\nh1 {\n \tfont-size: ]]..tableNameFontsize..[[;\n}\ntable {\n \twidth: ]]..tableWidth..[[;\n\theight: ]]..tableHeight..[[;\n}\ntable, th, td {\n \tborder: 0.5px solid white;\n \tborder-collapse: collapse;\n}\nth, td {\n \tpadding: 10px;\n \ttext-align: center;\n\tfont-size: ]]..tableFontSize..[[;\n}\n\n</style>\n\n</div>\n\n</body>\n\n]]\n\n--[[ HTML CODE ENDS HERE ]]--\n\nscreen.setHTML(html)","filter":{"args":[{"value":"screen"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"2"}],"methods":[],"events":[]}