:py:mod:`wolfhece.PyGui` ======================== .. py:module:: wolfhece.PyGui .. autoapi-nested-parse:: Author: HECE - University of Liege, Pierre Archambeau Date: 2024 Copyright (c) 2024 University of Liege. All rights reserved. This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited. Module Contents --------------- .. py:data:: GEOM_GROUP_NAME .. py:data:: MAGN_GROUP_NAME .. py:class:: GenMapManager(*args, **kw) Bases: :py:obj:`wx.Frame` .. autoapi-inheritance-diagram:: wolfhece.PyGui.GenMapManager :parts: 1 :private-bases: Default class for a Wolf Map Manager. Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel. It is not suitable for direct use. .. py:method:: setup_mapviewer(title: str, wolfparent) Setup of a WolfMapViewer .. py:method:: get_mapviewer() -> wolfhece.PyDraw.WolfMapViewer Retourne une instance WolfMapViewer .. py:method:: get_configuration() -> wolfhece.PyConfig.WolfConfiguration Retourne la configuration de Wolf .. py:class:: MapManager(*args, **kw) Bases: :py:obj:`GenMapManager` .. autoapi-inheritance-diagram:: wolfhece.PyGui.MapManager :parts: 1 :private-bases: Default class for a Wolf Map Manager. Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel. It is not suitable for direct use. .. py:class:: HydrologyModel(dir: str = '', splash=True, *args, **kw) Bases: :py:obj:`GenMapManager` .. autoapi-inheritance-diagram:: wolfhece.PyGui.HydrologyModel :parts: 1 :private-bases: Default class for a Wolf Map Manager. Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel. It is not suitable for direct use. .. py:attribute:: mydir :type: str .. py:attribute:: mydircharact :type: str .. py:attribute:: mydirwhole :type: str .. py:attribute:: files_hydrology_array :type: dict .. py:attribute:: files_hydrology_vectors :type: dict .. py:attribute:: mainparams :type: wolfhece.PyParams.Wolf_Param .. py:attribute:: basinparams :type: wolfhece.PyParams.Wolf_Param .. py:attribute:: SPWstations :type: wolfhece.RatingCurve.SPWMIGaugingStations .. py:attribute:: DCENNstations :type: wolfhece.RatingCurve.SPWDCENNGaugingStations .. py:attribute:: mycatchment :type: wolfhece.hydrology.Catchment.Catchment .. py:attribute:: myexchanges :type: wolfhece.hydrology.forcedexchanges.forced_exchanges .. py:class:: Wolf2DPartArrays(sim: wolfhece.mesh2d.wolf2dprev.prev_sim2D, mapviewer: wolfhece.PyDraw.WolfMapViewer) .. py:method:: setup_gui() Create the GUI A listbox in the upper part of the window will list the different part arrays. When a part array is selected, the listbox on the left will list the files associated with the selected part array. The listbox on the right will list the blocks associated with the selected file. .. py:method:: on_toviewer(event) Add the selected array to the mapviewer .. py:method:: on_list(event) When a part array is selected .. py:method:: on_list_files(event) When a file is selected .. py:method:: on_list_blocks(event) .. py:method:: on_addfile(event) Add a file to the selected part array .. py:method:: on_delfile(event) Delete the selected file .. py:method:: on_apply(event) .. py:method:: Show() .. py:class:: Wolf2DInfiltration(sim: wolfhece.mesh2d.wolf2dprev.prev_sim2D = None) .. py:property:: number_of_infiltration .. py:method:: setup_gui() .. py:method:: on_apply(event) .. py:method:: _fillgrid() Fill the CpGrid .. py:method:: on_adjust(event) Adjust the number of rows and columns of the CpGrid .. py:method:: on_plus(event) Add a zone or steps .. py:method:: on_minus(event) Remove a zone or steps .. py:method:: on_check(event) .. py:method:: on_reload(event) .. py:method:: on_plot(event) .. py:method:: Show() .. py:class:: Wolf2DModel(*args, dir: str = '', **kw) Bases: :py:obj:`GenMapManager` .. autoapi-inheritance-diagram:: wolfhece.PyGui.Wolf2DModel :parts: 1 :private-bases: Default class for a Wolf Map Manager. Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel. It is not suitable for direct use. .. py:property:: mymnap .. py:property:: xyzones .. py:property:: mysuxsuy .. py:property:: blocfile .. py:property:: writing_mode .. py:property:: writing_frequency .. py:property:: dx_fine .. py:property:: dy_fine .. py:property:: scheme_rk .. py:property:: is_multiblock Deprecated, use the property from the infiltration object .. py:property:: nb_blocks Deprecated, use the property from the infiltration object .. py:attribute:: mydir :type: str .. py:attribute:: sim :type: wolfhece.mesh2d.wolf2dprev.prev_sim2D .. py:attribute:: filenamegen :type: str .. py:attribute:: SPWstations :type: wolfhece.RatingCurve.SPWMIGaugingStations .. py:attribute:: DCENNstations :type: wolfhece.RatingCurve.SPWDCENNGaugingStations .. py:method:: _dx_block(idx) .. py:method:: _dy_block(idx) .. py:method:: _add_arrays_to_mapviewer(force_reload=False) Add arrays to the mapviewer .. py:method:: _add_vectors_to_mapviewer() Add vectors to the mapviewer .. py:method:: mimic_mask(source: wolfhece.wolf_array.WolfArray) Copy the mask of the source array to all arrays in the model. .. py:method:: show_properties() Show the properties of the model .. py:method:: _set_bc(e: wx.EVT_BUTTON) Set the boundary conditions .. py:method:: _set_infiltration(e: wx.EVT_BUTTON) .. py:method:: _set_part_arrays(e: wx.EVT_BUTTON) .. py:method:: add_boundary_condition(i: int, j: int, bc_type: wolfhece.mesh2d.cst_2D_boundary_conditions.BCType_2D, bc_value: float, border: wolfhece.mesh2d.cst_2D_boundary_conditions.Direction) alias .. py:method:: reset_boundary_conditions() Reset the boundary conditions .. py:method:: _check_errors(e: wx.EVT_BUTTON) Check the errors in the model .. py:method:: _write_files(e: wx.EVT_BUTTON) Write the files to disk .. py:method:: _run(e: wx.EVT_BUTTON) Run the simulation .. py:method:: _results(e: wx.EVT_BUTTON) Display the results .. py:method:: _results2ic(e: wx.EVT_BUTTON) Choose one result as initial conditions .. py:method:: _copy2gpu(e: wx.EVT_BUTTON) Click on the button to copy to the GPU .. py:method:: _wizard(e: wx.EVT_BUTTON) Launch the wizard .. py:method:: _mesher(e: wx.EVT_BUTTON) Call the mesher .. py:method:: _create_arrays(e: wx.EVT_BUTTON) Create the fine arrays .. py:method:: _add_blocks(e: wx.EVT_BUTTON) Add blocks to the model .. py:method:: _create_from_vector(e: wx.EVT_BUTTON) Create a simulation from a vector .. py:method:: _create_from_array(e: wx.EVT_BUTTON) Create a simulation from an array .. py:method:: _create_from_footprint(e: wx.EVT_BUTTON) Create a simulation from a footprint .. py:method:: _set_magnetic_grid(e: wx.EVT_BUTTON) Set the magnetic grid .. py:method:: _choose_fine_resolution(e: wx.EVT_BUTTON) Choose the fine resolution .. py:method:: _add_block(e: wx.EVT_BUTTON) Add a block to the model .. py:method:: _remove_block(e: wx.EVT_BUTTON) Remove a block from the model .. py:method:: _update_structure(e: wx.EVT_BUTTON) Update the structure of the model .. py:method:: _all_parameters(e: wx.EVT_CHECKBOX) Show all parameters .. py:method:: _force_update(e: wx.EVT_CHECKBOX) Force the update .. py:method:: _update_layout() Update the layout of the frame .. py:method:: _fill_buttons_genblocks() Fill the buttons for the blocks .. py:method:: _get_togglestates() Get the toggle states of the buttons .. py:method:: _show_glob_properties() Show the general properties .. py:method:: _set_default_background() Set the default background .. py:method:: _set_color_background() Set the color background .. py:method:: OnToggleGen(e: wx.EVT_TOGGLEBUTTON) Toggle the global properties .. py:method:: OnToggleBlock(e: wx.EVT_TOGGLEBUTTON) Toggle the properties of a block .. py:method:: _append_magnetic_grid_to_prop() Append the magnetic grid to the properties .. py:method:: _append_geometry_block_to_prop(idx: int) Append the geometry of the block to the properties .. py:method:: _apply_changes(e: wx.EVT_BUTTON) Apply the changes to the parameters .. py:method:: extend_bed_elevation() Extension du modèle topographique .. py:method:: extend_freesurface_elevation(selection: list) Extension des Conditions Initiales .. py:method:: extend_roughness(selection: list) Extension du frottement .. py:method:: set_type_ic(which: wolfhece.mesh2d.wolf2dprev.Literal[1, 2, 3] = 2, dialog: bool = True) Définition du type de conditions initiales .. py:method:: replace_external_contour(newvec: wolfhece.mesh2d.wolf2dprev.vector, interior: bool) Remplacement du contour externe .. py:method:: transfer_ic(vector) Transfert de conditions initiales .. py:method:: help_files() Aide sur les fichiers Deprecated, use the method from the infiltration object .. py:method:: check_infiltration() Vérification des zones d'infiltration Deprecated, use the method from the infiltration object .. py:method:: copy2gpu(dirout: str = '') Copie des matrices pour le code GPU Deprecated, use the method from the simulation object .. py:method:: write_bloc_file() Mise à jour du fichier de blocs .. py:method:: get_header_MB(abs=False) Renvoi d'un header avec les infos multi-blocs :param abs: If True, the header will be absolute, if False, it will be relative :type abs: bool :return: header_wolf .. py:method:: get_header(abs=False) Renvoi d'un header de matrice "fine" non MB :param abs: If True, the header will be absolute, if False, it will be relative :type abs: bool :return: header_wolf .. py:method:: read_fine_array(which: str = '') Lecture d'une matrice fine :param which: suffixe du fichier :type which: str .. py:method:: read_MB_array(which: str = '') Lecture d'une matrice MB :param which: suffixe du fichier :type which: str .. py:method:: read_fine_nap() -> wolfhece.mesh2d.wolf2dprev.np.ndarray Lecture de la matrice nap sur le maillage fin .. py:class:: Wolf2DGPUModel(*args, dir: str = '', **kw) Bases: :py:obj:`GenMapManager` .. autoapi-inheritance-diagram:: wolfhece.PyGui.Wolf2DGPUModel :parts: 1 :private-bases: Default class for a Wolf Map Manager. Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel. It is not suitable for direct use. .. py:property:: sim Alias .. py:method:: _add_arrays_to_mapviewer(force_reload: bool = False) Add the arrays to the mapviewer .. py:method:: _add_vectors_to_mapviewer() Add the vectors to the mapviewer .. py:method:: show_properties_sim() Show the properties of the model .. py:method:: _callbackwp() Callback for wolfparam .. py:method:: _callbackwp_destroy() Callback for wolfparam .. py:method:: _set_bc(e: wx.EVT_BUTTON) Set the boundary conditions .. py:method:: _set_infiltration(e: wx.EVT_BUTTON) .. py:method:: add_boundary_condition(i: int, j: int, bc_type: wolfhece.mesh2d.cst_2D_boundary_conditions.BCType_2D_GPU, bc_value: float, border: wolfhece.mesh2d.cst_2D_boundary_conditions.Direction) alias .. py:method:: reset_boundary_conditions() Reset the boundary conditions .. py:method:: _check_errors(e: wx.EVT_BUTTON) Check the errors in the model .. py:method:: _enable_disable_buttons(errors: bool = False) Enable or isable buttons .. py:method:: _write_files(e: wx.EVT_BUTTON) Write the files to disk .. py:method:: _run(e: wx.EVT_BUTTON) Run the simulation .. py:method:: _results(e: wx.EVT_BUTTON) Display the results .. py:method:: _results2ic(e: wx.EVT_BUTTON) Choose one result as initial conditions .. py:method:: _wizard(e: wx.EVT_BUTTON) Launch the wizard .. py:method:: _add_arrays2viewer(e: wx.EVT_BUTTON) Create the fine arrays .. py:method:: _apply_mask(e: wx.EVT_BUTTON) Apply the mask .. py:method:: _create_from_vector(e: wx.EVT_BUTTON) Create a simulation from a vector .. py:method:: _create_from_array(e: wx.EVT_BUTTON) Create a simulation from an array .. py:method:: _create_from_footprint(e: wx.EVT_BUTTON) Create a simulation from a footprint .. py:method:: _set_magnetic_grid(e: wx.EVT_BUTTON) Set the magnetic grid .. py:method:: _choose_resolution(e: wx.EVT_BUTTON) Choose the fine resolution .. py:method:: _copy2dir(e: wx.EVT_BUTTON) Copy the simulation to another directory .. py:method:: _apply_changes(e: wx.EVT_BUTTON) Apply the changes .. py:method:: show_properties() Show the properties of the model .. py:method:: onclose(e: wx.EVT_CLOSE) Close the properties frame .. py:method:: _append_magnetic_grid_to_prop() Append the magnetic grid to the properties .. py:method:: update_wp() Update the properties .. py:method:: clear_infos() Clear the information zone .. py:method:: append_infos(text) Append text to the information zone