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
Member Typedef Documentation
◆ 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 |
◆ loadInformation
|
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 212 of file journey.cpp.
◆ addNotes()
void JourneySection::addNotes | ( | const QStringList & | notes | ) |
Definition at line 222 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 490 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 281 of file journey.cpp.
◆ arrivalDelay()
|
nodiscard |
Definition at line 103 of file journey.cpp.
◆ arrivalPlatformChanged()
|
nodiscard |
Definition at line 207 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 254 of file journey.cpp.
◆ departureDelay()
|
nodiscard |
Definition at line 90 of file journey.cpp.
◆ departurePlatformChanged()
|
nodiscard |
Definition at line 175 of file journey.cpp.
◆ duration()
|
nodiscard |
Definition at line 111 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 432 of file journey.cpp.
◆ fromJson() [1/2]
|
staticnodiscard |
Deserialize a vector of journey sections from JSON.
Definition at line 681 of file journey.cpp.
◆ fromJson() [2/2]
|
staticnodiscard |
Deserialize an object from JSON.
Definition at line 662 of file journey.cpp.
◆ hasExpectedArrivalPlatform()
|
nodiscard |
Definition at line 202 of file journey.cpp.
◆ hasExpectedArrivalTime()
|
nodiscard |
Definition at line 98 of file journey.cpp.
◆ hasExpectedDeparturePlatform()
|
nodiscard |
Definition at line 170 of file journey.cpp.
◆ hasExpectedDepartureTime()
|
nodiscard |
Definition at line 85 of file journey.cpp.
◆ iconName()
|
nodiscard |
Definition at line 448 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 229 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 505 of file journey.cpp.
◆ loadInformation()
|
nodiscard |
Vehicle load information for this journey section, if available.
Definition at line 407 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 549 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 468 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 296 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 270 of file journey.cpp.
◆ setFeatures()
void JourneySection::setFeatures | ( | std::vector< KPublicTransport::Feature > && | features | ) |
Definition at line 442 of file journey.cpp.
◆ setIntermediateStops()
void JourneySection::setIntermediateStops | ( | std::vector< Stopover > && | stops | ) |
Set the intermediate stops.
Definition at line 240 of file journey.cpp.
◆ setLoadInformation()
void JourneySection::setLoadInformation | ( | std::vector< LoadInfo > && | loadInfo | ) |
Set the vehicle load information for this journey section.
Definition at line 418 of file journey.cpp.
◆ takeFeatures()
|
nodiscard |
Definition at line 437 of file journey.cpp.
◆ takeIntermediateStops()
std::vector< Stopover > && JourneySection::takeIntermediateStops | ( | ) |
Moves the intermediate stops out of this object.
Definition at line 234 of file journey.cpp.
◆ takeLoadInformation()
std::vector< LoadInfo > && JourneySection::takeLoadInformation | ( | ) |
Moves the load information out of this object for modification.
Definition at line 412 of file journey.cpp.
◆ toJson() [1/2]
|
staticnodiscard |
Serializes one journey section to JSON.
Definition at line 598 of file journey.cpp.
◆ toJson() [2/2]
|
staticnodiscard |
Serializes a vector of journey sections to JSON.
Definition at line 657 of file journey.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:51:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.