Cleaning up benchmarks and drivers code.
[iot2.git] / benchmarks / Java / IrrigationController / MotionDetection.java
index 0ae1e70ced0155387b072846b3134677401ba570..c6f82793eca19e0cde41eb0c60ba4dac8ce82844 100644 (file)
@@ -257,7 +257,6 @@ class MotionDetection extends UnicastRemoteObject implements CameraCallback {
 
                try {
                        // Parse the byte array into a Buffered Image
-                       //InputStream in = new ByteArrayInputStream(_camera.getLatestFrame());
                        InputStream in = new ByteArrayInputStream(latestFrame);
                        img = ImageIO.read(in);
 
@@ -273,16 +272,11 @@ class MotionDetection extends UnicastRemoteObject implements CameraCallback {
 
                // Save the image and timestamp for use later
                imageWriteLock.lock();                  // lock the image and timestamp buffers since multithread
-               latestImage = img;                                      // image into image buffer
+               latestImage = img;                              // image into image buffer
 
                // timestamp from camera into timestamo buffer
-               //try {
-                       //long dateLong = _camera.getTimestamp();
-                       long dateLong = timeStamp;
-                       possibleDate = new Date(dateLong);
-               //} catch (RemoteException e) {
-               //      e.printStackTrace();
-               //}
+               long dateLong = timeStamp;
+               possibleDate = new Date(dateLong);
 
                imageWriteLock.unlock();                // Never forget to unlock
 
@@ -416,10 +410,7 @@ class MotionDetection extends UnicastRemoteObject implements CameraCallback {
                                // Motion was detected so issue callbacks to all objects that registered
                                // to receive callback from this class.
                                for (MotionDetectionCallback c : callbackList) {
-                                       //try {
-                                               c.motionDetected(this.getTimestampOfLastMotion());
-                                       //} catch (RemoteException re) {
-                                       //}
+                                       c.motionDetected(this.getTimestampOfLastMotion());
                                }
 
                        } else {