Interface Device
- All Superinterfaces:
AutoCloseable, Commented, ComprehensiveIdentification, Identified<Identification>, Named, Serializable
- All Known Subinterfaces:
Actuator<C>, BallotCaster, Centrifuge, ComplexInstrument, HumidityProbe, Microscope, Multimeter, Oscilloscope, PHMeter, PressureGauge, Seismograph, Sensor<Q>, Spectrometer, Telescope, TemperatureProbe, VitalSignsMonitor, VoterScanner, VotingMachine, WeatherStation
- All Known Implementing Classes:
AbstractActuator, AbstractDevice, AbstractSensor, AbstractSimulatedActuator, AbstractSimulatedDevice, AbstractSimulatedSensor, GPIBDevice, MassSpectra, SimulatedBallotCaster, SimulatedCentrifuge, SimulatedGPIBDevice, SimulatedHumidityProbe, SimulatedMicroscope, SimulatedMultimeter, SimulatedOscilloscope, SimulatedPHMeter, SimulatedPressureGauge, SimulatedSeismograph, SimulatedSpectrometer, SimulatedTelescope, SimulatedTemperatureProbe, SimulatedUSBDevice, SimulatedVitalSignsMonitor, SimulatedVoterScanner, SimulatedVotingMachine, SimulatedWeatherStation, USBDevice
Primary interface for all hardware and software devices in the Episteme ecosystem.
A Device represents any physical or virtual component that can be identified, monitored, and controlled. This includes sensors, actuators, and complex scientific instruments.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a single record in the device history.static enumDevice connection and operational status. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalibrates the device.default voidCalibrates the device using a reference value.voidconnect()Connects to the device.voidDisconnects from the device.Returns the accuracy of the device.default List<?> Returns the calibration history.Returns a map of capabilities and their status (active/inactive).default Device.StatusReturns the actual status enum if available.Returns the preferred unit for display.default StringReturns the firmware version of this device.List<? extends Device.Record> Returns the history of values for this device.getId()Returns the unique identifier for this device.default InstantReturns the timestamp of the last calibration.default StringReturns the location description of the device.default StringReturns the manufacturer name.Returns the maximum measurement range.Returns the types of quantities this instrument can measure.Returns the minimum measurement range.default StringgetModel()Returns the model name.default StringReturns the precision description of the device.Returns the current status readings (Power, Uptime, etc.).Returns the resolution of the device.Returns the sensitivity of the device.default StringReturns the current status of the device as a string.getValue()Returns the current primary value of the device (e.g. sensor reading).booleanChecks if the device is currently connected.default booleanChecks if the device is enabled.measure()Takes a measurement.default booleanneedsCalibration(int maxAgeHours) Checks if the device needs calibration based on its maximum age.default voidsetDisplayUnit(Unit<?> unit) Sets the preferred unit for display.default voidsetEnabled(boolean enabled) Sets whether the device is enabled.Methods inherited from interface AutoCloseable
closeMethods inherited from interface Commented
getComments, getTrait, setComments
-
Method Details
-
connect
Connects to the device.- Throws:
IOException- if the connection fails
-
disconnect
Disconnects from the device.- Throws:
IOException- if the disconnection fails
-
isConnected
boolean isConnected()Checks if the device is currently connected.- Returns:
- true if connected, false otherwise
-
getId
Identification getId()Returns the unique identifier for this device.- Specified by:
getIdin interfaceIdentified<Identification>- Returns:
- the device ID
-
getManufacturer
-
getModel
-
getFirmware
Returns the firmware version of this device.- Returns:
- the firmware version, or "N/A" if not applicable
-
getPrecisionDescription
Returns the precision description of the device.- Returns:
- the precision description
-
getSensitivity
-
getAccuracy
-
getResolution
-
getMinRange
-
getMaxRange
-
getMeasurableQuantities
-
getDisplayUnit
-
setDisplayUnit
Sets the preferred unit for display. -
measure
-
getLocationDescription
Returns the location description of the device.- Returns:
- the location description
-
getLastCalibration
Returns the timestamp of the last calibration.- Returns:
- the last calibration instant
-
getCalibrationHistory
Returns the calibration history. -
calibrate
-
calibrate
-
needsCalibration
default boolean needsCalibration(int maxAgeHours) Checks if the device needs calibration based on its maximum age. -
isEnabled
default boolean isEnabled()Checks if the device is enabled.- Returns:
- true if enabled
-
setEnabled
default void setEnabled(boolean enabled) Sets whether the device is enabled.- Parameters:
enabled- true to enable
-
getCapabilities
-
getReadings
-
getStatus
Returns the current status of the device as a string.- Returns:
- the status string
-
getDeviceStatus
Returns the actual status enum if available. -
getValue
-
getHistory
List<? extends Device.Record> getHistory()Returns the history of values for this device.- Returns:
- the value history
-