Page 1 of 1

Unexpected behavior when using TimePlot constructor

Posted: Sat Apr 06, 2019 9:30 pm
by RBerliner
In the Sinewave example in an Arduino Uno, if I enable channels and specify the output stream as:

TimePlot MyPlot("Waveforms", Serial);

I find that the remaining setup commands

MyPlot.SetXlabel("Time");
MyPlot.SetYlabel("Amplitude");

// Set the plotting parameters. "Sinewave" = series name, Plot::Blue = line colour
// 2 = line width, Plot::Square = marker style
MyPlot.SetSeriesProperties("Sinewave", Plot::Blue, Plot::Solid, 2, Plot::Square);
MyPlot.SetSeriesProperties("Cosinewave", Plot::Red, Plot::Solid, 2, Plot::Square);

have no effect.

Is this a bug or a feature or simply operator error?

Re: Unexpected behavior when using TimePlot constructor

Posted: Sun Apr 07, 2019 8:12 am
by philr
Seems to work fine for me. Maybe you have accidentally selected no channels.
x2scrap.png
x2scrap.png (16.63 KiB) Viewed 12115 times
Make sure either of the highlighted bits in the picture are highlighted otherwise I dont think it will work.

Cheers
Phil

Re: Unexpected behavior when using TimePlot constructor

Posted: Mon Jun 17, 2019 8:42 pm
by ceremona
I see this problem as well. The advice about selecting highlighted values doesn't seem to do anything.

Not sure if this is related but when I attempt to look at Series Properties, it asks me to select a series. Not sure what it expects me to do. The graph is showing up ok, it just ignores any values I set for shape and color in the arduino code if they aren't the default.

Is there a list of known bugs somewhere? I am evaluating this software and I need to know what is possible.

Re: Unexpected behavior when using TimePlot constructor

Posted: Wed Jun 19, 2019 5:26 am
by philr
Hi Ceremona, did you have any luck with this?

Re: Unexpected behavior when using TimePlot constructor

Posted: Wed Jun 19, 2019 5:43 am
by philr
I tested this myself and it seemed to work fine. The important thing to realise is that the message is only sent once when the system boots. You can also get it to send it with each SendData call. See below for example.
MyPlot.SendData(F("Sinewave"), dY, Plot::Yellow, Plot::Solid, 2, Plot::Square);

Try this and see if it works.

Cheers
Phil

Re: Unexpected behavior when using TimePlot constructor

Posted: Tue Jun 25, 2019 7:35 pm
by ceremona
Hi.

Sorry for the late reply. I would rather just set these color shape aesthetic properties once via the SetSeriesProperties function. From reading the docs it's not clear to me what using SendData(F("temp"),...) does vs just SendData("temp",...). It looks like the same logic can be used in the SetSeriesProperties function as well, but I don't see it taking effect in the actual graph. The properties settings in the GUI seem to always override.

As an unrelated issue or feature request. It would be nice to be able to specifiy the date and time formats for the logging file name as well as delimeter between fields within the log. Right now my Windows 7 system barfs at files that use timestamps in the name due to the use of a colon. I can imagine a lot of people encounter that problem.

Re: Unexpected behavior when using TimePlot constructor

Posted: Mon Jul 01, 2019 8:49 am
by philr
The F("") notation is a trick in Arduino to store strings in flash memory. This is useful as strings take up a lot of ram.

You can definitely use SetSeriesProperties but be careful that if your arduino boots up before MegunoLink is connected we will likely miss that message and so the properties wont be set. If you set the style in the individual messages it wont be missed.

Cheers
Phil