Skip to content
This repository
Browse code

Merge branch 'master' of github.com:jywarren/spectral-workbench

  • Loading branch information...
commit 4e0259acf49e6248831efc1d2821fa77b4c2b029 2 parents 162720f + fbfa7b3
Jeffrey Warren authored October 27, 2012
5  webserver/app/views/capture/_configure.html.erb
@@ -24,9 +24,10 @@
24 24
 		
25 25
 		<p><i>This panel is under construction</i></p>
26 26
 
27  
-		<label for="samplerow-slider">Input slider:</label>
28  
-		<input type="range" name="samplerow-slider" id="samplerow-slider" value="240" min="0" max="480" onChange="$W.setSampleRows(parseInt($('#samplerow-slider').val()),parseInt($('#samplerow-slider').val())+40)"/>
  27
+		<label for="samplerow-slider">Sample row height (zero = top):</label>
  28
+		<input type="range" name="samplerow-slider" id="samplerow-slider" value="240" min="0" max="480" onChange="$W.setSampleRows(parseInt($('#samplerow-slider').val()),parseInt($('#samplerow-slider').val())+40);$('#heightIndicator')[0].style.height = parseInt(($('#samplerow-slider').val()/480)*280)+'px';"/>
29 29
 
  30
+		<div id="heightIndicator" style="position:absolute;z-index:999;opacity:0.4;background:black;height:120px;width:320px;"></div> 
30 31
 		<div id="webcam"></div> 
31 32
 		<a data-role="button" data-theme="a" href="#capture" data-panel="main">&laquo; Back</a>
32 33
 	</div>
12  webserver/public/javascripts/capture.js
@@ -55,6 +55,8 @@ $W = {
55 55
 		this.sample_height = this.sample_end_row - this.sample_start_row // how many pixels to sample
56 56
 		setInterval($W.alert_overexposure,3000)
57 57
 		$W.data = [{label: "webcam",data:[]}]
  58
+		$('video')[0].width = "320"
  59
+		$('video')[0].height = "280"
58 60
 	},
59 61
         success: function (stream) {
60 62
 		//console.log('success')
@@ -262,6 +264,16 @@ $W = {
262 264
 		$('#lat').val('')
263 265
 	},
264 266
 
  267
+	calibrate: function(id,x1,w1,x2,w2) {
  268
+		$.ajax({
  269
+			url: "/spectra/calibrate/"+$W.spectrum_id+"?x1="+x1+"&w1="+w1+"&x2="+x2+"&w2="+w2,
  270
+			type: "POST",
  271
+			success: function(result) {
  272
+				$W.notify('The spectrum with id '+id+' was calibrated successfully.')
  273
+			}
  274
+		})
  275
+	},
  276
+
265 277
 	match: function() {
266 278
 		cols = []
267 279
 		$.each($W.full_data,function(i,datum) {

0 notes on commit 4e0259a

Please sign in to comment.
Something went wrong with that request. Please try again.