Tracerestrict: Add condition whether reservation passes through tile

This commit is contained in:
Jonathan G Rennison
2023-02-06 19:54:14 +00:00
parent 07c923eceb
commit 07b7cc5652
7 changed files with 192 additions and 7 deletions

View File

@@ -154,6 +154,7 @@ enum TraceRestrictItemType {
TRIT_COND_RESERVED_TILES = 29, ///< Test reserved tiles ahead of train
TRIT_COND_CATEGORY = 30, ///< Test train category
TRIT_COND_TARGET_DIRECTION = 31, ///< Test direction of order target tile relative to this signal tile
TRIT_COND_RESERVATION_THROUGH = 32, ///< Test if train reservation passes through tile
TRIT_COND_END = 48, ///< End (exclusive) of conditional item types, note that this has the same value as TRIT_REVERSE
TRIT_REVERSE = 48, ///< Reverse behind signal
@@ -666,7 +667,8 @@ static inline bool IsTraceRestrictConditional(TraceRestrictItem item)
static inline bool IsTraceRestrictDoubleItem(TraceRestrictItem item)
{
const TraceRestrictItemType type = GetTraceRestrictType(item);
return type == TRIT_COND_PBS_ENTRY_SIGNAL || type == TRIT_COND_SLOT_OCCUPANCY || type == TRIT_COUNTER || type == TRIT_COND_COUNTER_VALUE || type == TRIT_COND_TIME_DATE_VALUE;
return type == TRIT_COND_PBS_ENTRY_SIGNAL || type == TRIT_COND_SLOT_OCCUPANCY || type == TRIT_COUNTER ||
type == TRIT_COND_COUNTER_VALUE || type == TRIT_COND_TIME_DATE_VALUE || type == TRIT_COND_RESERVATION_THROUGH;
}
/**
@@ -717,6 +719,7 @@ enum TraceRestrictValueType {
TRVT_SPEED_ADAPTATION_CONTROL = 48,///< takes a TraceRestrictSpeedAdaptationControlField
TRVT_SIGNAL_MODE_CONTROL = 49,///< takes a TraceRestrictSignalModeControlField
TRVT_ORDER_TARGET_DIAGDIR = 50,///< takes a DiagDirection, and the order type in the auxiliary field
TRVT_TILE_INDEX_THROUGH = 51,///< takes a TileIndex in the next item slot (passes through)
};
/**
@@ -871,6 +874,11 @@ static inline TraceRestrictTypePropertySet GetTraceRestrictTypeProperties(TraceR
out.cond_type = TRCOT_BINARY;
break;
case TRIT_COND_RESERVATION_THROUGH:
out.value_type = TRVT_TILE_INDEX_THROUGH;
out.cond_type = TRCOT_BINARY;
break;
default:
NOT_REACHED();
break;