Posts Tagged ‘AS3’

And the Leader Board Says…

Saturday, November 21st, 2009

Last night Justin came over and we worked on his website for a while. We put a new theme on it and then I showed him how to use some of the back end features. We also tested out the Pint Tracker app. I created a fob for Justin so it was ready when he arrived.

IMG_6299

I now have Pint Tracker running as an AIR app. It is working out great. I have a shortcut down in my dock so it make it really convenient to start and stop Pint Tracker as needed. I found a real nice pint icon over at http://www.iconspedia.com
that I am using. Take a look at my dock and you can see the icon sixth from the right.

Picture 2

I also have Pint Tracker starting up when I boot or log in to the home theater computer. Now that Pint Tracker is an AIR app, I want to update the wood background. Give it rounded edges and maybe a border around it. I want to also work in a nice reduce and close icon. The only real changes I had to make to Pint Tracker to get it running as an AIR app were to make sure my links pointing to the PHP files were absolute. Otherwise Pint Tracker can’t find them. Then the last change was adding this bit of code so that I could drag the app around on the desktop.

1
2
3
4
5
backwood.addEventListener(MouseEvent.MOUSE_DOWN, back_CLICK);
     function back_CLICK(e:MouseEvent):void
     {    
          stage.nativeWindow.startMove();
     }

Previously I had been running Pint Tracker as a Mac widget. The problem with the Mac widget is that the widget is always on top of all other windows. Running Pint Tracker as a AIR app is a much better option since I can launch, reduce and quit with ease and it goes behind other open apps.

After Justin and I worked on this website for a while Ryan stopped by to see what we were up to. I had a fob ready for him as well. Here are a few “security” photos that Pint Tracker snapped when they scanned their fob for a pint.

husar_1258769849 husar_1258773273 husar_1258775983

Right now I have the camera on top of the TV mounted to the wall. Since I know it is there it is easy for me to get a good photo. Or a better framed photo anyway.

husar_1258599224

Last night just proved that people look at the fob reader and not the camera. So I need to come up with a way to have the camera and the fob reader in a box or case. Kevin suggested a cigar box so I will give that a try first. I would ideally like the camera to be up at head level. So maybe I will add a shelf next to the TV just for the fob setup. Look for an update on that in the next few weeks.

Here is the leader board after Justin and Ryan had a couple. Pint Tracker Leader Board

We did run out of beer after just 4 pints last night. I knew we were close since Pint Tracker tells me the pint count. Well kind of. Right now Pint Tracker keeps track of individual people totals and beer type totals. Since this is only the second keg I have been tracking and the first was a Boulevard Unfiltered Wheat, I could tell how many we have been pulled from the tap. But it doesn’t keep track of the current keg totals just overall totals for a particular keg type. As soon as I add another keg of Pale Ale or Unfiltered Wheat I won’t know current keg totals. So I need to show current keg total on a new screen. I will have to come up with some kind of meter to show current keg % full. Only thing I can think of is a pint decreasing it’s beer level with each tap pull. Then show a warning when it drops down below a certain level. If you have a better idea let me know. Or maybe a keg photo with a break away cut out on it to show the inside and the beer level.

I was able to get 50 pints out of the last full keg. I buy the 5.5 gallon smaller kegs since they are easy to handle and lets me swap them out quicker for more variety. Also one thing to think about is different pint sizes. I use the following three glasses most of the time.

Pint Sizes I would like to standardize to the two far left glasses since they are the same oz. size. That will give me a better reading on a keg’s pint count. Also I have to drain off a little with each session to get the warm beer out of the line. I would estimate that is about 3-5 pints over the life of a keg or a quarter pint with each session.

With a 5.5 gallon keg there are 704 oz. Using 16 oz glasses that is 44 pints, with 12oz pints that is about 59 pints, and with an average of 14oz per pint that is 50 pints. I had 50 pints out of this keg of Pale Ale and that is not counting drain off pints. I may be off a few pints this time because I have been testing and deleting those records from the database. I will get a new keg today of Fat Time so it adds another beer on the leader board. It will be interesting to see the beer count with another full keg. Also I need to start showing recent keg lifespans. I can see a few new screens being added very soon.

Sorry for such a long post but this is exciting (geek) stuff! Do you have any ideas to enhance the system? Let me hear them if you do!

Twitter It!

Pint Tracker 1.1 – Leader Boards

Sunday, November 15th, 2009

Here are a few screens from Pint Tracker 1.1. I have updated the Beer Leader Boards and the Member’s Leader Board. I like the new screens and this is real data by the way. But I need more people on the leader board. I feel bad burying Terra so bad.

Pint Tracker 1.1 Beer Leader Board Pint Trackers 1.1 Member's Leader Board

Twitter It!

Pint Logger v1 Goes Live

Saturday, November 7th, 2009

Pint Logger is officially live and in production at The House of Husar. Tonight I cleared out the database of all my test users and test data. Now all that is left in the system is me and my wife. Since my wife doesn’t really partake in the joys of a fine pint of ale very often it just might be little big old me racking up the consumption stats. But I am going to make her have a beer when she gets home just so I don’t feel so bad about being the only one on the list that is consuming. I mean really what kind of loser would drink all the beer in his pub all by himself.

I will have a web page up dedicated just to the Pint Logger app and the stats it is generating. Look for a post on that very soon with the URL.

