// Path: library/src/main/java/com/linheimx/app/library/utils/Utils.java
// public class Utils {
// 
//     public static float dp2px(float dp) {
//         return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
//     }
//     
//     public static float textWidth(Paint paint, String txt) {
//         return paint.measureText(txt);
//     }
// 
//     private static Paint.FontMetrics mFontMetrics = new Paint.FontMetrics();
// 
//     public static int textHeightAsc(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent));
//     }
// 
//     public static int textHeight(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent) + Math.abs(mFontMetrics.descent));
//     }
// 
//     /**
//      * 将杂乱的数字变成里程碑。
//      *
//      * @param number
//      * @return
//      */
//     public static float roundNumber2One(double number) {
//         if (Double.isInfinite(number) ||
//                 Double.isNaN(number) ||
//                 number == 0.0)
//             return 0;
// 
//         final float d = (float) Math.ceil((float) Math.log10(number < 0 ? -number : number));//有几位？
//         final int pw = 1 - (int) d;
//         final float magnitude = (float) Math.pow(10, pw);
//         final long shifted = Math.round(number * magnitude);
//         return shifted / magnitude;
//     }
// 
// 
// }


import android.graphics.Color;
import com.linheimx.app.library.utils.Utils;
package com.linheimx.app.library.model;



/**
 * Created by lijian on 2017/2/18.
 */

public class WarnLine {

    public static final float D_WARN_WIDTH = 2;
    public static final float D_WARN_TXT_SIZE = 15;

    int warnColor = Color.RED;
    float warnLineWidth;
    float txtSize ;

    boolean enable = true;
    double value;//预警数值


    public WarnLine(double value) {
        this.value = value;

// Path: library/src/main/java/com/linheimx/app/library/utils/Utils.java
// public class Utils {
// 
//     public static float dp2px(float dp) {
//         return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
//     }
//     
//     public static float textWidth(Paint paint, String txt) {
//         return paint.measureText(txt);
//     }
// 
//     private static Paint.FontMetrics mFontMetrics = new Paint.FontMetrics();
// 
//     public static int textHeightAsc(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent));
//     }
// 
//     public static int textHeight(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent) + Math.abs(mFontMetrics.descent));
//     }
// 
//     /**
//      * 将杂乱的数字变成里程碑。
//      *
//      * @param number
//      * @return
//      */
//     public static float roundNumber2One(double number) {
//         if (Double.isInfinite(number) ||
//                 Double.isNaN(number) ||
//                 number == 0.0)
//             return 0;
// 
//         final float d = (float) Math.ceil((float) Math.log10(number < 0 ? -number : number));//有几位？
//         final int pw = 1 - (int) d;
//         final float magnitude = (float) Math.pow(10, pw);
//         final long shifted = Math.round(number * magnitude);
//         return shifted / magnitude;
//     }
// 
// 
// }


// Path: library/src/main/java/com/linheimx/app/library/model/WarnLine.java
import android.graphics.Color;
import com.linheimx.app.library.utils.Utils;

package com.linheimx.app.library.model;



/**
 * Created by lijian on 2017/2/18.
 */

public class WarnLine {

    public static final float D_WARN_WIDTH = 2;
    public static final float D_WARN_TXT_SIZE = 15;

    int warnColor = Color.RED;
    float warnLineWidth;
    float txtSize ;

    boolean enable = true;
    double value;//预警数值


    public WarnLine(double value) {
        this.value = value;

        warnLineWidth = Utils.dp2px(D_WARN_WIDTH);