Sfoglia il codice sorgente

更新八电极算法demo

master
陈福行 2 anni fa
parent
commit
7d0e8aea45

+ 35
- 2
app/src/main/java/aicare/net/cn/sdk/ailinksdkdemoandroid/utils/EightBodyFatAlgorithms.java Vedi File

package aicare.net.cn.sdk.ailinksdkdemoandroid.utils; 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.HTBodyBasicInfo;
import com.holtek.libHTBodyfat.HTBodyResultAllBody; import com.holtek.libHTBodyfat.HTBodyResultAllBody;
import aicare.net.cn.sdk.ailinksdkdemoandroid.EightBodyfatAdc;


import java.util.Locale; import java.util.Locale;


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



public class EightBodyFatAlgorithms { public class EightBodyFatAlgorithms {


} }





public EightBodyFatBean getAlgorithmsData(int algorithms, int sex, int height, float weight_kg, int age, EightBodyfatAdc eightBodyfatAdc) { public EightBodyFatBean getAlgorithmsData(int algorithms, int sex, int height, float weight_kg, int age, EightBodyfatAdc eightBodyfatAdc) {
EightBodyFatBean eightBodyFatBean = new EightBodyFatBean(); EightBodyFatBean eightBodyFatBean = new EightBodyFatBean();
switch (algorithms) { 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: case 1:
default: default:


eightBodyFatBean.setMuscleMassLeftBottom(String.valueOf(resultTwoLegs.htMuscleKgLeftLeg)); eightBodyFatBean.setMuscleMassLeftBottom(String.valueOf(resultTwoLegs.htMuscleKgLeftLeg));
eightBodyFatBean.setMuscleMassRightTop(String.valueOf(resultTwoLegs.htMuscleKgRightArm)); eightBodyFatBean.setMuscleMassRightTop(String.valueOf(resultTwoLegs.htMuscleKgRightArm));
eightBodyFatBean.setMuscleMassRightBottom(String.valueOf(resultTwoLegs.htMuscleKgRightLeg)); eightBodyFatBean.setMuscleMassRightBottom(String.valueOf(resultTwoLegs.htMuscleKgRightLeg));


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

+ 55
- 0
app/src/main/java/aicare/net/cn/sdk/ailinksdkdemoandroid/utils/EightBodyFatBean.java Vedi File

private double adcRightBody; private double adcRightBody;
private double adcRightHandLeftFoot; private double adcRightHandLeftFoot;
private double adcLeftHandRightFoot; private double adcLeftHandRightFoot;
/**
* adc身体
*/
private double adcBody; private double adcBody;
/**
* 算术
*/
private int arithmetic; private int arithmetic;
/**
* 心率
*/
private int heartRate; private int heartRate;
private String fatMassRightTop; //体脂-右上 private String fatMassRightTop; //体脂-右上
private String fatMassRightBottom; //体脂-右下 private String fatMassRightBottom; //体脂-右下


private String testAdc; 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() { public String getTestAdc() {
return testAdc; return testAdc;
"vwc=" + vwc + ", bodyAge=" + bodyAge + ", pp=" + pp + ", adcFoot=" + adcFoot + ", adcHand=" + adcHand + ", adcLeftHand=" + adcLeftHand + ", adcRightHand=" + adcRightHand + ", " + "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 + '\'' + '}'; "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…
Annulla
Salva