Art, do you have a suggestion as to how to initialize this menu?

The very first time it comes to this dialog there are no data channel names loaded into PlotPrefs(), and this is supposed to initialize them. Once you load defaults for these and close the menu, it comes back into this same code to set up the menu again the next time the user wants to change things.

I couldn't come up with a clever way to easily determine if things have been set up already or not.




________________________________
 From: arthare <notifications@github.com>
To: arthare/wifilapper <wifilapper@noreply.github.com> 
Cc: KDJones2 <KDJones2@yahoo.com> 
Sent: Wednesday, April 3, 2013 6:05 AM
Subject: Re: [wifilapper] Added Settings.txt additional display options (#18)
 

In PitsideConsole/PitsideConsole/DlgPlotSelect.cpp:
> @@ -150,7 +150,7 @@ void LoadLaps(ILapReceiver* pReceiver, int m_iRaceId)
>          case WM_INITDIALOG:
>          {
>            //  Initialize all data channels, if not already set by user.
> -          //  Assumes first data channel will always be a graph
> +          //  Assumes first data channel will be either true or false if user has set things up already
>            if (!m_sfLapOpts->m_PlotPrefs[1].iPlotView == false && !m_sfLapOpts->m_PlotPrefs[1].iPlotView == true)
>            { 
I don't understand - there's no point having code that will never execute, and unless m_PlotPrefs is an std::map, I don't think there'll be any side effects from your if statement, so nothing is getting done here.  I wonder if the optimizer takes it out entirely...
—
Reply to this email directly or view it on GitHub.