From 1788aa399989e919221f0bf4c8b6114bef4a49a9 Mon Sep 17 00:00:00 2001 From: Jeremy Tan Date: Thu, 31 Oct 2013 13:28:40 +0800 Subject: [PATCH] Some fixes --- server/image.c | 4 ++-- server/sensors/dilatometer.c | 2 +- server/sensors/pressure.c | 7 ++++--- testing/MCTXWeb/public_html/static/mctx.control.js | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/image.c b/server/image.c index d19ee7a..a32ac2c 100644 --- a/server/image.c +++ b/server/image.c @@ -74,8 +74,8 @@ void Image_Handler(FCGIContext * context, char * params) g_captureID = num; } - //cvSetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_WIDTH, width); - //cvSetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_HEIGHT, height); + cvSetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_WIDTH, width); + cvSetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_HEIGHT, height); *frame = cvQueryFrame(g_capture); result = (*frame != NULL); diff --git a/server/sensors/dilatometer.c b/server/sensors/dilatometer.c index 8d04fb5..0ab6ffb 100644 --- a/server/sensors/dilatometer.c +++ b/server/sensors/dilatometer.c @@ -179,7 +179,7 @@ bool Dilatometer_GetExpansion( int id, double * value, int samples) Log(LOGDEBUG, "GET IMAGE?"); IplImage * frame = NULL; - result = Camera_GetImage( 0, 1600, 1200 ,&frame); // Get a 1600x1200 image and place it into src + result = Camera_GetImage( 0, 800, 600,&frame); // Get a 1600x1200 image and place it into src Log(LOGDEBUG, "Got image..."); // If an error occured when capturing image then return diff --git a/server/sensors/pressure.c b/server/sensors/pressure.c index 699dda3..d93ceed 100644 --- a/server/sensors/pressure.c +++ b/server/sensors/pressure.c @@ -61,12 +61,13 @@ double Pressure_Callibrate(int id, int adc) double Vout = ADC_TO_MVOLTS(adc); return ((Vout - 0.1*Vs)/(0.8*Vs))*(Pmax - Pmin) + Pmin; */ - - return Data_Calibrate((double)adc, high_raw, high_cal, sizeof(high_raw)/sizeof(double)); + return adc; + //return Data_Calibrate((double)adc, high_raw, high_cal, sizeof(high_raw)/sizeof(double)); } case PRES_LOW0: // Not calibrated! - return (200.0 * (adc / ADC_RAW_MAX)); + //return (200.0 * ((double)adc / ADC_RAW_MAX)); + return adc; default: Fatal("Unknown Pressure id %d", id); return -1; // Should never happen diff --git a/testing/MCTXWeb/public_html/static/mctx.control.js b/testing/MCTXWeb/public_html/static/mctx.control.js index f414a82..212f708 100644 --- a/testing/MCTXWeb/public_html/static/mctx.control.js +++ b/testing/MCTXWeb/public_html/static/mctx.control.js @@ -21,6 +21,7 @@ function toggleControls(running) { $("#start-widget").hide(); } else { $("#start-widget").show(); + $("#start-widget input").removeAttr("disabled"); $("#experiment-stop").hide(); $("#pressure-widget").hide(); } -- 2.20.1