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

Add keyword to start tlf in s&p mode #396

Merged
merged 11 commits into from
Aug 1, 2023
Merged

Add keyword to start tlf in s&p mode #396

merged 11 commits into from
Aug 1, 2023

Conversation

darvark
Copy link
Contributor

@darvark darvark commented Jun 28, 2023

Solving one of ToDo items. Added command line argument to start tlf in S&P mode. Executing tlf -p will force s&p mode at startup.

@airween
Copy link
Member

airween commented Jun 28, 2023

We should consider to add this feature into logcfg.dat (I mean we can make this mode permanent.)

@darvark
Copy link
Contributor Author

darvark commented Jun 28, 2023

Ok, I'll start working on this. Does command line param should remain or remove it?

@airween
Copy link
Member

airween commented Jun 28, 2023

Ok, I'll start working on this.

Great, thanks!

Does command line param should remain or remove it?

I think it's a good feature, so I'd keep it. If it becomes available to configure the mode via the config file, it may help to override it (similar to --no-rig or --no-cluster). Therefore, it would be better to replace it with --mode=MODE, e.g. --mode=S&P or --mode=RUN.

But wait for other opinions.

@zcsahok
Copy link
Member

zcsahok commented Jun 28, 2023

I think the typical use case for this is "I'm a small pistol, I want to work (mostly) in S&P".
In this case probably setting it persistently in the configuration file (logcfg.dat) would be the best place.

@darvark
Copy link
Contributor Author

darvark commented Jun 28, 2023

Ok, so now we can setup one of 5 builtin modes. I don't know how to add screenshots here as test evidence.

@zcsahok
Copy link
Member

zcsahok commented Jun 28, 2023

Looks good. Practically only RUN and S&P are relevant, the others (AUTO, KEYBOARD, NONE) are just internal states.

You can add tests for it to test/test_parse_logcfg.c. If a new function is added then the initial configuration has to be re-executed before building.

@zcsahok
Copy link
Member

zcsahok commented Jun 28, 2023

We could also have CQ as an alias for RUN. Maybe it's somewhat more human-readable.

@darvark
Copy link
Contributor Author

darvark commented Jun 28, 2023

Thanks, just can you tell me what are requirements to build tests? I can't find any documentation on that.?

Why RUN mode is displayed as "CQ"? Maybe I should change it to commonly used "RUN" word?

@zcsahok
Copy link
Member

zcsahok commented Jun 28, 2023

Showing CQ on the upper left corner is just fine. Let's then just stay consistent with whatever shown on the screen, so allow only
OPERATING_MODE=CQ
or
OPERATING_MODE=S&P

For adding test and updating the man page please check for example #350

@darvark
Copy link
Contributor Author

darvark commented Jun 28, 2023

Don't know why one test is failing FAIL: run_rules. I've checked it on main branch and it's failing too. So rather not caused by my changes. One more fix is in progress. Sorry

@zcsahok
Copy link
Member

zcsahok commented Jun 28, 2023

Try to run locally the tests with
TERM=xterm make check
None of the failed at github.

test/test_parse_logcfg.c Outdated Show resolved Hide resolved
test/test_parse_logcfg.c Outdated Show resolved Hide resolved
src/parse_logcfg.h Outdated Show resolved Hide resolved
tlf.1.in Outdated Show resolved Hide resolved
@ha5se
Copy link
Contributor

ha5se commented Jun 28, 2023

Sorry to feel again to think to be forced to compel with this one, and to give negative comment on this one.

When you start a contest, independent of starting options, your first physical action will be the one to perfectly decide what you want:

  • as long and as soon as you are turning your VFO knob in your RIG, you are S&P
  • similarly, when you pick among TLF bandmap entries, you are S&P.
  • as soon as you press the CQ key (usually F1) you are running.

I am afraid but I absolutely do not see any use for such a startup option.
IMHO, I absolutely object against superfluous startup parameters.

tlf.1.in Outdated Show resolved Hide resolved
@zcsahok
Copy link
Member

zcsahok commented Jun 29, 2023

@ha5se I see your point, but I find this configuration handy for mostly S&P operators. Note that this is a configuration parameter rather than a command line option. So it has to be set just once as a preference.

@darvark Looks good. One more minor thing: please add/move the initialization of cqmode in main.c to the init_variables(). The purpose is to have a defined state of variables before reloading configuration.

(a git-technical comment: it will be easier to keep your repo in sync with TLF if PRs are created from dedicated branches, not from master)

@zcsahok
Copy link
Member

zcsahok commented Jun 29, 2023

You can also tick out this issue from the ToDo file. :-)

@zcsahok
Copy link
Member

zcsahok commented Jun 29, 2023

@airween @dl1jbe Any comments?

@darvark
Copy link
Contributor Author

darvark commented Jun 29, 2023

@zcsahok Thanks,

@darvark
Copy link
Contributor Author

darvark commented Jul 1, 2023

I think I should change behavior of that variable, and make it optional, just not to break backward compatibility.

@zcsahok
Copy link
Member

zcsahok commented Jul 1, 2023

I think it is backward compatible: if not present then CQ mode is selected.

@darvark
Copy link
Contributor Author

darvark commented Jul 1, 2023

I mean after that change will be merged to master, each user using this branch will have to update their configuration files and add new keyword, in other case he will get error message during tlf start. I just want to avoid such situations, so still as you wrote if option not present then default behaviour CQ is selected, but we would be able to start tlf based on old configs

@zcsahok
Copy link
Member

zcsahok commented Jul 1, 2023

There is no need to touch the configuration: the default mode (CQ) set in init_variables() will be effective.

You can also check this by simply commenting out the keyword from your logcfg.dat: TLF shall start in CQ mode without any complaints.

@darvark
Copy link
Contributor Author

darvark commented Jul 4, 2023

There is no need to touch the configuration: the default mode (CQ) set in init_variables() will be effective.

You can also check this by simply commenting out the keyword from your logcfg.dat: TLF shall start in CQ mode without any complaints.

yes, your right. Sorry for late reply. Everything works as expected.

@df7cb
Copy link
Contributor

df7cb commented Jul 4, 2023

Thanks for working on this, this is something I've also wanted for a long time.

@ha5se: you are right that tlf could probably figure out the mode on its own, but then the startup default still needs switching to S&P.

@zcsahok
Copy link
Member

zcsahok commented Aug 1, 2023

Thanks!

@zcsahok zcsahok merged commit e1cefb0 into Tlf:master Aug 1, 2023
4 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.

5 participants