Add config & CLI support for .ftml path in mssautoplot#2814
Add config & CLI support for .ftml path in mssautoplot#2814annapurna-gupta wants to merge 4 commits intoOpen-MSS:developfrom
Conversation
mslib/msui/constants.py
Outdated
|
|
||
| # ToDo refactor to a function | ||
| MSS_AUTOPLOT = os.getenv('MSS_AUTOPLOT', os.path.join(MSUI_CONFIG_PATH, "mssautoplot.json")) | ||
| DEFAULT_FTML_PATH = os.getenv('MSS_FTML_PATH', os.path.join(MSUI_CONFIG_PATH, "example_flight.ftml")) |
There was a problem hiding this comment.
please use the users config var mss_dir, and don't create a new constant
or investigate how it stores the first used dir.
e.g. when you store in a ftml dir, it uses that dir for e.g. an import
it should not behave different to the common user interface.
look for self.last_save_directory
mslib/utils/mssautoplot.py
Outdated
| # Todo add the dir to the file in the mssautoplot.json | ||
| dirpath = "./" | ||
| file_path = os.path.join(dirpath, filename) | ||
| file_path = DEFAULT_FTML_PATH |
There was a problem hiding this comment.
use the users config of mss_dir
|
Let’s also make sure we save the file path in mssautoplot.json. We can just use self.last_save_directory for this; no need to create a new default. |
|
the autoplot dockingwidget still does not save a path into the json configuration for the filenames, see |
I'm currently working on the CLI version of autoplot (not the GUI-based autoplot_dockwidget). My changes are focused on command-line behavior, so they won't affect or fix the GUI behavior related to JSON path saving? or am i missing something? |
|
Hii @ReimarBauer
But I think it’s not working as expected — the file still isn’t being found. Could you please help me check if I’m missing something? |
When configuring the new mssautoplot.json, we should mirror the behavior of existing configurations regarding file paths. Specifically, the path used to store an FTML file should be relative to the user's designated storage location. For example, if a user saves an FTML file as /Users/reimarbauer/FTML/example.ftml, the new configuration should reflect this same path. This consistency is important because sharing my mssautoplot.json necessitates also sharing the corresponding FTML file – and knowing the storage location ensures I can easily identify the correct one among potentially many examples. Please implement the functionality for the autoplot docking widget https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/autoplot_dockwidget.py to save the FTML path/file before proceeding with CLI improvements. |
mslib/msui/autoplot_dockwidget.py
Outdated
| else: | ||
| if filename != parent2.mscolab.active_operation_name: | ||
| filename += ".ftml" | ||
| filename = os.path.join(const.MSUI_CONFIG_PATH, filename + ".ftml") |
There was a problem hiding this comment.
when you do "save as" the used directory is stored at
https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/msui_mainwindow.py#L946
self.last_save_directory
You need to enable access to the var and use it then. We need the dir where the file is stored by File - Save_As
There was a problem hiding this comment.
you can pass it into the topview and from there to the dockingwidget, see https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/msui_mainwindow.py#L1029
|
Hii @ReimarBauer |
Please share the section of your mssautoplot.json for |
Fixes #2714