PC Review


Reply
Thread Tools Rate Thread

Design Advice for System Status Application

 
 
a_wahoo
Guest
Posts: n/a
 
      12th Feb 2008
I'm a relatively young coder that has been pulling my hair out trying to
design a nice reusable architecture for a project that I'm working on and
could really use the advice of some experts. I posted here because my
language choice isn't too important, but I'm using C# in this case.

I'm working with an embedded system that sends data packets at varying rates
over Ethernet. There are several "channels" of data that indicate various
bits of system data and I have a class that contains a "current view" of the
system. This gets updated every time I get a new piece of data, that data
also gets logged to a database. I have a custom collection that derives from
ArrayList and fires a public NewData() event whenever it is updated.

That all works fine, I get my various bits of data at their different rates
and my class stays current with the system status. The problem comes in now
that I need to display this data (and there is a lot of it). When I first
started my design I was going to use the NewData event to have controls
"subscribe" to the data class. I then realized that this was going to
require me to implement a ton of event_handlers and I think there has to be a
better way to do it.

I thought about binding to the "logging" database but that doesn't seem to
make sense because I always want to display the current state of the system.
I would have to have some kind of database entry that was the "current" view
and that becomes really messy, really fast. Maybe I was missing something
there.

I next looked at directly binding to the current view class itself. Let's
call it MyMachine. MyMachine has a bunch of ArrayLists that hold information
like "Temperature". What I really want to do is an easy way to bind the
single element MyMachine.Temperature[0] to a textbox. I want to be able to
change the individual element I'm binding to on the fly. Say I have 10
texboxes. I want textbox 1 to show Temperature[5] but I can change it so
that it shows Temperature[10] at runtime. I realize that I can use
Reflection to get a list of all Properties of my class. But then instead of
having a nice ArrayList of all Temperatures, I have float properties fTemp1,
fTemp2... etc... I really want the ability for the user to have a drop-down
list of available data types (the array lists), say Temperature, Motor
Current, Supply Voltage and another drop-down of individual elements in those
arrays (Temp1, Temp2, Temp3)

I thought about extending my own versions of textbox, label, etc... so that
they can bind to a list and I specify an individual element. Is that the
right way to go? Most of the time I'm using some custom developed controls
to display the data anyway so extending those wouldn't be too bad. I'm just
wondering if I'm overlooking a really simple solution to this.

Thanks in advance!

-Adam


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Sport Timing System Advice =?Utf-8?B?TWFyay4=?= Microsoft Access Database Table Design 3 19th Oct 2006 09:19 AM
Advice On Server-Client Application Design Randy Cox Microsoft VB .NET 2 31st May 2005 01:43 PM
Application design Advice =?Utf-8?B?Um9iIFM=?= Microsoft Dot NET Compact Framework 3 10th May 2005 05:26 PM
Plugin Application Design Advice Dave Weber Microsoft C# .NET 6 16th Mar 2005 08:17 PM
System Agent Status and application Agent status misleading manny Spyware Discussion 0 10th Jan 2005 01:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:39 PM.