function sineInput(waveformData) {
                this.type = waveformData.type;
                this.amplitude = parseInt(waveformData.amplitude); // GS
                this.period = parseFloat(waveformData.period) * 60 * 1000; // ms
                this.phase = parseFloat(waveformData.phase) * 60 * 1000; // ms
                this.offset = parseInt(waveformData.offset); // GS
                this.channel = parseInt(waveformData.wavelengthIndex);
                //Check if offset+amplitude doesn't exceed bounds
                if (this.offset + Math.abs(this.amplitude) > plate.maxGSValue || this.offset - Math.abs(this.amplitude) < 0) {
                    console.log("ERROR sine  function exceeds bounds");
                    // TO DO: deal with this (#errors)
                }
                //returns the waveform associated with this input
                this.generateWaveforms = function () {
                    var waveforms = [];
                    (function (amp, phase, period, offset) {
                        waveforms.push(function (time) {
                            return Math.round(amp * Math.sin(2 * Math.PI * (time - phase) / period) + offset)
                        });
                    })(this.amplitude, this.phase, this.period, this.offset);
                    return waveforms;
                }
            }
//contains the inputs associated a sine input in the webform
contains the inputs associated a sine input in the webform
contains the inputs associated a sine input in the webform
function sineInput(waveformData) {
                this.type = waveformData.type;
                this.amplitude = parseInt(waveformData.amplitude); 
                this.period = parseFloat(waveformData.period) * 60 * 1000; 
                this.phase = parseFloat(waveformData.phase) * 60 * 1000; 
                this.offset = parseInt(waveformData.offset); 
                this.channel = parseInt(waveformData.wavelengthIndex);
                if (this.offset + Math.abs(this.amplitude) > plate.maxGSValue || this.offset - Math.abs(this.amplitude) < 0) {
                    console.log("ERROR sine  function exceeds bounds");
                }
                this.generateWaveforms = function () {
                    var waveforms = [];
                    (function (amp, phase, period, offset) {
                        waveforms.push(function (time) {
                            return Math.round(amp * Math.sin(2 * Math.PI * (time - phase) / period) + offset)
                        });
                    })(this.amplitude, this.phase, this.period, this.offset);
                    return waveforms;
                }
            }
function sineInput ( waveformData ) { this . type = waveformData . type ; this . amplitude = parseInt ( waveformData . amplitude ) ; this . period = parseFloat ( waveformData . period ) * 60 * 1000 ; this . phase = parseFloat ( waveformData . phase ) * 60 * 1000 ; this . offset = parseInt ( waveformData . offset ) ; this . channel = parseInt ( waveformData . wavelengthIndex ) ; if ( this . offset + Math . abs ( this . amplitude ) > plate . maxGSValue || this . offset - Math . abs ( this . amplitude ) < 0 ) { console . log ( "ERROR sine  function exceeds bounds" ) ; } this . generateWaveforms = function ( ) { var waveforms = [ ] ; ( function ( amp , phase , period , offset ) { waveforms . push ( function ( time ) { return Math . round ( amp * Math . sin ( 2 * Math . PI * ( time - phase ) / period ) + offset ) } ) ; } ) ( this . amplitude , this . phase , this . period , this . offset ) ; return waveforms ; } }
contains the inputs associated a sine input in the webform
contains the inputs associated a sine input in the webform
// GS // ms // ms // GS //Check if offset+amplitude doesn't exceed bounds // TO DO: deal with this (#errors) //returns the waveform associated with this input