wolfhece 2.1.56__py3-none-any.whl → 2.1.58__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
wolfhece/PyDraw.py CHANGED
@@ -586,6 +586,7 @@ class WolfMapViewer(wx.Frame):
586
586
  self.helpmenu = wx.Menu()
587
587
  self.helpmenu.Append(wx.ID_ANY, _('Shortcuts'), _('Shortcuts'))
588
588
  self.helpmenu.Append(wx.ID_ANY, _('About'), _('About'))
589
+ self.helpmenu.Append(wx.ID_ANY, _('Check for updates'), _('Update?'))
589
590
 
590
591
  self.menubar.Append(self.helpmenu, _('&Help'))
591
592
 
@@ -652,9 +653,11 @@ class WolfMapViewer(wx.Frame):
652
653
  # self.treelist.SetPosition((0,0))
653
654
 
654
655
  # fenêtre ToolTip
655
- self.mytooltip = Wolf_Param(self, "Values", to_read=False, withbuttons=False)
656
+ self.mytooltip = Wolf_Param(self, _("Data/Results"), to_read=False, withbuttons=False, toolbar=False)
656
657
  self.mytooltip.SetSize(300, 400)
658
+ self.mytooltip.prop.SetDescBoxHeight(20) # Hauteur de la zone de description
657
659
  self.mytooltip.Show(False)
660
+ self._oldpos_tooltip = None
658
661
 
659
662
  #Notebooks
660
663
  self.notebookcs = None
@@ -4410,6 +4413,11 @@ class WolfMapViewer(wx.Frame):
4410
4413
  #print About Frame
4411
4414
  self.print_About()
4412
4415
 
4416
+ elif itemlabel == _('Check for updates'):
4417
+ # check for new version
4418
+
4419
+ self.check_for_updates()
4420
+
4413
4421
  elif itemlabel == _("Integrate Q along active vector..."):
4414
4422
  """ Integrate Q along active vector """
4415
4423
 
@@ -7808,24 +7816,25 @@ class WolfMapViewer(wx.Frame):
7808
7816
 
7809
7817
  self.mytooltip.myparams.clear()
7810
7818
 
7819
+
7811
7820
  curgroup = 'Position'
7812
7821
  self.mytooltip.myparams[curgroup] = {}
7813
7822
 
7814
- curpar = 'Pixel'
7823
+ curpar = _('Pixel (col,row)')
7815
7824
  self.mytooltip.add_param(groupname = curgroup,
7816
7825
  name = curpar,
7817
7826
  value = '(' + str(pos[0]) + ' ; ' + str(pos[1]) + ')',
7818
7827
  type = Type_Param.String,
7819
7828
  comment = '')
7820
7829
 
7821
- curpar = 'Coordinate X'
7830
+ curpar = _('Coordinate X [m]')
7822
7831
  self.mytooltip.add_param(groupname = curgroup,
7823
7832
  name = curpar,
7824
7833
  value = '{:3f}'.format(x),
7825
7834
  type = Type_Param.String,
7826
7835
  comment = '')
7827
7836
 
7828
- curpar = 'Coordinate Y'
7837
+ curpar = _('Coordinate Y [m]')
7829
7838
  self.mytooltip.add_param(groupname = curgroup,
7830
7839
  name = curpar,
7831
7840
  value = '{:3f}'.format(y),
@@ -8130,14 +8139,48 @@ class WolfMapViewer(wx.Frame):
8130
8139
  self._update_mytooltip()
8131
8140
 
8132
8141
  if e.ControlDown():
8133
- self.mytooltip.SetWindowStyle(wx.STAY_ON_TOP)
8142
+ if self._oldpos_tooltip is None:
8143
+ # Store the position of the tooltip
8144
+ # Useful to restore it after CTRL is released
8145
+ self._oldpos_tooltip = self.mytooltip.GetPosition()
8146
+
8147
+ self.mytooltip.SetWindowStyle(wx.STAY_ON_TOP) # Just on top, without Title bar
8134
8148
  ttsize = self.mytooltip.GetSize()
8135
8149
  self.mytooltip.position(pos + posframe + (ttsize[0] / 2. + 15, 15))
8136
8150
  else:
8137
- self.mytooltip.SetWindowStyle(wx.DEFAULT_FRAME_STYLE)
8151
+
8138
8152
  width, height = self.GetSize()
8139
- posframe[0] += width
8140
- self.mytooltip.position(posframe)
8153
+
8154
+ if self.IsMaximized():
8155
+ # Frame is maximized -> tooltip must be on the Screen
8156
+ self.mytooltip.SetWindowStyle(wx.STAY_ON_TOP)
8157
+ else:
8158
+
8159
+ if self._oldpos_tooltip is None:
8160
+ # No old position stored -> tooltip does not move
8161
+ pos_tooltip = self.mytooltip.GetPosition()
8162
+ else:
8163
+ # Restore the position of the tooltip
8164
+ pos_tooltip = self._oldpos_tooltip
8165
+
8166
+ # Reset the old position, so when CTRL is pressed again, the memory will be updated
8167
+ self._oldpos_tooltip = None
8168
+
8169
+ if shiftdown or (pos_tooltip[0] == 0 and pos_tooltip[1] == 0):
8170
+ # SHIFT is pressed or tooltip is at the top right corner of the Frame
8171
+ # or it is the first time the tooltip is displayed
8172
+ posframe[0] += width
8173
+ posframe[1] -= 50
8174
+ self.mytooltip.position(posframe)
8175
+ w, h = self.mytooltip.GetSize()
8176
+ self.mytooltip.SetSize((w, height))
8177
+
8178
+ else:
8179
+ # Force the position
8180
+ self.mytooltip.SetPosition(pos_tooltip)
8181
+
8182
+ self.mytooltip.SetIcon(self.GetIcon()) # update icon
8183
+ self.mytooltip.SetWindowStyle(wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP) # on top, with Title bar
8141
8184
 
8142
8185
  self.mytooltip.Show(True)
8143
8186
 
@@ -8351,6 +8394,26 @@ class WolfMapViewer(wx.Frame):
8351
8394
  dlg.ShowModal()
8352
8395
  dlg.Destroy()
8353
8396
 
8397
+ def check_for_updates(self):
8398
+ """ Check for updates """
8399
+ from .apps.version import WolfVersion
8400
+ import pkg_resources
8401
+
8402
+ current_version = str(WolfVersion())
8403
+ package_name = "wolfhece"
8404
+
8405
+ try:
8406
+ available_version = pkg_resources.get_distribution(package_name).version
8407
+ if available_version > current_version:
8408
+ with wx.MessageDialog(None, _("A new version is available: {}").format(available_version), _("Update"), wx.OK | wx.ICON_INFORMATION) as dlg:
8409
+ dlg.ShowModal()
8410
+ else:
8411
+ with wx.MessageDialog(None, _("You have the latest version."), _("Update"), wx.OK | wx.ICON_INFORMATION) as dlg:
8412
+ dlg.ShowModal()
8413
+
8414
+ except pkg_resources.DistributionNotFound:
8415
+ print("Package not found on PyPI.")
8416
+
8354
8417
  def print_shortcuts(self, inframe:bool = None):
8355
8418
  """ Print the list of shortcuts into logging """
8356
8419
 
@@ -8418,10 +8481,19 @@ class WolfMapViewer(wx.Frame):
8418
8481
  'CTRL+Shift+F4': _('Particle system : choose the step based on time'),
8419
8482
  'SPACE': _('Particle system : pause/resume animation'),
8420
8483
 
8484
+ 'Left Click and move': _('Drawing : translate the view'),
8485
+ 'Mouse wheel click and move': _('Drawing : translate the view'),
8486
+ 'Mouse wheel': _('Drawing : zoom in/out - centered on the middle of the canvas'),
8487
+ 'Mouse wheel + Space Bar': _('Drawing : zoom in/out - centered on the mouse position'),
8488
+ 'z, Z': _('Drawing : zoom out/in - centered on the middle of the canvas'),
8489
+ 'Touchpad 2 fingers': _('Drawing : zoom in/out - centered on the middle of the canvas'),
8490
+ 'CTRL + z': _('Drawing : Autoscale only on active array'),
8491
+ 'CTRL + Z': _('Drawing : Autoscale only on active vector'),
8492
+
8493
+ 'Arrow keys': _('Drawing : lateral movements'),
8494
+
8421
8495
  'F5': _('Drawing : autoscale'),
8422
8496
  'F7': _('Drawing : refresh'),
8423
- 'Z': _('Drawing : zoom in'),
8424
- 'z': _('Drawing : zoom out'),
8425
8497
  'Arrows': _('Drawing : lateral movements'),
8426
8498
  'c or C': _('Drawing : copy canvas to Clipboard wo axes'),
8427
8499
  'CTRL+C': _('Drawing : copy canvas to Clipboard as Matplotlib image'),
@@ -8437,9 +8509,12 @@ class WolfMapViewer(wx.Frame):
8437
8509
  'n or N': _('Arrays : node-by-node selection'),
8438
8510
  'b or B': _('Arrays : temporary vector selection'),
8439
8511
  'v or V': _('Arrays : activated vector selection - inner zone'),
8512
+
8440
8513
  'r': _('Arrays : reset the selection'),
8441
- 'R': _('Arrays : reset all selections'),
8442
- '1,2...9': _('Arrays : transfer the selection to the dictionary'),
8514
+ 'R': _('Arrays : reset the selection and the associated dictionnary'),
8515
+
8516
+ '1,2...9': _('Arrays : transfer the selection to the associated dictionary - key 1 to 9'),
8517
+
8443
8518
  'i': _('Arrays : 2D interpolation based on the selection on the current matrix'),
8444
8519
  'CTRL+C': _('Arrays : Set copy source and current selection to clipboard as string'),
8445
8520
  'CTRL+X': _('Arrays : Crop the active array using the active vector and make a copy'),
@@ -8468,7 +8543,7 @@ class WolfMapViewer(wx.Frame):
8468
8543
  txt += curgroup + '\n'
8469
8544
  for curkey, curval in shortcuts.items():
8470
8545
  if curgroup in curval:
8471
- txt += '\t' + curkey + ' : ' + curval + '\n'
8546
+ txt += '\t' + curkey + ' : ' + curval.split(':')[1] + '\n'
8472
8547
  txt += '\n'
8473
8548
  return txt
8474
8549
 
@@ -8487,7 +8562,7 @@ class WolfMapViewer(wx.Frame):
8487
8562
  sizer.Add(multiline, 1, wx.EXPAND)
8488
8563
 
8489
8564
  frame.SetSizer(sizer)
8490
-
8565
+ frame.SetIcon(self.GetIcon())
8491
8566
  frame.SetAutoLayout(True)
8492
8567
  frame.Layout()
8493
8568
 
@@ -8804,6 +8879,19 @@ class WolfMapViewer(wx.Frame):
8804
8879
 
8805
8880
  logging.info(_('Selection/Values pasted'))
8806
8881
 
8882
+ elif key == ord('Z'):
8883
+
8884
+ if ctrldown:
8885
+ if shiftdown:
8886
+ if self.active_vector is not None:
8887
+ self.zoom_on_vector(self.active_vector, canvas_height= self.canvas.GetSize()[1])
8888
+ else:
8889
+ logging.warning(_('No active vector to zoom on !'))
8890
+ else:
8891
+ if self.active_array is not None:
8892
+ self.zoom_on_array(self.active_array, canvas_height= self.canvas.GetSize()[1])
8893
+ else:
8894
+ logging.warning(_('No active array to zoom on !'))
8807
8895
  else:
8808
8896
  if key == wx.WXK_DELETE:
8809
8897
  self.removeobj()
wolfhece/PyParams.py CHANGED
@@ -282,7 +282,8 @@ class Wolf_Param(wx.Frame):
282
282
  DestroyAtClosing:bool = True,
283
283
  toShow:bool = True,
284
284
  init_GUI:bool = True,
285
- force_even_if_same_default:bool = False):
285
+ force_even_if_same_default:bool = False,
286
+ toolbar:bool = True):
286
287
  """
287
288
  Initialisation
288
289
 
@@ -325,7 +326,13 @@ class Wolf_Param(wx.Frame):
325
326
  self.sizer = None
326
327
 
327
328
  if self.wx_exists and init_GUI:
328
- self._set_gui(parent,title,w,h,ontop,to_read,withbuttons,DestroyAtClosing,toShow)
329
+ self._set_gui(parent,
330
+ title, w, h,
331
+ ontop, to_read,
332
+ withbuttons,
333
+ DestroyAtClosing,
334
+ toShow,
335
+ toolbar=toolbar)
329
336
 
330
337
  @property
331
338
  def has_prop(self) -> bool:
@@ -512,7 +519,8 @@ class Wolf_Param(wx.Frame):
512
519
  withbuttons:bool = True,
513
520
  DestroyAtClosing:bool = True,
514
521
  toShow:bool = True,
515
- full_style = False):
522
+ full_style = False,
523
+ toolbar:bool = True):
516
524
  """
