|
|
|
|
|
|
|
|
test_bodyfit.setOnClickListener(new View.OnClickListener() { |
|
|
test_bodyfit.setOnClickListener(new View.OnClickListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onClick(View v) { |
|
|
public void onClick(View v) { |
|
|
List<EightDoubleBodyFatAdcBean> list = new ArrayList<>(); |
|
|
|
|
|
EightDoubleBodyFatAdcBean adcBean = new EightDoubleBodyFatAdcBean(); |
|
|
|
|
|
adcBean.setAdcRightHand(0x70CE5D91L); |
|
|
|
|
|
adcBean.setAdcLeftHand(0x61A2D714L); |
|
|
|
|
|
adcBean.setAdcBody(0x3013EEE0L); |
|
|
|
|
|
adcBean.setAdcRightFoot(0x50A93C9FL); |
|
|
|
|
|
adcBean.setAdcLeftFoot(0x10071D0CL); |
|
|
|
|
|
adcBean.setFrequencyId(0x01); |
|
|
|
|
|
adcBean.setAlgorithmsId(0x01); |
|
|
|
|
|
list.add(adcBean); |
|
|
|
|
|
|
|
|
|
|
|
EightDoubleBodyFatAdcBean adcBean100 = new EightDoubleBodyFatAdcBean(); |
|
|
|
|
|
adcBean100.setAdcRightHand(0x509A9A5FL); |
|
|
|
|
|
adcBean100.setAdcLeftHand(0x7037B559L); |
|
|
|
|
|
adcBean100.setAdcBody(0x3022CEC6L); |
|
|
|
|
|
adcBean100.setAdcRightFoot(0x60AA8F98L); |
|
|
|
|
|
adcBean100.setAdcLeftFoot(0x40F72698L); |
|
|
|
|
|
adcBean100.setFrequencyId(0x02); |
|
|
|
|
|
adcBean100.setAlgorithmsId(0x01); |
|
|
|
|
|
list.add(adcBean100); |
|
|
|
|
|
mCid = EightDoubleBodyFatBleConfig.CID_APP; |
|
|
|
|
|
onTestCompleted(list); |
|
|
|
|
|
|
|
|
testAdc2(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void testAdc1(){ |
|
|
|
|
|
List<EightDoubleBodyFatAdcBean> list = new ArrayList<>(); |
|
|
|
|
|
EightDoubleBodyFatAdcBean adcBean = new EightDoubleBodyFatAdcBean(); |
|
|
|
|
|
adcBean.setAdcRightHand(0x70CE5D91L); |
|
|
|
|
|
adcBean.setAdcLeftHand(0x61A2D714L); |
|
|
|
|
|
adcBean.setAdcBody(0x3013EEE0L); |
|
|
|
|
|
adcBean.setAdcRightFoot(0x50A93C9FL); |
|
|
|
|
|
adcBean.setAdcLeftFoot(0x10071D0CL); |
|
|
|
|
|
adcBean.setFrequencyId(0x01); |
|
|
|
|
|
adcBean.setAlgorithmsId(0x01); |
|
|
|
|
|
list.add(adcBean); |
|
|
|
|
|
|
|
|
|
|
|
EightDoubleBodyFatAdcBean adcBean100 = new EightDoubleBodyFatAdcBean(); |
|
|
|
|
|
adcBean100.setAdcRightHand(0x509A9A5FL); |
|
|
|
|
|
adcBean100.setAdcLeftHand(0x7037B559L); |
|
|
|
|
|
adcBean100.setAdcBody(0x3022CEC6L); |
|
|
|
|
|
adcBean100.setAdcRightFoot(0x60AA8F98L); |
|
|
|
|
|
adcBean100.setAdcLeftFoot(0x40F72698L); |
|
|
|
|
|
adcBean100.setFrequencyId(0x02); |
|
|
|
|
|
adcBean100.setAlgorithmsId(0x01); |
|
|
|
|
|
list.add(adcBean100); |
|
|
|
|
|
onTestCompleted(list); |
|
|
} |
|
|
} |
|
|
|
|
|
private void testAdc2(){ |
|
|
|
|
|
List<EightDoubleBodyFatAdcBean> list = new ArrayList<>(); |
|
|
|
|
|
EightDoubleBodyFatAdcBean adcBean = new EightDoubleBodyFatAdcBean(); |
|
|
|
|
|
adcBean.setAdcRightHand(1635046219); |
|
|
|
|
|
adcBean.setAdcLeftHand(31463021); |
|
|
|
|
|
adcBean.setAdcBody(540087696); |
|
|
|
|
|
adcBean.setAdcRightFoot(8196483); |
|
|
|
|
|
adcBean.setAdcLeftFoot(4182139); |
|
|
|
|
|
adcBean.setFrequencyId(0x01); |
|
|
|
|
|
adcBean.setAlgorithmsId(0x01); |
|
|
|
|
|
list.add(adcBean); |
|
|
|
|
|
|
|
|
|
|
|
EightDoubleBodyFatAdcBean adcBean100 = new EightDoubleBodyFatAdcBean(); |
|
|
|
|
|
adcBean100.setAdcRightHand(1343010255); |
|
|
|
|
|
adcBean100.setAdcLeftHand(11339343); |
|
|
|
|
|
adcBean100.setAdcBody(536975770); |
|
|
|
|
|
adcBean100.setAdcRightFoot(816731059); |
|
|
|
|
|
adcBean100.setAdcLeftFoot(1884060387); |
|
|
|
|
|
adcBean100.setFrequencyId(0x02); |
|
|
|
|
|
adcBean100.setAlgorithmsId(0x01); |
|
|
|
|
|
list.add(adcBean100); |
|
|
|
|
|
onTestCompleted(list); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initUserInfo() { |
|
|
private void initUserInfo() { |
|
|
mWeightKg = et_weight.getText().toString().trim(); |
|
|
mWeightKg = et_weight.getText().toString().trim(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void getBodyFatData(List<EightDoubleBodyFatAdcBean> adcBeanList) { |
|
|
private void getBodyFatData(List<EightDoubleBodyFatAdcBean> adcBeanList) { |
|
|
if (mCid != EightDoubleBodyFatBleConfig.CID_APP || adcBeanList == null || adcBeanList.isEmpty()) { |
|
|
|
|
|
|
|
|
if ((mCid != EightDoubleBodyFatBleConfig.CID_APP && mCid != EightDoubleBodyFatBleConfig.CID_MCU) || adcBeanList == null || adcBeanList.isEmpty()) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
mEightDoubleBodyFatData.getDualEightBodyData(mUserInfoBean.getSex(), mUserInfoBean.getAge(), mUserInfoBean.getWeightKg(), |
|
|
|
|
|
mUserInfoBean.getHeightCm(), adcBeanList); |
|
|
|
|
|
|
|
|
if (mEightDoubleBodyFatData!=null) { |
|
|
|
|
|
mEightDoubleBodyFatData.getDualEightBodyData(mUserInfoBean.getSex(), mUserInfoBean.getAge(), mUserInfoBean.getWeightKg(), |
|
|
|
|
|
mUserInfoBean.getHeightCm(), adcBeanList); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |