Skip to content

Commit

Permalink
Merge branch 'temp'
Browse files Browse the repository at this point in the history
  • Loading branch information
jhh committed Dec 4, 2019
2 parents 6ef7b2d + 204be5a commit aa7ad25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ buildscript {
// applies to all sub-projects
configure(subprojects) {
group = 'org.strykeforce.thirdcoast'
version = '19.5.0'
version = '19.5.1'

apply plugin: 'java-library'
apply plugin: 'idea'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal const val PULSE_WIDTH_RISE_TO_FALL = "PULSE_WIDTH_RISE_TO_FALL"
internal const val PULSE_WIDTH_RISE_TO_RISE = "PULSE_WIDTH_RISE_TO_RISE"
internal const val FORWARD_LIMIT_SWITCH_CLOSED = "FORWARD_LIMIT_SWITCH_CLOSED"
internal const val REVERSE_LIMIT_SWITCH_CLOSED = "REVERSE_LIMIT_SWITCH_CLOSED"
internal const val TEMPERATURE = "TEMPERATURE"

/** Represents a [TalonSRX] telemetry-enable `Measurable` item. */
class TalonItem @JvmOverloads constructor(
Expand Down Expand Up @@ -62,7 +63,8 @@ class TalonItem @JvmOverloads constructor(
Measure(PULSE_WIDTH_RISE_TO_FALL, "PWM Pulse Width"),
Measure(PULSE_WIDTH_RISE_TO_RISE, "PWM Period"),
Measure(FORWARD_LIMIT_SWITCH_CLOSED, "Forward Limit Switch Closed"),
Measure(REVERSE_LIMIT_SWITCH_CLOSED, "Reverse Limit Switch Closed")
Measure(REVERSE_LIMIT_SWITCH_CLOSED, "Reverse Limit Switch Closed"),
Measure(TEMPERATURE, "Controller Temperature")
)

private val sensorCollection = requireNotNull(talon.sensorCollection)
Expand Down Expand Up @@ -95,6 +97,7 @@ class TalonItem @JvmOverloads constructor(
PULSE_WIDTH_RISE_TO_RISE -> DoubleSupplier { sensorCollection.pulseWidthRiseToRiseUs.toDouble() }
FORWARD_LIMIT_SWITCH_CLOSED -> DoubleSupplier { sensorCollection.isFwdLimitSwitchClosed.toDouble() }
REVERSE_LIMIT_SWITCH_CLOSED -> DoubleSupplier { sensorCollection.isRevLimitSwitchClosed.toDouble() }
TEMPERATURE -> DoubleSupplier { talon.temperature }
else -> DoubleSupplier { 2767.0 }
}
}
Expand Down

0 comments on commit aa7ad25

Please sign in to comment.