Main module

This is the module that handles all the communication with the current Gramophone device.

Gramophone class

class Gramophone.Gramophone(device, verbose=False)[source]
class Parameter(name, info, type)
info

Alias for field number 1

name

Alias for field number 0

type

Alias for field number 2

close()[source]

Disconnect from this device.

open()[source]

Connect to this device.

Helper classes

class Gramophone.Transmitter[source]

Emits Qt signals to transmit infromation from incoming packets.

emit_device_error(error_msg)[source]

Emit a signal with the given error message.

Parameters:error_msg (str) – The error message.
emit_inputs(inputs)[source]

Emit a signal with the state of the digital inputs.

Parameters:inputs ([int, int]) – A list containing the states of the two digital inputs.
emit_position(pos)[source]

Emit a signal with the given position.

Parameters:pos (int) – The position that should be emitted.
emit_recorder(values)[source]

Emit a signal with all the data required by the Recorder module. These are the current time, velocity, input- and output states in order.

Parameters:values ([int, float, int, int, int, int, int, int]) – A list containing the time, velocity, input- and output states.
emit_velocity(vel)[source]

Emit a signal with the given velocity.

Parameters:vel (float) – The velocity that should be emitted.
class Gramophone.Reader(name, read_func, frequency)[source]

A worker that can continnously send commands to the Gramophone with a given frequency.

Parameters:
  • name (str) – The name of this reader. Can be used for identification to stop a specific reader.
  • read_func (function) – The read function that should be called.
  • frequency (float) – The frequency at which the function should be called in Hz.
abort()[source]

Stop calling the read function.

read()[source]

Start calling the read function repeatedly. Slot for a QThread.