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
pymodaq/utils/exceptions.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from .dock import Dock, DockArea
|
|
2
|
-
from .list_picker import ListPicker
|
|
3
|
-
from .custom_app import CustomApp
|
|
4
|
-
from .file_io import select_file
|
|
5
|
-
from .widgets.table import TableView, TableModel, SpinBoxDelegate, BooleanDelegate
|
|
6
|
-
from .widgets.push import PushButtonIcon, EditPush, EditPushRel, EditPushInfo
|
|
7
|
-
from .widgets.qled import QLED
|
|
8
|
-
from .widgets.spinbox import QSpinBox_ro
|
|
1
|
+
from pymodaq_gui.utils.dock import Dock, DockArea
|
|
2
|
+
from pymodaq_gui.utils.list_picker import ListPicker
|
|
3
|
+
from pymodaq_gui.utils.custom_app import CustomApp
|
|
4
|
+
from pymodaq_gui.utils.file_io import select_file
|
|
5
|
+
from pymodaq_gui.utils.widgets.table import TableView, TableModel, SpinBoxDelegate, BooleanDelegate
|
|
6
|
+
from pymodaq_gui.utils.widgets.push import PushButtonIcon, EditPush, EditPushRel, EditPushInfo
|
|
7
|
+
from pymodaq_gui.utils.widgets.qled import QLED
|
|
8
|
+
from pymodaq_gui.utils.widgets.spinbox import QSpinBox_ro
|
|
9
9
|
|
|
10
10
|
from .utils import get_splash_sc
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from qtpy import QtWidgets
|
|
4
|
+
|
|
5
|
+
from pymodaq.dashboard import DashBoard
|
|
6
|
+
from pymodaq.utils.gui_utils import DockArea
|
|
7
|
+
from pymodaq.utils.config import get_set_preset_path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def load_dashboard_with_preset(preset_name: str, extension_name: str):
|
|
11
|
+
win = QtWidgets.QMainWindow()
|
|
12
|
+
area = DockArea()
|
|
13
|
+
win.setCentralWidget(area)
|
|
14
|
+
win.resize(1000, 500)
|
|
15
|
+
win.setWindowTitle('PyMoDAQ Dashboard')
|
|
16
|
+
win.show()
|
|
17
|
+
|
|
18
|
+
# win.setVisible(False)
|
|
19
|
+
dashboard = DashBoard(area)
|
|
20
|
+
|
|
21
|
+
file = Path(get_set_preset_path()).joinpath(f"{preset_name}.xml")
|
|
22
|
+
|
|
23
|
+
if file is not None and file.exists():
|
|
24
|
+
dashboard.set_preset_mode(file)
|
|
25
|
+
if extension_name == 'DAQScan':
|
|
26
|
+
extension = dashboard.load_scan_module()
|
|
27
|
+
elif extension_name == 'DAQLogger':
|
|
28
|
+
extension = dashboard.load_log_module()
|
|
29
|
+
else:
|
|
30
|
+
extension = dashboard.load_extension_from_name(extension_name)
|
|
31
|
+
else:
|
|
32
|
+
msgBox = QtWidgets.QMessageBox()
|
|
33
|
+
msgBox.setText(f"The default file specified in the configuration file does not exists!\n"
|
|
34
|
+
f"{file}\n"
|
|
35
|
+
f"Impossible to load the {extension_name} extension")
|
|
36
|
+
msgBox.setStandardButtons(msgBox.Ok)
|
|
37
|
+
ret = msgBox.exec()
|
|
38
|
+
return dashboard, extension, win
|
pymodaq/utils/gui_utils/utils.py
CHANGED
|
@@ -4,150 +4,18 @@ from qtpy.QtCore import QObject, Signal, QEvent, QBuffer, QIODevice, Qt
|
|
|
4
4
|
from qtpy import QtWidgets, QtCore, QtGui
|
|
5
5
|
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from
|
|
7
|
+
from pymodaq_utils.config import Config
|
|
8
|
+
from pymodaq_utils.logger import set_logger, get_module_name
|
|
8
9
|
|
|
9
10
|
config = Config()
|
|
11
|
+
logger = set_logger(get_module_name(__file__))
|
|
10
12
|
|
|
11
13
|
|
|
12
|
-
dashboard_submodules_params = [
|
|
13
|
-
{'title': 'Save 2D datas and above:', 'name': 'save_2D', 'type': 'bool', 'value': True},
|
|
14
|
-
{'title': 'Save raw datas only:', 'name': 'save_raw_only', 'type': 'bool', 'value': True, 'tooltip':
|
|
15
|
-
'if True, will not save extracted ROIs used to do live plotting, only raw datas will be saved'},
|
|
16
|
-
{'title': 'Do Save:', 'name': 'do_save', 'type': 'bool', 'default': False, 'value': False},
|
|
17
|
-
{'title': 'N saved:', 'name': 'N_saved', 'type': 'int', 'default': 0, 'value': 0, 'visible': False},
|
|
18
|
-
]
|
|
19
|
-
|
|
20
14
|
def get_splash_sc():
|
|
21
15
|
here = Path(__file__)
|
|
22
|
-
splash_sc = QtWidgets.QSplashScreen(
|
|
23
|
-
|
|
16
|
+
splash_sc = QtWidgets.QSplashScreen(
|
|
17
|
+
QtGui.QPixmap(str(here.parent.parent.parent.joinpath('splash.png'))),
|
|
18
|
+
Qt.WindowStaysOnTopHint)
|
|
24
19
|
return splash_sc
|
|
25
20
|
|
|
26
21
|
|
|
27
|
-
def clickable(widget):
|
|
28
|
-
class Filter(QObject):
|
|
29
|
-
clicked = Signal()
|
|
30
|
-
|
|
31
|
-
def eventFilter(self, obj, event):
|
|
32
|
-
if obj == widget:
|
|
33
|
-
if event.type() == QEvent.MouseButtonRelease:
|
|
34
|
-
if obj.rect().contains(event.pos()):
|
|
35
|
-
self.clicked.emit()
|
|
36
|
-
# The developer can opt for .emit(obj) to get the object within the slot.
|
|
37
|
-
return True
|
|
38
|
-
return False
|
|
39
|
-
|
|
40
|
-
filter = Filter(widget)
|
|
41
|
-
widget.installEventFilter(filter)
|
|
42
|
-
return filter.clicked
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def h5tree_to_QTree(base_node, base_tree_elt=None, pixmap_items=[]):
|
|
46
|
-
"""
|
|
47
|
-
| Convert a loaded h5 file to a QTreeWidgetItem element structure containing two columns.
|
|
48
|
-
| The first is the name of the h5 current node, the second is the path of the node in the h5 structure.
|
|
49
|
-
|
|
|
50
|
-
| Recursive function discreasing on base_node.
|
|
51
|
-
|
|
52
|
-
================== ======================================== ===============================
|
|
53
|
-
**Parameters** **Type** **Description**
|
|
54
|
-
|
|
55
|
-
*h5file* instance class File from tables module loaded h5 file
|
|
56
|
-
|
|
57
|
-
*base_node* pytables h5 node parent node
|
|
58
|
-
|
|
59
|
-
*base_tree_elt* QTreeWidgetItem parent QTreeWidgetItem element
|
|
60
|
-
================== ======================================== ===============================
|
|
61
|
-
|
|
62
|
-
Returns
|
|
63
|
-
-------
|
|
64
|
-
QTreeWidgetItem
|
|
65
|
-
h5 structure copy converted into QtreeWidgetItem structure.
|
|
66
|
-
|
|
67
|
-
See Also
|
|
68
|
-
--------
|
|
69
|
-
h5tree_to_QTree
|
|
70
|
-
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
if base_tree_elt is None:
|
|
74
|
-
base_tree_elt = QtWidgets.QTreeWidgetItem([base_node.name, "", base_node.path])
|
|
75
|
-
for node_name, node in base_node.children().items():
|
|
76
|
-
child = QtWidgets.QTreeWidgetItem([node_name, "", node.path])
|
|
77
|
-
if 'pixmap' in node.attrs.attrs_name:
|
|
78
|
-
pixmap_items.append(dict(node=node, item=child))
|
|
79
|
-
klass = node.attrs['CLASS']
|
|
80
|
-
if klass == 'GROUP':
|
|
81
|
-
h5tree_to_QTree(node, child, pixmap_items)
|
|
82
|
-
|
|
83
|
-
base_tree_elt.addChild(child)
|
|
84
|
-
return base_tree_elt, pixmap_items
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def set_enable_recursive(children, enable=False):
|
|
88
|
-
"""Apply the enable state on all children widgets, do it recursively
|
|
89
|
-
|
|
90
|
-
Parameters
|
|
91
|
-
----------
|
|
92
|
-
children: (list) elements children ofa pyqt5 element
|
|
93
|
-
enable: (bool) set enabled state (True) of all children widgets
|
|
94
|
-
"""
|
|
95
|
-
for child in children:
|
|
96
|
-
if not children:
|
|
97
|
-
return
|
|
98
|
-
elif isinstance(child, QtWidgets.QSpinBox) or isinstance(child, QtWidgets.QComboBox) or \
|
|
99
|
-
isinstance(child, QtWidgets.QPushButton) or isinstance(child, QtWidgets.QListWidget):
|
|
100
|
-
child.setEnabled(enable)
|
|
101
|
-
else:
|
|
102
|
-
set_enable_recursive(child.children(), enable)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
def widget_to_png_to_bytes(widget, keep_aspect=True, width=200, height=100):
|
|
106
|
-
"""
|
|
107
|
-
Renders the widget content in a png format as a bytes string
|
|
108
|
-
Parameters
|
|
109
|
-
----------
|
|
110
|
-
widget: (QWidget) the widget to render
|
|
111
|
-
keep_aspect: (bool) if True use width and the widget aspect ratio to calculate the height
|
|
112
|
-
if False use set values of width and height to produce the png
|
|
113
|
-
width: (int) the rendered width of the png
|
|
114
|
-
height: (int) the rendered width of the png
|
|
115
|
-
|
|
116
|
-
Returns
|
|
117
|
-
-------
|
|
118
|
-
binary string
|
|
119
|
-
|
|
120
|
-
"""
|
|
121
|
-
png = widget.grab().toImage()
|
|
122
|
-
wwidth = widget.width()
|
|
123
|
-
wheight = widget.height()
|
|
124
|
-
if keep_aspect:
|
|
125
|
-
height = width * wheight / wwidth
|
|
126
|
-
|
|
127
|
-
png = png.scaled(int(width), int(height), QtCore.Qt.KeepAspectRatio)
|
|
128
|
-
buffer = QtCore.QBuffer()
|
|
129
|
-
buffer.open(QtCore.QIODevice.WriteOnly)
|
|
130
|
-
png.save(buffer, "png")
|
|
131
|
-
return buffer.data().data()
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
def pngbinary2Qlabel(databinary, scale_height: int = None):
|
|
135
|
-
buff = QBuffer()
|
|
136
|
-
buff.open(QIODevice.WriteOnly)
|
|
137
|
-
buff.write(databinary)
|
|
138
|
-
dat = buff.data()
|
|
139
|
-
pixmap = QtGui.QPixmap()
|
|
140
|
-
pixmap.loadFromData(dat, 'PNG')
|
|
141
|
-
if scale_height is not None and isinstance(scale_height, int):
|
|
142
|
-
pixmap = pixmap.scaledToHeight(scale_height)
|
|
143
|
-
label = QtWidgets.QLabel()
|
|
144
|
-
label.setPixmap(pixmap)
|
|
145
|
-
return label
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
def start_qapplication() -> QtWidgets.QApplication:
|
|
149
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
150
|
-
if config('style', 'darkstyle'):
|
|
151
|
-
import qdarkstyle
|
|
152
|
-
app.setStyleSheet(qdarkstyle.load_stylesheet(qdarkstyle.DarkPalette))
|
|
153
|
-
return app
|
|
@@ -12,19 +12,20 @@ import xml.etree.ElementTree as ET
|
|
|
12
12
|
|
|
13
13
|
import numpy as np
|
|
14
14
|
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from .saving import H5SaverLowLevel
|
|
19
|
-
from .backends import GROUP, CARRAY, Node, GroupType
|
|
20
|
-
from .data_saving import DataToExportSaver, AxisSaverLoader,
|
|
21
|
-
|
|
15
|
+
from pymodaq_utils.abstract import ABCMeta, abstract_attribute, abstractmethod
|
|
16
|
+
from pymodaq_utils.utils import capitalize
|
|
17
|
+
from pymodaq_data.data import Axis, DataDim, DataWithAxes, DataToExport, DataDistribution
|
|
18
|
+
from pymodaq_data.h5modules.saving import H5SaverLowLevel
|
|
19
|
+
from pymodaq_data.h5modules.backends import GROUP, CARRAY, Node, GroupType
|
|
20
|
+
from pymodaq_data.h5modules.data_saving import (DataToExportSaver, AxisSaverLoader,
|
|
21
|
+
DataToExportTimedSaver, DataToExportExtendedSaver)
|
|
22
|
+
from pymodaq_gui.parameter import ioxml
|
|
22
23
|
|
|
23
24
|
if TYPE_CHECKING:
|
|
24
25
|
from pymodaq.extensions.daq_scan import DAQScan
|
|
25
26
|
from pymodaq.control_modules.daq_viewer import DAQ_Viewer
|
|
26
27
|
from pymodaq.control_modules.daq_move import DAQ_Move
|
|
27
|
-
from pymodaq.
|
|
28
|
+
from pymodaq.extensions.daq_logger.h5logging import H5Logger
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class ModuleSaver(metaclass=ABCMeta):
|
|
@@ -304,6 +305,12 @@ class ScanSaver(ModuleSaver):
|
|
|
304
305
|
if hasattr(module, 'module_and_data_saver'):
|
|
305
306
|
module.module_and_data_saver.h5saver = self.h5saver
|
|
306
307
|
|
|
308
|
+
def forget_h5(self):
|
|
309
|
+
for module in self._module.modules_manager.modules_all:
|
|
310
|
+
if hasattr(module, 'module_and_data_saver'):
|
|
311
|
+
module.module_and_data_saver.h5saver = None
|
|
312
|
+
self.h5saver.flush()
|
|
313
|
+
|
|
307
314
|
def get_set_node(self, where: Union[Node, str] = None, new=False) -> GROUP:
|
|
308
315
|
"""Get the last group scan node
|
|
309
316
|
|
pymodaq/utils/leco/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
1
|
+
from pymodaq_utils.logger import set_logger
|
|
2
|
+
from pymodaq_utils.config import Config
|
|
3
3
|
|
|
4
4
|
logger = set_logger('pymodaq')
|
|
5
5
|
config = Config() # to ckeck for config file existence, otherwise create one
|
|
@@ -12,8 +12,8 @@ from typing import Union
|
|
|
12
12
|
from pymodaq.control_modules.move_utility_classes import (DAQ_Move_base, comon_parameters_fun, main,
|
|
13
13
|
DataActuatorType, DataActuator)
|
|
14
14
|
|
|
15
|
-
from
|
|
16
|
-
from
|
|
15
|
+
from pymodaq_utils.utils import ThreadCommand
|
|
16
|
+
from pymodaq_gui.parameter import Parameter
|
|
17
17
|
|
|
18
18
|
from pymodaq.utils.leco.leco_director import LECODirector, leco_parameters
|
|
19
19
|
from pymodaq.utils.leco.director_utils import ActuatorDirector
|
|
@@ -5,8 +5,8 @@ from easydict import EasyDict as edict
|
|
|
5
5
|
|
|
6
6
|
from pymodaq.control_modules.viewer_utility_classes import DAQ_Viewer_base, comon_parameters, main
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
8
|
+
from pymodaq_utils.utils import ThreadCommand, getLineInfo
|
|
9
|
+
from pymodaq_gui.parameter import Parameter
|
|
10
10
|
from pymodaq.utils.tcp_ip.serializer import DeSerializer
|
|
11
11
|
|
|
12
12
|
from pymodaq.utils.leco.leco_director import LECODirector, leco_parameters
|
|
@@ -8,8 +8,8 @@ from typing import Optional, Union, List
|
|
|
8
8
|
|
|
9
9
|
from pyleco.directors.director import Director
|
|
10
10
|
|
|
11
|
-
import
|
|
12
|
-
from
|
|
11
|
+
import pymodaq_gui.parameter.utils as putils
|
|
12
|
+
from pymodaq_gui.parameter import Parameter, ioxml
|
|
13
13
|
from pymodaq.control_modules.move_utility_classes import DataActuator
|
|
14
14
|
from pymodaq.utils.leco.utils import serialize_object
|
|
15
15
|
|
|
@@ -3,10 +3,10 @@ import random
|
|
|
3
3
|
|
|
4
4
|
from typing import Callable, Sequence, List
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import pymodaq_gui.parameter.utils as putils
|
|
7
7
|
# object used to send info back to the main thread:
|
|
8
|
-
from
|
|
9
|
-
from
|
|
8
|
+
from pymodaq_utils.utils import ThreadCommand
|
|
9
|
+
from pymodaq_gui.parameter import Parameter
|
|
10
10
|
|
|
11
11
|
from pymodaq.utils.leco.director_utils import GenericDirector
|
|
12
12
|
from pymodaq.utils.leco.pymodaq_listener import PymodaqListener
|
|
@@ -14,8 +14,8 @@ from pyleco.core import COORDINATOR_PORT
|
|
|
14
14
|
from pyleco.utils.listener import Listener, PipeHandler
|
|
15
15
|
from qtpy.QtCore import QObject, Signal # type: ignore
|
|
16
16
|
|
|
17
|
-
from
|
|
18
|
-
from
|
|
17
|
+
from pymodaq_utils.utils import ThreadCommand
|
|
18
|
+
from pymodaq_gui.parameter import ioxml
|
|
19
19
|
from pymodaq.utils.tcp_ip.serializer import DataWithAxes, SERIALIZABLE, DeSerializer
|
|
20
20
|
from pymodaq.utils.leco.utils import serialize_object
|
|
21
21
|
|
pymodaq/utils/leco/utils.py
CHANGED
|
@@ -4,7 +4,7 @@ from typing import Any, Union, get_args
|
|
|
4
4
|
|
|
5
5
|
# import also the DeSerializer for easier imports in dependents
|
|
6
6
|
from pymodaq.utils.tcp_ip.serializer import SERIALIZABLE, Serializer, DeSerializer # type: ignore # noqa
|
|
7
|
-
from
|
|
7
|
+
from pymodaq_utils.logger import set_logger
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
logger = set_logger('leco_utils')
|
pymodaq/utils/logger.py
CHANGED
|
@@ -1,78 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
"""
|
|
3
|
-
Created the 27/10/2022
|
|
1
|
+
from pymodaq_utils.logger import set_logger, get_module_name, get_set_config_dir, get_base_logger
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
import logging
|
|
8
|
-
import warnings
|
|
9
|
-
from logging.handlers import TimedRotatingFileHandler
|
|
10
|
-
from pathlib import Path
|
|
3
|
+
from pymodaq_utils.warnings import deprecation_msg
|
|
11
4
|
|
|
12
|
-
from pymodaq.
|
|
13
|
-
|
|
14
|
-
config = Config()
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def set_logger(logger_name, add_handler=False, base_logger=False, add_to_console=False, log_level=None,
|
|
18
|
-
logger_base_name='pymodaq') -> logging.Logger:
|
|
19
|
-
"""defines a logger of a given name and eventually add an handler to it
|
|
20
|
-
|
|
21
|
-
Parameters
|
|
22
|
-
----------
|
|
23
|
-
logger_name: (str) the name of the logger (usually it is the module name as returned by get_module_name
|
|
24
|
-
add_handler (bool) if True adds a TimedRotatingFileHandler to the logger instance (should be True if logger set from
|
|
25
|
-
main app
|
|
26
|
-
base_logger: (bool) specify if this is the parent logger (usually where one defines the handler)
|
|
27
|
-
|
|
28
|
-
Returns
|
|
29
|
-
-------
|
|
30
|
-
logger: (logging.Logger) logger instance
|
|
31
|
-
See Also
|
|
32
|
-
--------
|
|
33
|
-
get_module_name, logging.handlers.TimedRotatingFileHandler
|
|
34
|
-
"""
|
|
35
|
-
if not base_logger:
|
|
36
|
-
logger_name = f'{logger_base_name}.{logger_name}'
|
|
37
|
-
|
|
38
|
-
logger = logging.getLogger(logger_name)
|
|
39
|
-
log_path = get_set_config_dir('log', user=True)
|
|
40
|
-
if log_level is None:
|
|
41
|
-
log_level = config('general', 'debug_level')
|
|
42
|
-
logger.setLevel(log_level)
|
|
43
|
-
if add_handler:
|
|
44
|
-
log_file_path = log_path.joinpath(f'{logger_base_name}.log')
|
|
45
|
-
if not log_file_path.is_file():
|
|
46
|
-
log_file_path.touch(mode=0o777)
|
|
47
|
-
handler = TimedRotatingFileHandler(log_file_path, when='midnight')
|
|
48
|
-
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
49
|
-
handler.setFormatter(formatter)
|
|
50
|
-
logger.addHandler(handler)
|
|
51
|
-
|
|
52
|
-
logging.captureWarnings(True)
|
|
53
|
-
# only catch DeprecationWarning in DEBUG level
|
|
54
|
-
if log_level == 'DEBUG':
|
|
55
|
-
warnings.filterwarnings('default', category=DeprecationWarning)
|
|
56
|
-
else:
|
|
57
|
-
warnings.filterwarnings('ignore', category=DeprecationWarning)
|
|
58
|
-
warnings_logger = logging.getLogger("py.warnings")
|
|
59
|
-
warnings_logger.addHandler(handler)
|
|
60
|
-
|
|
61
|
-
if add_to_console:
|
|
62
|
-
console_handler = logging.StreamHandler()
|
|
63
|
-
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
64
|
-
console_handler.setFormatter(formatter)
|
|
65
|
-
logger.addHandler(console_handler)
|
|
66
|
-
return logger
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def get_base_logger(logger: logging.Logger) -> logging.Logger:
|
|
70
|
-
while logger.name != 'pymodaq':
|
|
71
|
-
logger = logger.parent
|
|
72
|
-
return logger
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def get_module_name(module__file__path):
|
|
76
|
-
"""from the full path of a module extract its name"""
|
|
77
|
-
path = Path(module__file__path)
|
|
78
|
-
return path.stem
|
|
5
|
+
deprecation_msg('Importing logger stuff from pymodaq is deprecated in pymodaq>5.0.0,'
|
|
6
|
+
'please use the pymodaq_utils package')
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
+
from collections import OrderedDict
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import sys
|
|
1
4
|
from typing import List
|
|
2
5
|
|
|
3
|
-
import pymodaq.utils.config
|
|
4
|
-
import pymodaq.utils.gui_utils.dock
|
|
5
|
-
import pymodaq.utils.gui_utils.file_io
|
|
6
|
-
import pymodaq.utils.messenger
|
|
7
6
|
from qtpy import QtWidgets, QtCore
|
|
8
|
-
import sys
|
|
9
|
-
import os
|
|
10
7
|
|
|
11
|
-
from
|
|
8
|
+
from pymodaq_utils.logger import set_logger, get_module_name
|
|
9
|
+
from pymodaq_utils import config as config_mod
|
|
10
|
+
|
|
11
|
+
from pymodaq_gui.managers.parameter_manager import ParameterManager
|
|
12
|
+
from pymodaq_gui.utils import Dock, file_io, DockArea
|
|
13
|
+
from pymodaq_gui.parameter import ioxml
|
|
14
|
+
from pymodaq_gui.messenger import messagebox
|
|
15
|
+
|
|
12
16
|
from pymodaq.utils.managers.modules_manager import ModulesManager
|
|
13
|
-
from pymodaq.utils.gui_utils import Dock
|
|
14
|
-
from pymodaq.utils.logger import set_logger, get_module_name
|
|
15
|
-
from pymodaq.utils import config as config_mod
|
|
16
|
-
from pymodaq.utils.parameter import ioxml
|
|
17
17
|
from pymodaq.utils.scanner import Scanner
|
|
18
18
|
from pymodaq.utils.scanner.scan_factory import ScannerBase
|
|
19
|
-
from pymodaq.utils.
|
|
20
|
-
from pathlib import Path
|
|
21
|
-
from collections import OrderedDict
|
|
22
|
-
from pymodaq.utils.messenger import messagebox
|
|
19
|
+
from pymodaq.utils.config import get_set_batch_path
|
|
23
20
|
|
|
24
21
|
logger = set_logger(get_module_name(__file__))
|
|
25
22
|
|
|
26
|
-
batch_path =
|
|
23
|
+
batch_path = get_set_batch_path()
|
|
27
24
|
|
|
28
25
|
params = [
|
|
29
26
|
{'title': 'Actuators/Detectors Selection', 'name': 'modules', 'type': 'group', 'children': [
|
|
@@ -92,7 +89,7 @@ class BatchManager(ParameterManager):
|
|
|
92
89
|
|
|
93
90
|
"""
|
|
94
91
|
if filename is None or filename is False:
|
|
95
|
-
filename =
|
|
92
|
+
filename = file_io.select_file(start_path=self.batch_path, save=False, ext='xml')
|
|
96
93
|
if filename == '':
|
|
97
94
|
return
|
|
98
95
|
|
|
@@ -301,7 +298,7 @@ class BatchScanner(QtCore.QObject):
|
|
|
301
298
|
|
|
302
299
|
def load_file(self, filepath=None):
|
|
303
300
|
if filepath is None:
|
|
304
|
-
path =
|
|
301
|
+
path = file_io.select_file(start_path=batch_path, save=False, ext='xml')
|
|
305
302
|
if path != '':
|
|
306
303
|
filepath = path
|
|
307
304
|
else:
|
|
@@ -319,7 +316,7 @@ def main_batch_scanner():
|
|
|
319
316
|
from pymodaq.control_modules.mocks import MockDAQMove, MockDAQViewer
|
|
320
317
|
app = QtWidgets.QApplication(sys.argv)
|
|
321
318
|
win = QtWidgets.QMainWindow()
|
|
322
|
-
area =
|
|
319
|
+
area = DockArea()
|
|
323
320
|
win.setCentralWidget(area)
|
|
324
321
|
|
|
325
322
|
# prog = BatchManager(msgbox=False, actuators=['Xaxis', 'Yaxis'], detectors=['Det0D', 'Det1D'])
|
|
@@ -5,12 +5,16 @@ from qtpy.QtCore import QObject, Signal, Slot, QThread
|
|
|
5
5
|
from qtpy import QtWidgets
|
|
6
6
|
import time
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
|
|
12
|
-
from
|
|
13
|
-
|
|
8
|
+
from pymodaq_utils.logger import set_logger, get_module_name
|
|
9
|
+
from pymodaq_utils import utils
|
|
10
|
+
from pymodaq_utils.config import Config
|
|
11
|
+
|
|
12
|
+
from pymodaq_data.data import DataToExport
|
|
13
|
+
|
|
14
|
+
from pymodaq_gui.managers.parameter_manager import ParameterManager
|
|
15
|
+
from pymodaq_gui.utils import Dock
|
|
16
|
+
|
|
17
|
+
from pymodaq.utils.data import DataActuator
|
|
14
18
|
|
|
15
19
|
|
|
16
20
|
if TYPE_CHECKING:
|
|
@@ -490,7 +494,6 @@ if __name__ == '__main__':
|
|
|
490
494
|
app = QtWidgets.QApplication(sys.argv)
|
|
491
495
|
from qtpy.QtCore import QThread
|
|
492
496
|
from pymodaq.utils.gui_utils import DockArea
|
|
493
|
-
from pyqtgraph.dockarea import Dock
|
|
494
497
|
from pymodaq.control_modules.daq_viewer import DAQ_Viewer
|
|
495
498
|
from pymodaq.control_modules.daq_move import DAQ_Move
|
|
496
499
|
|
|
@@ -2,11 +2,9 @@ from qtpy import QtWidgets
|
|
|
2
2
|
import sys
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from pyqtgraph.parametertree.parameterTypes.basetypes import GroupParameter
|
|
9
|
-
from pymodaq.utils.gui_utils import select_file
|
|
5
|
+
from pymodaq_gui.parameter import ioxml, Parameter, ParameterTree
|
|
6
|
+
from pymodaq_gui.parameter.pymodaq_ptypes import registerParameterType, GroupParameter
|
|
7
|
+
from pymodaq_gui.utils import select_file
|
|
10
8
|
|
|
11
9
|
# check if overshoot_configurations directory exists on the drive
|
|
12
10
|
from pymodaq.utils.config import get_set_overshoot_path
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
from pymodaq.extensions import get_models
|
|
2
|
-
import pymodaq.utils.config
|
|
3
|
-
from pymodaq.utils.logger import set_logger, get_module_name, get_module_name
|
|
4
|
-
from pymodaq.utils.gui_utils.file_io import select_file
|
|
5
|
-
from qtpy import QtWidgets
|
|
6
|
-
import sys
|
|
7
1
|
import os
|
|
8
|
-
from pymodaq.utils.parameter import ParameterTree, Parameter
|
|
9
|
-
from pymodaq.utils.parameter import ioxml
|
|
10
|
-
from pymodaq.utils import daq_utils as utils
|
|
11
2
|
from pathlib import Path
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from qtpy import QtWidgets
|
|
6
|
+
|
|
7
|
+
import pymodaq_utils.config as config_mod
|
|
8
|
+
from pymodaq_utils.logger import set_logger, get_module_name
|
|
9
|
+
|
|
10
|
+
from pymodaq_gui.utils.file_io import select_file
|
|
11
|
+
from pymodaq_gui.parameter import ParameterTree, Parameter
|
|
12
|
+
from pymodaq_gui.parameter import ioxml
|
|
13
|
+
from pymodaq_gui.messenger import dialog as dialogbox
|
|
14
|
+
from pymodaq.utils import config as config_mod_pymodaq
|
|
15
|
+
from pymodaq.extensions import get_models
|
|
16
|
+
|
|
12
17
|
import pymodaq.utils.managers.preset_manager_utils # to register move and det types
|
|
13
18
|
|
|
14
19
|
logger = set_logger(get_module_name(__file__))
|
|
15
20
|
|
|
16
21
|
# check if preset_mode directory exists on the drive
|
|
17
|
-
pid_path =
|
|
18
|
-
preset_path =
|
|
19
|
-
overshoot_path =
|
|
20
|
-
layout_path =
|
|
22
|
+
pid_path = config_mod_pymodaq.get_set_pid_path()
|
|
23
|
+
preset_path = config_mod_pymodaq.get_set_preset_path()
|
|
24
|
+
overshoot_path = config_mod_pymodaq.get_set_overshoot_path()
|
|
25
|
+
layout_path = config_mod_pymodaq.get_set_layout_path()
|
|
21
26
|
|
|
22
27
|
pid_models = [mod['name'] for mod in get_models()]
|
|
23
28
|
|
|
@@ -169,8 +174,25 @@ class PresetManager:
|
|
|
169
174
|
# save managers parameters in a xml file
|
|
170
175
|
# start = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0]
|
|
171
176
|
# start = os.path.join("..",'daq_scan')
|
|
172
|
-
|
|
173
|
-
|
|
177
|
+
filename_without_extension = self.preset_params.child('filename').value()
|
|
178
|
+
|
|
179
|
+
try:
|
|
180
|
+
ioxml.parameter_to_xml_file(self.preset_params,
|
|
181
|
+
os.path.join(path, filename_without_extension),
|
|
182
|
+
overwrite=False)
|
|
183
|
+
except FileExistsError as currenterror:
|
|
184
|
+
# logger.warning(str(currenterror)+"File " + filename_without_extension + ".xml exists")
|
|
185
|
+
logger.warning(f"{currenterror} File {filename_without_extension}.xml exists")
|
|
186
|
+
user_agreed = dialogbox(title='Overwrite confirmation',
|
|
187
|
+
message="File exist do you want to overwrite it ?")
|
|
188
|
+
if user_agreed:
|
|
189
|
+
ioxml.parameter_to_xml_file(self.preset_params,
|
|
190
|
+
os.path.join(path, filename_without_extension))
|
|
191
|
+
logger.warning(f"File {filename_without_extension}.xml overwriten at user request")
|
|
192
|
+
else:
|
|
193
|
+
logger.warning(f"File {filename_without_extension}.xml wasn't saved at user request")
|
|
194
|
+
# emit status signal to dashboard to write : did not save ?
|
|
195
|
+
pass
|
|
174
196
|
|
|
175
197
|
if not self.pid_type:
|
|
176
198
|
# check if overshoot configuration and layout configuration with same name exists => delete them if yes
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import random
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from
|
|
3
|
+
from pymodaq_utils.logger import set_logger, get_module_name
|
|
4
|
+
from pymodaq_utils import utils
|
|
5
|
+
|
|
6
|
+
from pymodaq_gui.parameter.pymodaq_ptypes import registerParameterType, GroupParameter
|
|
7
|
+
|
|
5
8
|
from pymodaq.control_modules.move_utility_classes import params as daq_move_params
|
|
6
9
|
from pymodaq.control_modules.viewer_utility_classes import params as daq_viewer_params
|
|
10
|
+
from pymodaq.utils.daq_utils import get_plugins
|
|
7
11
|
|
|
8
|
-
from pyqtgraph.parametertree.Parameter import registerParameterType
|
|
9
|
-
from pyqtgraph.parametertree.parameterTypes.basetypes import GroupParameter
|
|
10
12
|
logger = set_logger(get_module_name(__file__))
|
|
11
13
|
|
|
12
|
-
DAQ_Move_Stage_type =
|
|
13
|
-
DAQ_0DViewer_Det_types =
|
|
14
|
-
DAQ_1DViewer_Det_types =
|
|
15
|
-
DAQ_2DViewer_Det_types =
|
|
16
|
-
DAQ_NDViewer_Det_types =
|
|
14
|
+
DAQ_Move_Stage_type = get_plugins('daq_move')
|
|
15
|
+
DAQ_0DViewer_Det_types = get_plugins('daq_0Dviewer')
|
|
16
|
+
DAQ_1DViewer_Det_types = get_plugins('daq_1Dviewer')
|
|
17
|
+
DAQ_2DViewer_Det_types = get_plugins('daq_2Dviewer')
|
|
18
|
+
DAQ_NDViewer_Det_types = get_plugins('daq_NDviewer')
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
def iterative_show_pb(params):
|