KPublicTransport::JourneySection
#include <journey.h>
Public Types | |
enum | Mode { Invalid = 0 , PublicTransport = 1 , Transfer = 2 , Walking = 4 , Waiting = 8 , RentedVehicle = 16 , IndividualTransport = 32 } |
typedef QFlags< Mode > | Modes |
Static Public Member Functions | |
static std::vector< JourneySection > | fromJson (const QJsonArray &array) |
static JourneySection | fromJson (const QJsonObject &obj) |
static bool | isSame (const JourneySection &lhs, const JourneySection &rhs) |
static JourneySection | merge (const JourneySection &lhs, const JourneySection &rhs) |
static Q_INVOKABLE QString | modeIconName (KPublicTransport::JourneySection::Mode mode) |
static QJsonObject | toJson (const JourneySection §ion) |
static QJsonArray | toJson (const std::vector< JourneySection > §ions) |
Detailed Description
A segment of a journey plan.
Also used for trips, ie. a single full vehicle run along a route.
This consists of a departure and an arrival stopover as well as zero or more intermediate stopovers. For extracting sub-journeys those can be addresses by a numeric index. Index 0 refers to the departure, 1 to N refer to the n-th intermediate stopover and N + 1 refers to the arrival, for N intermediate stops.
Member Typedef Documentation
◆ Modes
typedef QFlags< Mode > KPublicTransport::JourneySection::Modes |
Member Enumeration Documentation
◆ Mode
Mode of transport.
These categories are fairly coarse, for a more detailed break-down of PublicTransport see Line::Mode.
Property Documentation
◆ arrival
|
read |
◆ arrivalDelay
|
read |
◆ arrivalPlatformChanged
|
read |
◆ arrivalPlatformLayout
|
readwrite |
◆ arrivalVehicleLayout
|
readwrite |
◆ co2Emission
|
readwrite |
COâ‚‚ emission during this journey section, in gram.
In case the backend doesn't provide this value, it is estimated based on the distance travelled during this section and the mode of transport, based on average emission values from https://en.wikipedia.org/wiki/Environmental_impact_of_transport This value can be 0 (e.g. in case of walk or wait sections), or -1 if no information is available.
◆ departure
|
read |
◆ departureDelay
|
read |
◆ departurePlatformChanged
|
read |
◆ departurePlatformLayout
|
readwrite |
◆ departureVehicleLayout
|
readwrite |
◆ disruptionEffect
|
readwrite |
Disruption effect on this section, if any.
◆ distance
|
readwrite |
◆ duration
|
read |
◆ expectedArrivalPlatform
|
readwrite |
◆ expectedArrivalTime
|
readwrite |
◆ expectedDeparturePlatform
|
readwrite |
◆ expectedDepartureTime
|
readwrite |
◆ features
|
read |
◆ from
|
readwrite |
◆ hasExpectedArrivalPlatform
|
read |
◆ hasExpectedArrivalTime
|
read |
◆ hasExpectedDeparturePlatform
|
read |
◆ hasExpectedDepartureTime
|
read |
◆ iconName
|
read |
◆ individualTransport
|
readwrite |
◆ intermediateStops
|
read |
◆ label
|
read |
◆ loadInformation
|
readwrite |
◆ maximumOccupancy
|
read |
◆ mode
|
readwrite |
◆ notes
|
readwrite |
◆ path
|
readwrite |
◆ rentalVehicle
|
readwrite |
◆ route
|
readwrite |
◆ scheduledArrivalPlatform
|
readwrite |
◆ scheduledArrivalTime
|
readwrite |
◆ scheduledDeparturePlatform
|
readwrite |
◆ scheduledDepartureTime
|
readwrite |
◆ to
|
readwrite |
Member Function Documentation
◆ addNote()
void JourneySection::addNote | ( | const QString & | note | ) |
Adds a note.
This will check for duplicates and normalize the notes.
Definition at line 224 of file journey.cpp.
◆ addNotes()
void JourneySection::addNotes | ( | const QStringList & | notes | ) |
Definition at line 234 of file journey.cpp.
◆ applyMetaData()
void JourneySection::applyMetaData | ( | bool | download | ) |
Augment line meta data.
- Parameters
-
download if set to true
, trigger the download of locally missing assets.
Definition at line 673 of file journey.cpp.
◆ arrival()
|
nodiscard |
Returns the arrival stopover of this journey section.
This is the same information as accessible by individual properties, so this is mainly useful if you have to interface with code expecting a Stopover object.
Definition at line 296 of file journey.cpp.
◆ arrivalDelay()
|
nodiscard |
Definition at line 115 of file journey.cpp.
◆ arrivalPlatformChanged()
|
nodiscard |
Definition at line 219 of file journey.cpp.
◆ departure()
|
nodiscard |
Returns the departure stopover of this journey section.
This is the same information as accessible by individual properties, so this is mainly useful if you have to interface with code expecting a Stopover object.
Definition at line 266 of file journey.cpp.
◆ departureDelay()
|
nodiscard |
Definition at line 102 of file journey.cpp.
◆ departurePlatformChanged()
|
nodiscard |
Definition at line 187 of file journey.cpp.
◆ duration()
|
nodiscard |
Definition at line 123 of file journey.cpp.
◆ features()
|
nodiscard |
Vehicle features.
This is identical to departureVehicleLayout.features and provided for convenience for cases where no more detailed vehicle information are available.
Definition at line 457 of file journey.cpp.
◆ fromJson() [1/2]
|
staticnodiscard |
Deserialize a vector of journey sections from JSON.
Definition at line 882 of file journey.cpp.
◆ fromJson() [2/2]
|
staticnodiscard |
Deserialize an object from JSON.
Definition at line 862 of file journey.cpp.
◆ hasExpectedArrivalPlatform()
|
nodiscard |
Definition at line 214 of file journey.cpp.
◆ hasExpectedArrivalTime()
|
nodiscard |
Definition at line 110 of file journey.cpp.
◆ hasExpectedDeparturePlatform()
|
nodiscard |
Definition at line 182 of file journey.cpp.
◆ hasExpectedDepartureTime()
|
nodiscard |
Definition at line 97 of file journey.cpp.
◆ hasIdentifier()
|
nodiscard |
Definition at line 549 of file journey.cpp.
◆ hasIdentifiers()
|
nodiscard |
Returns true
if there is any identifier set at all.
This is usually a prerequisite for efficient trip queries.
Definition at line 560 of file journey.cpp.
◆ iconName()
|
nodiscard |
Definition at line 473 of file journey.cpp.
◆ identifier()
|
nodiscard |
Backend-specific journey section identifiers.
Definition at line 544 of file journey.cpp.
◆ indexOfStopover()
|
nodiscard |
Returns the index of stop
in this journey section.
- Returns
- -1 if
stop
isn't found.
Definition at line 596 of file journey.cpp.
◆ intermediateStops()
|
nodiscard |
Intermediate stop-overs along this journey section.
This does not include the departure and arrival stops, and might be empty on backends not providing this information.
Definition at line 241 of file journey.cpp.
◆ isSame()
|
staticnodiscard |
Checks if two instances refer to the same journey section (which does not necessarily mean they are exactly equal).
Definition at line 688 of file journey.cpp.
◆ label()
|
nodiscard |
Definition at line 515 of file journey.cpp.
◆ loadInformation()
|
nodiscard |
Vehicle load information for this journey section, if available.
Definition at line 425 of file journey.cpp.
◆ maximumOccupancy()
|
nodiscard |
Definition at line 537 of file journey.cpp.
◆ merge()
|
staticnodiscard |
Merge two instances.
This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.
Definition at line 738 of file journey.cpp.
◆ modeIconName()
|
staticnodiscard |
Icon representing the journey section mode mode
.
Can be a qrc: or file: URL or an XDG icon name.
Definition at line 493 of file journey.cpp.
◆ setArrival()
void JourneySection::setArrival | ( | const Stopover & | arrival | ) |
Sets all arrival properties from a given Stopover.
This effects location and time, but doesn't modify intermediate stops or paths.
Definition at line 311 of file journey.cpp.
◆ setDeparture()
void JourneySection::setDeparture | ( | const Stopover & | departure | ) |
Sets all departure properties from a given Stopover.
This effects location and time, but doesn't modify intermediate stops or paths.
Definition at line 282 of file journey.cpp.
◆ setFeatures()
void JourneySection::setFeatures | ( | std::vector< KPublicTransport::Feature > && | features | ) |
Definition at line 467 of file journey.cpp.
◆ setIdentifier()
Definition at line 554 of file journey.cpp.
◆ setIntermediateStops()
void JourneySection::setIntermediateStops | ( | std::vector< Stopover > && | stops | ) |
Set the intermediate stops.
Definition at line 252 of file journey.cpp.
◆ setLoadInformation()
void JourneySection::setLoadInformation | ( | std::vector< LoadInfo > && | loadInfo | ) |
Set the vehicle load information for this journey section.
Definition at line 436 of file journey.cpp.
◆ setStopovver()
void JourneySection::setStopovver | ( | qsizetype | idx, |
const Stopover & | stop ) |
Set the stopover at index idx
.
If idx
is not a valid index nothing is done.
Definition at line 580 of file journey.cpp.
◆ stopover()
|
nodiscard |
Retrieve stopover at index idx
.
Definition at line 565 of file journey.cpp.
◆ subsection()
|
nodiscard |
Returns the sub-journey starting from index begin
until end
(inclusive).
Both begin
and end
have to be valid indices and end
has to be strictly larger than begin
, otherwise an invalid journey section is returned.
Definition at line 610 of file journey.cpp.
◆ takeFeatures()
|
nodiscard |
Definition at line 462 of file journey.cpp.
◆ takeIntermediateStops()
std::vector< Stopover > && JourneySection::takeIntermediateStops | ( | ) |
Moves the intermediate stops out of this object.
Definition at line 246 of file journey.cpp.
◆ takeLoadInformation()
std::vector< LoadInfo > && JourneySection::takeLoadInformation | ( | ) |
Moves the load information out of this object for modification.
Definition at line 430 of file journey.cpp.
◆ toJson() [1/2]
|
staticnodiscard |
Serializes one journey section to JSON.
Definition at line 792 of file journey.cpp.
◆ toJson() [2/2]
|
staticnodiscard |
Serializes a vector of journey sections to JSON.
Definition at line 857 of file journey.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:47:41 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.