Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoTW import fails with 60M band #457

Open
OH1KH opened this issue Nov 15, 2021 · 2 comments
Open

LoTW import fails with 60M band #457

OH1KH opened this issue Nov 15, 2021 · 2 comments

Comments

@OH1KH
Copy link
Contributor

OH1KH commented Nov 15, 2021

LoTW import drops all 60M imports to error file.
The reason is fImportProgress line 849:

band := dmUtils.GetBandFromFreq(dmUtils.FreqFromBand(band,'CW'));

dmUtils.FreqFromBand is horrible hard coded list of frequencies versus modes. And there is a typing error with 60M band's
frequency that leads all LoTW imported qsos to be "not found in log" as the "band" above gets empty result.

There is already database table cqrlog_common.bands that holds user editable band start/end/cw/rtty/ssb frequencies.
So why not use that instead of hard coding?
In that table the column "cw" is just pointing at the end frequency of cw slice, but that does not matter. It gives good enough response, I think.

I have done fix that uses database instead of hard coding and in first test all qsos, including 60M, were imported ok from LoTW.
It still needs more testing as dmUtils.FreqFromBand is used from few other places.

While doing tests this issue is open. Test branch is https://github.com/OH1KH/cqrlog/tree/lotw_60m_rcvd_err

@OH1KH
Copy link
Contributor Author

OH1KH commented Nov 16, 2021

Found dmUtils.FreqFromBand used in three places:

  1. LoTW import.(fImportProgress) I can not understand the meaning there. LoTW is returning BAND in qso record. How ever after debug printing qso record (where band is ok) the band is recreated with
    band := dmUtils.GetBandFromFreq(dmUtils.FreqFromBand(band,'CW'));
    Meaning ?

  2. Adif import. I f there is no freq from adif, or its value is 0 freq is created from dmUtils.FreqFromBand. It is needed later in dmUtils.IsAdifOK. Reasonable.
    But after that the BAND is recreated from frequency with dmUtils.GetBandFromFreq before new entry is saved.
    Why??

  3. Wsjtx monitor. Freq is created from current band and mode and used in dmDXCC.DXCCInfo to see callsign worked status. OK, freq is needed there once and not used for recreating back the band.

So it seems that replacing hard coded version with band table lookup does not break anything.

While checking this I looked also to default frequencies. They are set with prefrences/TRXcontrol/Change default frequencies button.
Unfortunately they do not cover all bands and can so not be used for this purpose. In addition they are even stored in config file items.
This is a good place to refer again to issue #397.
Perhaps also those default frequencies should be moved from config file to cqrlog_common.bands table ?
And perhaps new, more user friendly layout of that table would be:
band
band_start
band_end
cw_start
cw_default
cw_end (former cw)
data_start (former rtty, to cover all digital modes)
data_default
data_end
ssb_start (former ssb, to cover all phone modes)
ssb_default
am_default
fm_default
ssb_end

That would not be very big change after all and would make the preferences/bands/frequencies editing more user friendly.
If I remember right the mode slices definition is used only in DXCluster spot double click.
The band start and end are used also elsewhere. And now also dmUtils.FreqFromBand uses this table.

OH1KH pushed a commit to OH1KH/cqrlog that referenced this issue Nov 16, 2021
	dmUtils.FreqFromBand was hard coded to return frequency when band and mode was given.
	How ever it had a typing error with 60M band that caused LoTW import fail with that band.
	As hard coded errors are difficult to fix frequency lookup is now moved tocarlog_common.bands
	where user can edit values via preferences/bands/Frequencies.

	For more information see issue ok2cqr#457

Squashed commit of the following:

commit d70345c
Author: OH1KH <[email protected]>
Date:   Mon Nov 15 21:17:37 2021 +0200

    Small fix to phone modes

commit b9543a5
Author: OH1KH <[email protected]>
Date:   Mon Nov 15 21:07:40 2021 +0200

    dmUtils.FreqFromBand rewritten
OH1KH pushed a commit to OH1KH/cqrlog that referenced this issue Nov 16, 2021
	dmUtils.FreqFromBand was hard coded to return frequency when band and mode was given.
	How ever it had a typing error with 60M band that caused LoTW import fail with that band.
	As hard coded errors are difficult to fix frequency lookup is now moved tocarlog_common.bands
	where user can edit values via preferences/bands/Frequencies.

	For more information see issue ok2cqr#457

	Created update to version 5 for cqrlog_common. Added 3 microwave bands.

Squashed commit of the following:

commit ea685a6
Author: OH1KH <[email protected]>
Date:   Tue Nov 16 15:33:31 2021 +0200

    Added missing 3 microvawe bands to cqrlog_common.bands by database version update to 5

commit d70345c
Author: OH1KH <[email protected]>
Date:   Mon Nov 15 21:17:37 2021 +0200

    Small fix to phone modes

commit b9543a5
Author: OH1KH <[email protected]>
Date:   Mon Nov 15 21:07:40 2021 +0200

    dmUtils.FreqFromBand rewritten
@OH1KH
Copy link
Contributor Author

OH1KH commented Nov 17, 2021

Error is now fixed by commit, but I still leave this open to remind the suggestion of new bands table format.

Using begin and end of modes could allow mode slices appear in different order in band than current and only CW->RTTY(data)->SSB order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant