Implement PLC integration for all outputs.

This commit is contained in:
Patrick Fairbank
2020-04-04 22:48:20 -07:00
parent ae4b03dfbc
commit 3739cd8690
4 changed files with 84 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ import "time"
const (
powerPortAutoGracePeriodSec = 5
powerPortTeleopGracePeriodSec = 5
PowerPortTeleopGracePeriodSec = 5
rungAssessmentDelaySec = 5
)

View File

@@ -23,7 +23,7 @@ type PowerPort struct {
func (powerPort *PowerPort) UpdateState(portCells [3]int, stage Stage, matchStartTime, currentTime time.Time) {
autoValidityDuration := GetDurationToAutoEnd() + powerPortAutoGracePeriodSec*time.Second
autoValidityCutoff := matchStartTime.Add(autoValidityDuration)
teleopValidityDuration := GetDurationToTeleopEnd() + powerPortTeleopGracePeriodSec*time.Second
teleopValidityDuration := GetDurationToTeleopEnd() + PowerPortTeleopGracePeriodSec*time.Second
teleopValidityCutoff := matchStartTime.Add(teleopValidityDuration)
newBottomCells := portCells[0] - totalPortCells(powerPort.AutoCellsBottom, powerPort.TeleopCellsBottom)