Exemplo n.º 1
0
  @Override
  protected void parse(BinArray binArray) throws AisMessageException, SixbitException {
    BinArray sixbit = vdm.getBinArray();
    if (sixbit.getLength() != 312) {
      throw new AisMessageException("Message 19 wrong length " + sixbit.getLength());
    }

    super.parse(sixbit);

    this.spare1 = (int) sixbit.getVal(8);
    this.sog = (int) sixbit.getVal(10);
    this.posAcc = (int) sixbit.getVal(1);
    this.pos = new AisPosition();
    this.pos.setRawLongitude(sixbit.getVal(28));
    this.pos.setRawLatitude(sixbit.getVal(27));
    this.cog = (int) sixbit.getVal(12);
    this.trueHeading = (int) sixbit.getVal(9);
    this.utcSec = (int) sixbit.getVal(6);
    this.spare2 = (int) sixbit.getVal(4);
    this.name = sixbit.getString(20);
    this.shipType = (int) sixbit.getVal(8);
    this.dimBow = (int) sixbit.getVal(9);
    this.dimStern = (int) sixbit.getVal(9);
    this.dimPort = (int) sixbit.getVal(6);
    this.dimStarboard = (int) sixbit.getVal(6);
    this.posType = (int) sixbit.getVal(4);
    this.raimFlag = (int) sixbit.getVal(1);
    this.dte = (int) sixbit.getVal(1);
    this.modeFlag = (int) sixbit.getVal(1);
    this.spare3 = (int) sixbit.getVal(4);
  }
Exemplo n.º 2
0
  public void parse() throws AisMessageException, SixbitException {
    BinArray binArray = vdm.getBinArray();
    if (binArray.getLength() < 424) {
      throw new AisMessageException("Message 5 wrong length " + binArray.getLength());
    }

    super.parse(binArray);

    this.version = (int) binArray.getVal(2);
    this.imo = binArray.getVal(30);
    this.callsign = binArray.getString(7);
    this.name = binArray.getString(20);
    this.shipType = (int) binArray.getVal(8);
    this.dimBow = (int) binArray.getVal(9);
    this.dimStern = (int) binArray.getVal(9);
    this.dimPort = (int) binArray.getVal(6);
    this.dimStarboard = (int) binArray.getVal(6);
    this.posType = (int) binArray.getVal(4);
    this.eta = binArray.getVal(20);
    this.draught = (int) binArray.getVal(8);
    this.dest = binArray.getString(20);
    this.dte = (int) binArray.getVal(1);
    this.spare = (int) binArray.getVal(1);
  }