HtmlItem

class HtmlItem(value: String, retained: Boolean, val isOverflow: Boolean, dashboardRef: Reference<String>, opMode: OpMode) : Telemetry.Item

Wraps a telemetry item displayed on the DS/FtcDashboard. Uses HTML to alter the way text is displayed based on wrapper utilities.

Author

Lachlan Paul, 2024

Constructors

Link copied to clipboard
constructor(value: String, retained: Boolean, isOverflow: Boolean, dashboardRef: Reference<String>, opMode: OpMode)

Properties

Link copied to clipboard

Whether this item failed to send to the DS because of telemetry queue overload.

Link copied to clipboard
var item: Telemetry.Item?

The underlying telemetry item added to the DS that this HTML item is wrapping.

Functions

Link copied to clipboard
open override fun addData(caption: String, value: Any): Telemetry.Item?
open override fun <T : Any> addData(caption: String, valueProducer: Func<T>): Telemetry.Item?
open override fun addData(caption: String, format: String, vararg args: Any): Telemetry.Item?
open override fun <T : Any> addData(caption: String, format: String, valueProducer: Func<T>): Telemetry.Item?

Adds a new data item in the associated Telemetry immediately following the receiver.

Link copied to clipboard

Apply the HTML formatting to the string only if if this condition is true.

Link copied to clipboard

Wrap the string in a background color on the DS.

Link copied to clipboard

Wrap the string in <big> tags, making the string large on the DS.

Link copied to clipboard

Wrap the string in <b> tags, making the string bold on the DS.

Link copied to clipboard

Wrap the string in a foreground color on the DS.

Link copied to clipboard
open override fun getCaption(): String?

Returns the caption associated with this item.

Link copied to clipboard

Wrap the string in <h1> tags, making the string a header 1 with a margin on the DS.

Link copied to clipboard

Wrap the string in <h2> tags, making the string a header 2 with a margin on the DS.

Link copied to clipboard

Wrap the string in <h3> tags, making the string a header 3 with a margin on the DS.

Link copied to clipboard

Wrap the string in <h4> tags, making the string a header 4 with a margin on the DS.

Link copied to clipboard

Wrap the string in <h5> tags, making the string a header 5 with a margin on the DS.

Link copied to clipboard

Wrap the string in <h6> tags, making the string a header 6 with a margin on the DS.

Link copied to clipboard
open override fun isRetained(): Boolean

Returns whether the item is to be retained in a clear() operation.

Link copied to clipboard

Wrap the string in <i> tags, making the string italic on the DS.

Link copied to clipboard
open override fun setCaption(caption: String): Telemetry.Item?

Sets the caption associated with this item.

Link copied to clipboard
open override fun setRetained(retained: Boolean?): Telemetry.Item?

Sets whether the item is to be retained in clear() operation or not. This is initially true for items that whose value is computed with a value producer; otherwise, it is initially false.

Link copied to clipboard
open override fun setValue(value: Any?): Telemetry.Item?

Updates the value of this item to be the result of applying Object.toString to the indicated object.

open override fun <T : Any> setValue(valueProducer: Func<T>): Telemetry.Item?
open override fun <T : Any> setValue(format: String, valueProducer: Func<T>): Telemetry.Item?

Updates the value of this item to be the indicated value producer. This will override any HTML formatting applied to the item as it is also a value producer.

open override fun setValue(format: String, vararg args: Any): Telemetry.Item?

Updates the value of this item to be the result of the indicated string formatting operation.

Link copied to clipboard

Wrap the string in <small> tags, making the string small on the DS.

Link copied to clipboard

Wrap the string in <s> tags, making the string strikethrough on the DS.

Link copied to clipboard

Wrap the string in <sub> tags, making the string subscript (bottom right align) on the DS.

Link copied to clipboard

Wrap the string in <sup> tags, making the string superscript (top right align) on the DS.

Link copied to clipboard

Wrap the string in <u> tags, making the string underlined on the DS.

Link copied to clipboard

Wrap the string in a tag supplied by the user on the DS. Note that these tags are limited to the HTML tags that are available as part of Html.fromHtml().