1***@qq.com
1***@qq.com
  • 发布:2023-06-25 10:35
  • 更新:2023-06-25 10:35
  • 阅读:119

float总是提示报错

分类:uts
import JSONObject from 'org.json.JSONObject';  
export default class QualityConfig {  

    // 光照  
    private minIllum : Float = 60!.toFloat();  // 最大  
    private maxIllum : Float = 200!.toFloat();  // 最小  
    // 模糊  
    private blur : Float = 0.4!.toFloat();  
    // 遮挡  
    private leftEyeOcclusion : Float = 0.4!.toFloat();       // 左眼  
    private rightEyeOcclusion : Float = 0.4!.toFloat();      // 右眼  
    private noseOcclusion : Float = 0.4!.toFloat();          // 鼻子  
    private mouseOcclusion : Float = 0.4!.toFloat();         // 嘴巴  
    private leftContourOcclusion : Float = 0.4!.toFloat();   // 左脸颊  
    private rightContourOcclusion : Float = 0.4!.toFloat();  // 右脸颊  
    private chinOcclusion : Float = 0.4!.toFloat();          // 下巴  
    // 姿态角  
    private pitch : Int = 15;   // 上下角  
    private yaw : Int = 15;     // 左右角  
    private roll : Int = 15;    // 旋转角  
    get getMinIllum() : Float {  
        return this.minIllum;  
    }  
    set setMinIllum(minIllum : Float) {  
        this.minIllum = minIllum;  
    }  

    get getMaxIllum() : Float {  
        return this.maxIllum;  
    }  

    set setMaxIllum(maxIllum : Float) {  
        this.maxIllum = maxIllum;  
    }  

    get getBlur() : Float {  
        return this.blur;  
    }  

    set setBlur(blur : Float) {  
        this.blur = blur;  
    }  

    get getLeftEyeOcclusion() : Float {  
        return this.leftEyeOcclusion;  
    }  

    set setLeftEyeOcclusion(leftEyeOcclusion : Float) {  
        this.leftEyeOcclusion = leftEyeOcclusion;  
    }  

    get getRightEyeOcclusion() : Float {  
        return this.rightEyeOcclusion;  
    }  

    set setRightEyeOcclusion(rightEyeOcclusion : Float) {  
        this.rightEyeOcclusion = rightEyeOcclusion;  
    }  

    get getNoseOcclusion() : Float {  
        return this.noseOcclusion;  
    }  

    set setNoseOcclusion(noseOcclusion : Float) {  
        this.noseOcclusion = noseOcclusion;  
    }  

    get getMouseOcclusion() : Float {  
        return this.mouseOcclusion;  
    }  

    set setMouseOcclusion(mouseOcclusion : Float) {  
        this.mouseOcclusion = mouseOcclusion;  
    }  

    get getLeftContourOcclusion() : Float {  
        return this.leftContourOcclusion;  
    }  

    set setLeftContourOcclusion(leftContourOcclusion : Float) {  
        this.leftContourOcclusion = leftContourOcclusion;  
    }  

    get getRightContourOcclusion() : Float {  
        return this.rightContourOcclusion;  
    }  

    set setRightContourOcclusion(rightContourOcclusion : Float) {  
        this.rightContourOcclusion = rightContourOcclusion;  
    }  

    get getChinOcclusion() : Float {  
        return this.chinOcclusion;  
    }  

    set setChinOcclusion(chinOcclusion : Float) {  
        this.chinOcclusion = chinOcclusion;  
    }  

    get getPitch() : Int {  
        return this.pitch;  
    }  

    set setPitch(pitch : Int) {  
        this.pitch = pitch;  
    }  

    get getYaw() : Int {  
        return this.yaw;  
    }  

    set setYaw(yaw : Int) {  
        this.yaw = yaw;  
    }  

    get getRoll() : Int {  
        return this.roll;  
    }  

    set setRoll(roll : Int) {  
        this.roll = roll;  
    }  
    /**  
         * 解析json文件的内容  
         * @param jsonObject  json数据  
         */  
    public parseFromJSONObject(jsonObject : JSONObject) : void {  
        this.minIllum = jsonObject.optDouble("minIllum").toFloat();  
        this.maxIllum = jsonObject.optDouble("maxIllum").toFloat();  
        this.blur = jsonObject.optDouble("blur").toFloat();  
        this.leftEyeOcclusion = jsonObject.optDouble("leftEyeOcclusion").toFloat();  
        this.rightEyeOcclusion = jsonObject.optDouble("rightEyeOcclusion").toFloat();  
        this.noseOcclusion = jsonObject.optDouble("noseOcclusion").toFloat();  
        this.mouseOcclusion = jsonObject.optDouble("mouseOcclusion").toFloat();  
        this.leftContourOcclusion = jsonObject.optDouble("leftContourOcclusion").toFloat();  
        this.rightContourOcclusion = jsonObject.optDouble("rightContourOcclusion").toFloat();  
        this.chinOcclusion = jsonObject.optDouble("chinOcclusion").toFloat();  
        this.pitch = jsonObject.optInt("pitch");  
        this.yaw = jsonObject.optInt("yaw");  
        this.roll = jsonObject.optInt("roll");  
    }  
}

get getMinIllum() : Float {
return this.minIllum;
}
提示什么未初始化

这种要怎么改啊

2023-06-25 10:35 负责人:无 分享
已邀请:

要回复问题请先登录注册