Hi all.
For the beginning I’d like to tell some words about WPF.
WPF is a great presentation technology allowing creating any UI interfaces with any complexity and any beauty you can ever imagine. Another big advantage is its dynamic data binding. The equivalent technologies are Silverlight for Web UI and Silverlight for Windows Phone.
But it’s worth to mention that WPF requires significant hardware resources for its dynamic layouting. Not even every notebook can present WPF UI smoothly and without simplification. On Windows OS, WPF is based on DirectX technology when a huge amount of calculations is handled by GPU (processor of graphics card) which is hundred times more powerful than CPU. Providing simplified WPF model to NETMF by Microsoft is great but UI’s created with it are still yet not acceptable in performance on devices like Cobra and ChipworkX where all calculations are handled by a single processor. Adding any dynamics to layout hangs it up dramatically.
As a solution, another way was chosen - rendering directly to a bitmap and flushing it to the screen - a technique similar to the one being a standard in game development. This way is used in such libraries as Glide, Pyxis, Gadgetos and .NET Clix (sincerely, there are not many products for today to choose from). More to say, Pyxis/Gadgetos are also a try to create some kind of OS for netmf – thanks to Skewworks, great job indeed!
I did some workaround with these libraries.
Glide
I created a Form and placed three TextBlocks on it. Next I added a new thread with a loop in which I periodically (once a second) assign a system time value to text property of these text blocks. Result is all three text blocks update only once and then freeze forever.
Pyxis/Gadgetos (+ most possibly NET Clix)
I created a Form with a background image and placed a panel on it. Panel has 4 Labels, 2 autosized, 2 with fixed size. Next I added a new thread with a loop in which I periodically (once a second) assign a system time value to text property of these labels. Result is form doesnt display its background image, labels with autosizing update their text on the screen only once and then freeze forever, labels with fixed size keep updating but without clearing their background area that leads to overlaying a text with each updating and getting a mess instead of text.
Next, I overviewed the source code of Pyxis. It uses a rendering technique which could be named like so called bubble notification. Due to it, controls with static size render only themselves if needed, while controls being able to change their size dependently on their properties (like labels etc.) cause its parent to rerender himself and all his children hierarchy, even those not needed to. Now lets consider a situation when we have a form with a dozen of panels, each of which contains a label and a panel, which contains a label and a panel and so on… up to 5 levels of hierarchy. Then we want all the labels to display some dynamic text. Can you imagine what will it end up with? With completely dead UI.
I guess Gadgetos and NET Clix use the same technique. And what about Glide?
In game development the other way is used. Theres a main loop which constantly makes all control hierarchy to update and to render. With such a technique we could never experienced the issues mentioned above. With a huge control amount we could miss some values from displaying but have some stable fps. With bubble notification – we couldnt.
And dont forget that NET Clix is 30$ and Glide for commercial use is 1000$.
Now is the question.
I have a production project with some number of H-bridges with current sensors connected to analog pins of Cobra. The task is to monitor their power consumption as fast as possible (lets say a couple times a second). Used are the progress bars for graphic form representation and labels for numeric one. Due to my workaround with mentioned libraries I cant use any of them for such a quite simple situation.
I would like the libraries creators to correct me if I did anything wrong and, if possible, to give me any recommendation for my project task. For now the only way that I see is to port to netmf my 2D GUI controls library made for XNA games.
Thank you.