Skip to content

Commit

Permalink
Added some more information in the help page.
Browse files Browse the repository at this point in the history
Changed order of applied pit-options.
If pit-options fails somehow, try to continue, but leave the pit-menu open and do not request box-this-lap.
Ready for release version 1.2
  • Loading branch information
Vantskruv committed Oct 3, 2021
1 parent 76e2640 commit 61b5627
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 14 deletions.
19 changes: 11 additions & 8 deletions FR3E_SD_Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ void FR3E_SD_Plugin::KeyUpForAction(const std::string& inAction, const std::stri
pitOptions = {
{R3E_PIT_MENU_PENALTY, serve_penalty},
{R3E_PIT_MENU_DRIVERCHANGE, driver_change},
{R3E_PIT_MENU_FUEL, refuel_option != NO_REFUEL},
{R3E_PIT_MENU_FRONTTIRES, front_tires},
{R3E_PIT_MENU_REARTIRES, rear_tires},
{R3E_PIT_MENU_BODYWORK, bodywork},
{R3E_PIT_MENU_FRONTAERO, front_wing},
{R3E_PIT_MENU_REARAERO, rear_wing},
{R3E_PIT_MENU_SUSPENSION, suspension},
{R3E_PIT_MENU_FRONTTIRES, front_tires},
{R3E_PIT_MENU_REARTIRES, rear_tires},
{R3E_PIT_MENU_FUEL, refuel_option != NO_REFUEL} };
{R3E_PIT_MENU_SUSPENSION, suspension}
};

iRefuelOption = refuel_option - REFUEL_SAFE;
}
Expand All @@ -141,13 +142,15 @@ void FR3E_SD_Plugin::KeyUpForAction(const std::string& inAction, const std::stri
pitOptions = {
{R3E_PIT_MENU_PENALTY, EPLJSONUtils::GetBoolByName(settings, "serve_penalty", false)},
{R3E_PIT_MENU_DRIVERCHANGE, EPLJSONUtils::GetBoolByName(settings, "driver_change", false)},
{R3E_PIT_MENU_FUEL, iRefuelOption},
{R3E_PIT_MENU_FRONTTIRES, EPLJSONUtils::GetBoolByName(settings, "front_tires", false)},
{R3E_PIT_MENU_REARTIRES, EPLJSONUtils::GetBoolByName(settings, "rear_tires", false)},
{R3E_PIT_MENU_BODYWORK, EPLJSONUtils::GetBoolByName(settings, "fix_bodywork", false)},
{R3E_PIT_MENU_FRONTAERO, EPLJSONUtils::GetBoolByName(settings, "fix_front_aero", false)},
{R3E_PIT_MENU_REARAERO, EPLJSONUtils::GetBoolByName(settings, "fix_rear_aero", false)},
{R3E_PIT_MENU_SUSPENSION, EPLJSONUtils::GetBoolByName(settings, "fix_suspension", false)},
{R3E_PIT_MENU_FRONTTIRES, EPLJSONUtils::GetBoolByName(settings, "front_tires", false)},
{R3E_PIT_MENU_REARTIRES, EPLJSONUtils::GetBoolByName(settings, "rear_tires", false)},
{R3E_PIT_MENU_FUEL, iRefuelOption} };
{R3E_PIT_MENU_SUSPENSION, EPLJSONUtils::GetBoolByName(settings, "fix_suspension", false)}
};

}

mConnectionManager->SetState(0, inContext);
Expand Down
2 changes: 1 addition & 1 deletion com.vantdev.r3einterface.sdPlugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"Name": "Raceroom Interface",
"Category": "Raceroom Interface",
"Icon": "R3E",
"Version": "1.1",
"Version": "1.2",
"OS": [
{
"Platform": "windows",
Expand Down
23 changes: 20 additions & 3 deletions com.vantdev.r3einterface.sdPlugin/propertyinspector/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,40 @@
and you can also set the different background icons for the different states.
<br>
</div>

<div class="sdpi-heading"><b>The Fuel Calc option</b></div>
<div>
This fuel-option calculates the required fuel for the session. It relies on your best lap-time (if running a timed session),
and Racerooms internal calculation of fuel/lap.<br>
If there is no valid lap-time (if running a timed session), or no valid fuel/lap calculation, a box-this-lap will not be
requested, and the pit-menu will not be closed to notify you about that.
It is recommened to drive a couple of clean laps with good average laptimes, to get the best approximation of how much
fuel is required til the end of the session.<br>
No responsibility from my end will be taken if you end up with not enough fuel in the end of the session.
<br>
</div>

<div class="sdpi-heading"><b>When it fails</b></div>
<div>
If you request box this lap and some options are not available in the pit-menu, the pit-stop execution may stop
and leaving the pit-menu open, even if the <b>'Close pit menu when finished is checked'</b> in the request box button.<br>
If you request box this lap and some options are not available in the pit-menu, the pit-stop execution may leave
the pit-menu open and not request box this lap, even if the <b>'Close pit menu when finished is checked'</b> in the
request box button.<br>
The purpose for this is to notify the driver some important pitstop-options did not work.<br>
<br>
This will happen when:<br>
<br>
these options are active or not:<br>
* Change tires<br>
* Refuel<br>
* Refuel (i.e. this can happen if the 'Calc' option is set with no valid lap-times)<br>
<br>
these options are active:<br>
* Serve penalty<br>
* Driver change<br>
<br>
The fix options (bodywork, suspension and so on) will be ignored, even if active.<br>
<br>
The pit-stop execution will try to set all the pit-options, even if it failed with some of the options.<br>
If you want to manually alter any pit-menu settings, let the pit-stop execution finish (the request box button stops blinking).
</div>
</div>
</body>
Expand Down
10 changes: 8 additions & 2 deletions r3esd_src/FR3EData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,19 @@ void FR3EData::thread_setPitOptions()
//From the right we have, SAFE, NORMAL, RISKY, and the N liters (up to the total fuel capacity of the car)

bool bSuccess = true;

for (auto iPitOption : currentPitOptions)
{
if (abortOnGoingPitOptions || !setPitOption(iPitOption.first, iPitOption.second, current_refuel_option)) { bSuccess = false; break; }
if (abortOnGoingPitOptions)
{
bSuccess = false;
break;
}
if(!setPitOption(iPitOption.first, iPitOption.second, current_refuel_option)) { bSuccess = false;}
std::this_thread::sleep_for(std::chrono::milliseconds(waitBetweenEachCommands));
}

if (bSuccess && !abortOnGoingPitOptions)
if (bSuccess)
{
if (current_request_boxthislap && r3eSharedData->pit_state <1) // Request pitstop
{
Expand Down

0 comments on commit 61b5627

Please sign in to comment.