|
@ -89,11 +89,12 @@ |
|
|
function ivHead(obj) { |
|
|
function ivHead(obj) { |
|
|
if(0 != obj.status) { // only add totals if inverter is online |
|
|
if(0 != obj.status) { // only add totals if inverter is online |
|
|
total[0] += obj.ch[0][2]; // P_AC |
|
|
total[0] += obj.ch[0][2]; // P_AC |
|
|
total[1] += obj.ch[0][7]; // YieldDay |
|
|
|
|
|
total[2] += obj.ch[0][6]; // YieldTotal |
|
|
|
|
|
total[3] += obj.ch[0][8]; // P_DC |
|
|
total[3] += obj.ch[0][8]; // P_DC |
|
|
total[4] += obj.ch[0][10]; // Q_AC |
|
|
total[4] += obj.ch[0][10]; // Q_AC |
|
|
} |
|
|
} |
|
|
|
|
|
total[1] += obj.ch[0][7]; // YieldDay |
|
|
|
|
|
total[2] += obj.ch[0][6]; // YieldTotal |
|
|
|
|
|
|
|
|
var t = span(" °C"); |
|
|
var t = span(" °C"); |
|
|
var clh = (0 == obj.status) ? "iv-h-dis" : "iv-h"; |
|
|
var clh = (0 == obj.status) ? "iv-h-dis" : "iv-h"; |
|
|
var clbg = (0 == obj.status) ? "iv-bg-dis" : "iv-bg"; |
|
|
var clbg = (0 == obj.status) ? "iv-bg-dis" : "iv-bg"; |
|
@ -103,6 +104,9 @@ |
|
|
ml("div", {class: "row"}, [ |
|
|
ml("div", {class: "row"}, [ |
|
|
ml("div", {class: "col mx-2 mx-md-1"}, obj.name), |
|
|
ml("div", {class: "col mx-2 mx-md-1"}, obj.name), |
|
|
ml("div", {class: "col a-c"}, "Power limit " + ((obj.power_limit_read == 65535) ? "n/a" : (obj.power_limit_read + " %"))), |
|
|
ml("div", {class: "col a-c"}, "Power limit " + ((obj.power_limit_read == 65535) ? "n/a" : (obj.power_limit_read + " %"))), |
|
|
|
|
|
ml("div", {class: "col a-c"}, ml("span", { class: "pointer", onclick: function() { |
|
|
|
|
|
getAjax("/api/inverter/alarm/" + obj.id, parseIvAlarm); |
|
|
|
|
|
}}, ("Alarms: " + obj.alarm_cnt))), |
|
|
ml("div", {class: "col a-r mx-2 mx-md-1"}, String(obj.ch[0][5]) + t.innerText) |
|
|
ml("div", {class: "col a-r mx-2 mx-md-1"}, String(obj.ch[0][5]) + t.innerText) |
|
|
]) |
|
|
]) |
|
|
), |
|
|
), |
|
@ -200,6 +204,7 @@ |
|
|
]) |
|
|
]) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var last = true; |
|
|
var last = true; |
|
|
for(var i = obj.id + 1; i < ivEn.length; i++) { |
|
|
for(var i = obj.id + 1; i < ivEn.length; i++) { |
|
|
if((i != ivEn.length) && ivEn[i]) { |
|
|
if((i != ivEn.length) && ivEn[i]) { |
|
@ -215,6 +220,32 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function parseIvAlarm(obj) { |
|
|
|
|
|
var html = []; |
|
|
|
|
|
html.push( |
|
|
|
|
|
ml("div", {class: "row"}, [ |
|
|
|
|
|
ml("div", {class: "col"}, ml("strong", {}, "String")), |
|
|
|
|
|
ml("div", {class: "col"}, ml("strong", {}, "ID")), |
|
|
|
|
|
ml("div", {class: "col"}, ml("strong", {}, "Start")), |
|
|
|
|
|
ml("div", {class: "col"}, ml("strong", {}, "End")) |
|
|
|
|
|
]) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
for(a of obj.alarm) { |
|
|
|
|
|
if(a.code != 0) { |
|
|
|
|
|
html.push( |
|
|
|
|
|
ml("div", {class: "row"}, [ |
|
|
|
|
|
ml("div", {class: "col mt-3"}, String(a.str)), |
|
|
|
|
|
ml("div", {class: "col mt-3"}, String(a.code)), |
|
|
|
|
|
ml("div", {class: "col mt-3"}, String(toIsoTimeStr(new Date(a.start * 1000)))), |
|
|
|
|
|
ml("div", {class: "col mt-3"}, String(toIsoTimeStr(new Date(a.end * 1000)))) |
|
|
|
|
|
]) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
modal("Alarms of inverter #" + obj.iv_id, ml("div", {}, html)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function parse(obj) { |
|
|
function parse(obj) { |
|
|
if(null != obj) { |
|
|
if(null != obj) { |
|
|
parseGeneric(obj["generic"]); |
|
|
parseGeneric(obj["generic"]); |
|
|