Blame view
src/main/kotlin/application/model/Message.kt
1.23 KB
b350f9dfe import vessels an... |
1 2 3 4 5 |
package application.model import java.time.LocalDateTime class Message(split: List<String>) { |
f39d90e60 Select/deselect MMSI |
6 |
val mmsi = MMSI(if (split[0] == "") null else split[0]) |
513c0341c add chart |
7 8 9 10 11 12 |
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()) |
f15a58907 add better chart |
13 14 15 |
val vesselName = VesselName(if (split[7] == "") null else split[7]) val imo = IMO(if (split[8] == "") null else split[8]) val callSign = CallSign(if (split[9] == "") null else split[9]) |
df68a9fdc refactor graph mi... |
16 |
val vesselType = VesselType(split[10].toDoubleOrNull()) |
f15a58907 add better chart |
17 |
val status = Status(if (split[11] == "") null else split[11]) |
513c0341c add chart |
18 19 20 |
val length = Length(split[12].toDoubleOrNull()) val width = Width(split[13].toDoubleOrNull()) val draft = Draft(split[14].toDoubleOrNull()) |
df68a9fdc refactor graph mi... |
21 |
val cargo = Cargo(split[15].toDoubleOrNull()) |
b350f9dfe import vessels an... |
22 |
|
513c0341c add chart |
23 |
fun getHexColorStroke(): String { |
f39d90e60 Select/deselect MMSI |
24 |
var hex = Integer.toHexString(this.mmsi.value?.toInt()!!) |
513c0341c add chart |
25 |
if (hex.length > 6) { |
79b001037 heat map |
26 27 28 29 |
hex = hex.substring(hex.length - 6) } return hex } |
b350f9dfe import vessels an... |
30 |
} |