package com.example.watch.ui.activity

class BaseData {
    val heigh = 146
    val sex = 1
    val age = 6
    val weight = 41
    val head = "123.jpg"
    val peaceHr = 90

    public fun calcActivity(Hr: Int, Sex: Int, Weight: Int, Age: Int, T: Int): String {
        var res = "0"
        var calc:Double
        if (Sex == 1) {
            calc = (((-55.0969 + (0.6309 * Hr) + (0.1988 * Weight) + (0.2017 * Age)) / 4.184)*60 *T)
        } else {
            calc = (((-20.4022 + (0.4472 * Hr) + (0.1263 * Weight) + (0.074 * Age)) / 4.184)*60 *T)
        }
//        强度最大100
        calc = if(calc >= 100.0) 100.0 else calc
        res = calc.toInt().toString()
        return res
    }
}