PaIRS-UniNa 0.2.7__cp312-cp312-macosx_11_0_universal2.whl → 0.2.10__cp312-cp312-macosx_11_0_universal2.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.
Files changed (38) hide show
  1. PaIRS_UniNa/Calibration_Tab.py +16 -0
  2. PaIRS_UniNa/Changes.txt +39 -0
  3. PaIRS_UniNa/Explorer.py +311 -75
  4. PaIRS_UniNa/FolderLoop.py +196 -6
  5. PaIRS_UniNa/Input_Tab.py +160 -53
  6. PaIRS_UniNa/Input_Tab_CalVi.py +11 -12
  7. PaIRS_UniNa/Input_Tab_tools.py +17 -15
  8. PaIRS_UniNa/Output_Tab.py +1 -3
  9. PaIRS_UniNa/PaIRS_pypacks.py +63 -65
  10. PaIRS_UniNa/Process_Tab.py +19 -15
  11. PaIRS_UniNa/Process_Tab_Disp.py +8 -1
  12. PaIRS_UniNa/SPIVCalHelp.py +155 -0
  13. PaIRS_UniNa/Saving_tools.py +2 -0
  14. PaIRS_UniNa/TabTools.py +165 -6
  15. PaIRS_UniNa/Vis_Tab.py +50 -22
  16. PaIRS_UniNa/Vis_Tab_CalVi.py +1 -2
  17. PaIRS_UniNa/Whatsnew.py +4 -3
  18. PaIRS_UniNa/_PaIRS_PIV.so +0 -0
  19. PaIRS_UniNa/__init__.py +3 -3
  20. PaIRS_UniNa/addwidgets_ps.py +570 -70
  21. PaIRS_UniNa/gPaIRS.py +118 -17
  22. PaIRS_UniNa/icons/folder_loop_cleanup.png +0 -0
  23. PaIRS_UniNa/icons/folder_loop_cleanup_off.png +0 -0
  24. PaIRS_UniNa/icons/information.png +0 -0
  25. PaIRS_UniNa/icons/information2.png +0 -0
  26. PaIRS_UniNa/icons/scan_path_loop.png +0 -0
  27. PaIRS_UniNa/icons/scan_path_loop_off.png +0 -0
  28. PaIRS_UniNa/icons/spiv_setup_no.png +0 -0
  29. PaIRS_UniNa/icons/spiv_setup_ok.png +0 -0
  30. PaIRS_UniNa/procTools.py +46 -1
  31. PaIRS_UniNa/rqrdpckgs.txt +7 -7
  32. PaIRS_UniNa/ui_Calibration_Tab.py +92 -59
  33. PaIRS_UniNa/ui_gPairs.py +8 -8
  34. PaIRS_UniNa/whatsnew.txt +2 -3
  35. {pairs_unina-0.2.7.dist-info → pairs_unina-0.2.10.dist-info}/METADATA +7 -8
  36. {pairs_unina-0.2.7.dist-info → pairs_unina-0.2.10.dist-info}/RECORD +38 -30
  37. {pairs_unina-0.2.7.dist-info → pairs_unina-0.2.10.dist-info}/WHEEL +0 -0
  38. {pairs_unina-0.2.7.dist-info → pairs_unina-0.2.10.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/TabTools.py CHANGED
@@ -706,16 +706,130 @@ class gPaIRS_Tab(QWidget):
706
706
  lab.setFont(font)
707
707
 
708
708
  def setTABWarnLabel(self):
709
- self.ui.name_tab.setFixedWidth(self.ui.name_tab.sizeHint().width())
710
- self.ui.label_done.setPixmap(self.pixmap_done if self.TABpar.OptionDone==1 else self.pixmap_warnc)
711
- self.ui.label_done.setToolTip(self.TABpar.warningMessage)
712
-
709
+ if hasattr(self.ui,'label_done'):
710
+ self.ui.name_tab.setFixedWidth(self.ui.name_tab.sizeHint().width())
711
+ self.ui.label_done.setPixmap(self.pixmap_done if self.TABpar.OptionDone==1 else self.pixmap_warnc)
712
+ self.ui.label_done.setToolTip(self.TABpar.warningMessage)
713
+
714
+ def syncPrevGlobalFields(self, ref_vals=None, include_bases=False, exceptions=[], FlagSync=True):
715
+ """
716
+ Sync class-level fields (declared in class bodies, e.g. PROpar.mode = mode_init)
717
+ across all TABpar-like instances inside self.TABpar_prev (nested lists / None / TABpar).
718
+
719
+ Parameters
720
+ ----------
721
+ ref : object | None
722
+ Reference TABpar instance whose values will be copied (default: self.TABpar).
723
+ include_bases : bool
724
+ If True, include class-level fields declared in base classes too.
725
+ If False, include ONLY fields declared in the concrete class (e.g., PROpar only).
726
+ """
727
+
728
+ ref = getattr(self, "TABpar", None)
729
+ if ref is None:
730
+ return []
731
+ ref_cls = type(ref)
732
+
733
+ # Decide which class we consider as "TABpar-like"
734
+ # If your tabs store subclasses of a known ParClass, use that; otherwise fallback to TABpar.
735
+ par_base = getattr(self, "ParClass", None)
736
+ if par_base is None:
737
+ par_base = TABpar # assumes TABpar is in scope in TabTools.py
738
+
739
+ # Reference object
740
+ if ref_vals is None:
741
+
742
+ # Collect class-level fields declared in class bodies
743
+ def _class_fields(cls):
744
+ if include_bases:
745
+ classes = [C for C in cls.mro() if C not in (object,)]
746
+ else:
747
+ classes = [cls]
748
+
749
+ out = []
750
+ for C in classes:
751
+ for name, val in C.__dict__.items():
752
+ if name.startswith("__"):
753
+ continue
754
+ # Skip methods / descriptors
755
+ if callable(val) or isinstance(val, (staticmethod, classmethod, property)):
756
+ continue
757
+ out.append(name)
758
+
759
+ # Unique preserving order
760
+ seen = set()
761
+ fields = []
762
+ for n in out:
763
+ if n not in seen:
764
+ seen.add(n)
765
+ fields.append(n)
766
+ return fields
767
+
768
+ fields = _class_fields(ref_cls)
769
+
770
+ # Build reference values (prefer instance override, otherwise class default)
771
+ ref_vals = {}
772
+ #pri.Info.green(f'{self.TABname}:')
773
+ for f in fields:
774
+ try:
775
+ ref_vals[f] = getattr(ref, f)
776
+ #pri.Info.green(f'{f} = {ref_vals[f]}')
777
+ except Exception:
778
+ pass
779
+ #pri.Info.green('\n')
780
+
781
+ if not FlagSync: return ref_vals
782
+
783
+ # Exclude exception fields (if any)
784
+ if exceptions:
785
+ exc = set(exceptions)
786
+ ref_vals = {k: v for k, v in ref_vals.items() if k not in exc}
787
+
788
+ # Walk nested structure and patch instances
789
+ def _walk(node, ParBase=par_base): # <-- bind ParBase safely here
790
+ if node is None:
791
+ return
792
+ if isinstance(node, ParBase):
793
+ for f, v in ref_vals.items():
794
+ try:
795
+ setattr(node, f, v)
796
+ except Exception:
797
+ pass
798
+ return
799
+ if isinstance(node, (list, tuple)):
800
+ for it in node:
801
+ _walk(it, ParBase)
802
+ return
803
+ if isinstance(node, dict):
804
+ for it in node.values():
805
+ _walk(it, ParBase)
806
+ return
807
+
808
+ _walk(getattr(self, "TABpar_prev", None))
809
+
810
+ # Set class-level (global) fields ONCE
811
+ for C in (ref_cls, self.TABpar, self.TABpar_old):
812
+ if C is None:
813
+ continue
814
+ for f, v in ref_vals.items():
815
+ try:
816
+ setattr(C, f, v)
817
+ except Exception:
818
+ pass
819
+ return ref_vals
820
+
713
821
  #*************************************************** Undo/redo
714
822
  def adjustTABparInd(self):
715
823
  TABpar_ind=self.TABpar_at(self.TABpar.ind)
716
824
  if TABpar_ind:
717
825
  TABpar_ind.copyfrom(self.TABpar)
718
826
 
827
+ def adjustFromTABparInd(self,ind=None):
828
+ if ind is None: ind=self.TABpar.ind
829
+ TABpar_ind=self.TABpar_at(ind)
830
+ if TABpar_ind:
831
+ self.TABpar.copyfrom(TABpar_ind)
832
+
719
833
  def gen_TABpar(self,ind,FlagSet=True,FlagEmptyPrev=False,FlagNone=False,FlagInsert=-1,Process=None,Step=None):
720
834
  Prev=prev=self.TABpar_prev if FlagSet else []
721
835
 
@@ -956,6 +1070,7 @@ class gPaIRS_Tab(QWidget):
956
1070
  d=0
957
1071
 
958
1072
  menu=QMenu(b)
1073
+ menu.setStyleSheet(self.gui.ui.menu.styleSheet())
959
1074
  act=[]
960
1075
  nur=len(krange)
961
1076
  flag=nur==Num_Prevs_back_forw
@@ -989,7 +1104,6 @@ class gPaIRS_Tab(QWidget):
989
1104
  if self.TABpar.ind[:-1]==ind[:-1]:
990
1105
  self.TABpar.ind[-1]=0
991
1106
 
992
-
993
1107
  #*************************************************** Special spin boxes (x,y,w,h)
994
1108
  def setMinMaxSpinxywh(self):
995
1109
  self.ui.spin_x.setMinimum(0)
@@ -1062,7 +1176,10 @@ def setupWid(self:gPaIRS_Tab,FlagFontSize=True):
1062
1176
 
1063
1177
  if hasattr(self,'widgets'): widgets=self.widgets
1064
1178
  else: widgets=self.findChildren(QWidget)
1179
+ if isinstance(widgets[0],list):
1180
+ widgets=[w for wi in widgets for w in wi]
1065
1181
  widgets+=self.findChildren(CollapsibleBox)
1182
+ widgets+=self.findChildren(QTextEdit)
1066
1183
  for w in widgets:
1067
1184
  w:QToolButton
1068
1185
  if hasattr(w,'toolTip'):
@@ -1082,9 +1199,51 @@ def setupWid(self:gPaIRS_Tab,FlagFontSize=True):
1082
1199
  if hasattr(w,'setup2'):
1083
1200
  w.setup2()
1084
1201
 
1085
- if isinstance(w,QToolButton) or isinstance(w,QPushButton):
1202
+ if isinstance(w,QToolButton) or isinstance(w,QPushButton) or isinstance(w,QCheckBox) or isinstance(w,QRadioButton) or isinstance(w,QComboBox):
1086
1203
  if w.cursor().shape()==Qt.CursorShape.ArrowCursor:
1087
1204
  w.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
1205
+ if isinstance(w,QToolButton) or isinstance(w,QPushButton):
1206
+ if not w.icon().isNull():
1207
+ size = w.iconSize()
1208
+ new_size = QSize(
1209
+ max(1, size.width() ),
1210
+ max(1, size.height() )
1211
+ )
1212
+ w.setIconSize(new_size)
1213
+ if (isinstance(w,QToolButton) or isinstance(w,QPushButton) or isinstance(w,ClickableLabel) or w.objectName()=='logo') and w.metaObject().className() not in ('DraggableButton','RichTextPushButton') and w.objectName() not in ('binButton','CollapsibleBox_toggle','StartingPage_Button'):
1214
+ if w.objectName() in ('logo','title_icon','workspace_icon'):
1215
+ apply_hover_glow_label(w)
1216
+ w.default_stylesheet=w.styleSheet()
1217
+ else:
1218
+ setButtonHoverStyle(w)
1219
+ if w.metaObject().className() == "RichTextPushButton":
1220
+ w.icnWidget.setAttribute(Qt.WA_Hover, True)
1221
+ w.icnWidget.setMouseTracking(True)
1222
+ setButtonHoverStyle(w,FlagCls=False)
1223
+ setButtonHoverStyle(w.icnWidget,FlagCls=False,FlagBorder=False)
1224
+ if isinstance(w,QCheckBox) or isinstance(w,QRadioButton):
1225
+ style=f"{w.metaObject().className()}{'::hover{ background-color: rgba(0, 116, 255, 0.1); border-radius: 6px;}'}"
1226
+ w.setStyleSheet(style)
1227
+ if isinstance(w,QSlider):
1228
+ w.setMouseTracking(True)
1229
+ cursor_filter = SliderHandleCursorFilter(w)
1230
+ w.installEventFilter(cursor_filter)
1231
+ if w.objectName()=='log' and hasattr(self,'gui'):
1232
+ base="""
1233
+ QTextEdit {
1234
+ background-color: #000000;
1235
+ color: #FFFFFF;
1236
+ border: 1px solid #2a2a2a;
1237
+ border-radius: 6px;
1238
+
1239
+ padding: 2px;
1240
+
1241
+ selection-background-color: rgba(0, 116, 255, 0.8);
1242
+ selection-color: #FFFFFF;
1243
+ }
1244
+ """
1245
+ w.setStyleSheet(base + "\n" + gPaIRS_QMenu_style)
1246
+
1088
1247
 
1089
1248
  for sname in ('range_from','range_to','x','y','w','h'):
1090
1249
  if hasattr(self.ui,"spin_"+sname):
PaIRS_UniNa/Vis_Tab.py CHANGED
@@ -234,8 +234,7 @@ class NamesPIV(TABpar):
234
234
 
235
235
  class VISpar(TABpar):
236
236
  FlagVis=True
237
- FlagAutoLevels=True
238
- FlagAutoSizes=True
237
+
239
238
  class OUT(TABpar):
240
239
  def __init__(self):
241
240
  self.x = 0
@@ -269,7 +268,7 @@ class VISpar(TABpar):
269
268
  def __init__(self,Process=ProcessTypes.null,Step=StepTypes.null):
270
269
  self.setup(Process,Step)
271
270
  super().__init__('VISpar','Vis')
272
- self.unchecked_fields+=['FlagAutomaticLevels','FlagAutomaticSizes','setPage']
271
+ self.unchecked_fields+=['setPage']
273
272
  self.uncopied_fields+=['graphics_fields']
274
273
 
275
274
  def setup(self,Process,Step):
@@ -314,6 +313,8 @@ class VISpar(TABpar):
314
313
  self.variableKey=''
315
314
  self.field_rep=0
316
315
 
316
+ self.FlagAutoLevels=True
317
+ self.FlagAutoSizes=True
317
318
  self.FlagYInvert=[False,False]
318
319
  self.FlagResetLevels=True
319
320
  self.FlagResetSizes=True
@@ -442,6 +443,7 @@ class Vis_Tab(gPaIRS_Tab):
442
443
  pri.Time.magenta('Colormap generation: start')
443
444
  # Create the popup menu
444
445
  self.colorMapMenu = QMenu(self)
446
+ self.colorMapMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
445
447
  # Add the colormap thumbnails to the menu
446
448
  def on_colormap_selected(name):
447
449
  self.VISpar.vcolorMap[self.VISpar.variableKey]=self.VISpar.colorMap=name
@@ -462,6 +464,7 @@ class Vis_Tab(gPaIRS_Tab):
462
464
  pri.Time.magenta('Vector color generation: start')
463
465
  # Create the popup menu
464
466
  self.vectorColorMenu = QMenu(self)
467
+ self.vectorColorMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
465
468
  # Add the colormap thumbnails to the menu
466
469
  def on_vectorcolor_selected(name):
467
470
  self.VISpar.vvectorColor[self.VISpar.variableKey]=self.VISpar.vectorColor=name
@@ -476,7 +479,9 @@ class Vis_Tab(gPaIRS_Tab):
476
479
  action = menu.addAction(QIcon(pixmap), ' '+colorName.lower())
477
480
  action.triggered.connect(lambda _, name=colorName: on_vectorcolor_selected(name))
478
481
  pri.Time.magenta('Vector color generation: end')
479
-
482
+
483
+ apply_hover_glow_label(self.ui.icon)
484
+
480
485
  #------------------------------------- Declaration of parameters
481
486
  self.VISpar_base=VISpar()
482
487
  self.VISpar:VISpar=self.TABpar
@@ -504,14 +509,15 @@ class Vis_Tab(gPaIRS_Tab):
504
509
 
505
510
  slider.valueChanged.connect(callback)
506
511
 
512
+ """
507
513
  if n in ('nclev','streamdens'):
508
514
  def sliderMessage(s:QSlider):
509
515
  if self.VISpar.field_rep==2:
510
516
  tip = f"Release to repaint"
511
- else: tip=""
512
- QToolTip.showText(s.mapToGlobal(s.rect().topLeft()), tip)
517
+ show_mouse_tooltip(s,tip)
513
518
  slider.sliderPressed.connect(lambda: sliderMessage(slider))
514
-
519
+ """
520
+
515
521
  setattr(self,'slider_'+n+'_callbcak',callback)
516
522
  setattr(self,'spin_'+n+'_action',action)
517
523
  setattr(self,'spin_'+n+'_set',setting)
@@ -550,8 +556,8 @@ class Vis_Tab(gPaIRS_Tab):
550
556
  self.setTABlayout=self.setVISlayout
551
557
 
552
558
  self.FlagReset=True
553
- self.FlagResetLevels=True
554
- self.FlagResetSizes =True
559
+ self.FlagResetLevels=False
560
+ self.FlagResetSizes =False
555
561
 
556
562
  self.image_file=''
557
563
  self.image_raw=None
@@ -637,7 +643,7 @@ class Vis_Tab(gPaIRS_Tab):
637
643
  FlagNew=(not self.VISpar.type and FlagNewImage) or (self.VISpar.type==1 and FlagNewResult)
638
644
  FlagDiff=self.VISpar.isDifferentFrom(self.VISpar_old,fields=['img','cam','frame']) or FlagNew
639
645
 
640
- if (VISpar.FlagAutoLevels and (FlagNewImage or FlagNewResult)):
646
+ if (self.VISpar.FlagAutoLevels and (FlagNewImage or FlagNewResult)):
641
647
  self.resetAllLevels()
642
648
  if FlagDiff or self.FlagResetLevels:
643
649
  self.FlagResetLevels=False
@@ -646,7 +652,7 @@ class Vis_Tab(gPaIRS_Tab):
646
652
  self.FlagResetLevels=False
647
653
  self.resetLevels()
648
654
 
649
- if (VISpar.FlagAutoSizes and (FlagNewImage or FlagNewResult)):
655
+ if (self.VISpar.FlagAutoSizes and (FlagNewImage or FlagNewResult)):
650
656
  self.resetAllXYLims()
651
657
  if FlagDiff or self.FlagResetSizes:
652
658
  self.FlagResetSizes=False
@@ -654,8 +660,9 @@ class Vis_Tab(gPaIRS_Tab):
654
660
  elif self.FlagResetSizes:
655
661
  self.FlagResetSizes=False
656
662
  self.resetXYLims()
657
-
663
+
658
664
  self.adjustFieldRep()
665
+
659
666
 
660
667
  def adjustImport(self):
661
668
  self.VISpar.image_file=self.VISpar.image_file_Min=self.VISpar.image_file_Disp=''
@@ -702,7 +709,13 @@ class Vis_Tab(gPaIRS_Tab):
702
709
  else:
703
710
  self.VISpar.result_file=self.VISpar.resF(self.VISpar.img)
704
711
  elif self.VISpar.img==0:
705
- self.VISpar.result_file=self.VISpar.result_file_Mean
712
+ self.VISpar.result_file=self.VISpar.result_file_Mean
713
+ if not self.VISpar.FlagView:
714
+ ITE=self.gui.ui.Explorer.ITEfromInd(self.VISpar.ind)
715
+ id=ITE.procdata.name_proc
716
+ self.VISpar.FlagResult=fileIdenitifierCheck(id,self.VISpar.result_file)
717
+ if not self.VISpar.FlagResult: self.VISpar.result_file=''
718
+
706
719
 
707
720
  FlagNewImage, FlagNewResult, _=self.importFiles()
708
721
  return FlagNewImage, FlagNewResult
@@ -1063,7 +1076,8 @@ class Vis_Tab(gPaIRS_Tab):
1063
1076
  res[n]=tres[0][:,:,j]
1064
1077
  if self.namesPIV.u in res and self.namesPIV.v in res:
1065
1078
  res=self.calcMagnitude(res)
1066
- res=self.calcZVorticity(res)
1079
+ FlagUnit=self.VISpar.Out.xres!=1.0 or self.VISpar.Out.pixAR!=1.0
1080
+ res=self.calcZVorticity(res,FlagUnit)
1067
1081
  for f in list(res):
1068
1082
  if not f in self.namesPIV.allFields: del res[f]
1069
1083
  except Exception as inst:
@@ -1079,9 +1093,10 @@ class Vis_Tab(gPaIRS_Tab):
1079
1093
  res[self.namesPIV.Mod]=np.sqrt(res[self.namesPIV.u]**2+res[self.namesPIV.v]**2)
1080
1094
  return res
1081
1095
 
1082
- def calcZVorticity(self,res):
1096
+ def calcZVorticity(self,res,FlagUnit=False):
1083
1097
  if self.namesPIV.x in res and self.namesPIV.y in res and self.namesPIV.u in res and self.namesPIV.v in res:
1084
- xres,yres=self.getXYRes(type=1)
1098
+ if FlagUnit: xres=yres=1/1000
1099
+ else: xres=yres=1.0
1085
1100
  try:
1086
1101
  du_dy, _=np.gradient(res[self.namesPIV.u],res[self.namesPIV.y][:,0]*yres,res[self.namesPIV.x][0,:]*xres) # Derivate di u rispetto a y e x
1087
1102
  _, dv_dx=np.gradient(res[self.namesPIV.v],res[self.namesPIV.y][:,0]*yres,res[self.namesPIV.x][0,:]*xres) # Derivate di v rispetto a y e x
@@ -1182,11 +1197,21 @@ class Vis_Tab(gPaIRS_Tab):
1182
1197
  self.setLevels()
1183
1198
 
1184
1199
  def button_automatic_levels_action(self):
1185
- VISpar.FlagAutoLevels=self.ui.button_automatic_levels.isChecked()
1200
+ self.VISpar.FlagAutoLevels=self.ui.button_automatic_levels.isChecked()
1186
1201
  return True
1187
1202
 
1188
1203
  def button_automatic_sizes_action(self):
1189
- VISpar.FlagAutoSizes=self.ui.button_automatic_sizes.isChecked()
1204
+ self.VISpar.FlagAutoSizes=self.ui.button_automatic_sizes.isChecked()
1205
+ if self.VISpar.FlagAutoSizes is False and self.VISpar.Process==ProcessTypes.piv:
1206
+ type2=0 if self.VISpar.type==1 else 1
1207
+ if self.VISpar.unit[self.VISpar.type]!=self.VISpar.unit[type2]:
1208
+ xres,yres=self.getXYRes(type=self.VISpar.unit[self.VISpar.type])
1209
+ else: xres=yres=1.0
1210
+ if (type2==0 and self.VISpar.unit[type2]) or (type2==1 and not self.VISpar.unit[type2]):
1211
+ xres2,yres2=self.getXYRes(type=type2)
1212
+ else: xres2=yres2=1.0
1213
+ self.VISpar.size[type2][0:2]=[s*xres/xres2 for s in [self.VISpar.xmin, self.VISpar.xmax]]
1214
+ self.VISpar.size[type2][2:4]=[s*yres/yres2 for s in [self.VISpar.ymin, self.VISpar.ymax]]
1190
1215
  return True
1191
1216
 
1192
1217
  def button_restore_action(self):
@@ -1327,6 +1352,7 @@ class Vis_Tab(gPaIRS_Tab):
1327
1352
 
1328
1353
  # Create a context menu and populate it with the available sizes
1329
1354
  menu = QMenu(self)
1355
+ menu.setStyleSheet(self.gui.ui.menu.styleSheet())
1330
1356
  for i in range(n):
1331
1357
  label = f"{Vect[2][i]} x {Vect[0][i]}"
1332
1358
  act = menu.addAction(label)
@@ -1389,10 +1415,10 @@ class Vis_Tab(gPaIRS_Tab):
1389
1415
  self.ui.button_Contourf.setChecked(self.VISpar.FlagContourf)
1390
1416
 
1391
1417
  def button_automatic_levels_set(self):
1392
- self.ui.button_automatic_levels.setChecked(VISpar.FlagAutoLevels)
1418
+ self.ui.button_automatic_levels.setChecked(self.VISpar.FlagAutoLevels)
1393
1419
 
1394
1420
  def button_automatic_sizes_set(self):
1395
- self.ui.button_automatic_sizes.setChecked(VISpar.FlagAutoSizes)
1421
+ self.ui.button_automatic_sizes.setChecked(self.VISpar.FlagAutoSizes)
1396
1422
 
1397
1423
  def button_invert_y_set(self):
1398
1424
  self.ui.button_invert_y.setChecked(self.VISpar.FlagYInvert[self.VISpar.type])
@@ -1480,6 +1506,7 @@ class Vis_Tab(gPaIRS_Tab):
1480
1506
  FlagVecField=self.VISpar.isDifferentFrom(self.VISpar_old,fields=fields)
1481
1507
  if FlagVecField and self.result:
1482
1508
  self.showVecField()
1509
+ elif self.result is None: self.cleanVecField()
1483
1510
  FlagDraw=FlagDraw or FlagVecField
1484
1511
 
1485
1512
  if FlagDraw:
@@ -1520,7 +1547,7 @@ class Vis_Tab(gPaIRS_Tab):
1520
1547
  FlagXLim=True
1521
1548
  else:
1522
1549
  self.imgshow.set_data(img)
1523
- extent=self.imgExtent()
1550
+ extent=self.imgExtent(size)
1524
1551
  if extent!=self.imgshow.get_extent():
1525
1552
  self.imgshow.set_extent(extent)
1526
1553
  FlagExtent=True
@@ -1560,7 +1587,7 @@ class Vis_Tab(gPaIRS_Tab):
1560
1587
  return cmap, levs
1561
1588
 
1562
1589
  def getXYRes(self,type=None):
1563
- if not type: type=self.VISpar.type
1590
+ if type is None: type=self.VISpar.type
1564
1591
  xres=yres=1.0
1565
1592
  if self.VISpar.Process==ProcessTypes.piv and not self.VISpar.Out.FlagNone:
1566
1593
  if type==0: #mm/pixels
@@ -2003,6 +2030,7 @@ class Vis_Tab(gPaIRS_Tab):
2003
2030
  #*************************************************** Menus
2004
2031
  def contextMenuEvent(self, event):
2005
2032
  contextMenu = QMenu(self)
2033
+ contextMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
2006
2034
  copy2clipboard = contextMenu.addAction("Copy to clipboard ("+self.QS_copy2clipboard.key().toString(QKeySequence.NativeText)+")")
2007
2035
  copy2clipboard.setIcon(self.ui.plot.copyIcon)
2008
2036
  copy2newfig = contextMenu.addAction("Open in new figure ("+self.QS_copy2newfig.key().toString(QKeySequence.NativeText)+")")
@@ -385,6 +385,7 @@ class Vis_Tab_CalVi(gPaIRS_Tab):
385
385
  self.ui.w_Commands.setVisible(self.VISpar.FlagRunning)
386
386
  if self.VISpar.FlagRunning:
387
387
  self.calibView.contextMenu = QtWidgets.QMenu(self)
388
+ self.calibView.contextMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
388
389
  for a in self.calibView.contextMenuActions:
389
390
  self.calibView.contextMenu.addAction(a)
390
391
  self.calibView.contextMenu.insertSeparator(self.calibView.contextMenuActions[1])
@@ -968,8 +969,6 @@ class Vis_Tab_CalVi(gPaIRS_Tab):
968
969
  FlagVisible=all([not bool(p) for p in calVect.flagPlane[:-1]])
969
970
  self.gui.ui.button_Run_CalVi.setVisible(FlagVisible)
970
971
 
971
-
972
-
973
972
 
974
973
  if __name__ == "__main__":
975
974
  import sys
PaIRS_UniNa/Whatsnew.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from .PaIRS_pypacks import*
2
2
  from .ui_Whatsnew import Ui_Whatsnew
3
- from .__init__ import __version__
3
+ from .__init__ import __version__,__subversion__
4
4
  import unicodedata
5
5
 
6
6
  #from TabTools import setupWid,setFontPixelSize,setFontSizeText
@@ -101,8 +101,9 @@ def whatsNew(self):
101
101
  splitted_news[k]= f'<br/><span style="font-weight: 600; font-size: {fontPixelSize}px;">{text[1:]}</span><br/>'
102
102
  news="".join(splitted_news)
103
103
 
104
- Message=f'<span style=" font-size: {fontPixelSize+dfontPixelSize}px; font-weight: 600;">'+f"What's new in PaIRS-UniNa {__version__}"+'</span><br/><br/>'+news+'<br/>Go to the menu "? -> Changes" for further information.'
105
- self.whatsnew=Whatsnew(self,Message,f'Updates of version {__version__}',dfontPixelSize)
104
+ subversion_string=f'(.{__subversion__})' if int(__subversion__) else ''
105
+ Message=f'<span style=" font-size: {fontPixelSize+dfontPixelSize}px; font-weight: 600;">'+f"What's new in PaIRS-UniNa {__version__}{subversion_string}"+'</span><br/><br/>'+news+'<br/>Go to the menu "? -> Changes" for further information.'
106
+ self.whatsnew=Whatsnew(self,Message,f'Updates of version {__version__}{subversion_string}',dfontPixelSize)
106
107
  #warningDialog(self,Message,pixmap=''+ icons_path +'news.png',title=f'Updates of version {__version__}',flagRichText=True)
107
108
  except Exception as inst:
108
109
  pri.Error.red(f"There was a problem while launching the What's new dialog box:\n{inst}")
PaIRS_UniNa/_PaIRS_PIV.so CHANGED
Binary file
PaIRS_UniNa/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
- __version__="0.2.7"
1
+ __version__="0.2.10"
2
2
  __subversion__="0"
3
- __year__='2025'
4
- __date__='2025.10.13'
3
+ __year__='2026'
4
+ __date__='2026.01.05'
5
5
  __mail__='etfd@unina.it'
6
6
  __website__='https://pairs.unina.it'