View Single Post
  #32   Spotlight this post!  
Unread 06-06-2002, 16:52
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Okay, let me clarify the design of our dashboard program a little bit.

The key element that we want to have is style and visual apeal. Now, since refresh rate isn't that important, we decided to make the display in Flash.

The problem is that Flash only does scripting - not any real programming. It's designed for the web, not real programming. As I see it, the only way to get Flash to read the info from the Dashboard is to use the import data options in Flash.

Flash has two ways to inport data. One is to read from a text file, and the other is to get it in through a server-side script - php, asp, cgi, etc. (remember, flash was designed for the internet, not programming). To get it from a server-side script, I suppose the best way would be to make it read from a database. However, 1. we don't know how to access databases in C/C++. and 2. even if we could, I'd think that having the C++ store the info in a database, then have flash request the info from a php page several times a second is a bit slower than the alternative.

The second way flash imports data is by a text file. We decided the fastest way would be to have the C++ proggie running in the background and constantly rewriting the text file while the flash proggie reads the data and displays it in style.

Yes, we realize this isn't the most efficient way, but again, our priority is style over refresh rate. The goal of this proggie is more of something that shows off to potential sponsors or visitors what we can do - not something for debuging the robot like StangSense (which is something I'd definately like to learn more about some other time).

We did consider that this would be very inefficient. However, to test just how inefficient it was, Ian and I created two small test proggies. The C++ one basically wrote to the text file one variable in an infinite loop, and the flash displayed it. Using just one variable and no additional calculations, the refresh rate is still better than we expected - easily about 10 times per second. I'm not sure how the additional calculations (both decoding the data sent in and the calculations required in the display proggie) will affect speed, but it should be good enough for our purposes.
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies