Page 1 of 1

chart shows no data unless added before calling subroutines

Posted: Thu Jul 22, 2004 3:31 pm
by 8119959
My chart has 2 "line" series that display OK when their data is added in code contained in form1's activated event subroutine.

However, if the same code is executed in another subroutine in form1.vb, as part of a second thread, the chart shows no data. That thread is started by the activated event.

I tried adding calls the following calls to the (parent) process that execute after the addition of data:
.Repaint(), .Show(), .Update() and similar methods

This does not help.

The chart itself is public to all code. Is it worth me emailing the code to you to review ? It is a small app with only one chart and ~200 hundred lines of VB .Net code.

Posted: Thu Jul 22, 2004 11:36 pm
by Pep
Hi,

have you tried calling the Refresh method ? :
tChart1.Refresh();

Posted: Fri Jul 23, 2004 6:40 pm
by 8119959
Yes, I did try .Refresh(), and I tried it again today.

When the .Add() code works (outside of the thread), there is no .Refresh() or similar method required.

Posted: Tue Jul 27, 2004 12:04 pm
by Chris
Hi -
The chart itself is public to all code. Is it worth me emailing the code to you to review ? It is a small app with only one chart and ~200 hundred lines of VB .Net code.
If you could send a small project to:
news://www.berneda.com/steema.public.attachments

that I can run "as-is" to reproduce the problem here then that would be greatly appreciated.

Many thanks!

Posted: Tue Aug 10, 2004 2:25 pm
by 8119959
We just loaded 4 files into the newsgroup you specified. The files are:

Readme.txt
alignStep.zip
teeClient.py
teeX.dat

I am sorry for not responding earlier, as I was on holidays. :D

Posted: Mon Aug 16, 2004 11:10 am
by Chris
Hi --

I've just run your test project with TeeChart for .NET version 1.1.1675.27998 (the latest release). Setting chartTest to true and running the project causes both the Transmit and Reflect series to adisplay properly ... what should I be looking for here? Could you tell me the steps I need to take to reproduce the problem?

Many thanks!

Posted: Mon Aug 16, 2004 4:07 pm
by 8119959
Thank you for responding. Please read the content of 'Readme.txt'. The presence of this file was noted in my previous post.

As noted in that file, 'chartTest' needs to be false. If getting input via a socket is awkward for you to test with, feel free to just modify the app to hardcode that input. Or I can do that for you.

Posted: Tue Aug 17, 2004 8:58 am
by Chris
Hi ..

Using the python scripts downloadable from http://www.codesampler.com/source/py_socket.zip
I can create a client-server connection through port 2096 on my machine.

I now set ipPort to 2096, localAddr to 172.26.0.3 and chartTest to false and run your application. This is the output copied from lastRun.txt:

Code: Select all

starting alignStep ...
sweep start = 0, end = 3
coarse step = 0.1, fine step (unused) = 0.05
coarse tol = 0.1, fine tol = 0.01
started TcpListener on port 2096
starting getIP_String ...
listening on port (should not be blocking) 2096
alignStep closing ...
Caught system null reference exception - likely no connection active.
The problem, AFAIC, is in the getIP_String() function where the following line:

Code: Select all

Dim stream As NetworkStream = conn.GetStream()
consistantly throws a null reference exception.

Posted: Thu Sep 23, 2004 3:25 pm
by 8119959
We loaded 2 new files in the directory you mentioned earlier:

atsChartTest.zip
atsReadme0921.txt

Please read the text file to understand how I simplified the application you tested earlier. It should now be much easier for you to run our app, without having to use sockets or data files.

Thank you.

Posted: Mon Sep 27, 2004 2:47 pm
by Chris
Hi -
We loaded 2 new files in the directory you mentioned earlier:

atsChartTest.zip
atsReadme0921.txt

Please read the text file to understand how I simplified the application you tested earlier. It should now be much easier for you to run our app, without having to use sockets or data files.
Thank you.

I have run your code and can see that no data is being added to the chart.

So, I made an experiment; I added a ListBox to the form and then everywhere data was being added to the chart (using the Steema.TeeChart.Styles.Series.Add Method) I added a line similar to the following:
ListBox1.Items.Add(AngleC(i).ToString() + currentsA(i).ReflectC.ToString())

Running you code again *did not add any data to the ListBox*. This means that the problem with data flow in your application is not specific to TeeChart.

Please let me know if you want me to post my modifications to the attachments newsgroup.

Posted: Mon Sep 27, 2004 5:22 pm
by 8119959
Thank you again Chris,

If I am understanding your post correctly, the problem we see is in VS and/or Windows 2000/XP, no ?

May I ask what versions of VS and Windows 2000/XP you used to do your test ?

If you have seen a problem similar to this before, could you give us any suggestions on resolving it or finding a workaround ?

Cheers.

Posted: Tue Sep 28, 2004 5:40 am
by Chris
Hi,
Thank you again Chris,
You're welcome :)
If I am understanding your post correctly, the problem we see is in VS and/or Windows 2000/XP, no ?

May I ask what versions of VS and Windows 2000/XP you used to do your test ?
I'm running VS.NET 2003 and Windows 2003.
If you have seen a problem similar to this before, could you give us any suggestions on resolving it or finding a workaround ?
No, I haven't seen this problem before. If I was you I would start stripping the code down to its bare essentials to see where the problem is occurring.