Skip to content
Browse files

moved autosnapshot into autoupdate. Made autoupdate also reload pixel…

…Trackers.txt every 4 min.
  • Loading branch information...
1 parent 43272eb commit a7ccb447872f6a362e3ea4923c4958511bc2e94c @electronicwhisper committed
View
14 sb_elevator_combined/autoupdate.pde
@@ -0,0 +1,14 @@
+int autoupdateTime = 4; // how often to do the autoupdate, in minutes
+int lastAutoupdateTime = -1;
+void autoupdate() {
+ int m = minute();
+ if (m % autoupdateTime == 0) {
+ if (m != lastAutoupdateTime) {
+ // do an auto update
+ saveSnapshot();
+ loadPixelTrackers();
+
+ lastAutoupdateTime = m;
+ }
+ }
+}
View
12 sb_elevator_combined/saveSnapshot.pde
@@ -3,15 +3,3 @@ void saveSnapshot() {
snap.copy(video, 0, 0, video.width, video.height, 0, 0, video.width, video.height);
snap.save("data/snapshots/"+minute()+".png");
}
-
-int autoSnapshotTime = 4; // how often to take a snapshot, in minutes
-int lastSnapshotTime = -1;
-void autoSnapshot() {
- int m = minute();
- if (m % autoSnapshotTime == 0) {
- if (m != lastSnapshotTime) {
- saveSnapshot();
- lastSnapshotTime = m;
- }
- }
-}
View
3 sb_elevator_combined/sb_elevator_combined.pde
@@ -52,8 +52,7 @@ void draw() {
updateElevators();
trackMovement(video);
- // for debugging, periodically save the frame
- autoSnapshot();
+ autoupdate();
}
// draw the currently selected pixelTracker

0 comments on commit a7ccb44

Please sign in to comment.
Something went wrong with that request. Please try again.