Documentation ¶
Overview ¶
Package tmc provides an HTTP interface to test and measurement devices
Index ¶
- func AcquireWaveform(o Oscilloscope) http.HandlerFunc
- func GetAcqLength(o Oscilloscope) http.HandlerFunc
- func GetAcqMode(o Oscilloscope) http.HandlerFunc
- func GetBitDepth(o Oscilloscope) http.HandlerFunc
- func GetChannelLabel(d DAQ) http.HandlerFunc
- func GetFrequency(fg FunctionGenerator) http.HandlerFunc
- func GetFunction(fg FunctionGenerator) http.HandlerFunc
- func GetOffset(fg FunctionGenerator) http.HandlerFunc
- func GetOutput(fg FunctionGenerator) http.HandlerFunc
- func GetRecordingChannel(d DAQ) http.HandlerFunc
- func GetRecordingLength(d DAQ) http.HandlerFunc
- func GetSampleRate(m SampleRateManipulator) http.HandlerFunc
- func GetScale(o Oscilloscope) http.HandlerFunc
- func GetTimebase(o Oscilloscope) http.HandlerFunc
- func GetVoltage(fg FunctionGenerator) http.HandlerFunc
- func HTTPFunctionGenerator(fg FunctionGenerator, table generichttp.RouteTable)
- func Record(d DAQ) http.HandlerFunc
- func SetAcqLength(o Oscilloscope) http.HandlerFunc
- func SetAcqMode(o Oscilloscope) http.HandlerFunc
- func SetBitDepth(o Oscilloscope) http.HandlerFunc
- func SetChannelLabel(d DAQ) http.HandlerFunc
- func SetFrequency(fg FunctionGenerator) http.HandlerFunc
- func SetFunction(fg FunctionGenerator) http.HandlerFunc
- func SetOffset(fg FunctionGenerator) http.HandlerFunc
- func SetOutput(fg FunctionGenerator) http.HandlerFunc
- func SetOutputLoad(fg FunctionGenerator) http.HandlerFunc
- func SetRecordingChannel(d DAQ) http.HandlerFunc
- func SetRecordingLength(d DAQ) http.HandlerFunc
- func SetSampleRate(m SampleRateManipulator) http.HandlerFunc
- func SetScale(o Oscilloscope) http.HandlerFunc
- func SetTimebase(o Oscilloscope) http.HandlerFunc
- func SetVoltage(fg FunctionGenerator) http.HandlerFunc
- func SetWaveform(fg FunctionGenerator) http.HandlerFunc
- func StartAcq(o Oscilloscope) http.HandlerFunc
- type DAQ
- type FunctionGenerator
- type HTTPDAQ
- type HTTPFunctionGeneratorT
- type HTTPOscilloscope
- type Oscilloscope
- type SampleRateManipulator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquireWaveform ¶
func AcquireWaveform(o Oscilloscope) http.HandlerFunc
AcquireWaveform transfers the data from the oscilloscope to the user
func GetAcqLength ¶
func GetAcqLength(o Oscilloscope) http.HandlerFunc
GetAcqLength exposes an HTTP interface to GetAcqLength
func GetAcqMode ¶
func GetAcqMode(o Oscilloscope) http.HandlerFunc
GetAcqMode exposes an HTTP interface to GetAcqMode
func GetBitDepth ¶
func GetBitDepth(o Oscilloscope) http.HandlerFunc
GetBitDepth exposes an HTTP interface to GetBitDepth
func GetChannelLabel ¶
func GetChannelLabel(d DAQ) http.HandlerFunc
GetChannelLabel retrieves the label associated with a channel over HTTP
func GetFrequency ¶
func GetFrequency(fg FunctionGenerator) http.HandlerFunc
GetFrequency exposes an HTTP interface to the GetFrequency method
func GetFunction ¶
func GetFunction(fg FunctionGenerator) http.HandlerFunc
GetFunction exposes an HTTP interface to the GetFunction method
func GetOffset ¶
func GetOffset(fg FunctionGenerator) http.HandlerFunc
GetOffset exposes an HTTP interface to the GetOffset method
func GetOutput ¶
func GetOutput(fg FunctionGenerator) http.HandlerFunc
GetOutput exposes an HTTP interface to the GetOutput method
func GetRecordingChannel ¶
func GetRecordingChannel(d DAQ) http.HandlerFunc
GetRecordingChannel returns the channel of a recording in samples
func GetRecordingLength ¶
func GetRecordingLength(d DAQ) http.HandlerFunc
GetRecordingLength returns the length of a recording in samples
func GetSampleRate ¶
func GetSampleRate(m SampleRateManipulator) http.HandlerFunc
GetSampleRate exposes an HTTP interface to GetSampleRate
func GetScale ¶
func GetScale(o Oscilloscope) http.HandlerFunc
GetScale returns the scale of a channel
func GetTimebase ¶
func GetTimebase(o Oscilloscope) http.HandlerFunc
GetTimebase exposes an HTTP interface to GetTimebase
func GetVoltage ¶
func GetVoltage(fg FunctionGenerator) http.HandlerFunc
GetVoltage exposes an HTTP interface to the GetVoltage method
func HTTPFunctionGenerator ¶
func HTTPFunctionGenerator(fg FunctionGenerator, table generichttp.RouteTable)
HTTPFunctionGenerator injects an HTTP interface to a function generator into a route table
func Record ¶
func Record(d DAQ) http.HandlerFunc
Record causes the DAQ to record and sends the result back as a CSV file
func SetAcqLength ¶
func SetAcqLength(o Oscilloscope) http.HandlerFunc
SetAcqLength exposes an HTTP interface to SetAcqLength
func SetAcqMode ¶
func SetAcqMode(o Oscilloscope) http.HandlerFunc
SetAcqMode exposes an HTTP interface to SetAcqMode
func SetBitDepth ¶
func SetBitDepth(o Oscilloscope) http.HandlerFunc
SetBitDepth exposes an HTTP interface to SetBitDepth
func SetChannelLabel ¶
func SetChannelLabel(d DAQ) http.HandlerFunc
SetChannelLabel sets the channel label on a DAQ
func SetFrequency ¶
func SetFrequency(fg FunctionGenerator) http.HandlerFunc
SetFrequency exposes an HTTP interface to the SetFrequency method
func SetFunction ¶
func SetFunction(fg FunctionGenerator) http.HandlerFunc
SetFunction exposes an HTTP interface to the SetFunction method
func SetOffset ¶
func SetOffset(fg FunctionGenerator) http.HandlerFunc
SetOffset exposes an HTTP interface to the SetOffset method
func SetOutput ¶
func SetOutput(fg FunctionGenerator) http.HandlerFunc
SetOutput exposes an HTTP interface to the Output control methods
func SetOutputLoad ¶
func SetOutputLoad(fg FunctionGenerator) http.HandlerFunc
SetOutputLoad exposes an HTTP interface to the SetOutputLoad method
func SetRecordingChannel ¶
func SetRecordingChannel(d DAQ) http.HandlerFunc
SetRecordingChannel sets the channel of a recording in samples
func SetRecordingLength ¶
func SetRecordingLength(d DAQ) http.HandlerFunc
SetRecordingLength sets the length of a recording in samples
func SetSampleRate ¶
func SetSampleRate(m SampleRateManipulator) http.HandlerFunc
SetSampleRate exposes an HTTP interface to SetSampleRate
func SetTimebase ¶
func SetTimebase(o Oscilloscope) http.HandlerFunc
SetTimebase exposes an HTTP interface to SetTimebase
func SetVoltage ¶
func SetVoltage(fg FunctionGenerator) http.HandlerFunc
SetVoltage exposes an HTTP interface to the SetVoltage method
func SetWaveform ¶
func SetWaveform(fg FunctionGenerator) http.HandlerFunc
Types ¶
type DAQ ¶
type DAQ interface { SampleRateManipulator // SetChannelLabel sets the label used for a given channel SetChannelLabel(int, string) error // GetChannelLabel retrieves the label used by a given channel GetChannelLabel(int) (string, error) // SetRecordingLength sets the number of samples used // in a recording SetRecordingLength(int) error // GetRecordingLength retrieves the number of samples used // in a recording GetRecordingLength() (int, error) // SetRecordingChannel sets the channel used // to record data SetRecordingChannel(int) error // GetRecordingChannel retrieves the channel // used to record data GetRecordingChannel() (int, error) // Record captures data Record() (oscilloscope.Recording, error) }
DAQ is the interface of a data acquisition device
type FunctionGenerator ¶
type FunctionGenerator interface { // SetFunctions sets the function SetFunction(string) error // GetFunction returns the current function type used GetFunction() (string, error) // SetFrequency configures the frequency of the output waveform SetFrequency(float64) error // GetFrequency gets the frequency of the output waveform GetFrequency() (float64, error) // SetVoltage configures the voltage of the output waveform SetVoltage(float64) error // GetVoltage retrieves the voltage of the output waveform GetVoltage() (float64, error) // SetOffset configures the offset of the output waveform SetOffset(float64) error // GetOffset retrieves the offset of the output waveform GetOffset() (float64, error) // SetPutput configures if the generator output is active SetOutput(bool) error // GetOutput queries if the generator output is active GetOutput() (bool, error) // SetOutputLoad sets the output load of the generator in ohms SetOutputLoad(float64) error // SetWaveform uplodas an arbitrary waveform to the function generator SetWaveform([]uint16) error }
FunctionGenerator describes an interface to a function generator
type HTTPDAQ ¶
type HTTPDAQ struct { D DAQ RouteTable generichttp.RouteTable }
HTTPDAQ is an HTTP adapter to a DAQ
type HTTPFunctionGeneratorT ¶
type HTTPFunctionGeneratorT struct { FG FunctionGenerator RouteTable generichttp.RouteTable }
HTTPFunctionGeneratorT holds an HTTP wrapper to a function generator
func NewHTTPFunctionGenerator ¶
func NewHTTPFunctionGenerator(fg FunctionGenerator) HTTPFunctionGeneratorT
NewHTTPFunctionGenerator wraps a function generator in an HTTP interface
func (HTTPFunctionGeneratorT) RT ¶
func (h HTTPFunctionGeneratorT) RT() generichttp.RouteTable
RT makes this generichttp.httper compliant
type HTTPOscilloscope ¶
type HTTPOscilloscope struct { O Oscilloscope RouteTable generichttp.RouteTable }
HTTPOscilloscope holds an HTTP wrapper to a function generator
func NewHTTPOscilloscope ¶
func NewHTTPOscilloscope(o Oscilloscope) HTTPOscilloscope
NewHTTPOscilloscope wraps a function generator in an HTTP interface
func (HTTPOscilloscope) RT ¶
func (h HTTPOscilloscope) RT() generichttp.RouteTable
RT makes this generichttp.httper compliant
type Oscilloscope ¶
type Oscilloscope interface { SampleRateManipulator // SetScale configures the full vertical range of a channel SetScale(string, float64) error // GetScale returns the full vertical range of a channel GetScale(string) (float64, error) // SetTimebase configures the full vertical range of a channel SetTimebase(float64) error // GetTimebase returns the full vertical range of a channel GetTimebase() (float64, error) // SetBandwidthLimit turns the bandwidth limit for a channel on or off SetBandwidthLimit(string, bool) error // SetBitDepth configures the bit depth of a scope SetBitDepth(int) error // GetBitDepth retrieves the bit depth of the scope GetBitDepth() (int, error) // SetAcqLength configures the number of data points to capture SetAcqLength(int) error // GetAcqLength retrieves the number of data points to be captured GetAcqLength() (int, error) // SetAcqMode configures the acquisition mode used by the scope SetAcqMode(string) error // GetAcqMode returns the acquisition mode used by the scope GetAcqMode() (string, error) // StartAcq begins DAQ StartAcq() error // AcquireWaveform triggers a measurement on the scope and returns the data AcquireWaveform([]string) (oscilloscope.Waveform, error) }
Oscilloscope describes an interface to a digital oscilloscope
type SampleRateManipulator ¶
type SampleRateManipulator interface { // SetSampleRate configures the analog sampling rate of the scope SetSampleRate(float64) error // GetSampleRate returns the analog sampling rate of the scope GetSampleRate() (float64, error) }
SampleRateManipulator can manipulate their sampling rate