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

GUI: Option to use individual time controls in games and in tournaments #599

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alwey
Copy link
Contributor

@alwey alwey commented Aug 8, 2020

This PR deals with two topics

  1. Option to use split time controls for White and Black in individual games in the GUI

A new TimeControlWidget is introduced in order support the TimeControlDialog. It takes most of the dialog's components.
The dialog controls two TimeControlWidgets. The second TimeControlWidget (for Black) can be enabled on demand. By checking or unchecking a checkbox the dialog switches between common time controls for both sides or split time controls for White and for Black.

TimeControl timeControl2 is added to the GameSettingsWidget class, to save/read settings for the 2nd time control.
If used in the general settings (Tools->Settings->Games) the second time control is saved to the cutechess.ini file.
It was necessary to add extra control logic for hourglass mode to prevent diverging settings for the sides.

  1. Option to use individual time controls in tournaments in the GUI

A new context menu is added to the tournament players' list if some player(s) are selected. The menu item "Edit Time control" can be used to edit time controls individually. A simplified time control dialog is shown. It looks mostly like the old time control dialog, the 2nd time control is unused. Multiple-item selection in the player list is supported for time control updates, (Hint to users: also use the SHIFT and the CTRL-modifiers when selecting for best results).

A QVector is added to NewTournamentDialog to store the individual time controls.

At tournament creation an individual time control is used when valid else tournament controls are used instead.
The hourglass mode is enabled or disabled uniformly according to the tournament's common settings.

Note:
In total, the TimeControlDialog is used in 4 ways:

  1. General game settings ( via GameSettingsWidget, two time controls available, values are read from / saved to cutechess.ini).
  2. Time controls for an individual game (via GameSettingsWidget, two time controls available)
  3. Common Time control of a new tournament (via GameSettingsWidget, but only one time control available)
  4. Individual time control of a tournament player (via players' list context menu if player(s) selected: only one time control)

The PR relates to #161, the opening book part of #161 is still missing.
Resolves #413

I hope this is useful

Update:
I attached some Screenshots below.
This PR also resolves #619, which came later. Also this addresses item 1 in request #351

@alwey alwey changed the title Option to use individual time controls in games and in tournaments GUI: Option to use individual time controls in games and in tournaments Aug 8, 2020
…ual games

Use the new TimeControlWidget in support of TimeControlDialog.
Enable second TimeControlWidget for Black on demand.
Add timeControl2 to GameSettingsWidget, save/read settings for 2nd control.
Add extra control logic for hourglass mode.

GUI: Option to use individual time controls in tournaments

Add a context menu to the tournament players' list.
Add function to edit time controls individually.
Use a simplified time control dialog (2nd time control unused).
Add QVector of individual time controls to NewTournamentDialog.
Support multi-engine selection for time control updates.
Use an individual time control when valid else tournament controls.
At tournament creation hourglass mode is enabled or disabled uniformly
according to the tournament's common settings.
@gekkehenker
Copy link

Thanks for this commit.
Works great for me.

@alwey
Copy link
Contributor Author

alwey commented Jan 1, 2022

Some screenshot to illustrate the features:

t4
The time control for individual games (via Game->New) can now be set individually for White and Black.

t1
The same goes for the general settings of time control (via Tools->Settings->Games).

t3
The checkbox in the top left corner switches between common time controls and split time controls t2.

Time controls can be set individually for tournament players.
Also see the example with an engine playing multiple instances with different time controls given in #619.

t5
Right-clicking an entry and selecting "Edit Time Control" calls the time control dialog.

t2
In this example the configurations have been renamed by the user to reflect the individual time controls. The time control dialog for the last engine is shown.

t6
The user should add the TC field to the resultformat, especially if the names of the tourney players are neutral.

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