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.
- PaIRS_UniNa/Calibration_Tab.py +331 -0
- PaIRS_UniNa/Changes.txt +134 -2
- PaIRS_UniNa/Custom_Top.py +299 -299
- PaIRS_UniNa/Explorer.py +3136 -0
- PaIRS_UniNa/FolderLoop.py +562 -0
- PaIRS_UniNa/Input_Tab.py +831 -0
- PaIRS_UniNa/Input_Tab_CalVi.py +786 -0
- PaIRS_UniNa/Input_Tab_tools.py +3025 -0
- PaIRS_UniNa/Log_Tab.py +57 -14
- PaIRS_UniNa/Output_Tab.py +922 -0
- PaIRS_UniNa/PaIRS_PIV.py +111 -18
- PaIRS_UniNa/PaIRS_pypacks.py +698 -140
- PaIRS_UniNa/Process_Tab.py +1221 -1402
- PaIRS_UniNa/Process_Tab_CalVi.py +137 -262
- PaIRS_UniNa/Process_Tab_Disp.py +163 -0
- PaIRS_UniNa/Process_Tab_Min.py +120 -0
- PaIRS_UniNa/Saving_tools.py +296 -0
- PaIRS_UniNa/TabTools.py +863 -543
- PaIRS_UniNa/Vis_Tab.py +1898 -1315
- PaIRS_UniNa/Vis_Tab_CalVi.py +484 -356
- PaIRS_UniNa/Whatsnew.py +59 -10
- PaIRS_UniNa/_PaIRS_PIV.pyd +0 -0
- PaIRS_UniNa/__init__.py +4 -3
- PaIRS_UniNa/addwidgets_ps.py +326 -56
- PaIRS_UniNa/calib.py +19 -12
- PaIRS_UniNa/calibView.py +48 -25
- PaIRS_UniNa/gPaIRS.py +3902 -3461
- PaIRS_UniNa/gPalette.py +189 -170
- 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/bin_off.png +0 -0
- PaIRS_UniNa/icons/bin_on.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/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/close_all.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/cut.png +0 -0
- PaIRS_UniNa/icons/cut_warnings.png +0 -0
- PaIRS_UniNa/icons/darkmode.png +0 -0
- PaIRS_UniNa/icons/disp_step.png +0 -0
- PaIRS_UniNa/icons/disp_step_off.png +0 -0
- PaIRS_UniNa/icons/edit_list.png +0 -0
- PaIRS_UniNa/icons/example_list.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_beta.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/folder_loop_cleanup.png +0 -0
- PaIRS_UniNa/icons/folder_loop_cleanup_off.png +0 -0
- PaIRS_UniNa/icons/gear.gif +0 -0
- PaIRS_UniNa/icons/gear.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/log_logo.png +0 -0
- PaIRS_UniNa/icons/logo_opaco.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/new_workspace.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/paused.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/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/read.png +0 -0
- PaIRS_UniNa/icons/read_list.png +0 -0
- PaIRS_UniNa/icons/reset.png +0 -0
- PaIRS_UniNa/icons/reset_levels.png +0 -0
- PaIRS_UniNa/icons/restore_undo.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/save_and_stop.png +0 -0
- PaIRS_UniNa/icons/save_cfg.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/scan_path_loop.png +0 -0
- PaIRS_UniNa/icons/scan_path_loop_off.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/unedited.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/vectorColor.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/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 +8 -8
- PaIRS_UniNa/parForMulti.py +7 -5
- PaIRS_UniNa/parForWorkers.py +370 -31
- PaIRS_UniNa/pivParFor.py +233 -229
- PaIRS_UniNa/plt_util.py +141 -141
- PaIRS_UniNa/preProcParFor.py +153 -148
- PaIRS_UniNa/procTools.py +631 -178
- PaIRS_UniNa/readcfg.py +31 -1
- PaIRS_UniNa/rqrdpckgs.txt +9 -0
- PaIRS_UniNa/stereoPivParFor.py +227 -0
- PaIRS_UniNa/tAVarie.py +215 -215
- PaIRS_UniNa/tabSplitter.py +612 -0
- PaIRS_UniNa/ui_Calibration_Tab.py +545 -0
- PaIRS_UniNa/ui_Custom_Top.py +5 -5
- PaIRS_UniNa/ui_Input_Tab.py +1101 -0
- PaIRS_UniNa/{ui_Import_Tab_CalVi.py → ui_Input_Tab_CalVi.py} +1282 -1275
- PaIRS_UniNa/ui_Log_Tab.py +262 -257
- PaIRS_UniNa/{ui_Export_Tab.py → ui_Output_Tab.py} +2361 -1778
- PaIRS_UniNa/ui_Process_Tab.py +3809 -3758
- PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1546
- PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
- PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
- PaIRS_UniNa/ui_Vis_Tab.py +1626 -1208
- PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
- PaIRS_UniNa/ui_Whatsnew.py +131 -131
- PaIRS_UniNa/ui_gPairs.py +876 -950
- PaIRS_UniNa/ui_infoPaIRS.py +550 -425
- PaIRS_UniNa/whatsnew.txt +6 -4
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/METADATA +69 -51
- pairs_unina-0.2.8.dist-info/RECORD +329 -0
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/WHEEL +1 -1
- PaIRS_UniNa/CalVi.py +0 -18
- PaIRS_UniNa/Export_Tab.py +0 -574
- PaIRS_UniNa/Import_Tab.py +0 -657
- PaIRS_UniNa/Import_Tab_CalVi.py +0 -861
- PaIRS_UniNa/Import_Tab_tools.py +0 -598
- PaIRS_UniNa/Tree_Tab.py +0 -543
- PaIRS_UniNa/gCalVi.py +0 -2024
- PaIRS_UniNa/icons/add.png +0 -0
- PaIRS_UniNa/icons/cancelled.png +0 -0
- PaIRS_UniNa/icons/chain.png +0 -0
- PaIRS_UniNa/icons/chain_broken.png +0 -0
- PaIRS_UniNa/icons/default_sizes.png +0 -0
- PaIRS_UniNa/icons/dock_tabs.png +0 -0
- PaIRS_UniNa/icons/done.png +0 -0
- PaIRS_UniNa/icons/down_arrow.png +0 -0
- PaIRS_UniNa/icons/export_logo.png +0 -0
- PaIRS_UniNa/icons/fast_delete.png +0 -0
- PaIRS_UniNa/icons/flip_y.png +0 -0
- PaIRS_UniNa/icons/ganci.png +0 -0
- PaIRS_UniNa/icons/import_blue.png +0 -0
- PaIRS_UniNa/icons/import_logo.png +0 -0
- PaIRS_UniNa/icons/missing.png +0 -0
- PaIRS_UniNa/icons/process_icon.png +0 -0
- PaIRS_UniNa/icons/processing.png +0 -0
- PaIRS_UniNa/icons/restart.png +0 -0
- PaIRS_UniNa/icons/right_arrow.png +0 -0
- PaIRS_UniNa/icons/run_piv.png +0 -0
- PaIRS_UniNa/icons/terminal.png +0 -0
- PaIRS_UniNa/icons/undock_tabs.png +0 -0
- PaIRS_UniNa/icons/vect_field.png +0 -0
- PaIRS_UniNa/icons/w0.png +0 -0
- PaIRS_UniNa/icons/w1.png +0 -0
- PaIRS_UniNa/icons/w2.png +0 -0
- PaIRS_UniNa/icons/w3.png +0 -0
- PaIRS_UniNa/icons/w4.png +0 -0
- PaIRS_UniNa/icons/w5.png +0 -0
- PaIRS_UniNa/run_CalVi.py +0 -14
- PaIRS_UniNa/run_gcalvi.py +0 -5
- PaIRS_UniNa/ui_Import_Tab.py +0 -1077
- PaIRS_UniNa/ui_Tree_Tab.py +0 -684
- PaIRS_UniNa/ui_gCalVi.py +0 -640
- PaIRS_UniNa/ui_infoCalVi.py +0 -428
- PaIRS_UniNa-0.1.13.dist-info/LICENSE +0 -19
- PaIRS_UniNa-0.1.13.dist-info/RECORD +0 -174
- /PaIRS_UniNa/icons/{clean_queue.png → clean.png} +0 -0
- /PaIRS_UniNa/icons/{waiting_c.png → sandglass.png} +0 -0
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/calib.py
CHANGED
|
@@ -43,7 +43,7 @@ if Flag_DEBUG_PARPOOL: import debugpy #nel casso mettere nel thread debugpy.debu
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
sleepTimeWorkers=0.2 #for multithreading and other stuff
|
|
46
|
-
FlagReadCfg=
|
|
46
|
+
FlagReadCfg=True
|
|
47
47
|
PrintTA.flagPriority=PrintTAPriority.veryLow
|
|
48
48
|
# errror codes
|
|
49
49
|
TYPE_ERR_REPEAT=-101 # pylint: disable=invalid-name
|
|
@@ -218,7 +218,7 @@ class Calib(PaIRS_lib.PyFunOutCalib):
|
|
|
218
218
|
def findPlaneFrom3Points(self,plane=0,op=0):
|
|
219
219
|
''' ask the user to input the 3 points and then finds the spots in the plane'''
|
|
220
220
|
try:
|
|
221
|
-
#pri.
|
|
221
|
+
#pri.Info.magenta(plane)
|
|
222
222
|
self.resetFindPlane(plane)
|
|
223
223
|
for i in range (3):
|
|
224
224
|
self.signals.textFromCalib.emit(f'Select the {self.pointDesc[i]} point')
|
|
@@ -285,7 +285,7 @@ class Calib(PaIRS_lib.PyFunOutCalib):
|
|
|
285
285
|
if flagPlane:# the points have not been found
|
|
286
286
|
|
|
287
287
|
if flagPlane & CalFlags.PLANE_ORIGIN_NOT_FOUND: # no origin error code
|
|
288
|
-
#pri.
|
|
288
|
+
#pri.Info.red('getFlagPlane-> searching????')
|
|
289
289
|
err=-1
|
|
290
290
|
return err
|
|
291
291
|
try:
|
|
@@ -335,12 +335,16 @@ class Calib(PaIRS_lib.PyFunOutCalib):
|
|
|
335
335
|
def taskFindAllPlanesFromOrigin(self):
|
|
336
336
|
''' finds all the spots in the planes when the origins and angles are known'''
|
|
337
337
|
self.cal.flagWorking=1
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
self.
|
|
342
|
-
|
|
343
|
-
|
|
338
|
+
try:
|
|
339
|
+
for c in range(self.nCams):
|
|
340
|
+
p0=c*self.nPlanesPerCam
|
|
341
|
+
for p in range(0,self.nPlanesPerCam):
|
|
342
|
+
self.findPlane(p0+p)
|
|
343
|
+
self.signals.drawCirclesFromCalib.emit(self.plane)
|
|
344
|
+
except ValueError as exc:
|
|
345
|
+
raise exc #può succedere in findPlaneAutomatic o se si preme stop
|
|
346
|
+
finally:
|
|
347
|
+
self.cal.flagWorking=0
|
|
344
348
|
|
|
345
349
|
|
|
346
350
|
|
|
@@ -441,10 +445,13 @@ class Calib(PaIRS_lib.PyFunOutCalib):
|
|
|
441
445
|
try:
|
|
442
446
|
pri.Process.blue ('calibrating ')
|
|
443
447
|
self.signals.textFromCalib.emit('calibrating ')
|
|
448
|
+
pri.Info.white(f'init calibration {self.cal.flagCalibrated}')
|
|
444
449
|
self.cal.calibrate(self.funCalib)
|
|
445
|
-
|
|
450
|
+
|
|
451
|
+
while self.cal.flagWorking==2:# and not self.isKilled:
|
|
446
452
|
timesleep(sleepTimeWorkers)
|
|
447
|
-
self.cal.
|
|
453
|
+
pri.Info.white(f'end calibration {self.cal.flagCalibrated}')
|
|
454
|
+
self.cal.checkCalibration() #needed because use the main thread and may exit with an exception
|
|
448
455
|
self.FlagCalibration=True
|
|
449
456
|
self.cal.saveCfg (0,self.cfgName)
|
|
450
457
|
|
|
@@ -548,7 +555,7 @@ class Calib(PaIRS_lib.PyFunOutCalib):
|
|
|
548
555
|
except Exception as exc:
|
|
549
556
|
#traceback.print_exc()
|
|
550
557
|
#pri.Info.white(str(exc.__cause__).split('\n')[3])
|
|
551
|
-
pri.Info.
|
|
558
|
+
pri.Info.white(str(exc.args[0]).split('\n')[3])
|
|
552
559
|
#'''
|
|
553
560
|
#for i in range(100): print(f'{outDa.z[0]} {outDa.XOr[0]} {outDa.YOr[0]} {outDa.angCol[0]} {outDa.angRow[0]}')
|
|
554
561
|
|
PaIRS_UniNa/calibView.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# pylint: disable=pointless-string-statement, too-many-instance-attributes, no-name-in-module, multiple-imports
|
|
3
3
|
# pylint: disable= import-error
|
|
4
4
|
# pylint: disable=multiple-statements,c-extension-no-member
|
|
5
|
-
import sys
|
|
5
|
+
import sys, traceback
|
|
6
6
|
from typing import Callable
|
|
7
7
|
from enum import Enum
|
|
8
8
|
#import faulthandler # per capire da dove vengono gli errori c
|
|
@@ -229,7 +229,7 @@ class CalibView(QLabel):
|
|
|
229
229
|
''' button pressed '''
|
|
230
230
|
#pri.Info.red(f'executeCalibTask {self.calib.flagExitFromView is True} {self.calib.cal.flagWorking } {self.calib.cal.flagWorking is True}')
|
|
231
231
|
if self.calib.flagExitFromView is True and self.calib.cal.flagWorking ==1:
|
|
232
|
-
pri.Info.red('
|
|
232
|
+
pri.Info.red('still working let us wait')# never used? Maybe flagWorking is useless???
|
|
233
233
|
return False
|
|
234
234
|
if flag is self.flagCurrentTask or flag is CalibTasks.stop:# in this case always stop
|
|
235
235
|
self.calib.flagExitFromView=True
|
|
@@ -271,15 +271,20 @@ class CalibView(QLabel):
|
|
|
271
271
|
def plotPlane(self,plane):
|
|
272
272
|
''' plot image of plane=plane'''
|
|
273
273
|
pri.Info.green('plotPlane call')
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
self.calib.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
self.
|
|
274
|
+
flagPlot=False
|
|
275
|
+
try:
|
|
276
|
+
if 0<=plane <self.calib.nPlanes:
|
|
277
|
+
self.calib.cal.data.piano=self.calib.plane=plane
|
|
278
|
+
self.calib.cal.initFindPoint(plane)
|
|
279
|
+
flagPlot=self.plotImg(plane)
|
|
280
|
+
if flagPlot and not self.calib.flagPlotMask:
|
|
281
|
+
self.drawCircles(plane)
|
|
282
|
+
except Exception as inst:
|
|
283
|
+
pri.Error.red(f'plotePlane call: error while plotting image\n{traceback.format_exc()}')
|
|
280
284
|
#XY=self.calib.cal.pointFromCalib([0,0,0],0)
|
|
281
285
|
#pri.Info.green(f"Punto (x,y,z)=(0,0,0) -> (X,Y)=({XY.x},{XY.y})")
|
|
282
286
|
#self.outToStatusBarCaller(f'Cam#:{self.calib.plane//self.calib.nPlanesPerCam} Plane:{self.calib.plane%self.calib.nPlanesPerCam}')
|
|
287
|
+
return flagPlot
|
|
283
288
|
|
|
284
289
|
@Slot(int)
|
|
285
290
|
def plotImg(self,plane,flagDrawRect=False):
|
|
@@ -331,14 +336,14 @@ class CalibView(QLabel):
|
|
|
331
336
|
if not calib.flagPlotMask:
|
|
332
337
|
if len(calib.imgs):
|
|
333
338
|
self.imgPlot=self.normalizeArray(calib.imgs[plane],calib.LMax,calib.LMin)
|
|
334
|
-
FlagPlot=self.imgPlot.max()!=self.imgPlot.min()
|
|
339
|
+
FlagPlot=bool(self.imgPlot.max()!=self.imgPlot.min())
|
|
335
340
|
|
|
336
341
|
if calib.flagShowMask and len(calib.ccMask):#todo TA ma se l'img è più piccola
|
|
337
342
|
self.imgPlot[0:mask.shape[0],0:mask.shape[1]]=mask # pylint: disable=unsupported-assignment-operation
|
|
338
343
|
else:
|
|
339
344
|
if len(calib.ccMask):
|
|
340
345
|
self.imgPlot=mask
|
|
341
|
-
FlagPlot=self.imgPlot.max()!=self.imgPlot.min()
|
|
346
|
+
FlagPlot=bool(self.imgPlot.max()!=self.imgPlot.min())
|
|
342
347
|
|
|
343
348
|
return self.imgPlot,FlagPlot
|
|
344
349
|
|
|
@@ -346,15 +351,21 @@ class CalibView(QLabel):
|
|
|
346
351
|
#todo GP non è mai chiamata con None è necessario complicarla? Fra l'altro se decidiamo di valutare
|
|
347
352
|
# min e max in fase di assegnazione è inutile
|
|
348
353
|
a=da.copy()# todo GP perchè la copii?
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
LMax
|
|
352
|
-
|
|
353
|
-
LMin
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
354
|
+
if 'int' in a.dtype.name:
|
|
355
|
+
LLim=2**16-1
|
|
356
|
+
if not LMax:
|
|
357
|
+
LMax=max([min([a.max(),LLim]),-LLim+1])
|
|
358
|
+
if not LMin:
|
|
359
|
+
LMin=max([min([a.min(),LMax-1]),-LLim])
|
|
360
|
+
LMin=max([0,LMin])
|
|
361
|
+
LMax=max([LMin+1,LMax])
|
|
362
|
+
a[a>LMax]=LMax
|
|
363
|
+
a[a<LMin]=LMin
|
|
364
|
+
else:
|
|
365
|
+
LMax=a.max()
|
|
366
|
+
LMin=a.min()
|
|
367
|
+
if LMax==LMin: LMax=LMax+1
|
|
368
|
+
|
|
358
369
|
a=np.uint8(255.0*(a-LMin)/(LMax-LMin))
|
|
359
370
|
return a
|
|
360
371
|
def insideImg(self,pu:Punto)->bool:
|
|
@@ -488,6 +499,9 @@ class CalibView(QLabel):
|
|
|
488
499
|
''' draw arrow from x1 to x scaled with l'''
|
|
489
500
|
dx=(x-x1)*l
|
|
490
501
|
dy=(y-y1)*l
|
|
502
|
+
if abs(dx)>10**6 or abs(dy)>10**6:
|
|
503
|
+
dx=10**3
|
|
504
|
+
dy=10**3
|
|
491
505
|
x2=x1+dx
|
|
492
506
|
y2=y1+dy
|
|
493
507
|
painter.drawLine(x1,y1,x2,y2)
|
|
@@ -521,15 +535,15 @@ class CalibView(QLabel):
|
|
|
521
535
|
puOr=Punto(calVect.XOr[p],calVect.YOr[p])
|
|
522
536
|
ind=0
|
|
523
537
|
#puOr=Punto(out.X[p,ii], out.Y[p,ii])
|
|
524
|
-
#for pp in range (0,self.calib.cal.data.Numpiani): pri.
|
|
525
|
-
#pri.
|
|
538
|
+
#for pp in range (0,self.calib.cal.data.Numpiani): pri.Info.green(out.X[pp,ii], out.Y[pp,ii])
|
|
539
|
+
#pri.Info.green(f'Or=({out.X[p,iOr]}, {out.Y[p,iOr]}) x=({out.X[p,ii]}, {out.Y[p,ii]}) y=({out.X[p,iOr+1]}, {out.Y[p,iOr+1]})')
|
|
526
540
|
|
|
527
541
|
|
|
528
542
|
if flagDrawCircles:
|
|
529
543
|
r=rInpCircle
|
|
530
544
|
def pCir(X:float, Y:float,r:float):
|
|
531
545
|
painter.drawRoundedRect(X-r, Y-r,2*r,2*r,r,r)
|
|
532
|
-
#pri.
|
|
546
|
+
#pri.Info.green(X,Y)
|
|
533
547
|
pen.setColor(QtGui.QColor(mainInCircleColors[ind]))
|
|
534
548
|
painter.setPen(pen)
|
|
535
549
|
pCir(puOr.x,puOr.y,r)
|
|
@@ -611,7 +625,9 @@ class CalibView(QLabel):
|
|
|
611
625
|
if self.calib.cal.flagCalibrated:
|
|
612
626
|
data=self.calib.cal.data
|
|
613
627
|
for i in indOk:
|
|
614
|
-
|
|
628
|
+
x=float(calVect.Xc[p,i]-data.ColPart)
|
|
629
|
+
y=float(calVect.Yc[p,i]-data.RigaPart)
|
|
630
|
+
self.drawArrow(painter,lunFreccia,calVect.X[p,i], calVect.Y[p,i],x,y)
|
|
615
631
|
if p==data.kMax:
|
|
616
632
|
pen.setColor(QtGui.QColor(maxErrorCircleColor))
|
|
617
633
|
painter.setPen(pen)
|
|
@@ -664,7 +680,7 @@ class CalibView(QLabel):
|
|
|
664
680
|
''' plot image of plane=plane'''
|
|
665
681
|
self.plotPlane(plane)
|
|
666
682
|
|
|
667
|
-
def spinOriginChanged(self,Off:int,spin:QSpinBox,flagX:bool):
|
|
683
|
+
def spinOriginChanged(self,Off:int,spin:QSpinBox,flagX:bool,flagPlot=True):
|
|
668
684
|
''' offset Origin '''
|
|
669
685
|
p=self.calib.plane
|
|
670
686
|
calVect=self.calib.cal.vect
|
|
@@ -676,7 +692,7 @@ class CalibView(QLabel):
|
|
|
676
692
|
calVect.xOrShift[p]=Off
|
|
677
693
|
else:
|
|
678
694
|
calVect.yOrShift[p]=Off
|
|
679
|
-
self.plotPlane(self.calib.plane)
|
|
695
|
+
if flagPlot: self.plotPlane(self.calib.plane)
|
|
680
696
|
|
|
681
697
|
def copyRemPoints(self):
|
|
682
698
|
p=self.calib.plane
|
|
@@ -713,6 +729,13 @@ class CalibView(QLabel):
|
|
|
713
729
|
else:
|
|
714
730
|
calVect.remPointsDo[p]=Off
|
|
715
731
|
self.calib.cal.removeBulk()
|
|
732
|
+
if self.calib.cal.flagCalibrated:
|
|
733
|
+
self.calib.cal.checkCalibration() #needed because use the main thread and may exit with an exception
|
|
734
|
+
strPriCalib=self.calib.prettyPrintCalib()
|
|
735
|
+
strPriErrCalib=self.calib.prettyPrintErrCalib()
|
|
736
|
+
pri.Process.blue (strPriErrCalib)
|
|
737
|
+
|
|
738
|
+
self.calib.signals.textFromCalib.emit(strPriErrCalib+'\n'+strPriCalib)
|
|
716
739
|
self.plotPlane(self.calib.plane)
|
|
717
740
|
|
|
718
741
|
@Slot(int)
|