pymodaq 4.4.7__py3-none-any.whl → 5.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pymodaq might be problematic. Click here for more details.
- pymodaq/__init__.py +57 -91
- pymodaq/control_modules/daq_move.py +64 -46
- pymodaq/control_modules/daq_move_ui.py +34 -12
- pymodaq/control_modules/daq_viewer.py +55 -30
- pymodaq/control_modules/daq_viewer_ui.py +6 -6
- pymodaq/control_modules/mocks.py +1 -1
- pymodaq/control_modules/move_utility_classes.py +51 -43
- pymodaq/control_modules/utils.py +43 -20
- pymodaq/control_modules/viewer_utility_classes.py +54 -18
- pymodaq/daq_utils/daq_utils.py +6 -0
- pymodaq/dashboard.py +639 -323
- pymodaq/examples/function_plotter.py +13 -12
- pymodaq/examples/tcp_client.py +1 -1
- pymodaq/extensions/__init__.py +1 -1
- pymodaq/extensions/bayesian/bayesian_optimisation.py +44 -32
- pymodaq/extensions/bayesian/utils.py +10 -10
- pymodaq/extensions/console.py +7 -6
- pymodaq/extensions/daq_logger/__init__.py +1 -0
- pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +30 -30
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger.py +16 -15
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger_models.py +2 -0
- pymodaq/{utils/h5modules → extensions/daq_logger}/h5logging.py +7 -8
- pymodaq/extensions/daq_scan.py +42 -34
- pymodaq/extensions/daq_scan_ui.py +18 -18
- pymodaq/extensions/h5browser.py +2 -3
- pymodaq/extensions/pid/__init__.py +4 -2
- pymodaq/extensions/pid/daq_move_PID.py +3 -3
- pymodaq/extensions/pid/pid_controller.py +59 -50
- pymodaq/extensions/pid/utils.py +10 -5
- pymodaq/extensions/utils.py +33 -3
- pymodaq/post_treatment/load_and_plot.py +10 -7
- pymodaq/resources/preset_default.xml +1 -1
- pymodaq/updater.py +107 -0
- pymodaq/utils/array_manipulation.py +4 -384
- pymodaq/utils/calibration_camera.py +12 -9
- pymodaq/utils/chrono_timer.py +11 -10
- pymodaq/utils/config.py +3 -458
- pymodaq/utils/daq_utils.py +9 -715
- pymodaq/utils/data.py +17 -2959
- pymodaq/utils/enums.py +4 -74
- pymodaq/utils/exceptions.py +0 -4
- pymodaq/utils/gui_utils/__init__.py +8 -8
- pymodaq/utils/gui_utils/loader_utils.py +26 -1
- pymodaq/utils/gui_utils/utils.py +8 -162
- pymodaq/utils/gui_utils/widgets/lcd.py +6 -109
- pymodaq/utils/h5modules/__init__.py +0 -4
- pymodaq/utils/h5modules/module_saving.py +9 -8
- pymodaq/utils/leco/__init__.py +2 -2
- pymodaq/utils/leco/daq_move_LECODirector.py +3 -6
- pymodaq/utils/leco/daq_xDviewer_LECODirector.py +5 -5
- pymodaq/utils/leco/director_utils.py +2 -2
- pymodaq/utils/leco/leco_director.py +3 -3
- pymodaq/utils/leco/pymodaq_listener.py +4 -3
- pymodaq/utils/leco/utils.py +11 -9
- pymodaq/utils/logger.py +4 -76
- pymodaq/utils/managers/batchscan_manager.py +16 -19
- pymodaq/utils/managers/modules_manager.py +30 -17
- pymodaq/utils/managers/overshoot_manager.py +48 -6
- pymodaq/utils/managers/preset_manager.py +39 -59
- pymodaq/utils/managers/preset_manager_utils.py +28 -22
- pymodaq/utils/managers/remote_manager.py +12 -10
- pymodaq/utils/math_utils.py +4 -582
- pymodaq/utils/messenger.py +4 -64
- pymodaq/utils/parameter/__init__.py +6 -9
- pymodaq/utils/parameter/utils.py +4 -328
- pymodaq/utils/scanner/scan_config.py +1 -1
- pymodaq/utils/scanner/scan_factory.py +16 -12
- pymodaq/utils/{plotting → scanner}/scan_selector.py +19 -20
- pymodaq/utils/scanner/scanner.py +10 -8
- pymodaq/utils/scanner/scanners/_1d_scanners.py +8 -5
- pymodaq/utils/scanner/scanners/_2d_scanners.py +5 -5
- pymodaq/utils/scanner/scanners/sequential.py +8 -8
- pymodaq/utils/scanner/scanners/tabular.py +9 -9
- pymodaq/utils/scanner/utils.py +6 -4
- pymodaq/utils/svg/svg_viewer2D.py +3 -4
- pymodaq/utils/tcp_ip/mysocket.py +4 -110
- pymodaq/utils/tcp_ip/serializer.py +4 -801
- pymodaq/utils/tcp_ip/tcp_server_client.py +15 -13
- pymodaq-5.0.1.dist-info/METADATA +242 -0
- pymodaq-5.0.1.dist-info/RECORD +122 -0
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/WHEEL +1 -1
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/entry_points.txt +1 -0
- pymodaq/examples/custom_app.py +0 -258
- pymodaq/examples/custom_viewer.py +0 -112
- pymodaq/examples/parameter_ex.py +0 -138
- pymodaq/examples/preset_MockCamera.xml +0 -1
- pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.py +0 -142
- pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.ui +0 -232
- pymodaq/post_treatment/daq_measurement/daq_measurement_main.py +0 -391
- pymodaq/post_treatment/daq_measurement/process_from_QtDesigner_DAQ_Measurement_GUI.bat +0 -2
- pymodaq/post_treatment/process_to_scalar.py +0 -263
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/algo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/input.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/random.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/target.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -238
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127453
- pymodaq/resources/QtDesigner_Ressources/__init__.py +0 -0
- pymodaq/resources/QtDesigner_Ressources/credit.rst +0 -7
- pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
- pymodaq/resources/VERSION +0 -2
- pymodaq/resources/config_template.toml +0 -96
- pymodaq/resources/triangulation_data.npy +0 -0
- pymodaq/utils/abstract/__init__.py +0 -48
- pymodaq/utils/db/__init__.py +0 -0
- pymodaq/utils/db/db_logger/__init__.py +0 -0
- pymodaq/utils/factory.py +0 -82
- pymodaq/utils/gui_utils/custom_app.py +0 -133
- pymodaq/utils/gui_utils/dock.py +0 -107
- pymodaq/utils/gui_utils/file_io.py +0 -94
- pymodaq/utils/gui_utils/layout.py +0 -34
- pymodaq/utils/gui_utils/list_picker.py +0 -38
- pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
- pymodaq/utils/gui_utils/widgets/label.py +0 -24
- pymodaq/utils/gui_utils/widgets/push.py +0 -149
- pymodaq/utils/gui_utils/widgets/qled.py +0 -62
- pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
- pymodaq/utils/gui_utils/widgets/table.py +0 -263
- pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
- pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -110
- pymodaq/utils/h5modules/backends.py +0 -1022
- pymodaq/utils/h5modules/browsing.py +0 -627
- pymodaq/utils/h5modules/data_saving.py +0 -1107
- pymodaq/utils/h5modules/exporter.py +0 -119
- pymodaq/utils/h5modules/exporters/__init__.py +0 -0
- pymodaq/utils/h5modules/exporters/base.py +0 -111
- pymodaq/utils/h5modules/exporters/flimj.py +0 -63
- pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
- pymodaq/utils/h5modules/saving.py +0 -866
- pymodaq/utils/h5modules/utils.py +0 -115
- pymodaq/utils/managers/action_manager.py +0 -489
- pymodaq/utils/managers/parameter_manager.py +0 -279
- pymodaq/utils/managers/roi_manager.py +0 -740
- pymodaq/utils/parameter/ioxml.py +0 -545
- pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
- pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
- pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
- pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
- pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
- pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
- pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
- pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
- pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
- pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -166
- pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
- pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
- pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
- pymodaq/utils/plotting/__init__.py +0 -0
- pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
- pymodaq/utils/plotting/data_viewers/base.py +0 -286
- pymodaq/utils/plotting/data_viewers/viewer.py +0 -275
- pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
- pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -826
- pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
- pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
- pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
- pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
- pymodaq/utils/plotting/gant_chart.py +0 -123
- pymodaq/utils/plotting/image_viewer.py +0 -97
- pymodaq/utils/plotting/items/__init__.py +0 -0
- pymodaq/utils/plotting/items/axis_scaled.py +0 -93
- pymodaq/utils/plotting/items/crosshair.py +0 -94
- pymodaq/utils/plotting/items/image.py +0 -388
- pymodaq/utils/plotting/navigator.py +0 -353
- pymodaq/utils/plotting/plotter/plotter.py +0 -94
- pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
- pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
- pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
- pymodaq/utils/plotting/utils/__init__.py +0 -0
- pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
- pymodaq/utils/plotting/utils/filter.py +0 -585
- pymodaq/utils/plotting/utils/lineout.py +0 -226
- pymodaq/utils/plotting/utils/plot_utils.py +0 -579
- pymodaq/utils/plotting/utils/signalND.py +0 -1347
- pymodaq/utils/plotting/widgets.py +0 -76
- pymodaq/utils/qvariant.py +0 -12
- pymodaq/utils/slicing.py +0 -63
- pymodaq/utils/units.py +0 -216
- pymodaq-4.4.7.dist-info/METADATA +0 -163
- pymodaq-4.4.7.dist-info/RECORD +0 -446
- /pymodaq/{post_treatment/daq_analysis → daq_utils}/__init__.py +0 -0
- /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
- /pymodaq/{post_treatment/daq_measurement → extensions/daq_logger/db}/__init__.py +0 -0
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,627 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
Created the 15/11/2022
|
|
4
|
-
|
|
5
|
-
@author: Sebastien Weber
|
|
6
|
-
"""
|
|
7
|
-
from typing import Tuple
|
|
8
|
-
import os
|
|
9
|
-
from collections import OrderedDict
|
|
10
|
-
from typing import List
|
|
11
|
-
import warnings
|
|
12
|
-
import logging
|
|
13
|
-
import webbrowser
|
|
14
|
-
import numpy as np
|
|
15
|
-
from pathlib import Path
|
|
16
|
-
from packaging import version as version_mod
|
|
17
|
-
|
|
18
|
-
from pymodaq.utils.logger import set_logger, get_module_name
|
|
19
|
-
from pymodaq.utils.config import Config
|
|
20
|
-
from qtpy import QtGui, QtCore
|
|
21
|
-
from qtpy.QtCore import Qt, QObject, Signal, QByteArray
|
|
22
|
-
|
|
23
|
-
from pymodaq.utils.parameter import ioxml
|
|
24
|
-
|
|
25
|
-
from pymodaq.utils.gui_utils.widgets.tree_layout import TreeLayout
|
|
26
|
-
from pymodaq.utils.daq_utils import capitalize
|
|
27
|
-
from pymodaq.utils.data import Axis
|
|
28
|
-
from pymodaq.utils.gui_utils.utils import h5tree_to_QTree, pngbinary2Qlabel
|
|
29
|
-
from pymodaq.utils.gui_utils.file_io import select_file, select_file_filter
|
|
30
|
-
from pymodaq.utils.plotting.data_viewers.viewerND import ViewerND
|
|
31
|
-
from qtpy import QtWidgets
|
|
32
|
-
from pymodaq.utils import daq_utils as utils
|
|
33
|
-
from pymodaq.utils.managers.action_manager import ActionManager
|
|
34
|
-
from pymodaq.utils.managers.parameter_manager import ParameterManager
|
|
35
|
-
from pymodaq.utils.messenger import messagebox
|
|
36
|
-
from .backends import H5Backend
|
|
37
|
-
from .saving import H5Saver
|
|
38
|
-
from . import data_saving
|
|
39
|
-
from .exporter import ExporterFactory
|
|
40
|
-
|
|
41
|
-
config = Config()
|
|
42
|
-
logger = set_logger(get_module_name(__file__))
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class H5BrowserUtil(H5Backend):
|
|
46
|
-
"""Utility object to interact and get info and data from a hdf5 file
|
|
47
|
-
|
|
48
|
-
Inherits H5Backend and all its functionalities
|
|
49
|
-
|
|
50
|
-
Parameters
|
|
51
|
-
----------
|
|
52
|
-
backend: str
|
|
53
|
-
The used hdf5 backend: either tables, h5py or h5pyd
|
|
54
|
-
"""
|
|
55
|
-
def __init__(self, backend='tables'):
|
|
56
|
-
super().__init__(backend=backend)
|
|
57
|
-
|
|
58
|
-
def export_data(self, node_path='/', filesavename: str = 'datafile.h5', filter=None):
|
|
59
|
-
"""Initialize the correct exporter and export the node"""
|
|
60
|
-
|
|
61
|
-
# Format the node and file type
|
|
62
|
-
filepath = Path(filesavename)
|
|
63
|
-
node = self.get_node(node_path)
|
|
64
|
-
# Separate dot from extension
|
|
65
|
-
extension = filepath.suffix[1:]
|
|
66
|
-
# Obtain the suitable exporter object
|
|
67
|
-
exporter = ExporterFactory.create_exporter(extension,
|
|
68
|
-
ExporterFactory.get_format_from_filter(filter))
|
|
69
|
-
# Export the data
|
|
70
|
-
exporter.export_data(node, filepath)
|
|
71
|
-
|
|
72
|
-
def get_h5file_scans(self, where='/'):
|
|
73
|
-
"""Get the list of the scan nodes in the file
|
|
74
|
-
|
|
75
|
-
Parameters
|
|
76
|
-
----------
|
|
77
|
-
where: str
|
|
78
|
-
the path in the file
|
|
79
|
-
|
|
80
|
-
Returns
|
|
81
|
-
-------
|
|
82
|
-
list of dict
|
|
83
|
-
dict with keys: scan_name, path (within the file) and data (the live scan png image)
|
|
84
|
-
"""
|
|
85
|
-
# TODO add a test for this method
|
|
86
|
-
scan_list = []
|
|
87
|
-
where = self.get_node(where)
|
|
88
|
-
for node in self.walk_nodes(where):
|
|
89
|
-
if 'pixmap2D' in node.attrs:
|
|
90
|
-
scan_list.append(
|
|
91
|
-
dict(scan_name='{:s}_{:s}'.format(node.parent_node.name, node.name), path=node.path,
|
|
92
|
-
data=node.attrs['pixmap2D']))
|
|
93
|
-
|
|
94
|
-
return scan_list
|
|
95
|
-
|
|
96
|
-
def get_h5_attributes(self, node_path):
|
|
97
|
-
"""
|
|
98
|
-
"""
|
|
99
|
-
node = self.get_node(node_path)
|
|
100
|
-
attrs_names = node.attrs.attrs_name
|
|
101
|
-
attr_dict = OrderedDict(node.attrs.to_dict())
|
|
102
|
-
|
|
103
|
-
settings = None
|
|
104
|
-
scan_settings = None
|
|
105
|
-
if 'settings' in attrs_names:
|
|
106
|
-
if node.attrs['settings'] != '':
|
|
107
|
-
settings = node.attrs['settings']
|
|
108
|
-
|
|
109
|
-
if 'scan_settings' in attrs_names:
|
|
110
|
-
if node.attrs['scan_settings'] != '':
|
|
111
|
-
scan_settings = node.attrs['scan_settings']
|
|
112
|
-
pixmaps = []
|
|
113
|
-
for attr in attrs_names:
|
|
114
|
-
if 'pixmap' in attr:
|
|
115
|
-
pixmaps.append(node.attrs[attr])
|
|
116
|
-
|
|
117
|
-
return attr_dict, settings, scan_settings, pixmaps
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class View(QObject):
|
|
121
|
-
item_clicked_sig = Signal(object)
|
|
122
|
-
item_double_clicked_sig = Signal(object)
|
|
123
|
-
|
|
124
|
-
def __init__(self, widget: QtWidgets.QWidget, settings_tree, settings_attributes_tree):
|
|
125
|
-
super().__init__()
|
|
126
|
-
self.parent_widget = widget
|
|
127
|
-
self.h5file_tree: TreeLayout = None
|
|
128
|
-
|
|
129
|
-
self._viewer_widget: QtWidgets.QWidget = None
|
|
130
|
-
self._text_list: QtWidgets.QListWidget = None
|
|
131
|
-
self._pixmap_widget: QtWidgets.QWidget = None
|
|
132
|
-
|
|
133
|
-
self.setup_ui(settings_tree, settings_attributes_tree)
|
|
134
|
-
|
|
135
|
-
def setup_ui(self, settings_tree, settings_attributes_tree):
|
|
136
|
-
layout = QtWidgets.QGridLayout()
|
|
137
|
-
|
|
138
|
-
v_splitter = QtWidgets.QSplitter(Qt.Vertical)
|
|
139
|
-
v_splitter2 = QtWidgets.QSplitter(Qt.Vertical)
|
|
140
|
-
h_splitter = QtWidgets.QSplitter(Qt.Horizontal)
|
|
141
|
-
|
|
142
|
-
widget = QtWidgets.QWidget()
|
|
143
|
-
# self.ui.h5file_tree = TreeLayout(Form,col_counts=2,labels=["Node",'Pixmap'])
|
|
144
|
-
self.h5file_tree = TreeLayout(widget, col_counts=1, labels=["Node"])
|
|
145
|
-
self.h5file_tree.tree.setMinimumWidth(300)
|
|
146
|
-
|
|
147
|
-
self.h5file_tree.item_clicked_sig.connect(self.item_clicked_sig.emit)
|
|
148
|
-
self.h5file_tree.item_double_clicked_sig.connect(self.item_double_clicked_sig.emit)
|
|
149
|
-
|
|
150
|
-
v_splitter.addWidget(widget)
|
|
151
|
-
v_splitter.addWidget(settings_attributes_tree)
|
|
152
|
-
|
|
153
|
-
h_splitter.addWidget(v_splitter)
|
|
154
|
-
self._pixmap_widget = QtWidgets.QWidget()
|
|
155
|
-
self._pixmap_widget.setMaximumHeight(100)
|
|
156
|
-
v_splitter2.addWidget(self._pixmap_widget)
|
|
157
|
-
|
|
158
|
-
v_splitter2.addWidget(settings_tree)
|
|
159
|
-
self._text_list = QtWidgets.QListWidget()
|
|
160
|
-
|
|
161
|
-
v_splitter2.addWidget(self._text_list)
|
|
162
|
-
h_splitter.addWidget(v_splitter2)
|
|
163
|
-
self._viewer_widget = QtWidgets.QWidget()
|
|
164
|
-
h_splitter.addWidget(self._viewer_widget)
|
|
165
|
-
layout.addWidget(h_splitter)
|
|
166
|
-
self.parent_widget.setLayout(layout)
|
|
167
|
-
|
|
168
|
-
def current_node_path(self):
|
|
169
|
-
return self.h5file_tree.current_node_path()
|
|
170
|
-
|
|
171
|
-
def add_actions(self, actions: List[QtWidgets.QAction]):
|
|
172
|
-
for action in actions:
|
|
173
|
-
self.h5file_tree.tree.addAction(action)
|
|
174
|
-
|
|
175
|
-
@property
|
|
176
|
-
def viewer_widget(self):
|
|
177
|
-
return self._viewer_widget
|
|
178
|
-
|
|
179
|
-
@property
|
|
180
|
-
def text_list(self):
|
|
181
|
-
return self._text_list
|
|
182
|
-
|
|
183
|
-
@property
|
|
184
|
-
def pixmap_widget(self):
|
|
185
|
-
return self._pixmap_widget
|
|
186
|
-
|
|
187
|
-
def clear(self):
|
|
188
|
-
self.h5file_tree.tree.clear()
|
|
189
|
-
|
|
190
|
-
def add_base_item(self, base_tree_item):
|
|
191
|
-
self.h5file_tree.tree.addTopLevelItem(base_tree_item)
|
|
192
|
-
|
|
193
|
-
def add_widget_to_tree(self, pixmap_items):
|
|
194
|
-
for item in pixmap_items:
|
|
195
|
-
widget = QtWidgets.QWidget()
|
|
196
|
-
|
|
197
|
-
vLayout = QtWidgets.QVBoxLayout()
|
|
198
|
-
label1D = QtWidgets.QLabel()
|
|
199
|
-
bytes = QByteArray(item['node'].attrs['pixmap1D'])
|
|
200
|
-
im1 = QtGui.QImage.fromData(bytes)
|
|
201
|
-
a = QtGui.QPixmap.fromImage(im1)
|
|
202
|
-
label1D.setPixmap(a)
|
|
203
|
-
|
|
204
|
-
label2D = QtWidgets.QLabel()
|
|
205
|
-
bytes = QByteArray(item['node'].attrs['pixmap2D'])
|
|
206
|
-
im2 = QtGui.QImage.fromData(bytes)
|
|
207
|
-
b = QtGui.QPixmap.fromImage(im2)
|
|
208
|
-
label2D.setPixmap(b)
|
|
209
|
-
|
|
210
|
-
vLayout.addWidget(label1D)
|
|
211
|
-
vLayout.addwidget(label2D)
|
|
212
|
-
widget.setLayout(vLayout)
|
|
213
|
-
self.h5file_tree.tree.setItemWidget(item['item'], 1, widget)
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
class H5Browser(QObject, ActionManager):
|
|
217
|
-
"""UI used to explore h5 files, plot and export subdatas
|
|
218
|
-
|
|
219
|
-
Parameters
|
|
220
|
-
----------
|
|
221
|
-
parent: QtWidgets container
|
|
222
|
-
either a QWidget or a QMainWindow
|
|
223
|
-
h5file: h5file instance
|
|
224
|
-
exact type depends on the backend
|
|
225
|
-
h5file_path: str or Path
|
|
226
|
-
if specified load the corresponding file, otherwise open a select file dialog
|
|
227
|
-
backend: str
|
|
228
|
-
either 'tables, 'h5py' or 'h5pyd'
|
|
229
|
-
|
|
230
|
-
See Also
|
|
231
|
-
--------
|
|
232
|
-
H5Backend, H5Backend
|
|
233
|
-
"""
|
|
234
|
-
data_node_signal = Signal(str) # the path of a node where data should be monitored, displayed...
|
|
235
|
-
# whatever use from the caller
|
|
236
|
-
status_signal = Signal(str)
|
|
237
|
-
|
|
238
|
-
def __init__(self, parent: QtWidgets.QMainWindow, h5file=None, h5file_path=None, backend='tables'):
|
|
239
|
-
QObject.__init__(self)
|
|
240
|
-
# toolbar = QtWidgets.QToolBar()
|
|
241
|
-
ActionManager.__init__(self) # , toolbar=toolbar)
|
|
242
|
-
|
|
243
|
-
if not isinstance(parent, QtWidgets.QMainWindow):
|
|
244
|
-
raise Exception('no valid parent container, expected a QMainWindow')
|
|
245
|
-
|
|
246
|
-
self.main_window = parent
|
|
247
|
-
self.parent_widget = QtWidgets.QWidget()
|
|
248
|
-
self.main_window.setCentralWidget(self.parent_widget)
|
|
249
|
-
#self.main_window.addToolBar(self.toolbar)
|
|
250
|
-
|
|
251
|
-
self.current_node_path = None
|
|
252
|
-
|
|
253
|
-
self.settings_attributes = ParameterManager()
|
|
254
|
-
self.settings = ParameterManager()
|
|
255
|
-
|
|
256
|
-
# construct the UI interface
|
|
257
|
-
self.view = View(self.parent_widget, settings_tree=self.settings.settings_tree,
|
|
258
|
-
settings_attributes_tree=self.settings_attributes.settings_tree)
|
|
259
|
-
self.view.item_clicked_sig.connect(self.show_h5_attributes)
|
|
260
|
-
self.view.item_double_clicked_sig.connect(self.show_h5_data)
|
|
261
|
-
self.hyper_viewer = ViewerND(self.view.viewer_widget)
|
|
262
|
-
|
|
263
|
-
self.setup_actions()
|
|
264
|
-
self.setup_menu()
|
|
265
|
-
self.connect_things()
|
|
266
|
-
|
|
267
|
-
# construct the h5 interface and load the file (or open a select file message)
|
|
268
|
-
self.h5utils = H5BrowserUtil(backend=backend)
|
|
269
|
-
self.data_loader = None
|
|
270
|
-
self.load_file(h5file, h5file_path)
|
|
271
|
-
|
|
272
|
-
def connect_things(self):
|
|
273
|
-
self.connect_action('export', self.export_data)
|
|
274
|
-
self.connect_action('comment', self.add_comments)
|
|
275
|
-
self.connect_action('load', lambda: self.load_file(None, None))
|
|
276
|
-
self.connect_action('save', self.save_file)
|
|
277
|
-
self.connect_action('quit', self.quit_fun)
|
|
278
|
-
self.connect_action('about', self.show_about)
|
|
279
|
-
self.connect_action('help', self.show_help)
|
|
280
|
-
self.connect_action('log', self.show_log)
|
|
281
|
-
|
|
282
|
-
self.connect_action('plot_node', lambda: self.get_node_and_plot(False))
|
|
283
|
-
self.connect_action('plot_nodes', lambda: self.get_node_and_plot(False, True))
|
|
284
|
-
self.connect_action('plot_node_with_bkg', lambda: self.get_node_and_plot(True))
|
|
285
|
-
self.connect_action('plot_nodes_with_bkg', lambda: self.get_node_and_plot(True, True))
|
|
286
|
-
|
|
287
|
-
self.status_signal.connect(self.add_log)
|
|
288
|
-
|
|
289
|
-
def get_node_and_plot(self, with_bkg, plot_all=False):
|
|
290
|
-
self.show_h5_data(item=None, with_bkg=with_bkg, plot_all=plot_all)
|
|
291
|
-
|
|
292
|
-
def load_file(self, h5file=None, h5file_path=None):
|
|
293
|
-
if h5file is None:
|
|
294
|
-
if h5file_path is None:
|
|
295
|
-
h5file_path = select_file(save=False, ext=['h5', 'hdf5'])
|
|
296
|
-
if Path(h5file_path).is_file():
|
|
297
|
-
if self.h5utils.isopen():
|
|
298
|
-
self.h5utils.close_file()
|
|
299
|
-
|
|
300
|
-
self.h5utils.open_file(h5file_path, 'r+')
|
|
301
|
-
else:
|
|
302
|
-
return
|
|
303
|
-
else:
|
|
304
|
-
self.h5utils.h5file = h5file
|
|
305
|
-
|
|
306
|
-
self.data_loader = data_saving.DataLoader(self.h5utils)
|
|
307
|
-
self.check_version()
|
|
308
|
-
self.populate_tree()
|
|
309
|
-
self.view.h5file_tree.expand_all()
|
|
310
|
-
|
|
311
|
-
def setup_menu(self):
|
|
312
|
-
menubar = self.main_window.menuBar()
|
|
313
|
-
file_menu = menubar.addMenu('File')
|
|
314
|
-
self.affect_to('load', file_menu)
|
|
315
|
-
self.affect_to('save', file_menu)
|
|
316
|
-
file_menu.addSeparator()
|
|
317
|
-
self.affect_to('quit', file_menu)
|
|
318
|
-
|
|
319
|
-
help_menu = menubar.addMenu('?')
|
|
320
|
-
self.affect_to('about', help_menu)
|
|
321
|
-
self.affect_to('help', help_menu)
|
|
322
|
-
self.affect_to('log', help_menu)
|
|
323
|
-
|
|
324
|
-
def setup_actions(self):
|
|
325
|
-
self.add_action('export', 'Export as', 'SaveAs', tip='Export node content (and children) as ',
|
|
326
|
-
toolbar=self.toolbar)
|
|
327
|
-
self.add_action('comment', 'Add Comment', 'properties', tip='Add comments to the node',
|
|
328
|
-
toolbar=self.toolbar)
|
|
329
|
-
self.add_action('plot_node', 'Plot Node', 'color', tip='Plot the current node',
|
|
330
|
-
toolbar=self.toolbar)
|
|
331
|
-
self.add_action('plot_nodes', 'Plot Nodes', 'color', tip='Plot all nodes hanging from the same parent',
|
|
332
|
-
toolbar=self.toolbar)
|
|
333
|
-
self.add_action('plot_node_with_bkg', 'Plot Node With Bkg', 'color', tip='Plot the current node with background'
|
|
334
|
-
' substraction if possible',
|
|
335
|
-
toolbar=self.toolbar)
|
|
336
|
-
self.add_action('plot_nodes_with_bkg', 'Plot Nodes With Bkg', 'color', tip='Plot all nodes hanging from'
|
|
337
|
-
' the same parent with background'
|
|
338
|
-
' substraction if possible',
|
|
339
|
-
toolbar=self.toolbar)
|
|
340
|
-
self.view.add_actions([self.get_action('export'), self.get_action('comment'),
|
|
341
|
-
self.get_action('plot_node'), self.get_action('plot_nodes'),
|
|
342
|
-
self.get_action('plot_node_with_bkg'),
|
|
343
|
-
self.get_action('plot_nodes_with_bkg')])
|
|
344
|
-
|
|
345
|
-
self.add_action('load', 'Load File', 'Open', tip='Open a new file')
|
|
346
|
-
self.add_action('save', 'Save File as', 'SaveAs', tip='Save as another file')
|
|
347
|
-
self.add_action('quit', 'Quit the application', 'Exit', tip='Quit the application')
|
|
348
|
-
self.add_action('about', 'About', tip='About')
|
|
349
|
-
self.add_action('help', 'Help', 'Help', tip='Show documentation', shortcut=QtCore.Qt.Key_F1)
|
|
350
|
-
self.add_action('log', 'Show Log', 'information2', tip='Open Log')
|
|
351
|
-
|
|
352
|
-
def check_version(self):
|
|
353
|
-
"""Check version of PyMoDAQ to assert if file is compatible or not with the current version of the Browser"""
|
|
354
|
-
if 'pymodaq_version' in self.h5utils.root().attrs.attrs_name:
|
|
355
|
-
if version_mod.parse(self.h5utils.root().attrs['pymodaq_version']) < version_mod.parse('4.0.0a0'):
|
|
356
|
-
msg_box = messagebox(severity='warning', title='Invalid version',
|
|
357
|
-
text=f"Your file has been saved using PyMoDAQ "
|
|
358
|
-
f"version {self.h5utils.root().attrs['pymodaq_version']} "
|
|
359
|
-
f"while you're using version: {utils.get_version()}\n"
|
|
360
|
-
f"Please create and use an adapted environment to use this"
|
|
361
|
-
f" version (up to 3.x.y):\n"
|
|
362
|
-
f"pip install pymodaq==3.x.y")
|
|
363
|
-
self.quit_fun()
|
|
364
|
-
|
|
365
|
-
def add_comments(self, status: bool, comment=''):
|
|
366
|
-
"""Add comments to a node
|
|
367
|
-
|
|
368
|
-
Parameters
|
|
369
|
-
----------
|
|
370
|
-
status: bool
|
|
371
|
-
comment: str
|
|
372
|
-
The comment to be added in a comment attribute to the current node path
|
|
373
|
-
|
|
374
|
-
See Also
|
|
375
|
-
--------
|
|
376
|
-
current_node_path
|
|
377
|
-
"""
|
|
378
|
-
try:
|
|
379
|
-
self.current_node_path = self.get_tree_node_path()
|
|
380
|
-
node = self.h5utils.get_node(self.current_node_path)
|
|
381
|
-
if 'comments' in node.attrs.attrs_name:
|
|
382
|
-
tmp = node.attrs['comments']
|
|
383
|
-
else:
|
|
384
|
-
tmp = ''
|
|
385
|
-
if comment == '':
|
|
386
|
-
text, res = QtWidgets.QInputDialog.getMultiLineText(None, 'Enter comments', 'Enter comments here:', tmp)
|
|
387
|
-
if res and text != '':
|
|
388
|
-
comment = text
|
|
389
|
-
node.attrs['comments'] = comment
|
|
390
|
-
else:
|
|
391
|
-
node.attrs['comments'] = tmp + comment
|
|
392
|
-
|
|
393
|
-
self.h5utils.flush()
|
|
394
|
-
|
|
395
|
-
except Exception as e:
|
|
396
|
-
logger.exception(str(e))
|
|
397
|
-
|
|
398
|
-
def get_tree_node_path(self):
|
|
399
|
-
"""Get the node path of the currently selected node in the UI"""
|
|
400
|
-
return self.view.current_node_path()
|
|
401
|
-
|
|
402
|
-
def export_data(self):
|
|
403
|
-
"""Opens a dialog to export data
|
|
404
|
-
|
|
405
|
-
See Also
|
|
406
|
-
--------
|
|
407
|
-
H5BrowserUtil.export_data
|
|
408
|
-
"""
|
|
409
|
-
try:
|
|
410
|
-
file_filter = ExporterFactory.get_file_filters()
|
|
411
|
-
file, selected_filter = select_file_filter(save=True, filter=file_filter)
|
|
412
|
-
self.current_node_path = self.get_tree_node_path()
|
|
413
|
-
if file != '':
|
|
414
|
-
self.h5utils.export_data(self.current_node_path, str(file), selected_filter)
|
|
415
|
-
|
|
416
|
-
except Exception as e:
|
|
417
|
-
logger.exception(str(e))
|
|
418
|
-
|
|
419
|
-
def save_file(self, filename=None):
|
|
420
|
-
|
|
421
|
-
if filename is None:
|
|
422
|
-
filename = select_file(save=True, ext='txt')
|
|
423
|
-
if filename != '':
|
|
424
|
-
self.h5utils.save_file(filename)
|
|
425
|
-
|
|
426
|
-
def quit_fun(self):
|
|
427
|
-
"""
|
|
428
|
-
"""
|
|
429
|
-
try:
|
|
430
|
-
self.h5utils.close_file()
|
|
431
|
-
if self.main_window is None:
|
|
432
|
-
self.parent_widget.close()
|
|
433
|
-
else:
|
|
434
|
-
self.main_window.close()
|
|
435
|
-
except Exception as e:
|
|
436
|
-
logger.exception(str(e))
|
|
437
|
-
|
|
438
|
-
def show_about(self):
|
|
439
|
-
splash_path = os.path.join(os.path.split(os.path.split(__file__)[0])[0], 'splash.png')
|
|
440
|
-
splash = QtGui.QPixmap(splash_path)
|
|
441
|
-
self.splash_sc = QtWidgets.QSplashScreen(splash, QtCore.Qt.WindowStaysOnTopHint)
|
|
442
|
-
self.splash_sc.setVisible(True)
|
|
443
|
-
self.splash_sc.showMessage(f"PyMoDAQ version {utils.get_version()}\n"
|
|
444
|
-
f"Modular Acquisition with Python\nWritten by Sébastien Weber",
|
|
445
|
-
QtCore.Qt.AlignRight, QtCore.Qt.white)
|
|
446
|
-
|
|
447
|
-
@staticmethod
|
|
448
|
-
def show_log():
|
|
449
|
-
webbrowser.open(logging.getLogger('pymodaq').handlers[0].baseFilename)
|
|
450
|
-
|
|
451
|
-
@staticmethod
|
|
452
|
-
def show_help():
|
|
453
|
-
QtGui.QDesktopServices.openUrl(QtCore.QUrl("http://pymodaq.cnrs.fr"))
|
|
454
|
-
|
|
455
|
-
@staticmethod
|
|
456
|
-
def add_log(txt):
|
|
457
|
-
logger.info(txt)
|
|
458
|
-
|
|
459
|
-
def show_h5_attributes(self, item=None):
|
|
460
|
-
try:
|
|
461
|
-
self.current_node_path = self.get_tree_node_path()
|
|
462
|
-
|
|
463
|
-
attr_dict, settings, scan_settings, pixmaps = self.h5utils.get_h5_attributes(self.current_node_path)
|
|
464
|
-
|
|
465
|
-
for child in self.settings_attributes.settings.children():
|
|
466
|
-
child.remove()
|
|
467
|
-
params = []
|
|
468
|
-
for attr in attr_dict:
|
|
469
|
-
params.append({'title': attr, 'name': attr, 'type': 'str', 'value': attr_dict[attr],
|
|
470
|
-
'readonly': True})
|
|
471
|
-
self.settings_attributes.settings.addChildren(params)
|
|
472
|
-
|
|
473
|
-
if settings is not None:
|
|
474
|
-
for child in self.settings.settings.children():
|
|
475
|
-
child.remove()
|
|
476
|
-
QtWidgets.QApplication.processEvents() # so that the tree associated with settings updates
|
|
477
|
-
params = ioxml.XML_string_to_parameter(settings)
|
|
478
|
-
self.settings.settings.addChildren(params)
|
|
479
|
-
|
|
480
|
-
if scan_settings is not None:
|
|
481
|
-
params = ioxml.XML_string_to_parameter(scan_settings)
|
|
482
|
-
self.settings.settings.addChildren(params)
|
|
483
|
-
|
|
484
|
-
if pixmaps == []:
|
|
485
|
-
self.view.pixmap_widget.setVisible(False)
|
|
486
|
-
else:
|
|
487
|
-
self.view.pixmap_widget.setVisible(True)
|
|
488
|
-
self.show_pixmaps(pixmaps)
|
|
489
|
-
|
|
490
|
-
except Exception as e:
|
|
491
|
-
logger.exception(str(e))
|
|
492
|
-
|
|
493
|
-
def show_pixmaps(self, pixmaps=[]):
|
|
494
|
-
if self.view.pixmap_widget.layout() is None:
|
|
495
|
-
self.view.pixmap_widget.setLayout(QtWidgets.QHBoxLayout())
|
|
496
|
-
while 1:
|
|
497
|
-
child = self.view.pixmap_widget.layout().takeAt(0)
|
|
498
|
-
if not child:
|
|
499
|
-
break
|
|
500
|
-
child.widget().deleteLater()
|
|
501
|
-
QtWidgets.QApplication.processEvents()
|
|
502
|
-
labs = []
|
|
503
|
-
for pix in pixmaps:
|
|
504
|
-
labs.append(pngbinary2Qlabel(pix))
|
|
505
|
-
self.view.pixmap_widget.layout().addWidget(labs[-1])
|
|
506
|
-
|
|
507
|
-
def show_h5_data(self, item, with_bkg=False, plot_all=False):
|
|
508
|
-
"""
|
|
509
|
-
|
|
510
|
-
Parameters
|
|
511
|
-
----------
|
|
512
|
-
item
|
|
513
|
-
with_bkg
|
|
514
|
-
plot_all
|
|
515
|
-
|
|
516
|
-
Returns
|
|
517
|
-
-------
|
|
518
|
-
|
|
519
|
-
"""
|
|
520
|
-
try:
|
|
521
|
-
if item is None:
|
|
522
|
-
self.current_node_path = self.get_tree_node_path()
|
|
523
|
-
self.show_h5_attributes()
|
|
524
|
-
node = self.h5utils.get_node(self.current_node_path)
|
|
525
|
-
self.data_node_signal.emit(self.current_node_path)
|
|
526
|
-
|
|
527
|
-
if 'data_type' in node.attrs and node.attrs['data_type'] == 'strings':
|
|
528
|
-
self.view.text_list.clear()
|
|
529
|
-
for txt in node.read():
|
|
530
|
-
self.view.text_list.addItem(txt)
|
|
531
|
-
elif 'data_type' in node.attrs:
|
|
532
|
-
data_with_axes = self.data_loader.load_data(node, with_bkg=with_bkg, load_all=plot_all)
|
|
533
|
-
self.hyper_viewer.show_data(data_with_axes, force_update=True)
|
|
534
|
-
|
|
535
|
-
except Exception as e:
|
|
536
|
-
logger.exception(str(e))
|
|
537
|
-
|
|
538
|
-
def populate_tree(self):
|
|
539
|
-
"""
|
|
540
|
-
| Init the ui-tree and store data into calling the h5_tree_to_Qtree convertor method
|
|
541
|
-
|
|
542
|
-
See Also
|
|
543
|
-
--------
|
|
544
|
-
h5tree_to_QTree, update_status
|
|
545
|
-
"""
|
|
546
|
-
try:
|
|
547
|
-
if self.h5utils.h5file is not None:
|
|
548
|
-
self.view.clear()
|
|
549
|
-
base_node = self.h5utils.root()
|
|
550
|
-
base_tree_item, pixmap_items = h5tree_to_QTree(base_node)
|
|
551
|
-
self.view.add_base_item(base_tree_item)
|
|
552
|
-
self.view.add_widget_to_tree(pixmap_items)
|
|
553
|
-
|
|
554
|
-
except Exception as e:
|
|
555
|
-
logger.exception(str(e))
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
def browse_data(fname=None, ret_all=False, message=None) -> Tuple[data_saving.DataWithAxes, str, str]:
|
|
559
|
-
"""Browse data present in any h5 file using the H5Browser within a dialog window
|
|
560
|
-
when the user has selected a given node, return its content
|
|
561
|
-
|
|
562
|
-
Parameters
|
|
563
|
-
----------
|
|
564
|
-
fname: str
|
|
565
|
-
ret_all: bool
|
|
566
|
-
message: str
|
|
567
|
-
|
|
568
|
-
Returns
|
|
569
|
-
-------
|
|
570
|
-
data: DataWithAxes
|
|
571
|
-
if argument ret_all is True, returns also:
|
|
572
|
-
fname: the file name
|
|
573
|
-
node_path: hte path of the selected node within the H5 file tree
|
|
574
|
-
|
|
575
|
-
"""
|
|
576
|
-
if fname is None:
|
|
577
|
-
fname = str(select_file(start_path=config('data_saving', 'h5file', 'save_path'), save=False, ext='h5'))
|
|
578
|
-
|
|
579
|
-
if type(fname) != str:
|
|
580
|
-
try:
|
|
581
|
-
fname = str(fname)
|
|
582
|
-
except Exception:
|
|
583
|
-
raise Exception('filename in browse data is not valid')
|
|
584
|
-
if fname != '':
|
|
585
|
-
(root, ext) = os.path.splitext(fname)
|
|
586
|
-
if not ('h5' in ext or 'hdf5' in ext):
|
|
587
|
-
warnings.warn('This is not a PyMODAQ h5 file, there could be issues', Warning)
|
|
588
|
-
|
|
589
|
-
form = QtWidgets.QMainWindow()
|
|
590
|
-
browser = H5Browser(form, h5file_path=fname)
|
|
591
|
-
dataloader = data_saving.DataLoader(browser.h5utils)
|
|
592
|
-
dialog = QtWidgets.QDialog()
|
|
593
|
-
vlayout = QtWidgets.QVBoxLayout()
|
|
594
|
-
|
|
595
|
-
vlayout.addWidget(form)
|
|
596
|
-
dialog.setLayout(vlayout)
|
|
597
|
-
buttonBox = QtWidgets.QDialogButtonBox(parent=dialog)
|
|
598
|
-
|
|
599
|
-
buttonBox.addButton('OK', buttonBox.AcceptRole)
|
|
600
|
-
buttonBox.accepted.connect(dialog.accept)
|
|
601
|
-
buttonBox.addButton('Cancel', buttonBox.RejectRole)
|
|
602
|
-
buttonBox.rejected.connect(dialog.reject)
|
|
603
|
-
vlayout.addWidget(buttonBox)
|
|
604
|
-
|
|
605
|
-
dialog.setWindowTitle('Select a data node in the tree')
|
|
606
|
-
if message is None or not isinstance(message, str):
|
|
607
|
-
dialog.setWindowTitle('Select a data node in the tree')
|
|
608
|
-
else:
|
|
609
|
-
dialog.setWindowTitle(message)
|
|
610
|
-
res = dialog.exec()
|
|
611
|
-
|
|
612
|
-
if res == dialog.Accepted:
|
|
613
|
-
node_path = browser.current_node_path
|
|
614
|
-
data = dataloader.load_data(node_path, with_bkg=True)
|
|
615
|
-
else:
|
|
616
|
-
data = None
|
|
617
|
-
node_path = None
|
|
618
|
-
|
|
619
|
-
browser.h5utils.close_file()
|
|
620
|
-
|
|
621
|
-
if ret_all:
|
|
622
|
-
return data, fname, node_path
|
|
623
|
-
else:
|
|
624
|
-
return data
|
|
625
|
-
return None, '', ''
|
|
626
|
-
|
|
627
|
-
|