4. Description of generic graphics tools#

The graphical routines are organized as follows:

  • hat routines and generic routines: in the outils_ihm.py file,

  • graphical interfaces specific to each calculation tab: in a specific Python file: for example, the ce_ihm_expansion.py file contains the graphics class linked to the data expansion tab, while the ce_calcul_expansion.py file contains the associated calculations (and can be tested in non-interactive mode without using Python’s Tk modules).

Here we detail how the main classes TabbedWindow and MessageBoxInteractive work. For other classes, refer to their header description. These small classes allow you to display specific menus: selection of a group of nodes in a mesh, choice of parameters for an Aster operation, parameters for a change of coordinate system.

4.1. TabbedWindow class#

When macro-command CALC_ESSAI is called in interactive mode, the create_interactive_window routine starts:

  • a blank TabbedWindow window (in outils.py) in which the specific content of each work tab is displayed. ,

  • an Interactive MessageBox message window, in which the interactive messages displayed during calculation will be displayed.

Notes:

  1. The inside of the blank TabbedWindow window is a Canvas (the advantage of Canvas over a classic Frame is the possibility of adding a vertical scroll bar if this one is large),

  2. the set_current_tab routine is used to display the corresponding interface each time the tab is changed; the setup method associated with the graphical class of the tab is called to refresh the environment (Aster concepts created); the method setupmust therefore exist in the graphics classes of all tabs,

  3. the initial size of the main and message windows are determined respectively in the __init__ routines for defining said windows.

4.2. Interactive MessageBox class#

An empty window in which informational messages are printed during calculations. As mentioned in the previous section, the window is created when macro CALC_ESSAI is called (mess instance), and is carried as an argument to all graphics classes. Example:

iface = interfaceCorrelation (main, objects, objects, macro, mess, param_visu)

The arguments are as follows:

  • main: the main window for IHM, which contains the TabbedWindow,

  • objects: CalcessAIObjects instance that contains existing Aster concepts,

  • macro: macro-command, outdated

  • mess: message window instance

  • param_visu: instance of the IHM InterfaceParameters class, which allows you to choose the parameters for visualizing deformations and curves (Xmgrace + GMSH or Salome).

4.2.1. View error messages from exceptions#

When an Aster command is started in the macro through an interactive command, and the calculation finishes in error (recovered as an exception by Aster), the error message is displayed in the interactive message window. We recover this error using the following command:

Try:

MACRO_EXPANS (MODELE_CALCUL = mcfact_calculation,

MODELE_MESURE = mcfact_measure,

NUME_DDL = number,

RESU_ET = Res_et,

RESU_RD = Res_RD,

RESOLUTION = parameters,

**args)

except aster.error, error:

message = « ERREUR ASTER: » + mess.getText (“I”, err.id_message,

err.valk, err.vali, err.valr)

self.mess.disp_mess (message)

UTMESS (“A”, “CALCESSAI0_7”)

Return

Note: during the last renderings made, we noticed that this error tracking was no longer functional. The interactive window display has been removed, and replaced by a simple « Error in the Aster calculation ».

4.3. ScrollList class#

Generic frame for displaying a table with a scroll bar. The values attribute is a list filled in by set_values corresponding to what is displayed in the table. get_selection returns a list containing the indices selected with the mouse and the corresponding values value:

[[1,”N1_DX”], [3, “N4_DY”]]

4.3.1. ModeList and ModeFreqList classes#

A sub-class of ScrollList, it has two buttons below that allow you to select or de-select all the rows in the list at once. It is used to display order numbers and an associated value (natural frequency type or NOEU_CMP). get_selection only returns the list of selected order numbers.

The ModeFreqList class, a subclass of ModeList, is to be used preferentially because it allows the values of natural frequencies or NOEU_CMP to be correctly formatted.

4.3.2. StudyList class#

A sub-class of ScrollList, it allows you to display the list of open Salomé studies. It has a validation method that stores the current Salomé study for displaying deformations, MAC and curves.

4.4. VisuSpectrum class#

This class creates a frame composed of one or more tables to display the coordinates of the interspectrum to be visualized. This class is used for the effort identification tab and for signal processing.

So choice! = None, we add a button above allowing you to choose between several options to view.

Note: common methods for extracting inter-spectrum functions and displaying them to the chosen visualization software should be added to this class. Currently, these features are written in duplicate in the IHM classes of the corresponding tabs.

4.5. ParamMode ICouple, ParamMode LMME, and ParamProjMesuModal classes#

These classes allow you to display frames in the main window or in TopLevel to control the calculation parameters for the use of CALC_MODES or PROJ_MESU_MODAL.

4.6. Observation Window class#

This class generates a Frame to apply the macro command OBSERVATION to a result concept such as mode_meca. It is used in the effort identification tab and in the results visualization window.

This Frame is composed of two green and blue color frames, in which the groups of nodes contained in the chosen experimental model are displayed, and the DDL available in each group. A button allowing you to choose the associated coordinate change is used.

4.6.1. DispoBS class#

This class opens an external TopLevel window when you click on the « Observations » button in the « Settings and Visualization » tab.

Note that in the set_resu method, we check whether the result concept chosen beforehand was created by the macro command OBSERVATION. If this is the case, then we pre-select the selected DDL and the coordinate system change parameters (see the set_selected method in the GroupNoWidget class below).

4.6.2. SelectionNodes, SelectionMeshes, and _selectionBase classes#

The SelectionNodes and SelectionMeshes classes show rows for node groups and meshes, and are subclasses of _SelectionBase. This class makes it possible to make the link between the DDL selected by the user and the construction of the keyword in the OBSERVATION macro. They are based on the class below.

4.6.3. GroupNoWidget class#

This class displays lists of node and mesh groups, with associated DDL (set_data method).

get_selected is a method that returns the options chosen by the user in dictionary form.

set_selected is used when the mode_meca concept to be visualized has already been created by OBSERVATION. In this case, we will search the context for the keywords that were used when creating the concept, and we modify the boxes in the interface accordingly. This should make it possible to modify the existing concept without having to reproduce all the operations.

Note: the set_selected method is not optimal and should be changed:

  • we added the « return Nothing » command at the end of the routine, which generates an error; however, we noticed that if we really don’t return anything (« return » command alone), then when we open the window, the check boxes are not checked,

  • if you want to modify a concept already created by OBSERVATION, you should start from the initial result, and not from the concept already projected, because starting from the latter, you can only remove more points, but you cannot modify them.