Setting up a more general interface above Frequency

In Orekit, we have a Frequency enumerate, located in the org.orekit.gnss package. This enumerate lists various GNSS signals (G01, G02, …E05, …) that are used for example in Rinex files to specify the ObservationType (C1C, L6A, …).

An enumerate is cumbersome as it cannot be extended, so if one needs to use a non-standard frequency, it cannot be done. The name Frequency is also a misnomer as the enumerate provides not only the frequency itself but also the wavelength.

I would like to introduce at least one upper-level interface above Frequency, for example RadioWave and declare the getMHzFrequency and getWavelength methods at this interface level, with the existing enumerate implementing the interface. Perhaps we could also set up an intermediate level interface GnssSignal for the getRatio method that would reference the common 10.23MHz frequency used in many navigation systems.

Setting up these interfaces is trivial and could be done for 12.1.

I am however not sure if we could at the same time change some methods signatures that use the Frequency enumerate in their parameters list to instead accept a RadioWave (or GnssSignal). It seems to me it is a compatible change as a Frequency would implement these interfaces and then could be used as is. However I am not sure this would work in case someone had overriden such a method in a custom class. Do you think this should wait for 13.0?

Issues 1433 and 1434 have been created for this.
The first one introduces the interfaces and as it is compatible, it was fixed for version 12.1.
The second one introduces incompatibility, so it has been set to target version 13.0.

1 Like