Merge pull request #28 from justinjessada/master
authorSam Moore <[email protected]>
Mon, 9 Sep 2013 01:34:02 +0000 (18:34 -0700)
committerSam Moore <[email protected]>
Mon, 9 Sep 2013 01:34:02 +0000 (18:34 -0700)
Added sensors, actuators, PWM code

camera/capture.c
irc/log
server/stream.c

index 815cef0..8ec196d 100644 (file)
@@ -22,14 +22,14 @@ int storeFrame( CvCapture* capture)
 
        /*int p[3];
        p[0] = CV_IMWRITE_JPEG_QUALITY;
-       p[1] = 10;
+       p[1] = 10;      //quality value; 0->100
        p[2] = 0;*/
                
        frame = cvQueryFrame(capture);
        if( frame == NULL)
                return 0;       //error
        cvSaveImage(filepath,frame,0);
-       
+       cvReleaseImageHeader(&frame);
        return 1;
 }
 
diff --git a/irc/log b/irc/log
index 84d928d..76a2601 100644 (file)
--- a/irc/log
+++ b/irc/log
 20:04 < jtanx> FCGI_RejectJSON now requires that you give a description explaining why
 20:05 < jtanx> when RejectJSOn is called, it's always logged along with the description, so some of the current log messages within the handler functions may be redundant
 21:11 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 23.0.1/20130814063812]"]
+--- Day changed Sat Sep 07 2013
+10:30 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+18:29 < jtanx> hmm
+18:29 < jtanx> what if you had two file pointers to the same file
+18:29 < jtanx> one read only, one write only
+18:29 < jtanx> then if you also kept track of how many points were written to the file
+18:29 < jtanx> you don't need to have mutexes anymore
+18:30 < jtanx> as long as you write the read/write calls carefully
+18:44 < jtanx> ahp, may have spoken too soon
+18:44 < jtanx> you'd still need a mutex around the read/write from/to the counter
+18:45 < jtanx> I think...
+19:07 < jtanx> but it might still be a good idea
+21:38 < jtanx> I went the simple route
+21:53 < jtanx> what I've got: /api/sensors?id=x&from=y&count=z
+21:54 < jtanx> In dump mode:
+21:54 < jtanx> If from < 0, then return from start, else from the given index (0-indexed)
+21:54 < jtanx> if count < 0, then return all points, else return /at most/ that many points
+21:55 < jtanx> in normal mode:
+21:55 < jtanx> if from < 0, then return from the end (return the most recent points)
+21:55 < jtanx> if count < 0, then return at most the default amount (SENSOR_QUERYBUFSIZ)
+21:56 < jtanx> otherwise return /at most/ that many points
+21:56 < jtanx> oh ya, if from >= 0 then return from that indicated index
+21:57 < jtanx> it's only in my git repository for now because I haven't tested it enough and I'm still not sure how I should go about integrating it with the current code
+21:58 < jtanx> (I basically rewrote Sensor_Handler and it has less error checks on the input; not sure if they're necessary or not)
+21:59 < jtanx> Since requesting a huge range could impact on sensor readings due to the mutex, it may be better to at least restrict dumps to when the experiment is not 'running'
+22:01 -!- jtanx [[email protected]] has quit ["~ that's it for now! ~"]
+--- Day changed Sun Sep 08 2013
+11:28 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+14:50 -!- Callum [[email protected]] has joined #mctxuwa_softdev
+17:55 -!- Callum_ [[email protected]] has joined #mctxuwa_softdev
+18:06 < Callum_> what was the server stuff you said to install? also what packages do i need?
+18:07 -!- Callum_ [[email protected]] has quit [EOF From client]
+18:07 -!- Callum_ [[email protected]] has joined #mctxuwa_softdev
+18:09 -!- Callum [[email protected]] has quit [Ping timeout]
+18:09 -!- Callum_ is now known as Callum
+18:21 < jtanx> if you want to install the server, you need at least the 'nginx' and 'spawn-fcgi' packages
+18:21 < jtanx> one nginx is installed you need to copy the config files from the git repository in
+21:14 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 23.0.1/20130814063812]"]
+21:47 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+22:36 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 23.0.1/20130814063812]"]
+22:38 -!- Callum [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 23.0.1/20130814063812]"]
index 229041a..09f723f 100644 (file)
@@ -16,13 +16,14 @@ int storeFrame( CvCapture* capture)
        
        int p[3];
        p[0] = CV_IMWRITE_JPEG_QUALITY;
-       p[1] = 10;      //quality value. 0-100
+       p[1] = 50;      //quality value. 0-100
        p[2] = 0;
                
        frame = cvQueryFrame(capture);
        if( frame == NULL)
                return 0;       //error
        cvSaveImage("../web/images/test.JPG",frame,p);
+       cvReleaseImageHeader(&frame);
        return 1;
 }
 

UCC git Repository :: git.ucc.asn.au