SMES UI fixes

- SMES now shows "Partially Charging" in UI when it has at least some input, but not enough to charge at set rate.
- Added yellowish-orange overlay which is used instead of the normal one if the SMES is partially charging, so you can visually see it without having to open the UI.
- UI input/output rate fields are now 20px wider. This fixes issues with values that exceed 1 000 000 W. Such values are possible with multi-coiled SMESs.
This commit is contained in:
Atlantiscze
2014-11-05 12:55:58 +01:00
parent 8165c5db7e
commit e0dd1fbfcf
3 changed files with 13 additions and 7 deletions

View File

@@ -61,7 +61,9 @@
overlays += image('icons/obj/power.dmi', "smes-op[online]") overlays += image('icons/obj/power.dmi', "smes-op[online]")
if(charging) if(charging == 2)
overlays += image('icons/obj/power.dmi', "smes-oc2")
else if (charging == 1)
overlays += image('icons/obj/power.dmi', "smes-oc1") overlays += image('icons/obj/power.dmi', "smes-oc1")
else else
if(chargemode) if(chargemode)
@@ -96,9 +98,11 @@
var/actual_load = add_load(target_load) // add the load to the terminal side network var/actual_load = add_load(target_load) // add the load to the terminal side network
charge += actual_load * SMESRATE // increase the charge charge += actual_load * SMESRATE // increase the charge
if (actual_load >= target_load) // did the powernet have enough power available for us? if (actual_load >= target_load) // Did we charge at full rate?
charging = 2
else if (actual_load) // If not, did we charge at least partially?
charging = 1 charging = 1
else else // Or not at all?
charging = 0 charging = 0
if(online) // if outputting if(online) // if outputting

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -18,10 +18,12 @@
<div class="itemContent"> <div class="itemContent">
{{:helper.link('Auto', 'refresh', {'cmode' : 1}, data.chargeMode ? 'selected' : null)}}{{:helper.link('Off', 'close', {'cmode' : 1}, data.chargeMode ? null : 'selected')}} {{:helper.link('Auto', 'refresh', {'cmode' : 1}, data.chargeMode ? 'selected' : null)}}{{:helper.link('Off', 'close', {'cmode' : 1}, data.chargeMode ? null : 'selected')}}
&nbsp; &nbsp;
{{if data.charging}} {{if data.charging == 2}}
[<span class='good'>Charging</span>] [<span class='good'>Charging</span>]
{{else data.charging == 1}}
[<span class='average'>Partially Charging</span>]
{{else}} {{else}}
[<span class='average'>Not Charging</span>] [<span class='bad'>Not Charging</span>]
{{/if}} {{/if}}
</div> </div>
</div> </div>
@@ -36,7 +38,7 @@
{{:helper.link('MIN', null, {'input' : 'min'}, (data.chargeLevel > 0) ? null : 'disabled')}} {{:helper.link('MIN', null, {'input' : 'min'}, (data.chargeLevel > 0) ? null : 'disabled')}}
{{:helper.link('SET', null, {'input' : 'set'}, null)}} {{:helper.link('SET', null, {'input' : 'set'}, null)}}
{{:helper.link('MAX', null, {'input' : 'max'}, (data.chargeLevel < data.chargeMax) ? null : 'disabled')}} {{:helper.link('MAX', null, {'input' : 'max'}, (data.chargeLevel < data.chargeMax) ? null : 'disabled')}}
<div style="float: left; width: 80px; text-align: center;">&nbsp;{{:data.chargeLevel}} W&nbsp;</div> <div style="float: left; width: 100px; text-align: center;">&nbsp;{{:data.chargeLevel}} W&nbsp;</div>
</div> </div>
</div> </div>
</div> </div>
@@ -61,7 +63,7 @@
{{:helper.link('MIN', null, {'output' : 'min'}, (data.outputLevel > 0) ? null : 'disabled')}} {{:helper.link('MIN', null, {'output' : 'min'}, (data.outputLevel > 0) ? null : 'disabled')}}
{{:helper.link('SET', null, {'output' : 'set'}, null)}} {{:helper.link('SET', null, {'output' : 'set'}, null)}}
{{:helper.link('MAX', null, {'output' : 'max'}, (data.outputLevel < data.outputMax) ? null : 'disabled')}} {{:helper.link('MAX', null, {'output' : 'max'}, (data.outputLevel < data.outputMax) ? null : 'disabled')}}
<div style="float: left; width: 80px; text-align: center;">&nbsp;{{:data.outputLevel}} W&nbsp;</div> <div style="float: left; width: 100px; text-align: center;">&nbsp;{{:data.outputLevel}} W&nbsp;</div>
</div> </div>
</div> </div>
</div> </div>