mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-11 07:56:39 +02:00
Patch no_eeprom_pl
This commit is contained in:
parent
f53933b473
commit
7c7a7d25b8
8 changed files with 25 additions and 92 deletions
|
@ -33,6 +33,18 @@
|
|||
<input type="button" value="Turn Off" class="btn" id="turnoff"/>
|
||||
<input type="button" value="Turn On" class="btn" id="turnon"/>
|
||||
<br/>
|
||||
<label>Send Power Limit:</label>
|
||||
<input type="text" class="text" name="pwrlimval" maxlength="4" size="20%"/>
|
||||
<label></label>
|
||||
<select name="pwrlimcntrl" id="pwrlimcntrl">
|
||||
<option value="65535">select the unit and persistence</option>
|
||||
<option value="0">absolute in Watt non persistent</option>
|
||||
<option value="1">relativ in percent non persistent</option>
|
||||
<option value="256">absolute in Watt persistent</option>
|
||||
<option value="257">relativ in percent persistent</option>
|
||||
</select>
|
||||
<input type="button" value="Send PL" class="btn" id="sendpwrlim"/>
|
||||
<br/>
|
||||
Ctrl result: <span id="result">n/a</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -161,7 +173,7 @@
|
|||
obj.inverter = get_selected_iv();
|
||||
obj.cmd = 11;
|
||||
obj.tx_request = 81;
|
||||
obj.payload = [2000, 1];
|
||||
obj.payload = [100, 1];
|
||||
getAjax("/api/ctrl", ctrlCb, "POST", JSON.stringify(obj));
|
||||
});
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
|
||||
document.getElementsByName("btnAdd")[0].addEventListener("click", function() {
|
||||
if(highestId < (maxInv-1))
|
||||
ivHtml(JSON.parse('{"name":"","serial":"","channels":4,"ch_max_power":[0,0,0,0],"ch_name":["","","",""],"power_limit":1500,"power_limit_option":65535}'), highestId + 1);
|
||||
ivHtml(JSON.parse('{"name":"","serial":"","channels":4,"ch_max_power":[0,0,0,0],"ch_name":["","","",""]}'), highestId + 1);
|
||||
});
|
||||
|
||||
function ivHtml(obj, id) {
|
||||
|
@ -163,20 +163,11 @@
|
|||
}
|
||||
});
|
||||
|
||||
for(var i of [["Name", "name", "Name*", 32], ["ActivePowerLimit", "power_limit", "Active Power Limit", 5]]) {
|
||||
for(var i of [["Name", "name", "Name*", 32]]) { // so richtig?
|
||||
iv.appendChild(lbl(id + i[0], i[2]));
|
||||
iv.appendChild(inp(id + i[0], obj[i[1]], i[3]));
|
||||
}
|
||||
|
||||
iv.appendChild(lbl(id + "PowerLimitControl", "Active Power Limit Control Type"));
|
||||
iv.appendChild(sel(id + "PowerLimitControl", [
|
||||
[65535, "no power limit"],
|
||||
[0, "absolute in Watt non persistent"],
|
||||
[1, "absolute in Watt persistent"],
|
||||
[256, "relativ in percent non persistent"],
|
||||
[257, "relativ in percent persistent"]
|
||||
], obj.power_limit_option));
|
||||
|
||||
for(var j of [["ModPwr", "ch_max_power", "Max Module Power (Wp)", 4], ["ModName", "ch_name", "Module Name", 16]]) {
|
||||
var cl = (re.test(obj["serial"])) ? null : ["hide"];
|
||||
iv.appendChild(lbl(null, j[2], cl, "lbl" + id + j[0]));
|
||||
|
|
|
@ -39,8 +39,7 @@
|
|||
var limit = iv["power_limit_read"] + "%";
|
||||
if(limit == "65535%")
|
||||
limit = "n/a";
|
||||
var ctrl = (iv["power_limit_active"]) ? "" : " (not controlled)";
|
||||
ch0.appendChild(span(iv["name"] + " Limit " + limit + ctrl + " | last Alarm: " + iv["last_alarm"], ["head"]));
|
||||
ch0.appendChild(span(iv["name"] + " Limit " + limit + " | last Alarm: " + iv["last_alarm"], ["head"]));
|
||||
|
||||
for(var j = 0; j < root.ch0_fld_names.length; j++) {
|
||||
var val = Math.round(iv["ch"][0][j] * 100) / 100;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue