Feature Web GUI#10234
Conversation
|
Support for 3DBlox Handling: We implemented the new clear3Dbx method, which properly iterates through and clears 3DBlox, allowing adequate support for multiple 3DBlox files during the same session. Web GUI Closing and Shutdown: We wired the server shutdown mechanics to the reception of the exit/quit commands in the GUI's Tcl terminal, ensuring the actual and safe closure of the socket and the web session. |
There was a problem hiding this comment.
Code Review
This pull request introduces a clear_3dbx command and updates read_3dbx to automatically clear existing chip data before loading new files. It also modifies dbChip::destroy to include chip nets and implements a graceful server shutdown mechanism for the web interface triggered by 'exit' or 'quit' commands. Review feedback suggests using std::vector::assign for more idiomatic chip collection in C++ and recommends translating Portuguese UI strings to English to maintain consistency across the application.
| std::vector<odb::dbChip*> chips; | ||
| for (odb::dbChip* chip : db_->getChips()) { | ||
| chips.push_back(chip); | ||
| } |
There was a problem hiding this comment.
Use std::vector::assign with iterators to copy elements from a dbSet to a std::vector, as per the repository's general rules. This is more idiomatic and concise than a manual loop.
std::vector<odb::dbChip*> chips;
auto chips_set = db_->getChips();
chips.assign(chips_set.begin(), chips_set.end());References
- To copy elements from a dbSet to a std::vector, use the vector::assign() method with iterators from the dbSet, as direct assignment is not supported.
| tclAppend('Sessão terminada. Pode fechar este separador.\n', | ||
| 'tcl-exit'); | ||
| input.disabled = true; | ||
| input.placeholder = 'Sessão terminada'; |
There was a problem hiding this comment.
The UI strings are in Portuguese, while the rest of the application uses English. For consistency and maintainability, please use English for these messages.
| tclAppend('Sessão terminada. Pode fechar este separador.\n', | |
| 'tcl-exit'); | |
| input.disabled = true; | |
| input.placeholder = 'Sessão terminada'; | |
| tclAppend('Session terminated. You can close this tab.\n', | |
| 'tcl-exit'); | |
| input.disabled = true; | |
| input.placeholder = 'Session terminated'; |
|
@osamahammad21 FYI |
| } | ||
|
|
||
| Tcl_ResetResult(interp_); | ||
| logger_->info(utl::WEB, 5, "Server stopped."); |
There was a problem hiding this comment.
warning: no header providing "Tcl_ResetResult" is directly included [misc-include-cleaner]
src/web/src/web.cpp:39:
- #include "tile_generator.h"
+ #include "tclDecls.h"
+ #include "tile_generator.h"0ff7c2d to
ab39b17
Compare
| #include "request_handler.h" | ||
| #include "tcl.h" | ||
| #include "tclDecls.h" | ||
| #include "tile_generator.h" |
There was a problem hiding this comment.
warning: included header tclDecls.h is not used directly [misc-include-cleaner]
| #include "tile_generator.h" | |
| #include "tile_generator.h" |
fix the issue #10232