PaIRS-UniNa 0.1.13__cp310-cp310-win_amd64.whl → 0.2.8__cp310-cp310-win_amd64.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 (292) hide show
  1. PaIRS_UniNa/Calibration_Tab.py +331 -0
  2. PaIRS_UniNa/Changes.txt +134 -2
  3. PaIRS_UniNa/Custom_Top.py +299 -299
  4. PaIRS_UniNa/Explorer.py +3136 -0
  5. PaIRS_UniNa/FolderLoop.py +562 -0
  6. PaIRS_UniNa/Input_Tab.py +831 -0
  7. PaIRS_UniNa/Input_Tab_CalVi.py +786 -0
  8. PaIRS_UniNa/Input_Tab_tools.py +3025 -0
  9. PaIRS_UniNa/Log_Tab.py +57 -14
  10. PaIRS_UniNa/Output_Tab.py +922 -0
  11. PaIRS_UniNa/PaIRS_PIV.py +111 -18
  12. PaIRS_UniNa/PaIRS_pypacks.py +698 -140
  13. PaIRS_UniNa/Process_Tab.py +1221 -1402
  14. PaIRS_UniNa/Process_Tab_CalVi.py +137 -262
  15. PaIRS_UniNa/Process_Tab_Disp.py +163 -0
  16. PaIRS_UniNa/Process_Tab_Min.py +120 -0
  17. PaIRS_UniNa/Saving_tools.py +296 -0
  18. PaIRS_UniNa/TabTools.py +863 -543
  19. PaIRS_UniNa/Vis_Tab.py +1898 -1315
  20. PaIRS_UniNa/Vis_Tab_CalVi.py +484 -356
  21. PaIRS_UniNa/Whatsnew.py +59 -10
  22. PaIRS_UniNa/_PaIRS_PIV.pyd +0 -0
  23. PaIRS_UniNa/__init__.py +4 -3
  24. PaIRS_UniNa/addwidgets_ps.py +326 -56
  25. PaIRS_UniNa/calib.py +19 -12
  26. PaIRS_UniNa/calibView.py +48 -25
  27. PaIRS_UniNa/gPaIRS.py +3902 -3461
  28. PaIRS_UniNa/gPalette.py +189 -170
  29. PaIRS_UniNa/icons/align_all.png +0 -0
  30. PaIRS_UniNa/icons/announcement.png +0 -0
  31. PaIRS_UniNa/icons/automatic_levels_off.png +0 -0
  32. PaIRS_UniNa/icons/automatic_levels_on.png +0 -0
  33. PaIRS_UniNa/icons/automatic_off.png +0 -0
  34. PaIRS_UniNa/icons/automatic_on.png +0 -0
  35. PaIRS_UniNa/icons/automatic_size_off.png +0 -0
  36. PaIRS_UniNa/icons/automatic_size_on.png +0 -0
  37. PaIRS_UniNa/icons/bin_off.png +0 -0
  38. PaIRS_UniNa/icons/bin_on.png +0 -0
  39. PaIRS_UniNa/icons/brush_cursor.png +0 -0
  40. PaIRS_UniNa/icons/bugfix.png +0 -0
  41. PaIRS_UniNa/icons/cal_proc.png +0 -0
  42. PaIRS_UniNa/icons/cal_proc_off.png +0 -0
  43. PaIRS_UniNa/icons/cal_step.png +0 -0
  44. PaIRS_UniNa/icons/cal_step_off.png +0 -0
  45. PaIRS_UniNa/icons/calibration_logo.png +0 -0
  46. PaIRS_UniNa/icons/change_folder.png +0 -0
  47. PaIRS_UniNa/icons/change_folder_off.png +0 -0
  48. PaIRS_UniNa/icons/close_all.png +0 -0
  49. PaIRS_UniNa/icons/close_workspace.png +0 -0
  50. PaIRS_UniNa/icons/colormap.png +0 -0
  51. PaIRS_UniNa/icons/colormaps/Accent.png +0 -0
  52. PaIRS_UniNa/icons/colormaps/BrBG.png +0 -0
  53. PaIRS_UniNa/icons/colormaps/Dark2.png +0 -0
  54. PaIRS_UniNa/icons/colormaps/PRGn.png +0 -0
  55. PaIRS_UniNa/icons/colormaps/Paired.png +0 -0
  56. PaIRS_UniNa/icons/colormaps/Pastel1.png +0 -0
  57. PaIRS_UniNa/icons/colormaps/Pastel2.png +0 -0
  58. PaIRS_UniNa/icons/colormaps/PiYG.png +0 -0
  59. PaIRS_UniNa/icons/colormaps/PuOr.png +0 -0
  60. PaIRS_UniNa/icons/colormaps/RdBu.png +0 -0
  61. PaIRS_UniNa/icons/colormaps/RdGy.png +0 -0
  62. PaIRS_UniNa/icons/colormaps/RdYlBu.png +0 -0
  63. PaIRS_UniNa/icons/colormaps/RdYlGn.png +0 -0
  64. PaIRS_UniNa/icons/colormaps/Set1.png +0 -0
  65. PaIRS_UniNa/icons/colormaps/Set2.png +0 -0
  66. PaIRS_UniNa/icons/colormaps/Set3.png +0 -0
  67. PaIRS_UniNa/icons/colormaps/Spectral.png +0 -0
  68. PaIRS_UniNa/icons/colormaps/Wistia.png +0 -0
  69. PaIRS_UniNa/icons/colormaps/afmhot.png +0 -0
  70. PaIRS_UniNa/icons/colormaps/autumn.png +0 -0
  71. PaIRS_UniNa/icons/colormaps/binary.png +0 -0
  72. PaIRS_UniNa/icons/colormaps/blackVector.png +0 -0
  73. PaIRS_UniNa/icons/colormaps/blueVector.png +0 -0
  74. PaIRS_UniNa/icons/colormaps/bone.png +0 -0
  75. PaIRS_UniNa/icons/colormaps/brg.png +0 -0
  76. PaIRS_UniNa/icons/colormaps/bwr.png +0 -0
  77. PaIRS_UniNa/icons/colormaps/cividis.png +0 -0
  78. PaIRS_UniNa/icons/colormaps/cool.png +0 -0
  79. PaIRS_UniNa/icons/colormaps/coolwarm.png +0 -0
  80. PaIRS_UniNa/icons/colormaps/copper.png +0 -0
  81. PaIRS_UniNa/icons/colormaps/cubehelix.png +0 -0
  82. PaIRS_UniNa/icons/colormaps/cyanVector.png +0 -0
  83. PaIRS_UniNa/icons/colormaps/flag.png +0 -0
  84. PaIRS_UniNa/icons/colormaps/gist_heat.png +0 -0
  85. PaIRS_UniNa/icons/colormaps/gray.png +0 -0
  86. PaIRS_UniNa/icons/colormaps/greenVector.png +0 -0
  87. PaIRS_UniNa/icons/colormaps/hot.png +0 -0
  88. PaIRS_UniNa/icons/colormaps/hsv.png +0 -0
  89. PaIRS_UniNa/icons/colormaps/inferno.png +0 -0
  90. PaIRS_UniNa/icons/colormaps/jet.png +0 -0
  91. PaIRS_UniNa/icons/colormaps/magentaVector.png +0 -0
  92. PaIRS_UniNa/icons/colormaps/magma.png +0 -0
  93. PaIRS_UniNa/icons/colormaps/ocean.png +0 -0
  94. PaIRS_UniNa/icons/colormaps/pink.png +0 -0
  95. PaIRS_UniNa/icons/colormaps/plasma.png +0 -0
  96. PaIRS_UniNa/icons/colormaps/prism.png +0 -0
  97. PaIRS_UniNa/icons/colormaps/rainbow.png +0 -0
  98. PaIRS_UniNa/icons/colormaps/redVector.png +0 -0
  99. PaIRS_UniNa/icons/colormaps/seismic.png +0 -0
  100. PaIRS_UniNa/icons/colormaps/spring.png +0 -0
  101. PaIRS_UniNa/icons/colormaps/summer.png +0 -0
  102. PaIRS_UniNa/icons/colormaps/tab10.png +0 -0
  103. PaIRS_UniNa/icons/colormaps/tab20.png +0 -0
  104. PaIRS_UniNa/icons/colormaps/tab20b.png +0 -0
  105. PaIRS_UniNa/icons/colormaps/tab20c.png +0 -0
  106. PaIRS_UniNa/icons/colormaps/terrain.png +0 -0
  107. PaIRS_UniNa/icons/colormaps/twilight.png +0 -0
  108. PaIRS_UniNa/icons/colormaps/viridis.png +0 -0
  109. PaIRS_UniNa/icons/colormaps/whiteVector.png +0 -0
  110. PaIRS_UniNa/icons/colormaps/winter.png +0 -0
  111. PaIRS_UniNa/icons/colormaps/yellowVector.png +0 -0
  112. PaIRS_UniNa/icons/common_region.png +0 -0
  113. PaIRS_UniNa/icons/common_region_off.png +0 -0
  114. PaIRS_UniNa/icons/completed.png +0 -0
  115. PaIRS_UniNa/icons/contourf_off.png +0 -0
  116. PaIRS_UniNa/icons/contourf_on.png +0 -0
  117. PaIRS_UniNa/icons/copy.png +0 -0
  118. PaIRS_UniNa/icons/copy_process.png +0 -0
  119. PaIRS_UniNa/icons/copy_process_off.png +0 -0
  120. PaIRS_UniNa/icons/cut.png +0 -0
  121. PaIRS_UniNa/icons/cut_warnings.png +0 -0
  122. PaIRS_UniNa/icons/darkmode.png +0 -0
  123. PaIRS_UniNa/icons/disp_step.png +0 -0
  124. PaIRS_UniNa/icons/disp_step_off.png +0 -0
  125. PaIRS_UniNa/icons/edit_list.png +0 -0
  126. PaIRS_UniNa/icons/example_list.png +0 -0
  127. PaIRS_UniNa/icons/flaticon_PaIRS_beta.png +0 -0
  128. PaIRS_UniNa/icons/flaticon_PaIRS_download_warning.png +0 -0
  129. PaIRS_UniNa/icons/flip_y_off.png +0 -0
  130. PaIRS_UniNa/icons/flip_y_on.png +0 -0
  131. PaIRS_UniNa/icons/folder_loop_cleanup.png +0 -0
  132. PaIRS_UniNa/icons/folder_loop_cleanup_off.png +0 -0
  133. PaIRS_UniNa/icons/gear.gif +0 -0
  134. PaIRS_UniNa/icons/gear.png +0 -0
  135. PaIRS_UniNa/icons/import_set.png +0 -0
  136. PaIRS_UniNa/icons/information.png +0 -0
  137. PaIRS_UniNa/icons/input_logo.png +0 -0
  138. PaIRS_UniNa/icons/issue.png +0 -0
  139. PaIRS_UniNa/icons/laser_NTR.png +0 -0
  140. PaIRS_UniNa/icons/laser_TR_double.png +0 -0
  141. PaIRS_UniNa/icons/laser_TR_single.png +0 -0
  142. PaIRS_UniNa/icons/link.png +0 -0
  143. PaIRS_UniNa/icons/linked.png +0 -0
  144. PaIRS_UniNa/icons/log_logo.png +0 -0
  145. PaIRS_UniNa/icons/logo_opaco.png +0 -0
  146. PaIRS_UniNa/icons/measure.png +0 -0
  147. PaIRS_UniNa/icons/measure_off.png +0 -0
  148. PaIRS_UniNa/icons/min_proc.png +0 -0
  149. PaIRS_UniNa/icons/min_proc_off.png +0 -0
  150. PaIRS_UniNa/icons/min_step.png +0 -0
  151. PaIRS_UniNa/icons/min_step_off.png +0 -0
  152. PaIRS_UniNa/icons/new_workspace.png +0 -0
  153. PaIRS_UniNa/icons/open_image.png +0 -0
  154. PaIRS_UniNa/icons/open_new_window.png +0 -0
  155. PaIRS_UniNa/icons/open_result.png +0 -0
  156. PaIRS_UniNa/icons/open_workspace.png +0 -0
  157. PaIRS_UniNa/icons/output_logo.png +0 -0
  158. PaIRS_UniNa/icons/paste_above.png +0 -0
  159. PaIRS_UniNa/icons/paste_below.png +0 -0
  160. PaIRS_UniNa/icons/paused.png +0 -0
  161. PaIRS_UniNa/icons/piv_proc.png +0 -0
  162. PaIRS_UniNa/icons/piv_proc_off.png +0 -0
  163. PaIRS_UniNa/icons/piv_step.png +0 -0
  164. PaIRS_UniNa/icons/piv_step_off.png +0 -0
  165. PaIRS_UniNa/icons/process_logo.png +0 -0
  166. PaIRS_UniNa/icons/process_loop.png +0 -0
  167. PaIRS_UniNa/icons/project.png +0 -0
  168. PaIRS_UniNa/icons/pylog.png +0 -0
  169. PaIRS_UniNa/icons/python_warning.png +0 -0
  170. PaIRS_UniNa/icons/queue.png +0 -0
  171. PaIRS_UniNa/icons/read.png +0 -0
  172. PaIRS_UniNa/icons/read_list.png +0 -0
  173. PaIRS_UniNa/icons/reset.png +0 -0
  174. PaIRS_UniNa/icons/reset_levels.png +0 -0
  175. PaIRS_UniNa/icons/restore_undo.png +0 -0
  176. PaIRS_UniNa/icons/running.gif +0 -0
  177. PaIRS_UniNa/icons/running.png +0 -0
  178. PaIRS_UniNa/icons/running_warn.png +0 -0
  179. PaIRS_UniNa/icons/save_and_stop.png +0 -0
  180. PaIRS_UniNa/icons/save_cfg.png +0 -0
  181. PaIRS_UniNa/icons/saveas_workspace.png +0 -0
  182. PaIRS_UniNa/icons/scale_all.png +0 -0
  183. PaIRS_UniNa/icons/scale_down.png +0 -0
  184. PaIRS_UniNa/icons/scale_up.png +0 -0
  185. PaIRS_UniNa/icons/scan_list.png +0 -0
  186. PaIRS_UniNa/icons/scan_path.png +0 -0
  187. PaIRS_UniNa/icons/scan_path_loop.png +0 -0
  188. PaIRS_UniNa/icons/scan_path_loop_off.png +0 -0
  189. PaIRS_UniNa/icons/search.png +0 -0
  190. PaIRS_UniNa/icons/showIW_off.png +0 -0
  191. PaIRS_UniNa/icons/showIW_on.png +0 -0
  192. PaIRS_UniNa/icons/show_all.png +0 -0
  193. PaIRS_UniNa/icons/sort.png +0 -0
  194. PaIRS_UniNa/icons/sort_reversed.png +0 -0
  195. PaIRS_UniNa/icons/spiv_proc.png +0 -0
  196. PaIRS_UniNa/icons/spiv_proc_off.png +0 -0
  197. PaIRS_UniNa/icons/star.png +0 -0
  198. PaIRS_UniNa/icons/step_inheritance.png +0 -0
  199. PaIRS_UniNa/icons/subMIN_off.png +0 -0
  200. PaIRS_UniNa/icons/subMIN_on.png +0 -0
  201. PaIRS_UniNa/icons/unedited.png +0 -0
  202. PaIRS_UniNa/icons/uninitialized.png +0 -0
  203. PaIRS_UniNa/icons/unlink.png +0 -0
  204. PaIRS_UniNa/icons/unwrap_items.png +0 -0
  205. PaIRS_UniNa/icons/vectorColor.png +0 -0
  206. PaIRS_UniNa/icons/view.png +0 -0
  207. PaIRS_UniNa/icons/view_off.png +0 -0
  208. PaIRS_UniNa/icons/vis_logo.png +0 -0
  209. PaIRS_UniNa/icons/warning_circle.png +0 -0
  210. PaIRS_UniNa/icons/window.png +0 -0
  211. PaIRS_UniNa/icons/workspace.png +0 -0
  212. PaIRS_UniNa/icons/wrap_items.png +0 -0
  213. PaIRS_UniNa/icons/write_list.png +0 -0
  214. PaIRS_UniNa/listLib.py +303 -0
  215. PaIRS_UniNa/mtfPIV.py +8 -8
  216. PaIRS_UniNa/parForMulti.py +7 -5
  217. PaIRS_UniNa/parForWorkers.py +370 -31
  218. PaIRS_UniNa/pivParFor.py +233 -229
  219. PaIRS_UniNa/plt_util.py +141 -141
  220. PaIRS_UniNa/preProcParFor.py +153 -148
  221. PaIRS_UniNa/procTools.py +631 -178
  222. PaIRS_UniNa/readcfg.py +31 -1
  223. PaIRS_UniNa/rqrdpckgs.txt +9 -0
  224. PaIRS_UniNa/stereoPivParFor.py +227 -0
  225. PaIRS_UniNa/tAVarie.py +215 -215
  226. PaIRS_UniNa/tabSplitter.py +612 -0
  227. PaIRS_UniNa/ui_Calibration_Tab.py +545 -0
  228. PaIRS_UniNa/ui_Custom_Top.py +5 -5
  229. PaIRS_UniNa/ui_Input_Tab.py +1101 -0
  230. PaIRS_UniNa/{ui_Import_Tab_CalVi.py → ui_Input_Tab_CalVi.py} +1282 -1275
  231. PaIRS_UniNa/ui_Log_Tab.py +262 -257
  232. PaIRS_UniNa/{ui_Export_Tab.py → ui_Output_Tab.py} +2361 -1778
  233. PaIRS_UniNa/ui_Process_Tab.py +3809 -3758
  234. PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1546
  235. PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
  236. PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
  237. PaIRS_UniNa/ui_Vis_Tab.py +1626 -1208
  238. PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
  239. PaIRS_UniNa/ui_Whatsnew.py +131 -131
  240. PaIRS_UniNa/ui_gPairs.py +876 -950
  241. PaIRS_UniNa/ui_infoPaIRS.py +550 -425
  242. PaIRS_UniNa/whatsnew.txt +6 -4
  243. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/METADATA +69 -51
  244. pairs_unina-0.2.8.dist-info/RECORD +329 -0
  245. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/WHEEL +1 -1
  246. PaIRS_UniNa/CalVi.py +0 -18
  247. PaIRS_UniNa/Export_Tab.py +0 -574
  248. PaIRS_UniNa/Import_Tab.py +0 -657
  249. PaIRS_UniNa/Import_Tab_CalVi.py +0 -861
  250. PaIRS_UniNa/Import_Tab_tools.py +0 -598
  251. PaIRS_UniNa/Tree_Tab.py +0 -543
  252. PaIRS_UniNa/gCalVi.py +0 -2024
  253. PaIRS_UniNa/icons/add.png +0 -0
  254. PaIRS_UniNa/icons/cancelled.png +0 -0
  255. PaIRS_UniNa/icons/chain.png +0 -0
  256. PaIRS_UniNa/icons/chain_broken.png +0 -0
  257. PaIRS_UniNa/icons/default_sizes.png +0 -0
  258. PaIRS_UniNa/icons/dock_tabs.png +0 -0
  259. PaIRS_UniNa/icons/done.png +0 -0
  260. PaIRS_UniNa/icons/down_arrow.png +0 -0
  261. PaIRS_UniNa/icons/export_logo.png +0 -0
  262. PaIRS_UniNa/icons/fast_delete.png +0 -0
  263. PaIRS_UniNa/icons/flip_y.png +0 -0
  264. PaIRS_UniNa/icons/ganci.png +0 -0
  265. PaIRS_UniNa/icons/import_blue.png +0 -0
  266. PaIRS_UniNa/icons/import_logo.png +0 -0
  267. PaIRS_UniNa/icons/missing.png +0 -0
  268. PaIRS_UniNa/icons/process_icon.png +0 -0
  269. PaIRS_UniNa/icons/processing.png +0 -0
  270. PaIRS_UniNa/icons/restart.png +0 -0
  271. PaIRS_UniNa/icons/right_arrow.png +0 -0
  272. PaIRS_UniNa/icons/run_piv.png +0 -0
  273. PaIRS_UniNa/icons/terminal.png +0 -0
  274. PaIRS_UniNa/icons/undock_tabs.png +0 -0
  275. PaIRS_UniNa/icons/vect_field.png +0 -0
  276. PaIRS_UniNa/icons/w0.png +0 -0
  277. PaIRS_UniNa/icons/w1.png +0 -0
  278. PaIRS_UniNa/icons/w2.png +0 -0
  279. PaIRS_UniNa/icons/w3.png +0 -0
  280. PaIRS_UniNa/icons/w4.png +0 -0
  281. PaIRS_UniNa/icons/w5.png +0 -0
  282. PaIRS_UniNa/run_CalVi.py +0 -14
  283. PaIRS_UniNa/run_gcalvi.py +0 -5
  284. PaIRS_UniNa/ui_Import_Tab.py +0 -1077
  285. PaIRS_UniNa/ui_Tree_Tab.py +0 -684
  286. PaIRS_UniNa/ui_gCalVi.py +0 -640
  287. PaIRS_UniNa/ui_infoCalVi.py +0 -428
  288. PaIRS_UniNa-0.1.13.dist-info/LICENSE +0 -19
  289. PaIRS_UniNa-0.1.13.dist-info/RECORD +0 -174
  290. /PaIRS_UniNa/icons/{clean_queue.png → clean.png} +0 -0
  291. /PaIRS_UniNa/icons/{waiting_c.png → sandglass.png} +0 -0
  292. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/Tree_Tab.py DELETED
