Blame view

src/app/model/vessel.ts 527 Bytes
de59ffef8   lsagona   add model + search
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  import {Message} from './message';
  
  export class Vessel {
    messages: Array<Message>;
  
    constructor(messages: Array<Message>) {
      this.messages = messages;
    }
  
    addMessage(message: Message): void {
    this.messages.push(message);
    }
  
    getMMSI(): string {
9bbae2409   lsagona   highlight selecte...
15
16
17
      if (this.messages.length === 0) {
        return '';
      }
de59ffef8   lsagona   add model + search
18
19
20
21
22
23
      return this.messages[0].mmsi;
    }
  
    getName(): string {
      return this.messages[0].vesselName;
    }
287033a62   lsagona   add vessel positi...
24
    public getColor(): string {
72dfa80e2   lsagona   eache vessel have...
25
      return '#' + (+this.getMMSI()).toString(16).substr(0, 6);
287033a62   lsagona   add vessel positi...
26
    }
de59ffef8   lsagona   add model + search
27
  }