The "ideas" thread

Discussion created by RJKSolutions on Dec 10, 2009
Latest reply on Mar 8, 2011 by andreas

Inspired by all this talk of some kind of Open Source development of a PI tool I thought I would share one of my ideas that has been hanging around my hard drives for some time now - the virtual world of PI.  Now by virtual I don't mean virtual servers running PI, I mean a whole virtual world and a different twist of visualising your PI data.

I have always been a massive, massive fan of ProcessBook as far to say it is my favourite OSI tool (with AF more or less on par).  Imagine your 2d schematic on the ProcessBook display, values updating nicely and then at the click of a button you enter a 3d world representing the equipment of that very 2d schematic.  Wouldn't it be nicer if you could fly around the equipment and see the live data from PI on the equipment/plant/refinery... - well I thought it would be nice if we had that option, so off I went...

Now what was apparent from the start were the various 3d modeling formats out there, various graphics engines etc so I decided to stick to the big boys and I came across the Microsoft XNA framework redistributable, did I mention it is free?  After some digging in to XNA I soon got up to speed with some spinning cubes, flying around the cube - pretty much the controls I need fly around my equipment.  For any of you that have seen Google SketchUp, well I was "inspired" by their navigation controls.
It was a big learning curve working with XNA and 3d "game" programming in general but it was required if I was to understand the 3d world of PI.

I am going to summarise the next part as it is more involved than it sounds - I then started looking in to the various modeling formats that I could load in to XNA framework and have them rendered correctly.  This is the tricky part, however I soon managed DirectX & FBX but other formats need their own set of classes & logic to load, not something that can be done overnight.  For now I was happy with a couple of formats to prove the theory and it appears I proved it albeit with some optimisation issues.  I was flying around looking at a pump and a pipeline.  Next, I needed to see data, any data even static data - basically some text dotted around the 3d equipment.
After some more digging around and talking to more experienced XNA guys I moved on to BillBoards and soon had string values being placed around the equipment (in completely random places because I was guessing the 3d coordinates).  At this point I had done enough to prove my point, plugging in live data seemed a fairly trivial task so it was time to sit back and look at the bigger picture.  I have been sitting back for far too long, I feel the need to revive this and progress it further.

My plans were the following:
- Create a plugin environment for different model formats to be used within the tool.  Sounds simple but I fear it is the most difficult part.
- Use AF to store meta data for a 3d model.  This includes the full definition of where data points are placed in the model (or the model definitions files could be parsed for data points).
- AF meta data would also define "views" on the 3d model linked to PI Notifications.  Imagine, Tag1 is shown in the model and goes in to alarm.  A PI notification is raised and triggered in the tool, a link or alarm list then appears if the notification is defined with a view.  User clicks on the item in the list and the camera is taken to the predefined view for the alarming PI tag - you are now looking at the alarming piece of equipment.
- Enable data to be fed from PI event pipes in to the tool and update live values in the 3d model - the billboards.  Would need optimising so elements are not redrawn too often. 
- Various tools to help with bulk loading models, managing the AF databases specific to this tool etc.
- Optimise, optimise, optimise every line of code.

There you go, my idea is out in the open.
Would appreciate the immediate thoughts of the community.

I am keen to work on this tool just because it is a challenge but I am also real to the size of the task ahead of me.  There are probable tools out there that do something similar (I even saw 1 tool toying with the idea of PI in 3d) but I envisioned a tool tightly integrated with PI to offer a new dimension to PI data.  No doubt I skipped over a few details but I am writing this post from memory, I must open my source code again...