Package yams.mechanisms.config
Class SensorConfig
java.lang.Object
yams.mechanisms.config.SensorConfig
Sensor configuration for simulated and real sensors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the list of Fields (SensorData) for this sensor.getName()Get the name of the sensor.Get theSensorfor this sensor.withField(String name, BooleanSupplier supplier, boolean defaultVal) Add a field to the sensor.withField(String name, DoubleSupplier supplier, double defaultVal) Add a field to the sensor.withField(String name, IntSupplier supplier, int defaultVal) Add a field to the sensor.withField(String name, LongSupplier supplier, long defaultVal) Add a field to the sensor.withSimulatedValue(String fieldName, Time start, Time end, boolean value) Add a simulated value to the sensor at a given match time.withSimulatedValue(String fieldName, Time start, Time end, double value) Add a simulated value to the sensor at a given match time.withSimulatedValue(String fieldName, Time start, Time end, int value) Add a simulated value to the sensor at a given match time.withSimulatedValue(String fieldName, Time start, Time end, long value) Add a simulated value to the sensor at a given match time.withSimulatedValue(String fieldName, BooleanSupplier trigger, boolean value) Add a simulated value to the sensor at a given trigger.withSimulatedValue(String fieldName, BooleanSupplier trigger, double value) Add a simulated value to the sensor at a given trigger.withSimulatedValue(String fieldName, BooleanSupplier trigger, int value) Add a simulated value to the sensor at a given trigger.withSimulatedValue(String fieldName, BooleanSupplier trigger, long value) Add a simulated value to the sensor at a given trigger.
-
Constructor Details
-
SensorConfig
Sensor configuration.- Parameters:
name- Name of sensor to display in the simulation window.
-
-
Method Details
-
withField
Add a field to the sensor.- Parameters:
name- Name of the field to add.supplier- Supplier of the real field value.defaultVal- Default value of the field.- Returns:
SensorConfig
-
withField
Add a field to the sensor.- Parameters:
name- Name of the field to add.supplier- Supplier of the real field value.defaultVal- Default value of the field.- Returns:
SensorConfig
-
withField
Add a field to the sensor.- Parameters:
name- Name of the field to add.supplier- Supplier of the real field value.defaultVal- Default value of the field.- Returns:
SensorConfig
-
withField
Add a field to the sensor.- Parameters:
name- Name of the field to add.supplier- Supplier of the real field value.defaultVal- Default value of the field.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given match time.- Parameters:
fieldName- Name of the field to change.start-Timeat which to start the data simulation.end-Timeat which to end the data simulation.value- Value to simulate.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given match time.- Parameters:
fieldName- Name of the field to change.start-Timeat which to start the data simulation.end-Timeat which to end the data simulation.value- Value to simulate.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given match time.- Parameters:
fieldName- Name of the field to change.start-Timeat which to start the data simulation.end-Timeat which to end the data simulation.value- Value to simulate.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given match time.- Parameters:
fieldName- Name of the field to change.start-Timeat which to start the data simulation.end-Timeat which to end the data simulation.value- Value to simulate.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given trigger.- Parameters:
fieldName- Name of the field to change.trigger-BooleanSupplierfor when data should be simulated.value- Value to simulate.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given trigger.- Parameters:
fieldName- Name of the field to change.trigger-BooleanSupplierfor when data should be simulated.value- Value to simulate.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given trigger.- Parameters:
fieldName- Name of the field to change.trigger-BooleanSupplierfor when data should be simulated.value- Value to simulate.- Returns:
SensorConfig
-
withSimulatedValue
Add a simulated value to the sensor at a given trigger.- Parameters:
fieldName- Name of the field to change.trigger-BooleanSupplierfor when data should be simulated.value- Value to simulate.- Returns:
SensorConfig
-
getSensor
Get theSensorfor this sensor.- Returns:
Sensorfor fetching real and simulated values.
-
getName
Get the name of the sensor.- Returns:
- Name of the sensor.
-
getFields
Get the list of Fields (SensorData) for this sensor.- Returns:
- list of
SensorDatafor this sensor
-