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

Fix frequency input logic #421

Merged
merged 4 commits into from
Jan 14, 2024
Merged

Fix frequency input logic #421

merged 4 commits into from
Jan 14, 2024

Conversation

zcsahok
Copy link
Member

@zcsahok zcsahok commented Jan 8, 2024

Changing frequency by entering it in the call input field is a handy feature, but it has some rough edges.

  1. if an out-of-band frequency (all digits) is entered then it is treated erroneously as a callsign
    image

  2. similarly, when there is no rig control then all numeric values are taken for a callsign
    image

Reworked sendqrg() to use plain_number() to check if input is a number. Originally atof() was used to parse it, presumably to support fractional kHz values. As dot is used to configure bandmap this part of the feature was broken anyway, so I replaced it with a simple atoi().
In logit.c moved the clearing in case of freq up to the check itself and thus reduced the indenting of the code actually doing relevant stuff.

@dl1jbe
Copy link
Member

dl1jbe commented Jan 10, 2024

Looks good from my side.

While looking up the changes I found an error in callinput.c line 1257. send_bandswitch() expects an frequency as parameter but gets an bandindex. Maybe you can add a fix for it too.

@zcsahok
Copy link
Member Author

zcsahok commented Jan 13, 2024

Fixed the argument for bandswitch. Probably nobody uses the parallel(!) port info cwdaemon can provide, so this went unnoticed.

Also fixed plain_number(): it returned true for an empty string. When called from callinput.c it is always ensured that the input is not empty, that's why this wasn't a problem until now.
The effect of treating empty string as a number broke keyer window if the input field was empty.

@dl1jbe
Copy link
Member

dl1jbe commented Jan 14, 2024

Fixed the argument for bandswitch. Probably nobody uses the parallel(!) port info cwdaemon can provide, so this went unnoticed.

Thanks.

Also fixed plain_number(): it returned true for an empty string. When called from callinput.c it is always ensured that the input is not empty, that's why this wasn't a problem until now. The effect of treating empty string as a number broke keyer window if the input field was empty.

Fine too.

Whole PR looks good. Should be merged in.

@zcsahok zcsahok merged commit d632426 into Tlf:master Jan 14, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants