Skip to content
Snippets Groups Projects
Commit 93fbac4a authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

add delay time

parent db17976e
No related branches found
No related tags found
No related merge requests found
...@@ -29,17 +29,18 @@ var init = function() { ...@@ -29,17 +29,18 @@ var init = function() {
// UI settings // UI settings
// //
mod.threshold.value = 0.025 mod.threshold.value = 0.025
mod.time.value = 15 mod.latency.value = 15
mod.delay.value = 1
mod.dpi = 100 mod.dpi = 100
// //
// open window for last image // open window for last image
// //
open_window() open_window()
// //
// trigger image after initial delay // trigger image after latency (for start-up)
// //
setTimeout(outputs.trigger.event, setTimeout(outputs.trigger.event,
parseFloat(mod.time.value)*1000) parseFloat(mod.latency.value)*1000)
} }
// //
// inputs // inputs
...@@ -118,7 +119,16 @@ var interface = function(div){ ...@@ -118,7 +119,16 @@ var interface = function(div){
input.type = 'text' input.type = 'text'
input.size = 6 input.size = 6
info.appendChild(input) info.appendChild(input)
mod.time = input mod.latency = input
info.appendChild(document.createTextNode(' (s)'))
div.appendChild(info)
info.appendChild(document.createElement('br'))
info.appendChild(document.createTextNode('delay: '))
var input = document.createElement('input')
input.type = 'text'
input.size = 6
info.appendChild(input)
mod.delay = input
info.appendChild(document.createTextNode(' (s)')) info.appendChild(document.createTextNode(' (s)'))
div.appendChild(info) div.appendChild(info)
} }
...@@ -175,16 +185,17 @@ function compare_images() { ...@@ -175,16 +185,17 @@ function compare_images() {
outputs.imageInfo.event(obj) outputs.imageInfo.event(obj)
outputs.image.event() outputs.image.event()
// //
// trigger next image after delay // trigger next image after latency
// //
setTimeout(outputs.trigger.event, setTimeout(outputs.trigger.event,
parseFloat(mod.time.value)*1000) parseFloat(mod.latency.value)*1000)
} }
else { else {
// //
// no, trigger next image immediately // no, trigger next image after delay
// //
outputs.trigger.event() setTimeout(outputs.trigger.event,
parseFloat(mod.delay.value)*1000)
} }
// //
// update canvas // update canvas
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment