Add Plc.IsEnabled() method and refactor places that were checking settings directly to use it instead.

This commit is contained in:
Patrick Fairbank
2020-03-22 17:42:37 -07:00
parent 27dc4a8773
commit 31505b265f
7 changed files with 18 additions and 11 deletions

View File

@@ -647,7 +647,7 @@ func (arena *Arena) checkCanStartMatch() error {
return err
}
if arena.EventSettings.PlcAddress != "" {
if arena.Plc.IsEnabled() {
if !arena.Plc.IsHealthy {
return fmt.Errorf("Cannot start match while PLC is not healthy.")
}