소스 검색

校准四舍五入去整

datasub12_previous
H Vs 1 년 전
부모
커밋
880434d9b8
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. +8
    -8
      HealthMonitor.WebApi/Controllers/HealthMonitor/HmBloodPressConfigManualCalibrationController.cs

+ 8
- 8
HealthMonitor.WebApi/Controllers/HealthMonitor/HmBloodPressConfigManualCalibrationController.cs 파일 보기

@@ -201,8 +201,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor




// 增量值=(标定值-平均值)* 0.25 // 增量值=(标定值-平均值)* 0.25
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
_logger.LogInformation(" A.2 没有下推记录,有测量记录,正常计算增量值 ,增量值将正常下发"); _logger.LogInformation(" A.2 没有下推记录,有测量记录,正常计算增量值 ,增量值将正常下发");
return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false); return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false);
} }
@@ -254,8 +254,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor
//var systolicAvgOffset = avgOffset; //var systolicAvgOffset = avgOffset;
//var diastolicAvgOffset = avgOffset; //var diastolicAvgOffset = avgOffset;
// 增量值=(标定值-平均值)* 0.25 // 增量值=(标定值-平均值)* 0.25
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
_logger.LogInformation("B.1.2 设备已经被重新设置, 从重置的ts 到 now 有测量数据 ,增量值将正常下发"); _logger.LogInformation("B.1.2 设备已经被重新设置, 从重置的ts 到 now 有测量数据 ,增量值将正常下发");
return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false); return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false);
} }
@@ -288,8 +288,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor
//systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!; //systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
//diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; //diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;


systolicInc = (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
systolicInc = (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;


// B.2.1 数据异常,将按最后一次测量值的offeset下发 // B.2.1 数据异常,将按最后一次测量值的offeset下发
if (systolicAvg.Equals(0) || diastolicAvg.Equals(0)) if (systolicAvg.Equals(0) || diastolicAvg.Equals(0))
@@ -318,8 +318,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor
{ {
// 增量值=(标定值-平均值)* 0.25 // 增量值=(标定值-平均值)* 0.25
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
_logger.LogInformation("B.2.2 曾经下推过断言有测量记录,数据正常,按正常计算 ,增量值将正常下发"); _logger.LogInformation("B.2.2 曾经下推过断言有测量记录,数据正常,按正常计算 ,增量值将正常下发");
return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false); return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false);
} }


Loading…
취소
저장