diff --git a/cmd/main.go b/cmd/main.go index 3a4bbef..a3563d7 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -157,7 +157,6 @@ func feedifyVehicles(vehicles []*pb.VehiclePosition, header *pb.FeedHeader, rout var route_long_name sql.NullString if !rows.Next() { - fmt.Println(rows.Err()) continue } @@ -196,6 +195,7 @@ func feedifyVehicles(vehicles []*pb.VehiclePosition, header *pb.FeedHeader, rout ShortName: route_short_name.String, LongName: route_long_name.String, }, + TripId: *vehicle.Trip.TripId, }) } diff --git a/proto/schema.pb.go b/proto/schema.pb.go index 0ab4de9..ebb1182 100644 --- a/proto/schema.pb.go +++ b/proto/schema.pb.go @@ -385,6 +385,7 @@ type VehicleFeed_Vehicle struct { NearestStation *VehicleFeed_Station `protobuf:"bytes,6,opt,name=nearest_station,json=nearestStation,proto3" json:"nearest_station,omitempty"` Headsign string `protobuf:"bytes,7,opt,name=headsign,proto3" json:"headsign,omitempty"` Route *VehicleFeed_Route `protobuf:"bytes,8,opt,name=route,proto3" json:"route,omitempty"` + TripId string `protobuf:"bytes,10,opt,name=trip_id,json=tripId,proto3" json:"trip_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -482,11 +483,18 @@ func (x *VehicleFeed_Vehicle) GetRoute() *VehicleFeed_Route { return nil } +func (x *VehicleFeed_Vehicle) GetTripId() string { + if x != nil { + return x.TripId + } + return "" +} + var File_proto_schema_proto protoreflect.FileDescriptor const file_proto_schema_proto_rawDesc = "" + "\n" + - "\x12proto/schema.proto\"\xcf\x06\n" + + "\x12proto/schema.proto\"\xe8\x06\n" + "\vVehicleFeed\x120\n" + "\bvehicles\x18\x01 \x03(\v2\x14.VehicleFeed.VehicleR\bvehicles\x12)\n" + "\x04info\x18\x02 \x01(\v2\x15.VehicleFeed.FeedInfoR\x04info\x1a+\n" + @@ -511,7 +519,7 @@ const file_proto_schema_proto_rawDesc = "" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x10\n" + "\x03lat\x18\x03 \x01(\x02R\x03lat\x12\x10\n" + - "\x03lon\x18\x04 \x01(\x02R\x03lon\x1a\xa1\x02\n" + + "\x03lon\x18\x04 \x01(\x02R\x03lon\x1a\xba\x02\n" + "\aVehicle\x12\x10\n" + "\x03lat\x18\x01 \x01(\x02R\x03lat\x12\x10\n" + "\x03lon\x18\x02 \x01(\x02R\x03lon\x12\x18\n" + @@ -521,7 +529,9 @@ const file_proto_schema_proto_rawDesc = "" + "\x02id\x18\x05 \x01(\tR\x02id\x12=\n" + "\x0fnearest_station\x18\x06 \x01(\v2\x14.VehicleFeed.StationR\x0enearestStation\x12\x1a\n" + "\bheadsign\x18\a \x01(\tR\bheadsign\x12(\n" + - "\x05route\x18\b \x01(\v2\x12.VehicleFeed.RouteR\x05route\"Z\n" + + "\x05route\x18\b \x01(\v2\x12.VehicleFeed.RouteR\x05route\x12\x17\n" + + "\atrip_id\x18\n" + + " \x01(\tR\x06tripId\"Z\n" + "\x04Line\x12\x14\n" + "\x10LINE_UNSPECIFIED\x10\x00\x12\t\n" + "\x05GREEN\x10\x01\x12\a\n" + diff --git a/proto/schema.proto b/proto/schema.proto index 7883f13..c71fb73 100644 --- a/proto/schema.proto +++ b/proto/schema.proto @@ -48,6 +48,7 @@ message VehicleFeed { Station nearest_station = 6; string headsign = 7; Route route = 8; + string trip_id = 10; } repeated Vehicle vehicles = 1; diff --git a/static/index.html b/static/index.html index d064978..a6aef34 100644 --- a/static/index.html +++ b/static/index.html @@ -300,6 +300,6 @@ - + diff --git a/static/js/main.js b/static/js/main.js index 110c266..e7ad01f 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -178,7 +178,7 @@ function vehiclePopupContent(vehicle) { content += `
@ ${vehicle.nearest_station.name}` } - content += `

vehicle #: ${vehicle.id}` + content += `

vehicle #: ${vehicle.id} · trip ID: ${vehicle.trip_id}` return content }