Commit 537e247d authored by Volker Krause's avatar Volker Krause
Browse files

Consider 1154UT vendor blocks for determining validity and passenger name

parent 50599678
Pipeline #264870 passed with stage
in 8 minutes and 34 seconds
......@@ -291,6 +291,15 @@ QDateTime Uic9183Parser::validFrom() const
return dt;
}
// CD vender block
if (const auto b = findBlock<Vendor1154UTBlock>(); b.isValid()) {
const auto subBlock = b.findSubBlock("OD");
qDebug() << subBlock.toString();
if (!subBlock.isNull()) {
return QDateTime::fromString(subBlock.toString(), QStringLiteral("dd.MM.yyyy hh:mm"));
}
}
// RCT2
if (const auto rct2 = rct2Ticket(); rct2.isValid()) {
const auto dt = rct2.firstDayOfValidity();
......@@ -323,8 +332,7 @@ QDateTime Uic9183Parser::validUntil() const
}
// DB vendor block
const auto b = findBlock<Vendor0080BLBlock>();
if (b.isValid() && b.orderBlockCount() == 1) {
if (const auto b = findBlock<Vendor0080BLBlock>(); b.isValid() && b.orderBlockCount() == 1) {
return QDateTime(b.orderBlock(0).validTo(), {23, 59, 59});
}
......@@ -339,6 +347,16 @@ QDateTime Uic9183Parser::validUntil() const
return dt;
}
// CD vender block
if (const auto b = findBlock<Vendor1154UTBlock>(); b.isValid()) {
const auto subBlock = b.findSubBlock("DO");
qDebug() << subBlock.toString();
if (!subBlock.isNull()) {
return QDateTime::fromString(subBlock.toString(), QStringLiteral("dd.MM.yyyy hh:mm"));
}
}
// RCT2 RPT according to ERA TAP TSI Annex B.6
if (const auto rct2 = rct2Ticket(); rct2.isValid() && rct2.type() == Rct2Ticket::RailPass) {
const auto validityRange = ticketLayout().text(3, 1, 36, 1).trimmed();
......@@ -387,6 +405,15 @@ Person Uic9183Parser::person() const
return p;
}
}
// CD vender block
if (const auto b = findBlock<Vendor1154UTBlock>(); b.isValid()) {
const auto subBlock = b.findSubBlock("KJ");
if (!subBlock.isNull()) {
Person p;
p.setName(subBlock.toString());
return p;
}
}
// RCT2 tickets
const auto rct2 = rct2Ticket();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment