Timetable GUI: Add warnings for conditional order timetabling.

This commit is contained in:
Jonathan G Rennison
2017-12-18 01:47:22 +00:00
parent 218085c535
commit c4897f92df
2 changed files with 6 additions and 0 deletions

View File

@@ -4650,6 +4650,8 @@ STR_TIMETABLE_AUTOSEP_SINGLE_VEH :{BLACK}This tim
STR_TIMETABLE_WARNING_AUTOSEP_CONDITIONAL :{BLACK}Cannot auto separate timetable: conditional order(s) present STR_TIMETABLE_WARNING_AUTOSEP_CONDITIONAL :{BLACK}Cannot auto separate timetable: conditional order(s) present
STR_TIMETABLE_WARNING_AUTOSEP_MISSING_TIMINGS :{BLACK}Cannot auto separate timetable: wait or travel time(s) missing STR_TIMETABLE_WARNING_AUTOSEP_MISSING_TIMINGS :{BLACK}Cannot auto separate timetable: wait or travel time(s) missing
STR_TIMETABLE_WARNING_FULL_LOAD :{BLACK}Timetabling full-load orders is not recommended STR_TIMETABLE_WARNING_FULL_LOAD :{BLACK}Timetabling full-load orders is not recommended
STR_TIMETABLE_WARNING_AUTOFILL_CONDITIONAL :{BLACK}Autofill will only update taken branch of conditional orders.
STR_TIMETABLE_NON_TIMETABLED_BRANCH :{BLACK}Not all conditional order branch-taken travel times are timetabled.
# Date window (for timetable) # Date window (for timetable)

View File

@@ -569,12 +569,14 @@ struct TimetableWindow : Window {
bool have_missing_wait = false; bool have_missing_wait = false;
bool have_missing_travel = false; bool have_missing_travel = false;
bool have_bad_full_load = false; bool have_bad_full_load = false;
bool have_non_timetabled_conditional_branch = false;
const bool assume_timetabled = HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE) || HasBit(v->vehicle_flags, VF_AUTOMATE_TIMETABLE); const bool assume_timetabled = HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE) || HasBit(v->vehicle_flags, VF_AUTOMATE_TIMETABLE);
for (int n = 0; n < v->GetNumOrders(); n++) { for (int n = 0; n < v->GetNumOrders(); n++) {
const Order *order = v->GetOrder(n); const Order *order = v->GetOrder(n);
if (order->IsType(OT_CONDITIONAL)) { if (order->IsType(OT_CONDITIONAL)) {
have_conditional = true; have_conditional = true;
if (!order->IsWaitTimetabled()) have_non_timetabled_conditional_branch = true;
} else { } else {
if (order->GetWaitTime() == 0 && order->IsType(OT_GOTO_STATION)) { if (order->GetWaitTime() == 0 && order->IsType(OT_GOTO_STATION)) {
have_missing_wait = true; have_missing_wait = true;
@@ -636,6 +638,8 @@ struct TimetableWindow : Window {
} }
} }
if (have_bad_full_load) draw_info(STR_TIMETABLE_WARNING_FULL_LOAD, true); if (have_bad_full_load) draw_info(STR_TIMETABLE_WARNING_FULL_LOAD, true);
if (have_conditional && HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) draw_info(STR_TIMETABLE_WARNING_AUTOFILL_CONDITIONAL, true);
if (total_time && have_non_timetabled_conditional_branch) draw_info(STR_TIMETABLE_NON_TIMETABLED_BRANCH, false);
if (warning_count != this->summary_warnings) { if (warning_count != this->summary_warnings) {
TimetableWindow *mutable_this = const_cast<TimetableWindow *>(this); TimetableWindow *mutable_this = const_cast<TimetableWindow *>(this);