package com.gyee.runeconomy.model;


import java.io.Serializable;

public class TemperatureTagInfo extends TagInfo {
    /**
     * 最大正常运行值
     */
    private double reasonablemaxval;
    /**
     * 最大允许值
     */
    private double maxval;
    /**
     * 停机时最大值
     */
    private double stopMaxValue;

    public double getStopMaxValue() {
        return stopMaxValue;
    }

    public void setStopMaxValue(double stopMaxValue) {
        this.stopMaxValue = stopMaxValue;
    }

    public void setReasonablemaxval(double reasonablemaxval) {
        this.reasonablemaxval = reasonablemaxval;
    }

    public void setMaxval(double maxval) {
        this.maxval = maxval;
    }

    public TemperatureStatus getStatus() {
        if (this.getValue() >= 2000) {
            return TemperatureStatus.BadPoint;
        }
        if (maxval != -1 && this.getValue() >= maxval) {
            return TemperatureStatus.OverLimit;
        }
        if (reasonablemaxval != -1 && this.getValue() >= reasonablemaxval) {
            return TemperatureStatus.CrossingLimit;
        }
        return TemperatureStatus.Normal;
    }
}