aboutsummaryrefslogtreecommitdiff
path: root/src/Enmarcha.Backend/Types
diff options
context:
space:
mode:
Diffstat (limited to 'src/Enmarcha.Backend/Types')
-rw-r--r--src/Enmarcha.Backend/Types/Arrivals/Arrival.cs3
-rw-r--r--src/Enmarcha.Backend/Types/Arrivals/StopEstimatesResponse.cs19
-rw-r--r--src/Enmarcha.Backend/Types/ConsolidatedCirculation.cs12
-rw-r--r--src/Enmarcha.Backend/Types/StopSchedule.cs1542
-rw-r--r--src/Enmarcha.Backend/Types/VigoSchedules.cs78
5 files changed, 33 insertions, 1621 deletions
diff --git a/src/Enmarcha.Backend/Types/Arrivals/Arrival.cs b/src/Enmarcha.Backend/Types/Arrivals/Arrival.cs
index eab463d..9789d43 100644
--- a/src/Enmarcha.Backend/Types/Arrivals/Arrival.cs
+++ b/src/Enmarcha.Backend/Types/Arrivals/Arrival.cs
@@ -20,11 +20,12 @@ public class Arrival
[JsonPropertyName("currentPosition")] public Position? CurrentPosition { get; set; }
- [JsonPropertyName("stopShapeIndex")] public int? StopShapeIndex { get; set; }
[JsonPropertyName("vehicleInformation")]
public VehicleBadge? VehicleInformation { get; set; }
+ [JsonPropertyName("patternId")] public string? PatternId { get; set; }
+
[System.Text.Json.Serialization.JsonIgnore]
public List<string> NextStops { get; set; } = [];
diff --git a/src/Enmarcha.Backend/Types/Arrivals/StopEstimatesResponse.cs b/src/Enmarcha.Backend/Types/Arrivals/StopEstimatesResponse.cs
new file mode 100644
index 0000000..6d83587
--- /dev/null
+++ b/src/Enmarcha.Backend/Types/Arrivals/StopEstimatesResponse.cs
@@ -0,0 +1,19 @@
+using System.Text.Json.Serialization;
+
+namespace Enmarcha.Backend.Types.Arrivals;
+
+public class StopEstimatesResponse
+{
+ [JsonPropertyName("arrivals")] public List<ArrivalEstimate> Arrivals { get; set; } = [];
+}
+
+public class ArrivalEstimate
+{
+ [JsonPropertyName("tripId")] public required string TripId { get; set; }
+
+ [JsonPropertyName("patternId")] public string? PatternId { get; set; }
+
+ [JsonPropertyName("estimate")] public required ArrivalDetails Estimate { get; set; }
+
+ [JsonPropertyName("delay")] public DelayBadge? Delay { get; set; }
+}
diff --git a/src/Enmarcha.Backend/Types/ConsolidatedCirculation.cs b/src/Enmarcha.Backend/Types/ConsolidatedCirculation.cs
index 55d6e87..bb6a251 100644
--- a/src/Enmarcha.Backend/Types/ConsolidatedCirculation.cs
+++ b/src/Enmarcha.Backend/Types/ConsolidatedCirculation.cs
@@ -36,3 +36,15 @@ public class Position
public int OrientationDegrees { get; set; }
public int ShapeIndex { get; set; }
}
+
+public class Epsg25829
+{
+ public double X { get; set; }
+ public double Y { get; set; }
+}
+
+public class Shape
+{
+ public string ShapeId { get; set; }
+ public List<Epsg25829> Points { get; set; }
+}
diff --git a/src/Enmarcha.Backend/Types/StopSchedule.cs b/src/Enmarcha.Backend/Types/StopSchedule.cs
deleted file mode 100644
index 2a143ea..0000000
--- a/src/Enmarcha.Backend/Types/StopSchedule.cs
+++ /dev/null
@@ -1,1542 +0,0 @@
-// <auto-generated>
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: stop_schedule.proto
-// </auto-generated>
-#pragma warning disable 1591, 0612, 3021, 8981
-#region Designer generated code
-
-using pb = global::Google.Protobuf;
-using pbc = global::Google.Protobuf.Collections;
-using pbr = global::Google.Protobuf.Reflection;
-using scg = global::System.Collections.Generic;
-namespace Enmarcha.Backend.Types {
-
- /// <summary>Holder for reflection information generated from stop_schedule.proto</summary>
- public static partial class StopScheduleReflection {
-
- #region Descriptor
- /// <summary>File descriptor for stop_schedule.proto</summary>
- public static pbr::FileDescriptor Descriptor {
- get { return descriptor; }
- }
- private static pbr::FileDescriptor descriptor;
-
- static StopScheduleReflection() {
- byte[] descriptorData = global::System.Convert.FromBase64String(
- string.Concat(
- "ChNzdG9wX3NjaGVkdWxlLnByb3RvEgVwcm90byIhCglFcHNnMjU4MjkSCQoB",
- "eBgBIAEoARIJCgF5GAIgASgBIoMECgxTdG9wQXJyaXZhbHMSDwoHc3RvcF9p",
- "ZBgBIAEoCRIiCghsb2NhdGlvbhgDIAEoCzIQLnByb3RvLkVwc2cyNTgyORI2",
- "CghhcnJpdmFscxgFIAMoCzIkLnByb3RvLlN0b3BBcnJpdmFscy5TY2hlZHVs",
- "ZWRBcnJpdmFsGoUDChBTY2hlZHVsZWRBcnJpdmFsEhIKCnNlcnZpY2VfaWQY",
- "ASABKAkSDwoHdHJpcF9pZBgCIAEoCRIMCgRsaW5lGAMgASgJEg0KBXJvdXRl",
- "GAQgASgJEhAKCHNoYXBlX2lkGAUgASgJEhsKE3NoYXBlX2Rpc3RfdHJhdmVs",
- "ZWQYBiABKAESFQoNc3RvcF9zZXF1ZW5jZRgLIAEoDRIUCgxuZXh0X3N0cmVl",
- "dHMYDCADKAkSFQoNc3RhcnRpbmdfY29kZRgVIAEoCRIVCg1zdGFydGluZ19u",
- "YW1lGBYgASgJEhUKDXN0YXJ0aW5nX3RpbWUYFyABKAkSFAoMY2FsbGluZ190",
- "aW1lGCEgASgJEhMKC2NhbGxpbmdfc3NtGCIgASgNEhUKDXRlcm1pbnVzX2Nv",
- "ZGUYKSABKAkSFQoNdGVybWludXNfbmFtZRgqIAEoCRIVCg10ZXJtaW51c190",
- "aW1lGCsgASgJEh4KFnByZXZpb3VzX3RyaXBfc2hhcGVfaWQYMyABKAkiOwoF",
- "U2hhcGUSEAoIc2hhcGVfaWQYASABKAkSIAoGcG9pbnRzGAMgAygLMhAucHJv",
- "dG8uRXBzZzI1ODI5QiSqAiFDb3N0YXNkZXYuQnVzdXJiYW5vLkJhY2tlbmQu",
- "VHlwZXNiBnByb3RvMw=="));
- descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
- new pbr::FileDescriptor[] { },
- new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
- new pbr::GeneratedClrTypeInfo(typeof(global::Enmarcha.Backend.Types.Epsg25829), global::Enmarcha.Backend.Types.Epsg25829.Parser, new[]{ "X", "Y" }, null, null, null, null),
- new pbr::GeneratedClrTypeInfo(typeof(global::Enmarcha.Backend.Types.StopArrivals), global::Enmarcha.Backend.Types.StopArrivals.Parser, new[]{ "StopId", "Location", "Arrivals" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Enmarcha.Backend.Types.StopArrivals.Types.ScheduledArrival), global::Enmarcha.Backend.Types.StopArrivals.Types.ScheduledArrival.Parser, new[]{ "ServiceId", "TripId", "Line", "Route", "ShapeId", "ShapeDistTraveled", "StopSequence", "NextStreets", "StartingCode", "StartingName", "StartingTime", "CallingTime", "CallingSsm", "TerminusCode", "TerminusName", "TerminusTime", "PreviousTripShapeId" }, null, null, null, null)}),
- new pbr::GeneratedClrTypeInfo(typeof(global::Enmarcha.Backend.Types.Shape), global::Enmarcha.Backend.Types.Shape.Parser, new[]{ "ShapeId", "Points" }, null, null, null, null)
- }));
- }
- #endregion
-
- }
- #region Messages
- public sealed partial class Epsg25829 : pb::IMessage<Epsg25829>
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- , pb::IBufferMessage
- #endif
- {
- private static readonly pb::MessageParser<Epsg25829> _parser = new pb::MessageParser<Epsg25829>(() => new Epsg25829());
- private pb::UnknownFieldSet _unknownFields;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pb::MessageParser<Epsg25829> Parser { get { return _parser; } }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pbr::MessageDescriptor Descriptor {
- get { return global::Enmarcha.Backend.Types.StopScheduleReflection.Descriptor.MessageTypes[0]; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- pbr::MessageDescriptor pb::IMessage.Descriptor {
- get { return Descriptor; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public Epsg25829() {
- OnConstruction();
- }
-
- partial void OnConstruction();
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public Epsg25829(Epsg25829 other) : this() {
- x_ = other.x_;
- y_ = other.y_;
- _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public Epsg25829 Clone() {
- return new Epsg25829(this);
- }
-
- /// <summary>Field number for the "x" field.</summary>
- public const int XFieldNumber = 1;
- private double x_;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public double X {
- get { return x_; }
- set {
- x_ = value;
- }
- }
-
- /// <summary>Field number for the "y" field.</summary>
- public const int YFieldNumber = 2;
- private double y_;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public double Y {
- get { return y_; }
- set {
- y_ = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override bool Equals(object other) {
- return Equals(other as Epsg25829);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public bool Equals(Epsg25829 other) {
- if (ReferenceEquals(other, null)) {
- return false;
- }
- if (ReferenceEquals(other, this)) {
- return true;
- }
- if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(X, other.X)) return false;
- if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Y, other.Y)) return false;
- return Equals(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override int GetHashCode() {
- int hash = 1;
- if (X != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(X);
- if (Y != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Y);
- if (_unknownFields != null) {
- hash ^= _unknownFields.GetHashCode();
- }
- return hash;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override string ToString() {
- return pb::JsonFormatter.ToDiagnosticString(this);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void WriteTo(pb::CodedOutputStream output) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- output.WriteRawMessage(this);
- #else
- if (X != 0D) {
- output.WriteRawTag(9);
- output.WriteDouble(X);
- }
- if (Y != 0D) {
- output.WriteRawTag(17);
- output.WriteDouble(Y);
- }
- if (_unknownFields != null) {
- _unknownFields.WriteTo(output);
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
- if (X != 0D) {
- output.WriteRawTag(9);
- output.WriteDouble(X);
- }
- if (Y != 0D) {
- output.WriteRawTag(17);
- output.WriteDouble(Y);
- }
- if (_unknownFields != null) {
- _unknownFields.WriteTo(ref output);
- }
- }
- #endif
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public int CalculateSize() {
- int size = 0;
- if (X != 0D) {
- size += 1 + 8;
- }
- if (Y != 0D) {
- size += 1 + 8;
- }
- if (_unknownFields != null) {
- size += _unknownFields.CalculateSize();
- }
- return size;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(Epsg25829 other) {
- if (other == null) {
- return;
- }
- if (other.X != 0D) {
- X = other.X;
- }
- if (other.Y != 0D) {
- Y = other.Y;
- }
- _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(pb::CodedInputStream input) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- input.ReadRawMessage(this);
- #else
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
- break;
- case 9: {
- X = input.ReadDouble();
- break;
- }
- case 17: {
- Y = input.ReadDouble();
- break;
- }
- }
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
- break;
- case 9: {
- X = input.ReadDouble();
- break;
- }
- case 17: {
- Y = input.ReadDouble();
- break;
- }
- }
- }
- }
- #endif
-
- }
-
- public sealed partial class StopArrivals : pb::IMessage<StopArrivals>
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- , pb::IBufferMessage
- #endif
- {
- private static readonly pb::MessageParser<StopArrivals> _parser = new pb::MessageParser<StopArrivals>(() => new StopArrivals());
- private pb::UnknownFieldSet _unknownFields;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pb::MessageParser<StopArrivals> Parser { get { return _parser; } }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pbr::MessageDescriptor Descriptor {
- get { return global::Enmarcha.Backend.Types.StopScheduleReflection.Descriptor.MessageTypes[1]; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- pbr::MessageDescriptor pb::IMessage.Descriptor {
- get { return Descriptor; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public StopArrivals() {
- OnConstruction();
- }
-
- partial void OnConstruction();
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public StopArrivals(StopArrivals other) : this() {
- stopId_ = other.stopId_;
- location_ = other.location_ != null ? other.location_.Clone() : null;
- arrivals_ = other.arrivals_.Clone();
- _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public StopArrivals Clone() {
- return new StopArrivals(this);
- }
-
- /// <summary>Field number for the "stop_id" field.</summary>
- public const int StopIdFieldNumber = 1;
- private string stopId_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string StopId {
- get { return stopId_; }
- set {
- stopId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "location" field.</summary>
- public const int LocationFieldNumber = 3;
- private global::Enmarcha.Backend.Types.Epsg25829 location_;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public global::Enmarcha.Backend.Types.Epsg25829 Location {
- get { return location_; }
- set {
- location_ = value;
- }
- }
-
- /// <summary>Field number for the "arrivals" field.</summary>
- public const int ArrivalsFieldNumber = 5;
- private static readonly pb::FieldCodec<global::Enmarcha.Backend.Types.StopArrivals.Types.ScheduledArrival> _repeated_arrivals_codec
- = pb::FieldCodec.ForMessage(42, global::Enmarcha.Backend.Types.StopArrivals.Types.ScheduledArrival.Parser);
- private readonly pbc::RepeatedField<global::Enmarcha.Backend.Types.StopArrivals.Types.ScheduledArrival> arrivals_ = new pbc::RepeatedField<global::Enmarcha.Backend.Types.StopArrivals.Types.ScheduledArrival>();
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public pbc::RepeatedField<global::Enmarcha.Backend.Types.StopArrivals.Types.ScheduledArrival> Arrivals {
- get { return arrivals_; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override bool Equals(object other) {
- return Equals(other as StopArrivals);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public bool Equals(StopArrivals other) {
- if (ReferenceEquals(other, null)) {
- return false;
- }
- if (ReferenceEquals(other, this)) {
- return true;
- }
- if (StopId != other.StopId) return false;
- if (!object.Equals(Location, other.Location)) return false;
- if(!arrivals_.Equals(other.arrivals_)) return false;
- return Equals(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override int GetHashCode() {
- int hash = 1;
- if (StopId.Length != 0) hash ^= StopId.GetHashCode();
- if (location_ != null) hash ^= Location.GetHashCode();
- hash ^= arrivals_.GetHashCode();
- if (_unknownFields != null) {
- hash ^= _unknownFields.GetHashCode();
- }
- return hash;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override string ToString() {
- return pb::JsonFormatter.ToDiagnosticString(this);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void WriteTo(pb::CodedOutputStream output) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- output.WriteRawMessage(this);
- #else
- if (StopId.Length != 0) {
- output.WriteRawTag(10);
- output.WriteString(StopId);
- }
- if (location_ != null) {
- output.WriteRawTag(26);
- output.WriteMessage(Location);
- }
- arrivals_.WriteTo(output, _repeated_arrivals_codec);
- if (_unknownFields != null) {
- _unknownFields.WriteTo(output);
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
- if (StopId.Length != 0) {
- output.WriteRawTag(10);
- output.WriteString(StopId);
- }
- if (location_ != null) {
- output.WriteRawTag(26);
- output.WriteMessage(Location);
- }
- arrivals_.WriteTo(ref output, _repeated_arrivals_codec);
- if (_unknownFields != null) {
- _unknownFields.WriteTo(ref output);
- }
- }
- #endif
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public int CalculateSize() {
- int size = 0;
- if (StopId.Length != 0) {
- size += 1 + pb::CodedOutputStream.ComputeStringSize(StopId);
- }
- if (location_ != null) {
- size += 1 + pb::CodedOutputStream.ComputeMessageSize(Location);
- }
- size += arrivals_.CalculateSize(_repeated_arrivals_codec);
- if (_unknownFields != null) {
- size += _unknownFields.CalculateSize();
- }
- return size;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(StopArrivals other) {
- if (other == null) {
- return;
- }
- if (other.StopId.Length != 0) {
- StopId = other.StopId;
- }
- if (other.location_ != null) {
- if (location_ == null) {
- Location = new global::Enmarcha.Backend.Types.Epsg25829();
- }
- Location.MergeFrom(other.Location);
- }
- arrivals_.Add(other.arrivals_);
- _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(pb::CodedInputStream input) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- input.ReadRawMessage(this);
- #else
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
- break;
- case 10: {
- StopId = input.ReadString();
- break;
- }
- case 26: {
- if (location_ == null) {
- Location = new global::Enmarcha.Backend.Types.Epsg25829();
- }
- input.ReadMessage(Location);
- break;
- }
- case 42: {
- arrivals_.AddEntriesFrom(input, _repeated_arrivals_codec);
- break;
- }
- }
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
- break;
- case 10: {
- StopId = input.ReadString();
- break;
- }
- case 26: {
- if (location_ == null) {
- Location = new global::Enmarcha.Backend.Types.Epsg25829();
- }
- input.ReadMessage(Location);
- break;
- }
- case 42: {
- arrivals_.AddEntriesFrom(ref input, _repeated_arrivals_codec);
- break;
- }
- }
- }
- }
- #endif
-
- #region Nested types
- /// <summary>Container for nested types declared in the StopArrivals message type.</summary>
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static partial class Types {
- public sealed partial class ScheduledArrival : pb::IMessage<ScheduledArrival>
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- , pb::IBufferMessage
- #endif
- {
- private static readonly pb::MessageParser<ScheduledArrival> _parser = new pb::MessageParser<ScheduledArrival>(() => new ScheduledArrival());
- private pb::UnknownFieldSet _unknownFields;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pb::MessageParser<ScheduledArrival> Parser { get { return _parser; } }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pbr::MessageDescriptor Descriptor {
- get { return global::Enmarcha.Backend.Types.StopArrivals.Descriptor.NestedTypes[0]; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- pbr::MessageDescriptor pb::IMessage.Descriptor {
- get { return Descriptor; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public ScheduledArrival() {
- OnConstruction();
- }
-
- partial void OnConstruction();
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public ScheduledArrival(ScheduledArrival other) : this() {
- serviceId_ = other.serviceId_;
- tripId_ = other.tripId_;
- line_ = other.line_;
- route_ = other.route_;
- shapeId_ = other.shapeId_;
- shapeDistTraveled_ = other.shapeDistTraveled_;
- stopSequence_ = other.stopSequence_;
- nextStreets_ = other.nextStreets_.Clone();
- startingCode_ = other.startingCode_;
- startingName_ = other.startingName_;
- startingTime_ = other.startingTime_;
- callingTime_ = other.callingTime_;
- callingSsm_ = other.callingSsm_;
- terminusCode_ = other.terminusCode_;
- terminusName_ = other.terminusName_;
- terminusTime_ = other.terminusTime_;
- previousTripShapeId_ = other.previousTripShapeId_;
- _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public ScheduledArrival Clone() {
- return new ScheduledArrival(this);
- }
-
- /// <summary>Field number for the "service_id" field.</summary>
- public const int ServiceIdFieldNumber = 1;
- private string serviceId_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string ServiceId {
- get { return serviceId_; }
- set {
- serviceId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "trip_id" field.</summary>
- public const int TripIdFieldNumber = 2;
- private string tripId_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string TripId {
- get { return tripId_; }
- set {
- tripId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "line" field.</summary>
- public const int LineFieldNumber = 3;
- private string line_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string Line {
- get { return line_; }
- set {
- line_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "route" field.</summary>
- public const int RouteFieldNumber = 4;
- private string route_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string Route {
- get { return route_; }
- set {
- route_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "shape_id" field.</summary>
- public const int ShapeIdFieldNumber = 5;
- private string shapeId_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string ShapeId {
- get { return shapeId_; }
- set {
- shapeId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "shape_dist_traveled" field.</summary>
- public const int ShapeDistTraveledFieldNumber = 6;
- private double shapeDistTraveled_;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public double ShapeDistTraveled {
- get { return shapeDistTraveled_; }
- set {
- shapeDistTraveled_ = value;
- }
- }
-
- /// <summary>Field number for the "stop_sequence" field.</summary>
- public const int StopSequenceFieldNumber = 11;
- private uint stopSequence_;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public uint StopSequence {
- get { return stopSequence_; }
- set {
- stopSequence_ = value;
- }
- }
-
- /// <summary>Field number for the "next_streets" field.</summary>
- public const int NextStreetsFieldNumber = 12;
- private static readonly pb::FieldCodec<string> _repeated_nextStreets_codec
- = pb::FieldCodec.ForString(98);
- private readonly pbc::RepeatedField<string> nextStreets_ = new pbc::RepeatedField<string>();
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public pbc::RepeatedField<string> NextStreets {
- get { return nextStreets_; }
- }
-
- /// <summary>Field number for the "starting_code" field.</summary>
- public const int StartingCodeFieldNumber = 21;
- private string startingCode_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string StartingCode {
- get { return startingCode_; }
- set {
- startingCode_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "starting_name" field.</summary>
- public const int StartingNameFieldNumber = 22;
- private string startingName_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string StartingName {
- get { return startingName_; }
- set {
- startingName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "starting_time" field.</summary>
- public const int StartingTimeFieldNumber = 23;
- private string startingTime_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string StartingTime {
- get { return startingTime_; }
- set {
- startingTime_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "calling_time" field.</summary>
- public const int CallingTimeFieldNumber = 33;
- private string callingTime_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string CallingTime {
- get { return callingTime_; }
- set {
- callingTime_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "calling_ssm" field.</summary>
- public const int CallingSsmFieldNumber = 34;
- private uint callingSsm_;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public uint CallingSsm {
- get { return callingSsm_; }
- set {
- callingSsm_ = value;
- }
- }
-
- /// <summary>Field number for the "terminus_code" field.</summary>
- public const int TerminusCodeFieldNumber = 41;
- private string terminusCode_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string TerminusCode {
- get { return terminusCode_; }
- set {
- terminusCode_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "terminus_name" field.</summary>
- public const int TerminusNameFieldNumber = 42;
- private string terminusName_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string TerminusName {
- get { return terminusName_; }
- set {
- terminusName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "terminus_time" field.</summary>
- public const int TerminusTimeFieldNumber = 43;
- private string terminusTime_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string TerminusTime {
- get { return terminusTime_; }
- set {
- terminusTime_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "previous_trip_shape_id" field.</summary>
- public const int PreviousTripShapeIdFieldNumber = 51;
- private string previousTripShapeId_ = "";
- /// <summary>
- /// Shape ID of the previous trip when the bus comes from another trip that ends at the starting point
- /// </summary>
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string PreviousTripShapeId {
- get { return previousTripShapeId_; }
- set {
- previousTripShapeId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override bool Equals(object other) {
- return Equals(other as ScheduledArrival);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public bool Equals(ScheduledArrival other) {
- if (ReferenceEquals(other, null)) {
- return false;
- }
- if (ReferenceEquals(other, this)) {
- return true;
- }
- if (ServiceId != other.ServiceId) return false;
- if (TripId != other.TripId) return false;
- if (Line != other.Line) return false;
- if (Route != other.Route) return false;
- if (ShapeId != other.ShapeId) return false;
- if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ShapeDistTraveled, other.ShapeDistTraveled)) return false;
- if (StopSequence != other.StopSequence) return false;
- if(!nextStreets_.Equals(other.nextStreets_)) return false;
- if (StartingCode != other.StartingCode) return false;
- if (StartingName != other.StartingName) return false;
- if (StartingTime != other.StartingTime) return false;
- if (CallingTime != other.CallingTime) return false;
- if (CallingSsm != other.CallingSsm) return false;
- if (TerminusCode != other.TerminusCode) return false;
- if (TerminusName != other.TerminusName) return false;
- if (TerminusTime != other.TerminusTime) return false;
- if (PreviousTripShapeId != other.PreviousTripShapeId) return false;
- return Equals(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override int GetHashCode() {
- int hash = 1;
- if (ServiceId.Length != 0) hash ^= ServiceId.GetHashCode();
- if (TripId.Length != 0) hash ^= TripId.GetHashCode();
- if (Line.Length != 0) hash ^= Line.GetHashCode();
- if (Route.Length != 0) hash ^= Route.GetHashCode();
- if (ShapeId.Length != 0) hash ^= ShapeId.GetHashCode();
- if (ShapeDistTraveled != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ShapeDistTraveled);
- if (StopSequence != 0) hash ^= StopSequence.GetHashCode();
- hash ^= nextStreets_.GetHashCode();
- if (StartingCode.Length != 0) hash ^= StartingCode.GetHashCode();
- if (StartingName.Length != 0) hash ^= StartingName.GetHashCode();
- if (StartingTime.Length != 0) hash ^= StartingTime.GetHashCode();
- if (CallingTime.Length != 0) hash ^= CallingTime.GetHashCode();
- if (CallingSsm != 0) hash ^= CallingSsm.GetHashCode();
- if (TerminusCode.Length != 0) hash ^= TerminusCode.GetHashCode();
- if (TerminusName.Length != 0) hash ^= TerminusName.GetHashCode();
- if (TerminusTime.Length != 0) hash ^= TerminusTime.GetHashCode();
- if (PreviousTripShapeId.Length != 0) hash ^= PreviousTripShapeId.GetHashCode();
- if (_unknownFields != null) {
- hash ^= _unknownFields.GetHashCode();
- }
- return hash;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override string ToString() {
- return pb::JsonFormatter.ToDiagnosticString(this);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void WriteTo(pb::CodedOutputStream output) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- output.WriteRawMessage(this);
- #else
- if (ServiceId.Length != 0) {
- output.WriteRawTag(10);
- output.WriteString(ServiceId);
- }
- if (TripId.Length != 0) {
- output.WriteRawTag(18);
- output.WriteString(TripId);
- }
- if (Line.Length != 0) {
- output.WriteRawTag(26);
- output.WriteString(Line);
- }
- if (Route.Length != 0) {
- output.WriteRawTag(34);
- output.WriteString(Route);
- }
- if (ShapeId.Length != 0) {
- output.WriteRawTag(42);
- output.WriteString(ShapeId);
- }
- if (ShapeDistTraveled != 0D) {
- output.WriteRawTag(49);
- output.WriteDouble(ShapeDistTraveled);
- }
- if (StopSequence != 0) {
- output.WriteRawTag(88);
- output.WriteUInt32(StopSequence);
- }
- nextStreets_.WriteTo(output, _repeated_nextStreets_codec);
- if (StartingCode.Length != 0) {
- output.WriteRawTag(170, 1);
- output.WriteString(StartingCode);
- }
- if (StartingName.Length != 0) {
- output.WriteRawTag(178, 1);
- output.WriteString(StartingName);
- }
- if (StartingTime.Length != 0) {
- output.WriteRawTag(186, 1);
- output.WriteString(StartingTime);
- }
- if (CallingTime.Length != 0) {
- output.WriteRawTag(138, 2);
- output.WriteString(CallingTime);
- }
- if (CallingSsm != 0) {
- output.WriteRawTag(144, 2);
- output.WriteUInt32(CallingSsm);
- }
- if (TerminusCode.Length != 0) {
- output.WriteRawTag(202, 2);
- output.WriteString(TerminusCode);
- }
- if (TerminusName.Length != 0) {
- output.WriteRawTag(210, 2);
- output.WriteString(TerminusName);
- }
- if (TerminusTime.Length != 0) {
- output.WriteRawTag(218, 2);
- output.WriteString(TerminusTime);
- }
- if (PreviousTripShapeId.Length != 0) {
- output.WriteRawTag(154, 3);
- output.WriteString(PreviousTripShapeId);
- }
- if (_unknownFields != null) {
- _unknownFields.WriteTo(output);
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
- if (ServiceId.Length != 0) {
- output.WriteRawTag(10);
- output.WriteString(ServiceId);
- }
- if (TripId.Length != 0) {
- output.WriteRawTag(18);
- output.WriteString(TripId);
- }
- if (Line.Length != 0) {
- output.WriteRawTag(26);
- output.WriteString(Line);
- }
- if (Route.Length != 0) {
- output.WriteRawTag(34);
- output.WriteString(Route);
- }
- if (ShapeId.Length != 0) {
- output.WriteRawTag(42);
- output.WriteString(ShapeId);
- }
- if (ShapeDistTraveled != 0D) {
- output.WriteRawTag(49);
- output.WriteDouble(ShapeDistTraveled);
- }
- if (StopSequence != 0) {
- output.WriteRawTag(88);
- output.WriteUInt32(StopSequence);
- }
- nextStreets_.WriteTo(ref output, _repeated_nextStreets_codec);
- if (StartingCode.Length != 0) {
- output.WriteRawTag(170, 1);
- output.WriteString(StartingCode);
- }
- if (StartingName.Length != 0) {
- output.WriteRawTag(178, 1);
- output.WriteString(StartingName);
- }
- if (StartingTime.Length != 0) {
- output.WriteRawTag(186, 1);
- output.WriteString(StartingTime);
- }
- if (CallingTime.Length != 0) {
- output.WriteRawTag(138, 2);
- output.WriteString(CallingTime);
- }
- if (CallingSsm != 0) {
- output.WriteRawTag(144, 2);
- output.WriteUInt32(CallingSsm);
- }
- if (TerminusCode.Length != 0) {
- output.WriteRawTag(202, 2);
- output.WriteString(TerminusCode);
- }
- if (TerminusName.Length != 0) {
- output.WriteRawTag(210, 2);
- output.WriteString(TerminusName);
- }
- if (TerminusTime.Length != 0) {
- output.WriteRawTag(218, 2);
- output.WriteString(TerminusTime);
- }
- if (PreviousTripShapeId.Length != 0) {
- output.WriteRawTag(154, 3);
- output.WriteString(PreviousTripShapeId);
- }
- if (_unknownFields != null) {
- _unknownFields.WriteTo(ref output);
- }
- }
- #endif
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public int CalculateSize() {
- int size = 0;
- if (ServiceId.Length != 0) {
- size += 1 + pb::CodedOutputStream.ComputeStringSize(ServiceId);
- }
- if (TripId.Length != 0) {
- size += 1 + pb::CodedOutputStream.ComputeStringSize(TripId);
- }
- if (Line.Length != 0) {
- size += 1 + pb::CodedOutputStream.ComputeStringSize(Line);
- }
- if (Route.Length != 0) {
- size += 1 + pb::CodedOutputStream.ComputeStringSize(Route);
- }
- if (ShapeId.Length != 0) {
- size += 1 + pb::CodedOutputStream.ComputeStringSize(ShapeId);
- }
- if (ShapeDistTraveled != 0D) {
- size += 1 + 8;
- }
- if (StopSequence != 0) {
- size += 1 + pb::CodedOutputStream.ComputeUInt32Size(StopSequence);
- }
- size += nextStreets_.CalculateSize(_repeated_nextStreets_codec);
- if (StartingCode.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(StartingCode);
- }
- if (StartingName.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(StartingName);
- }
- if (StartingTime.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(StartingTime);
- }
- if (CallingTime.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(CallingTime);
- }
- if (CallingSsm != 0) {
- size += 2 + pb::CodedOutputStream.ComputeUInt32Size(CallingSsm);
- }
- if (TerminusCode.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(TerminusCode);
- }
- if (TerminusName.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(TerminusName);
- }
- if (TerminusTime.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(TerminusTime);
- }
- if (PreviousTripShapeId.Length != 0) {
- size += 2 + pb::CodedOutputStream.ComputeStringSize(PreviousTripShapeId);
- }
- if (_unknownFields != null) {
- size += _unknownFields.CalculateSize();
- }
- return size;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(ScheduledArrival other) {
- if (other == null) {
- return;
- }
- if (other.ServiceId.Length != 0) {
- ServiceId = other.ServiceId;
- }
- if (other.TripId.Length != 0) {
- TripId = other.TripId;
- }
- if (other.Line.Length != 0) {
- Line = other.Line;
- }
- if (other.Route.Length != 0) {
- Route = other.Route;
- }
- if (other.ShapeId.Length != 0) {
- ShapeId = other.ShapeId;
- }
- if (other.ShapeDistTraveled != 0D) {
- ShapeDistTraveled = other.ShapeDistTraveled;
- }
- if (other.StopSequence != 0) {
- StopSequence = other.StopSequence;
- }
- nextStreets_.Add(other.nextStreets_);
- if (other.StartingCode.Length != 0) {
- StartingCode = other.StartingCode;
- }
- if (other.StartingName.Length != 0) {
- StartingName = other.StartingName;
- }
- if (other.StartingTime.Length != 0) {
- StartingTime = other.StartingTime;
- }
- if (other.CallingTime.Length != 0) {
- CallingTime = other.CallingTime;
- }
- if (other.CallingSsm != 0) {
- CallingSsm = other.CallingSsm;
- }
- if (other.TerminusCode.Length != 0) {
- TerminusCode = other.TerminusCode;
- }
- if (other.TerminusName.Length != 0) {
- TerminusName = other.TerminusName;
- }
- if (other.TerminusTime.Length != 0) {
- TerminusTime = other.TerminusTime;
- }
- if (other.PreviousTripShapeId.Length != 0) {
- PreviousTripShapeId = other.PreviousTripShapeId;
- }
- _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(pb::CodedInputStream input) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- input.ReadRawMessage(this);
- #else
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
- break;
- case 10: {
- ServiceId = input.ReadString();
- break;
- }
- case 18: {
- TripId = input.ReadString();
- break;
- }
- case 26: {
- Line = input.ReadString();
- break;
- }
- case 34: {
- Route = input.ReadString();
- break;
- }
- case 42: {
- ShapeId = input.ReadString();
- break;
- }
- case 49: {
- ShapeDistTraveled = input.ReadDouble();
- break;
- }
- case 88: {
- StopSequence = input.ReadUInt32();
- break;
- }
- case 98: {
- nextStreets_.AddEntriesFrom(input, _repeated_nextStreets_codec);
- break;
- }
- case 170: {
- StartingCode = input.ReadString();
- break;
- }
- case 178: {
- StartingName = input.ReadString();
- break;
- }
- case 186: {
- StartingTime = input.ReadString();
- break;
- }
- case 266: {
- CallingTime = input.ReadString();
- break;
- }
- case 272: {
- CallingSsm = input.ReadUInt32();
- break;
- }
- case 330: {
- TerminusCode = input.ReadString();
- break;
- }
- case 338: {
- TerminusName = input.ReadString();
- break;
- }
- case 346: {
- TerminusTime = input.ReadString();
- break;
- }
- case 410: {
- PreviousTripShapeId = input.ReadString();
- break;
- }
- }
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
- break;
- case 10: {
- ServiceId = input.ReadString();
- break;
- }
- case 18: {
- TripId = input.ReadString();
- break;
- }
- case 26: {
- Line = input.ReadString();
- break;
- }
- case 34: {
- Route = input.ReadString();
- break;
- }
- case 42: {
- ShapeId = input.ReadString();
- break;
- }
- case 49: {
- ShapeDistTraveled = input.ReadDouble();
- break;
- }
- case 88: {
- StopSequence = input.ReadUInt32();
- break;
- }
- case 98: {
- nextStreets_.AddEntriesFrom(ref input, _repeated_nextStreets_codec);
- break;
- }
- case 170: {
- StartingCode = input.ReadString();
- break;
- }
- case 178: {
- StartingName = input.ReadString();
- break;
- }
- case 186: {
- StartingTime = input.ReadString();
- break;
- }
- case 266: {
- CallingTime = input.ReadString();
- break;
- }
- case 272: {
- CallingSsm = input.ReadUInt32();
- break;
- }
- case 330: {
- TerminusCode = input.ReadString();
- break;
- }
- case 338: {
- TerminusName = input.ReadString();
- break;
- }
- case 346: {
- TerminusTime = input.ReadString();
- break;
- }
- case 410: {
- PreviousTripShapeId = input.ReadString();
- break;
- }
- }
- }
- }
- #endif
-
- }
-
- }
- #endregion
-
- }
-
- public sealed partial class Shape : pb::IMessage<Shape>
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- , pb::IBufferMessage
- #endif
- {
- private static readonly pb::MessageParser<Shape> _parser = new pb::MessageParser<Shape>(() => new Shape());
- private pb::UnknownFieldSet _unknownFields;
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pb::MessageParser<Shape> Parser { get { return _parser; } }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public static pbr::MessageDescriptor Descriptor {
- get { return global::Enmarcha.Backend.Types.StopScheduleReflection.Descriptor.MessageTypes[2]; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- pbr::MessageDescriptor pb::IMessage.Descriptor {
- get { return Descriptor; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public Shape() {
- OnConstruction();
- }
-
- partial void OnConstruction();
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public Shape(Shape other) : this() {
- shapeId_ = other.shapeId_;
- points_ = other.points_.Clone();
- _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public Shape Clone() {
- return new Shape(this);
- }
-
- /// <summary>Field number for the "shape_id" field.</summary>
- public const int ShapeIdFieldNumber = 1;
- private string shapeId_ = "";
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public string ShapeId {
- get { return shapeId_; }
- set {
- shapeId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
- }
- }
-
- /// <summary>Field number for the "points" field.</summary>
- public const int PointsFieldNumber = 3;
- private static readonly pb::FieldCodec<global::Enmarcha.Backend.Types.Epsg25829> _repeated_points_codec
- = pb::FieldCodec.ForMessage(26, global::Enmarcha.Backend.Types.Epsg25829.Parser);
- private readonly pbc::RepeatedField<global::Enmarcha.Backend.Types.Epsg25829> points_ = new pbc::RepeatedField<global::Enmarcha.Backend.Types.Epsg25829>();
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public pbc::RepeatedField<global::Enmarcha.Backend.Types.Epsg25829> Points {
- get { return points_; }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override bool Equals(object other) {
- return Equals(other as Shape);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public bool Equals(Shape other) {
- if (ReferenceEquals(other, null)) {
- return false;
- }
- if (ReferenceEquals(other, this)) {
- return true;
- }
- if (ShapeId != other.ShapeId) return false;
- if(!points_.Equals(other.points_)) return false;
- return Equals(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override int GetHashCode() {
- int hash = 1;
- if (ShapeId.Length != 0) hash ^= ShapeId.GetHashCode();
- hash ^= points_.GetHashCode();
- if (_unknownFields != null) {
- hash ^= _unknownFields.GetHashCode();
- }
- return hash;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public override string ToString() {
- return pb::JsonFormatter.ToDiagnosticString(this);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void WriteTo(pb::CodedOutputStream output) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- output.WriteRawMessage(this);
- #else
- if (ShapeId.Length != 0) {
- output.WriteRawTag(10);
- output.WriteString(ShapeId);
- }
- points_.WriteTo(output, _repeated_points_codec);
- if (_unknownFields != null) {
- _unknownFields.WriteTo(output);
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
- if (ShapeId.Length != 0) {
- output.WriteRawTag(10);
- output.WriteString(ShapeId);
- }
- points_.WriteTo(ref output, _repeated_points_codec);
- if (_unknownFields != null) {
- _unknownFields.WriteTo(ref output);
- }
- }
- #endif
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public int CalculateSize() {
- int size = 0;
- if (ShapeId.Length != 0) {
- size += 1 + pb::CodedOutputStream.ComputeStringSize(ShapeId);
- }
- size += points_.CalculateSize(_repeated_points_codec);
- if (_unknownFields != null) {
- size += _unknownFields.CalculateSize();
- }
- return size;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(Shape other) {
- if (other == null) {
- return;
- }
- if (other.ShapeId.Length != 0) {
- ShapeId = other.ShapeId;
- }
- points_.Add(other.points_);
- _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public void MergeFrom(pb::CodedInputStream input) {
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- input.ReadRawMessage(this);
- #else
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
- break;
- case 10: {
- ShapeId = input.ReadString();
- break;
- }
- case 26: {
- points_.AddEntriesFrom(input, _repeated_points_codec);
- break;
- }
- }
- }
- #endif
- }
-
- #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
- [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
- uint tag;
- while ((tag = input.ReadTag()) != 0) {
- switch(tag) {
- default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
- break;
- case 10: {
- ShapeId = input.ReadString();
- break;
- }
- case 26: {
- points_.AddEntriesFrom(ref input, _repeated_points_codec);
- break;
- }
- }
- }
- }
- #endif
-
- }
-
- #endregion
-
-}
-
-#endregion Designer generated code
diff --git a/src/Enmarcha.Backend/Types/VigoSchedules.cs b/src/Enmarcha.Backend/Types/VigoSchedules.cs
deleted file mode 100644
index ee7930f..0000000
--- a/src/Enmarcha.Backend/Types/VigoSchedules.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System.Text.Json.Serialization;
-
-namespace Enmarcha.Backend.Types;
-
-public class ScheduledStop
-{
- [JsonPropertyName("trip_id")] public required string TripId { get; set; }
- [JsonPropertyName("service_id")] public required string ServiceId { get; set; }
- [JsonPropertyName("line")] public required string Line { get; set; }
- [JsonPropertyName("route")] public required string Route { get; set; }
- [JsonPropertyName("stop_sequence")] public required int StopSequence { get; set; }
-
- [JsonPropertyName("shape_dist_traveled")]
- public required double ShapeDistTraveled { get; set; }
-
- [JsonPropertyName("next_streets")] public required string[] NextStreets { get; set; }
-
- [JsonPropertyName("starting_code")] public required string StartingCode { get; set; }
- [JsonPropertyName("starting_name")] public required string StartingName { get; set; }
- [JsonPropertyName("starting_time")] public required string StartingTime { get; set; }
- public DateTime? StartingDateTime(DateTime? baseDate = null)
- {
- return ParseGtfsTime(StartingTime, baseDate);
- }
-
- [JsonPropertyName("calling_ssm")] public required int CallingSsm { get; set; }
- [JsonPropertyName("calling_time")] public required string CallingTime { get; set; }
- public DateTime? CallingDateTime(DateTime? baseDate = null)
- {
- return ParseGtfsTime(CallingTime, baseDate);
- }
-
- [JsonPropertyName("terminus_code")] public required string TerminusCode { get; set; }
- [JsonPropertyName("terminus_name")] public required string TerminusName { get; set; }
- [JsonPropertyName("terminus_time")] public required string TerminusTime { get; set; }
-
- /// <summary>
- /// Parse GTFS time format (HH:MM:SS) which can have hours >= 24 for services past midnight
- /// </summary>
- private static DateTime? ParseGtfsTime(string timeStr, DateTime? baseDate = null)
- {
- if (string.IsNullOrWhiteSpace(timeStr))
- {
- return null;
- }
-
- var parts = timeStr.Split(':');
- if (parts.Length != 3)
- {
- return null;
- }
-
- if (!int.TryParse(parts[0], out var hours) ||
- !int.TryParse(parts[1], out var minutes) ||
- !int.TryParse(parts[2], out var seconds))
- {
- return null;
- }
-
- // Handle GTFS times that exceed 24 hours (e.g., 25:30:00 for 1:30 AM next day)
- var days = hours / 24;
- var normalizedHours = hours % 24;
-
- try
- {
- var dt = (baseDate ?? DateTime.Today)
- .AddDays(days)
- .AddHours(normalizedHours)
- .AddMinutes(minutes)
- .AddSeconds(seconds);
- return dt.AddSeconds(60 - dt.Second);
- }
- catch
- {
- return null;
- }
- }
-}