517
525
  Set the GUI if wxPython is running
518
526
 
@@ -573,7 +581,7 @@ class Wolf_Param(wx.Frame):
573
581
  self.prop = pg.PropertyGridManager(self,
574
582
  style = pg.PG_BOLD_MODIFIED|pg.PG_SPLITTER_AUTO_CENTER|
575
583
  # Include toolbar.
576
- pg.PG_TOOLBAR |
584
+ pg.PG_TOOLBAR if toolbar else 0 |
577
585
  # Include description box.
578
586
  pg.PG_DESCRIPTION |
579
587
  pg.PG_TOOLTIPS |
@@ -591,7 +599,7 @@ class Wolf_Param(wx.Frame):
591
599
  self.prop = pg.PropertyGridManager(self,
592
600
  style = pg.PG_BOLD_MODIFIED|pg.PG_SPLITTER_AUTO_CENTER|
593
601
  # Include toolbar.
594
- pg.PG_TOOLBAR |
602
+ pg.PG_TOOLBAR if toolbar else 0 |
595
603
  # Include description box.
596
604
  pg.PG_DESCRIPTION |
597
605
  pg.PG_TOOLTIPS |
@@ -624,6 +632,11 @@ class Wolf_Param(wx.Frame):
624
632
  #affichage de la page
625
633
  self.Show(toShow)
626
634
 
635
+ def mask_toolbar(self):
636
+ """ Mask the toolbar """
637
+
638
+ self.prop.SetSt
639
+
627
640
  def _set_only_prop(self, wxparent):
628
641
  """ Set only the property grid """
629
642
 
wolfhece/apps/version.py CHANGED
@@ -5,7 +5,7 @@ class WolfVersion():
5
5
 
6
6
  self.major = 2
7
7
  self.minor = 1
8
- self.patch = 56
8
+ self.patch = 58
9
9
 
10
10
  def __str__(self):
11
11
 
@@ -1238,7 +1238,7 @@ class UI_Manager_2D_GPU():
1238
1238
  """
1239
1239
 
1240
1240
  # frame creation
1241
- self._frame = wx.Frame(None, wx.ID_ANY, _('Scenario WOLF2D_GPU'), size=(800,800))
1241
+ self._frame = wx.Frame(self._parent.get_mapviewer(), wx.ID_ANY, _('Scenario WOLF2D_GPU'), size=(800,800))
1242
1242
 
1243
1243
  # sizers creation -- frame's structure
1244
1244
  sizer_updown = wx.BoxSizer(wx.VERTICAL)
@@ -1378,6 +1378,9 @@ class UI_Manager_2D_GPU():
1378
1378
  # link sizer to frame
1379
1379
  self._frame.SetSizer(sizer_updown)
1380
1380
 
1381
+ if self._parent.get_mapviewer() is not None:
1382
+ self._frame.SetIcon(self._parent.get_mapviewer().GetIcon())
1383
+
1381
1384
  # Layout
1382
1385
  self._frame.Layout()
1383
1386
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wolfhece
3
- Version: 2.1.56
3
+ Version: 2.1.58
4
4
  Author-email: Pierre Archambeau <pierre.archambeau@uliege.be>
5
5
  License: Copyright (c) 2024 University of Liege. All rights reserved.
6
6
  Project-URL: Homepage, https://uee.uliege.be/hece
@@ -7,12 +7,12 @@ wolfhece/ManageParams.py,sha256=EeuUI5Vvh9ixCvYf8YShMC1s1Yacc7OxOCN7q81gqiQ,517
7
7
  wolfhece/Model1D.py,sha256=uL1DJVmDI2xVSE7H6n3icn3QbsPtTHeg8E-6wkDloKw,476914
8
8
  wolfhece/PyConfig.py,sha256=FB8u0belXOXTb03Ln6RdVWvMgjzi3oGPCmw2dWa3lNg,8332
9
9
  wolfhece/PyCrosssections.py,sha256=FnmM9DWY_SAF2EDH9Gu2PojXNtSTRF4-aYQuAAJXBh4,112771
10
- wolfhece/PyDraw.py,sha256=Ib7Rix3QAjR9X0o1E-80_91QsKhWtxmnR2QA89WIPQU,402676
10
+ wolfhece/PyDraw.py,sha256=ZJoYLDrz5_jSMwLfdE0wjWa3eBmdmHOsZbrgxMPcbSU,407046
11
11
  wolfhece/PyGui.py,sha256=oBIBpgBQRR_XXucKE5-RFrtqKj0DRg9VlUCRo8Mzalc,105009
12
12
  wolfhece/PyGuiHydrology.py,sha256=f60E8K9eGTnRq5RDF6yvt-ahf2AYegwQ9t25zZ2Mk1A,14946
13
13
  wolfhece/PyHydrographs.py,sha256=jwtSNMMACwarxrtN1UeQYth99UNrhwPx1IGgUwcooHA,3774
14
14
  wolfhece/PyPalette.py,sha256=3ehK6H2PvqSe0zICR1HyNs6KQokR1DmnAh4LwYnLIcU,28009
15
- wolfhece/PyParams.py,sha256=wwgmP-_7wiiPLTcyX8a5jR6FyC1D2c4oBPc1VWQqtSA,97383
15
+ wolfhece/PyParams.py,sha256=Zxf3baM4TFNapcDqgrtM4IZ4vwCGVd3penwgwWUtG40,97775
16
16
  wolfhece/PyPictures.py,sha256=m1kY0saW6Y9Q0bDCo47lW6XxDkBrbQG-Fd8uVn8G5ic,2514
17
17
  wolfhece/PyTranslate.py,sha256=4appkmNeHHZLFmUtaA_k5_5QL-5ymxnbVN4R2OblmtE,622
18
18
  wolfhece/PyVertex.py,sha256=MtZVjIWIi62QX_oqNosb56xPgjhOGVeGz-XsD82tsNg,40614
@@ -72,7 +72,7 @@ wolfhece/apps/check_install.py,sha256=SG024u18G7VRLKynbp7DKD1jImtHwuWwN4bJWHm-YH
72
72
  wolfhece/apps/curvedigitizer.py,sha256=Yps4bcayzbsz0AoVc_dkSk35dEhhn_esIBy1Ziefgmk,5334
73
73
  wolfhece/apps/isocurrent.py,sha256=dagmGR8ja9QQ1gwz_8fU-N052hIw-W0mWGVkzLu6C7I,4247
74
74
  wolfhece/apps/splashscreen.py,sha256=SrustmIQeXnsiD-92OzjdGhBi-S7c_j-cSvuX4T6rtg,2929
75
- wolfhece/apps/version.py,sha256=jKmjHt6it_fDnxBWS6UidqNaqpxUEweKKiTeeY5HE80,388
75
+ wolfhece/apps/version.py,sha256=0lp2iLnoPUFxdKcw_jzmegskBPc16FjVo0YHgsdgPpQ,388
76
76
  wolfhece/apps/wolf.py,sha256=j_CgvsL8rwixbVvVD5Z0s7m7cHZ86gmFLojKGuetMls,729
77
77
  wolfhece/apps/wolf2D.py,sha256=4z_OPQ3IgaLtjexjMKX9ppvqEYyjFLt1hcfFABy3-jU,703
78
78
  wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
@@ -260,7 +260,7 @@ wolfhece/report/reporting.py,sha256=JUEXovx_S4jpYkJEBU0AC-1Qw2OkkWyV3VAp6iOfSHc,
260
260
  wolfhece/report/wolf_report.png,sha256=NoSV58LSwb-oxCcZScRiJno-kxDwRdm_bK-fiMsKJdA,592485
261
261
  wolfhece/scenario/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
262
262
  wolfhece/scenario/check_scenario.py,sha256=w7_SST4n_uec-MUBK36gbJzz2KC8qT_bVJ_VNyp7cMo,4917
263
- wolfhece/scenario/config_manager.py,sha256=UzInaAtxmTLqUaXAHg17iLcUZRGTrPPLsj2D9kBs6wI,85468
263
+ wolfhece/scenario/config_manager.py,sha256=aZLfOdKCGva2lXVDAVQrn4nd9ONXHQ_ZNDcUcEIbkCo,85621
264
264
  wolfhece/scenario/imposebc_void.py,sha256=PqA_99hKcaqK5zsK6IRIc5Exgg3WVpgWU8xpwNL49zQ,5571
265
265
  wolfhece/scenario/update_void.py,sha256=ay8C_FxfXN627Hx46waaAO6F3ovYmOCTxseUumKAY7c,7474
266
266
  wolfhece/shaders/fragment_shader_texture.glsl,sha256=w6h8d5mJqFaGbao0LGmjRcFFdcEQ3ICIl9JpuT71K5k,177
@@ -283,8 +283,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=8PlMYrb_8jI8h9F0_EagpM
283
283
  wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=ORy7fz4dcp691qKzaOZHrRLZ0uXNhL-LIHxmpDGL6BI,5007
284
284
  wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
285
285
  wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
286
- wolfhece-2.1.56.dist-info/METADATA,sha256=22ItLzx1EFDuQSjhn9gTL3WdS68Hq1rRch6O93ZtOAg,2541
287
- wolfhece-2.1.56.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
288
- wolfhece-2.1.56.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
- wolfhece-2.1.56.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
- wolfhece-2.1.56.dist-info/RECORD,,
286
+ wolfhece-2.1.58.dist-info/METADATA,sha256=otlu_91hkUtPzxtyi71YB3WkoTgL4Lf-YaMPAGm9LBM,2541
287
+ wolfhece-2.1.58.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
288
+ wolfhece-2.1.58.dist-info/entry_points.txt,sha256=Q5JuIWV4odeIJI3qc6fV9MwRoz0ezqPVlFC1Ppm_vdQ,395
289
+ wolfhece-2.1.58.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
290
+ wolfhece-2.1.58.dist-info/RECORD,,