Include pre event count in min estimated ram use

This commit is contained in:
Isaac Connor 2021-05-08 15:47:29 -04:00
parent d3e91da514
commit bc11e6a95b
1 changed files with 2 additions and 1 deletions

View File

@ -140,7 +140,7 @@ function initPage() {
form.submit();
};
});
document.querySelectorAll('input[name="newMonitor[ImageBufferCount]"],input[name="newMonitor[MaxImageBufferCount]"],input[name="newMonitor[Width]"],input[name="newMonitor[Height]"]').forEach(function(el) {
document.querySelectorAll('input[name="newMonitor[ImageBufferCount]"],input[name="newMonitor[MaxImageBufferCount]"],input[name="newMonitor[Width]"],input[name="newMonitor[Height]"],input[name="newMonitor[PreEventCount]"]').forEach(function(el) {
el.oninput = window['update_estimated_ram_use'].bind(el);
});
update_estimated_ram_use();
@ -317,6 +317,7 @@ function update_estimated_ram_use() {
var colours = document.querySelectorAll('select[name="newMonitor[Colours]"]')[0].value;
var min_buffer_count = parseInt(document.querySelectorAll('input[name="newMonitor[ImageBufferCount]"]')[0].value);
min_buffer_count += parseInt(document.querySelectorAll('input[name="newMonitor[PreEventCount]"]')[0].value);
var min_buffer_size = min_buffer_count * width * height * colours;
document.getElementById('estimated_ram_use').innerHTML = 'Min: ' + human_filesize(min_buffer_size);