Monday, December 21, 2009

TimeLapse Internationalization


Douglas gave me tons of help last night with i18n. I18n of TimeLapse is not fully finished but the hard parts of it are done and I know enough to finish it thanks to Douglas. Here is a screenshot:




Thursday, December 17, 2009

How to Install and Use TimeLapse

This is a work in progress. I will add a More detailed installation procedure soon.

Short Version: 
 To install type:
su
yum install bzr
bzr branch lp:timelapse

To use type:
cd timelapse
su         (Currently, root is necessary for TimeLapse to run properly)
python timelapse.py

I figured out the problem with #3

I was talking to Luke today and he told me that I need to use show() instead of set_visible(True). I tried using show() and it worked

Tuesday, December 15, 2009

Tuesday's Class

Today Robin and I made a lot of fixes to TimeLapse. Last Tuesday when we went to Frank's house we came up with a list of things that needed to be changed and fixed.

This is the list, as I remember it:
1. Make files play when they are double clicked
2. Fix bug where data can not be selected if it does not have a picture
3. Add a confirmation pop up for the "Delete All Data" button.
4. Make it possible to choose the data quality.

We completed #1 and #2 and started working on #3.
When trying to do #3 we ran into a problem. We coulden't figure out how to make our pop up confirmation window appear. We tried set_visible(True), but that didn't work. I was quite surprised that didn't work. I didn't know what the problem was.

Tuesday, December 8, 2009

Going to Frank's House

Today, after quickly fixing a bug in TimeLapse at the career center, Robin and I went to Frank's house to set him up with the new version of  TimeLapse. He liked all the new features. He thought the sound quality was actually better than it was before, and he gave us some sujestions on what we could change to improve TimeLapse. It was a long time sitting in traffic, but it was a useful meeting that went relitivly smoothly after we finally got there.

Fixing Copy All Data

Today I was testing the new "Copy All Data" feture in TimeLapse and I realized that I could not copy the data to a flash drive. This was a major problem because the purpose of the "Copy All Data" button was to copy the data to a flash drive to get it off the XO. I figured out the problem was a bug in shutil when copying ext3 filesystem to fat32 filesystem. To fix the problem I replaced this:

shutil.copytree("data", filepath)

I replaced it with this:

subprocess.check_call(['cp', '-R',  'data', filepath])

New "Copy All Data" Feature

Frank Linton uses this program to collect bee sound data. He analizes this data on a differnt computer. To do this he needs to copy the data from his XO to a flash drive then from his flash drive to his computer. I think he uses linux commands to cut all data from the data folder and paste it to his flash drive. Then he copies over the catalog.xml file with a blank one so timelapse doesn't think the data is still there. That whole posess can be very confusing and time consuming for him.

To solve this problem I added a new "Copy All Data" button. When clicked, the button pops up a create new folder window. Frank, or any user, can use the create new folder window to navigate to their flash drive, type in a folder name, and push copy. When they push copy all of the TimeLapse data in the data folder is copied into the new folder with the folder name they choose. Frank can use this in congunction with the "Delete All Data" button to meet his needs. He can use the "Copy all Data" button to copy the data to the flash drive. Then he can use the "Delete All Data" button to free up space on the XO so he can collect more data.

This is what it looks like:

(I will put screenshot here soon.)

Monday, December 7, 2009

New Delete feature

Before today there was no easy way to delete data. Deleting data required removing the data catalog.xml file and manually deleting the data from the data folder.

To fix this problem I added a "Delete" button to remove the currently highlighted data. It removes the data entry from the catalog.xml file and the data folder. While doing this I completely rewrote the way xml data is written. We may consider switching away from xml data completely at some point

"Delete All Data" button

If someone wanted to delete all the collected data it would still be diffacult to do with just the delete button because the "Delete" button only deletes one grupe of data at a time. Deleting all data would require many clicks.
I added a "Delete All Data" to solve this problem. The "Delete All Data" button deletes all the data entries in the catalog.xml file as well as everything in the data folder.

Sunday, November 15, 2009

Fixing CPU Usage and Sound Problems and Getting Rid of Treads

I used gobject.timeout_add instead of threading which fixed the CPU usage problem and made the code easier to read. I made the sound quality better by changing the bit-rate and the depth. I made TimeLapse collect the image and audio at the same time which improved the speed of data collections.

Wednesday, November 4, 2009

New Start and Stop Time Feature

Last weekend I worked on adding a new feature. The new feature makes it possible to choose when to start data collection and when to stop data collection.

This is what Time Lapse now looks like:


By default "Start Now" and "End Never" are checked as shown below:


"Start Now" and "End Never" can be unchecked to allow a person to choose a specific start and stop time for data collection:






After "OK" under "Begin Collecting" is clicked Start Date and Time can no longer be modified. End time can still be changed. (Changes to End Time do actually change the end time)
This is shown below:

Not clicked:


Clicked:


"Start Date and Time" isn't changeable because people can simply push End Collecting without any trouble if they need to change the start time because no data will have been collected yet.

Saturday, October 31, 2009

CPU usage. Is it a problem?

This is why I chose to do my start time a little differntly than the way Time Lapse currently waits until a specific time for the purpose of frequency. The screenshots are self-explanitory. I don't really know if the high CPU usage really matters or not. Please give me your opinion. If it is a problem, it would be easy to fix.







You can see the problem in the first few lines of the run method



I wrote my code a little differnly for start time so I could avoid this problem. Should I change my code to be consistant with this? Or should I change this to fix the problem and be consistant with my code? Is this actually a problem?


I think I'll just ignore this for now.

Thursday, October 29, 2009

Adding start stop time functionality

Today we were working on figuring out how to actually add the start-stop functionality. We figured out how to interact with the user interface through glade. I wrote a line of code to print the date in the end date calendar when the begin collecting button is clicked to try this out, and we started looking at python's time and datetime to figure out the best way to start and stop data collection at a particular time.

Tuesday, October 27, 2009

Working on Timelapse.glade to add start and stop times

Today we worked on making the user interface for the new timelapse. This involved working with and learning glade and seeing how things looked on the XO. At the end of the day this is what we had:



now we need to figure out how to actually add the start and stop times and link it to the user interface. We also need to make any changes to the user interface that we overlooked as we go along

Monday, October 26, 2009

Timelapse.glade still doesn't look right in glade on my computer but nevertheless I maniged to add some calendars for dates and dropdowns for hours and minutes. Here is a screen-shot:

This is a screenshot from running timelapse.py on my computer. This layout doesn't currently work on the XO which is the only thing it needs to work on.


Note: I'm working on the user interface for start and stop functionality before I have actually added start and stop functionality. Normally I would do that the other way around. But I am working on the user interface first because I think it will be the hardest part of adding start and stop times, mostly because I don't really know glade or pygtk.
This is what the "making progress" version (seen in earlier screen-shot) of Timelapse.glade looks like when opened in glade on my home computer:


My home computer is using Ubuntu 9.10 Beta and Glade 3.6.7
I opened up timelapse in glade here at school and it looked the way it should instead of the way it looked on my home computer. On my home computer all the buttons and windows were lined up in a row. Here they look proper:

School computer glade 3.6.3 Ubuntu 9.04:




Making progress:



(click on the images to see the full size image. I didn't realize it was possible to do that before.)

I am trying to add start and stop dates to timelapse. I started by writing a simple pygtk program so I could look at the calendar widget and see what the calendar looks like by default. I posted a screenshot of that program above.

Next I looked at the timelapse.py code to figure out how I should add the start and stop times. I realized that I will probably want to use glade. I have never used glade so I installed glade and tried to figure out how to use it. I also glanced at a tutorial but didn't actually read any of it yet. I opened up Timelapse.glade and tried to figure out how to add a calendar into the program. It didn't work out quite how I wanted it to. Here is a screenshot.


I was trying to figure out how to add that calendar next to the collect data now button but I failed miserably.

After looking at glade I realized that it may be quite hard to do a popout calendar like we had planed. We may have to settle for a pop-up window or just cram the entire calendar in.

What I need to do now:
  • learn enuph glade and pygtk to create the gui part of the start and stop dates
  • add start and stop dates to gui
  • write code to start and stop recording at spicific times
  • link gui start and stop dates to code that starts and stops recording at specific times.
(I'm not quite finished with outside of class work. I'll do a little bit more this evening.)

Tuesday, October 20, 2009


I am trying to figure out the best way to make a calender for the purpose of adding a start and stop date for data collection in timelapse.

Picture of our ideas:



I emailed Frank Linton to see which ideas he liked the best and to set up a time when we could give him the latest version of timelapse

Tuesday, October 13, 2009

change of plans

Today we started out by figuring out what we need to do to edit measure. We installed git and we downloaded the git repository. Then we talked to Matt and determined that Dr. Linton's main problem was that he didn't have the latest version of TimeLapse. Now we are planning on adding the features to TimeLapse that Dr. Linton wants and getting Dr. Linton set up with the latest version of TimeLapse.

Monday, October 12, 2009

got it working

I couldn't figure out what the problem was so I tried updating the XO and it fixed the problem.

Seeing the Bees

This morning we went to Dr. Frank's house to see the bees. We saw his setup and we learned the purpose of the programming we are going to be doing. We also learned a lot of interesting stuff about bees. Jeff's blog entry, The Magic of Bees, explains more about what we saw

Sunday, October 11, 2009

Trying to figure out connection problem

I tried to ssh into the XO pc on my home network but still had no luck. I thought the usb ethernet adapter might not be working so I tried it on my home computer but it worked immediately without a flaw.

Tuesday, October 6, 2009

Determining the best development environment

Today we were trying to determine the best development environment for measure. After talking on #sugar we determined that it would be best to develop on the XO laptops themselves and ssh into the laptops to edit the code. To do this Jeff gave Robin and I XO laptops and USB Ethernet adapters to use for this course. Robin had no problems using ssh with his XO and Ethernet adapter, but I could not connect to the network with my XO and Ethernet adapter. Class ended before I had time to troubleshoot the problem.

The following picture shows how we are going to access and work on the measure activity: