Page 1 of 1

Smith chart throws exception in WPF

Posted: Mon Sep 08, 2008 8:37 am
by 13050247
Hi,

We've implement a Smith chart using a trial version of TeeChart (TeeChart.WPF.dll version 3.5.3065.19165) and everything worked fine.

We've bought TeeChart recently and now the same Smith chart (and data) crashes our application by throwing an exception in the TeeChart API (using TeeChart.WPF.dll version 3.5.3146.24806).

We've actually tried it with another dataset (data attacted- see at bottom) and the same thing happens.
Any ideas? bug fixes?

The output is as follows for the one dataset:
--------------------------------------------------
'System.InvalidOperationException' occurred in PresentationCore.dll.
Additional information: BeginFigure must be called before this API.

Here is the callstack:
------------------------
PresentationCore.dll!System.Windows.Media.ByteStreamGeometryContext.ArcTo(System.Windows.Point point, System.Windows.Size size, double rotationAngle = 0.0, bool isLargeArc = true, System.Windows.Media.SweepDirection sweepDirection = Counterclockwise, bool isStroked = true, bool isSmoothJoin = true) + 0x15f bytes
TeeChart.WPF.dll!Steema.TeeChart.Drawing.Graphics3DWPF.Arc(double x1 = -1902.0466666666666, double y1 = -3631.1066666666666, double x2 = 2947.9533333333334, double y2 = 246.8933333333334, float startAngle = 0.0, float sweepAngle = 360.0) + 0x346 bytes
TeeChart.WPF.dll!Steema.TeeChart.Styles.Smith.DrawXCircle(double Value = 0.1, double Z = 0.0, bool ShowLabel = true) + 0x35b bytes
TeeChart.WPF.dll!Steema.TeeChart.Styles.Smith.DrawXCircleGrid() + 0x9e bytes
TeeChart.WPF.dll!Steema.TeeChart.Styles.Smith.DrawAxis() + 0x36 bytes
TeeChart.WPF.dll!Steema.TeeChart.Styles.Smith.DoBeforeDrawValues() + 0x3b1 bytes
TeeChart.WPF.dll!Steema.TeeChart.Styles.Series.DrawSeries() + 0x4b2 bytes
TeeChart.WPF.dll!Steema.TeeChart.Chart.InternalDraw(System.Windows.Media.DrawingContext g = {System.Windows.Media.VisualDrawingContext}, bool noTools = false) + 0x64a bytes
TeeChart.WPF.dll!Steema.TeeChart.Chart.InternalDraw(System.Windows.Media.DrawingContext g = {System.Windows.Media.VisualDrawingContext}) + 0x28 bytes
TeeChart.WPF.dll!Steema.TeeChart.WPF.TChart.Draw(System.Windows.Media.DrawingContext g = {System.Windows.Media.VisualDrawingContext}) + 0x13b bytes
TeeChart.WPF.dll!Steema.TeeChart.WPF.TChart.OnRender(System.Windows.Media.DrawingContext drawingContext = {System.Windows.Media.VisualDrawingContext}) + 0x26 bytes
PresentationCore.dll!System.Windows.UIElement.Arrange(System.Windows.Rect finalRect) + 0x560 bytes
PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout() + 0x24d bytes
PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayoutCallback(object arg) + 0x19 bytes
PresentationCore.dll!System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() + 0x10 bytes
PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() + 0x97 bytes
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget = null) + 0x80 bytes
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandler(object resizedCompositionTarget) + 0x2b bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback = {Method = {System.Object RenderMessageHandler(System.Object)}}, object args = null, bool isSingleParameter = true) + 0x8a bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher}, System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler = null) + 0x4a bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler) + 0x44 bytes
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() + 0x5d bytes
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state) + 0x38 bytes
mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x51 bytes
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x67 bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x45 bytes
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() + 0x63 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() + 0x127 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x63 bytes
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd = 1838288, int msg = 49957, System.IntPtr wParam = 0, System.IntPtr lParam = 0, ref bool handled = false) + 0xbe bytes
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x7a bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback = {Method = {System.Object DispatcherCallbackOperation(System.Object)}}, object args = {MS.Win32.HwndSubclass.DispatcherOperationCallbackParameter}, bool isSingleParameter = true) + 0x8a bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher}, System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler = null) + 0x4a bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler) + 0x44 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, bool isSingleParameter) + 0x91 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority priority, System.Delegate method, object arg) + 0x40 bytes
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd = 1838288, int msg = 49957, System.IntPtr wParam = 0, System.IntPtr lParam = 0) + 0xdc bytes
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame = {System.Windows.Threading.DispatcherFrame}) + 0xc7 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) + 0x49 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.Run() + 0x4c bytes
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) + 0x1e bytes
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0x6f bytes
PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) + 0x26 bytes
PresentationFramework.dll!System.Windows.Application.Run() + 0x19 bytes

