Dataflow in App Designer
Afficher commentaires plus anciens
What is a good way to implement a dataflow paradigm in App Designer?
My app consists of processing stages, each of which take input data and generate output data based on settings specified by GUI components. Each stage depends on other stages in a chain or tree (directed graph) being executed to provide its input data. The first stage is typically reading a file and the final stages typically display plots, images or tables of results. Because some stages take a significant time to execute, it makes sense whenever possible not to recompute intermediate results data. However, I need to find a clean way to code this behaviour.
Any suggestions welcome!
8 commentaires
J. Alex Lee
le 17 Nov 2020
in the object oriented paradigm, perhaps it is less productive to think about "data flow" versus "properties"...but I'm not sure exactly what is your question, and other computer science experts may shoot my comment down.
Mario Malic
le 17 Nov 2020
That's a familiar name, hello again. Since I don't have programming background, i have not looked at it without some understanding of OOP. I took these so-called "helper-functions" as functions, and now I have a tiny mess of an application.
If you can program your data flow within a function or script externally, you can call it within App Designer.
However, it's best if you start typing.
J. Alex Lee
le 18 Nov 2020
it's difficult for me to understand, once you decided "only calculate data that need to be recalculated", what is preventing you from actually executingt? i'm not sure what you mean by the question "how to do that"? perhaps an example problem and why you believe it is challenging, or better yet an actual solution where you still have redundant calculations?
and also, does your question relate only to app designer, or does the problem persist in any kind of data processing workflow?
fburton
le 18 Nov 2020
Sourabh Kondapaka
le 19 Nov 2020
I think what you are looking for is a multi-windows app whilst passing data between each window.
These links could be helpful :
Mario Malic
le 20 Nov 2020
I'd separate the calculation part out of plotting, for a complex app. I guess creating classes or having properties for each of the calculation stages would be the way to go. Then, the plotting part is where you'd have multiple options to choose what you want to plot. Within those options you can program what data you need, from which properties/classes and do the plotting.
J. Alex Lee
le 20 Nov 2020
i completely agree about separating calculation from plotting!
Réponses (1)
J. Alex Lee
le 20 Nov 2020
0 votes
Yes, much clearer explanation of your question.
All due respect to Sourabh, I do not think you are looking for multi-window app with data passing.
First let's assume that you have the modular functions required on your back end squared away and available to do all the atomic steps of your workflow. [If you don't have that, focus on that first, do not even think about app-izing it].
If you can break your steps that cleanly, then conceptually why not have a "execute" button for each step? On file load, you can have the program go through all the steps, but then say if you want to change a parameter in step C, change it and press the "execute step C" button. Then you can have a "plot results" button, or executing step C can trigger execution of the plot. You can make the user experience a bit more seemless by associating each of your parameters with a step (A,B,C), and automatically executing the relevant step on ValueChanged. This would be easiest if your workflow is truly serial, so that changes in A trigger B, trigger C. If you have a more complicated workflow, like you may be able to change A, but actually wouldn't need to re-run B and can skip to D, but that DOES require triggering F, etc., then I guess you need to think about any kidn of automatic triggers more, or stick with manual step execution buttons or something like that.
To your specific question about the app "knowing" what step has changed, that just sounds like a logical variable to switch on or off depending on if a step has been executed or needs to be executed based on detecting a ValueChanged on something.
1 commentaire
J. Alex Lee
le 20 Nov 2020
Modifié(e) : J. Alex Lee
le 20 Nov 2020
it may help to use "events and listeners" in addition to callbacks
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!