473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Data flow

Hi,

Im tidying up some code ive written wich atm is all in the main form.
its working reasonably well, uses zedgraph wich is nice,
but i need to tidy it up as its become increasingly difficult to work with.
although very fluent in C++ etc, im still geting to grips with c#,
and I think theres probably a better way to do what im trying todo in c#.

so far ive managed to seperate all but the data processing into seperate
clases in seperate files,
and also a seperate process entirly to collect the data, quite easily,
but the data processing is the bulkiest part.

the data consisting of 4 floats arrives at a rate of 5000 per minute,
and there maybe upto a years worth of data and I am displaying the data in
real time as it arrives.

the processing can be split into many data transformations,
the first stage organises the data into blocks of 10 minutes worth of data,
the next stage does some statistics and converts about 3 seconds of data to
1 point.
although this actually takes many complicated steps, with blocks of blocks
inbetween.
the data then gets some more processing such as fft etc.
the last stage takes blocks of data wich are a whole days worth.
the graph displays up to the minute statistics as each of the different
length blocks are processed.

atm each procesing stage is a function and calls the next function when it
has assembled a block of data.

however im hoping to break it down into seperate classes wich are easiy to
identify
and change/swap and add extra stages inbetween easily.
the main task sends the incoming data to the first stage/class
but im hoping to make it then control the transfer of processed data from
each stage to the next stage as it becomes ready.

however there are a lot of data variables that are shared throughout the
code,
more than I had first thought wich is making it a bit of a job,
such as graph pointpairlists etc but c# has no global data as with c++
there are too many to pass with parameters,
so I need to make each class able to access the data,
I could just keep them in the main form and pass a reference to the classes,
but it would be preferable to split the data up and move to the most
appropriate class wich makes that a bit more dificult for each class to
access.

im trying to make it clearer to follow the code, but adding such indirection
adds a level of complexity.
its a bit of a job in any language but I was wondering if C# had anything
fancy to do this sort of thing that i havent come acros yet ? although I
just realised I could make them static that could work.
or do partial classes work well ?
with c# is there a prefered way to control the flow of data from one class
to another?
I gues this is like event handling but im not sure this will make things
clearer or not.

thanks
Colin =^.^=
Jun 6 '07 #1
2 1907
You can use static class with public properties or fields for your globals.
Previously several posts discussed this.

HTH
Alex

"colin" <co*********@ntworld.NOSPAM.comwrote in message
news:VO******************@newsfe2-win.ntli.net...
Hi,

Im tidying up some code ive written wich atm is all in the main form.
its working reasonably well, uses zedgraph wich is nice,
but i need to tidy it up as its become increasingly difficult to work
with.
although very fluent in C++ etc, im still geting to grips with c#,
and I think theres probably a better way to do what im trying todo in c#.

so far ive managed to seperate all but the data processing into seperate
clases in seperate files,
and also a seperate process entirly to collect the data, quite easily,
but the data processing is the bulkiest part.

the data consisting of 4 floats arrives at a rate of 5000 per minute,
and there maybe upto a years worth of data and I am displaying the data in
real time as it arrives.

the processing can be split into many data transformations,
the first stage organises the data into blocks of 10 minutes worth of
data,
the next stage does some statistics and converts about 3 seconds of data
to 1 point.
although this actually takes many complicated steps, with blocks of blocks
inbetween.
the data then gets some more processing such as fft etc.
the last stage takes blocks of data wich are a whole days worth.
the graph displays up to the minute statistics as each of the different
length blocks are processed.

atm each procesing stage is a function and calls the next function when it
has assembled a block of data.

however im hoping to break it down into seperate classes wich are easiy to
identify
and change/swap and add extra stages inbetween easily.
the main task sends the incoming data to the first stage/class
but im hoping to make it then control the transfer of processed data from
each stage to the next stage as it becomes ready.

however there are a lot of data variables that are shared throughout the
code,
more than I had first thought wich is making it a bit of a job,
such as graph pointpairlists etc but c# has no global data as with c++
there are too many to pass with parameters,
so I need to make each class able to access the data,
I could just keep them in the main form and pass a reference to the
classes,
but it would be preferable to split the data up and move to the most
appropriate class wich makes that a bit more dificult for each class to
access.

im trying to make it clearer to follow the code, but adding such
indirection adds a level of complexity.
its a bit of a job in any language but I was wondering if C# had anything
fancy to do this sort of thing that i havent come acros yet ? although I
just realised I could make them static that could work.
or do partial classes work well ?
with c# is there a prefered way to control the flow of data from one class
to another?
I gues this is like event handling but im not sure this will make things
clearer or not.

thanks
Colin =^.^=


Jun 6 '07 #2
"AlexS" <sa***********@SPAMrogers.comPLEASEwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
You can use static class with public properties or fields for your
globals. Previously several posts discussed this.
yes thanks, i should of realised that from the start, I didnt know you could
make the class decleration static itself although all this does is make sure
you dont have any non static members, you stil have to make each member
static.

I also just made one of the class instances static on the form1, so it could
be easily referenced, as it was too much work to make all the members
static.

ofc if I want to make more than one instance this is the better way.

it was mainly about ways to organize data flows than anything,
doesnt seem like theres anything very new there compared to c++/mfc.
Im not sure what I would expect to find.

I know theres a lot of c# I havnt used yet.
much of that is the interface rather than the language.

Colin =^.^=
Jun 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: popsovy | last post by:
Hi I have a question about whether Data Binding can facilitate the process of saving data in a web application I learned that you can data bind information from a number of different data...
4
by: Guadala Harry | last post by:
Is there any way for one Session to remove and update objects in another Session? I seriously doubt it, but thought I'd ask. Here's why: I have some data that is unique per user (or per session -...
6
by: Paul | last post by:
Hi I have 2 data grids and several controls on a web page. The grids will vary in size, just wondering if the lower grid could be covered by part of the upper grid depending on its size or is there...
0
by: Marc DVer | last post by:
I am at kind of a loss on how to design a certain database project I am working on. Basically, we have a proprietary program with a standard backend (though we do not have direct write access to...
3
by: smk | last post by:
Hi, I am having a file in this format ********************************************************************** ********************************************************************** *** ...
10
by: Frank van Wensveen | last post by:
Friend, coders, fellow wage slaves, lend my your ears. I believe that in a perfect world the design of a website (or feature on a website) should be totally separated from its design and the data...
1
by: ganesah | last post by:
hi there, i need to create a program to continously display the received binary data (2bytes) from COM 8 in a console, however I'm having problem in doing so where i do nt see any data being...
5
by: ludvig.ericson | last post by:
Hello, My question concerns asynchat in particular. With the following half- pseudo code in mind: class Example(asynchat.async_chat): def readable(self): if foo:...
0
by: thesti | last post by:
hello, i'm trying to import data from an excel file to a SQL Server 2005 table using the Integration Services Project. i have Visual Studio 2005 installed as i drag the data flow task and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.