---------------------------------------------------------------
Data:
------

214.920031528386000 , -20.767120843194900
212.384275909625000 , -25.790982419379600
211.408670196120000 , -29.746008576673800
207.347681730249000 , -39.239055629026700
198.681947784138000 , -43.020460438000000
195.359292248533000 , -41.601870248062400
187.325938283753000 , -50.578793034748300
179.659210287007000 , -45.218138472890700
184.064202048898000 , -40.930821874346000
168.408961840477000 , -50.693466411165800
169.367792338422000 , -33.414555971169100
187.729579349676000 , -43.919901808788800
179.241884934402000 , -58.542381861266500
160.354088353693000 , -58.696432036481200
155.321338058296000 , -22.071967985351600
199.539579943738000 , -47.039815775115900
168.170924296514000 , -73.840736152832400
147.955608564362000 , -67.956462030311600
134.781070209874000 , -52.762104499959600
-----------------------------------------------------------------

Posted: Mon Sep 08, 2008 9:12 am
by narcis
Hi Sean,

I've been able to reproduce the problem here and added it (TF02013384) to the defect list to be fixed for next releases.

Posted: Mon Sep 08, 2008 12:27 pm
by 13050247
You mention that you will fix it in the next release(s). By when can we expect such a release?

We decided to buy TeeChart recently mainly because it supports Smith charts and we need Smith charts *now*.
We would have opted for a different charting library if this was not the case.

So not having Smith charts now is quite a problem for our management, as this equates TeeChart equal to other charting libraries we considered. This situation is magnified since we are still in our 30 day refund period.

Any chance you will be able to fix it soon?

Posted: Mon Sep 08, 2008 12:44 pm
by narcis
Hi Sean,

Using our current sources, I could reproduce the issue using the WPFDemo shipped with TeeChart. Using the values you posted worked fine but the exception ocurred when I enabled the "2D" checkbox. Is this the same behaviour you are experiencing?

Thanks in advance.

Posted: Mon Sep 08, 2008 12:50 pm
by 13050247
Hi NarcĂ­s,

Yip, same here.

I load the WPFDemo, change the series to a Smith series, click 2D, and boom!, crash.

Posted: Mon Sep 08, 2008 1:58 pm
by 13050247
I've made a workaround in our code to select the SmithChart as a 3D chart, and then it works (to some degree). The chart is rendered correctly, it is also resized correctly, but when it has to be redrawn (e.g. changing to a different tab in our application, and then going back to the tab the charts are displayed on), then it crashes with a similar 'invalid operation' exception.

Posted: Tue Sep 09, 2008 7:50 am
by narcis
Hi Sean,

The problem is resolved for inclusion in the next maintenance release that should be available shortly.

Posted: Tue Sep 09, 2008 8:28 am
by 13050247
Awesome!

Thanx for the quick support. We'll integrate the new version of TeeChart when it comes available. You have any idea when that may be? Weeks? Months?

ciao,
Sean.

Posted: Tue Sep 09, 2008 9:15 am
by narcis
Hi Sean,

You're welcome.

We haven't fixed a date for the next maintenance release. However, considering that recently a new build is published every 4-6 weeks and that last release was published on 12th August, I imagine (just my opinion) that you can expect the next release to be out before the end of this month.

I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements.