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 |
Public Member Functions | |
void | addNote (const QString ¬e) |
void | addNotes (const QStringList ¬es) |
void | applyMetaData (bool download) |
Stopover | arrival () const |
int | arrivalDelay () const |
bool | arrivalPlatformChanged () const |
Stopover | departure () const |
int | departureDelay () const |
bool | departurePlatformChanged () const |
int | duration () const |
bool | hasExpectedArrivalPlatform () const |
bool | hasExpectedArrivalTime () const |
bool | hasExpectedDeparturePlatform () const |
bool | hasExpectedDepartureTime () const |
const std::vector< Stopover > & | intermediateStops () const |
const std::vector< LoadInfo > & | loadInformation () const |
void | setArrival (const Stopover &arrival) |
void | setDeparture (const Stopover &departure) |
void | setIntermediateStops (std::vector< Stopover > &&stops) |
void | setLoadInformation (std::vector< LoadInfo > &&loadInfo) |
std::vector< Stopover > && | takeIntermediateStops () |
std::vector< LoadInfo > && | takeLoadInformation () |
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 QJsonObject | toJson (const JourneySection §ion) |
static QJsonArray | toJson (const std::vector< JourneySection > §ions) |
Detailed Description
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 |
◆ from
|
readwrite |
◆ hasExpectedArrivalPlatform
|
read |
◆ hasExpectedArrivalTime
|
read |
◆ hasExpectedDeparturePlatform
|
read |
◆ hasExpectedDepartureTime
|
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 210 of file journey.cpp.
◆ addNotes()
void JourneySection::addNotes | ( | const QStringList & | notes | ) |
Definition at line 220 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 371 of file journey.cpp.
◆ arrival()
Stopover JourneySection::arrival | ( | ) | const |
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 279 of file journey.cpp.
◆ arrivalDelay()
int JourneySection::arrivalDelay | ( | ) | const |
Definition at line 101 of file journey.cpp.
◆ arrivalPlatformChanged()
bool JourneySection::arrivalPlatformChanged | ( | ) | const |
Definition at line 205 of file journey.cpp.
◆ departure()
Stopover JourneySection::departure | ( | ) | const |
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 252 of file journey.cpp.
◆ departureDelay()
int JourneySection::departureDelay | ( | ) | const |
Definition at line 88 of file journey.cpp.
◆ departurePlatformChanged()
bool JourneySection::departurePlatformChanged | ( | ) | const |
Definition at line 173 of file journey.cpp.
◆ duration()
int JourneySection::duration | ( | ) | const |
Definition at line 109 of file journey.cpp.
◆ fromJson() [1/2]
|
static |
Deserialize a vector of journey sections from JSON.
Definition at line 562 of file journey.cpp.
◆ fromJson() [2/2]
|
static |
Deserialize an object from JSON.
Definition at line 543 of file journey.cpp.
◆ hasExpectedArrivalPlatform()
bool JourneySection::hasExpectedArrivalPlatform | ( | ) | const |
Definition at line 200 of file journey.cpp.
◆ hasExpectedArrivalTime()
bool JourneySection::hasExpectedArrivalTime | ( | ) | const |
Definition at line 96 of file journey.cpp.
◆ hasExpectedDeparturePlatform()
bool JourneySection::hasExpectedDeparturePlatform | ( | ) | const |
Definition at line 168 of file journey.cpp.
◆ hasExpectedDepartureTime()
bool JourneySection::hasExpectedDepartureTime | ( | ) | const |
Definition at line 83 of file journey.cpp.
◆ intermediateStops()
const std::vector< Stopover > & JourneySection::intermediateStops | ( | ) | const |
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 227 of file journey.cpp.
◆ isSame()
|
static |
Checks if two instances refer to the same journey section (which does not necessarily mean they are exactly equal).
Definition at line 386 of file journey.cpp.
◆ loadInformation()
const std::vector< LoadInfo > & JourneySection::loadInformation | ( | ) | const |
Vehicle load information for this journey section, if available.
Definition at line 346 of file journey.cpp.
◆ merge()
|
static |
Merge two instances.
This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.
Definition at line 430 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 294 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 268 of file journey.cpp.
◆ setIntermediateStops()
void JourneySection::setIntermediateStops | ( | std::vector< Stopover > && | stops | ) |
Set the intermediate stops.
Definition at line 238 of file journey.cpp.
◆ setLoadInformation()
void JourneySection::setLoadInformation | ( | std::vector< LoadInfo > && | loadInfo | ) |
Set the vehicle load information for this journey section.
Definition at line 357 of file journey.cpp.
◆ takeIntermediateStops()
std::vector< Stopover > && JourneySection::takeIntermediateStops | ( | ) |
Moves the intermediate stops out of this object.
Definition at line 232 of file journey.cpp.
◆ takeLoadInformation()
std::vector< LoadInfo > && JourneySection::takeLoadInformation | ( | ) |
Moves the load information out of this object for modification.
Definition at line 351 of file journey.cpp.
◆ toJson() [1/2]
|
static |
Serializes one journey section to JSON.
Definition at line 479 of file journey.cpp.
◆ toJson() [2/2]
|
static |
Serializes a vector of journey sections to JSON.
Definition at line 538 of file journey.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.