doc: dev: Some minor change.

mesh
Pierre-Antoine Rouby 2023-09-20 11:52:53 +02:00
parent 48851c7d71
commit 89353b656f
2 changed files with 110 additions and 55 deletions

View File

@ -75,62 +75,41 @@ https://doc.qt.io/qt-5/model-view-programming.html (last access
* TODO Architecture * TODO Architecture
Pamhyr2 architecture is based on Qt Model/View programming[fn:qt-mv] architecture. Pamhyr2's architecture is based on Qt Model/View, see Figure
[[graph-architecture]]. It is made up of several different components: the
model (in blue), the graphical components (in red), the
actions/delegates (in green), the commands (in purple), the solvers
(in yellow) and the save file (in grey).
#+name: graph-pipeline The model is a set of python classes and can be exported to a single
#+header: :results drawer SQLite3 format backup file. The view can be made up of various
#+header: :exports results components, generally a Qt window with other view components, such as:
#+header: :post attr_wrap(width="12cm", data=*this*, name="graph-pipeline", caption="Pamhyr2 solver execution pipeline architecture scheme", float="t") a table, a text box, a button, a plot, and so on. The user can view
#+begin_src dot :file "images/graph-pipeline.png" :cache no the data using the view and interact with certain components. These
digraph { components are linked to an action (such as a Python function) or to a
node[colorscheme=set19,shape=box,style="filled",fillcolor=9]; delegate class. These actions or delegate can create a command (based
on Qt UndoCommand class), this command must implement two functions:
subgraph cluster0 { One to modify the model, one to reverte this modification and reset
label="Pamhyr2" the model to previous state. All model modification must be perform by
config[label="Config",fillcolor=5]; a command to be cancelled. The user can also run a solver and add some
model[label="Model",fillcolor=2]; simulation results to model data.
obj[label="Solver",fillcolor=6];
results[label="Results",fillcolor=2];
view[label="View",fillcolor=1];
results -> model[style="dotted"];
results -> obj[style="dotted"];
}
config -> obj[label=""];
obj -> model;
subgraph cluster1{
label="System";
in[label="Solver input files",shape=note];
out[label="Solver output files",shape=note];
bin[label="Solver binary",shape=note];
}
obj -> in[label="Write"];
bin -> in[label="Read"];
obj -> bin[label="Execute"];
bin -> out[label="Write"];
obj -> results[label="Create"];
results -> out[label="Read"];
view -> model;
view -> results;
}
#+end_src
#+name: graph-architecture #+name: graph-architecture
#+header: :results drawer #+header: :results drawer
#+header: :exports results #+header: :exports results
#+header: :post attr_wrap(width="7cm", data=*this*, name="graph-architecture", caption="Pamhyr2 Model/View architecture scheme (inspired by Qt Model/View architecture [[https://doc.qt.io/qt-5/model-view-programming.html]])", float="t") #+header: :post attr_wrap(width="9cm", data=*this*, name="graph-architecture", caption="Pamhyr2 Model/View architecture scheme (inspired by Qt Model/View architecture [[https://doc.qt.io/qt-5/model-view-programming.html]])", float="t")
#+begin_src dot :file "images/graph-architecture.png" :cache no #+begin_src dot :file "images/graph-architecture.png" :cache no
digraph { digraph {
bgcolor="transparent";
node[colorscheme=set19,shape=box,style="filled",fillcolor=white]; node[colorscheme=set19,shape=box,style="filled",fillcolor=white];
save[label="Pamhyr save",fillcolor="9",shape=note]; save[label="Pamhyr save",fillcolor="9",shape=note];
model[label="Model",fillcolor="2"]; model[label="Model",fillcolor="2"];
view[label="View",fillcolor="1"]; view[label="View",fillcolor="1"];
delegate[label="Delegate",fillcolor="3"]; delegate[label="Delegate",fillcolor="3"];
undocommand[label="UndoCommand",fillcolor="4"]; action[label="Action",fillcolor="3"];
solver[label="Solver",fillcolor="6"];
undocommand[label="Command",fillcolor="4"];
user[label="User",shape=ellipse]; user[label="User",shape=ellipse];
model -> save[label="Save"]; model -> save[label="Save"];
@ -139,19 +118,37 @@ Pamhyr2 architecture is based on Qt Model/View programming[fn:qt-mv] architectur
model -> view[label="Rendering"]; model -> view[label="Rendering"];
view -> delegate[label="Rendering"]; view -> delegate[label="Rendering"];
delegate -> undocommand[label="Create"]; delegate -> undocommand[label="Create"];
undocommand -> model[label="Modify"] action -> undocommand[label="Create"];
action -> solver[label="Run"];
solver -> model[label="Add results"];
undocommand -> model[label="Modify"];
view -> user[label="Vizualize"]; view -> user[label="Vizualize"];
user -> delegate[label="Modify"]; user -> delegate[label="Modify"];
user -> action[label="Activate"];
} }
#+end_src #+end_src
All the model source code are in the directory {{{file(src/Model)}}}
(let see section [[Model]] for more details), the View components,
delegate and command are in {{{file(src/View)}}} (see section [[View]]). Solvers classes are
in {{{file(src/Solver)}}} (see section [[Solver]]).
[fn:qt-mv] The Qt Model/View documentation web page:
https://doc.qt.io/qt-5/model-view-programming.html
** TODO Model
- Model de donnée Python
- Correspond à une sauvegarde SQL
#+name: graph-model #+name: graph-model
#+header: :results drawer #+header: :results drawer
#+header: :exports results #+header: :exports results
#+header: :post attr_wrap(width="16cm", data=*this*, name="graph-model", caption="Pamhyr2 Model architecture scheme", float="t") #+header: :post attr_wrap(width="16cm", data=*this*, name="graph-model", caption="Pamhyr2 model class dependencies", float="t")
#+begin_src dot :file "images/graph-model.png" :cache no #+begin_src dot :file "images/graph-model.png" :cache no
digraph { digraph {
bgcolor="transparent";
node[colorscheme=set19,shape=box,style="filled",fillcolor="2"]; node[colorscheme=set19,shape=box,style="filled",fillcolor="2"];
study[label="Study"]; study[label="Study"];
@ -202,6 +199,14 @@ Pamhyr2 architecture is based on Qt Model/View programming[fn:qt-mv] architectur
geopoint[label="Point"]; geopoint[label="Point"];
} }
subgraph cluster07 {
label="Results"
results[label="Results"]
rriver[label="River"];
rreach[label="Reach"];
rcrosssection[label="Cross-section"];
}
study -> river; study -> river;
river -> rnode; river -> rnode;
river -> redge; river -> redge;
@ -218,20 +223,71 @@ Pamhyr2 architecture is based on Qt Model/View programming[fn:qt-mv] architectur
geocrosssection -> sedimentlayer; geocrosssection -> sedimentlayer;
geopoint -> sedimentlayer; geopoint -> sedimentlayer;
results -> study[style="dashed"];
results -> rriver;
rriver -> river[style="dashed"];
rriver -> rreach;
rreach -> georeach[style="dashed"];
rreach -> rcrosssection;
rcrosssection -> geocrosssection[style="dashed"];
} }
#+end_src #+end_src
[fn:qt-mv] The Qt Model/View documentation web page: *** TODO SQL study file
https://doc.qt.io/qt-5/model-view-programming.html *** TODO List class
*** TODO Dict class
** TODO Model
** TODO View ** TODO View
*** TODO UI file *** TODO UI file
*** TODO Window class *** TODO Translate
** TODO UndoCommand *** TODO Window
** TODO Table *** TODO UndoCommand
** TODO Plot *** TODO Table
*** TODO Plot
*** TODO Mainwindow
** TODO Solver ** TODO Solver
#+name: graph-pipeline
#+header: :results drawer
#+header: :exports results
#+header: :post attr_wrap(width="12cm", data=*this*, name="graph-pipeline", caption="Pamhyr2 solver execution pipeline architecture scheme", float="t")
#+begin_src dot :file "images/graph-pipeline.png" :cache no
digraph {
bgcolor="transparent";
node[colorscheme=set19,shape=box,style="filled",fillcolor=9];
subgraph cluster0 {
label="Pamhyr2"
config[label="Config",fillcolor=5];
model[label="Model",fillcolor=2];
obj[label="Solver",fillcolor=6];
results[label="Results",fillcolor=2];
view[label="View",fillcolor=1];
results -> model[style="dashed"];
results -> obj[style="dashed"];
}
config -> obj[label=""];
obj -> model[style="dashed"];
subgraph cluster1{
label="System";
in[label="Solver input files",shape=note];
out[label="Solver output files",shape=note];
bin[label="Solver binary",shape=note];
}
obj -> in[label="Write (1)"];
obj -> bin[label="Execute (2)"];
bin -> in[label="Read (2.1)"];
bin -> out[label="Write (2.2)"];
obj -> results[label="Create (3)"];
obj -> out[label="Read (3.1)"];
view -> model[style="dashed"];
view -> results[style="dashed"];
}
#+end_src
** TODO Unit tests ** TODO Unit tests
** TODO The debug mode ** TODO The debug mode
* TODO Build the project * TODO Build the project
@ -530,10 +586,9 @@ file and make a merge request.
#+end_src #+end_src
#+NAME: qt-linguist-setup #+NAME: qt-linguist-setup
#+ATTR_HTML: :width 8cm
#+ATTR_LATEX: :width 8cm #+ATTR_LATEX: :width 8cm
#+CAPTION: Qt linguist lang setup example with italian. #+CAPTION: Qt linguist lang setup example with italian.
[[../images/Qt-linguist-setup-lang.png]] [[./images/Qt-linguist-setup-lang.png]]
[fn:qt-linguist] The Qt linguist documentation web page: [fn:qt-linguist] The Qt linguist documentation web page:
https://doc.qt.io/qt-5/qtlinguist-index.html (last access 2023-09-18) https://doc.qt.io/qt-5/qtlinguist-index.html (last access 2023-09-18)

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB