mmomtchev / igc-xc-score

A scoring program for gliding competitions striving for 100% accuracy and determinism
GNU Lesser General Public License v3.0
42 stars 9 forks source link

Properties "launch" and "landing" missing in index.d.ts file ? #245

Open xeronimus opened 2 months ago

xeronimus commented 2 months ago

The solver detects launch and landing automatically. The resulting Solution contains indices for both these points.

E.g.

{
  opt: {
    launch: 0,             // the index of the corresponding GPS fix
    landing: 1247,     // the index of the corresponding GPS fix
    flight: { ... },
    scoring: { ... },
    config : {... }
  },
  ...
}

The type "Opt", that is defined in index.d.ts is missing the two properties "launch" and "landing".


interface Opt {
    scoring: Scoring;
    flight: IGCFile & {
        /** Filtered GPS fixes when invalid=false, GPS fix number is relative to this array */
        filtered: BRecord[];
    };
    launch?: number;
        landing?: number;
}

Thanks!

mmomtchev commented 2 months ago

As far as I remember, they are optional and depend on whether the launch/landing detection is enabled.

You can submit a PR.

xeronimus commented 1 month ago

I checked the code, "launch" and "landing" are always set.

If launch-landing detection is disabled (or no launch/landing can be detected), "launch" will be 0 and "landing" will be the index of the last fix.

the Solution.Opt also contains the config object, I added it to the type definition as well.