Replies: 2 comments 1 reply
-
@atlanswer Let us review your second bullet. Regarding the first one, it is not a PyAEDT limitation, it is an AEDT issue, there is not timeline for that, but the development team is working on that. |
Beta Was this translation helpful? Give feedback.
0 replies
-
We found a limitation in Linux to support multiple Desktop instances. But with this Pull request, it will be possible in Widnows: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. #3342 mentioned that some refactorings have been made to support multiple desktop instances in the future. So I'm wondering:
Is there a timeline for that to be implemented?
Before it arrives, the end users can try to achieve similar functionality by managing references to the desktop objects themselves. At least there's a workaround that is supposed to work for PyAEDT 0.7.
Users can clear the
_desktop_sessions
dict after creating oneDesktop
instance to get to__init__
again. However, ifstarting_mode == "grpc"
, the DLL functionpyaedt.generic.grpc_plugin.CreateAedtApplication
seems to return a singleton, i.e., making every desktop wrapper object created to reference the latest one.Fallback to COM by
settings.use_grpc_api = False
can work. But currently, a lot of instance variables, methods, and properties are referencing the global variables such as the desktop objectoDesktop
stored insys.modules["__main__"]
, which will be overwritten by subsequent initializations of newDesktop
objects.I think one solution is to get rid of global references like
self._main = sys.modules["__main__"]
. For instance, setting theodesktop
instance variable directly to the AEDT COM objectoDesktop
, or whatever wrapper the corresponding initialization function may return. Right now, instance variables and methods can be overridden by users but properties without setters couldn't.Is this solution the intended one? Are issues and PRs that replace these global references with local ones acceptable? For example:
pyaedt/pyaedt/desktop.py
Line 1047 in 09db4b3
pyaedt/pyaedt/desktop.py
Line 632 in 09db4b3
pyaedt/pyaedt/desktop.py
Line 650 in 2a62fa5
Thanks. Keep up the good work. 👍
Beta Was this translation helpful? Give feedback.
All reactions