From 204be5aedd37f7d7daa02967482bd5fb467f0726 Mon Sep 17 00:00:00 2001 From: Jeff Hutchison Date: Wed, 4 Dec 2019 11:15:36 -0500 Subject: [PATCH] Add temperature to Talon item --- build.gradle | 2 +- .../org/strykeforce/thirdcoast/telemetry/item/TalonItem.kt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index c4166e5e..345c00f4 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/item/TalonItem.kt b/telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/item/TalonItem.kt index e09d90ab..474c657f 100644 --- a/telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/item/TalonItem.kt +++ b/telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/item/TalonItem.kt @@ -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( @@ -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) @@ -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 } } }