summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-07-03 09:08:26 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-07-03 09:22:07 +0200
commitb67947751a24366137844cd1a3b41bed7095bf76 (patch)
tree2fd867803c6a68b3b256750d17f33d9b22b43664
parentc15f15d47e9333087eeda52b2dde80e64e6f69bd (diff)
downloaduca-b67947751a24366137844cd1a3b41bed7095bf76.tar.gz
uca-b67947751a24366137844cd1a3b41bed7095bf76.tar.bz2
uca-b67947751a24366137844cd1a3b41bed7095bf76.tar.xz
uca-b67947751a24366137844cd1a3b41bed7095bf76.zip
Fix LU-16: Add cooling point props
Added "cooling-point-min", "cooling-point-max" and "cooling-point-default" to query the valid range of "cooling-point".
-rw-r--r--src/cameras/uca-pco-camera.c44
-rw-r--r--test/grab.c6
2 files changed, 49 insertions, 1 deletions
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c
index 87167cf..26894e1 100644
--- a/src/cameras/uca-pco-camera.c
+++ b/src/cameras/uca-pco-camera.c
@@ -108,6 +108,9 @@ enum {
PROP_RECORD_MODE,
PROP_ACQUIRE_MODE,
PROP_COOLING_POINT,
+ PROP_COOLING_POINT_MIN,
+ PROP_COOLING_POINT_MAX,
+ PROP_COOLING_POINT_DEFAULT,
PROP_NOISE_FILTER,
PROP_TIMESTAMP_MODE,
N_PROPERTIES
@@ -1098,6 +1101,27 @@ static void uca_pco_camera_get_property(GObject *object, guint property_id, GVal
}
break;
+ case PROP_COOLING_POINT_MIN:
+ {
+ GParamSpecInt *spec = (GParamSpecInt *) pco_properties[PROP_COOLING_POINT];
+ g_value_set_int(value, spec->minimum);
+ }
+ break;
+
+ case PROP_COOLING_POINT_MAX:
+ {
+ GParamSpecInt *spec = (GParamSpecInt *) pco_properties[PROP_COOLING_POINT];
+ g_value_set_int(value, spec->maximum);
+ }
+ break;
+
+ case PROP_COOLING_POINT_DEFAULT:
+ {
+ GParamSpecInt *spec = (GParamSpecInt *) pco_properties[PROP_COOLING_POINT];
+ g_value_set_int(value, spec->default_value);
+ }
+ break;
+
case PROP_NOISE_FILTER:
{
guint16 mode;
@@ -1298,8 +1322,26 @@ static void uca_pco_camera_class_init(UcaPcoCameraClass *klass)
pco_properties[PROP_COOLING_POINT] =
g_param_spec_int("cooling-point",
"Cooling point of the camera",
- "Cooling point of the camera",
+ "Cooling point of the camera in degree celsius",
0, 10, 5, G_PARAM_READWRITE);
+
+ pco_properties[PROP_COOLING_POINT_MIN] =
+ g_param_spec_int("cooling-point-min",
+ "Minimum cooling point",
+ "Minimum cooling point in degree celsius",
+ G_MININT, G_MAXINT, 0, G_PARAM_READABLE);
+
+ pco_properties[PROP_COOLING_POINT_MAX] =
+ g_param_spec_int("cooling-point-max",
+ "Maximum cooling point",
+ "Maximum cooling point in degree celsius",
+ G_MININT, G_MAXINT, 0, G_PARAM_READABLE);
+
+ pco_properties[PROP_COOLING_POINT_DEFAULT] =
+ g_param_spec_int("cooling-point-default",
+ "Default cooling point",
+ "Default cooling point in degree celsius",
+ G_MININT, G_MAXINT, 0, G_PARAM_READABLE);
pco_properties[PROP_SENSOR_ADCS] =
g_param_spec_uint("sensor-adcs",
diff --git a/test/grab.c b/test/grab.c
index a5f1cf5..67763b4 100644
--- a/test/grab.c
+++ b/test/grab.c
@@ -38,6 +38,7 @@ int main(int argc, char *argv[])
guint sensor_width, sensor_height, sensor_width_extended, sensor_height_extended;
guint roi_width, roi_height, roi_x, roi_y, roi_width_multiplier, roi_height_multiplier;
guint bits, sensor_rate;
+ gint cp_min, cp_max, cp_default;
gchar *name;
g_type_init();
@@ -75,6 +76,9 @@ int main(int argc, char *argv[])
"roi-y0", &roi_y,
"sensor-bitdepth", &bits,
"sensor-pixelrate", &sensor_rate,
+ "cooling-point-min", &cp_min,
+ "cooling-point-max", &cp_max,
+ "cooling-point-default", &cp_default,
NULL);
g_print("Camera: %s\n", name);
@@ -88,6 +92,8 @@ int main(int argc, char *argv[])
g_print("ROI: %ix%i @ (%i, %i), steps: %i, %i\n",
roi_width, roi_height, roi_x, roi_y, roi_width_multiplier, roi_height_multiplier);
+ g_print("Valid cooling point range: [%i, %i] (default: %i)\n", cp_min, cp_max, cp_default);
+
const int pixel_size = bits == 8 ? 1 : 2;
gpointer buffer = g_malloc0(roi_width * roi_height * pixel_size);
gchar filename[FILENAME_MAX];