JohnW63
The on going project....
At this point, I want to print out the session names at the pit stops. What I have done so far seems to work, but ... the print out is one digit off the actual session. For example, I learned that the sessions are numbered as follows:
1 is Practice 1
2 is Practice 2
3 is Practice 3
4 is Practice 4 ( if there is a P4 )
5 is Qualifying
6 is Warm-up
7 is Race.
So that I can print out more than numbers 1 -7 as the event moves on, I setup some code in the StartSession section:
I'll probably change that all to a switch/case set of statements, when I get it working.
The variable mSessionNumber is one I created and I set it equal to the predefined variable mSession in the UpdateScoring section. This seems to work, because if I print out simply the session number in the Telemetry section, they are correct. However, in the same line of code, if I have it display the mSessionName , the first session shows as a blank, the next as Practice 1, when it is Qualifying, then Qualifying, when it is Warm-up ... etc.
My output code is like this:
I had to include the string stuff in the Example.hpp file to do this as a string :
My question is why the assignment of the name seems to be one session behind the number.
At this point, I want to print out the session names at the pit stops. What I have done so far seems to work, but ... the print out is one digit off the actual session. For example, I learned that the sessions are numbered as follows:
1 is Practice 1
2 is Practice 2
3 is Practice 3
4 is Practice 4 ( if there is a P4 )
5 is Qualifying
6 is Warm-up
7 is Race.
So that I can print out more than numbers 1 -7 as the event moves on, I setup some code in the StartSession section:
Code:
if ( mSessionNumber == 1 ){
mSessionName = "Practice 1";
}
else if ( mSessionNumber == 2 ){
mSessionName = "Practice 2";
}
else if ( mSessionNumber == 3 ){
mSessionName = "Practice 3";
}
else if ( mSessionNumber == 4 ){
mSessionName = "Practice 4";
}
else if ( mSessionNumber == 5 ){
mSessionName = "Qualifying";
}
else if ( mSessionNumber == 6 ){
mSessionName = "Warm-Up";
}
else if ( mSessionNumber == 7 ){
mSessionName = "Race";
mRaceTempRead = false;
}
I'll probably change that all to a switch/case set of statements, when I get it working.
The variable mSessionNumber is one I created and I set it equal to the predefined variable mSession in the UpdateScoring section. This seems to work, because if I print out simply the session number in the Telemetry section, they are correct. However, in the same line of code, if I have it display the mSessionName , the first session shows as a blank, the next as Practice 1, when it is Qualifying, then Qualifying, when it is Warm-up ... etc.
My output code is like this:
Code:
fprintf( fo, " Session = %s , %d \n ", mSessionName.c_str(), mSessionNumber );
I had to include the string stuff in the Example.hpp file to do this as a string :
Code:
#include <string>
using std::string;
My question is why the assignment of the name seems to be one session behind the number.