public class

VehicleButtonEvent

extends EventedMeasurement<TheUnit extends Unit>
java.lang.Object
   ↳ com.openxc.measurements.BaseMeasurement<TheUnit extends com.openxc.units.Unit>
     ↳ com.openxc.measurements.EventedMeasurement<TheUnit extends com.openxc.units.Unit>
       ↳ com.openxc.measurements.VehicleButtonEvent

Class Overview

A ButtonEvent represents a button press, release or hold on the vehicle HMI. This measurement is only valid when used asynchronously, much like any other key or button event in Java. An application registers to receive button events, and decides what to do based on the returned ButtonId and ButtonAction. If this measurement is retrieved synchronously, it will return the last button event received - this is probably not what you want. TODO This is by far the ugliest measurement because it has to incorporate two different values instead of the usual one. Is this implementation saying something about the architecture in general, or is it just an edge case we need to ignore and let live?

Summary

Nested Classes
enum VehicleButtonEvent.ButtonAction The ButtonAction is the specific event that ocurred. 
enum VehicleButtonEvent.ButtonId The ButtonId is the direction of a button within a single control cluster. 
Constants
String ID
[Expand]
Inherited Fields
From class com.openxc.measurements.BaseMeasurement
Public Constructors
VehicleButtonEvent(State<VehicleButtonEvent.ButtonId> value, State<VehicleButtonEvent.ButtonAction> event)
VehicleButtonEvent(VehicleButtonEvent.ButtonId value, VehicleButtonEvent.ButtonAction event)
VehicleButtonEvent(String value, String event)
Public Methods
State<VehicleButtonEvent.ButtonAction> getEvent()
String getGenericName()
String getSerializedEvent()
String getSerializedValue()
Return the value of this measurement as a type good for serialization.
[Expand]
Inherited Methods
From class com.openxc.measurements.EventedMeasurement
From class com.openxc.measurements.BaseMeasurement
From class java.lang.Object
From interface com.openxc.measurements.Measurement

Constants

public static final String ID

Constant Value: "button_event"

Public Constructors

public VehicleButtonEvent (State<VehicleButtonEvent.ButtonId> value, State<VehicleButtonEvent.ButtonAction> event)

public VehicleButtonEvent (VehicleButtonEvent.ButtonId value, VehicleButtonEvent.ButtonAction event)

public VehicleButtonEvent (String value, String event)

Public Methods

public String getGenericName ()

public String getSerializedEvent ()

public String getSerializedValue ()

Return the value of this measurement as a type good for serialization.

Returns
  • something easily serializable - e.g. String, Double, Boolean.