Class AbstractSimulatedDevice
java.lang.Object
org.episteme.core.device.AbstractDevice
org.episteme.core.device.sim.AbstractSimulatedDevice
- All Implemented Interfaces:
Serializable, AutoCloseable, Device, Commented, ComprehensiveIdentification, Identified<Identification>, Named
- Direct Known Subclasses:
SimulatedGPIBDevice, SimulatedTelescope, SimulatedUSBDevice, SimulatedVitalSignsMonitor, SimulatedVotingMachine, SimulatedWeatherStation
Abstract base implementation for all simulated devices.
Uses
SimulatedDeviceSupport to provide common simulation features.- Since:
- 1.2
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractDevice
AbstractDevice.RecordNested classes/interfaces inherited from interface Device
Device.Status -
Field Summary
FieldsFields inherited from class AbstractDevice
accuracy, calibrationHistory, currentValue, displayUnit, firmware, history, identification, lastCalibration, locationDescription, manufacturer, maxRange, minRange, model, precisionDescription, resolution, sensitivity, status -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractSimulatedDevice(String name, String manufacturer) protectedAbstractSimulatedDevice(Identification identification) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCustomReadings(Map<String, String> readings) Subclasses can override to add custom readings.voidclose()voidconnect()Connects to the device.voidDisconnects from the device.Returns a map of capabilities and their status (active/inactive).intReturns the current status readings (Power, Uptime, etc.).Returns the current status of the device as a string.longbooleanChecks if the device is currently connected.booleanvoidsetCapability(String name, boolean enabled) voidsetDriverClass(String driverClass) voidsetErrorCode(int errorCode) voidsetPowerOn(boolean powerOn) Methods inherited from class AbstractDevice
calibrate, getAccuracy, getCalibrationHistory, getDeviceStatus, getDisplayUnit, getFirmware, getHistory, getId, getLastCalibration, getLocationDescription, getManufacturer, getMaxRange, getMeasurableQuantities, getMinRange, getModel, getPrecisionDescription, getResolution, getSensitivity, getTrait, getTraitOptional, getTraits, getValue, isEnabled, measure, needsCalibration, performCalibration, recordMeasurement, setAccuracy, setCurrentValue, setDisplayUnit, setEnabled, setFirmware, setLastCalibration, setLocationDescription, setManufacturer, setMaxRange, setMinRange, setModel, setPrecisionDescription, setResolution, setSensitivity, setStatusMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Commented
getComments, getTrait, setCommentsMethods inherited from interface ComprehensiveIdentification
getName, setName, setTrait
-
Field Details
-
support
-
-
Constructor Details
-
AbstractSimulatedDevice
-
AbstractSimulatedDevice
-
AbstractSimulatedDevice
-
-
Method Details
-
connect
Description copied from interface:DeviceConnects to the device.- Throws:
IOException- if the connection fails
-
disconnect
Description copied from interface:DeviceDisconnects from the device.- Throws:
IOException- if the disconnection fails
-
isConnected
public boolean isConnected()Description copied from interface:DeviceChecks if the device is currently connected.- Returns:
- true if connected, false otherwise
-
getDriverClass
-
setDriverClass
-
isPowerOn
public boolean isPowerOn() -
setPowerOn
public void setPowerOn(boolean powerOn) -
getErrorCode
public int getErrorCode() -
setErrorCode
public void setErrorCode(int errorCode) -
getUptimeSeconds
public long getUptimeSeconds() -
getCapabilities
-
setCapability
-
getReadings
-
addCustomReadings
-
getStatus
-
getFormattedInfo
-
close
-