diff options
author | Mihael Koep <koep@schneide.com> | 2012-10-09 14:18:28 +0200 |
---|---|---|
committer | Mihael Koep <koep@schneide.com> | 2012-10-09 14:18:28 +0200 |
commit | 5783156882cde177cd6c2f7e06451e8e0444e666 (patch) | |
tree | 511d4249e1f3428cd73472b977bffee76792fd90 | |
parent | 7d8d5904eb7423a26a37cd3b0b69a7bd0cb59ab8 (diff) | |
download | uca-5783156882cde177cd6c2f7e06451e8e0444e666.tar.gz uca-5783156882cde177cd6c2f7e06451e8e0444e666.tar.bz2 uca-5783156882cde177cd6c2f7e06451e8e0444e666.tar.xz uca-5783156882cde177cd6c2f7e06451e8e0444e666.zip |
Add test mode attribute.
-rw-r--r-- | src/cameras/uca-dexela-camera.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cameras/uca-dexela-camera.c b/src/cameras/uca-dexela-camera.c index 21b13b2..13e8b05 100644 --- a/src/cameras/uca-dexela-camera.c +++ b/src/cameras/uca-dexela-camera.c @@ -35,6 +35,7 @@ GQuark uca_dexela_camera_error_quark() enum { PROP_GAIN_MODE = N_BASE_PROPERTIES, + PROP_TEST_MODE, N_PROPERTIES }; @@ -241,6 +242,11 @@ static void uca_dexela_camera_get_property(GObject *object, guint property_id, G g_value_set_uint(value, dexela_get_gain()); break; } + case PROP_TEST_MODE: + { + g_value_set_boolean(value, dexela_get_control_register() & 1); + break; + } case PROP_TRIGGER_MODE: { map_dexela_trigger_mode_to_uca(value, dexela_get_trigger_mode()); @@ -299,6 +305,15 @@ static void uca_dexela_camera_set_property(GObject *object, guint property_id, c g_warning("Illegal attempt to set gain: %d", gain); break; } + case PROP_TEST_MODE: + { + if (g_value_get_boolean(value)) { + dexela_set_control_register(dexela_get_control_register() | 1); + return; + } + dexela_set_control_register(dexela_get_control_register() & 0xFFFE); + break; + } case PROP_TRIGGER_MODE: { set_trigger_mode(g_value_get_enum(value)); @@ -365,6 +380,11 @@ static void uca_dexela_camera_class_init(UcaDexelaCameraClass *klass) "High or Low Full Well", "High (1) or Low (0) Full Well", 0, 1, 0, G_PARAM_READWRITE); + dexela_properties[PROP_TEST_MODE] = + g_param_spec_boolean("test-mode", + "Enable or disable test mode", + "Enable (true) or disable (false) test mode", + FALSE, G_PARAM_READWRITE); for (guint id = N_BASE_PROPERTIES; id < N_PROPERTIES; id++) { g_object_class_install_property(gobject_class, id, dexela_properties[id]); } |