瀏覽代碼

更新八电极算法demo

master
陈福行 2 年之前
父節點
當前提交
7d0e8aea45

+ 35
- 2
app/src/main/java/aicare/net/cn/sdk/ailinksdkdemoandroid/utils/EightBodyFatAlgorithms.java 查看文件

@@ -1,11 +1,16 @@
package aicare.net.cn.sdk.ailinksdkdemoandroid.utils;

import com.besthealth.bhBodyComposition120.BhBodyComposition;
import com.besthealth.bhBodyComposition120.BhErrorType;
import com.besthealth.bhBodyComposition120.BhPeopleType;
import com.besthealth.bhBodyComposition120.BhSex;
import com.holtek.libHTBodyfat.HTBodyBasicInfo;
import com.holtek.libHTBodyfat.HTBodyResultAllBody;
import aicare.net.cn.sdk.ailinksdkdemoandroid.EightBodyfatAdc;

import java.util.Locale;

import aicare.net.cn.sdk.ailinksdkdemoandroid.EightBodyfatAdc;


public class EightBodyFatAlgorithms {

@@ -24,10 +29,36 @@ public class EightBodyFatAlgorithms {
}



public EightBodyFatBean getAlgorithmsData(int algorithms, int sex, int height, float weight_kg, int age, EightBodyfatAdc eightBodyfatAdc) {
EightBodyFatBean eightBodyFatBean = new EightBodyFatBean();
switch (algorithms) {
//和泰算法

case 2:
BhBodyComposition bhBodyComposition = new BhBodyComposition();
bhBodyComposition.bhSex = sex == 1 ? BhSex.MALE.ordinal() : BhSex.FEMALE.ordinal();
bhBodyComposition.bhPeopleType= BhPeopleType.NORMAL.ordinal();
bhBodyComposition.bhWeightKg = weight_kg;
bhBodyComposition.bhAge = age;
bhBodyComposition.bhHeightCm = height;
bhBodyComposition.bhZLeftBodyEnCode = eightBodyfatAdc.getAdcRightBody();
bhBodyComposition.bhZLeftArmEnCode = eightBodyfatAdc.getAdcLeftHand();
bhBodyComposition.bhZRightArmEnCode = eightBodyfatAdc.getAdcRightHand();
bhBodyComposition.bhZLeftLegEnCode = eightBodyfatAdc.getAdcLeftFoot();
bhBodyComposition.bhZRightLegEnCode = eightBodyfatAdc.getAdcRightFoot();

BhErrorType bhErrorType = BhErrorType.values()[bhBodyComposition.getBodyComposition()];

if (bhErrorType == BhErrorType.NONE) {
eightBodyFatBean.setBhSkeletalMuscleKg(bhBodyComposition.bhSkeletalMuscleKg + "");
eightBodyFatBean.setBhSkeletalMuscleKgLevel(bhBodyComposition.bhSkeletalMuscleKgLevel + "");
eightBodyFatBean.setBhSkeletalMuscleKgListStandardOrExcellent(bhBodyComposition.bhMuscleKgListStandardOrExcellent + "");
eightBodyFatBean.setBhSkeletalMuscleKgListUnderOrStandard(bhBodyComposition.bhSkeletalMuscleKgListUnderOrStandard + "");
}

break;


case 1:
default:

@@ -63,6 +94,8 @@ public class EightBodyFatAlgorithms {
eightBodyFatBean.setMuscleMassLeftBottom(String.valueOf(resultTwoLegs.htMuscleKgLeftLeg));
eightBodyFatBean.setMuscleMassRightTop(String.valueOf(resultTwoLegs.htMuscleKgRightArm));
eightBodyFatBean.setMuscleMassRightBottom(String.valueOf(resultTwoLegs.htMuscleKgRightLeg));


// eightBodyFatBean.setMusleMass(resultTwoLegs.htMuscleKg);
// eightBodyFatBean.setStandardWeight(resultTwoLegs.htIdealWeightKg);
// eightBodyFatBean.setWeightWithoutFat(resultTwoLegs.htBodyfatFreeMass);

+ 55
- 0
app/src/main/java/aicare/net/cn/sdk/ailinksdkdemoandroid/utils/EightBodyFatBean.java 查看文件

@@ -22,8 +22,17 @@ public class EightBodyFatBean {
private double adcRightBody;
private double adcRightHandLeftFoot;
private double adcLeftHandRightFoot;
/**
* adc身体
*/
private double adcBody;
/**
* 算术
*/
private int arithmetic;
/**
* 心率
*/
private int heartRate;
private String fatMassRightTop; //体脂-右上
private String fatMassRightBottom; //体脂-右下
@@ -39,10 +48,55 @@ public class EightBodyFatBean {

private String testAdc;

/**
* 骨骼肌公斤
*/
private String bhSkeletalMuscleKg;
/**
* 骨骼肌公斤级别
*/
private String bhSkeletalMuscleKgLevel;
/**
* 骨骼肌公斤列表或标准
*/
private String bhSkeletalMuscleKgListUnderOrStandard;
/**
* 骨骼肌公斤标准或优秀列表
*/
private String bhSkeletalMuscleKgListStandardOrExcellent;


public void setBhSkeletalMuscleKg(String bhSkeletalMuscleKg) {
this.bhSkeletalMuscleKg = bhSkeletalMuscleKg;
}

public void setBhSkeletalMuscleKgLevel(String bhSkeletalMuscleKgLevel) {
this.bhSkeletalMuscleKgLevel = bhSkeletalMuscleKgLevel;
}

public void setBhSkeletalMuscleKgListUnderOrStandard(String bhSkeletalMuscleKgListUnderOrStandard) {
this.bhSkeletalMuscleKgListUnderOrStandard = bhSkeletalMuscleKgListUnderOrStandard;
}

public void setBhSkeletalMuscleKgListStandardOrExcellent(String bhSkeletalMuscleKgListStandardOrExcellent) {
this.bhSkeletalMuscleKgListStandardOrExcellent = bhSkeletalMuscleKgListStandardOrExcellent;
}

public String getBhSkeletalMuscleKg() {
return bhSkeletalMuscleKg;
}

public String getBhSkeletalMuscleKgLevel() {
return bhSkeletalMuscleKgLevel;
}

public String getBhSkeletalMuscleKgListUnderOrStandard() {
return bhSkeletalMuscleKgListUnderOrStandard;
}

public String getBhSkeletalMuscleKgListStandardOrExcellent() {
return bhSkeletalMuscleKgListStandardOrExcellent;
}

public String getTestAdc() {
return testAdc;
@@ -332,4 +386,5 @@ public class EightBodyFatBean {
"vwc=" + vwc + ", bodyAge=" + bodyAge + ", pp=" + pp + ", adcFoot=" + adcFoot + ", adcHand=" + adcHand + ", adcLeftHand=" + adcLeftHand + ", adcRightHand=" + adcRightHand + ", " +
"adcLeftFoot=" + adcLeftFoot + ", adcRightFoot=" + adcRightFoot + ", adcLeftBody=" + adcLeftBody + ", adcRightBody=" + adcRightBody + ", adcRightHandLeftFoot=" + adcRightHandLeftFoot + ", adcLeftHandRightFoot=" + adcLeftHandRightFoot + ", adcBody=" + adcBody + ", arithmetic=" + arithmetic + ", heartRate=" + heartRate + ", fatMassRightTop='" + fatMassRightTop + '\'' + ", fatMassRightBottom='" + fatMassRightBottom + '\'' + ", fatMassLeftTop='" + fatMassLeftTop + '\'' + ", fatMassLeftBottom='" + fatMassLeftBottom + '\'' + ", fatMassBody='" + fatMassBody + '\'' + ", muscleMassRightTop='" + muscleMassRightTop + '\'' + ", muscleMassRightBottom='" + muscleMassRightBottom + '\'' + ", muscleMassLeftTop='" + muscleMassLeftTop + '\'' + ", muscleMassLeftBottom='" + muscleMassLeftBottom + '\'' + ", muscleMassBody='" + muscleMassBody + '\'' + ", testAdc='" + testAdc + '\'' + '}';
}

}

Loading…
取消
儲存