I am required to write a C# application that will analyse data logs from a RF control board (multiple RF nodes attached).
The data logs are saved as comma deliminated file(s) - one per day.
The log files are 13 columns wide and 6000 rows down.
I need to analyse the data and display it in a user friendly way - graphical (ie. battery voltages, RF strength, temperature, etc).
At the moment I thought analysing one log file at a time is sufficient but down the track multiple file analysis would be required.
As it's been quite some time since I last wrote a C# application I'm having difficulties determining the best approach.
Thus any design advice/suggestions would be greatly appreciated.
Thank you.
Loading
Matt PerksPosted Mar 17, 2010, 7:22 PM
cheers Matt.
Sam HobbsPosted Mar 8, 2010, 2:29 AM
We don't know how often the data will be processed. We don't know if data from more than one log file will be processed together. We don't know what relationships would or could exist among the data. A database can make data access more efficient when portions of each of many files need to be accessed. I don't know the data well enough to be sure, but the customers might want to do ad-hoc analysis and reporting. They can load the CSV into a database or spreadsheet themselves, but they would probably appreciate having that done for them.
I am not saying that either way is a mistake, and I am saying that both ways have advantages.
Sam HobbsPosted Mar 8, 2010, 2:16 AM
You can start out without a database, but my guess is that your requirements will expannd to the point where you will understand the advantage of a database. I have seen that type of thing happen way too much, and management is afraid to invest in fixing the problem. I agree that that is not likely to happen to you; you will likely be able to improve your design later, but I have seen many cases where that was not the case.
Mahesh ChandPosted Mar 7, 2010, 11:45 PM
Even though it is easy to load data from a database, I would not recommend saving data in a database. This is like you are doing twice work and now you will need to manage a database. Data is already in flat files, that are much faster accessing than from a relational database.
I suggest write a parser and develop a multi-threaded application to parse multiple log files simultaneously. You may want to search this site for Text parsing and threading. Here is an example:
Multi Threaded File Reader and Generator
You need to build a collection of objects. For instance, you can create a class and in this class each public property will be the column name in a row of text file. So when you done loading a log file, you should have a collection of objects. Once you have a collection, you can easily bind it to data-bound controls.
Post here if you have more questions.
Good luck!
Sam HobbsPosted Mar 7, 2010, 11:00 PM
There are other database systems, such as MySQL. There is another database system that other developers around here recommend, but I forget what it is.
If you use CSV without a traditional database system, then look at LINQ; it is something that .Net provides that will do most of the things that a database system will do, except in code. You need to learn about objects as a data source and things like that.
Something else worth looking at is business logic. It is a design methodology in which software is split into three layers; a Data Access Layer (DAL), a Business Logic Layer (BLL) and a User Interface. I don't know a lot about it but it is something I intend to learn about. The advantage for you is that you can create a DAL separate from the BLL and then you can create an alternative DAL with little or no modification to the BLL or the UI.
Matt PerksPosted Mar 7, 2010, 5:59 PM
I have no experience with SQL server databases so not sure about this approach!
Can you embedded a SQL database into an application? Like if this application was to ship with our hardware it would have to be a complete analysis package. So simple is best... not only for me creating the application but for the end user(s) as well.
Sam HobbsPosted Mar 5, 2010, 11:20 AM
Look at my article Using CSV and Other Delimited Files in C#, in case that helps. That can at least show you an easy way to read the CSV data.