KPublicTransport::JourneySection

Search for usage in LXR

KPublicTransport::JourneySection Class Reference

#include <journey.h>

Public Types

enum  Mode {
  Invalid = 0, PublicTransport = 1, Transfer = 2, Walking = 4,
  Waiting = 8, RentedVehicle = 16, IndividualTransport = 32
}
 
typedef QFlags< ModeModes
 

Properties

KPublicTransport::Stopover arrival
 
int arrivalDelay
 
bool arrivalPlatformChanged
 
KPublicTransport::Platform arrivalPlatformLayout
 
KPublicTransport::Vehicle arrivalVehicleLayout
 
int co2Emission
 
KPublicTransport::Stopover departure
 
int departureDelay
 
bool departurePlatformChanged
 
KPublicTransport::Platform departurePlatformLayout
 
KPublicTransport::Vehicle departureVehicleLayout
 
KPublicTransport::Disruption::Effect disruptionEffect
 
int distance
 
int duration
 
QString expectedArrivalPlatform
 
QDateTime expectedArrivalTime
 
QString expectedDeparturePlatform
 
QDateTime expectedDepartureTime
 
KPublicTransport::Location from
 
bool hasExpectedArrivalPlatform
 
bool hasExpectedArrivalTime
 
bool hasExpectedDeparturePlatform
 
bool hasExpectedDepartureTime
 
KPublicTransport::IndividualTransport individualTransport
 
QVariantList intermediateStops
 
QVariantList loadInformation
 
Mode mode
 
QStringList notes
 
KPublicTransport::Path path
 
KPublicTransport::RentalVehicle rentalVehicle
 
KPublicTransport::Route route
 
QString scheduledArrivalPlatform
 
QDateTime scheduledArrivalTime
 
QString scheduledDeparturePlatform
 
QDateTime scheduledDepartureTime
 
KPublicTransport::Location to
 

Public Member Functions

void addNote (const QString &note)
 
void addNotes (const QStringList &notes)
 
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 setIntermediateStops (std::vector< Stopover > &&stops)
 
void setLoadInformation (std::vector< LoadInfo > &&loadInfo)
 
std::vector< Stopover > && takeIntermediateStops ()
 
std::vector< LoadInfo > && takeLoadInformation ()
 

Static Public Member Functions

static JourneySection fromJson (const QJsonObject &obj)
 
static std::vector< JourneySectionfromJson (const QJsonArray &array)
 
static bool isSame (const JourneySection &lhs, const JourneySection &rhs)
 
static JourneySection merge (const JourneySection &lhs, const JourneySection &rhs)
 
static QJsonObject toJson (const JourneySection &section)
 
static QJsonArray toJson (const std::vector< JourneySection > &sections)
 

Detailed Description

A segment of a journey plan.

Definition at line 31 of file journey.h.

Member Enumeration Documentation

Mode of transport.

These categories are fairly coarse, for a more detailed break-down of PublicTransport see Line::Mode.

Enumerator
RentedVehicle 

free floating or dock-based rental bike service, electric scooters, car sharing services, ie. any vehicle you drive yourself but that isn't your own

IndividualTransport 

using your own vehicle (bike, car, etc).

Definition at line 39 of file journey.h.

Property Documentation

Stopover JourneySection::arrival
read

All arrival information represented as Stopover object.

Definition at line 118 of file journey.h.

int JourneySection::arrivalDelay
read

Difference to schedule in minutes.

Definition at line 75 of file journey.h.

bool JourneySection::arrivalPlatformChanged
read

true if we have real-time platform information and the platform changed.

Definition at line 105 of file journey.h.

KPublicTransport::Platform KPublicTransport::JourneySection::arrivalPlatformLayout
readwrite

Platform layout information at arrival.

Definition at line 153 of file journey.h.

KPublicTransport::Vehicle KPublicTransport::JourneySection::arrivalVehicleLayout
readwrite

Vehicle coach layout information at arrival.

Note that this does not necessarily need to be the same as departureVehicleLayout, as e.g. trains can be split up or merged along the way.

Definition at line 151 of file journey.h.

int JourneySection::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.

Definition at line 127 of file journey.h.

Stopover JourneySection::departure
read

All departure information represented as Stopover object.

Definition at line 116 of file journey.h.

int JourneySection::departureDelay
read

Difference to schedule in minutes.

Definition at line 64 of file journey.h.

bool JourneySection::departurePlatformChanged
read

true if we have real-time platform information and the platform changed.

Definition at line 96 of file journey.h.

KPublicTransport::Platform KPublicTransport::JourneySection::departurePlatformLayout
readwrite

Platform layout information at departure.

Definition at line 146 of file journey.h.

KPublicTransport::Vehicle KPublicTransport::JourneySection::departureVehicleLayout
readwrite

Vehicle coach layout information at departure.

Definition at line 144 of file journey.h.

KPublicTransport::Disruption::Effect KPublicTransport::JourneySection::disruptionEffect
readwrite

Disruption effect on this section, if any.

Definition at line 108 of file journey.h.

int JourneySection::distance
readwrite

Distance of the section in meter.

Definition at line 80 of file journey.h.

int JourneySection::duration
read

Duration of the section in seconds.

Definition at line 78 of file journey.h.

QString JourneySection::expectedArrivalPlatform
readwrite

Actual arrival platform, in case real-time information are available.

Definition at line 101 of file journey.h.

