longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// function Title() {
//     this.min = 0;                //最小值
//     this.max = 0;                //最大值
//     this.avg = 0;                //平均值
//     this.ahight = 0;            //高告警阀值
//     this.alow = 0;            //低告警阀值
//     this.clow = 0;            //次低更换阀值
//     this.lc = 0;                //低告警单体数
//     this.lp = 0;                //低告警百分比
// }
 
function createTitle() {
    var obj = new Object();
    obj.min = 0;
    obj.max = 0;
    obj.avg = 0;
    obj.ahight = 0;
    obj.alow = 0;
    obj.clow = 0;
    obj.lc = 0;
    obj.lp = 0;
    return obj;
}
var maxText = '最大值';        //最大值
var minText = '最小值';        //最小值
var avgText = '平均值';         //平均值
var lowText = '落后值';        //落后值
var lcText = '落后数量';        //落后数量
var lpText = '落后数量比';     //落后数量比
function Title(min, max, avg, ahight, alow, clow, lc, lp) {
    this.min = min;
    this.max = max;
    this.avg = avg;
    this.ahight = ahight;
    this.alow = alow;
    this.clow = clow;
    this.lc = lc;
    this.lp = lp;
}
 
Title.prototype.setMin = function (min) {
    this.min = min;
};
 
Title.prototype.getMin = function () {
    return this.min;
};
 
Title.prototype.setMax = function (max) {
    this.max = max;
};
 
Title.prototype.getMax = function () {
    return this.max;
};
 
Title.prototype.setAvg = function (avg) {
    this.avg = avg;
};
 
Title.prototype.getAvg = function () {
    return this.avg;
};
 
Title.prototype.setAhight = function (ahight) {
    this.ahight = ahight;
};
 
Title.prototype.getAhight = function () {
    return this.ahight;
};
 
Title.prototype.setAlow = function (alow) {
    this.alow = alow;
};
 
Title.prototype.getAlow = function () {
    return this.alow;
};
 
Title.prototype.setClow = function (clow) {
    this.clow = clow;
};
 
Title.prototype.getClow = function () {
    return this.clow;
};
 
Title.prototype.setLc = function (lc) {
    this.lc = lc;
};
 
Title.prototype.getLc = function () {
    return this.lc;
};
 
Title.prototype.setLp = function (lp) {
    this.lp = lp;
};
 
Title.prototype.getLp = function () {
    return lp;
};
 
Title.prototype.getAllTile = function (lname) {
    //alert(this.avg);
    var title = "";
    if ("Voltage" == lname) {
        //title=maxText+"="+(parseFloat(this.max).toFixed(3))+"V;"+minText+"="+(parseFloat(this.min).toFixed(3))+"V;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"V;"+lowText+"="+this.alow+"V;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title = maxText + "=" + (parseFloat(this.max).toFixed(3)) + "V;" + minText + "=" + (parseFloat(this.min).toFixed(3)) + "V;" + avgText + "=" + (parseFloat(this.avg).toFixed(3)) + "V";
    } else if ("Resistance" == lname) {
        //title=maxText+"="+(parseFloat(this.max).toFixed(3))+"mΩ;"+minText+"="+(parseFloat(this.min).toFixed(3))+"mΩ;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"mΩ;"+lowText+"="+this.alow+"mΩ;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title = maxText + "=" + (parseFloat(this.max).toFixed(3)) + "mΩ;" + minText + "=" + (parseFloat(this.min).toFixed(3)) + "mΩ;" + avgText + "=" + (parseFloat(this.avg).toFixed(3)) + "mΩ";
    } else if ("Temperature" == lname) {
        //title=maxText+"="+(parseFloat(this.max).toFixed(1))+"℃;"+minText+"="+(parseFloat(this.min).toFixed(1))+"℃;"+avgText+"="+(parseFloat(this.avg).toFixed(1))+"℃;"+lowText+"="+this.alow+"℃;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title = maxText + "=" + (parseFloat(this.max).toFixed(1)) + "℃;" + minText + "=" + (parseFloat(this.min).toFixed(1)) + "℃;" + avgText + "=" + (parseFloat(this.avg).toFixed(1)) + "℃";
    } else if ("Conductance" == lname) {
        //title=maxText+"="+(parseFloat(this.max).toFixed(0))+";"+minText+"="+(parseFloat(this.min).toFixed(0))+";"+avgText+"="+(parseFloat(this.avg).toFixed(0))+";"+lowText+"="+this.alow+";"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title = maxText + "=" + (parseFloat(this.max).toFixed(0)) + ";" + minText + "=" + (parseFloat(this.min).toFixed(0)) + ";" + avgText + "=" + (parseFloat(this.avg).toFixed(0));
    } else if ("MonJHCurr" == lname) {
        //title=maxText+"="+(parseFloat(this.max).toFixed(3))+"V;"+minText+"="+(parseFloat(this.min).toFixed(3))+"V;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"V;"+lowText+"="+this.alow+"V;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title = maxText + "=" + (parseFloat(this.max).toFixed(3)) + "A;" + minText + "=" + (parseFloat(this.min).toFixed(3)) + "A;" + avgText + "=" + (parseFloat(this.avg).toFixed(3)) + "A";
    } else if ("Serpercent" == lname || "Percent_total_capacity" == lname) {
        //title=maxText+"="+this.max+"%;"+minText+"="+this.min+"%;"+avgText+"="+this.avg+"%;"+lowText+"="+this.alow+"%;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title = maxText + "=" + this.max + "%;" + minText + "=" + this.min + "%;" + avgText + "=" + this.avg + "%";
    } else if ("Actual_capacity" == lname || "Residual_capacity" == lname) {
        //title=maxText+"="+(parseFloat(this.max).toFixed(0))+"AH;"+minText+"="+(parseFloat(this.min).toFixed(0))+"AH;"+avgText+"="+(parseFloat(this.avg).toFixed(0))+"AH;"+lowText+"="+this.alow+"AH;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title = maxText + "=" + (parseFloat(this.max).toFixed(0)) + "AH;" + minText + "=" + (parseFloat(this.min).toFixed(0)) + "AH;" + avgText + "=" + (parseFloat(this.avg).toFixed(0)) + "AH";
    }
    return title;
};
 
export default Title;