mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Remove 2018-game-specific field/plc/led code.
This commit is contained in:
@@ -4,6 +4,26 @@ package plc
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[heartbeat-0]
|
||||
_ = x[matchReset-1]
|
||||
_ = x[stackLightGreen-2]
|
||||
_ = x[stackLightOrange-3]
|
||||
_ = x[stackLightRed-4]
|
||||
_ = x[stackLightBlue-5]
|
||||
_ = x[stackLightBuzzer-6]
|
||||
_ = x[red1EthernetDisable-7]
|
||||
_ = x[red2EthernetDisable-8]
|
||||
_ = x[red3EthernetDisable-9]
|
||||
_ = x[blue1EthernetDisable-10]
|
||||
_ = x[blue2EthernetDisable-11]
|
||||
_ = x[blue3EthernetDisable-12]
|
||||
_ = x[coilCount-13]
|
||||
}
|
||||
|
||||
const _coil_name = "heartbeatmatchResetstackLightGreenstackLightOrangestackLightRedstackLightBluestackLightBuzzerred1EthernetDisablered2EthernetDisablered3EthernetDisableblue1EthernetDisableblue2EthernetDisableblue3EthernetDisablecoilCount"
|
||||
|
||||
var _coil_index = [...]uint8{0, 9, 19, 34, 50, 63, 77, 93, 112, 131, 150, 170, 190, 210, 219}
|
||||
|
||||
@@ -4,9 +4,29 @@ package plc
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _input_name = "fieldEstopredEstop1redEstop2redEstop3blueEstop1blueEstop2blueEstop3redConnected1redConnected2redConnected3blueConnected1blueConnected2blueConnected3scaleNearscaleFarredSwitchNearredSwitchFarblueSwitchNearblueSwitchFarredForceActivateredLevitateActivateredBoostActivateblueForceActivateblueLevitateActivateblueBoostActivateinputCount"
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[fieldEstop-0]
|
||||
_ = x[redEstop1-1]
|
||||
_ = x[redEstop2-2]
|
||||
_ = x[redEstop3-3]
|
||||
_ = x[blueEstop1-4]
|
||||
_ = x[blueEstop2-5]
|
||||
_ = x[blueEstop3-6]
|
||||
_ = x[redConnected1-7]
|
||||
_ = x[redConnected2-8]
|
||||
_ = x[redConnected3-9]
|
||||
_ = x[blueConnected1-10]
|
||||
_ = x[blueConnected2-11]
|
||||
_ = x[blueConnected3-12]
|
||||
_ = x[inputCount-13]
|
||||
}
|
||||
|
||||
var _input_index = [...]uint16{0, 10, 19, 28, 37, 47, 57, 67, 80, 93, 106, 120, 134, 148, 157, 165, 178, 190, 204, 217, 233, 252, 268, 285, 305, 322, 332}
|
||||
const _input_name = "fieldEstopredEstop1redEstop2redEstop3blueEstop1blueEstop2blueEstop3redConnected1redConnected2redConnected3blueConnected1blueConnected2blueConnected3inputCount"
|
||||
|
||||
var _input_index = [...]uint8{0, 10, 19, 28, 37, 47, 57, 67, 80, 93, 106, 120, 134, 148, 158}
|
||||
|
||||
func (i input) String() string {
|
||||
if i < 0 || i >= input(len(_input_index)-1) {
|
||||
|
||||
44
plc/plc.go
44
plc/plc.go
@@ -52,18 +52,6 @@ const (
|
||||
blueConnected1
|
||||
blueConnected2
|
||||
blueConnected3
|
||||
scaleNear
|
||||
scaleFar
|
||||
redSwitchNear
|
||||
redSwitchFar
|
||||
blueSwitchNear
|
||||
blueSwitchFar
|
||||
redForceActivate
|
||||
redLevitateActivate
|
||||
redBoostActivate
|
||||
blueForceActivate
|
||||
blueLevitateActivate
|
||||
blueBoostActivate
|
||||
inputCount
|
||||
)
|
||||
|
||||
@@ -77,12 +65,6 @@ const (
|
||||
blue1Bandwidth
|
||||
blue2Bandwidth
|
||||
blue3Bandwidth
|
||||
redForceDistance
|
||||
redLevitateDistance
|
||||
redBoostDistance
|
||||
blueForceDistance
|
||||
blueLevitateDistance
|
||||
blueBoostDistance
|
||||
registerCount
|
||||
)
|
||||
|
||||
@@ -180,32 +162,6 @@ func (plc *Plc) GetTeamEstops() ([3]bool, [3]bool) {
|
||||
return redEstops, blueEstops
|
||||
}
|
||||
|
||||
// Returns the state of the scale and the red and blue switches.
|
||||
func (plc *Plc) GetScaleAndSwitches() ([2]bool, [2]bool, [2]bool) {
|
||||
var scale, redSwitch, blueSwitch [2]bool
|
||||
|
||||
scale[0] = plc.inputs[scaleNear]
|
||||
scale[1] = plc.inputs[scaleFar]
|
||||
redSwitch[0] = plc.inputs[redSwitchNear]
|
||||
redSwitch[1] = plc.inputs[redSwitchFar]
|
||||
blueSwitch[0] = plc.inputs[blueSwitchNear]
|
||||
blueSwitch[1] = plc.inputs[blueSwitchFar]
|
||||
|
||||
return scale, redSwitch, blueSwitch
|
||||
}
|
||||
|
||||
// Returns the state of the red and blue vault power cube sensors.
|
||||
func (plc *Plc) GetVaults() (uint16, uint16, uint16, uint16, uint16, uint16) {
|
||||
return plc.registers[redForceDistance], plc.registers[redLevitateDistance], plc.registers[redBoostDistance],
|
||||
plc.registers[blueForceDistance], plc.registers[blueLevitateDistance], plc.registers[blueBoostDistance]
|
||||
}
|
||||
|
||||
// Returns the state of the red and blue power up buttons on the vaults.
|
||||
func (plc *Plc) GetPowerUpButtons() (bool, bool, bool, bool, bool, bool) {
|
||||
return plc.inputs[redForceActivate], plc.inputs[redLevitateActivate], plc.inputs[redBoostActivate],
|
||||
plc.inputs[blueForceActivate], plc.inputs[blueLevitateActivate], plc.inputs[blueBoostActivate]
|
||||
}
|
||||
|
||||
// Set the on/off state of the stack lights on the scoring table.
|
||||
func (plc *Plc) SetStackLights(red, blue, green bool) {
|
||||
plc.coils[stackLightRed] = red
|
||||
|
||||
@@ -4,9 +4,22 @@ package plc
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _register_name = "red1Bandwidthred2Bandwidthred3Bandwidthblue1Bandwidthblue2Bandwidthblue3BandwidthredForceDistanceredLevitateDistanceredBoostDistanceblueForceDistanceblueLevitateDistanceblueBoostDistanceregisterCount"
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[red1Bandwidth-0]
|
||||
_ = x[red2Bandwidth-1]
|
||||
_ = x[red3Bandwidth-2]
|
||||
_ = x[blue1Bandwidth-3]
|
||||
_ = x[blue2Bandwidth-4]
|
||||
_ = x[blue3Bandwidth-5]
|
||||
_ = x[registerCount-6]
|
||||
}
|
||||
|
||||
var _register_index = [...]uint8{0, 13, 26, 39, 53, 67, 81, 97, 116, 132, 149, 169, 186, 199}
|
||||
const _register_name = "red1Bandwidthred2Bandwidthred3Bandwidthblue1Bandwidthblue2Bandwidthblue3BandwidthregisterCount"
|
||||
|
||||
var _register_index = [...]uint8{0, 13, 26, 39, 53, 67, 81, 94}
|
||||
|
||||
func (i register) String() string {
|
||||
if i < 0 || i >= register(len(_register_index)-1) {
|
||||
|
||||
Reference in New Issue
Block a user