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

Reproduce detection of fluorescent lights from legacy capture interface into new capture interface (this then offers to calibrate, with an alert along the top!) #885

Closed
Tracked by #801
Georjane opened this issue Feb 8, 2022 · 3 comments · Fixed by #886
Assignees

Comments

@Georjane
Copy link
Collaborator

Georjane commented Feb 8, 2022

@jywarren and @Tlazypanda
I think I will be picking up this issue next from publiclab/spectral-workbench.js#265

thank you

@jywarren
Copy link
Member

jywarren commented Feb 8, 2022

So we found that is_cfl maybe is not even used??? Because the line of code actually run is observe_contrast() which checks the average amount of "steepness" or contrast in the data every half second. I bet this run faster and more reliably than actually checking if the data matched a fluorescent light pattern, which is interesting:

https://github.com/publiclab/spectral-workbench.js/blob/4e3c9f65d51d3dacd4a831ab2aebf39181620db8/examples/capture/api.js#L41-L64

So, that should be something we can integrate here!

@jywarren
Copy link
Member

jywarren commented Feb 8, 2022

Here's where it's used in the legacy code:

jQuery(document).ready(function() {
$W.observe_contrast(
false,
function() {
$('#cfl-detect i').css('color','red');
},
function() {
$('#cfl-detect i').css('color','white');
}
)
})

@jywarren
Copy link
Member

jywarren commented Feb 8, 2022

And here it is in the new capture code. Is it actually running?

$W.observe_contrast(
false,
function() {
$('#cfl-detect i').css('color','red');
},
function() {
$('#cfl-detect i').css('color','white');
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants