Blame view

src/main/kotlin/application/model/Message.kt 1.08 KB
b350f9dfe   lsagona   import vessels an...
1
2
3
4
5
  package application.model
  
  import java.time.LocalDateTime
  
  class Message(split: List<String>) {
513c0341c   lsagona   add chart
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
      val mmsi = MMSI(split[0].toIntOrNull())
      val time = Time(LocalDateTime.parse(split[1]))
      val latitude = Latitude(split[2].toDoubleOrNull())
      val longitude = Longitude(split[3].toDoubleOrNull())
      val speedOverGround = SpeedOverGround(split[4].toDoubleOrNull())
      val courseOverGround = CourseOverGround(split[5].toDoubleOrNull())
      val heading = Heading(split[6].toDoubleOrNull())
      val vesselName = VesselName(split[7])
      val imo = IMO(split[8])
      val callSign = CallSign(split[9])
      val vesselType = VesselType(split[10].toIntOrNull())
      val status = Status(split[11])
      val length = Length(split[12].toDoubleOrNull())
      val width = Width(split[13].toDoubleOrNull())
      val draft = Draft(split[14].toDoubleOrNull())
      val cargo = Cargo(split[15].toIntOrNull())
b350f9dfe   lsagona   import vessels an...
22

79b001037   lsagona   heat map
23

513c0341c   lsagona   add chart
24
25
26
      fun getHexColorStroke(): String {
          var hex = Integer.toHexString(this.mmsi.value!!)
          if (hex.length > 6) {
79b001037   lsagona   heat map
27
28
29
30
              hex = hex.substring(hex.length - 6)
          }
          return hex
      }
b350f9dfe   lsagona   import vessels an...
31
  }