@@ -1,543 +0,0 @@
1
- from .PaIRS_pypacks import *
2
- from .ui_Tree_Tab import*
3
- from .TabTools import*
4
- from .procTools import dataTreePar
5
-
6
- class TREpar(TABpar):
7
- def __init__(self):
8
- self.setup()
9
- super().__init__()
10
- self.name='TREpar'
11
- self.surname='QUEUE_Tab'
12
- self.unchecked_fields+=self.fields
13
-
14
- def setup(self):
15
- self.indTree = 0
16
- #these lists are called queues
17
- self.past = []
18
- self.current = []
19
- self.future = []
20
- class Tree_Tab(gPaIRS_Tab):
21
-
22
- class Tree_Tab_Signals(gPaIRS_Tab.Tab_Signals):
23
- selection=Signal(int,int,QTreeWidgetItem,int)
24
- def __init__(self, parent):
25
- super().__init__(parent)
26
-
27
- def __init__(self,*args):
28
- parent=None
29
- flagInit=True
30
- if len(args): parent=args[0]
31
- if len(args)>1: flagInit=args[1]
32
- super().__init__(parent,Ui_TreeTab,dataTreePar)
33
- self.signals=self.Tree_Tab_Signals(self)
34
-
35
- #------------------------------------- Graphical interface: widgets
36
- self.ui: Ui_TreeTab
37
- ui=self.ui
38
- #tree are the real widgets, queues are the lists of their items
39
- ui.tree_past.clear()
40
- ui.tree_current.clear()
41
- ui.tree_future.clear()
42
-
43
- self.setupWid() #---------------- IMPORTANT
44
-
45
- #------------------------------------- Graphical interface: miscellanea
46
- self.Tree_icons=TREico()
47
-
48
- self.icon_add=QIcon()
49
- self.icon_add.addFile(u""+ icons_path +"add.png", QSize(), QIcon.Normal, QIcon.Off)
50
- self.icon_run_piv=QIcon()
51
- self.icon_run_piv.addFile(u""+ icons_path +"run_piv.png", QSize(), QIcon.Normal, QIcon.Off)
52
-
53
- self.icon_delete= QIcon()
54
- self.icon_delete.addFile(u""+ icons_path +"delete.png", QSize(), QIcon.Normal, QIcon.Off)
55
- self.icon_fast_delete= QIcon()
56
- self.icon_fast_delete.addFile(u""+ icons_path +"fast_delete.png", QSize(), QIcon.Normal, QIcon.Off)
57
-
58
- self.itemSize=self.ui.tree_current.size()-QSize(0,4)
59
- self.TreeNames=['tree_past','tree_current','tree_future']
60
- self.QueueNames=['past','current','future']
61
-
62
- #------------------------------------- Declaration of parameters
63
- self.TREpar=TREpar()
64
- self.TREpar_base=TREpar()
65
-
66
- self.TREselect_fun=lambda iTold,iT,t,i,c: None
67
- self.addNewItem2Prevs=lambda iT,iIt: None
68
- self.addExistingItem2Prevs=lambda iTold,iItold,iT,iIt: None
69
- self.removeItemFromPrevs=lambda iT,iIt: None
70
- self.moveupdownPrevs=lambda iT,iIt,d: None
71
-
72
- #------------------------------------- Callbacks
73
- self.setupCallbacks()
74
- self.FlagNoWrapper=True
75
-
76
- #------------------------------------- Initializing
77
- #for c in self.findChildren(QPushButton)+self.findChildren(QToolButton):
78
- # if c in (self.ui.button_min,self.ui.button_PIV,self.ui.button_import_past): continue
79
- # c.hide()
80
-
81
- if flagInit:
82
- self.initialize()
83
-
84
- def initialize(self):
85
- self.clearAllTimes()
86
- self.addNewItem2TreeQueue(0,"current",QIcon())
87
- self.setExample()
88
- self.checkButtons()
89
-
90
- def setupCallbacks(self):
91
- ui=self.ui
92
- ui.tree_past.itemClicked.connect(lambda i,c: self.addParWrapper(self.selectItem(ui.tree_past,i,c),'Past tree selection'))
93
- ui.tree_current.itemClicked.connect(lambda i,c: self.addParWrapper(self.selectItem(ui.tree_current,i,c),'Current tree selection'))
94
- ui.tree_future.itemClicked.connect(lambda i,c: self.addParWrapper(self.selectItem(ui.tree_future,i,c),'Future tree selection'))
95
-
96
- ui.button_delete_future_callback=ui.button_delete_past_callback=self.addParWrapper(self.removeFromCurrentTree,'Button delete')
97
- ui.button_delete_past.clicked.connect(ui.button_delete_past_callback)
98
- ui.button_delete_future.clicked.connect(ui.button_delete_future_callback)
99
- self.setFastDelete(False)
100
-
101
- ui.button_restore_callback=self.addParWrapper(self.restoreItemFromTree,'Button restore')
102
- ui.button_restore.clicked.connect(ui.button_restore_callback)
103
-
104
- ui.button_clean_past_callback=self.addParWrapper(lambda: self.cleanTreeQueue(-1),'Button clean')
105
- ui.button_clean_past.clicked.connect(ui.button_clean_past_callback)
106
- ui.button_clean_future_callback=self.addParWrapper(lambda: self.cleanTreeQueue(+1),'Button clean')
107
- ui.button_clean_future.clicked.connect(ui.button_clean_future_callback)
108
- ui.button_clean_past.setVisible(True)
109
- ui.button_clean_future.setVisible(True)
110
-
111
- ui.tree_past.addfuncshift_pressed['func']=self.addParWrapper(lambda: self.setFastDelete(True),'Tree: input from keyboard')
112
- ui.tree_past.addfuncshift_released['func']=self.addParWrapper(lambda: self.setFastDelete(False),'Tree: input from keyboard')
113
-
114
- ui.tree_past.addfuncout['func']=self.addParWrapper(lambda: self.setFastDelete(False),'Tree: input from keyboard')
115
- ui.tree_past.addfuncin['func']=self.addParWrapper(lambda: self.setFastDelete_FocusIn(),'Tree: input from keyboard')
116
-
117
- #ui.tree_past.addfuncdel_pressed['func']=self.addParWrapper(lambda: self.removeFromCurrentTree(),'Tree: input from keyboard')
118
- #ui.tree_past.addfunckey_pressed['func']=lambda k: self.addParWrapper(self.keyCallbacks(k),'Tree: input from keyboard')
119
- #ui.tree_future.addfuncdel_pressed['func']=self.addParWrapper(lambda: self.removeFromCurrentTree(),'Tree: input from keyboard')
120
- #ui.tree_future.addfunckey_pressed['func']=lambda k: self.addParWrapper(self.keyCallbacks(k),'Tree: input from keyboard')
121
-
122
- ui.tree_past.addfuncarrows_pressed['func']=lambda k: self.addParWrapper(self.movingAcrossTrees(k),'Tree: input from keyboard')
123
- ui.tree_current.addfuncarrows_pressed['func']=lambda k: self.addParWrapper(self.movingAcrossTrees(k),'Tree: input from keyboard')
124
- ui.tree_future.addfuncarrows_pressed['func']=lambda k: self.addParWrapper(self.movingAcrossTrees(k),'Tree: input from keyboard')
125
-
126
- ui.button_up_past_callback=self.addParWrapper(lambda: self.moveupdown(-1),'Move past item up')
127
- ui.button_down_past_callback=self.addParWrapper(lambda: self.moveupdown(+1),'Move past item down')
128
- ui.button_up_future_callback=self.addParWrapper(lambda: self.moveupdown(-1),'Move future item up')
129
- ui.button_down_future_callback=self.addParWrapper(lambda: self.moveupdown(+1),'Move future item down')
130
- ui.button_up_past.clicked.connect(ui.button_up_past_callback)
131
- ui.button_down_past.clicked.connect(ui.button_down_past_callback)
132
- ui.button_up_future.clicked.connect(ui.button_up_future_callback)
133
- ui.button_down_future.clicked.connect(ui.button_down_future_callback)
134
-
135
- ui.tree_past.contextMenuEvent=lambda e: self.treeContextMenuEvent(ui.tree_past,e)
136
- ui.tree_current.contextMenuEvent=lambda e: self.treeContextMenuEvent(ui.tree_current,e)
137
- ui.tree_future.contextMenuEvent=lambda e: self.treeContextMenuEvent(ui.tree_future,e)
138
-
139
- def treeContextMenuEvent(self, tree:myQTreeWidget, event):
140
- item=tree.currentItem()
141
- if not item: return
142
- self.selectItem(tree,item,0)
143
- menu=QMenu(tree)
144
- buttons_in_past=['up_past','down_past',
145
- -1,'import_past',
146
- -1,'restore','delete_past','clean_past',
147
- -1,'min','PIV']
148
- buttons_in_current=['min','PIV']
149
- buttons_in_future=['up_future','down_future',
150
- -1,'edit_item',
151
- -1,'delete_future','clean_future',
152
- -1,'min','PIV']
153
- buttons=[buttons_in_past,buttons_in_current,buttons_in_future]
154
- name=[]
155
- act=[]
156
- fun=[]
157
- for k,nb in enumerate(buttons[self.TREpar.indTree+1]):
158
- if type(nb)==str:
159
- b:QPushButton=getattr(self.ui,'button_'+nb)
160
- if b.isVisible() and b.isEnabled():
161
- if hasattr(self.ui,'button_'+nb+'_callback'):
162
- name.append(nb)
163
- act.append(QAction(b.icon(),toPlainText(b.toolTip().split('.')[0]),tree))
164
- menu.addAction(act[-1])
165
- callback=getattr(self.ui,'button_'+nb+'_callback')
166
- fun.append(callback)
167
- else:
168
- if len(act): menu.addSeparator()
169
-
170
- if len(act):
171
- pri.Callback.yellow(f'||| Opening {self.QueueNames[self.TREpar.indTree]} tree item context menu |||')
172
- action = menu.exec_(tree.mapToGlobal(event.pos()))
173
- flag=False
174
- for nb,a,f in zip(name,act,fun):
175
- if a==action:
176
- if nb=='edit_item':
177
- self.ui.button_edit_item.setChecked(not self.ui.button_edit_item.isChecked())
178
- f()
179
- flag=True
180
- if not flag:
181
- self.focusOnTree(tree)
182
- else:
183
- toolTip=item.toolTip(0)
184
- item.setToolTip(0,'')
185
-
186
- message='No context menu available! Please, pause processing.'
187
- tip=QToolTip(self)
188
- toolTipDuration=self.toolTipDuration()
189
- self.setToolTipDuration(3000)
190
- tip.showText(QCursor.pos(),message)
191
- self.setToolTipDuration(toolTipDuration)
192
-
193
- item.setToolTip(0,toolTip)
194
-
195
- #*************************************************** Selection
196
- def pickTree(self,ind_name):
197
- if type(ind_name)==str: name=ind_name
198
- else: name=self.QueueNames[ind_name+1]
199
- tree=getattr(self.ui,'tree_'+name)
200
- queue=getattr(self.TREpar,name)
201
- return tree, queue
202
-
203
- def selectTree(self,ind_name,*args):
204
- tree,queue=self.pickTree(ind_name)
205
- l=len(queue)
206
- if not l: return
207
- if len(args):
208
- indItem=min([args[0],l-1])
209
- else: indItem=-1
210
- tree: QTreeWidget
211
- self.selectItem(tree,queue[indItem],0)
212
-
213
- def selectPast(self,*args):
214
- self.selectTree(-1,*args)
215
-
216
- def selectCurrent(self,*args):
217
- self.selectTree(0,*args)
218
-
219
- def selectFuture(self,*args):
220
- self.selectTree(1,*args)
221
-
222
- def selectItem(self,tree,item,column):
223
- #args[0]=queue_prev
224
- indTree_old=self.TREpar.indTree
225
- self.focusOnTree(tree)
226
- tree.setCurrentItem(item)
227
- self.checkButtons()
228
-
229
- def focusOnTree(self,tree):
230
- if type(tree)==int: #tree=-1,0,1
231
- indTree=tree
232
- elif type(tree)==str: #tree='past','current','future'
233
- indTree=self.TreeNames.index(tree)
234
- else:
235
- indTree=self.TreeNames.index(tree.objectName())
236
- for it,tname in enumerate(self.TreeNames):
237
- t=getattr(self.ui,tname)
238
- if it==indTree:
239
- t.setFocus()
240
- else:
241
- t.setCurrentItem(QTreeWidgetItem())
242
- self.TREpar.indTree=indTree-1
243
-
244
- def checkButtons(self):
245
- _,queue=self.pickTree(self.TREpar.indTree)
246
- if len(queue):
247
- self.setButtons()
248
- else:
249
- self.selectCurrent() #comes back to checkButtons recursively
250
-
251
- def setButtons(self,FlagRun=False):
252
- tree: QTreeWidget
253
- indTree=self.TREpar.indTree
254
- tree,queue=self.pickTree(indTree)
255
- indItem=tree.indexOfTopLevelItem(tree.currentItem())
256
- isItemFirst=indItem==0
257
- isItemLast=indItem==len(queue)-1
258
-
259
- Flag=indTree==-1
260
- self.ui.button_down_past.setEnabled(Flag and not isItemLast)
261
- self.ui.button_up_past.setEnabled(Flag and not isItemFirst)
262
- self.ui.button_restore.setEnabled(Flag)
263
- self.ui.button_delete_past.setEnabled(Flag)
264
- self.ui.button_clean_past.setEnabled(len(self.TREpar.past)>0)
265
-
266
- Flag=indTree==1 and not FlagRun
267
- self.ui.button_down_future.setEnabled(Flag and not isItemLast)
268
- self.ui.button_up_future.setEnabled(Flag and not isItemFirst)
269
- self.ui.button_edit_item.setEnabled(Flag)
270
- self.ui.button_delete_future.setEnabled(Flag)
271
- self.ui.button_clean_future.setEnabled(not FlagRun and len(self.TREpar.future)>0)
272
-
273
- def hideButtons(self):
274
- self.TREpar.indTree=-2
275
- self.checkButtons()
276
-
277
- def moveupdown(self,d):
278
- tree: QTreeWidget
279
- queue: list
280
- indTree=self.TREpar.indTree
281
- tree,queue=self.pickTree(indTree)
282
- indItem=tree.indexOfTopLevelItem(tree.currentItem())
283
- item=queue[indItem]
284
- tree.takeTopLevelItem(indItem)
285
- tree.insertTopLevelItem(indItem+d,item)
286
- queue.insert(indItem+d,queue.pop(indItem))
287
- #del queue[indItem]
288
- #queue.insert(indItem+d,item)
289
- for k in range(min([indItem+d,indItem]),len(queue)):
290
- i=queue[k]
291
- i.data(0,Qt.UserRole).indItem=k
292
- tree.setCurrentItem(item)
293
- self.checkButtons()
294
- self.moveupdownPrevs(indTree,indItem,d)
295
-
296
-
297
- #*************************************************** Addition
298
- def createItemInTree(self,tree,queue,name,idata,icon):
299
- currentItem=QTreeWidgetItem(tree)
300
- currentItem.setText(0,name)
301
- currentItem.setData(0,Qt.UserRole,idata)
302
- currentItem.setSizeHint(0,self.itemSize)
303
- currentItem.setIcon(0,icon)
304
- currentItem.setToolTip(0,name)
305
- currentItem.setStatusTip(0,name)
306
- tree.addTopLevelItem(currentItem)
307
- tree.setCurrentItem(currentItem)
308
- queue.append(currentItem)
309
- return currentItem
310
-
311
- def addNewItem2TreeQueue(self,indTree,name,icon,*args):
312
- if not len(args):
313
- flagSelection=True
314
- else:
315
- flagSelection=args[0]
316
- tree,queue=self.pickTree(indTree)
317
- if not flagSelection: ci=tree.currentItem()
318
- idata=TABpar(name,'QUEUE_Tab')
319
- idata.ind=0
320
- idata.indTree=indTree
321
- idata.indItem=indItem_new=len(queue)
322
- currentItem=self.createItemInTree(tree,queue,name,idata,icon)
323
- self.addNewItem2Prevs(indTree,indItem_new)
324
- if flagSelection:
325
- self.selectItem(tree,currentItem,0)
326
- else:
327
- tree.setCurrentItem(ci)
328
-
329
- def addExisitngItem2TreeQueue(self,indTree,name,idata,icon,*args):
330
- if not len(args):
331
- flagSelection=True
332
- else:
333
- flagSelection=args[0]
334
- tree,queue=self.pickTree(indTree)
335
- if not flagSelection: ci=tree.currentItem()
336
- indTree_old=idata.indTree
337
- indItem_old=idata.indItem
338
- idata.indTree=indTree
339
- idata.indItem=indItem_new=len(queue)
340
- currentItem=self.createItemInTree(tree,queue,name,idata,icon)
341
- self.addExistingItem2Prevs(indTree_old,indItem_old,indTree,indItem_new)
342
- if flagSelection:
343
- self.selectItem(tree,currentItem,0)
344
- else:
345
- tree.setCurrentItem(ci)
346
-
347
- #*************************************************** Removal
348
- def removeFromCurrentTree(self,*args):
349
- if not len(args):
350
- flagSelection=True
351
- else:
352
- flagSelection=args[0]
353
- if len(args)<=1:
354
- indTree=self.TREpar.indTree
355
- tree,queue=self.pickTree(indTree)
356
- if tree==None: return
357
- tree: QTreeWidget
358
- i=tree.currentItem()
359
- else:
360
- i=args[1]
361
- idata=i.data(0,Qt.UserRole)
362
- indTree=idata.indTree
363
- tree,queue=self.pickTree(indTree)
364
- if tree==None: return
365
- if tree==self.ui.tree_current: return
366
- if indTree==-1 and not self.FlagFastDelete:
367
- WarningMessage="Are you sure you want to permanently delete this item?\n"+\
368
- "(Once deleted from the past queue, you will not be able to recover the related process.)"
369
- flag=questionDialog(self,WarningMessage)
370
- else:
371
- flag=True
372
- if indTree==1:
373
- icon=self.Tree_icons.cancelled
374
- self.addExisitngItem2TreeQueue(-1,i.text(0),i.data(0,Qt.UserRole),icon,False)
375
- if flag:
376
- self.removeItem(i,indTree,tree,queue,flagSelection)
377
-
378
- def removeItem(self,i,indTree,tree: QTreeWidget,queue,*args):
379
- if not len(args):
380
- flagSelection=True
381
- else:
382
- flagSelection=args[0]
383
- if not flagSelection: ci=tree.currentItem()
384
- indItem=tree.indexOfTopLevelItem(i)
385
- tree.removeItemWidget(i, 0)
386
- tree.takeTopLevelItem(indItem)
387
- queue.pop(indItem)
388
- for k in range(indItem,len(queue)):
389
- queue[k].data(0,Qt.UserRole).indItem=k
390
- self.removeItemFromPrevs(indTree,indItem)
391
- if flagSelection:
392
- if len(queue):
393
- if indItem:
394
- self.selectItem(tree,queue[indItem-1],0)
395
- else:
396
- self.selectItem(tree,queue[indItem],0)
397
- tree.setFocus()
398
- else:
399
- self.selectCurrent() #move to current!
400
- else:
401
- tree.setCurrentItem(ci)
402
-
403
- def setFastDelete(self,flag):
404
- self.FlagFastDelete=flag
405
- if self.TREpar.indTree==0: return
406
- elif self.TREpar.indTree==-1: b=self.ui.button_delete_past
407
- elif self.TREpar.indTree==+1: b=self.ui.button_delete_future
408
- if self.FlagFastDelete:
409
- b.setIcon(self.icon_fast_delete)
410
- tip='Delete process (Delete/Backspace). Release Shift key for warning upon deletion'
411
- else:
412
- b.setIcon(self.icon_delete)
413
- tip='Delete process (Delete/Backspace). Press Shift key for avoiding warning upon deletion'
414
- b.setToolTip(tip)
415
- b.setStatusTip(tip)
416
- if b.underMouse():
417
- QtWidgets.QToolTip.showText(QCursor.pos(),tip,b)
418
-
419
- def setFastDelete_FocusIn(self):
420
- modifiers = QtWidgets.QApplication.keyboardModifiers()
421
- flag=modifiers == QtCore.Qt.ShiftModifier
422
- self.setFastDelete(flag)
423
-
424
- #*************************************************** Removal
425
- def restoreItemFromTree(self):
426
- indTree=self.TREpar.indTree
427
- tree,queue=self.pickTree(self.TREpar.indTree)
428
- if tree==None: return
429
- tree: QTreeWidget
430
- i=tree.currentItem()
431
- icon=self.Tree_icons.waiting
432
- self.addExisitngItem2TreeQueue(+1,i.text(0),i.data(0,Qt.UserRole),icon,False)
433
- self.removeItem(i,indTree,tree,queue,False)
434
- self.selectFuture(len(self.TREpar.future))
435
-
436
- #*************************************************** Cleaning
437
- def cleanTreeQueue(self,*args):
438
- if len(args): indTree=args[0]
439
- else: indTree=self.TREpar.indTree
440
- if indTree==-1: name='past'
441
- elif indTree==+1: name='future'
442
- WarningMessage=f"Are you sure you want to permanently clean the {name} queue?\n"+\
443
- f"(Once cleaned off, you will not be able to recover the processes of the queue.)"
444
-
445
- if questionDialog(self,WarningMessage):
446
- self.clearTenses([name])
447
- self.checkButtons()
448
-
449
- def clearTenses(self,tenses):
450
- for name in tenses:
451
- self.emptyTree(name)
452
-
453
- def clearPastFuture(self):
454
- self.clearTenses(['past','future'])
455
-
456
- def clearAllTimes(self):
457
- self.clearTenses(['past','current','future'])
458
-
459
- def emptyTree(self,name):
460
- t,q=self.pickTree(name)
461
- indTree=self.QueueNames.index(name)-1
462
- for _ in range(len(q)):
463
- self.removeItem(q[0],indTree,t,q,False)
464
-
465
- #*************************************************** Keyboard inputs
466
- def movingAcrossTrees(self,key):
467
- Flag=True
468
- if self.TREpar.indTree==0:
469
- i=self.ui.tree_current.currentItem()
470
- k=self.ui.tree_current.indexOfTopLevelItem(i)
471
- if k==0 and key == QtCore.Qt.Key_Up:
472
- self.selectPast(-1)
473
- Flag=False
474
- elif k+1==len(self.TREpar.current) and key == QtCore.Qt.Key_Down:
475
- self.selectFuture(0)
476
- Flag=False
477
- else:
478
- if key == QtCore.Qt.Key_Up: d=-1
479
- elif key == QtCore.Qt.Key_Down: d=+1
480
- self.selectCurrent(k+d)
481
- elif self.TREpar.indTree==-1:
482
- i=self.ui.tree_past.currentItem()
483
- k=self.ui.tree_past.indexOfTopLevelItem(i)
484
- if k+1==len(self.TREpar.past) and key == QtCore.Qt.Key_Down:
485
- self.selectCurrent(0)
486
- Flag=False
487
- else:
488
- if key == QtCore.Qt.Key_Up and k>0: d=-1
489
- elif key == QtCore.Qt.Key_Down: d=+1
490
- else: d=0
491
- if d: self.selectPast(k+d)
492
- elif self.TREpar.indTree==+1:
493
- i=self.ui.tree_future.currentItem()
494
- k=self.ui.tree_future.indexOfTopLevelItem(i)
495
- if k==0 and key == QtCore.Qt.Key_Up:
496
- self.selectCurrent(-1)
497
- Flag=False
498
- else:
499
- if key == QtCore.Qt.Key_Up: d=-1
500
- elif key == QtCore.Qt.Key_Down and k<len(self.TREpar.future): d=+1
501
- else: d=0
502
- if d: self.selectFuture(k+d)
503
- return Flag
504
-
505
- def keyCallbacks(self,key):
506
- if self.TREpar.indTree==-1:
507
- if key == QtCore.Qt.Key_C:
508
- self.cleanTreeQueue()
509
- elif key == QtCore.Qt.Key_R:
510
- self.restoreItemFromTree()
511
- elif self.TREpar.indTree==+1:
512
- if key == QtCore.Qt.Key_C:
513
- self.cleanTreeQueue()
514
- if key == QtCore.Qt.Key_D and Flag_DEBUG:
515
- tree,_,_=self.pickTree(self.TREpar.indTree)
516
- i=tree.currentItem()
517
- i.data(0,Qt.UserRole).flagRun=-1
518
- self.removeFromCurrentTree()
519
- return
520
-
521
- #*************************************************** Example
522
- def setExample(self):
523
- name="first #1"+"a"*30
524
- self.addNewItem2TreeQueue(-1,name,self.Tree_icons.done)
525
- self.addNewItem2TreeQueue(-1,"second",self.Tree_icons.cancelled)
526
- self.addNewItem2TreeQueue(-1,"thrid",self.Tree_icons.trash)
527
-
528
- name="Minimum #1"+"b"*30
529
- self.addNewItem2TreeQueue(1,name,self.Tree_icons.running)
530
- self.addNewItem2TreeQueue(1,"PIV process #1", self.Tree_icons.waiting)
531
- self.addNewItem2TreeQueue(1,"PIV process #2",self.Tree_icons.issue)
532
-
533
-
534
- if __name__ == "__main__":
535
- import sys
536
- app=QApplication.instance()
537
- if not app:app = QApplication(sys.argv)
538
- app.setStyle('Fusion')
539
- object = Tree_Tab()
540
- object.show()
541
- app.exec()
542
- app.quit()
543
- app=None