Showing posts with label wpf. Show all posts
Showing posts with label wpf. Show all posts

Thursday, June 7, 2007

ChemL1ve! quite a hard time …

My team and I had just finished our Imagine Cup 2007 local round project, ChemL1ve!, and had given presentation on yesterday at TK Park, Central World Plaza. We won the third prize. I am really happy since I thought our team would not be in the top three of six teams from various Universities.

We had to give the presentation in very limited time of 15 minutes and we could not finish it in time. It was a really bad feeling. Try to think of yourself spent days coding a program and had only five minutes to show it off. It is hard to admit but this is normal situation. Good developers should learn some presentation skills too.

The winner was a team from CPE, Kasetsart University. Their project is an application that helps people who cannot read to be able to understand a book. By let the web camera point to the contents of the book. The application quickly recognizes the word on the page and displays the image and details of that word on the screen in a stylish way using WPF. User can also browse to the word he/she interested in by pronouncing that word to the microphone. The demo was really great and I can tell that this is the obvious winner of this year, right after I attend their presentation.

Our project is multi-user virtual chemistry lab software. At the stage of proposal submission, without any research, I thought it would not be so hard to develop such kind of system. But after that, when I tried to model it, I realize this was too big for a team with two inexperienced developers! More importantly, to correctly and effectively model this kind of system, you need a solid understanding of Chemistry which I actually got a “C” in my first Intania year T-T

Since this is a tech blog, I may go into the details of implementation. Here is my “ugly” class diagram at one stage of the development. Please note that it is “ugly” in term of OO design (Visual Studio 2005 generates this polish diagram quite well). It is “ugly” because it cannot support many of the system behaviors.

With this diagram, number of kind of lab equipment is fixed because I use a class to represent equipment. I am wondering if I could dynamically create new equipment at runtime. Those reflection stuffs might be able to do this sort of thing.

That is all my part. Another part is a client that my friend develops using the WPF as presentation layer. The client sends the interaction between lab equipment and get result from Web Service which wraps my part. This diagram below may help visualize architecture of our project (I designed this diagram using Expression Design, it is suitable for creating this kind of image than Adobe Photoshop).

Here are some screenshots of the client, ChemL1ve! Action.

For those who want to join next year’s Imagine Cup s/w design competition, I suggest that you should focus more on your ideas than the implementation details and make sure that your application can really solve the problem addressed. And keep in mind that this is “ideas” and “software design” competition. Do not mess with the coding too much. Just make sure that the app will not throw any uncatched exceptions during the demonstration : )

Thursday, February 1, 2007

My first simple .NET Framwork 3.0 app

My friends and I had just submitted the project proposals for Imagine Cup 2007: Software Design (You can find more info about Imagine Cup at http://www.imaginecup.com). One of the requirements of the project, only for the first round here in Thailand, is to build the application on the .NET Framework 3.0 which means it's time to start learning WPF, WCF, WF now!

To get started, make sure you have Visual Studio 2005 and these extensions.


First, I created a new project of type Windows Application under .NET Framework 3.0 category. I named it "HelloWPF".

I then designed the form. The Visual Studio's WPF designer is seperated into 2 panes : one for the visual designer and the other for editing raw XAML code. You can click on the "swap" button to swap the XAML pane and visual designer pane too. However, this CTP version of designer is hard to use and is not very impressive.

After that, I tried to add an event handler to the click event of the button. But there is no same old "Events" tab in the property window. Double clicked the button in the designer also not work. It takes me some time to figured out that I has to map event to code in XAML or to map it in the code under the constructor. I choose the latter way. Here is my C# code.



public partial class Window1 : System.Windows.Window
{

public Window1()
{
InitializeComponent();
btnSayHello.Click +=
new RoutedEventHandler(btnSayHello_Click);
}

void btnSayHello_Click(object sender,
RoutedEventArgs e)
{
txtMessage.Text = "WPF : สวัสดี ว่าไง";
}

}


I could finally press the F5 button and this is the result.