Changeset 35193 for gs3-extensions/mars-src/trunk
- Timestamp:
- 2021-05-30T16:47:16+12:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/mars-src/trunk/src/wavesurfer-renderer/drawer.spectrummulticanvas.js
r34810 r35193 300 300 createAVProgressTimelineData(arousal_vals,valence_vals, my) 301 301 { 302 console.log("**** createAVProgressTimelineData");302 //console.log("**** createAVProgressTimelineData"); 303 303 var canvas_width = this.canvases[0].wave.width; 304 console.log("canvas width = " + canvas_width); 305 304 //console.log("**** canvas width = " + canvas_width); 305 306 //console.log(" arousal_val = " + JSON.stringify(arousal_vals)); 307 //console.log("this.arousal_val = " + JSON.stringify(this.arousal_vals)); 308 306 309 //this.arousal_vals = arousal_vals; 307 310 //this.valence_vals = valence_vals; … … 310 313 this.valence_vals.unshift(0); 311 314 312 this.norm_arousal_vals = this.normaliseAVVals( arousal_vals);313 this.norm_valence_vals = this.normaliseAVVals( valence_vals);315 this.norm_arousal_vals = this.normaliseAVVals(this.arousal_vals); 316 this.norm_valence_vals = this.normaliseAVVals(this.valence_vals); 314 317 315 318 const time_slice = 6; // 6 secs … … 319 322 this.timeline_steps.unshift(0); 320 323 321 var num_vals = arousal_vals.length;324 var num_vals = this.arousal_vals.length; 322 325 var t = time_slice; 323 326 var n = 1; … … 329 332 } 330 333 const total_duration = t; 331 console.log("*** total duration = " + total_duration); 334 //console.log("*** n = " + n); 335 //console.log("*** total duration = " + total_duration); 332 336 333 337 this.timeline_steps[n] = total_duration; 338 this.arousal_vals[n] = 0; 339 this.valence_vals[n] = 0; 334 340 this.norm_arousal_vals[n] = 0; 335 341 this.norm_valence_vals[n] = 0; … … 367 373 //console.log("*** start_ts = " + start_ts + ", end_ts = " + end_ts + " (ts_diff = " + ts_diff +")"); 368 374 //console.log("*** start_arousal = " + start_arousal + ", end_arousal = " + end_arousal); 375 //console.log("*** norm_start_arousal = " + norm_start_arousal + ", norm_end_arousal = " + norm_end_arousal); 369 376 370 377 for (var ts=start_ts; ts<end_ts; ts++) { … … 401 408 //console.log("*** that = "); 402 409 //console.log(that); 403 this.arousal_vals = data.arousal; 404 this.valence_vals = data.valence; 405 410 //this.arousal_vals = data.arousal.slice(); // **** slice() does array copy 411 //this.valence_vals = data.valence.slice(); // **** slice() does array copy 412 413 // The following two lines use map() to both: 414 // convert the JSON string vals to numbers 415 // generate a fresh array of values (rather than a shared ref) which is what we want 416 this.arousal_vals = data.arousal.map((v) => Number(v)); 417 this.valence_vals = data.valence.map((v) => Number(v)); 418 406 419 //this.createAVProgressTimelineData(arousal_vals, valence_vals, this); // **** need to pass in 'this' ?? 407 420 }); … … 732 745 733 746 if (arousal_val_3dp >= 0) { 734 arousal_val_3dp = " " + arousal_val_3d ;747 arousal_val_3dp = " " + arousal_val_3dp; 735 748 } 736 749 737 750 if (valence_val_3dp >= 0) { 738 valence_val_3dp = " " + valence_val_3d ;751 valence_val_3dp = " " + valence_val_3dp; 739 752 } 740 753 741 754 if ($('#arousal-val').length) { 742 $('#arousal-val'). text(arousal_val_3dp);755 $('#arousal-val').html(arousal_val_3dp); 743 756 } 744 757 if ($('#valence-val').length) { 745 $('#valence-val'). text(valence_val_3dp);758 $('#valence-val').html(valence_val_3dp); 746 759 } 747 760
Note:
See TracChangeset
for help on using the changeset viewer.