Here are a few quick photos from my iPhone of just me on the leader board. The current beer on tap is Boulevard Unfiltered Wheat. That is only on tap because my wife had girls over from work this week. They needed a girly beer on tap for their consumption. Lightweights. But trust me, I am working hard to empty the 5 gallon keg after they had their 6 beers.

Pint Tracker Goes Live

Pint Tracker Goes Live

Pint Tracker Goes Live

Until I get the dedicate page up for Pint Tracker here is what is on my mind for updates.

1. Twitter updates on how and when they consume beer. If you are not on twitter what better reason could you want to join!?

2. Photo taken when someone swipes their fob. These will be posted to the web and Twitter.

3. Control the tap flow based by the fob swipe.

Thing on the functional side that I want to do.

1. Don’t load anything if I cannot connect to the database. Right now it loads and doesn’t display anything.

2. close and open the doors when a fob is swiped for nothing more than a visual effect.

That is all I have for right now. My pint is empty so I need to swipe my fob and get a refill. Too bad you are not here, I know that is what you are thinking right now. Anyway.

Twitter It!

Pint Logger Version 1

Wednesday, November 4th, 2009

Here is a quick video of the Flash + Phidget + Beer system I am building to track my tap at home. Version 1 is pretty much complete. I will clear out the test data this weekend and start using it to track beers at The House of Husar going forward. I will get a page dedicated to the project up as soon as I can and start loading stats into it so you can follow along.

A few things to come in future versions….

1. Tweet with each beer server. Who, What and When with a link back to the dedicated page.
2. Take a photo via an attached quick cam with each fob beer served and load it to the web.
3. Control the flow of beer with a servo motor and ball value. This will be the hardest of the 3 major upgrades for sure.

Watch the video and let me know what you think.

Twitter It!

Tracking Beer

Monday, November 2nd, 2009

For the past few years I have wanted to develop a system to track my tap and beer consumption. What is on tap, who consumed what, when. Then be able report on it. I have seen one system that some college kids create that was pretty cool but it was a little too complicated. I put the idea on the shelf a few years ago. Too much to do. Too little time.

Fast forward to 2009.

At the MAX conference in Los Angelas a guy name Kevin Hoyt gave a presentation on Phidgets that I happen to catch by accident. Phidgets are a set of “plug and play” building blocks for low cost USB sensing and control from your PC. All the USB complexity is taken care of by our robust API. Applications can be developed quickly by programmers using their favorite language: C/C++, C#, Cocoa, Delphi, Flash AS3, Flex AS3, Java, LabVIEW, MATLAB, Max/MSP, MRS, Python, REALBasic, Visual Basic.NET, Visual Basic 6.0, Visual Basic for Applications, Visual Basic Script, and Visual C/C++/Borland.NET.

Immediately my brew tracker ideas came into my head. Now I could finally create what I want with tools I was familar with. So off and on for the past few weeks I have been creating a system to track mine and my friends tap activities. With only an hour here and hour there it has been tough to find the time to work on this. On top of the time issue I have had to learn Action Script 3. I am happy to say that version one us ready.

The system is based off a RFID Phidget. The concept is pretty simple. Each friend has a RFID tag or fob that is assigned to them. Each fob has a unique id. You swipe the fob each time you get a beer. Here is a photo of a few different RFID tags I current have for my testing. They have wrist band fob, card fobs, key chain fobs, even fob to implant under your skin.

Fobs

Basically you swipe your fob to track your beer intake. The system tracks what is on tap, who you are, what you drank and when you drank it. Then I can report on it via the web. I know scary sounding isn’t it?!

So I have written a system in Flash that does just that. Below are screen shots of the system. I worked on the user interface last weekend a little and pretty happy with what I came up with. The theme is a oak chalk board look that you might see in a pub.

The first screen shot is what you see when the app loads. It cycles two stats screens while it waits for a fob to be scanned. This one below shows the Beer Leader Board stats. Basically a running log of the top 5 pints that have been drawn from my pub. These are just testing stats right now and not real data.
Picture 1

The Member Leader Board is not completed yet but it shows the top 5 friend and their consumption. It is a given that I will be #1 on the list. It would be a travesty if I wasn’t first on the list don’t you think? This is still in development so no data to show you.
Picture 2

This screen shows is what a user sees when they swipe their fob. It shows a photo, their name, fob id, what their life time beer consumption is and what their current month’s consumption is. More details will be added to this screen as I get more data in the system. Think of this as sort of a bio page that show when you swipe your fob.
Picture 3

This final screen shot is of the end animation if a fob is scanned that it is not recognized. Doors animate shut for a few seconds and they tell the user to contact the bartender.
Picture 4

The system is fully functional I just need to get the time to shoot a video of it in action. Soon all the data will be available via the web with graphs. I might password protect it. I am a little worried about people that I don’t who want to see how much I consume. But hey it is all in the spirit of testing the system, righ?. But be assured if you are regular commenter and reading of this thing I call a blog you can see the full stats.

Future plans include the system snapping a photo when you swipe your fob via a web cam and connecting a server motor to the system to actually control the tap flow. The web cam part is something that I can do pretty quick. The servo motor tap flow part will take some time.

So big thanks to Kevin Hoyt for starting me on this path of Phidgets. Look for a video of the system in action in the next night or two. It really is pretty slick.

Twitter It!