Skip to content

Add fit to cts viewer#4849

Merged
maliberty merged 9 commits into
The-OpenROAD-Project:masterfrom
jlowpc:add_fit_to_cts_viewer
Apr 6, 2024
Merged

Add fit to cts viewer#4849
maliberty merged 9 commits into
The-OpenROAD-Project:masterfrom
jlowpc:add_fit_to_cts_viewer

Conversation

@jlowpc
Copy link
Copy Markdown
Contributor

@jlowpc jlowpc commented Mar 24, 2024

Attempt to add fit to cts viewer Issue #2590. Attached a simple ibex test case (with 2 clock tabs) to test the hotkey 'f'.
test_cts_viewer_fit.tar.gz

Comment thread src/gui/src/mainWindow.cpp Outdated
connect(exit_, &QAction::triggered, this, &MainWindow::exit);
connect(this, &MainWindow::exit, viewers_, &LayoutTabs::exit);
connect(fit_, &QAction::triggered, viewers_, &LayoutTabs::fit);
connect(fit_, &QAction::triggered, clock_viewer_, &ClockWidget::fit);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this.

Fit in the main window and fit in the clock viewer should be separate. You might well want to fit one without fitting the other. You should create an independent action for the ClockWidget.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say independent action for the ClockWidget, do you want a different hot key for the fit for clock viewer? If so, what key should I use? If not, please let me know how do we decide when user press 'f', whether it goes to the layout window or the clock tree viewer? Thanks.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@AcKoucher
Copy link
Copy Markdown
Contributor

AcKoucher commented Apr 3, 2024

How about also having a fit button in the clock widget?

And, instead of having two hotkeys couldn't we fit based on the cursor position? (Only fit the clock tree if cursor is inside this widget)

@maliberty
Copy link
Copy Markdown
Member

I was thinking the fit key would be window dependent as well. There is already a fit on the right click menu so I'm not sure another button is needed.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

@jlowpc
Copy link
Copy Markdown
Contributor Author

jlowpc commented Apr 4, 2024

@maliberty please confirm that you want the 'f' key to ONLY work on the CTS window when the mouse cursor is within the CTS window, and you want the 'f' key to ONLY work on the layout when the mouse cursor is over the layout window. The menu and button for fit will work ONLY for the layout regardless of where the mouse cursor is.

@maliberty
Copy link
Copy Markdown
Member

My thought was it would depend on the mouse location or focus but perhaps this is getting too tricky both for implementation and somewhat unintuitive as a UI. A fit button next to the update button might be a simpler solution.

@jlowpc
Copy link
Copy Markdown
Contributor Author

jlowpc commented Apr 4, 2024

Please review and comment on my attempt #2 to add a fit button instead of using 'f' hotkey for CTS viewer. Please use attached smaller and improved test case for testing [source run.tcl].
test_cts_fit2.tar.gz

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/gui/src/clockWidget.cpp Outdated

void ClockWidget::fit()
{
if (views_.size() > 0 && clocks_tab_->currentIndex() < views_.size()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]

Suggested change
if (views_.size() > 0 && clocks_tab_->currentIndex() < views_.size()) {
if (!views_.empty() && clocks_tab_->currentIndex() < views_.size()) {
Additional context

/usr/include/c++/11/bits/stl_vector.h:1006: method 'vector'::empty() defined here

      empty() const _GLIBCXX_NOEXCEPT
      ^

@maliberty
Copy link
Copy Markdown
Member

Thanks this look good. Please run clang-format on the code and fix the clang-tidy warning above.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2024

clang-tidy review says "All clean, LGTM! 👍"

@maliberty maliberty merged commit ca07447 into The-OpenROAD-Project:master Apr 6, 2024
@maliberty
Copy link
Copy Markdown
Member

Thanks!

@jlowpc jlowpc deleted the add_fit_to_cts_viewer branch May 8, 2024 17:43
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.

3 participants