So, it's been a while since I wrote anything, so I thought I'd let you lot know how the project is getting along.
There has been a vast leap in my project in the last few weeks. I've created a new prototype that's turning more and more in to a finished product, and may just well be the final deliverable.
So in essence; my project has gone from this:

Prototype 1
To this:

Prototype 2
As you can see, the UI has significantly changed. There will still be a map to click on, but how that is managed is still yet to be decided. The old prototype used a static, pre-rendered, image, but I want the prototype to have interactive elements that you can click on (so they highlight themselves, can display more data, etc).
To go about making an interactive map I first chose to have Line entities drawn on a Canvas control, but that lagged to no end. I then tried DrawingVisual, but that still lagged to no end (but not as much). I fear that I will have to use another static map, but maybe try and overlay drawn objects to display more data.
My aim with this project is not just to have it do the data mining, but display it in a meaningful and easy to access way that's also easily customisable. When I say customisable, I mean that I want the user to be able to mine the data to as many optional parameters as possible (these are then saved in to the database as "profiles"). Take a look at this screenshot to see what I mean:

Profile Config Screen
There is only one other thing that I can add to that, which is an option to search by day. The program uses the parameters here to build a dynamic LINQ query, which is something that can be a bit eluding at first. When searching for how to build dynamic LINQ queries, you can get a lot of confusing answers that, while probably very good ways, are ultimately too much for something as simple as I was looking at.
This is cross section of my projects code to show you how I did it:
IQueryable<AssetStatusHistory> result=from r in _gd92.AssetStatusHistories select r;
if (p.HasTimeRange)
result=result.Where(r => r.TimeStamp.TimeOfDay>=p.TimeStart && r.TimeStamp.TimeOfDayif (p.Day1>0 && p.Day2>0 && p.Month1>0 && p.Month2>0) {
if (p.Day1>0 && p.Month1>0) {
result=result.Where(r => r.TimeStamp>=new DateTime(r.TimeStamp.Year,p.Month1,p.Day1));
int yearMod=0;
if (p.Day2>0 && p.Month2>0) {
if (new DateTime(1,p.Month1,p.Day1)>new DateTime(1,p.Month2,p.Day2))
yearMod=1;
result=result.Where(r => r.TimeStamp<new DateTime(r.TimeStamp.Year+yearMod,p.Month2,p.Day2));
}
}
} else if (p.Day1>0 && p.Month1>0)
result=result.Where(r => r.TimeStamp==new DateTime(r.TimeStamp.Year,p.Month1,p.Day1));
if (p.Status>0)
result=result.Where(r=>r.Status==p.Status);
As you can see, it's through use of the Where() function that you can refine your queries based on conditionals, allowing you to dynamically build them up.
With all this, my project is mostly complete. I just need to get the map, search, and extra profile parameter and I'm done.

Make a comment