05-09-2008 10:27 AM
Hi,
I have two problems with the WaveFormGraph in a visual studio 2005 application:
I have a data acquisition system which reads data from transmitters and then plot data in several WaveFormGraph (one for each transmitter). Each graph has a thread and is in a separated window.
The problem is that each WaveFormGraph uses around 15-20% of my CPU.
I plot, with the PlotY, method around 50 points every 50ms.
If my application is in background or reduced in the task bar, it uses only 2-3% of the CPU but when the graph need to be refreshed, it use all the CPU.
This is my first problem.
The second one is a crash that occurred in the WaveFormGraph. I have an exception that I can not catch. I get this stack:
************** Texte de l'exception **************
System.InvalidOperationException: La collection a été modifiée ; l'opération d'énumération peut ne pas s'exécuter.
à System.Collections.Hashtable.HashtableEnumerator.MoveNext()
à NationalInstruments.UI.Internal.by.e(ComponentDrawArgsInternal A_0)
à NationalInstruments.UI.Internal.by.b(ComponentDrawArgsInternal A_0)
à NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
à NationalInstruments.Restricted.ControlElement.DrawChildren(ComponentDrawArgsInternal args, Rectangle clipRectangle)
à NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
à NationalInstruments.Restricted.ControlElement.DrawChildren(ComponentDrawArgsInternal args, Rectangle clipRectangle)
à NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1, Boolean A_2)
à NationalInstruments.Restricted.ControlElement.a(ComponentDrawArgsInternal A_0, Rectangle A_1)
à NationalInstruments.Restricted.ControlElement.Paint(PaintEventArgs e)
à NationalInstruments.UI.WindowsForms.ControlBase.OnPaint(PaintEventArgs e)
à System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
à System.Windows.Forms.Control.WmPaint(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
My application still runs but the graph only displays a red cross.
Thanks,
Norbert
05-18-2008 11:41 AM
05-21-2008 07:19 AM