using YBDevice.Entity;

namespace YBDevice.Body.BodyFatHelper
{
    /// <summary>
    /// 体脂计算算法
    /// </summary>
    public interface IBodyFatHelperService
    {
        /// <summary>
        /// 结果计算
        /// </summary>
        /// <param name="model">已计算的结果</param>
        /// <returns></returns>
        UserMeasureModel CalcBodyFat(MeasureCalcDto model);

        /// <summary>
        /// 2/4电极计算体脂
        /// </summary>
        /// <param name="weight">体重,单位为kg</param>
        /// <param name="height">身高,单位为米</param>
        /// <param name="age">年龄</param>
        /// <param name="adc">阻抗</param>
        /// <param name="sex">性别,1-男，2-女,0-未知</param>
        /// <returns></returns>
        UserMeasureModel CalcBodyFat(double weight, double height, int age, int adc, GenderType sex);

        /// <summary>
        /// 品传2/4电极计算体脂
        /// </summary>
        /// <param name="weight">体重,单位为kg</param>
        /// <param name="height">身高,单位为米</param>
        /// <param name="age">年龄</param>
        /// <param name="adc">阻抗</param>
        /// <param name="sex">性别,1-男，2-女,0-未知</param>
        /// <returns></returns>
        UserMeasureModel PCCalcBodyFat(double weight, double height, int age, int adc, GenderType sex);

        /// <summary>
        /// 八电极计算体脂
        /// </summary>
        /// <param name="weight">体重,单位为kg</param>
        /// <param name="height">身高,单位为米</param>
        /// <param name="age">年龄</param>
        /// <param name="sex">性别,1-男，2-女,0-未知</param>
        /// <param name="body">全身阻抗</param>
        /// <param name="leftfoot">左脚阻抗</param>
        /// <param name="lefthand">左手阻抗</param>
        /// <param name="rightfoot">右脚阻抗</param>
        /// <param name="righthand">右手阻抗</param>
        Task<UserMeasureDto> CalcBody120FatAsync(decimal weight, decimal height, int age, GenderType sex, decimal lefthand, decimal righthand, decimal leftfoot, decimal rightfoot, decimal body);

        /// <summary>
        /// bmi范围标准
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> bmi_value(GenderType sex, int age);

        /// <summary>
        /// 脂肪率/体脂率范围标准
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> fa_r_value(GenderType sex, int age);

        /// <summary>
        /// 脂肪重量标准范围
        /// </summary>
        /// <param name="sex">性别</param>
        /// <param name="age">年龄</param>
        /// <param name="weight">重量,kg</param>
        /// <returns></returns>
        List<MeasureInfoItemValue> fat_w_value(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 肌肉率范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> muscle_value(GenderType sex, int age);

        /// <summary>
        /// 肌肉重量标准范围
        /// </summary>
        /// <param name="sex">性别</param>
        /// <param name="age">年龄</param>
        /// <param name="weight">重量,kg</param>
        /// <returns></returns>
        List<MeasureInfoItemValue> muscleval_value(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 水份范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> water_value(GenderType sex, int age);

        /// <summary>
        /// 骨量范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="weight">体重</param>
        /// <returns></returns>
        List<MeasureInfoItemValue> bone_value(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 基础代谢范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="weight"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> kcal_value(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 内脂范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> visceral_value(GenderType sex, int age);

        /// <summary>
        /// 蛋白质范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> protein_value(GenderType sex, int age);

        /// <summary>
        /// 蛋白量标准范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="weight"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> proteinval_value(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 皮下脂肪范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> sfr_value(GenderType sex, int age);

        /// <summary>
        /// 骨骼肌量范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> skeletalmusclekg(GenderType sex, int age);

        /// <summary>
        /// 皮下脂肪量范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="weight"></param>
        /// <returns></returns>
        List<MeasureInfoItemValue> sfrval_value(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 肥胖等级
        /// </summary>
        /// <param name="level">level=(体重-标准体重)/标准体重</param>
        /// <returns></returns>
        string fatlevel(double level);

        /// <summary>
        /// 标准体重
        /// </summary>
        /// <param name="height">身高,厘米</param>
        /// <param name="sex">性别,0-女,1-男</param>
        /// <returns></returns>
        double standweight(int height, GenderType sex);

        /// <summary>
        /// BMI标准的范围
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        MeasureInfoItemValue bmi_stand(GenderType sex, int age);

        /// <summary>
        /// 肌肉量标准
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="weight"></param>
        /// <returns></returns>
        MeasureInfoItemValue muscleval_stand(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 脂肪重量标准
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="weight"></param>
        /// <returns></returns>
        MeasureInfoItemValue fat_w_stand(GenderType sex, int age, decimal weight);

        /// <summary>
        /// 骨骼肌量标准
        /// </summary>
        /// <param name="sex"></param>
        /// <param name="age"></param>
        /// <param name="val">骨骼肌值</param>
        /// <returns></returns>
        List<MeasureInfoItemValue> skeletalmusclekg_val(GenderType sex, int age, decimal val);

        /// <summary>
        /// BMI值计算
        /// </summary>
        /// <param name="height">身高,厘米</param>
        /// <param name="weight">体重,公斤</param>
        /// <returns></returns>
        decimal CalcBMi(decimal height, decimal weight);

        /// <summary>
        /// 标准体重计算
        /// </summary>
        /// <param name="height">身高,厘米</param>
        /// <param name="sex">性别,1-男,2-女</param>
        /// <returns></returns>
        decimal CalcStandWeight(decimal height, GenderType sex);

        /// <summary>
        /// 根据等级获取标准颜色
        /// </summary>
        /// <param name="level">等级标准</param>
        /// <returns></returns>
        string GetLevelColor(string level);
    }
}