Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive slider improvements #166

Merged
merged 7 commits into from
Sep 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ static esp_err_t cmd_handler(httpd_req_t *req){
size_t buf_len;
char variable[32] = {0,};
char value[32] = {0,};

flashLED(75);

buf_len = httpd_req_get_url_query_len(req) + 1;
Expand Down
21 changes: 21 additions & 0 deletions index_other.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ const uint8_t index_simple_html[] = R"=====(<!doctype html>
}
}

var rangeUpdateScheduled = false
var latestRangeConfig

function updateRangeConfig (el) {
latestRangeConfig = el
if (!rangeUpdateScheduled) {
rangeUpdateScheduled = true;
setTimeout(function(){
rangeUpdateScheduled = false
updateConfig(latestRangeConfig)
}, 150);
}
}

function updateConfig (el) {
let value
switch (el.type) {
Expand Down Expand Up @@ -259,6 +273,13 @@ const uint8_t index_simple_html[] = R"=====(<!doctype html>
el.onchange = () => updateConfig(el)
})

// Update range sliders as they are being moved
document
.querySelectorAll('input[type="range"]')
.forEach(el => {
el.oninput = () => updateRangeConfig(el)
})

// Custom actions
// Detection and framesize
rotate.onchange = () => {
Expand Down
21 changes: 21 additions & 0 deletions index_ov2640.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,20 @@ const uint8_t index_ov2640_html[] = R"=====(<!doctype html>
}
}

var rangeUpdateScheduled = false
var latestRangeConfig

function updateRangeConfig (el) {
latestRangeConfig = el
if (!rangeUpdateScheduled) {
rangeUpdateScheduled = true;
setTimeout(function(){
rangeUpdateScheduled = false
updateConfig(latestRangeConfig)
}, 150);
}
}

function updateConfig (el) {
let value
switch (el.type) {
Expand Down Expand Up @@ -499,6 +513,13 @@ const uint8_t index_ov2640_html[] = R"=====(<!doctype html>
el.onchange = () => updateConfig(el)
})

// Update range sliders as they are being moved
document
.querySelectorAll('input[type="range"]')
.forEach(el => {
el.oninput = () => updateRangeConfig(el)
})

// Custom actions
// Gain
const agc = document.getElementById('agc')
Expand Down
21 changes: 21 additions & 0 deletions index_ov3660.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,20 @@ const uint8_t index_ov3660_html[] = R"=====(<!doctype html>
}
}

var rangeUpdateScheduled = false
var latestRangeConfig

function updateRangeConfig (el) {
latestRangeConfig = el
if (!rangeUpdateScheduled) {
rangeUpdateScheduled = true;
setTimeout(function(){
rangeUpdateScheduled = false
updateConfig(latestRangeConfig)
}, 150);
}
}

function updateConfig (el) {
let value
switch (el.type) {
Expand Down Expand Up @@ -511,6 +525,13 @@ const uint8_t index_ov3660_html[] = R"=====(<!doctype html>
el.onchange = () => updateConfig(el)
})

// Update range sliders as they are being moved
document
.querySelectorAll('input[type="range"]')
.forEach(el => {
el.oninput = () => updateRangeConfig(el)
})

// Custom actions
// Gain
const agc = document.getElementById('agc')
Expand Down