@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.mjs CHANGED
@@ -1902,7 +1902,6 @@ function parseCallsign(raw) {
1902
1902
  iarea <= 2 && // Fortran: iarea (1-indexed) must be 2 or 3 → 0-indexed: 1 or 2
1903
1903
  nplet >= 1 && // at least one letter before area digit
1904
1904
  npdig < iarea && // not all digits before area
1905
- nslet >= 1 && // must have at least one letter after area digit
1906
1905
  nslet <= 3; // at most 3 suffix letters
1907
1906
  return { basecall: call, isStandard: standard, suffix };
1908
1907
  }
@@ -1946,7 +1945,22 @@ function pack28(token) {
1946
1945
  // Standard callsign
1947
1946
  const { basecall, isStandard } = parseCallsign(t);
1948
1947
  if (isStandard) {
1949
- const cs = basecall.length === 5 ? ` ${basecall}` : basecall;
1948
+ // Fortran pack28 layout:
1949
+ // iarea==2 (0-based 1): callsign=' '//c13(1:5)
1950
+ // iarea==3 (0-based 2): callsign= c13(1:6)
1951
+ let iareaD = -1;
1952
+ for (let ii = basecall.length - 1; ii >= 1; ii--) {
1953
+ const c = basecall[ii] ?? "";
1954
+ if (c >= "0" && c <= "9") {
1955
+ iareaD = ii;
1956
+ break;
1957
+ }
1958
+ }
1959
+ let cs = basecall;
1960
+ if (iareaD === 1)
1961
+ cs = ` ${basecall.slice(0, 5)}`;
1962
+ if (iareaD === 2)
1963
+ cs = basecall.slice(0, 6);
1950
1964
  const i1 = A1.indexOf(cs[0] ?? " ");
1951
1965
  const i2 = A2.indexOf(cs[1] ?? "0");
1952
1966
  const i3 = A3.indexOf(cs[2] ?? "0");