|
|
@ -1,6 +1,7 @@ |
|
|
|
package a8k.app.service.param.pipetteparam; |
|
|
|
|
|
|
|
import a8k.app.service.param.base.ParamMgr; |
|
|
|
import a8k.app.type.param.type.A8kSamplePos; |
|
|
|
import jakarta.annotation.PostConstruct; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
@ -9,16 +10,37 @@ import org.springframework.stereotype.Component; |
|
|
|
@Slf4j |
|
|
|
public class PipetteGunExParamMgr extends ParamMgr { |
|
|
|
enum PipetteGunParam { |
|
|
|
VOLUME_CALIBRATION_COEFFICIENT_A("体积校准系数-A", Double.class), |
|
|
|
VOLUME_CALIBRATION_COEFFICIENT_B("体积校准系数-B", Double.class), |
|
|
|
VOLUME_CALIBRATION_COEFFICIENT_A("体积校准系数-A", Double.class, 1.0), |
|
|
|
VOLUME_CALIBRATION_COEFFICIENT_B("体积校准系数-B", Double.class, 0.0), |
|
|
|
|
|
|
|
SMALL_VOLUME_CALIBRATION_COEFFICIENT_A("小体积-校准系数-A", Double.class, 1.0), |
|
|
|
SMALL_VOLUME_CALIBRATION_COEFFICIENT_B("小体积-校准系数-B", Double.class, 0.0), |
|
|
|
|
|
|
|
THRESHOLD("阈值", Double.class, 35.0), |
|
|
|
|
|
|
|
|
|
|
|
SMALL_VOLUME_ABSORB_VELOCITY("小体积吸液速度", Double.class, 10.0), |
|
|
|
LARGE_VOLUME_ABSORB_VELOCITY("大体积排液速度", Double.class, 40.0), |
|
|
|
|
|
|
|
EMERGENCY_TUBE_LLF_VEL("<急诊试管>液面跟随速度", Integer.class, 20), |
|
|
|
BLOOD_TUBE_LLF_VEL("<全血试管>液面跟随速度", Integer.class, 15), |
|
|
|
MINI_TUBE_LLF_VEL("<迷你试管>液面跟随速度", Integer.class, 15), |
|
|
|
MINI_BLOOD_LLF_VEL("<阳普管>液面跟随速度", Integer.class, 15), |
|
|
|
BULLET_TUBE_1P5_LLF_VEL("<子弹头试管1.5ML>液面跟随速度", Integer.class, 20), |
|
|
|
BULLET_TUBE_0P5_LLF_VEL("<子弹头试管0.5ML>液面跟随速度", Integer.class, 20), |
|
|
|
STOOL_TEST_TUBE_LLF_VEL("<粪便试管>液面跟随速度", Integer.class, 15), |
|
|
|
LARGE_BS_BOTTLE_LLF_VEL("<大BS瓶>液面跟随速度", Integer.class, 20), |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
public final String chName; |
|
|
|
public final Class<?> type; |
|
|
|
public final Object defaultVal; |
|
|
|
|
|
|
|
PipetteGunParam(String chName, Class<?> type) { |
|
|
|
this.chName = chName; |
|
|
|
this.type = type; |
|
|
|
PipetteGunParam(String chName, Class<?> type, Object defaultVal) { |
|
|
|
this.chName = chName; |
|
|
|
this.type = type; |
|
|
|
this.defaultVal = defaultVal; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -26,19 +48,39 @@ public class PipetteGunExParamMgr extends ParamMgr { |
|
|
|
@PostConstruct |
|
|
|
void initialize() { |
|
|
|
for (PipetteGunParam param : PipetteGunParam.values()) { |
|
|
|
initParam(param, param.chName, param.type); |
|
|
|
initParam(param, param.chName, param.type, param.defaultVal); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void setVolumeCalibrationCoefficient(Double A, Double B) { |
|
|
|
public void setLargeVolumeCalibrationCoefficient(Double A, Double B) { |
|
|
|
setParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_A, A); |
|
|
|
setParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_B, B); |
|
|
|
} |
|
|
|
|
|
|
|
public void setSmallVolumeCalibrationCoefficient(Double A, Double B) { |
|
|
|
setParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_A, A); |
|
|
|
setParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_B, B); |
|
|
|
} |
|
|
|
|
|
|
|
public void setThreshold(Double threshold) { |
|
|
|
setParam(PipetteGunParam.THRESHOLD, threshold); |
|
|
|
} |
|
|
|
|
|
|
|
public double calibrateVolume(double rawVolume) { |
|
|
|
Double A = getParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_A, Double.class); |
|
|
|
Double B = getParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); |
|
|
|
return A * rawVolume + B; |
|
|
|
|
|
|
|
|
|
|
|
Double sA = getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_A, Double.class); |
|
|
|
Double sB = getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); |
|
|
|
|
|
|
|
Double threshold = getParam(PipetteGunParam.THRESHOLD, Double.class); |
|
|
|
|
|
|
|
if (rawVolume < threshold) { |
|
|
|
return sA * rawVolume + sB; |
|
|
|
} else { |
|
|
|
return A * rawVolume + B; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public double getCoefficientA() { |
|
|
@ -48,4 +90,73 @@ public class PipetteGunExParamMgr extends ParamMgr { |
|
|
|
public double getCoefficientB() { |
|
|
|
return getParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); |
|
|
|
} |
|
|
|
|
|
|
|
public double getSmallCoefficientA() { |
|
|
|
return getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_A, Double.class); |
|
|
|
} |
|
|
|
|
|
|
|
public double getSmallCoefficientB() { |
|
|
|
return getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); |
|
|
|
} |
|
|
|
|
|
|
|
public double getThreshold() { |
|
|
|
return getParam(PipetteGunParam.THRESHOLD, Double.class); |
|
|
|
} |
|
|
|
|
|
|
|
public int geVolumeAbsorbVelocity(Double ul) { |
|
|
|
Double threshold = getParam(PipetteGunParam.THRESHOLD, Double.class); |
|
|
|
if (ul < threshold) { |
|
|
|
return (int) getSmallVolumeAbsorbVelocity(); |
|
|
|
} else { |
|
|
|
return (int) getLargeVolumeAbsorbVelocity(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public double getSmallVolumeAbsorbVelocity() { |
|
|
|
return getParam(PipetteGunParam.SMALL_VOLUME_ABSORB_VELOCITY, Double.class); |
|
|
|
} |
|
|
|
|
|
|
|
public double getLargeVolumeAbsorbVelocity() { |
|
|
|
return getParam(PipetteGunParam.LARGE_VOLUME_ABSORB_VELOCITY, Double.class); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Integer getSampleLLFVel(Double ul, A8kSamplePos pos) { |
|
|
|
Double threshold = getParam(PipetteGunParam.THRESHOLD, Double.class); |
|
|
|
if (ul < threshold) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return getLargeAbsorbSampleLLFVel(pos); |
|
|
|
} |
|
|
|
|
|
|
|
public Integer getLargeAbsorbSampleLLFVel(A8kSamplePos pos) { |
|
|
|
return switch (pos) { |
|
|
|
case EmergencyTubePos -> getParam(PipetteGunParam.EMERGENCY_TUBE_LLF_VEL, Integer.class); |
|
|
|
case BloodHTubePos, BloodSTubePos -> getParam(PipetteGunParam.BLOOD_TUBE_LLF_VEL, Integer.class); |
|
|
|
case MiniBloodPos -> getParam(PipetteGunParam.MINI_BLOOD_LLF_VEL, Integer.class); |
|
|
|
case Bulltube1P5Pos -> getParam(PipetteGunParam.BULLET_TUBE_1P5_LLF_VEL, Integer.class); |
|
|
|
case Bulltube0P5Pos -> getParam(PipetteGunParam.BULLET_TUBE_0P5_LLF_VEL, Integer.class); |
|
|
|
case StoolTestTubePos -> getParam(PipetteGunParam.STOOL_TEST_TUBE_LLF_VEL, Integer.class); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
public void setLargeAbsorbSampleLLFVel(A8kSamplePos pos, Integer val) { |
|
|
|
switch (pos) { |
|
|
|
case EmergencyTubePos -> setParam(PipetteGunParam.EMERGENCY_TUBE_LLF_VEL, val); |
|
|
|
case BloodHTubePos, BloodSTubePos -> setParam(PipetteGunParam.BLOOD_TUBE_LLF_VEL, val); |
|
|
|
case MiniBloodPos -> setParam(PipetteGunParam.MINI_BLOOD_LLF_VEL, val); |
|
|
|
case Bulltube1P5Pos -> setParam(PipetteGunParam.BULLET_TUBE_1P5_LLF_VEL, val); |
|
|
|
case Bulltube0P5Pos -> setParam(PipetteGunParam.BULLET_TUBE_0P5_LLF_VEL, val); |
|
|
|
case StoolTestTubePos -> setParam(PipetteGunParam.STOOL_TEST_TUBE_LLF_VEL, val); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public Integer getLargeBSBottleLlfVel() { |
|
|
|
return getParam(PipetteGunParam.LARGE_BS_BOTTLE_LLF_VEL, Integer.class); |
|
|
|
} |
|
|
|
|
|
|
|
public void setLargeBSBottleLlfVel(Integer val) { |
|
|
|
setParam(PipetteGunParam.LARGE_BS_BOTTLE_LLF_VEL, val); |
|
|
|
} |
|
|
|
|
|
|
|
} |