@e04/ft8ts 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ft8ts.cjs CHANGED
@@ -1904,7 +1904,6 @@ function parseCallsign(raw) {
1904
1904
  iarea <= 2 && // Fortran: iarea (1-indexed) must be 2 or 3 → 0-indexed: 1 or 2
1905
1905
  nplet >= 1 && // at least one letter before area digit
1906
1906
  npdig < iarea && // not all digits before area
1907
- nslet >= 1 && // must have at least one letter after area digit
1908
1907
  nslet <= 3; // at most 3 suffix letters
1909
1908
  return { basecall: call, isStandard: standard, suffix };
1910
1909
  }
@@ -1948,7 +1947,22 @@ function pack28(token) {
1948
1947
  // Standard callsign
1949
1948
  const { basecall, isStandard } = parseCallsign(t);
1950
1949
  if (isStandard) {
1951
- const cs = basecall.length === 5 ? ` ${basecall}` : basecall;
1950
+ // Fortran pack28 layout:
1951
+ // iarea==2 (0-based 1): callsign=' '//c13(1:5)
1952
+ // iarea==3 (0-based 2): callsign= c13(1:6)
1953
+ let iareaD = -1;
1954
+ for (let ii = basecall.length - 1; ii >= 1; ii--) {
1955
+ const c = basecall[ii] ?? "";
1956
+ if (c >= "0" && c <= "9") {
1957
+ iareaD = ii;
1958
+ break;
1959
+ }
1960
+ }
1961
+ let cs = basecall;
1962
+ if (iareaD === 1)
1963
+ cs = ` ${basecall.slice(0, 5)}`;
1964
+ if (iareaD === 2)
1965
+ cs = basecall.slice(0, 6);
1952
1966
  const i1 = A1.indexOf(cs[0] ?? " ");
1953
1967
  const i2 = A2.indexOf(cs[1] ?? "0");
1954
1968
  const i3 = A3.indexOf(cs[2] ?? "0");