Data Monitoring Application...

I have been developing a windows forms application that monitors and controls industrial processes(ie. temperature, humidity, flow). My app needs to dynamically display data to the user in a graphical format. I thought SVG was my answer. I have spent the last 6 month developing my app around the Adobe SVG active X control. It was perfect, I could directly manipulate the SVG dom, and it would automatically change the graphic on the screen. Well, a couple of weeks ago, I downloaded Adobe's latest SVG viewer, and found out that it wouldn't work with windows app any longer due to a security issue. Anyway, I changed my direction and started looking into GDI+. The problem that I'm having is associating the graphic objects with the data that I recieve from the system. Let's say for example that I have an image of a pump that I want to turn green when it's running. Well, I have an event that is triggered that lets me know that the pump is running, but do I have to re-draw the entire image Can I just change a property of the existing graphics path Also, I would like the user to create his own graphics using my app(somthing like visio stencils). How can I associate these graphical objects with my data, and store them in a file for later re-use

Thanks



Answer this question

Data Monitoring Application...

  • DavidDante

    Hi!

    GDI+ is not a document format where you can describe and edit object's attributes. GDI+ is the way to render. When to render is under your total control. You have few choices:

    1. you may implement own rendering code and invalidate screen each time something changed, rendering code will render new state.

    2. you can develop something like SVG or own object's graph that can render himself and work with it.

    3. you can use HTML to render all the stuff. The goal is that your app create and display HTML document using Web Browser Control. You keep links to HTML document elements and you can change their properties. Also you can allow to users to create own HTML elements and your app will separate presentation and logic. If you want I can make small sample of HTML based solution.



  • Sondeepa

    I don't think MS have something to do with SVG, if I understand right - this is Adobe's component and Adobe must develop it.

    IE have HTML DOM model which can give you the same things - scaling, layout, rendering, etc. HTML can work with VML too, but I don't see too much examples of this, still any VML element is also HTML DOM element, so you can try make some VML elements and control them.

    BTW, I add a little more to this HTML sample recently - this is how you can intercept events from HTML elements. Here is code how to add button to HTML:

    <input type="button" id="DoUpdate" value="Update application">

    and the code to respond when user click on button:

    void Web_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)

    {

    if (Web.Document == null) return;

    HtmlElement button = Web.Document.GetElementById("DoUpdate");

    if (button != null) button.Click += button_Click;

    }

    void button_Click(object sender, HtmlElementEventArgs e)

    {

    ...

    }



  • Ghost Rider

    Thanks S.G., I'll look for it

    Paul K.


  • Rob Blackerby

    Thanks for the reply SG.

    That would be great if you could send me an example that was HTML based. I never thought about doing it with html. Can I dynamically update the html tags like SVG and the values automatically be regenerated on the screen without having to refresh the page I'm sorry, I'm more farmiliar with XML and SVG. Since my values update so frequently, refreshing the page every time a value changes slows the whole thing down. It would be much better if I could just change the html tags, and have html render it like svg does, I just don't know if html works this way. Any help would be great. Thanks a million.

    Paul K


  • Shane Mulhall

    Few years ago I wrote app using HTML based approach. It used to display a lot of data (at least thousand values in table) with realtime rendering - all works fine, just as you want. I'll make sample and post it back here today.

  • mark healy

    Thanks SG,

    Looks great! I didn't realize that you could load and manipulate an html document like an xml or svg document! I'll give it a try, and let you know how I make out. By the way, do you know if Microsoft will support svg without using the Adobe plugin some day I sure hope so. I like the dynamic scaling features of SVG. Doesn't Microsoft have thier own web vector graphics driver built into IE(vml or somthing like that) Do you know if there is an api for this, or is it older technology Sorry to hit you up with so many questions, but you seem to know a lot about the subject.

    Thanks again,

    Paul K


  • rfwilliams76

    // Here is sample of HTML file

  • Data Monitoring Application...