Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
f37e6775
Commit
f37e6775
authored
Nov 09, 2021
by
Volker Krause
Browse files
Use IFOPT identifiers for platform matching when present
This is much more reliable than name-based heuristics.
parent
457aa4ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/app/IndoorMapPage.qml
View file @
f37e6775
...
...
@@ -29,11 +29,14 @@ Kirigami.Page {
property
alias
map
:
map
property
string
arrivalGateName
property
string
arrivalPlatformName
property
var
arrivalPlatformMode
:
Platform
.
Rail
property
alias
arrivalPlatformName
:
platformModel
.
arrivalPlatform
.
name
property
alias
arrivalPlatformMode
:
platformModel
.
arrivalPlatform
.
mode
property
alias
arrivalPlatformIfopt
:
platformModel
.
arrivalPlatform
.
ifopt
property
string
departureGateName
property
string
departurePlatformName
property
var
departurePlatformMode
:
Platform
.
Rail
property
alias
departurePlatformName
:
platformModel
.
departurePlatform
.
name
property
alias
departurePlatformMode
:
platformModel
.
departurePlatform
.
mode
property
alias
departurePlatformIfopt
:
platformModel
.
departurePlatform
.
ifopt
property
string
region
property
string
timeZone
...
...
@@ -287,8 +290,6 @@ Kirigami.Page {
Connections
{
target
:
map
.
mapLoader
function
onDone
()
{
platformModel
.
setArrivalPlatform
(
root
.
arrivalPlatformName
,
root
.
arrivalPlatformMode
);
platformModel
.
setDeparturePlatform
(
root
.
departurePlatformName
,
root
.
departurePlatformMode
);
gateModel
.
setArrivalGate
(
root
.
arrivalGateName
);
gateModel
.
setDepartureGate
(
root
.
departureGateName
);
map
.
region
=
root
.
region
;
...
...
src/app/JourneySectionStopDelegate.qml
View file @
f37e6775
...
...
@@ -155,11 +155,13 @@ Item {
};
if
(
!
isDeparture
)
{
args
.
arrivalPlatformName
=
stop
.
hasExpectedPlatform
?
stop
.
expectedPlatform
:
stop
.
scheduledPlatform
;
args
.
arrivalPlatformMode
=
PublicTransport
.
lineModeToPlatformMode
(
stop
.
route
.
line
.
mode
)
args
.
arrivalPlatformMode
=
PublicTransport
.
lineModeToPlatformMode
(
stop
.
route
.
line
.
mode
);
args
.
arrivalPlatformIfopt
=
stop
.
stopPoint
.
identifier
(
"
ifopt
"
);
}
if
(
!
isArrival
)
{
args
.
departurePlatformName
=
stop
.
hasExpectedPlatform
?
stop
.
expectedPlatform
:
stop
.
scheduledPlatform
;
args
.
departurePlatformMode
=
PublicTransport
.
lineModeToPlatformMode
(
stop
.
route
.
line
.
mode
)
args
.
departurePlatformMode
=
PublicTransport
.
lineModeToPlatformMode
(
stop
.
route
.
line
.
mode
);
args
.
departurePlatformIfopt
=
stop
.
stopPoint
.
identifier
(
"
ifopt
"
);
}
applicationWindow
().
pageStack
.
push
(
indoorMapPage
,
args
);
}
...
...
src/app/timelinedelegatecontroller.cpp
View file @
f37e6775
...
...
@@ -575,6 +575,8 @@ QJSValue TimelineDelegateController::arrivalMapArguments() const
arrPlatform
=
res
.
value
<
TrainReservation
>
().
reservationFor
().
value
<
TrainTrip
>
().
arrivalPlatform
();
}
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformName"
),
arrPlatform
);
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformMode"
),
KOSMIndoorMap
::
Platform
::
Rail
);
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformIfopt"
),
arr
.
stopPoint
().
identifier
(
QStringLiteral
(
"ifopt"
)));
// there is no arrival gate property (yet)
// arrival time
...
...
@@ -593,6 +595,7 @@ QJSValue TimelineDelegateController::arrivalMapArguments() const
const
auto
dep
=
PublicTransport
::
firstTransportSection
(
transfer
.
journey
());
args
.
setProperty
(
QStringLiteral
(
"departurePlatformName"
),
dep
.
hasExpectedDeparturePlatform
()
?
dep
.
expectedDeparturePlatform
()
:
dep
.
scheduledDeparturePlatform
());
args
.
setProperty
(
QStringLiteral
(
"departurePlatformMode"
),
PublicTransport
::
lineModeToPlatformMode
(
dep
.
route
().
line
().
mode
()));
args
.
setProperty
(
QStringLiteral
(
"departurePlatformIfopt"
),
dep
.
from
().
identifier
(
QStringLiteral
(
"ifopt"
)));
args
.
setProperty
(
QStringLiteral
(
"endTime"
),
engine
->
toScriptValue
(
dep
.
hasExpectedDepartureTime
()
?
dep
.
expectedDepartureTime
()
:
dep
.
scheduledDepartureTime
()));
return
args
;
}
...
...
@@ -609,6 +612,8 @@ QJSValue TimelineDelegateController::arrivalMapArguments() const
depPlatform
=
nextRes
.
value
<
TrainReservation
>
().
reservationFor
().
value
<
TrainTrip
>
().
departurePlatform
();
}
args
.
setProperty
(
QStringLiteral
(
"departurePlatformName"
),
depPlatform
);
args
.
setProperty
(
QStringLiteral
(
"departurePlatformMode"
),
PublicTransport
::
lineModeToPlatformMode
(
dep
.
route
().
line
().
mode
()));
args
.
setProperty
(
QStringLiteral
(
"departurePlatformIfopt"
),
dep
.
stopPoint
().
identifier
(
QStringLiteral
(
"ifopt"
)));
if
(
JsonLd
::
isA
<
FlightReservation
>
(
nextRes
))
{
args
.
setProperty
(
QStringLiteral
(
"departureGateName"
),
nextRes
.
value
<
FlightReservation
>
().
reservationFor
().
value
<
Flight
>
().
departureGate
());
}
...
...
@@ -646,6 +651,8 @@ QJSValue TimelineDelegateController::departureMapArguments() const
depPlatform
=
res
.
value
<
TrainReservation
>
().
reservationFor
().
value
<
TrainTrip
>
().
departurePlatform
();
}
args
.
setProperty
(
QStringLiteral
(
"departurePlatformName"
),
depPlatform
);
args
.
setProperty
(
QStringLiteral
(
"departurePlatformMode"
),
KOSMIndoorMap
::
Platform
::
Rail
);
args
.
setProperty
(
QStringLiteral
(
"departurePlatformIfopt"
),
dep
.
stopPoint
().
identifier
(
QStringLiteral
(
"ifopt"
)));
if
(
JsonLd
::
isA
<
FlightReservation
>
(
res
))
{
args
.
setProperty
(
QStringLiteral
(
"departureGateName"
),
res
.
value
<
FlightReservation
>
().
reservationFor
().
value
<
Flight
>
().
departureGate
());
}
...
...
@@ -666,6 +673,7 @@ QJSValue TimelineDelegateController::departureMapArguments() const
const
auto
arr
=
PublicTransport
::
lastTransportSection
(
transfer
.
journey
());
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformName"
),
arr
.
hasExpectedArrivalPlatform
()
?
arr
.
expectedArrivalPlatform
()
:
arr
.
scheduledArrivalPlatform
());
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformMode"
),
PublicTransport
::
lineModeToPlatformMode
(
arr
.
route
().
line
().
mode
()));
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformIfopt"
),
arr
.
to
().
identifier
(
QStringLiteral
(
"ifopt"
)));
args
.
setProperty
(
QStringLiteral
(
"beginTime"
),
engine
->
toScriptValue
(
arr
.
hasExpectedArrivalTime
()
?
arr
.
expectedArrivalTime
()
:
arr
.
scheduledArrivalTime
()));
return
args
;
}
...
...
@@ -682,6 +690,8 @@ QJSValue TimelineDelegateController::departureMapArguments() const
arrPlatform
=
prevRes
.
value
<
TrainReservation
>
().
reservationFor
().
value
<
TrainTrip
>
().
arrivalPlatform
();
}
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformName"
),
arrPlatform
);
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformMode"
),
PublicTransport
::
lineModeToPlatformMode
(
dep
.
route
().
line
().
mode
()));
args
.
setProperty
(
QStringLiteral
(
"arrivalPlatformIfopt"
),
dep
.
stopPoint
().
identifier
(
QStringLiteral
(
"ifopt"
)));
// there is no arrival gate property (yet)
auto
arrTime
=
arr
.
hasExpectedArrivalTime
()
?
arr
.
expectedArrivalTime
()
:
arr
.
scheduledArrivalTime
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment