Kaynağa Gözat

add the heading to the inbound structure

Sven Czarnian 2 yıl önce
ebeveyn
işleme
c080ddb987

+ 11 - 1
src/inbound/dto/flightstate.dto.ts

@@ -19,10 +19,20 @@ export class FlightStateDto {
   @Max(700)
   groundSpeed: number;
 
+  @IsNotEmpty()
+  @ApiProperty({
+    description: 'The reported heading',
+    example: 200,
+  })
+  @IsInt()
+  @Min(0)
+  @Max(360)
+  heading: number;
+
   @IsNotEmpty()
   @ApiProperty({
     description: 'The reported ground track',
-    example: 400,
+    example: 205,
   })
   @IsInt()
   @Min(0)

+ 1 - 0
src/inbound/inbound.controller.ts

@@ -87,6 +87,7 @@ export class InboundController {
     return {
       position: CoordinateConverter.convert(input.position),
       groundSpeed: input.groundSpeed,
+      heading: input.heading,
       groundTrack: input.groundTrack,
       altitude: input.altitude,
       verticalSpeed: input.verticalSpeed,

+ 6 - 0
src/inbound/models/flightstate.model.ts

@@ -21,6 +21,12 @@ export class FlightState {
   })
   groundSpeed: number;
 
+  @Prop({
+    required: true,
+    type: Number,
+  })
+  heading: number;
+
   @Prop({
     required: true,
     type: Number,