mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
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:
@@ -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 |
@@ -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')}}
|
||||||
|
|
||||||
{{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;"> {{:data.chargeLevel}} W </div>
|
<div style="float: left; width: 100px; text-align: center;"> {{:data.chargeLevel}} W </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;"> {{:data.outputLevel}} W </div>
|
<div style="float: left; width: 100px; text-align: center;"> {{:data.outputLevel}} W </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user