void Image_Handler(FCGIContext * context, char * params)
{
+
int num = 0, width = 1600, height = 1200; // Set Default values
FCGIValue val[] = {
{"num", &num, FCGI_INT_T},
g_captureID = num;
}
- cvSetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_WIDTH, width);
- cvSetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_HEIGHT, height);
+ if (g_capture != NULL)
+ {
+
+ 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);
+ *frame = cvQueryFrame(g_capture);
+ result = (*frame != NULL);
//cvShowImage("display", *image);
//cvWaitKey(0);
//cvSaveImage("test.jpg",*image,0);
- Log(LOGDEBUG, "At end of mutex");
-
+ Log(LOGDEBUG, "At end of mutex");
+ }
+
pthread_mutex_unlock(&mutex); //Close the mutex
//NOTE: Never have a "return" statement before the mutex is unlocked; it causes deadlocks!
#include "sensors/strain.h"
#include "sensors/pressure.h"
#include "sensors/dilatometer.h"
+#include "sensors/microphone.h"
void Sensor_Init()
{
//Sensor_Add("cpu_stime", RESOURCE_CPU_SYS, Resource_Read, NULL, NULL, NULL);
Sensor_Add("pressure_high1", PRES_HIGH1, Pressure_Read, Pressure_Init, Pressure_Cleanup, NULL);
Sensor_Add("pressure_low0", PRES_LOW0, Pressure_Read, Pressure_Init, Pressure_Cleanup, NULL);
//Sensor_Add("../testing/count.py", 0, Piped_Read, Piped_Init, Piped_Cleanup, 1e50,-1e50,1e50,-1e50);
- Sensor_Add("strain0_endhoop", STRAIN0, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
- Sensor_Add("strain1_endlong", STRAIN1, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
- Sensor_Add("strain2_midhoop", STRAIN2, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
- Sensor_Add("strain3_midlong", STRAIN3, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
+ //Sensor_Add("strain0_endhoop", STRAIN0, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
+ //Sensor_Add("strain1_endlong", STRAIN1, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
+ //Sensor_Add("strain2_midhoop", STRAIN2, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
+ //Sensor_Add("strain3_midlong", STRAIN3, Strain_Read, Strain_Init, Strain_Cleanup, Strain_Sanity);
+
+ //Sensor_Add("microphone", 0, Microphone_Read, Microphone_Init, Microphone_Cleanup, Microphone_Sanity);
//Sensor_Add("pressure0", PRESSURE0, Pressure_Read, Pressure_Init, 5000,0,5000,0);
//Sensor_Add("pressure1", PRESSURE1, Pressure_Read, Pressure_Init, 5000,0,5000,0);
//Sensor_Add("pressure_feedback", PRESSURE_FEEDBACK, Pressure_Read, Pressure_Init, 5000,0,5000,0);
- //Sensor_Add("enclosure", ENCLOSURE, Enclosure_Read, Enclosure_Init, 1,1,1,1);
- Sensor_Add("dilatometer_pos", DIL_POS, Dilatometer_Read, Dilatometer_Init, Dilatometer_Cleanup, NULL);
- //Sensor_Add("dilatometer_diff",DIL_DIFF, Dilatometer_Read, Dilatometer_Init, Dilatometer_Cleanup, NULL);
+ //Sensor_Add("enclosure", ENCLOSURE, Enclosure_Read, Enclosure_Init, 1,1,1,1); // Does not exist...
+
+ //NOTE: DO NOT ENABLE DILATOMETER WITHOUT FURTHER TESTING; CAUSES SEGFAULTS
+ //Sensor_Add("dilatometer0", 0, Dilatometer_Read, Dilatometer_Init, Dilatometer_Cleanup, NULL);
+ //Sensor_Add("dilatometer1",1, Dilatometer_Read, Dilatometer_Init, Dilatometer_Cleanup, NULL);
}
/**