KPublicTransport::Stopover
#include <stopover.h>
Public Member Functions | |
void | addNote (const QString ¬e) |
void | addNotes (const QStringList ¬es) |
void | applyMetaData (bool download) |
int | arrivalDelay () const |
int | departureDelay () const |
const std::vector< KPublicTransport::Feature > & | features () const |
bool | hasExpectedArrivalTime () const |
bool | hasExpectedDepartureTime () const |
bool | hasExpectedPlatform () const |
const std::vector< LoadInfo > & | loadInformation () const |
bool | platformChanged () const |
void | setFeatures (std::vector< KPublicTransport::Feature > &&features) |
void | setLoadInformation (std::vector< LoadInfo > &&loadInfo) |
std::vector< KPublicTransport::Feature > && | takeFeatures () |
std::vector< LoadInfo > && | takeLoadInformation () |
Static Public Member Functions | |
static std::vector< Stopover > | fromJson (const QJsonArray &array) |
static Stopover | fromJson (const QJsonObject &obj) |
static bool | isSame (const Stopover &lhs, const Stopover &rhs) |
static Stopover | merge (const Stopover &lhs, const Stopover &rhs) |
static QJsonArray | toJson (const std::vector< Stopover > &deps) |
static QJsonObject | toJson (const Stopover &stopover) |
Detailed Description
Information about an arrival and/or departure of a vehicle at a stop area.
Definition at line 25 of file stopover.h.
Property Documentation
◆ arrivalDelay
|
read |
Difference to schedule in minutes.
Definition at line 38 of file stopover.h.
◆ departureDelay
|
read |
Difference to schedule in minutes.
Definition at line 49 of file stopover.h.
◆ disruptionEffect
|
readwrite |
Disruption effect on this arrival or departure, if any.
Definition at line 67 of file stopover.h.
◆ expectedArrivalTime
|
readwrite |
Actual arrival time, if available.
Set to invalid to indicate real-time data is not available.
Definition at line 34 of file stopover.h.
◆ expectedDepartureTime
|
readwrite |
Actual departure time, if available.
Set to invalid to indicate real-time data is not available.
Definition at line 45 of file stopover.h.
◆ expectedPlatform
|
readwrite |
Actual departure platform, in case real-time information are available.
Definition at line 54 of file stopover.h.
◆ features
|
read |
Features of the vehicle used on this section.
This is identical to departureVehicleLayout.features and provided for convenience for cases where no more detailed vehicle information are available.
Definition at line 85 of file stopover.h.
◆ hasExpectedArrivalTime
|
read |
true
if this has real-time data.
Definition at line 36 of file stopover.h.
◆ hasExpectedDepartureTime
|
read |
true
if this has real-time data.
Definition at line 47 of file stopover.h.
◆ hasExpectedPlatform
|
read |
true
if real-time platform information are available.
Definition at line 56 of file stopover.h.
◆ loadInformation
|
read |
Vehicle load information for departure from this stopover Contains LoadInfo objects for consumption by QML.
Definition at line 74 of file stopover.h.
◆ notes
|
readwrite |
General human-readable notes on this service, e.g.
details about a disruption.
Definition at line 69 of file stopover.h.
◆ platformChanged
|
read |
true
if we have real-time platform information and the platform changed.
Definition at line 58 of file stopover.h.
◆ platformLayout
|
readwrite |
Platform layout information.
Definition at line 79 of file stopover.h.
◆ route
|
readwrite |
The departing route.
Definition at line 61 of file stopover.h.
◆ scheduledArrivalTime
|
readwrite |
Planned arrival time.
Definition at line 30 of file stopover.h.
◆ scheduledDepartureTime
|
readwrite |
Planned departure time.
Definition at line 41 of file stopover.h.
◆ scheduledPlatform
|
readwrite |
Planned departure platform.
Definition at line 52 of file stopover.h.
◆ stopPoint
|
readwrite |
The stop point of this departure.
Definition at line 64 of file stopover.h.
◆ vehicleLayout
|
readwrite |
Vehicle coach layout information at this stopover.
Definition at line 77 of file stopover.h.
Member Function Documentation
◆ addNote()
void Stopover::addNote | ( | const QString & | note | ) |
Adds a note.
This will check for duplicates and normalize the notes.
Definition at line 110 of file stopover.cpp.
◆ addNotes()
void Stopover::addNotes | ( | const QStringList & | notes | ) |
Definition at line 120 of file stopover.cpp.
◆ applyMetaData()
void Stopover::applyMetaData | ( | bool | download | ) |
Augment line meta data.
- Parameters
-
download when set to true
trigger download of missing assets.
Definition at line 168 of file stopover.cpp.
◆ arrivalDelay()
int Stopover::arrivalDelay | ( | ) | const |
Definition at line 57 of file stopover.cpp.
◆ departureDelay()
int Stopover::departureDelay | ( | ) | const |
Definition at line 70 of file stopover.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 152 of file stopover.cpp.
◆ fromJson() [1/2]
|
static |
Deserialize a list of departures from JSON.
Definition at line 276 of file stopover.cpp.
◆ fromJson() [2/2]
|
static |
Deserialize an object from JSON.
Definition at line 264 of file stopover.cpp.
◆ hasExpectedArrivalTime()
bool Stopover::hasExpectedArrivalTime | ( | ) | const |
Definition at line 52 of file stopover.cpp.
◆ hasExpectedDepartureTime()
bool Stopover::hasExpectedDepartureTime | ( | ) | const |
Definition at line 65 of file stopover.cpp.
◆ hasExpectedPlatform()
bool Stopover::hasExpectedPlatform | ( | ) | const |
Definition at line 100 of file stopover.cpp.
◆ isSame()
Checks if to instances refer to the same departure (which does not necessarily mean they are exactly equal).
Definition at line 175 of file stopover.cpp.
◆ loadInformation()
const std::vector< LoadInfo > & Stopover::loadInformation | ( | ) | const |
Expected vehicle load for departing from this stopover.
Definition at line 127 of file stopover.cpp.
◆ merge()
Merge two departure instances.
This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.
Definition at line 205 of file stopover.cpp.
◆ platformChanged()
bool Stopover::platformChanged | ( | ) | const |
Definition at line 105 of file stopover.cpp.
◆ setFeatures()
void Stopover::setFeatures | ( | std::vector< KPublicTransport::Feature > && | features | ) |
Definition at line 162 of file stopover.cpp.
◆ setLoadInformation()
void Stopover::setLoadInformation | ( | std::vector< LoadInfo > && | loadInfo | ) |
Set the expected vehicle load information for departing from this stopover.
Definition at line 138 of file stopover.cpp.
◆ takeFeatures()
|
nodiscard |
Definition at line 157 of file stopover.cpp.
◆ takeLoadInformation()
std::vector< LoadInfo > && Stopover::takeLoadInformation | ( | ) |
Moves the load information out of this object for modification.
Definition at line 132 of file stopover.cpp.
◆ toJson() [1/2]
|
static |
Serializes a vector of departure objects to JSON.
Definition at line 259 of file stopover.cpp.
◆ toJson() [2/2]
|
static |
Serializes one object to JSON.
Definition at line 232 of file stopover.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.