pymodaq 4.2.3__py3-none-any.whl → 5.0.0__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 +30 -23
- pymodaq/control_modules/daq_move.py +27 -14
- pymodaq/control_modules/daq_move_ui.py +33 -16
- pymodaq/control_modules/daq_viewer.py +38 -28
- pymodaq/control_modules/daq_viewer_ui.py +6 -6
- pymodaq/control_modules/mocks.py +1 -1
- pymodaq/control_modules/move_utility_classes.py +19 -10
- pymodaq/control_modules/utils.py +18 -12
- pymodaq/control_modules/viewer_utility_classes.py +13 -4
- pymodaq/dashboard.py +166 -118
- pymodaq/examples/custom_app.py +13 -16
- pymodaq/examples/custom_viewer.py +7 -7
- pymodaq/examples/function_plotter.py +13 -12
- pymodaq/examples/parameter_ex.py +50 -25
- pymodaq/examples/tcp_client.py +1 -1
- pymodaq/extensions/__init__.py +1 -1
- pymodaq/extensions/bayesian/bayesian_optimisation.py +15 -12
- pymodaq/extensions/bayesian/utils.py +10 -10
- pymodaq/extensions/console.py +10 -13
- pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +36 -56
- 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 +153 -247
- pymodaq/extensions/daq_scan_ui.py +11 -9
- pymodaq/extensions/h5browser.py +8 -8
- pymodaq/extensions/pid/__init__.py +6 -3
- pymodaq/extensions/pid/daq_move_PID.py +4 -2
- pymodaq/extensions/pid/pid_controller.py +15 -12
- pymodaq/extensions/pid/utils.py +10 -5
- pymodaq/extensions/utils.py +5 -3
- pymodaq/post_treatment/load_and_plot.py +10 -7
- pymodaq/resources/preset_default.xml +1 -1
- pymodaq/utils/array_manipulation.py +4 -384
- pymodaq/utils/calibration_camera.py +12 -9
- pymodaq/utils/chrono_timer.py +7 -5
- pymodaq/utils/config.py +3 -450
- pymodaq/utils/daq_utils.py +6 -664
- pymodaq/utils/data.py +9 -2774
- pymodaq/utils/exceptions.py +0 -4
- pymodaq/utils/gui_utils/__init__.py +8 -8
- pymodaq/utils/gui_utils/loader_utils.py +38 -0
- pymodaq/utils/gui_utils/utils.py +6 -138
- pymodaq/utils/h5modules/__init__.py +0 -4
- pymodaq/utils/h5modules/module_saving.py +15 -8
- pymodaq/utils/leco/__init__.py +2 -2
- pymodaq/utils/leco/daq_move_LECODirector.py +2 -2
- pymodaq/utils/leco/daq_xDviewer_LECODirector.py +2 -2
- pymodaq/utils/leco/director_utils.py +2 -2
- pymodaq/utils/leco/leco_director.py +3 -3
- pymodaq/utils/leco/pymodaq_listener.py +2 -2
- pymodaq/utils/leco/utils.py +1 -1
- pymodaq/utils/logger.py +4 -76
- pymodaq/utils/managers/batchscan_manager.py +16 -19
- pymodaq/utils/managers/modules_manager.py +10 -7
- pymodaq/utils/managers/overshoot_manager.py +3 -5
- pymodaq/utils/managers/preset_manager.py +37 -15
- pymodaq/utils/managers/preset_manager_utils.py +11 -9
- pymodaq/utils/managers/remote_manager.py +12 -10
- pymodaq/utils/math_utils.py +4 -572
- pymodaq/utils/parameter/__init__.py +4 -11
- pymodaq/utils/parameter/utils.py +4 -299
- 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/serializer.py +64 -16
- pymodaq/utils/tcp_ip/tcp_server_client.py +10 -8
- {pymodaq-4.2.3.dist-info → pymodaq-5.0.0.dist-info}/METADATA +5 -3
- pymodaq-5.0.0.dist-info/RECORD +123 -0
- {pymodaq-4.2.3.dist-info → pymodaq-5.0.0.dist-info}/WHEEL +1 -1
- 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/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/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/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/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 -234
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127150
- pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
- pymodaq/resources/VERSION +0 -1
- pymodaq/resources/config_template.toml +0 -90
- 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/enums.py +0 -76
- 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 -93
- 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/lcd.py +0 -111
- 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 -102
- pymodaq/utils/h5modules/backends.py +0 -1022
- pymodaq/utils/h5modules/browsing.py +0 -625
- pymodaq/utils/h5modules/data_saving.py +0 -1101
- 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 -282
- pymodaq/utils/managers/roi_manager.py +0 -726
- pymodaq/utils/messenger.py +0 -66
- pymodaq/utils/parameter/ioxml.py +0 -542
- 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 -145
- 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 -274
- pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
- pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -820
- 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.2.3.dist-info/RECORD +0 -438
- /pymodaq/{post_treatment/daq_analysis → extensions/daq_logger}/__init__.py +0 -0
- /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
- /pymodaq/{resources/QtDesigner_Ressources → extensions/daq_logger/db}/__init__.py +0 -0
- {pymodaq-4.2.3.dist-info → pymodaq-5.0.0.dist-info}/entry_points.txt +0 -0
- {pymodaq-4.2.3.dist-info → pymodaq-5.0.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
from qtpy import QtWidgets, QtCore
|
|
2
|
-
from pyqtgraph import functions as fn
|
|
3
|
-
from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem, SimpleParameter
|
|
4
|
-
from pyqtgraph.parametertree import Parameter, ParameterItem
|
|
5
|
-
import numpy as np
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class WidgetParameterItem(WidgetParameterItem):
|
|
9
|
-
|
|
10
|
-
def updateDisplayLabel(self, value=None):
|
|
11
|
-
"""Update the display label to reflect the value of the parameter."""
|
|
12
|
-
if value is None:
|
|
13
|
-
value = self.param.value()
|
|
14
|
-
self.displayLabel.setText(value.toString(self.param.opts['format']))
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class DateParameterItem(WidgetParameterItem):
|
|
18
|
-
"""Registered parameter type which displays a QLineEdit"""
|
|
19
|
-
|
|
20
|
-
def makeWidget(self):
|
|
21
|
-
opts = self.param.opts
|
|
22
|
-
w = QtWidgets.QDateEdit(QtCore.QDate(QtCore.QDate.currentDate()))
|
|
23
|
-
w.setCalendarPopup(True)
|
|
24
|
-
if 'format' not in opts:
|
|
25
|
-
opts['format'] = 'dd/MM/yyyy'
|
|
26
|
-
w.setDisplayFormat(opts['format'])
|
|
27
|
-
|
|
28
|
-
w.sigChanged = w.dateChanged
|
|
29
|
-
w.value = w.date
|
|
30
|
-
w.setValue = w.setDate
|
|
31
|
-
return w
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class DateTimeParameterItem(WidgetParameterItem):
|
|
35
|
-
"""Registered parameter type which displays a QLineEdit"""
|
|
36
|
-
|
|
37
|
-
def makeWidget(self):
|
|
38
|
-
opts = self.param.opts
|
|
39
|
-
w = QtWidgets.QDateTimeEdit(QtCore.QDateTime(QtCore.QDate.currentDate(),
|
|
40
|
-
QtCore.QTime.currentTime()))
|
|
41
|
-
w.setCalendarPopup(True)
|
|
42
|
-
if 'format' not in opts:
|
|
43
|
-
opts['format'] = 'dd/MM/yyyy hh:mm'
|
|
44
|
-
w.setDisplayFormat(opts['format'])
|
|
45
|
-
w.sigChanged = w.dateTimeChanged
|
|
46
|
-
w.value = w.dateTime
|
|
47
|
-
w.setValue = w.setDateTime
|
|
48
|
-
return w
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class QTimeCustom(QtWidgets.QTimeEdit):
|
|
52
|
-
def __init__(self, *args, **kwargs):
|
|
53
|
-
super(QTimeCustom, self).__init__(*args, **kwargs)
|
|
54
|
-
self.minutes_increment = 1
|
|
55
|
-
self.timeChanged.connect(self.updateTime)
|
|
56
|
-
|
|
57
|
-
def setTime(self, time):
|
|
58
|
-
hours = time.hour()
|
|
59
|
-
minutes = time.minute()
|
|
60
|
-
|
|
61
|
-
minutes = int(np.round(minutes / self.minutes_increment) * self.minutes_increment)
|
|
62
|
-
if minutes == 60:
|
|
63
|
-
minutes = 0
|
|
64
|
-
hours += 1
|
|
65
|
-
|
|
66
|
-
time.setHMS(hours, minutes, 0)
|
|
67
|
-
|
|
68
|
-
return super(QTimeCustom, self).setTime(time)
|
|
69
|
-
|
|
70
|
-
def setMinuteIncrement(self, minutes_increment):
|
|
71
|
-
self.minutes_increment = minutes_increment
|
|
72
|
-
self.updateTime(self.time())
|
|
73
|
-
|
|
74
|
-
@QtCore.Slot(QtCore.QTime)
|
|
75
|
-
def updateTime(self, time):
|
|
76
|
-
self.setTime(time)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class TimeParameterItem(WidgetParameterItem):
|
|
80
|
-
"""Registered parameter type which displays a QLineEdit"""
|
|
81
|
-
|
|
82
|
-
def makeWidget(self):
|
|
83
|
-
opts = self.param.opts
|
|
84
|
-
w = QTimeCustom(QtCore.QTime(QtCore.QTime.currentTime()))
|
|
85
|
-
if 'minutes_increment' in opts:
|
|
86
|
-
w.setMinuteIncrement(opts['minutes_increment'])
|
|
87
|
-
if 'format' not in opts:
|
|
88
|
-
opts['format'] = 'hh:mm'
|
|
89
|
-
w.setDisplayFormat(opts['format'])
|
|
90
|
-
|
|
91
|
-
w.sigChanged = w.timeChanged
|
|
92
|
-
w.value = w.time
|
|
93
|
-
w.setValue = w.setTime
|
|
94
|
-
return w
|
|
95
|
-
|
|
96
|
-
def optsChanged(self, param, opts):
|
|
97
|
-
"""
|
|
98
|
-
|
|
99
|
-
"""
|
|
100
|
-
super().optsChanged(param, opts)
|
|
101
|
-
if 'minutes_increment' in opts:
|
|
102
|
-
self.widget.setMinuteIncrement(opts['minutes_increment'])
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class DateParameter(SimpleParameter):
|
|
106
|
-
itemClass = DateParameterItem
|
|
107
|
-
|
|
108
|
-
def _interpretValue(self, v):
|
|
109
|
-
return QtCore.QDate(v)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
class DateTimeParameter(SimpleParameter):
|
|
113
|
-
itemClass = DateTimeParameterItem
|
|
114
|
-
|
|
115
|
-
def _interpretValue(self, v):
|
|
116
|
-
return QtCore.QDateTime(v)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
class TimeParameter(SimpleParameter):
|
|
120
|
-
itemClass = TimeParameterItem
|
|
121
|
-
|
|
122
|
-
def _interpretValue(self, v):
|
|
123
|
-
if isinstance(v, QtCore.QTime):
|
|
124
|
-
return v
|
|
125
|
-
elif isinstance(v, str):
|
|
126
|
-
return QtCore.QTime(*eval(v.split('QTime')[1]))
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from qtpy import QtWidgets, QtCore, QtGui
|
|
4
|
-
from pyqtgraph.parametertree.Parameter import ParameterItem
|
|
5
|
-
from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem
|
|
6
|
-
from pyqtgraph.parametertree import Parameter
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class FileDirWidget(QtWidgets.QWidget):
|
|
10
|
-
"""
|
|
11
|
-
================ =========================
|
|
12
|
-
**Attributes** **Type**
|
|
13
|
-
*value_changed* instance of pyqt Signal
|
|
14
|
-
*path* string
|
|
15
|
-
================ =========================
|
|
16
|
-
|
|
17
|
-
See Also
|
|
18
|
-
--------
|
|
19
|
-
browse_path
|
|
20
|
-
"""
|
|
21
|
-
value_changed = QtCore.Signal(str)
|
|
22
|
-
|
|
23
|
-
def __init__(self, init_path='D:/Data', file_type=False):
|
|
24
|
-
|
|
25
|
-
super().__init__()
|
|
26
|
-
self.filetype = file_type
|
|
27
|
-
self.path = init_path
|
|
28
|
-
self.initUI()
|
|
29
|
-
|
|
30
|
-
self.base_path_browse_pb.clicked.connect(self.browse_path)
|
|
31
|
-
|
|
32
|
-
def browse_path(self):
|
|
33
|
-
"""
|
|
34
|
-
Browse the path attribute if exist.
|
|
35
|
-
|
|
36
|
-
See Also
|
|
37
|
-
--------
|
|
38
|
-
set_path
|
|
39
|
-
"""
|
|
40
|
-
if self.filetype is True:
|
|
41
|
-
folder_name = QtWidgets.QFileDialog.getOpenFileName(None, 'Choose File', os.path.split(self.path)[0])[0]
|
|
42
|
-
elif self.filetype is False:
|
|
43
|
-
folder_name = QtWidgets.QFileDialog.getExistingDirectory(None, 'Choose Folder', self.path)
|
|
44
|
-
|
|
45
|
-
elif self.filetype == "save":
|
|
46
|
-
folder_name = QtWidgets.QFileDialog.getSaveFileName(None, 'Enter a Filename', os.path.split(self.path)[0])[
|
|
47
|
-
0]
|
|
48
|
-
|
|
49
|
-
if not (not(folder_name)): # execute if the user didn't cancel the file selection
|
|
50
|
-
self.set_path(folder_name)
|
|
51
|
-
self.value_changed.emit(folder_name)
|
|
52
|
-
|
|
53
|
-
def set_path(self, path_file):
|
|
54
|
-
"""
|
|
55
|
-
Set the base path attribute with the given path_file.
|
|
56
|
-
|
|
57
|
-
=============== =========== ===========================
|
|
58
|
-
**Parameters** **Type** **Description**
|
|
59
|
-
*path_file* string the pathname of the file
|
|
60
|
-
=============== =========== ===========================
|
|
61
|
-
"""
|
|
62
|
-
if isinstance(path_file, Path):
|
|
63
|
-
path_file = str(path_file)
|
|
64
|
-
self.base_path_edit.setPlainText(path_file)
|
|
65
|
-
self.path = path_file
|
|
66
|
-
|
|
67
|
-
def get_value(self):
|
|
68
|
-
"""
|
|
69
|
-
Get the value of the base_path_edit attribute.
|
|
70
|
-
|
|
71
|
-
Returns
|
|
72
|
-
-------
|
|
73
|
-
string
|
|
74
|
-
the path name
|
|
75
|
-
"""
|
|
76
|
-
return self.base_path_edit.toPlainText()
|
|
77
|
-
|
|
78
|
-
def initUI(self):
|
|
79
|
-
"""
|
|
80
|
-
Init the User Interface.
|
|
81
|
-
"""
|
|
82
|
-
|
|
83
|
-
self.hor_layout = QtWidgets.QHBoxLayout()
|
|
84
|
-
self.base_path_edit = QtWidgets.QPlainTextEdit(self.path)
|
|
85
|
-
self.base_path_edit.setMaximumHeight(50)
|
|
86
|
-
self.base_path_browse_pb = QtWidgets.QPushButton()
|
|
87
|
-
self.base_path_browse_pb.setText("")
|
|
88
|
-
icon3 = QtGui.QIcon()
|
|
89
|
-
icon3.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/Browse_Dir_Path.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
90
|
-
self.base_path_browse_pb.setIcon(icon3)
|
|
91
|
-
self.hor_layout.addWidget(self.base_path_edit)
|
|
92
|
-
|
|
93
|
-
verlayout = QtWidgets.QVBoxLayout()
|
|
94
|
-
verlayout.addWidget(self.base_path_browse_pb)
|
|
95
|
-
verlayout.addStretch()
|
|
96
|
-
self.hor_layout.addLayout(verlayout)
|
|
97
|
-
self.hor_layout.setSpacing(0)
|
|
98
|
-
self.setLayout(self.hor_layout)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
class FileDirParameterItem(WidgetParameterItem):
|
|
102
|
-
def makeWidget(self):
|
|
103
|
-
"""
|
|
104
|
-
Make an initialized file_browser object with parameter options dictionnary ('readonly' key)0
|
|
105
|
-
|
|
106
|
-
Returns
|
|
107
|
-
-------
|
|
108
|
-
w : filebrowser
|
|
109
|
-
The initialized file browser.
|
|
110
|
-
|
|
111
|
-
See Also
|
|
112
|
-
--------
|
|
113
|
-
file_browser
|
|
114
|
-
"""
|
|
115
|
-
self.asSubItem = True
|
|
116
|
-
self.hideWidget = False
|
|
117
|
-
if 'filetype' in self.param.opts:
|
|
118
|
-
self.filetype = self.param.opts['filetype']
|
|
119
|
-
else:
|
|
120
|
-
self.filetype = True
|
|
121
|
-
|
|
122
|
-
self.w = FileDirWidget(self.param.value(), file_type=self.filetype)
|
|
123
|
-
|
|
124
|
-
# if 'tip' in self.param.opts:
|
|
125
|
-
# self.w.setToolTip(self.param.opts['tip'])
|
|
126
|
-
|
|
127
|
-
self.w.base_path_edit.setReadOnly(self.param.opts['readonly'])
|
|
128
|
-
self.w.value = self.w.get_value
|
|
129
|
-
self.w.setValue = self.w.set_path
|
|
130
|
-
self.w.sigChanged = self.w.value_changed
|
|
131
|
-
return self.w
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
class FileDirParameter(Parameter):
|
|
135
|
-
"""
|
|
136
|
-
Editable string; displayed as large text box in the tree.
|
|
137
|
-
See Also
|
|
138
|
-
--------
|
|
139
|
-
file_browserParameterItem
|
|
140
|
-
"""
|
|
141
|
-
itemClass = FileDirParameterItem
|
|
142
|
-
|
|
143
|
-
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
from copy import deepcopy
|
|
2
|
-
|
|
3
|
-
from qtpy import QtWidgets, QtCore, QtGui
|
|
4
|
-
from pyqtgraph.parametertree.Parameter import ParameterItem
|
|
5
|
-
from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem
|
|
6
|
-
from pyqtgraph.parametertree import Parameter
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ItemSelect_pb(QtWidgets.QWidget):
|
|
10
|
-
def __init__(self,checkbox=False,):
|
|
11
|
-
|
|
12
|
-
super(ItemSelect_pb, self).__init__()
|
|
13
|
-
self.initUI(checkbox,)
|
|
14
|
-
|
|
15
|
-
def initUI(self, checkbox=False,):
|
|
16
|
-
#### Widgets ###
|
|
17
|
-
# ListWidget
|
|
18
|
-
self.itemselect = ItemSelect(checkbox)
|
|
19
|
-
# Pushbutton Add
|
|
20
|
-
self.add_pb = QtWidgets.QPushButton()
|
|
21
|
-
self.add_pb.setText("")
|
|
22
|
-
icon3 = QtGui.QIcon()
|
|
23
|
-
icon3.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/Add2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
24
|
-
self.add_pb.setIcon(icon3)
|
|
25
|
-
# Pushbutton Remove
|
|
26
|
-
self.remove_pb = QtWidgets.QPushButton()
|
|
27
|
-
self.remove_pb.setText("")
|
|
28
|
-
icon3 = QtGui.QIcon()
|
|
29
|
-
icon3.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
30
|
-
self.remove_pb.setIcon(icon3)
|
|
31
|
-
#### Layout ###
|
|
32
|
-
self.ver_layout = QtWidgets.QVBoxLayout()
|
|
33
|
-
self.ver_layout.addWidget(self.add_pb)
|
|
34
|
-
self.ver_layout.addWidget(self.remove_pb)
|
|
35
|
-
self.ver_layout.setSpacing(0)
|
|
36
|
-
|
|
37
|
-
self.hor_layout = QtWidgets.QHBoxLayout()
|
|
38
|
-
self.hor_layout.addWidget(self.itemselect)
|
|
39
|
-
self.hor_layout.addLayout(self.ver_layout)
|
|
40
|
-
|
|
41
|
-
self.hor_layout.setSpacing(0)
|
|
42
|
-
self.setLayout(self.hor_layout)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class ItemSelect(QtWidgets.QListWidget):
|
|
46
|
-
def __init__(self, hasCheckbox=True):
|
|
47
|
-
QtWidgets.QListWidget.__init__(self)
|
|
48
|
-
self.hasCheckbox = hasCheckbox # Boolean indicating if listwidget item uses checkbox ot not
|
|
49
|
-
self.selItems = [] # Dummy variable to keep track of click order
|
|
50
|
-
self.itemDoubleClicked.connect(self.doubleClickSelection)
|
|
51
|
-
|
|
52
|
-
def doubleClickSelection(self,item:QtWidgets.QListWidgetItem):
|
|
53
|
-
"""
|
|
54
|
-
Function to select item. The selection depends if the item uses checkbox or not.
|
|
55
|
-
"""
|
|
56
|
-
if self.hasCheckbox:
|
|
57
|
-
item.setCheckState(int(2*bool(not item.checkState())))
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def get_value(self):
|
|
61
|
-
"""
|
|
62
|
-
Get the dictionnary of values contained in the QtWidget attribute.
|
|
63
|
-
|
|
64
|
-
Returns
|
|
65
|
-
-------
|
|
66
|
-
dictionnary
|
|
67
|
-
The dictionnary of all_items compared to the selectedItems.
|
|
68
|
-
"""
|
|
69
|
-
allitems = [item.text() for item in self.all_items()]
|
|
70
|
-
if self.hasCheckbox:
|
|
71
|
-
# Clean up list with non existing entries
|
|
72
|
-
[self.selItems.remove(item) for item in self.selItems if item not in allitems]
|
|
73
|
-
for item in self.all_items():
|
|
74
|
-
if item.checkState() != 0: # Item is selected
|
|
75
|
-
if item.text() not in self.selItems: # if item not in list then add it
|
|
76
|
-
self.selItems.append(item.text())
|
|
77
|
-
else: # Item is not selected
|
|
78
|
-
if item.text() in self.selItems: # if item in list then remove it
|
|
79
|
-
self.selItems.remove(item.text())
|
|
80
|
-
selitems = self.selItems.copy() #need to copy to correctly emit signal when changed
|
|
81
|
-
|
|
82
|
-
# selitems = [item.text() for item in self.all_items() if item.checkState()!=0]
|
|
83
|
-
else:
|
|
84
|
-
selitems = [item.text() for item in self.selectedItems()]
|
|
85
|
-
|
|
86
|
-
return dict(all_items=allitems, selected=selitems)
|
|
87
|
-
|
|
88
|
-
def all_items(self) -> list:
|
|
89
|
-
"""
|
|
90
|
-
Get the all_items list from the self QtWidget attribute.
|
|
91
|
-
|
|
92
|
-
Returns
|
|
93
|
-
-------
|
|
94
|
-
list
|
|
95
|
-
The item list.
|
|
96
|
-
"""
|
|
97
|
-
return [self.item(ind) for ind in range(self.count())]
|
|
98
|
-
|
|
99
|
-
def select_item(self, item: QtWidgets.QListWidgetItem, doSelect:bool = False):
|
|
100
|
-
"""
|
|
101
|
-
Function to select item. The selection depends if the item uses checkbox or not.
|
|
102
|
-
"""
|
|
103
|
-
if self.hasCheckbox:
|
|
104
|
-
item.setCheckState(int(2*doSelect)) # 2=QtCore.Qt.Checked, 0=QtCore.Qt.Unchecked
|
|
105
|
-
else:
|
|
106
|
-
item.setSelected(doSelect)
|
|
107
|
-
|
|
108
|
-
def set_value(self, values: dict):
|
|
109
|
-
"""
|
|
110
|
-
Set values to the all_items attributes filtering values by the 'selected' key.
|
|
111
|
-
|
|
112
|
-
=============== ============== =======================================
|
|
113
|
-
**Parameters** **Type** **Description**
|
|
114
|
-
*values* dictionnary the values dictionnary to be setted.
|
|
115
|
-
=============== ============== =======================================
|
|
116
|
-
"""
|
|
117
|
-
# Remove values in selected if they do not exist in all
|
|
118
|
-
values = deepcopy(values)
|
|
119
|
-
[values['selected'].remove(value) for value in values['selected'] if value
|
|
120
|
-
not in values['all_items']]
|
|
121
|
-
|
|
122
|
-
allitems_text = []
|
|
123
|
-
# Check existing items and remove unused ones
|
|
124
|
-
for item in self.all_items():
|
|
125
|
-
if item.text() not in values['all_items']: # Remove items from list if text not
|
|
126
|
-
# in values
|
|
127
|
-
item = self.takeItem(self.row(item))
|
|
128
|
-
else:
|
|
129
|
-
allitems_text.append(item.text()) # Add items to list
|
|
130
|
-
# Create items if needed
|
|
131
|
-
for value in values['all_items']: # Loop through all values
|
|
132
|
-
if value not in allitems_text: # Test if object already exists
|
|
133
|
-
item = QtWidgets.QListWidgetItem(value) # Create object
|
|
134
|
-
if self.hasCheckbox: # Add checkbox if required
|
|
135
|
-
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
|
136
|
-
self.select_item(item, doSelect=False)
|
|
137
|
-
# Make sure item is not selected (checkbox not appearing somehow without)
|
|
138
|
-
self.addItem(item) # Add object to widget
|
|
139
|
-
|
|
140
|
-
allitems = self.all_items() # All selectable items
|
|
141
|
-
# Selection process
|
|
142
|
-
for item in allitems:
|
|
143
|
-
self.select_item(item, doSelect=False)
|
|
144
|
-
for value in values['selected']: # Loop through selected to retain selection order
|
|
145
|
-
item = allitems[[item.text() for item in allitems].index(value)]
|
|
146
|
-
self.select_item(item, doSelect=True)
|
|
147
|
-
QtWidgets.QApplication.processEvents()
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
class ItemSelectParameterItem(WidgetParameterItem):
|
|
151
|
-
|
|
152
|
-
def makeWidget(self):
|
|
153
|
-
"""
|
|
154
|
-
| Make and initialize an instance of ItemSelect_pb with itemselect value.
|
|
155
|
-
| Connect the created object with the plus and minus buttonClicked function.
|
|
156
|
-
|
|
157
|
-
"""
|
|
158
|
-
self.asSubItem = True
|
|
159
|
-
self.hideWidget = False
|
|
160
|
-
opts = self.param.opts
|
|
161
|
-
|
|
162
|
-
if 'checkbox' in opts and opts['checkbox']:
|
|
163
|
-
w = ItemSelect_pb(checkbox=opts['checkbox'])
|
|
164
|
-
w.sigChanged = w.itemselect.itemChanged
|
|
165
|
-
else:
|
|
166
|
-
w = ItemSelect_pb()
|
|
167
|
-
w.sigChanged = w.itemselect.itemSelectionChanged
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if 'dragdrop' in opts and opts['dragdrop']:
|
|
171
|
-
w.itemselect.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove)
|
|
172
|
-
|
|
173
|
-
w.itemselect.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
|
174
|
-
# if 'minheight' in opts:
|
|
175
|
-
# w.itemselect.setMinimumHeight(opts['min_height'])
|
|
176
|
-
# if 'height' in opts:
|
|
177
|
-
# w.itemselect.setMaximumHeight(opts['height'])
|
|
178
|
-
# else:
|
|
179
|
-
# w.itemselect.setMaximumHeight(70)
|
|
180
|
-
# w.setReadOnly(self.param.opts.get('readonly', False))
|
|
181
|
-
w.itemselect.setMinimumHeight(opts.get('min_height', 0))
|
|
182
|
-
w.itemselect.setMaximumHeight(opts.get('height', 70))
|
|
183
|
-
w.add_pb.setVisible(opts.get('show_pb', False))
|
|
184
|
-
w.remove_pb.setVisible(opts.get('show_mb', False))
|
|
185
|
-
|
|
186
|
-
if 'tip' in opts:
|
|
187
|
-
w.setToolTip(opts['tip'])
|
|
188
|
-
w.value = w.itemselect.get_value
|
|
189
|
-
w.setValue = w.itemselect.set_value
|
|
190
|
-
w.add_pb.clicked.connect(self.pb_buttonClicked)
|
|
191
|
-
w.remove_pb.clicked.connect(self.mb_buttonClicked)
|
|
192
|
-
return w
|
|
193
|
-
|
|
194
|
-
def pb_buttonClicked(self):
|
|
195
|
-
"""
|
|
196
|
-
Append to the param attribute the dictionnary obtained from the QtWidget add parameter procedure.
|
|
197
|
-
"""
|
|
198
|
-
|
|
199
|
-
text, ok = QtWidgets.QInputDialog.getText(None, "Enter a value to add to the parameter",
|
|
200
|
-
"String value:", QtWidgets.QLineEdit.Normal)
|
|
201
|
-
if text in self.param.value()['all_items']:
|
|
202
|
-
print('Entry already exists, please use a different name.')
|
|
203
|
-
return
|
|
204
|
-
if ok and not (text == ""):
|
|
205
|
-
all = self.param.value()['all_items']
|
|
206
|
-
all.append(text)
|
|
207
|
-
sel = self.param.value()['selected']
|
|
208
|
-
sel.append(text)
|
|
209
|
-
val = dict(all_items=all, selected=sel)
|
|
210
|
-
self.param.setValue(val)
|
|
211
|
-
self.param.sigValueChanged.emit(self.param, val)
|
|
212
|
-
|
|
213
|
-
def mb_buttonClicked(self):
|
|
214
|
-
"""
|
|
215
|
-
Remove the selected Qwidget items by removing the entries in the parameter attribute.
|
|
216
|
-
"""
|
|
217
|
-
items_to_be_removed = self.widget.itemselect.selectedItems()
|
|
218
|
-
if len(items_to_be_removed) > 0:
|
|
219
|
-
all = self.param.value()['all_items']
|
|
220
|
-
sel = self.param.value()['selected']
|
|
221
|
-
for item in items_to_be_removed:
|
|
222
|
-
if item.text() in all:
|
|
223
|
-
all.remove(item.text())
|
|
224
|
-
if item.text() in sel:
|
|
225
|
-
sel.remove(item.text())
|
|
226
|
-
val = dict(all_items=all, selected=sel)
|
|
227
|
-
self.param.setValue(val)
|
|
228
|
-
self.param.sigValueChanged.emit(self.param, val)
|
|
229
|
-
|
|
230
|
-
def optsChanged(self, param, opts):
|
|
231
|
-
"""
|
|
232
|
-
Called when any options are changed that are not name, value, default, or limits.
|
|
233
|
-
|
|
234
|
-
See Also
|
|
235
|
-
--------
|
|
236
|
-
optsChanged
|
|
237
|
-
"""
|
|
238
|
-
# print "opts changed:", opts
|
|
239
|
-
ParameterItem.optsChanged(self, param, opts)
|
|
240
|
-
|
|
241
|
-
self.widget.add_pb.setVisible(opts.get('show_pb', False))
|
|
242
|
-
self.widget.remove_pb.setVisible(opts.get('show_mb', False))
|
|
243
|
-
|
|
244
|
-
class ItemSelectParameter(Parameter):
|
|
245
|
-
"""
|
|
246
|
-
Editable string; displayed as large text box in the tree.
|
|
247
|
-
|
|
248
|
-
=============== ======================================
|
|
249
|
-
**Attributes** **Type**
|
|
250
|
-
*itemClass* instance of ItemSelectParameterItem
|
|
251
|
-
*sigActivated* instance of pyqt Signal
|
|
252
|
-
=============== ======================================
|
|
253
|
-
"""
|
|
254
|
-
itemClass = ItemSelectParameterItem
|
|
255
|
-
sigActivated = QtCore.Signal(object)
|
|
256
|
-
|
|
257
|
-
def activate(self):
|
|
258
|
-
"""
|
|
259
|
-
Activate the "Activated" signal attribute0
|
|
260
|
-
"""
|
|
261
|
-
self.sigActivated.emit(self)
|
|
262
|
-
self.emitStateChanged('activated', None)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem, SimpleParameter
|
|
2
|
-
from pymodaq.utils.gui_utils.widgets import QLED
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class LedParameterItem(WidgetParameterItem):
|
|
6
|
-
"""Registered parameter type which displays a QLineEdit"""
|
|
7
|
-
|
|
8
|
-
def makeWidget(self):
|
|
9
|
-
w = QLED()
|
|
10
|
-
w.clickable = False
|
|
11
|
-
w.set_as_false()
|
|
12
|
-
w.sigChanged = w.value_changed
|
|
13
|
-
w.value = w.get_state
|
|
14
|
-
w.setValue = w.set_as
|
|
15
|
-
self.hideWidget = False
|
|
16
|
-
return w
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class LedPushParameterItem(LedParameterItem):
|
|
20
|
-
"""Registered parameter type which displays a QLineEdit"""
|
|
21
|
-
|
|
22
|
-
def makeWidget(self):
|
|
23
|
-
w = QLED()
|
|
24
|
-
w.clickable = True
|
|
25
|
-
w.set_as_false()
|
|
26
|
-
w.sigChanged = w.value_changed
|
|
27
|
-
w.value = w.get_state
|
|
28
|
-
w.setValue = w.set_as
|
|
29
|
-
self.hideWidget = False
|
|
30
|
-
return w
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class LedParameter(SimpleParameter):
|
|
34
|
-
itemClass = LedParameterItem
|
|
35
|
-
|
|
36
|
-
def _interpretValue(self, v):
|
|
37
|
-
return bool(v)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class LedPushParameter(SimpleParameter):
|
|
41
|
-
itemClass = LedPushParameterItem
|
|
42
|
-
|
|
43
|
-
def _interpretValue(self, v):
|
|
44
|
-
return bool(v)
|