Architecture considerations¶
Dependencies¶
Several dependencies are needed in order to build the GUI:
CMake >=3.15
OpenTURNS >=1.25
otfmi >=0.14 (optional, for FMI support)
otmorris >=0.18 (optional, for Morris support)
Qt >=5.15
Qwt >=6
Python >=3.6
SWIG >=4
Boost.program_options (optional, for win32 launcher)
Boost.stacktrace (/backtrace) library (optional, to dump the call stack)
SalomeYACS (optional, for YACS support)
Sphinx >=1.8 (optional, for doc)
Numpydoc >=0.9 (optional, for doc)
ParaView >=5.11 (optional, for visualization)
Compilation¶
git clone https://git.phimeca.com/ot-edf/otgui.git persalys
cd persalys
mkdir -p build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-DOpenTURNS_DIR=$PWD/../../openturns/build/install/lib/cmake/openturns \
-DParaView_DIR=$PWD/../../paraview/build/install/lib/cmake/paraview \
-DOTMORRIS_DIR=$PWD/../../otmorris/build/install/lib/cmake/otmorris \
..
make install
To run it:
persalys.sh
Translation¶
lupdate -verbose lib/ -ts translations/persalys_fr.ts -no-obsolete
linguist translations/persalys_fr.ts
Python console menu translation:
lupdate -verbose lib/src/view/PyConsole/ -ts lib/src/view/PyConsole/resources/PyConsole_msg_fr.ts -no-obsolete
linguist lib/src/view/PyConsole/resources/PyConsole_msg_fr.ts
publish PyConsole_msg_fr.qm
in translations/
Source code structure¶

The GUI classes are organized by 3 layers: I0, I1, V0. This layered organization is reflected in the sources with three different folders and their associated sub-libraries.
Here is the global class diagram for each layer:

Details on implementing a new type of object¶
Pull request
!523
shows the implementation of a new type of object intended to be used in a study, along with its associated analysis and resultsStart by implementing
Object
andObjectImplementation
classesA new type of object
Object
must belong to either one of the existing or a newCollection
asStudyImplementation
attributes, along with the appropriateStudyImplementation
methods (getObjects
,getObjectByName
,hasObjectNamed
,getAvailableObjectName
,add
,remove
)Implement in
src/model
ObjectItem
: base classObjectDefinitionItem
: for handlingObject
and study tree interactionsObjectDiagramItem
: for handlingObject
and diagram window interactions
Create an action in
src/model/ItemFactory
intended to add theObject
to the studyThis action is connected to a new button in
src/view/StudyWindow
Observer
class must implement a dedicatedappendItem(const Object&)
method, this allows to call a newObjectWindow
Implement in
src/view
ObjectDiagramWindow
: dedicatedObject
diagram windowObjectWindow
: dedicatedObject
window forObject
definition
Add a case in
WindowFactory::GetWindow
, based on thesrc/model/ObjectItem
to allow the instantiation of the twoObjectWindow
andObjectDiagramWindow
Implementing a new type of analysis¶
Create necessary base classes (
{Type}Analysis
and{Type}AnalysisResult
)Add .i and _doc.i files for SWIG in
python/src
Create a python test in
python/test
Create the Window classes in
src/view
Edit
src/view/WindowFactory.cxx
,src/view/{ModelType}DiagramWindow.cxx
Edit
ItemFactory::createAction
insrc/model/ItemFactory.cxx
Create action in
src/model/{ModelType}DiagramItem.cxx
Add user documentation