Colorhug.DeviceQueue¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Colorhug.DeviceQueue(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Return type:
New in version 0.1.29.
- add(device, cmd, buffer_in, buffer_in_len, buffer_out, buffer_out_len)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecmd (
int) – The command, e.g.Colorhug.CMD_TAKE_READINGSbuffer_in_len (
int) – The size of buffer_inbuffer_out_len (
int) – The size of buffer_out
Adds a raw command to the device queue.
New in version 0.1.29.
- boot_flash(device)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Device
Boots the device from bootloader to firmware mode.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- clear_calibration(device, calibration_index)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecalibration_index (
int) – Slot
Clears a calibration slot.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- erase_flash(device, address)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceaddress ([
int]) – The device EEPROM address
Erase program code on the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_adc_vref_neg(device, vref)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicevref (
float) – The voltage reference, ranging from 0.0 to 3.3V.
Gets the ADC Vref- calibration value.
NOTE: This command is available on hardware version: 2
New in version 0.1.31.
- get_adc_vref_pos(device, vref)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicevref (
float) – The voltage reference, ranging from 0.0 to 3.3V.
Gets the ADC Vref+ calibration value.
NOTE: This command is available on hardware version: 2
New in version 0.1.31.
- get_calibration(device, calibration_index, calibration, types, description)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecalibration_index (
int) – The slot positioncalibration (
Colord.Mat3x3) – the 3x3 calibration matrixtypes (
int) – The types the matrix supportsdescription (
str) – The description of the calibration
Gets the calibration data.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_calibration_map(device, calibration_map)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecalibration_map (
int) – An array of slot positions
Gets the calibration map.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_ccd_calibration(device, indexes)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceindexes (
int) – An array of red, green, blue indexes
Gets the CCD spectral calibration indexes. These are “pointers” to specific spectral peaks returned by the CCD.
NOTE: This command is available on hardware version: 2
New in version 0.1.31.
- get_color_select(device, color_select)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecolor_select (
Colorhug.ColorSelect) – The color select, e.g.Colorhug.ColorSelect.RED
Gets the selected sensor color.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_dac_value(device, dac_value)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicedac_value (
float) – value between 0.0 and 0.99
Gets the DAC value.
NOTE: This command is available on hardware version: 2
New in version 1.1.6.
- get_dark_offsets(device, value)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicevalue (
Colord.ColorRGB) – AColord.ColorRGB
Gets the device dark offsets.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_firmware_ver(device, major, minor, micro)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicemajor (
int) – The firmware major versionminor (
int) – The firmware minor versionmicro (
int) – The firmware micro version
Gets the firmware version.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_hardware_version(device, hw_version)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicehw_version (
int) – The hardware version
Gets the hardware version.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_integral_time(device, integral_time)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceintegral_time (
int) – The sensor integral time in device units
Gets the reading integral time.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_leds(device, leds)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceleds (
int) – The LED bitfield
Gets the LED status.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_measure_mode(device, measure_mode)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicemeasure_mode (
Colorhug.MeasureMode) – TheColorhug.MeasureMode, e.g.Colorhug.MeasureMode.DURATION
Gets the measurement mode.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_multiplier(device, multiplier)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicemultiplier (
Colorhug.FreqScale) – The device multiplier, e.g.Colorhug.FreqScale._100
Gets the sensor multiplier.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_owner_email(device, email)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceemail (
str) – An email address
Gets the owner email address.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_owner_name(device, name)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicename (
str) – The owner name
Gets the owner name.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_pcb_errata(device, pcb_errata)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicepcb_errata (
int) – The PCB errata, e.g.Colorhug.PcbErrata.SWAPPED_LEDS
Gets the PCB errata level.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_post_scale(device, post_scale)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicepost_scale (
float) – The post-scale value
Gets the post scale value.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_pre_scale(device, pre_scale)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicepre_scale (
float) – Pre-scale value
Gets the pre scale value.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_remote_hash(device, remote_hash)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceremote_hash (
Colorhug.Sha1) – AColorhug.Sha1
Gets the remote hash stored on the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_serial_number(device, serial_number)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceserial_number (
int) – The device serial number
Gets the device serial number.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- get_temperature(device, temperature)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicetemperature (
float) – Temperature in Celsius
Gets the device temperature.
NOTE: This command is available on hardware version: 2
New in version 0.1.29.
- process(process_flags, cancellable)¶
- Parameters:
process_flags (
Colorhug.DeviceQueueProcessFlags) – Flags how to process the queue, e.g.Colorhug.DeviceQueueProcessFlags.CONTINUE_ERRORScancellable (
Gio.CancellableorNone) –Gio.CancellableorNone
- Raises:
- Returns:
Trueif the commands were executed successfully.- Return type:
Processes all commands in the command queue. WARNING: this function is synchronous and will block.
New in version 0.1.29.
- process_async(process_flags, cancellable, callback, *user_data)¶
- Parameters:
process_flags (
Colorhug.DeviceQueueProcessFlags) –cancellable (
Gio.CancellableorNone) – AGio.Cancellable, orNonecallback (
Gio.AsyncReadyCallbackorNone) – AGio.AsyncReadyCallbackthat will be called when finished.
Processes all commands in the command queue.
New in version 0.1.29.
- process_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – theGio.AsyncResult- Raises:
- Returns:
Trueif the request was fulfilled.- Return type:
Gets the result from the asynchronous function.
New in version 0.1.29.
- read_firmware(device, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicedata (
bytes) – Firmware binary data
Reads firmware on the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 1.2.11.
- read_flash(device, address, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceaddress (
int) – The device EEPROM addressdata (
bytes) – Binary data
Read flash code from the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- read_sram(device, address, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceaddress (
int) – The device memory addressdata (
bytes) – The binary data
Reads binary data from the SRAM.
NOTE: This command is available on hardware version: 2
New in version 0.1.29.
- reset(device)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Device
Resets the device back to bootloader mode.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- self_test(device)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Device
Performs some self tests on the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_calibration(device, calibration_index, calibration, types, description)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecalibration_index (
int) – The slot positioncalibration (
Colord.Mat3x3) – the 3x3 calibration matrixtypes (
int) – The types the matrix supportsdescription (
str) – The description of the calibration
Sets the calibration data.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_calibration_ccmx(device, calibration_index, ccmx)¶
- Parameters:
device (
GUsb.Device) –calibration_index (
int) –ccmx (
Colord.It8) –
- Raises:
- Return type:
New in version 0.1.29.
- set_calibration_map(device, calibration_map)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecalibration_map (
int) – An array of slot positions
Sets the calibration map.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_ccd_calibration(device, indexes)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceindexes (
int) – An array of red, green, blue indexes
Sets the CCD spectral calibration indexes. These are “pointers” to specific spectral peaks returned by the CCD.
NOTE: This command is available on hardware version: 2
New in version 0.1.31.
- set_color_select(device, color_select)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecolor_select (
Colorhug.ColorSelect) – The color select, e.g.Colorhug.ColorSelect.RED
Sets the sensor measurement color.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_dac_value(device, dac_value)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicedac_value (
float) – The DAC value
Sets the post scale value.
NOTE: This command is available on hardware version: 1 & 2
New in version 1.1.6.
- set_dark_offsets(device, value)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicevalue (
Colord.ColorRGB) – AColord.ColorRGB
Sets the device dark offsets.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_flash_success(device, value)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicevalue (
int) – Success value
Sets the firmware flash success value. Be careful using this function as misuse can result in a ‘bricked’ ColorHug device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_integral_time(device, integral_time)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceintegral_time (
int) – The sensor integral time in device units
Sets the reading integral time.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_leds(device, leds, repeat, on_time, off_time)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceleds (
int) – The LEDs bitfieldrepeat (
int) – Sets the number of times to repeat the patternon_time (
int) – Set the on timeoff_time (
int) – Set the off time
Sets the LED status.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_measure_mode(device, measure_mode)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicemeasure_mode (
Colorhug.MeasureMode) – TheColorhug.MeasureMode, e.g.Colorhug.MeasureMode.DURATION
Sets the measurement mode.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_multiplier(device, multiplier)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicemultiplier (
Colorhug.FreqScale) – The device multiplier, e.g.Colorhug.FreqScale._100
Sets the sensor multiplier.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_owner_email(device, email)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceemail (
str) – An email address
Sets the owner email address.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_owner_name(device, name)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicename (
str) – The owner name
Sets the owner name.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_pcb_errata(device, pcb_errata)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicepcb_errata (
int) – The PCB errata, e.g.Colorhug.PcbErrata.SWAPPED_LEDS
Sets the PCB board errata.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_post_scale(device, post_scale)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicepost_scale (
float) – The post-scale value
Sets the post scale value.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_pre_scale(device, pre_scale)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicepre_scale (
float) – Pre-scale value
Sets the pre-scale value.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_remote_hash(device, remote_hash)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceremote_hash (
Colorhug.Sha1) – AColorhug.Sha1
Sets the remote hash on the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- set_serial_number(device, serial_number)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceserial_number (
int) – The device serial number
Sets the device serial number.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- take_reading_array(device, reading_array)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicereading_array (
int) – An array of raw readings
Get an array of raw readings in quick succession.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- take_reading_raw(device, take_reading)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicetake_reading (
int) – A raw reading value
Take a raw reading from the sensor.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- take_reading_spectral(device, sram_addr)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicesram_addr (
int) – The SRAM location where the data is held
Takes a raw spectral reading.
NOTE: This command is available on hardware version: 2
New in version 0.1.31.
- take_readings(device, value)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicevalue (
Colord.ColorRGB) – TheColord.ColorRGBof the raw reading
Take a RGB triplet of readings from the sensor without applying the calibration matrix.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- take_readings_xyz(device, calibration_index, value)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicecalibration_index (
int) –value (
Colord.ColorXYZ) – TheColord.ColorXYZfor a given calibration slot
Take an XYZ fully cooked reading from the sensor.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- verify_firmware(device, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicedata (
bytes) – Firmware binary data
Verifies firmware on the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- verify_flash(device, address, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceaddress (
int) – The device EEPROM addressdata (
bytes) – Binary data
Verify flash code from the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- write_eeprom(device, magic)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicemagic (
str) – The magic sekret string
Writes values to the firmware to be set at device startup.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- write_firmware(device, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Devicedata (
bytes) – Firmware binary data
Writes new firmware to the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- write_flash(device, address, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceaddress (
int) – The device EEPROM addressdata (
bytes) – Binary data
Write flash code to the device.
NOTE: This command is available on hardware version: 1 & 2
New in version 0.1.29.
- write_sram(device, address, data)¶
- Parameters:
device (
GUsb.Device) – AGUsb.Deviceaddress (
int) – The device memory addressdata (
bytes) – The binary data
Writes binary data to the SRAM.
NOTE: This command is available on hardware version: 2
New in version 0.1.29.
- do_device_failed(device, error_message) virtual¶
- Parameters:
device (
GUsb.Device) –error_message (
str) –
Signal Details¶
- Colorhug.DeviceQueue.signals.device_failed(device_queue, object, p0)¶
- Signal Name:
device-failed- Flags:
- Parameters:
device_queue (
Colorhug.DeviceQueue) – The object which received the signalobject (
GObject.Object) –p0 (
str) –
- Colorhug.DeviceQueue.signals.progress_changed(device_queue, object)¶
- Signal Name:
progress-changed- Flags:
- Parameters:
device_queue (
Colorhug.DeviceQueue) – The object which received the signalobject (
int) –