Update Turbine computer to use TGUI

This commit is contained in:
Matt Smith
2017-11-21 22:28:14 -06:00
committed by CitadelStationBot
parent dbf2467f5e
commit 694958f587
2 changed files with 80 additions and 42 deletions
+51
View File
@@ -0,0 +1,51 @@
<script>
component.exports = {
data: {
powerState (status) {
switch (status) {
case 1: return 'good'
default: return 'bad'
}
}
}
}
</script>
<ui-notice>
<ui-section label='Reconnect'>
<div style='float:right'>
<ui-button icon='refresh' action='reconnect' state='{{data.connected}}'>Reconnect</ui-button>
</div>
</ui-section>
</ui-notice>
<ui-display title='Turbine Controller'>
<ui-section label='Status'>
{{#if data.working}}
<span class='{{powerState(data.online)}}'>{{data.online && !(data.compressor_broke || data.turbine_broke) ? "Online" : "Offline"}}</span>
{{else}}
<span class='bad'>Broken</span>
{{/if}}
<div style='float:right'>
<ui-button icon='power-off' action='power' state='{{data.working}}' style='{{data.online ? "selected" : ""}}'>On</ui-button>
<ui-button icon='close' action='power' state='{{data.working}}' style='{{data.online ? "" : "selected"}}'>Off</ui-button>
</div>
{{#if data.compressor_broke}}
<br>
[ <span class='bad'>Compressor is inoperable</span> ]
{{/if}}
{{#if data.turbine_broke}}
<br>
[ <span class='bad'>Turbine is inoperable</span> ]
{{/if}}
</ui-section>
</ui-display>
<ui-display title='Status'>
<ui-section label='Turbine Speed'>
<span>{{data.working ? data.rpm : "--"}} RPM</span>
</ui-section>
<ui-section label='Internal Temp'>
<span>{{data.working ? data.temp : "--"}} K</span>
</ui-section>
<ui-section label='Generated Power'>
<span>{{data.working ? data.power : "--"}}</span>
</ui-section>
</ui-display>