function stepInput(waveformData) {
                this.type = waveformData.type;
                this.startInts = JSON.parse("[" + waveformData.startInts + "]");
                this.startInts = numeric.round(this.startInts); // Make sure all amps are whole numbers
                this.finalInts = JSON.parse("[" + waveformData.finalInts + "]");
                this.finalInts = numeric.round(this.finalInts);
                this.stepTimes = JSON.parse("[" + waveformData.stepTimes + "]");
                for (var i=0; i<this.stepTimes.length; i++) {
                    this.stepTimes[i] = Math.floor(parseFloat(this.stepTimes[i]) * 60 * 1000);
                }
                this.channel = parseInt(waveformData.wavelengthIndex);
                //Gives the number of different waveforms that this input will create
                this.getNumWaveforms = function () {
                    return this.startInts.length;
                }
                //returns a list of waveforms associated with this input
                this.generateWaveforms = function () {
                    var waveforms = [];
                    for (var i = 0; i < this.startInts.length; i++) {
                        (function (amp, offset, stepTime) {
                            waveforms.push(function (time) {
                                if (time < stepTime) {
                                    return offset;
                                } else {
                                    return offset + amp
                                }
                            });
                        })(this.finalInts[i]-this.startInts[i], this.startInts[i], this.stepTimes[i]);
                    }
                    return waveforms;
                }
            }
//contains the inputs associated a step input in the webform
contains the inputs associated a step input in the webform
contains the inputs associated a step input in the webform
function stepInput(waveformData) {
                this.type = waveformData.type;
                this.startInts = JSON.parse("[" + waveformData.startInts + "]");
                this.startInts = numeric.round(this.startInts); 
                this.finalInts = JSON.parse("[" + waveformData.finalInts + "]");
                this.finalInts = numeric.round(this.finalInts);
                this.stepTimes = JSON.parse("[" + waveformData.stepTimes + "]");
                for (var i=0; i<this.stepTimes.length; i++) {
                    this.stepTimes[i] = Math.floor(parseFloat(this.stepTimes[i]) * 60 * 1000);
                }
                this.channel = parseInt(waveformData.wavelengthIndex);
                this.getNumWaveforms = function () {
                    return this.startInts.length;
                }
                this.generateWaveforms = function () {
                    var waveforms = [];
                    for (var i = 0; i < this.startInts.length; i++) {
                        (function (amp, offset, stepTime) {
                            waveforms.push(function (time) {
                                if (time < stepTime) {
                                    return offset;
                                } else {
                                    return offset + amp
                                }
                            });
                        })(this.finalInts[i]-this.startInts[i], this.startInts[i], this.stepTimes[i]);
                    }
                    return waveforms;
                }
            }
function stepInput ( waveformData ) { this . type = waveformData . type ; this . startInts = JSON . parse ( "[" + waveformData . startInts + "]" ) ; this . startInts = numeric . round ( this . startInts ) ; this . finalInts = JSON . parse ( "[" + waveformData . finalInts + "]" ) ; this . finalInts = numeric . round ( this . finalInts ) ; this . stepTimes = JSON . parse ( "[" + waveformData . stepTimes + "]" ) ; for ( var i = 0 ; i < this . stepTimes . length ; i ++ ) { this . stepTimes [ i ] = Math . floor ( parseFloat ( this . stepTimes [ i ] ) * 60 * 1000 ) ; } this . channel = parseInt ( waveformData . wavelengthIndex ) ; this . getNumWaveforms = function ( ) { return this . startInts . length ; } this . generateWaveforms = function ( ) { var waveforms = [ ] ; for ( var i = 0 ; i < this . startInts . length ; i ++ ) { ( function ( amp , offset , stepTime ) { waveforms . push ( function ( time ) { if ( time < stepTime ) { return offset ; } else { return offset + amp } } ) ; } ) ( this . finalInts [ i ] - this . startInts [ i ] , this . startInts [ i ] , this . stepTimes [ i ] ) ; } return waveforms ; } }
contains the inputs associated a step input in the webform
contains the inputs associated a step input in the webform
// Make sure all amps are whole numbers //Gives the number of different waveforms that this input will create //returns a list of waveforms associated with this input