App designer app calls sub apps, better to leave as .mlapp or compile each one to .exe?

7 ビュー (過去 30 日間)
I'm designing an app in app designer. It calls several sub apps. Some of these do their own processes, some of them are simply complex dialogue boxes.
At the moment, when I run the app in App designer to test it out, all the apps are still in .mlapp format. My question is, when I finally compile my main app should I compile each sub app separately myself and include their .exes in the file list? Or leave them in .mlapp format and let the compiler deal with them? Does it make a difference?
  1 件のコメント
Neurolab
Neurolab 2024 年 3 月 29 日
For an example of a dialogue box sub app you can see this Mathworks walkthrough, but it doesn't mention what to do when it comes to compiling the app(s):
https://www.mathworks.com/help/matlab/creating_guis/creating-multiwindow-apps-in-app-designer.html

サインインしてコメントする。

採用された回答

Eric Delgado
Eric Delgado 2024 年 4 月 1 日
編集済み: Eric Delgado 2024 年 4 月 1 日
Yes, there's a significant difference! Keeping the files as .MLAPP means only one session of the MATLAB Runtime will run on the user's machine.
However, if you directly compile auxiliary modules and include their .EXE in your project, calling a .EXE module will create a separate session of MATLAB Runtime each time. Consequently, you won't have a handle for the auxiliar app, preventing information exchange between your main app and the auxiliar one.
Beyond that, this would lead to a poor user experience, given that the MATLAB Runtime takes between 10 and 20 seconds to load.
  2 件のコメント
Neurolab
Neurolab 2024 年 4 月 1 日
At the moment the parent app is passed as an input argument to the sub-app, you are saying that if the sub app is compiled separately this will no longer work? Is there any way to alert the parent app that the sub app has completed it's task?
10-20 seconds might not actually be a problem because the sub app only needs to be called once and is expected to be doing it's task for a little while.
Eric Delgado
Eric Delgado 2024 年 4 月 1 日
編集済み: Eric Delgado 2024 年 4 月 1 日
Unfortunately, calling a .EXE file (created in MATLAB) initiates a new process (MATLAB Runtime) in your operating system. For this reason, you lose access to the app's public properties and methods within this new process.
If you proceed with this approach, you'd be forced to rely on mechanisms like external files or tcp-sockets to facilitate information exchange between applications running in different processes of your operating system. However, I don't think this is a good ideia! :)
I forgot to answer your last question ("Is there any way to alert the parent app that the sub app has completed it's task?"). So... maybe the answer that you are looking for is here: https://www.mathworks.com/help/matlab/ref/parallel.pool.dataqueue.html

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by