SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI "MonAPI" | |
| 2 | local turbine1 | |
| 3 | local reactor1 | |
| 4 | local mon = monAPI.wrapMonitor("right")
| |
| 5 | ||
| 6 | mon.setTextColor(colors.white) | |
| 7 | mon.setBackgroundColor(color.black) | |
| 8 | mon.clear() | |
| 9 | mon.setCursorPos(1,1) | |
| 10 | ||
| 11 | local section1 = mon.createSection(1,1,20,19) | |
| 12 | section1.clear() | |
| 13 | local section2 = mon.createSection(21,1,51,19) | |
| 14 | section2.clear() | |
| 15 | local section3 = mon.createSection(52,1,82,19) | |
| 16 | section3.clear() | |
| 17 | ||
| 18 | ||
| 19 | while true do | |
| 20 | rednet.open("back")
| |
| 21 | id,message = rednet.receive() | |
| 22 | ||
| 23 | if id == 158 then | |
| 24 | section2.clear() | |
| 25 | section2.setCursorPos(1,1) | |
| 26 | section2.write('Reactor - Turbine Monitoring')
| |
| 27 | section2.setCursorPos(1,2) | |
| 28 | section2.write('Data Broadcast Received')
| |
| 29 | section2.setCursorPos(1,3) | |
| 30 | section2.write('System Status')
| |
| 31 | section2.setCursorPos(1,4) | |
| 32 | section2.write('Turbine:')
| |
| 33 | section2.setCursorPos(1,5) | |
| 34 | section2.write('RPM: '..message["turbine1rpm"]..'')
| |
| 35 | section2.setCursorPos(1,6) | |
| 36 | section2.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
| |
| 37 | section2.setCursorPos(1,7) | |
| 38 | section2.write('Generation: '..message["turbine1RFT"]..' rf/t')
| |
| 39 | section2.setCursorPos(1,8) | |
| 40 | section2.write('Capacitor: '..message["turbine1capacitor"]..'')
| |
| 41 | section2.setCursorPos(1,10) | |
| 42 | section2.write('Reactor:')
| |
| 43 | section2.setCursorPos(1,11) | |
| 44 | section2.write('Temp: '..message["reactor1Temp"]..'')
| |
| 45 | section2.setCursorPos(1,12) | |
| 46 | section2.write('Steam Pressure: '..message["reactor1Steam"]..'')
| |
| 47 | section2.setCursorPos(1,13) | |
| 48 | section2.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
| |
| 49 | ||
| 50 | - | end |
| 50 | + | elseif id == 159 then |
| 51 | section3.clear() | |
| 52 | section3.setCursorPos(1,1) | |
| 53 | section3.write('Reactor - Turbine Monitoring')
| |
| 54 | section3.setCursorPos(1,2) | |
| 55 | section3.write('Data Broadcast Received')
| |
| 56 | section3.setCursorPos(1,3) | |
| 57 | section3.write('System Status')
| |
| 58 | section3.setCursorPos(1,4) | |
| 59 | section3.write('Turbine:')
| |
| 60 | section3.setCursorPos(1,5) | |
| 61 | section3.write('RPM: '..message["turbine1rpm"]..'')
| |
| 62 | section3.setCursorPos(1,6) | |
| 63 | section3.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
| |
| 64 | section3.setCursorPos(1,7) | |
| 65 | section3.write('Generation: '..message["turbine1RFT"]..' rf/t')
| |
| 66 | section3.setCursorPos(1,8) | |
| 67 | section3.write('Capacitor: '..message["turbine1capacitor"]..'')
| |
| 68 | section3.setCursorPos(1,10) | |
| 69 | section3.write('Reactor:')
| |
| 70 | section3.setCursorPos(1,11) | |
| 71 | section3.write('Temp: '..message["reactor1Temp"]..'')
| |
| 72 | section3.setCursorPos(1,12) | |
| 73 | section3.write('Steam Pressure: '..message["reactor1Steam"]..'')
| |
| 74 | section3.setCursorPos(1,13) | |
| 75 | section3.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
| |
| 76 | end | |
| 77 | ||
| 78 | ||
| 79 | end |