PaIRS-UniNa 0.2.7__cp313-cp313-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.
Potentially problematic release.
This version of PaIRS-UniNa might be problematic. Click here for more details.
- PaIRS_UniNa/Calibration_Tab.py +331 -0
- PaIRS_UniNa/Changes.txt +135 -0
- PaIRS_UniNa/Custom_Top.py +303 -0
- PaIRS_UniNa/Explorer.py +3086 -0
- PaIRS_UniNa/FolderLoop.py +372 -0
- PaIRS_UniNa/Input_Tab.py +722 -0
- PaIRS_UniNa/Input_Tab_CalVi.py +788 -0
- PaIRS_UniNa/Input_Tab_tools.py +3024 -0
- PaIRS_UniNa/Log_Tab.py +110 -0
- PaIRS_UniNa/Output_Tab.py +924 -0
- PaIRS_UniNa/PaIRS.py +18 -0
- PaIRS_UniNa/PaIRS_PIV.py +873 -0
- PaIRS_UniNa/PaIRS_pypacks.py +1376 -0
- PaIRS_UniNa/Process_Tab.py +1757 -0
- PaIRS_UniNa/Process_Tab_CalVi.py +313 -0
- PaIRS_UniNa/Process_Tab_Disp.py +163 -0
- PaIRS_UniNa/Process_Tab_Min.py +120 -0
- PaIRS_UniNa/ResizePopup.py +55 -0
- PaIRS_UniNa/Saving_tools.py +296 -0
- PaIRS_UniNa/TabTools.py +1254 -0
- PaIRS_UniNa/Vis_Tab.py +2148 -0
- PaIRS_UniNa/Vis_Tab_CalVi.py +983 -0
- PaIRS_UniNa/Whatsnew.py +129 -0
- PaIRS_UniNa/_PaIRS_PIV.so +0 -0
- PaIRS_UniNa/__init__.py +6 -0
- PaIRS_UniNa/__main__.py +45 -0
- PaIRS_UniNa/addwidgets_ps.py +1133 -0
- PaIRS_UniNa/calib.py +1488 -0
- PaIRS_UniNa/calibView.py +833 -0
- PaIRS_UniNa/gPaIRS.py +3856 -0
- PaIRS_UniNa/gPalette.py +189 -0
- PaIRS_UniNa/icons/abort.png +0 -0
- PaIRS_UniNa/icons/about.png +0 -0
- PaIRS_UniNa/icons/align_all.png +0 -0
- PaIRS_UniNa/icons/announcement.png +0 -0
- PaIRS_UniNa/icons/automatic_levels_off.png +0 -0
- PaIRS_UniNa/icons/automatic_levels_on.png +0 -0
- PaIRS_UniNa/icons/automatic_off.png +0 -0
- PaIRS_UniNa/icons/automatic_on.png +0 -0
- PaIRS_UniNa/icons/automatic_size_off.png +0 -0
- PaIRS_UniNa/icons/automatic_size_on.png +0 -0
- PaIRS_UniNa/icons/axes.png +0 -0
- PaIRS_UniNa/icons/background.png +0 -0
- PaIRS_UniNa/icons/background_vectors.png +0 -0
- PaIRS_UniNa/icons/bin_off.png +0 -0
- PaIRS_UniNa/icons/bin_on.png +0 -0
- PaIRS_UniNa/icons/browse_file_c.png +0 -0
- PaIRS_UniNa/icons/browse_folder_c.png +0 -0
- PaIRS_UniNa/icons/brush_cursor.png +0 -0
- PaIRS_UniNa/icons/bugfix.png +0 -0
- PaIRS_UniNa/icons/cal_proc.png +0 -0
- PaIRS_UniNa/icons/cal_proc_off.png +0 -0
- PaIRS_UniNa/icons/cal_step.png +0 -0
- PaIRS_UniNa/icons/cal_step_off.png +0 -0
- PaIRS_UniNa/icons/calibrate.png +0 -0
- PaIRS_UniNa/icons/calibration_logo.png +0 -0
- PaIRS_UniNa/icons/change_folder.png +0 -0
- PaIRS_UniNa/icons/change_folder_off.png +0 -0
- PaIRS_UniNa/icons/checklist.png +0 -0
- PaIRS_UniNa/icons/clean.png +0 -0
- PaIRS_UniNa/icons/clean_run.png +0 -0
- PaIRS_UniNa/icons/close.png +0 -0
- PaIRS_UniNa/icons/close_all.png +0 -0
- PaIRS_UniNa/icons/close_project.png +0 -0
- PaIRS_UniNa/icons/close_workspace.png +0 -0
- PaIRS_UniNa/icons/colormap.png +0 -0
- PaIRS_UniNa/icons/colormaps/Accent.png +0 -0
- PaIRS_UniNa/icons/colormaps/BrBG.png +0 -0
- PaIRS_UniNa/icons/colormaps/Dark2.png +0 -0
- PaIRS_UniNa/icons/colormaps/PRGn.png +0 -0
- PaIRS_UniNa/icons/colormaps/Paired.png +0 -0
- PaIRS_UniNa/icons/colormaps/Pastel1.png +0 -0
- PaIRS_UniNa/icons/colormaps/Pastel2.png +0 -0
- PaIRS_UniNa/icons/colormaps/PiYG.png +0 -0
- PaIRS_UniNa/icons/colormaps/PuOr.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdBu.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdGy.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdYlBu.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdYlGn.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set1.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set2.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set3.png +0 -0
- PaIRS_UniNa/icons/colormaps/Spectral.png +0 -0
- PaIRS_UniNa/icons/colormaps/Wistia.png +0 -0
- PaIRS_UniNa/icons/colormaps/afmhot.png +0 -0
- PaIRS_UniNa/icons/colormaps/autumn.png +0 -0
- PaIRS_UniNa/icons/colormaps/binary.png +0 -0
- PaIRS_UniNa/icons/colormaps/blackVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/blueVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/bone.png +0 -0
- PaIRS_UniNa/icons/colormaps/brg.png +0 -0
- PaIRS_UniNa/icons/colormaps/bwr.png +0 -0
- PaIRS_UniNa/icons/colormaps/cividis.png +0 -0
- PaIRS_UniNa/icons/colormaps/cool.png +0 -0
- PaIRS_UniNa/icons/colormaps/coolwarm.png +0 -0
- PaIRS_UniNa/icons/colormaps/copper.png +0 -0
- PaIRS_UniNa/icons/colormaps/cubehelix.png +0 -0
- PaIRS_UniNa/icons/colormaps/cyanVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/flag.png +0 -0
- PaIRS_UniNa/icons/colormaps/gist_heat.png +0 -0
- PaIRS_UniNa/icons/colormaps/gray.png +0 -0
- PaIRS_UniNa/icons/colormaps/greenVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/hot.png +0 -0
- PaIRS_UniNa/icons/colormaps/hsv.png +0 -0
- PaIRS_UniNa/icons/colormaps/inferno.png +0 -0
- PaIRS_UniNa/icons/colormaps/jet.png +0 -0
- PaIRS_UniNa/icons/colormaps/magentaVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/magma.png +0 -0
- PaIRS_UniNa/icons/colormaps/ocean.png +0 -0
- PaIRS_UniNa/icons/colormaps/pink.png +0 -0
- PaIRS_UniNa/icons/colormaps/plasma.png +0 -0
- PaIRS_UniNa/icons/colormaps/prism.png +0 -0
- PaIRS_UniNa/icons/colormaps/rainbow.png +0 -0
- PaIRS_UniNa/icons/colormaps/redVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/seismic.png +0 -0
- PaIRS_UniNa/icons/colormaps/spring.png +0 -0
- PaIRS_UniNa/icons/colormaps/summer.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab10.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20b.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20c.png +0 -0
- PaIRS_UniNa/icons/colormaps/terrain.png +0 -0
- PaIRS_UniNa/icons/colormaps/twilight.png +0 -0
- PaIRS_UniNa/icons/colormaps/viridis.png +0 -0
- PaIRS_UniNa/icons/colormaps/whiteVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/winter.png +0 -0
- PaIRS_UniNa/icons/colormaps/yellowVector.png +0 -0
- PaIRS_UniNa/icons/common_region.png +0 -0
- PaIRS_UniNa/icons/common_region_off.png +0 -0
- PaIRS_UniNa/icons/completed.png +0 -0
- PaIRS_UniNa/icons/contourf_off.png +0 -0
- PaIRS_UniNa/icons/contourf_on.png +0 -0
- PaIRS_UniNa/icons/copy.png +0 -0
- PaIRS_UniNa/icons/copy_process.png +0 -0
- PaIRS_UniNa/icons/copy_process_off.png +0 -0
- PaIRS_UniNa/icons/copygrid.png +0 -0
- PaIRS_UniNa/icons/cursor_lamp.png +0 -0
- PaIRS_UniNa/icons/cut.png +0 -0
- PaIRS_UniNa/icons/cut_warnings.png +0 -0
- PaIRS_UniNa/icons/darkmode.png +0 -0
- PaIRS_UniNa/icons/debug_run.png +0 -0
- PaIRS_UniNa/icons/delete.png +0 -0
- PaIRS_UniNa/icons/deleteErr.png +0 -0
- PaIRS_UniNa/icons/disp_step.png +0 -0
- PaIRS_UniNa/icons/disp_step_off.png +0 -0
- PaIRS_UniNa/icons/down.png +0 -0
- PaIRS_UniNa/icons/edit_list.png +0 -0
- PaIRS_UniNa/icons/editing.png +0 -0
- PaIRS_UniNa/icons/example_list.png +0 -0
- PaIRS_UniNa/icons/find_all_planes.png +0 -0
- PaIRS_UniNa/icons/find_plane.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_beta.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_download.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_download_warning.png +0 -0
- PaIRS_UniNa/icons/flip_y_off.png +0 -0
- PaIRS_UniNa/icons/flip_y_on.png +0 -0
- PaIRS_UniNa/icons/focusErrr.png +0 -0
- PaIRS_UniNa/icons/gear.gif +0 -0
- PaIRS_UniNa/icons/gear.png +0 -0
- PaIRS_UniNa/icons/ger.png +0 -0
- PaIRS_UniNa/icons/greenv.png +0 -0
- PaIRS_UniNa/icons/guide.png +0 -0
- PaIRS_UniNa/icons/icon_CalVi.png +0 -0
- PaIRS_UniNa/icons/icon_PaIRS.png +0 -0
- PaIRS_UniNa/icons/import.png +0 -0
- PaIRS_UniNa/icons/import_set.png +0 -0
- PaIRS_UniNa/icons/information.png +0 -0
- PaIRS_UniNa/icons/input_logo.png +0 -0
- PaIRS_UniNa/icons/issue.png +0 -0
- PaIRS_UniNa/icons/laser_NTR.png +0 -0
- PaIRS_UniNa/icons/laser_TR_double.png +0 -0
- PaIRS_UniNa/icons/laser_TR_single.png +0 -0
- PaIRS_UniNa/icons/link.png +0 -0
- PaIRS_UniNa/icons/linked.png +0 -0
- PaIRS_UniNa/icons/loaded.png +0 -0
- PaIRS_UniNa/icons/loading_2.gif +0 -0
- PaIRS_UniNa/icons/log_logo.png +0 -0
- PaIRS_UniNa/icons/logo_CalVi.png +0 -0
- PaIRS_UniNa/icons/logo_CalVi_completo.png +0 -0
- PaIRS_UniNa/icons/logo_CalVi_party.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_completo.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_download.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_party_rect.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_rect.png +0 -0
- PaIRS_UniNa/icons/logo_opaco.png +0 -0
- PaIRS_UniNa/icons/mask.png +0 -0
- PaIRS_UniNa/icons/measure.png +0 -0
- PaIRS_UniNa/icons/measure_off.png +0 -0
- PaIRS_UniNa/icons/min_proc.png +0 -0
- PaIRS_UniNa/icons/min_proc_off.png +0 -0
- PaIRS_UniNa/icons/min_step.png +0 -0
- PaIRS_UniNa/icons/min_step_off.png +0 -0
- PaIRS_UniNa/icons/minus.png +0 -0
- PaIRS_UniNa/icons/mirror_u.png +0 -0
- PaIRS_UniNa/icons/mirror_v.png +0 -0
- PaIRS_UniNa/icons/mirror_x.png +0 -0
- PaIRS_UniNa/icons/mirror_y.png +0 -0
- PaIRS_UniNa/icons/mtplt.png +0 -0
- PaIRS_UniNa/icons/new.png +0 -0
- PaIRS_UniNa/icons/new_workspace.png +0 -0
- PaIRS_UniNa/icons/news.png +0 -0
- PaIRS_UniNa/icons/normal_run.png +0 -0
- PaIRS_UniNa/icons/open.png +0 -0
- PaIRS_UniNa/icons/open_image.png +0 -0
- PaIRS_UniNa/icons/open_new_window.png +0 -0
- PaIRS_UniNa/icons/open_result.png +0 -0
- PaIRS_UniNa/icons/open_workspace.png +0 -0
- PaIRS_UniNa/icons/output_logo.png +0 -0
- PaIRS_UniNa/icons/paste_above.png +0 -0
- PaIRS_UniNa/icons/paste_below.png +0 -0
- PaIRS_UniNa/icons/pause.png +0 -0
- PaIRS_UniNa/icons/paused.png +0 -0
- PaIRS_UniNa/icons/pencil_bw.png +0 -0
- PaIRS_UniNa/icons/piv_proc.png +0 -0
- PaIRS_UniNa/icons/piv_proc_off.png +0 -0
- PaIRS_UniNa/icons/piv_step.png +0 -0
- PaIRS_UniNa/icons/piv_step_off.png +0 -0
- PaIRS_UniNa/icons/plane.png +0 -0
- PaIRS_UniNa/icons/play.png +0 -0
- PaIRS_UniNa/icons/plus.png +0 -0
- PaIRS_UniNa/icons/process_logo.png +0 -0
- PaIRS_UniNa/icons/process_loop.png +0 -0
- PaIRS_UniNa/icons/project.png +0 -0
- PaIRS_UniNa/icons/pylog.png +0 -0
- PaIRS_UniNa/icons/python_warning.png +0 -0
- PaIRS_UniNa/icons/queue.png +0 -0
- PaIRS_UniNa/icons/quit.png +0 -0
- PaIRS_UniNa/icons/read.png +0 -0
- PaIRS_UniNa/icons/read_list.png +0 -0
- PaIRS_UniNa/icons/redo.png +0 -0
- PaIRS_UniNa/icons/redx.png +0 -0
- PaIRS_UniNa/icons/reset.png +0 -0
- PaIRS_UniNa/icons/reset_levels.png +0 -0
- PaIRS_UniNa/icons/resize_icon.png +0 -0
- PaIRS_UniNa/icons/restore.png +0 -0
- PaIRS_UniNa/icons/restore_undo.png +0 -0
- PaIRS_UniNa/icons/rotate_clock.png +0 -0
- PaIRS_UniNa/icons/rotate_counter.png +0 -0
- PaIRS_UniNa/icons/rotate_v_clock.png +0 -0
- PaIRS_UniNa/icons/rotate_v_counter.png +0 -0
- PaIRS_UniNa/icons/running.gif +0 -0
- PaIRS_UniNa/icons/running.png +0 -0
- PaIRS_UniNa/icons/running_warn.png +0 -0
- PaIRS_UniNa/icons/sandglass.png +0 -0
- PaIRS_UniNa/icons/save.png +0 -0
- PaIRS_UniNa/icons/save_and_stop.png +0 -0
- PaIRS_UniNa/icons/save_cfg.png +0 -0
- PaIRS_UniNa/icons/saveas.png +0 -0
- PaIRS_UniNa/icons/saveas_workspace.png +0 -0
- PaIRS_UniNa/icons/scale_all.png +0 -0
- PaIRS_UniNa/icons/scale_down.png +0 -0
- PaIRS_UniNa/icons/scale_up.png +0 -0
- PaIRS_UniNa/icons/scan_list.png +0 -0
- PaIRS_UniNa/icons/scan_path.png +0 -0
- PaIRS_UniNa/icons/search.png +0 -0
- PaIRS_UniNa/icons/showIW_off.png +0 -0
- PaIRS_UniNa/icons/showIW_on.png +0 -0
- PaIRS_UniNa/icons/show_all.png +0 -0
- PaIRS_UniNa/icons/sort.png +0 -0
- PaIRS_UniNa/icons/sort_reversed.png +0 -0
- PaIRS_UniNa/icons/spiv_proc.png +0 -0
- PaIRS_UniNa/icons/spiv_proc_off.png +0 -0
- PaIRS_UniNa/icons/star.png +0 -0
- PaIRS_UniNa/icons/step_inheritance.png +0 -0
- PaIRS_UniNa/icons/subMIN_off.png +0 -0
- PaIRS_UniNa/icons/subMIN_on.png +0 -0
- PaIRS_UniNa/icons/tom.png +0 -0
- PaIRS_UniNa/icons/trash.png +0 -0
- PaIRS_UniNa/icons/undo.png +0 -0
- PaIRS_UniNa/icons/unedited.png +0 -0
- PaIRS_UniNa/icons/unina_dii.png +0 -0
- PaIRS_UniNa/icons/uninitialized.png +0 -0
- PaIRS_UniNa/icons/unlink.png +0 -0
- PaIRS_UniNa/icons/unwrap_items.png +0 -0
- PaIRS_UniNa/icons/up.png +0 -0
- PaIRS_UniNa/icons/updating_import.gif +0 -0
- PaIRS_UniNa/icons/updating_pairs.gif +0 -0
- PaIRS_UniNa/icons/vectorColor.png +0 -0
- PaIRS_UniNa/icons/vettore.png +0 -0
- PaIRS_UniNa/icons/view.png +0 -0
- PaIRS_UniNa/icons/view_off.png +0 -0
- PaIRS_UniNa/icons/vis_logo.png +0 -0
- PaIRS_UniNa/icons/waiting_circle.png +0 -0
- PaIRS_UniNa/icons/warning.png +0 -0
- PaIRS_UniNa/icons/warning_circle.png +0 -0
- PaIRS_UniNa/icons/window.png +0 -0
- PaIRS_UniNa/icons/workspace.png +0 -0
- PaIRS_UniNa/icons/wrap_items.png +0 -0
- PaIRS_UniNa/icons/write_list.png +0 -0
- PaIRS_UniNa/listLib.py +303 -0
- PaIRS_UniNa/mtfPIV.py +256 -0
- PaIRS_UniNa/parForMulti.py +435 -0
- PaIRS_UniNa/parForWorkers.py +593 -0
- PaIRS_UniNa/pivParFor.py +235 -0
- PaIRS_UniNa/plt_util.py +141 -0
- PaIRS_UniNa/preProcParFor.py +155 -0
- PaIRS_UniNa/procTools.py +1394 -0
- PaIRS_UniNa/readcfg.py +52 -0
- PaIRS_UniNa/rqrdpckgs.txt +9 -0
- PaIRS_UniNa/stereoPivParFor.py +227 -0
- PaIRS_UniNa/tAVarie.py +215 -0
- PaIRS_UniNa/tabSplitter.py +612 -0
- PaIRS_UniNa/ui_Calibration_Tab.py +545 -0
- PaIRS_UniNa/ui_Custom_Top.py +296 -0
- PaIRS_UniNa/ui_Input_Tab.py +1101 -0
- PaIRS_UniNa/ui_Input_Tab_CalVi.py +1283 -0
- PaIRS_UniNa/ui_Log_Tab.py +263 -0
- PaIRS_UniNa/ui_Output_Tab.py +2362 -0
- PaIRS_UniNa/ui_Process_Tab.py +3810 -0
- PaIRS_UniNa/ui_Process_Tab_CalVi.py +1549 -0
- PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
- PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
- PaIRS_UniNa/ui_ResizePopup.py +204 -0
- PaIRS_UniNa/ui_Vis_Tab.py +1628 -0
- PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1251 -0
- PaIRS_UniNa/ui_Whatsnew.py +132 -0
- PaIRS_UniNa/ui_gPairs.py +877 -0
- PaIRS_UniNa/ui_infoPaIRS.py +551 -0
- PaIRS_UniNa/whatsnew.txt +5 -0
- pairs_unina-0.2.7.dist-info/METADATA +160 -0
- pairs_unina-0.2.7.dist-info/RECORD +325 -0
- pairs_unina-0.2.7.dist-info/WHEEL +5 -0
- pairs_unina-0.2.7.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
from .PaIRS_pypacks import*
|
|
2
|
+
from .ui_Custom_Top import *
|
|
3
|
+
from .TabTools import *
|
|
4
|
+
|
|
5
|
+
class Custom_Top(QDialog):
|
|
6
|
+
|
|
7
|
+
def __init__(self,custom_list=None):
|
|
8
|
+
super().__init__()
|
|
9
|
+
ui=Ui_Custom_Top()
|
|
10
|
+
ui.setupUi(self)
|
|
11
|
+
self.ui=ui
|
|
12
|
+
setupWid(self)
|
|
13
|
+
self.itemSize=QSize(500,20)
|
|
14
|
+
ui.tree.FlagArrowKeysNormal=True
|
|
15
|
+
|
|
16
|
+
self.custom_list_file=pro_path+custom_list_file
|
|
17
|
+
|
|
18
|
+
self.queue=[]
|
|
19
|
+
ui.tree.clear()
|
|
20
|
+
if custom_list==None:
|
|
21
|
+
self.custom_list=[os.path.basename(f)[:-10] for f in glob.glob(pro_path+outExt.pro)]
|
|
22
|
+
else:
|
|
23
|
+
self.custom_list=custom_list
|
|
24
|
+
self.custom_list=setCustomList(lambda var,name: self.createItemInTree(ui.tree,self.queue,name,name,QIcon()))
|
|
25
|
+
self.deleted=[]
|
|
26
|
+
self.added=[]
|
|
27
|
+
|
|
28
|
+
self.setupCallbacks()
|
|
29
|
+
self.FlagAdjusting=False
|
|
30
|
+
self.setButtons()
|
|
31
|
+
|
|
32
|
+
def setupCallbacks(self):
|
|
33
|
+
self.ui.tree.itemSelectionChanged.connect(self.setButtons)
|
|
34
|
+
self.ui.tree.itemChanged.connect(self.adjustText)
|
|
35
|
+
|
|
36
|
+
button_up_callback=lambda: self.moveupdown(-1)
|
|
37
|
+
button_down_callback=lambda: self.moveupdown(+1)
|
|
38
|
+
self.ui.button_up.clicked.connect(button_up_callback)
|
|
39
|
+
self.ui.button_down.clicked.connect(button_down_callback)
|
|
40
|
+
self.ui.button_edit.clicked.connect(self.editItem)
|
|
41
|
+
self.ui.button_undo.clicked.connect(self.undo)
|
|
42
|
+
self.ui.button_restore.clicked.connect(self.restoreItem)
|
|
43
|
+
self.ui.button_delete.clicked.connect(self.removeItem)
|
|
44
|
+
self.ui.button_import.clicked.connect(self.loadPastProc)
|
|
45
|
+
|
|
46
|
+
self.ui.button_done.clicked.connect(self.save_and_close)
|
|
47
|
+
self.ui.button_cancel.clicked.connect(lambda: self.done(0))
|
|
48
|
+
|
|
49
|
+
def moveupdown(self,d):
|
|
50
|
+
tree: QTreeWidget
|
|
51
|
+
tree=self.ui.tree
|
|
52
|
+
queue=self.queue
|
|
53
|
+
item=tree.currentItem()
|
|
54
|
+
indItem=tree.indexOfTopLevelItem(item)
|
|
55
|
+
tree.takeTopLevelItem(indItem)
|
|
56
|
+
tree.insertTopLevelItem(indItem+d,item)
|
|
57
|
+
queue.insert(indItem+d,queue.pop(indItem))
|
|
58
|
+
self.custom_list.insert(indItem+d,self.custom_list.pop(indItem))
|
|
59
|
+
|
|
60
|
+
tree.setCurrentItem(item)
|
|
61
|
+
self.setButtons()
|
|
62
|
+
|
|
63
|
+
def createItemInTree(self,tree,queue,name,idata,icon):
|
|
64
|
+
currentItem=QTreeWidgetItem(tree)
|
|
65
|
+
tree.addTopLevelItem(currentItem)
|
|
66
|
+
tree.setCurrentItem(currentItem)
|
|
67
|
+
queue.append(currentItem)
|
|
68
|
+
currentItem.setText(0,name)
|
|
69
|
+
currentItem.setSizeHint(0,self.itemSize)
|
|
70
|
+
currentItem.setIcon(0,icon)
|
|
71
|
+
currentItem.setToolTip(0,name)
|
|
72
|
+
currentItem.setStatusTip(0,name)
|
|
73
|
+
currentItem.setFlags(currentItem.flags() | Qt.ItemIsEditable)
|
|
74
|
+
currentItem.setData(0,Qt.UserRole,idata)
|
|
75
|
+
return currentItem
|
|
76
|
+
|
|
77
|
+
def setButtons(self,*args):
|
|
78
|
+
tree: QTreeWidget
|
|
79
|
+
tree=self.ui.tree
|
|
80
|
+
if len(args):
|
|
81
|
+
item=args[0]
|
|
82
|
+
i=tree.indexFromItem(item)
|
|
83
|
+
c=args[1]
|
|
84
|
+
else:
|
|
85
|
+
i=tree.currentIndex().row()
|
|
86
|
+
item=tree.currentItem()
|
|
87
|
+
c=0
|
|
88
|
+
if item==None:
|
|
89
|
+
self.ui.button_down.setEnabled(False)
|
|
90
|
+
self.ui.button_up.setEnabled(False)
|
|
91
|
+
self.ui.button_undo.setVisible(False)
|
|
92
|
+
self.ui.button_delete.setVisible(False)
|
|
93
|
+
self.ui.button_edit.setVisible(False)
|
|
94
|
+
self.ui.button_restore.setVisible(False)
|
|
95
|
+
return
|
|
96
|
+
indItem=tree.indexOfTopLevelItem(tree.currentItem())
|
|
97
|
+
isItemFirst=indItem==0
|
|
98
|
+
isItemLast=indItem==tree.topLevelItemCount()-1
|
|
99
|
+
self.ui.button_down.setEnabled(not isItemLast)
|
|
100
|
+
self.ui.button_up.setEnabled(not isItemFirst)
|
|
101
|
+
flagDeleted=item.font(c).strikeOut()
|
|
102
|
+
self.ui.button_undo.setVisible(item.data(0,Qt.UserRole)!=item.text(0) and not flagDeleted)
|
|
103
|
+
self.ui.button_delete.setVisible(not flagDeleted)
|
|
104
|
+
self.ui.button_edit.setVisible(not flagDeleted)
|
|
105
|
+
self.ui.button_restore.setVisible(flagDeleted)
|
|
106
|
+
|
|
107
|
+
def editItem(self):
|
|
108
|
+
item=self.ui.tree.currentItem()
|
|
109
|
+
self.ui.tree.edit(self.ui.tree.indexFromItem(item))
|
|
110
|
+
|
|
111
|
+
def adjustText(self):
|
|
112
|
+
if self.FlagAdjusting: return
|
|
113
|
+
self.FlagAdjusting=True
|
|
114
|
+
item=self.ui.tree.currentItem()
|
|
115
|
+
newName=item.text(0)
|
|
116
|
+
for i in self.queue:
|
|
117
|
+
if i==item: continue
|
|
118
|
+
if i.data(0,Qt.UserRole)==newName:
|
|
119
|
+
WarningMessage=f'The chosen name "{newName}" is already associated with a custom process. Please, indicate a different name!'
|
|
120
|
+
warningDialog(self,WarningMessage)
|
|
121
|
+
item.setText(0,item.data(0,Qt.UserRole))
|
|
122
|
+
if item.data(0,Qt.UserRole) and item.data(0,Qt.UserRole)!=item.text(0):
|
|
123
|
+
item.setIcon(0,self.ui.button_edit.icon())
|
|
124
|
+
else:
|
|
125
|
+
item.setIcon(0,QIcon())
|
|
126
|
+
self.setButtons()
|
|
127
|
+
self.FlagAdjusting=False
|
|
128
|
+
|
|
129
|
+
def undo(self):
|
|
130
|
+
self.FlagAdjusting=True
|
|
131
|
+
item=self.ui.tree.currentItem()
|
|
132
|
+
item.setText(0,item.data(0,Qt.UserRole))
|
|
133
|
+
item.setIcon(0,QIcon())
|
|
134
|
+
self.setButtons()
|
|
135
|
+
self.FlagAdjusting=False
|
|
136
|
+
|
|
137
|
+
def restoreItem(self):
|
|
138
|
+
self.FlagAdjusting=True
|
|
139
|
+
item=self.ui.tree.currentItem()
|
|
140
|
+
f = item.font(0)
|
|
141
|
+
f.setStrikeOut(False)
|
|
142
|
+
item.setFont(0,f)
|
|
143
|
+
item.setFlags(item.flags() | Qt.ItemIsEditable)
|
|
144
|
+
self.deleted.pop(self.deleted.index(item))
|
|
145
|
+
item.setData(0,Qt.UserRole,item.text(0))
|
|
146
|
+
item.setIcon(0,QIcon())
|
|
147
|
+
self.setButtons()
|
|
148
|
+
self.FlagAdjusting=False
|
|
149
|
+
|
|
150
|
+
def removeItem(self):
|
|
151
|
+
self.FlagAdjusting=True
|
|
152
|
+
item=self.ui.tree.currentItem()
|
|
153
|
+
#item.setFlags(item.flags() | ~Qt.ItemIsEditable)
|
|
154
|
+
f = item.font(0)
|
|
155
|
+
f.setStrikeOut(True)
|
|
156
|
+
item.setFont(0,f)
|
|
157
|
+
item.setText(0,item.data(0,Qt.UserRole))
|
|
158
|
+
item.setData(0,Qt.UserRole,'')
|
|
159
|
+
item.setIcon(0,QIcon())
|
|
160
|
+
item.setFlags(item.flags() & ~QtCore.Qt.ItemIsEditable)
|
|
161
|
+
self.deleted.append(item)
|
|
162
|
+
self.setButtons()
|
|
163
|
+
self.FlagAdjusting=False
|
|
164
|
+
|
|
165
|
+
def save_and_close(self):
|
|
166
|
+
if len(self.deleted):
|
|
167
|
+
WarningMessage="Some items were deleted from the list. The corresponding files will be removed from the disk. This operation is irreversible.\n"+\
|
|
168
|
+
"Do you want to continue?"
|
|
169
|
+
flag=questionDialog(self,WarningMessage)
|
|
170
|
+
else:
|
|
171
|
+
flag=True
|
|
172
|
+
if flag:
|
|
173
|
+
self.FlagAdjusting=True
|
|
174
|
+
for item in self.deleted:
|
|
175
|
+
self.deleteItem(item)
|
|
176
|
+
i=self.queue.index(item)
|
|
177
|
+
self.custom_list.pop(i)
|
|
178
|
+
self.queue.pop(i)
|
|
179
|
+
for item in self.queue:
|
|
180
|
+
self.renameItem(item)
|
|
181
|
+
self.custom_list[self.queue.index(item)]=item.text(0)
|
|
182
|
+
self.saveCustomList()
|
|
183
|
+
self.FlagAdjusting=False
|
|
184
|
+
self.done(1)
|
|
185
|
+
|
|
186
|
+
def deleteItem(self,item):
|
|
187
|
+
filename=pro_path+item.text(0)+outExt.pro
|
|
188
|
+
if os.path.exists(filename):
|
|
189
|
+
os.remove(filename)
|
|
190
|
+
|
|
191
|
+
def renameItem(self,item):
|
|
192
|
+
if item.text(0)==item.data(0,Qt.UserRole) and item.data(0,Qt.UserRole)!='': return
|
|
193
|
+
|
|
194
|
+
filename=pro_path+item.text(0)+outExt.pro
|
|
195
|
+
if not os.path.exists(filename):
|
|
196
|
+
dummyfilename=pro_path+item.text(0)+outExt.dum
|
|
197
|
+
try:
|
|
198
|
+
open(dummyfilename,'w')
|
|
199
|
+
except:
|
|
200
|
+
OptionValidRoot=False
|
|
201
|
+
else:
|
|
202
|
+
OptionValidRoot=True
|
|
203
|
+
finally:
|
|
204
|
+
if os.path.exists(dummyfilename):
|
|
205
|
+
os.remove(dummyfilename)
|
|
206
|
+
else: OptionValidRoot=True
|
|
207
|
+
|
|
208
|
+
if not OptionValidRoot: return
|
|
209
|
+
filename_old=pro_path+item.data(0,Qt.UserRole)+outExt.pro
|
|
210
|
+
if os.path.exists(filename_old):
|
|
211
|
+
os.rename(filename_old,filename)
|
|
212
|
+
item.setData(0,Qt.UserRole,item.text(0))
|
|
213
|
+
|
|
214
|
+
def saveCustomList(self):
|
|
215
|
+
try:
|
|
216
|
+
with open(self.custom_list_file,'w') as file:
|
|
217
|
+
for c in self.custom_list:
|
|
218
|
+
file.write(c+'\n')
|
|
219
|
+
file.close()
|
|
220
|
+
except:
|
|
221
|
+
pri.Error.red(f'Error while trying to save the custom process list: {self.custom_list_file}.\n{traceback.format_exc()}\n')
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def loadPastProc(self,*args):
|
|
225
|
+
if len(args): inpath=args[0]
|
|
226
|
+
else: inpath='./'
|
|
227
|
+
ext_pro=f'*{outExt.min} *{outExt.piv} *.cfg'
|
|
228
|
+
filename, _ = QFileDialog.getOpenFileName(self,\
|
|
229
|
+
"Select an image file of the sequence", filter=ext_pro,\
|
|
230
|
+
dir=inpath,\
|
|
231
|
+
options=optionNativeDialog)
|
|
232
|
+
if not filename: return
|
|
233
|
+
|
|
234
|
+
ext='.'+filename.split('.')[-1]
|
|
235
|
+
if ext in (outExt.min,outExt.piv):
|
|
236
|
+
try:
|
|
237
|
+
with open(filename, 'rb') as file:
|
|
238
|
+
data=pickle.load(file)
|
|
239
|
+
PROpar=data.PRO
|
|
240
|
+
except Exception as inst:
|
|
241
|
+
pri.Error.red(f'Error while loading past process:\n{traceback.format_exc()}\n\n{inst}\n')
|
|
242
|
+
WarningMessage=f'Error while importing {filename}. Perhaps, the file is corrupted.'
|
|
243
|
+
warningDialog(self,WarningMessage)
|
|
244
|
+
return
|
|
245
|
+
elif filename[-4:]=='.cfg':
|
|
246
|
+
try:
|
|
247
|
+
p=PaIRS_lib.PIV()
|
|
248
|
+
p.readCfgProc(filename)
|
|
249
|
+
except Exception as inst:
|
|
250
|
+
pri.Error.red(f'Error while loading the cfg file {filename}:\n{traceback.format_exc()}\n\n{inst}\n')
|
|
251
|
+
errPIVlib='\n'.join(str(inst.args[0]).split('\n')[3:]) #str(inst.__cause__).split('\n')[3] #solved
|
|
252
|
+
WarningMessage=f'Error while importing {filename}:\n{errPIVlib}'
|
|
253
|
+
warningDialog(self,WarningMessage)
|
|
254
|
+
return
|
|
255
|
+
try:
|
|
256
|
+
from .procTools import PIV2Pro
|
|
257
|
+
PROpar=PIV2Pro(p)
|
|
258
|
+
for f in PROpar.fields:
|
|
259
|
+
a=getattr(PROpar,f)
|
|
260
|
+
if type(a)==float:
|
|
261
|
+
setattr(PROpar,f,round(a,4))
|
|
262
|
+
except Exception as inst:
|
|
263
|
+
pri.Error.red(f'Error while loading the cfg file {filename}:\n{traceback.format_exc()}\n\n{inst}\n')
|
|
264
|
+
WarningMessage=f'Error while importing {filename}. Perhaps, the .cfg file does not correspond to a valid PIV process or the file is corrupted.'
|
|
265
|
+
warningDialog(self,WarningMessage)
|
|
266
|
+
return
|
|
267
|
+
else:
|
|
268
|
+
WarningMessage=f'Invalid selected file format ({ext})! Please select one of the following extentions:\n{ext_pro}'
|
|
269
|
+
warningDialog(self,WarningMessage)
|
|
270
|
+
return
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
name=os.path.basename(filename).split('.')[0]
|
|
274
|
+
filename=pro_path+name+outExt.pro
|
|
275
|
+
i=0
|
|
276
|
+
while os.path.exists(filename):
|
|
277
|
+
filename=pro_path+name+f'_{i}{outExt.pro}'
|
|
278
|
+
i+=1
|
|
279
|
+
if i: name+=f'_{i-1}'
|
|
280
|
+
|
|
281
|
+
PROpar.top=0
|
|
282
|
+
PROpar.FlagCustom=False
|
|
283
|
+
PROpar.name=name
|
|
284
|
+
try:
|
|
285
|
+
with open(filename,'wb') as file:
|
|
286
|
+
pickle.dump(PROpar,file)
|
|
287
|
+
pri.Info.blue(f'Saving custom process file {filename}')
|
|
288
|
+
self.createItemInTree(self.ui.tree,self.queue,name,name,QIcon())
|
|
289
|
+
self.custom_list.append(name)
|
|
290
|
+
except Exception as inst:
|
|
291
|
+
pri.Error.red(f'Error while saving custom process file {filename}:\n{traceback.format_exc()}\n\n{inst}')
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
if __name__ == "__main__":
|
|
297
|
+
import sys
|
|
298
|
+
app=QApplication.instance()
|
|
299
|
+
if not app:app = QApplication(sys.argv)
|
|
300
|
+
app.setStyle('Fusion')
|
|
301
|
+
object = Custom_Top()
|
|
302
|
+
object.exec()
|
|
303
|
+
#app.exec()
|