From f8343c65cfdb9c274ba1406a4e1318b0861b1e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C5=BEe=20Jen=C5=A1terle?= Date: Mon, 3 Feb 2025 13:12:40 +0100 Subject: Add parsing of 30-bit SSB station codes --- .../java/org/uic/barcode/ssbFrame/SsbStations.java | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/uic/barcode/ssbFrame/SsbStations.java b/src/main/java/org/uic/barcode/ssbFrame/SsbStations.java index 13bf40a..7fc6a4e 100644 --- a/src/main/java/org/uic/barcode/ssbFrame/SsbStations.java +++ b/src/main/java/org/uic/barcode/ssbFrame/SsbStations.java @@ -22,6 +22,8 @@ public class SsbStations { protected String arrivalStationCode = " "; protected String departureStationCode = " "; + protected Integer arrivalStationNumber = 0; + protected Integer departureStationNumber = 0; protected SsbStationCodeTable codeTable = SsbStationCodeTable.NRT; protected boolean alphaNumeric = true; @@ -81,16 +83,21 @@ public class SsbStations { offset++; if (alphaNumeric) { + codeTable = SsbStationCodeTable.UNKNOWN_0; departureStationCode = bits.getChar6String(offset,30); + departureStationNumber = bits.getInteger(offset, 30); offset += 30; arrivalStationCode = bits.getChar6String(offset,30); + arrivalStationNumber = bits.getInteger(offset, 30); offset += 30; } else { codeTable = SsbStationCodeTable.values()[bits.getInteger(offset, 4)]; offset += 4; - departureStationCode = Integer.toString(bits.getInteger(offset, 28)); + departureStationNumber = bits.getInteger(offset, 28); + departureStationCode = Integer.toString(departureStationNumber); offset += 28; - arrivalStationCode = Integer.toString(bits.getInteger(offset, 28)); + arrivalStationNumber = bits.getInteger(offset, 28); + arrivalStationCode = Integer.toString(arrivalStationNumber); offset += 28; } @@ -108,6 +115,14 @@ public class SsbStations { this.arrivalStationCode = arrivalStationCode; } + public Integer getArrivalStationNumber() { + return arrivalStationNumber; + } + + public void setArrivalStationNumber(Integer arrivalStationNumber) { + this.arrivalStationNumber = arrivalStationNumber; + } + public String getDepartureStationCode() { return departureStationCode; } @@ -116,6 +131,14 @@ public class SsbStations { this.departureStationCode = departureStationCode; } + public Integer getDepartureStationNumber() { + return departureStationNumber; + } + + public void setDepartureStationNumber(Integer departureStationNumber) { + this.departureStationNumber = departureStationNumber; + } + public SsbStationCodeTable getCodeTable() { return codeTable; } -- cgit v1.2.3