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
pymodaq/utils/h5modules/utils.py
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
Created the 19/01/2023
|
|
4
|
-
|
|
5
|
-
@author: Sebastien Weber and N Tappy
|
|
6
|
-
"""
|
|
7
|
-
# Standard imports
|
|
8
|
-
from collections import OrderedDict
|
|
9
|
-
from typing import List, Dict
|
|
10
|
-
from pathlib import Path
|
|
11
|
-
from importlib import import_module
|
|
12
|
-
from ..daq_utils import get_entrypoints
|
|
13
|
-
|
|
14
|
-
# 3rd party imports
|
|
15
|
-
import numpy as np
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def register_exporter(parent_module_name: str = 'pymodaq.utils.h5modules'):
|
|
19
|
-
exporters = []
|
|
20
|
-
try:
|
|
21
|
-
exporter_module = import_module(f'{parent_module_name}.exporters')
|
|
22
|
-
|
|
23
|
-
exporter_path = Path(exporter_module.__path__[0])
|
|
24
|
-
|
|
25
|
-
for file in exporter_path.iterdir():
|
|
26
|
-
if file.is_file() and 'py' in file.suffix and file.stem != '__init__':
|
|
27
|
-
try:
|
|
28
|
-
exporters.append(import_module(f'.{file.stem}', exporter_module.__name__))
|
|
29
|
-
except ModuleNotFoundError:
|
|
30
|
-
pass
|
|
31
|
-
except ModuleNotFoundError:
|
|
32
|
-
pass
|
|
33
|
-
finally:
|
|
34
|
-
return exporters
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def register_exporters() -> list:
|
|
38
|
-
exporters = register_exporter('pymodaq.utils.h5modules')
|
|
39
|
-
discovered_exporter_plugins = get_entrypoints('pymodaq.h5exporters')
|
|
40
|
-
for entry in discovered_exporter_plugins:
|
|
41
|
-
exporters.extend(register_exporter(entry.value))
|
|
42
|
-
return exporters
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def find_scan_node(scan_node):
|
|
46
|
-
"""
|
|
47
|
-
utility function to find the parent node of "scan" type, meaning some of its children (DAQ_scan case)
|
|
48
|
-
or co-nodes (daq_logger case) are navigation axes
|
|
49
|
-
Parameters
|
|
50
|
-
----------
|
|
51
|
-
scan_node: (pytables node)
|
|
52
|
-
data node from where this function look for its navigation axes if any
|
|
53
|
-
Returns
|
|
54
|
-
-------
|
|
55
|
-
node: the parent node of 'scan' type
|
|
56
|
-
list: the data nodes of type 'navigation_axis' corresponding to the initial data node
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"""
|
|
60
|
-
try:
|
|
61
|
-
while True:
|
|
62
|
-
if scan_node.attrs['type'] == 'scan':
|
|
63
|
-
break
|
|
64
|
-
else:
|
|
65
|
-
scan_node = scan_node.parent_node
|
|
66
|
-
children = list(scan_node.children().values()) # for data saved using daq_scan
|
|
67
|
-
children.extend([scan_node.parent_node.children()[child] for child in
|
|
68
|
-
scan_node.parent_node.children_name()]) # for data saved using the daq_logger
|
|
69
|
-
nav_children = []
|
|
70
|
-
for child in children:
|
|
71
|
-
if 'type' in child.attrs.attrs_name:
|
|
72
|
-
if child.attrs['type'] == 'navigation_axis':
|
|
73
|
-
nav_children.append(child)
|
|
74
|
-
return scan_node, nav_children
|
|
75
|
-
except Exception:
|
|
76
|
-
return None, []
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def get_h5_attributes(self, node_path):
|
|
80
|
-
"""
|
|
81
|
-
"""
|
|
82
|
-
node = self.get_node(node_path)
|
|
83
|
-
attrs_names = node.attrs.attrs_name
|
|
84
|
-
attr_dict = OrderedDict([])
|
|
85
|
-
for attr in attrs_names:
|
|
86
|
-
# if attr!='settings':
|
|
87
|
-
attr_dict[attr] = node.attrs[attr]
|
|
88
|
-
|
|
89
|
-
settings = None
|
|
90
|
-
scan_settings = None
|
|
91
|
-
if 'settings' in attrs_names:
|
|
92
|
-
if node.attrs['settings'] != '':
|
|
93
|
-
settings = node.attrs['settings']
|
|
94
|
-
|
|
95
|
-
if 'scan_settings' in attrs_names:
|
|
96
|
-
if node.attrs['scan_settings'] != '':
|
|
97
|
-
scan_settings = node.attrs['scan_settings']
|
|
98
|
-
pixmaps = []
|
|
99
|
-
for attr in attrs_names:
|
|
100
|
-
if 'pixmap' in attr:
|
|
101
|
-
pixmaps.append(node.attrs[attr])
|
|
102
|
-
|
|
103
|
-
return attr_dict, settings, scan_settings, pixmaps
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
def get_h5_data_from_node():
|
|
107
|
-
pass
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
def extract_axis():
|
|
111
|
-
pass
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
def verify_axis_data_uniformity():
|
|
115
|
-
pass
|
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
import warnings
|
|
2
|
-
|
|
3
|
-
import pymodaq.utils.messenger
|
|
4
|
-
from multipledispatch import dispatch
|
|
5
|
-
from typing import Union, Callable, List
|
|
6
|
-
|
|
7
|
-
from qtpy import QtGui, QtWidgets, QtCore
|
|
8
|
-
from qtpy.QtWidgets import QAction
|
|
9
|
-
|
|
10
|
-
from pymodaq.resources.QtDesigner_Ressources import QtDesigner_ressources_rc
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def create_icon(icon_name: str):
|
|
15
|
-
icon = QtGui.QIcon()
|
|
16
|
-
if Path(icon_name).is_file():
|
|
17
|
-
icon.addPixmap(QtGui.QPixmap(icon_name), QtGui.QIcon.Normal,
|
|
18
|
-
QtGui.QIcon.Off)
|
|
19
|
-
else:
|
|
20
|
-
icon.addPixmap(QtGui.QPixmap(f":/icons/Icon_Library/{icon_name}.png"), QtGui.QIcon.Normal,
|
|
21
|
-
QtGui.QIcon.Off)
|
|
22
|
-
return icon
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class QAction(QAction):
|
|
26
|
-
"""
|
|
27
|
-
QAction subclass to mimic signals as pushbuttons. Done to be sure of backcompatibility when I moved from
|
|
28
|
-
pushbuttons to QAction
|
|
29
|
-
"""
|
|
30
|
-
def __init__(self, *args, **kwargs):
|
|
31
|
-
super().__init__(*args, **kwargs)
|
|
32
|
-
|
|
33
|
-
def click(self):
|
|
34
|
-
pymodaq.utils.messenger.deprecation_msg("click for PyMoDAQ's QAction is deprecated, use *trigger*",
|
|
35
|
-
stacklevel=3)
|
|
36
|
-
self.trigger()
|
|
37
|
-
|
|
38
|
-
@property
|
|
39
|
-
def clicked(self):
|
|
40
|
-
pymodaq.utils.messenger.deprecation_msg("clicked for PyMoDAQ's QAction is deprecated, use *trigger*",
|
|
41
|
-
stacklevel=3)
|
|
42
|
-
return self.triggered
|
|
43
|
-
|
|
44
|
-
def connect_to(self, slot):
|
|
45
|
-
self.triggered.connect(slot)
|
|
46
|
-
|
|
47
|
-
def set_icon(self, icon_name: str):
|
|
48
|
-
self.setIcon(create_icon(icon_name))
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def addaction(name: str = '', icon_name: str = '', tip='', checkable=False, checked=False,
|
|
52
|
-
slot: Callable = None, toolbar: QtWidgets.QToolBar = None,
|
|
53
|
-
menu: QtWidgets.QMenu = None, visible=True, shortcut=None,
|
|
54
|
-
enabled=True):
|
|
55
|
-
"""Create a new action and add it eventually to a toolbar and a menu
|
|
56
|
-
|
|
57
|
-
Parameters
|
|
58
|
-
----------
|
|
59
|
-
name: str
|
|
60
|
-
Displayed name if should be displayed (for instance in menus)
|
|
61
|
-
icon_name: str
|
|
62
|
-
png file name to produce the icon
|
|
63
|
-
tip: str
|
|
64
|
-
a tooltip to be displayed when hovering above the action
|
|
65
|
-
checkable: bool
|
|
66
|
-
set the checkable state of the action
|
|
67
|
-
checked: bool
|
|
68
|
-
set the current state of the action
|
|
69
|
-
slot: callable
|
|
70
|
-
Method or function that will be called when the action is triggered
|
|
71
|
-
toolbar: QToolBar
|
|
72
|
-
a toolbar where action should be added.
|
|
73
|
-
menu: QMenu
|
|
74
|
-
a menu where action should be added.
|
|
75
|
-
visible: bool
|
|
76
|
-
display or not the action in the toolbar/menu
|
|
77
|
-
shortcut: str
|
|
78
|
-
a string defining a shortcut for this action
|
|
79
|
-
enabled: bool
|
|
80
|
-
set the enabled state
|
|
81
|
-
"""
|
|
82
|
-
if icon_name != '':
|
|
83
|
-
action = QAction(create_icon(icon_name), name, None)
|
|
84
|
-
else:
|
|
85
|
-
action = QAction(name)
|
|
86
|
-
|
|
87
|
-
if slot is not None:
|
|
88
|
-
action.connect_to(slot)
|
|
89
|
-
action.setCheckable(checkable)
|
|
90
|
-
if checkable:
|
|
91
|
-
action.setChecked(checked)
|
|
92
|
-
action.setToolTip(tip)
|
|
93
|
-
if toolbar is not None:
|
|
94
|
-
toolbar.addAction(action)
|
|
95
|
-
if menu is not None:
|
|
96
|
-
menu.addAction(action)
|
|
97
|
-
if shortcut is not None:
|
|
98
|
-
action.setShortcut(shortcut)
|
|
99
|
-
action.setVisible(visible)
|
|
100
|
-
action.setEnabled(enabled)
|
|
101
|
-
return action
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
def addwidget(klass: Union[str, QtWidgets.QWidget], *args, tip='', toolbar: QtWidgets.QToolBar = None, visible=True,
|
|
105
|
-
signal_str=None, slot: Callable=None, setters = {}, **kwargs):
|
|
106
|
-
"""Create and eventually add a widget to a toolbar
|
|
107
|
-
|
|
108
|
-
Parameters
|
|
109
|
-
----------
|
|
110
|
-
klass: str or QWidget
|
|
111
|
-
should be a custom widget class or the name of a standard widget of QWidgets
|
|
112
|
-
args: list
|
|
113
|
-
variable arguments passed as is to the widget constructor
|
|
114
|
-
tip: str
|
|
115
|
-
a tooltip to be displayed when hovering above the widget
|
|
116
|
-
toolbar: QToolBar
|
|
117
|
-
a toolbar where the widget should be added.
|
|
118
|
-
visible: bool
|
|
119
|
-
display or not the action in the toolbar/menu
|
|
120
|
-
signal_str: str
|
|
121
|
-
an attribute of type Signal of the widget
|
|
122
|
-
slot: Callable
|
|
123
|
-
a callable connected to the signal
|
|
124
|
-
kwargs: dict
|
|
125
|
-
variable named arguments used as is in the widget constructor
|
|
126
|
-
setters: dict
|
|
127
|
-
method/value pair of the widget (for instance setMaximumWidth)
|
|
128
|
-
Returns
|
|
129
|
-
-------
|
|
130
|
-
QtWidgets.QWidget
|
|
131
|
-
"""
|
|
132
|
-
if isinstance(klass, str):
|
|
133
|
-
if hasattr(QtWidgets, klass):
|
|
134
|
-
widget: QtWidgets.QWidget = getattr(QtWidgets, klass)(*args)
|
|
135
|
-
else:
|
|
136
|
-
return None
|
|
137
|
-
else:
|
|
138
|
-
try:
|
|
139
|
-
widget = klass(*args, **kwargs)
|
|
140
|
-
except:
|
|
141
|
-
return None
|
|
142
|
-
widget.setVisible(visible)
|
|
143
|
-
widget.setToolTip(tip)
|
|
144
|
-
if toolbar is not None:
|
|
145
|
-
toolbar.addWidget(widget)
|
|
146
|
-
if isinstance(signal_str, str) and slot is not None:
|
|
147
|
-
if hasattr(widget, signal_str):
|
|
148
|
-
getattr(widget, signal_str).connect(slot)
|
|
149
|
-
|
|
150
|
-
for setter in setters:
|
|
151
|
-
if hasattr(widget, setter):
|
|
152
|
-
getattr(widget, setter)(setters[setter])
|
|
153
|
-
|
|
154
|
-
return widget
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
class ActionManager:
|
|
158
|
-
"""MixIn Class to be used by all UserInterface to manage their QActions and the action they are connected to
|
|
159
|
-
|
|
160
|
-
Parameters
|
|
161
|
-
----------
|
|
162
|
-
toolbar: QToolbar, optional
|
|
163
|
-
The toolbar to use as default
|
|
164
|
-
menu: QMenu, option
|
|
165
|
-
The menu to use as default
|
|
166
|
-
"""
|
|
167
|
-
def __init__(self, toolbar=None, menu=None):
|
|
168
|
-
self._actions = dict([])
|
|
169
|
-
self._toolbar = toolbar
|
|
170
|
-
self._menu = menu
|
|
171
|
-
|
|
172
|
-
#self.setup_actions()
|
|
173
|
-
|
|
174
|
-
def setup_actions(self):
|
|
175
|
-
"""Method where to create actions to be subclassed. Mandatory
|
|
176
|
-
|
|
177
|
-
Examples
|
|
178
|
-
--------
|
|
179
|
-
>>> self.add_action('Quit', 'close2', "Quit program")
|
|
180
|
-
>>> self.add_action('Grab', 'camera', "Grab from camera", checkable=True)
|
|
181
|
-
>>> self.add_action('Load', 'Open', "Load target file (.h5, .png, .jpg) or data from camera", checkable=False)
|
|
182
|
-
>>> self.add_action('Save', 'SaveAs', "Save current data", checkable=False)
|
|
183
|
-
|
|
184
|
-
See Also
|
|
185
|
-
--------
|
|
186
|
-
ActionManager.add_action
|
|
187
|
-
"""
|
|
188
|
-
raise NotImplementedError(f'You have to define actions here in the following form:'
|
|
189
|
-
f'{self.setup_actions.__doc__}')
|
|
190
|
-
|
|
191
|
-
def add_action(self, short_name: str = '', name: str = '', icon_name: str = '', tip='',
|
|
192
|
-
checkable=False,
|
|
193
|
-
checked=False, toolbar=None, menu=None,
|
|
194
|
-
visible=True, shortcut=None, auto_toolbar=True, auto_menu=True,
|
|
195
|
-
enabled=True):
|
|
196
|
-
"""Create a new action and add it to toolbar and menu
|
|
197
|
-
|
|
198
|
-
Parameters
|
|
199
|
-
----------
|
|
200
|
-
short_name: str
|
|
201
|
-
the name as referenced in the dict self.actions
|
|
202
|
-
name: str
|
|
203
|
-
Displayed name if should be displayed in
|
|
204
|
-
icon_name: str
|
|
205
|
-
png file name to produce the icon
|
|
206
|
-
tip: str
|
|
207
|
-
a tooltip to be displayed when hovering above the action
|
|
208
|
-
checkable: bool
|
|
209
|
-
set the checkable state of the action
|
|
210
|
-
checked: bool
|
|
211
|
-
set the current state of the action
|
|
212
|
-
toolbar: QToolBar
|
|
213
|
-
a toolbar where action should be added. Actions can also be added later see *affect_to*
|
|
214
|
-
menu: QMenu
|
|
215
|
-
a menu where action should be added. Actions can also be added later see *affect_to*
|
|
216
|
-
visible: bool
|
|
217
|
-
display or not the action in the toolbar/menu
|
|
218
|
-
auto_toolbar: bool
|
|
219
|
-
if True add this action to the defined toolbar
|
|
220
|
-
auto_menu: bool
|
|
221
|
-
if True add this action to the defined menu
|
|
222
|
-
enabled: bool
|
|
223
|
-
set the enabled state of this action
|
|
224
|
-
See Also
|
|
225
|
-
--------
|
|
226
|
-
affect_to, pymodaq.resources.QtDesigner_Ressources.Icon_Library,
|
|
227
|
-
pymodaq.utils.managers.action_manager.add_action
|
|
228
|
-
"""
|
|
229
|
-
if auto_toolbar:
|
|
230
|
-
if toolbar is None:
|
|
231
|
-
toolbar = self._toolbar
|
|
232
|
-
if auto_menu:
|
|
233
|
-
if menu is None:
|
|
234
|
-
menu = self._menu
|
|
235
|
-
self._actions[short_name] = addaction(name, icon_name, tip, checkable=checkable,
|
|
236
|
-
checked=checked, toolbar=toolbar, menu=menu,
|
|
237
|
-
visible=visible, shortcut=shortcut, enabled=enabled)
|
|
238
|
-
|
|
239
|
-
def add_widget(self, short_name, klass: Union[str, QtWidgets.QWidget], *args, tip='',
|
|
240
|
-
toolbar: QtWidgets.QToolBar = None, visible=True, signal_str=None, slot: Callable=None, **kwargs):
|
|
241
|
-
"""Create and add a widget to a toolbar
|
|
242
|
-
|
|
243
|
-
Parameters
|
|
244
|
-
----------
|
|
245
|
-
short_name: str
|
|
246
|
-
the name as referenced in the dict self.actions
|
|
247
|
-
klass: str or QWidget
|
|
248
|
-
should be a custom widget class or the name of a standard widget of QWidgets
|
|
249
|
-
args: list
|
|
250
|
-
variable arguments passed as is to the widget constructor
|
|
251
|
-
tip: str
|
|
252
|
-
a tooltip to be displayed when hovering above the widget
|
|
253
|
-
toolbar: QToolBar
|
|
254
|
-
a toolbar where the widget should be added.
|
|
255
|
-
visible: bool
|
|
256
|
-
display or not the action in the toolbar/menu
|
|
257
|
-
signal_str: str
|
|
258
|
-
an attribute of type Signal of the widget
|
|
259
|
-
slot: Callable
|
|
260
|
-
a callable connected to the signal
|
|
261
|
-
kwargs: dict
|
|
262
|
-
variable named arguments passed as is to the widget constructor
|
|
263
|
-
Returns
|
|
264
|
-
-------
|
|
265
|
-
QtWidgets.QWidget
|
|
266
|
-
"""
|
|
267
|
-
if toolbar is None:
|
|
268
|
-
toolbar = self._toolbar
|
|
269
|
-
widget = addwidget(klass, *args, tip=tip, toolbar=toolbar, visible=visible, signal_str=signal_str,
|
|
270
|
-
slot=slot, **kwargs)
|
|
271
|
-
if widget is not None:
|
|
272
|
-
self._actions[short_name] = widget
|
|
273
|
-
else:
|
|
274
|
-
warnings.warn(UserWarning(f'Impossible to add the widget {short_name} and type {klass} to the toolbar'))
|
|
275
|
-
|
|
276
|
-
def set_toolbar(self, toolbar):
|
|
277
|
-
"""affect a toolbar to self
|
|
278
|
-
|
|
279
|
-
Parameters
|
|
280
|
-
----------
|
|
281
|
-
toolbar:
|
|
282
|
-
QtWidgets.QToolBar
|
|
283
|
-
"""
|
|
284
|
-
self._toolbar = toolbar
|
|
285
|
-
|
|
286
|
-
def set_menu(self, menu):
|
|
287
|
-
"""affect a menu to self
|
|
288
|
-
|
|
289
|
-
Parameters
|
|
290
|
-
----------
|
|
291
|
-
menu:
|
|
292
|
-
QtWidgets.QMenu
|
|
293
|
-
"""
|
|
294
|
-
self._menu = menu
|
|
295
|
-
|
|
296
|
-
def set_action_text(self, action_name: str, text: str):
|
|
297
|
-
"""Convenience method to set the displayed text on an action
|
|
298
|
-
|
|
299
|
-
Parameters
|
|
300
|
-
----------
|
|
301
|
-
action_name: str
|
|
302
|
-
The action name as defined in setup_actions
|
|
303
|
-
text: str
|
|
304
|
-
The text to display
|
|
305
|
-
"""
|
|
306
|
-
self.get_action(action_name).setText(text)
|
|
307
|
-
|
|
308
|
-
@property
|
|
309
|
-
def actions(self) -> List[QAction]:
|
|
310
|
-
return list(self._actions.values())
|
|
311
|
-
|
|
312
|
-
def get_action(self, name) -> QAction:
|
|
313
|
-
"""Getter of a given action
|
|
314
|
-
|
|
315
|
-
Parameters
|
|
316
|
-
----------
|
|
317
|
-
name: str
|
|
318
|
-
The action name as defined in setup_actions
|
|
319
|
-
|
|
320
|
-
Returns
|
|
321
|
-
-------
|
|
322
|
-
QAction
|
|
323
|
-
"""
|
|
324
|
-
if self.has_action(name):
|
|
325
|
-
return self._actions[name]
|
|
326
|
-
else:
|
|
327
|
-
raise KeyError(f'The action with name: {name} is not referenced'
|
|
328
|
-
f' in the view actions: {self._actions.keys()}')
|
|
329
|
-
|
|
330
|
-
def has_action(self, action_name) -> bool:
|
|
331
|
-
"""Check if an action has been defined
|
|
332
|
-
Parameters
|
|
333
|
-
----------
|
|
334
|
-
action_name: str
|
|
335
|
-
The action name as defined in setup_actions
|
|
336
|
-
|
|
337
|
-
Returns
|
|
338
|
-
-------
|
|
339
|
-
bool: True if the action exists, False otherwise
|
|
340
|
-
"""
|
|
341
|
-
return action_name in self._actions
|
|
342
|
-
|
|
343
|
-
@property
|
|
344
|
-
def toolbar(self):
|
|
345
|
-
"""Get the default toolbar"""
|
|
346
|
-
return self._toolbar
|
|
347
|
-
|
|
348
|
-
@property
|
|
349
|
-
def menu(self):
|
|
350
|
-
"""Get the default menu"""
|
|
351
|
-
return self._menu
|
|
352
|
-
|
|
353
|
-
def affect_to(self, action_name, obj: Union[QtWidgets.QToolBar, QtWidgets.QMenu]):
|
|
354
|
-
"""Affect action to an object either a toolbar or a menu
|
|
355
|
-
|
|
356
|
-
Parameters
|
|
357
|
-
----------
|
|
358
|
-
action_name: str
|
|
359
|
-
The action name as defined in setup_actions
|
|
360
|
-
obj: QToolbar or QMenu
|
|
361
|
-
The object where to add the action
|
|
362
|
-
"""
|
|
363
|
-
if isinstance(obj, QtWidgets.QToolBar) or isinstance(obj, QtWidgets.QMenu):
|
|
364
|
-
obj.addAction(self._actions[action_name])
|
|
365
|
-
|
|
366
|
-
def connect_action(self, name, slot, connect=True, signal_name=''):
|
|
367
|
-
"""Connect (or disconnect) the action referenced by name to the given slot
|
|
368
|
-
|
|
369
|
-
Parameters
|
|
370
|
-
----------
|
|
371
|
-
name: str
|
|
372
|
-
key of the action as referenced in the self._actions dict
|
|
373
|
-
slot: method
|
|
374
|
-
a method/function
|
|
375
|
-
connect: bool
|
|
376
|
-
if True connect the trigger signal of the action to the defined slot else disconnect it
|
|
377
|
-
signal_name: str
|
|
378
|
-
try to use it as a signal (for widgets added...) otherwise use the *triggered* signal
|
|
379
|
-
"""
|
|
380
|
-
signal = 'triggered'
|
|
381
|
-
if name in self._actions:
|
|
382
|
-
if hasattr(self._actions[name], signal_name):
|
|
383
|
-
signal = signal_name
|
|
384
|
-
if connect:
|
|
385
|
-
getattr(self._actions[name], signal).connect(slot)
|
|
386
|
-
else:
|
|
387
|
-
try:
|
|
388
|
-
getattr(self._actions[name], signal).disconnect()
|
|
389
|
-
except (TypeError,) as e:
|
|
390
|
-
pass # the action was not connected
|
|
391
|
-
else:
|
|
392
|
-
raise KeyError(f'The action with name: {name} is not referenced'
|
|
393
|
-
f' in the view actions: {self._actions.keys()}')
|
|
394
|
-
|
|
395
|
-
@dispatch(str)
|
|
396
|
-
def is_action_visible(self, action_name: str):
|
|
397
|
-
"""Check the visibility of a given action or the list of an action"""
|
|
398
|
-
if action_name in self._actions:
|
|
399
|
-
return self._actions[action_name].isVisible()
|
|
400
|
-
else:
|
|
401
|
-
raise KeyError(f'The action with name: {action_name} is not referenced'
|
|
402
|
-
f' in the actions list: {self._actions}')
|
|
403
|
-
|
|
404
|
-
@dispatch(list)
|
|
405
|
-
def is_action_visible(self, actions_name: list):
|
|
406
|
-
"""Check the visibility of a given action or the list of an action"""
|
|
407
|
-
isvisible = False
|
|
408
|
-
for action_name in actions_name:
|
|
409
|
-
isvisible = isvisible and self.is_action_visible(action_name)
|
|
410
|
-
return isvisible
|
|
411
|
-
|
|
412
|
-
@dispatch(str)
|
|
413
|
-
def is_action_checked(self, action_name: str):
|
|
414
|
-
"""Get the CheckState of a given action or a list of actions"""
|
|
415
|
-
if action_name in self._actions:
|
|
416
|
-
return self._actions[action_name].isChecked()
|
|
417
|
-
else:
|
|
418
|
-
raise KeyError(f'The action with name: {action_name} is not referenced'
|
|
419
|
-
f' in the actions list: {self._actions}')
|
|
420
|
-
|
|
421
|
-
@dispatch(list)
|
|
422
|
-
def is_action_checked(self, actions_name: list):
|
|
423
|
-
"""Get the CheckState of a given action or a list of actions"""
|
|
424
|
-
ischecked = False
|
|
425
|
-
for action_name in actions_name:
|
|
426
|
-
ischecked = ischecked and self.is_action_checked(action_name)
|
|
427
|
-
return ischecked
|
|
428
|
-
|
|
429
|
-
@dispatch(str, bool)
|
|
430
|
-
def set_action_visible(self, action_name: str, visible=True):
|
|
431
|
-
"""Set the visibility of a given action or a list of an action"""
|
|
432
|
-
if action_name in self._actions:
|
|
433
|
-
self._actions[action_name].setVisible(visible)
|
|
434
|
-
else:
|
|
435
|
-
raise KeyError(f'The action with name: {action_name} is not referenced'
|
|
436
|
-
f' in the actions list: {self._actions}')
|
|
437
|
-
|
|
438
|
-
@dispatch(list, bool)
|
|
439
|
-
def set_action_visible(self, actions_name: list, visible=True):
|
|
440
|
-
"""Set the visibility of a given action or a list of an action"""
|
|
441
|
-
for action_name in actions_name:
|
|
442
|
-
self.set_action_visible(action_name, visible)
|
|
443
|
-
|
|
444
|
-
@dispatch(str, bool)
|
|
445
|
-
def set_action_checked(self, action_name: str, checked=True):
|
|
446
|
-
"""Set the CheckedState of a given action or a list of actions"""
|
|
447
|
-
if action_name in self._actions:
|
|
448
|
-
self._actions[action_name].setChecked(checked)
|
|
449
|
-
else:
|
|
450
|
-
raise KeyError(f'The action with name: {action_name} is not referenced'
|
|
451
|
-
f' in the actions list: {self._actions}')
|
|
452
|
-
|
|
453
|
-
@dispatch(list, bool)
|
|
454
|
-
def set_action_checked(self, actions_name: list, checked=True):
|
|
455
|
-
"""Set the CheckedState of a given action or a list of actions"""
|
|
456
|
-
for action_name in actions_name:
|
|
457
|
-
self.set_action_checked(action_name, checked)
|
|
458
|
-
|
|
459
|
-
@dispatch(str, bool)
|
|
460
|
-
def set_action_enabled(self, action_name: str, enabled=True):
|
|
461
|
-
"""Set the EnabledState of a given action or a list of actions"""
|
|
462
|
-
if action_name in self._actions:
|
|
463
|
-
self._actions[action_name].setEnabled(enabled)
|
|
464
|
-
else:
|
|
465
|
-
raise KeyError(f'The action with name: {action_name} is not referenced'
|
|
466
|
-
f' in the actions list: {self._actions}')
|
|
467
|
-
|
|
468
|
-
@dispatch(list, bool)
|
|
469
|
-
def set_action_enabled(self, actions_name: list, enabled=True):
|
|
470
|
-
"""Set the EnabledState of a given action or a list of actions"""
|
|
471
|
-
for action_name in actions_name:
|
|
472
|
-
self.set_action_enabled(action_name, enabled)
|
|
473
|
-
|
|
474
|
-
@dispatch(str)
|
|
475
|
-
def is_action_enabled(self, action_name: str):
|
|
476
|
-
"""Get the EnabledState of a given action or a list of actions"""
|
|
477
|
-
if action_name in self._actions:
|
|
478
|
-
return self._actions[action_name].isEnabled()
|
|
479
|
-
else:
|
|
480
|
-
raise KeyError(f'The action with name: {action_name} is not referenced'
|
|
481
|
-
f' in the actions list: {self._actions}')
|
|
482
|
-
|
|
483
|
-
@dispatch(list)
|
|
484
|
-
def is_action_checked(self, actions_name: list):
|
|
485
|
-
"""Get the EnabledState of a given action or a list of actions"""
|
|
486
|
-
is_enabled = False
|
|
487
|
-
for action_name in actions_name:
|
|
488
|
-
is_enabled = is_enabled and self.is_action_enabled(action_name)
|
|
489
|
-
return is_enabled
|