public class


extends EventedMeasurement<TheUnit extends Unit>
   ↳ 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?


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. 
String ID
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.
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


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.

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