QDateTime KPublicTransport::JourneySection::expectedArrivalTime
readwrite

Actual arrival time, if available.

Set to invalid to indicate real-time data is not available.

Definition at line 71 of file journey.h.

QString JourneySection::expectedDeparturePlatform
readwrite

Actual departure platform, in case real-time information are available.

Definition at line 92 of file journey.h.

QDateTime KPublicTransport::JourneySection::expectedDepartureTime
readwrite

Actual departure time, if available.

Set to invalid to indicate real-time data is not available.

Definition at line 60 of file journey.h.

KPublicTransport::Location KPublicTransport::JourneySection::from
readwrite

Departure location of this segment.

Definition at line 83 of file journey.h.

bool JourneySection::hasExpectedArrivalPlatform
read

true if real-time platform information are available.

Definition at line 103 of file journey.h.

bool JourneySection::hasExpectedArrivalTime
read

true if this has real-time data.

Definition at line 73 of file journey.h.

bool JourneySection::hasExpectedDeparturePlatform
read

true if real-time platform information are available.

Definition at line 94 of file journey.h.

bool JourneySection::hasExpectedDepartureTime
read

true if this has real-time data.

Definition at line 62 of file journey.h.

KPublicTransport::IndividualTransport KPublicTransport::JourneySection::individualTransport
readwrite

Individual transport details for sections using your own vehicle.

Definition at line 156 of file journey.h.

const std::vector< Stopover > & JourneySection::intermediateStops
read

Intermediate stops for consumption by QML.

Definition at line 113 of file journey.h.

const std::vector< LoadInfo > & JourneySection::loadInformation
read

Vehicle load information for this journey section.

Contains LoadInfo objects for consumption by QML.

Definition at line 132 of file journey.h.

Mode KPublicTransport::JourneySection::mode
readwrite

Mode of transport for this section.

Definition at line 53 of file journey.h.

QStringList KPublicTransport::JourneySection::notes
readwrite

General human-readable notes on this service, e.g.

details about a disruption.

Definition at line 110 of file journey.h.

KPublicTransport::Path KPublicTransport::JourneySection::path
readwrite

Movement path for this journey section.

This can be navigation instructions for individual transport modes and transfers, or the path a public transport vehicle takes.

Definition at line 141 of file journey.h.

KPublicTransport::RentalVehicle KPublicTransport::JourneySection::rentalVehicle
readwrite

Information about a rental vehicle, for sections using one.

Definition at line 135 of file journey.h.

KPublicTransport::Route KPublicTransport::JourneySection::route
readwrite

Route to take on this segment.

Definition at line 87 of file journey.h.

QString JourneySection::scheduledArrivalPlatform
readwrite

Planned arrival platform.

Definition at line 99 of file journey.h.

QDateTime KPublicTransport::JourneySection::scheduledArrivalTime
readwrite

Planned arrival time.

Definition at line 67 of file journey.h.

QString JourneySection::scheduledDeparturePlatform
readwrite

Planned departure platform.

Definition at line 90 of file journey.h.

QDateTime KPublicTransport::JourneySection::scheduledDepartureTime
readwrite

Planned departure time.

Definition at line 56 of file journey.h.

KPublicTransport::Location KPublicTransport::JourneySection::to
readwrite

Arrival location of this segment.

Definition at line 85 of file journey.h.

Member Function Documentation

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.

Stopover KPublicTransport::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.

Stopover KPublicTransport::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.

JourneySection JourneySection::fromJson ( const QJsonObject obj)
static

Deserialize an object from JSON.

Definition at line 506 of file journey.cpp.

std::vector< JourneySection > JourneySection::fromJson ( const QJsonArray array)
static

Deserialize a vector of journey sections from JSON.

Definition at line 524 of file journey.cpp.

const std::vector<Stopover>& KPublicTransport::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.

bool JourneySection::isSame ( const JourneySection lhs,
const JourneySection rhs 
)
static

Checks if two instances refer to the same journey section (which does not necessarily mean they are exactly equal).

Definition at line 349 of file journey.cpp.

const std::vector<LoadInfo>& KPublicTransport::JourneySection::loadInformation ( ) const

Vehicle load information for this journey section, if available.

JourneySection JourneySection::merge ( const JourneySection lhs,
const JourneySection rhs 
)
static

Merge two instances.

This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.

Definition at line 393 of file journey.cpp.

void JourneySection::setIntermediateStops ( std::vector< Stopover > &&  stops)

Set the intermediate stops.

Definition at line 238 of file journey.cpp.

void JourneySection::setLoadInformation ( std::vector< LoadInfo > &&  loadInfo)

Set the vehicle load information for this journey section.

Definition at line 335 of file journey.cpp.

std::vector< Stopover > && JourneySection::takeIntermediateStops ( )

Moves the intermediate stops out of this object.

Definition at line 232 of file journey.cpp.

std::vector< LoadInfo > && JourneySection::takeLoadInformation ( )

Moves the load information out of this object for modification.

Definition at line 329 of file journey.cpp.

QJsonObject JourneySection::toJson ( const JourneySection section)
static

Serializes one journey section to JSON.

Definition at line 442 of file journey.cpp.

QJsonArray JourneySection::toJson ( const std::vector< JourneySection > &  sections)
static

Serializes a vector of journey sections to JSON.

Definition at line 501 of file journey.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Oct 24 2021 23:05:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.