Solved

Signal tracing GUI widget

Posted on 2011-09-06
4
453 Views
Last Modified: 2012-05-12
Hello!

I am new for C# and .NET, currently using v3.5. For an embedded application writtenin Windows Forms of which I am implementing the GUI, I am asked to display a few dozen signals (up to fifty) comming from a file on the device in a two-dimensional coordinate system. The vertical scale(s) will be some electrical properties (A, V, VA, ...), the time scale will be in milliseconds. It is prescribed to have for each signal a value each 10 ms. There will be no server part, but a part written in C++ that prepares the measured values in text files for the GUI.

Below the drawing, a table should show the signals and their corresponding colours so that the user can easily match them, as there will be no legend information (like signal names) visible in the drawing. If two vertical scales exist, the table will also show which of the vertical scales each signal is using.

The widget should also have twovertical  (white) lines. If the user moves them apart, a zoom into the waverforms on the time axis (x) is achieved. No zooming plans for the Y axis exist - the user may copy the information on a USB stick and analyze it on their PC further, if needed.

Question:
How would you implement such a widget? Just by using a pictureBox, making the drawing and catching the mouse clicks/touch events, or by deriving a new widget class from an existing one?

Thank you for your information!
0
Comment
Question by:sae1962at
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:zvytas
ID: 36488652
This sounds like an ideal candidate for Windows Presentation Foundation (WPF) project, there are plenty of reading material online. I personally would go ahead with WPF.
Another viable option is using any canvas (image box, etc) to draw everything you need.
0
 
LVL 1

Author Comment

by:sae1962at
ID: 36489072
OK. Originally, WPF was also my favorite, but our customer decided to "reduce" it all to WinForms. So, I have to find out what's up there...

I currently use a pictureBox.Image that I load (all black). I couldn't find a way to create a bitmap directly, but it may also be OK to load the resource image.
0
 
LVL 5

Accepted Solution

by:
zvytas earned 250 total points
ID: 36489187
I would rather use Panel to be honest, but picture box should be OK too. You can draw pretty much whatever you want on these "surfaces", please see some examples here:

http://www.java2s.com/Code/CSharp/2D-Graphics/Drawaline.htm
0
 
LVL 1

Author Closing Comment

by:sae1962at
ID: 36520972
The example given showed me clearly how to proceed. Thank you for your help, zvytas!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
The goal of this is to tech the user how to export photos out of Lightroom and the different options they have. Select which photos you want to export : Select where you want to export and with which options : Export :
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question