mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Turn off cargo ship lights during sandstorm period as well.
This commit is contained in:
@@ -739,6 +739,7 @@ func (arena *Arena) handlePlcOutput() {
|
||||
arena.Plc.SetFieldResetLight(false)
|
||||
}
|
||||
|
||||
arena.Plc.SetCargoShipLights(true)
|
||||
arena.Plc.SetCargoShipMagnets(true)
|
||||
arena.Plc.SetRocketLights(false, false)
|
||||
case PostMatch:
|
||||
@@ -748,8 +749,13 @@ func (arena *Arena) handlePlcOutput() {
|
||||
scoreReady := arena.RedRealtimeScore.FoulsCommitted && arena.BlueRealtimeScore.FoulsCommitted &&
|
||||
arena.alliancePostMatchScoreReady("red") && arena.alliancePostMatchScoreReady("blue")
|
||||
arena.Plc.SetStackLights(false, false, !scoreReady, false)
|
||||
arena.Plc.SetCargoShipLights(true)
|
||||
arena.Plc.SetCargoShipMagnets(true)
|
||||
arena.Plc.SetRocketLights(false, false)
|
||||
case AutoPeriod:
|
||||
fallthrough
|
||||
case PausePeriod:
|
||||
arena.Plc.SetCargoShipLights(false)
|
||||
case TeleopPeriod:
|
||||
if arena.lastMatchState != TeleopPeriod {
|
||||
arena.Plc.SetSandstormUp(true)
|
||||
@@ -758,6 +764,7 @@ func (arena *Arena) handlePlcOutput() {
|
||||
arena.Plc.SetSandstormUp(false)
|
||||
}()
|
||||
}
|
||||
arena.Plc.SetCargoShipLights(false)
|
||||
arena.Plc.SetCargoShipMagnets(false)
|
||||
arena.Plc.SetRocketLights(arena.RedScoreSummary().CompleteRocket, arena.BlueScoreSummary().CompleteRocket)
|
||||
}
|
||||
|
||||
@@ -186,11 +186,14 @@ func (plc *Plc) SetSandstormUp(state bool) {
|
||||
plc.coils[sandstormUpBlue] = state
|
||||
}
|
||||
|
||||
func (plc *Plc) SetCargoShipLights(state bool) {
|
||||
plc.coils[cargoShipLightRed] = state
|
||||
plc.coils[cargoShipLightBlue] = state
|
||||
}
|
||||
|
||||
func (plc *Plc) SetCargoShipMagnets(state bool) {
|
||||
plc.coils[cargoShipMagnetRed] = state
|
||||
plc.coils[cargoShipMagnetBlue] = state
|
||||
plc.coils[cargoShipLightRed] = state
|
||||
plc.coils[cargoShipLightBlue] = state
|
||||
}
|
||||
|
||||
func (plc *Plc) SetRocketLights(red, blue bool) {
|
||||
|
||||
Reference in New Issue
Block a user