Class MicroCalibrationService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.ext.freestyle.service.micro.calibration.MicroCalibrationService
- All Implemented Interfaces:
CtxEventListener
,ContextHandleAware
,HandleAware
,Ready
,ReadyAndReadyListener
,ReadyListener
Service for managing micro pump calibration data.
- Version:
- 2024-10-09
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetBoardReport
(Board board) Return calibration report for a board.getHistory
(MicroPump pump) Return calibration history for the specified pump.getPumpReport
(MicroPump pump) Return calibration report for the specified pump.getStorageCal
(MicroPump pump) Return micro calibration for the specified pump from storage.void
Reset the running value from storage if the current value in the pump is a temporary value.double
roundCalValue
(MicroPump pump, double val) Given a calibration value, return the rounded value that will actually be stored in the associated storage system.void
setPumpBothCal
(MicroPump pump, double val, String src) Set both the running and baseline calibration values for the pump.void
setPumpCalBaseline
(MicroPump pump, double val, String src) Set the baseline calibration value for the pump.void
setPumpCalRunning
(MicroPump pump, double val, String src) Set the running calibration value for he pump.void
setPumpCalWithCode
(MicroPump pump, String code) Set the calibration value for the specified pump using the code on the pump.void
setStorageMgr
(MicroCalibrationStorageMgr storageMgr) By default the service usesCriticalData
to store calibration data so that it survives across board swaps.void
setTmpPumpCalRunning
(MicroPump pump, double val) Writes the running value directly to the pump, marking it as temporary so that it will be reset on the next reboot if not reset via api.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefix
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyAndReadyListener
onBeanReady, onDependenciesReady
Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Field Details
-
SRC_PUMP_CODE
- See Also:
-
SRC_ENDPOINT
- See Also:
-
SRC_STORAGE
- See Also:
-
-
Method Details
-
setStorageMgr
By default the service usesCriticalData
to store calibration data so that it survives across board swaps. However, if critical data is not available, the storage manager can be replaced to use some other form of persistence for micro pump calibration data. This must be called from the system app before the assembly is installed to ensure that the previous storage manager isn't used when hardware first links. -
setPumpCalWithCode
Set the calibration value for the specified pump using the code on the pump. This will set both the baseline and running calibration value for the pump.- Parameters:
pump
- the pump to setcode
- the calibration code from the pump sticker- Throws:
IOException
-
setPumpCalBaseline
Set the baseline calibration value for the pump. This will update storage and the pump.- Parameters:
pump
- the pump to updateval
- the new baseline valuesrc
- the source of the new calibration value- Throws:
IOException
-
setPumpCalRunning
Set the running calibration value for he pump. This will update storage and the pump.- Parameters:
pump
- the pump to updateval
- the new running valuesrc
- the source of the new calibration value- Throws:
IOException
-
roundCalValue
Given a calibration value, return the rounded value that will actually be stored in the associated storage system. In some cases the storage system may be space constrained and return a range-limited or less granular value.- Parameters:
pump
- the pump the cal value is forval
- the calibration value to round
-
getStorageCal
Return micro calibration for the specified pump from storage.- Parameters:
pump
- the pump to return calibration data for
-
setTmpPumpCalRunning
Writes the running value directly to the pump, marking it as temporary so that it will be reset on the next reboot if not reset via api.- Parameters:
pump
- the pump to updateval
- the new running value- Throws:
IOException
-
resetTmpPumpCalRunning
Reset the running value from storage if the current value in the pump is a temporary value.- Parameters:
pump
- the pump to reset- Throws:
IOException
-
setPumpBothCal
Set both the running and baseline calibration values for the pump.- Parameters:
pump
- the pump being updatedval
- the new running/baseline valuesrc
- the source of the new cal values- Throws:
IOException
-
getBoardReport
Return calibration report for a board. -
getPumpReport
Return calibration report for the specified pump. -
getHistory
Return calibration history for the specified pump.
-