SMESes now connect when built, and report if they're connected. (#24354)

This commit is contained in:
Charlie Nolan
2024-03-10 20:15:03 +00:00
committed by GitHub
parent 504f5e0363
commit 80a1fe9101
3 changed files with 51 additions and 44 deletions
+5 -1
View File
@@ -44,6 +44,9 @@
component_parts += new /obj/item/stack/cable_coil(null, 5)
RefreshParts()
// When (re)built, try to connect to the powernet under us.
connect_to_network()
dir_loop:
for(var/d in GLOB.cardinal)
var/turf/T = get_step(src, d)
@@ -275,7 +278,7 @@
inputting = FALSE
//outputting
if(output_attempt)
if(output_attempt && powernet)
if(outputting)
output_used = min( charge/SMESRATE, output_level) //limit output to that stored
if(produce_direct_power(output_used)) // add output to powernet if it exists (smes side)
@@ -361,6 +364,7 @@
"inputLevel_text" = DisplayPower(input_level),
"inputLevelMax" = input_level_max,
"inputAvailable" = input_available,
"outputPowernet" = !isnull(powernet),
"outputAttempt" = output_attempt,
"outputting" = outputting,
"outputLevel" = output_level,
+8 -5
View File
@@ -25,6 +25,7 @@ export const Smes = (props, context) => {
inputLevel,
inputLevelMax,
inputAvailable,
outputPowernet,
outputAttempt,
outputting,
outputLevel,
@@ -149,11 +150,13 @@ export const Smes = (props, context) => {
}
>
<Box color={outputState}>
{outputting
? 'Sending'
: charge > 0
? 'Not Sending'
: 'No Charge'}
{outputPowernet
? outputting
? 'Sending'
: charge > 0
? 'Not Sending'
: 'No Charge'
: 'Not Connected'}
</Box>
</LabeledList.Item>
<LabeledList.Item label="Target Output">
File diff suppressed because one or more lines are too long