pymodaq 4.4.7__py3-none-any.whl → 5.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pymodaq might be problematic. Click here for more details.
- pymodaq/__init__.py +57 -91
- pymodaq/control_modules/daq_move.py +64 -46
- pymodaq/control_modules/daq_move_ui.py +34 -12
- pymodaq/control_modules/daq_viewer.py +55 -30
- pymodaq/control_modules/daq_viewer_ui.py +6 -6
- pymodaq/control_modules/mocks.py +1 -1
- pymodaq/control_modules/move_utility_classes.py +51 -43
- pymodaq/control_modules/utils.py +43 -20
- pymodaq/control_modules/viewer_utility_classes.py +54 -18
- pymodaq/daq_utils/daq_utils.py +6 -0
- pymodaq/dashboard.py +639 -323
- pymodaq/examples/function_plotter.py +13 -12
- pymodaq/examples/tcp_client.py +1 -1
- pymodaq/extensions/__init__.py +1 -1
- pymodaq/extensions/bayesian/bayesian_optimisation.py +44 -32
- pymodaq/extensions/bayesian/utils.py +10 -10
- pymodaq/extensions/console.py +7 -6
- pymodaq/extensions/daq_logger/__init__.py +1 -0
- pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +30 -30
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger.py +16 -15
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger_models.py +2 -0
- pymodaq/{utils/h5modules → extensions/daq_logger}/h5logging.py +7 -8
- pymodaq/extensions/daq_scan.py +42 -34
- pymodaq/extensions/daq_scan_ui.py +18 -18
- pymodaq/extensions/h5browser.py +2 -3
- pymodaq/extensions/pid/__init__.py +4 -2
- pymodaq/extensions/pid/daq_move_PID.py +3 -3
- pymodaq/extensions/pid/pid_controller.py +59 -50
- pymodaq/extensions/pid/utils.py +10 -5
- pymodaq/extensions/utils.py +33 -3
- pymodaq/post_treatment/load_and_plot.py +10 -7
- pymodaq/resources/preset_default.xml +1 -1
- pymodaq/updater.py +107 -0
- pymodaq/utils/array_manipulation.py +4 -384
- pymodaq/utils/calibration_camera.py +12 -9
- pymodaq/utils/chrono_timer.py +11 -10
- pymodaq/utils/config.py +3 -458
- pymodaq/utils/daq_utils.py +9 -715
- pymodaq/utils/data.py +17 -2959
- pymodaq/utils/enums.py +4 -74
- pymodaq/utils/exceptions.py +0 -4
- pymodaq/utils/gui_utils/__init__.py +8 -8
- pymodaq/utils/gui_utils/loader_utils.py +26 -1
- pymodaq/utils/gui_utils/utils.py +8 -162
- pymodaq/utils/gui_utils/widgets/lcd.py +6 -109
- pymodaq/utils/h5modules/__init__.py +0 -4
- pymodaq/utils/h5modules/module_saving.py +9 -8
- pymodaq/utils/leco/__init__.py +2 -2
- pymodaq/utils/leco/daq_move_LECODirector.py +3 -6
- pymodaq/utils/leco/daq_xDviewer_LECODirector.py +5 -5
- pymodaq/utils/leco/director_utils.py +2 -2
- pymodaq/utils/leco/leco_director.py +3 -3
- pymodaq/utils/leco/pymodaq_listener.py +4 -3
- pymodaq/utils/leco/utils.py +11 -9
- pymodaq/utils/logger.py +4 -76
- pymodaq/utils/managers/batchscan_manager.py +16 -19
- pymodaq/utils/managers/modules_manager.py +30 -17
- pymodaq/utils/managers/overshoot_manager.py +48 -6
- pymodaq/utils/managers/preset_manager.py +39 -59
- pymodaq/utils/managers/preset_manager_utils.py +28 -22
- pymodaq/utils/managers/remote_manager.py +12 -10
- pymodaq/utils/math_utils.py +4 -582
- pymodaq/utils/messenger.py +4 -64
- pymodaq/utils/parameter/__init__.py +6 -9
- pymodaq/utils/parameter/utils.py +4 -328
- pymodaq/utils/scanner/scan_config.py +1 -1
- pymodaq/utils/scanner/scan_factory.py +16 -12
- pymodaq/utils/{plotting → scanner}/scan_selector.py +19 -20
- pymodaq/utils/scanner/scanner.py +10 -8
- pymodaq/utils/scanner/scanners/_1d_scanners.py +8 -5
- pymodaq/utils/scanner/scanners/_2d_scanners.py +5 -5
- pymodaq/utils/scanner/scanners/sequential.py +8 -8
- pymodaq/utils/scanner/scanners/tabular.py +9 -9
- pymodaq/utils/scanner/utils.py +6 -4
- pymodaq/utils/svg/svg_viewer2D.py +3 -4
- pymodaq/utils/tcp_ip/mysocket.py +4 -110
- pymodaq/utils/tcp_ip/serializer.py +4 -801
- pymodaq/utils/tcp_ip/tcp_server_client.py +15 -13
- pymodaq-5.0.1.dist-info/METADATA +242 -0
- pymodaq-5.0.1.dist-info/RECORD +122 -0
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/WHEEL +1 -1
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/entry_points.txt +1 -0
- pymodaq/examples/custom_app.py +0 -258
- pymodaq/examples/custom_viewer.py +0 -112
- pymodaq/examples/parameter_ex.py +0 -138
- pymodaq/examples/preset_MockCamera.xml +0 -1
- pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.py +0 -142
- pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.ui +0 -232
- pymodaq/post_treatment/daq_measurement/daq_measurement_main.py +0 -391
- pymodaq/post_treatment/daq_measurement/process_from_QtDesigner_DAQ_Measurement_GUI.bat +0 -2
- pymodaq/post_treatment/process_to_scalar.py +0 -263
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/algo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/input.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/random.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/target.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -238
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127453
- pymodaq/resources/QtDesigner_Ressources/__init__.py +0 -0
- pymodaq/resources/QtDesigner_Ressources/credit.rst +0 -7
- pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
- pymodaq/resources/VERSION +0 -2
- pymodaq/resources/config_template.toml +0 -96
- pymodaq/resources/triangulation_data.npy +0 -0
- pymodaq/utils/abstract/__init__.py +0 -48
- pymodaq/utils/db/__init__.py +0 -0
- pymodaq/utils/db/db_logger/__init__.py +0 -0
- pymodaq/utils/factory.py +0 -82
- pymodaq/utils/gui_utils/custom_app.py +0 -133
- pymodaq/utils/gui_utils/dock.py +0 -107
- pymodaq/utils/gui_utils/file_io.py +0 -94
- pymodaq/utils/gui_utils/layout.py +0 -34
- pymodaq/utils/gui_utils/list_picker.py +0 -38
- pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
- pymodaq/utils/gui_utils/widgets/label.py +0 -24
- pymodaq/utils/gui_utils/widgets/push.py +0 -149
- pymodaq/utils/gui_utils/widgets/qled.py +0 -62
- pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
- pymodaq/utils/gui_utils/widgets/table.py +0 -263
- pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
- pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -110
- pymodaq/utils/h5modules/backends.py +0 -1022
- pymodaq/utils/h5modules/browsing.py +0 -627
- pymodaq/utils/h5modules/data_saving.py +0 -1107
- pymodaq/utils/h5modules/exporter.py +0 -119
- pymodaq/utils/h5modules/exporters/__init__.py +0 -0
- pymodaq/utils/h5modules/exporters/base.py +0 -111
- pymodaq/utils/h5modules/exporters/flimj.py +0 -63
- pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
- pymodaq/utils/h5modules/saving.py +0 -866
- pymodaq/utils/h5modules/utils.py +0 -115
- pymodaq/utils/managers/action_manager.py +0 -489
- pymodaq/utils/managers/parameter_manager.py +0 -279
- pymodaq/utils/managers/roi_manager.py +0 -740
- pymodaq/utils/parameter/ioxml.py +0 -545
- pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
- pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
- pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
- pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
- pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
- pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
- pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
- pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
- pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
- pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -166
- pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
- pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
- pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
- pymodaq/utils/plotting/__init__.py +0 -0
- pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
- pymodaq/utils/plotting/data_viewers/base.py +0 -286
- pymodaq/utils/plotting/data_viewers/viewer.py +0 -275
- pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
- pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -826
- pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
- pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
- pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
- pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
- pymodaq/utils/plotting/gant_chart.py +0 -123
- pymodaq/utils/plotting/image_viewer.py +0 -97
- pymodaq/utils/plotting/items/__init__.py +0 -0
- pymodaq/utils/plotting/items/axis_scaled.py +0 -93
- pymodaq/utils/plotting/items/crosshair.py +0 -94
- pymodaq/utils/plotting/items/image.py +0 -388
- pymodaq/utils/plotting/navigator.py +0 -353
- pymodaq/utils/plotting/plotter/plotter.py +0 -94
- pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
- pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
- pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
- pymodaq/utils/plotting/utils/__init__.py +0 -0
- pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
- pymodaq/utils/plotting/utils/filter.py +0 -585
- pymodaq/utils/plotting/utils/lineout.py +0 -226
- pymodaq/utils/plotting/utils/plot_utils.py +0 -579
- pymodaq/utils/plotting/utils/signalND.py +0 -1347
- pymodaq/utils/plotting/widgets.py +0 -76
- pymodaq/utils/qvariant.py +0 -12
- pymodaq/utils/slicing.py +0 -63
- pymodaq/utils/units.py +0 -216
- pymodaq-4.4.7.dist-info/METADATA +0 -163
- pymodaq-4.4.7.dist-info/RECORD +0 -446
- /pymodaq/{post_treatment/daq_analysis → daq_utils}/__init__.py +0 -0
- /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
- /pymodaq/{post_treatment/daq_measurement → extensions/daq_logger/db}/__init__.py +0 -0
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/licenses/LICENSE +0 -0
pymodaq/utils/enums.py
CHANGED
|
@@ -1,76 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
from pymodaq.utils.math_utils import find_index
|
|
3
|
-
from pymodaq.utils.math_utils import my_moment
|
|
4
|
-
import numpy as np
|
|
5
|
-
from scipy.optimize import curve_fit
|
|
6
|
-
from typing import List, Union
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class BaseEnum(Enum):
|
|
10
|
-
"""Enum to be used within pymodaq with some utility methods"""
|
|
11
|
-
|
|
12
|
-
@classmethod
|
|
13
|
-
def names(cls) -> List[str]:
|
|
14
|
-
"""Returns all the names of the enum"""
|
|
15
|
-
return list(cls.__members__.keys())
|
|
16
|
-
|
|
17
|
-
@classmethod
|
|
18
|
-
def values(cls) -> List[str]:
|
|
19
|
-
"""Returns all the names of the enum"""
|
|
20
|
-
return [cls[name].value for name in cls.names()]
|
|
21
|
-
|
|
22
|
-
@classmethod
|
|
23
|
-
def to_dict(cls):
|
|
24
|
-
""" Returns the enum in form of a dict with names os keys
|
|
25
|
-
|
|
26
|
-
New in 4.0.2
|
|
27
|
-
"""
|
|
28
|
-
return {name: cls[name].value for name in cls.names()}
|
|
29
|
-
|
|
30
|
-
@classmethod
|
|
31
|
-
def to_dict_value(cls):
|
|
32
|
-
""" Returns the enum in form of a dict with values os keys
|
|
33
|
-
|
|
34
|
-
New in 4.0.2
|
|
35
|
-
"""
|
|
36
|
-
return {cls[name].value: name for name in cls.names()}
|
|
37
|
-
|
|
38
|
-
def __eq__(self, other: Union[str, Enum]):
|
|
39
|
-
"""testing for equality using the enum name"""
|
|
40
|
-
if isinstance(other, str):
|
|
41
|
-
if other == self.name:
|
|
42
|
-
return True
|
|
43
|
-
return super().__eq__(other)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def enum_checker(enum: BaseEnum, item: Union[BaseEnum, str]):
|
|
47
|
-
"""Check if the item parameter is a valid enum or at least one valid string name of the enum
|
|
48
|
-
|
|
49
|
-
If a string, transforms it to a valid enum (case not important)
|
|
50
|
-
|
|
51
|
-
Parameters
|
|
52
|
-
----------
|
|
53
|
-
enum: BaseEnum class or one of its derivated class
|
|
54
|
-
|
|
55
|
-
item: str or BaseEnum instance
|
|
56
|
-
|
|
57
|
-
Returns
|
|
58
|
-
-------
|
|
59
|
-
BaseEnum class or one of its derivated class
|
|
60
|
-
"""
|
|
61
|
-
|
|
62
|
-
if not isinstance(item, enum):
|
|
63
|
-
if not isinstance(item, str):
|
|
64
|
-
raise ValueError(f'{item} is an invalid {enum}. Should be a {enum} enum or '
|
|
65
|
-
f'a string in {enum.names()}')
|
|
66
|
-
for ind, name in enumerate(enum.names()):
|
|
67
|
-
if item.lower() == name.lower():
|
|
68
|
-
item = enum[name]
|
|
69
|
-
break
|
|
70
|
-
else:
|
|
71
|
-
raise ValueError(f'{item} is an invalid {enum}. Should be a {enum} enum or '
|
|
72
|
-
f'a string in {enum.names()}')
|
|
73
|
-
return item
|
|
74
|
-
|
|
1
|
+
from pymodaq_utils.enums import *
|
|
75
2
|
|
|
3
|
+
from pymodaq_utils.warnings import deprecation_msg
|
|
76
4
|
|
|
5
|
+
deprecation_msg('Importing enums stuff from pymodaq is deprecated in pymodaq>5.0.0,'
|
|
6
|
+
'please use the pymodaq_utils.enums module')
|
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
|
|
@@ -5,9 +5,30 @@ from qtpy import QtWidgets
|
|
|
5
5
|
from pymodaq.dashboard import DashBoard
|
|
6
6
|
from pymodaq.utils.gui_utils import DockArea
|
|
7
7
|
from pymodaq.utils.config import get_set_preset_path
|
|
8
|
+
from pymodaq.extensions.utils import CustomExt
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
def load_dashboard_with_preset(preset_name: str, extension_name: str)
|
|
11
|
+
def load_dashboard_with_preset(preset_name: str, extension_name: str) -> \
|
|
12
|
+
(DashBoard, CustomExt, QtWidgets.QMainWindow):
|
|
13
|
+
""" Load the Dashboard using a given preset then load an extension
|
|
14
|
+
|
|
15
|
+
Parameters
|
|
16
|
+
----------
|
|
17
|
+
preset_name: str
|
|
18
|
+
The filename (without extension) defining the preset to be loaded in the Dashboard
|
|
19
|
+
extension_name: str
|
|
20
|
+
The name of the extension. Either the builtins ones:
|
|
21
|
+
* 'DAQScan'
|
|
22
|
+
* 'DAQLogger'
|
|
23
|
+
* 'DAQ_PID'
|
|
24
|
+
* 'Bayesian'
|
|
25
|
+
|
|
26
|
+
or the ones defined within a plugin
|
|
27
|
+
|
|
28
|
+
Returns
|
|
29
|
+
-------
|
|
30
|
+
|
|
31
|
+
"""
|
|
11
32
|
win = QtWidgets.QMainWindow()
|
|
12
33
|
area = DockArea()
|
|
13
34
|
win.setCentralWidget(area)
|
|
@@ -26,6 +47,10 @@ def load_dashboard_with_preset(preset_name: str, extension_name: str):
|
|
|
26
47
|
extension = dashboard.load_scan_module()
|
|
27
48
|
elif extension_name == 'DAQLogger':
|
|
28
49
|
extension = dashboard.load_log_module()
|
|
50
|
+
elif extension_name == 'DAQ_PID':
|
|
51
|
+
extension = dashboard.load_pid_module()
|
|
52
|
+
elif extension_name == 'Bayesian':
|
|
53
|
+
extension = dashboard.load_bayesian()
|
|
29
54
|
else:
|
|
30
55
|
extension = dashboard.load_extension_from_name(extension_name)
|
|
31
56
|
else:
|
pymodaq/utils/gui_utils/utils.py
CHANGED
|
@@ -1,172 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
from pymodaq_utils.config import Config
|
|
2
|
+
from pymodaq_utils.logger import set_logger, get_module_name
|
|
2
3
|
|
|
3
|
-
from
|
|
4
|
-
from qtpy import QtWidgets, QtCore, QtGui
|
|
4
|
+
from pymodaq_gui.utils.splash import get_splash_sc
|
|
5
5
|
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from pymodaq.utils.config import Config
|
|
8
|
-
from pymodaq.utils.logger import set_logger, get_module_name
|
|
9
|
-
from pyqtgraph import mkQApp as mkQApppg
|
|
10
6
|
|
|
11
7
|
config = Config()
|
|
12
8
|
logger = set_logger(get_module_name(__file__))
|
|
13
9
|
|
|
10
|
+
from pymodaq_utils.warnings import deprecation_msg
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{'title': 'Do Save:', 'name': 'do_save', 'type': 'bool', 'default': False, 'value': False},
|
|
20
|
-
{'title': 'N saved:', 'name': 'N_saved', 'type': 'int', 'default': 0, 'value': 0, 'visible': False},
|
|
21
|
-
]
|
|
12
|
+
deprecation_msg('Importing get_splash_sc stuff from pymodaq is deprecated '
|
|
13
|
+
'in pymodaq>5.0.0,'
|
|
14
|
+
'please use the same method from the '
|
|
15
|
+
'pymodaq_gui.utils.splash module')
|
|
22
16
|
|
|
23
|
-
def get_splash_sc():
|
|
24
|
-
here = Path(__file__)
|
|
25
|
-
splash_sc = QtWidgets.QSplashScreen(QtGui.QPixmap(str(here.parent.parent.parent.joinpath('splash.png'))),
|
|
26
|
-
Qt.WindowStaysOnTopHint)
|
|
27
|
-
return splash_sc
|
|
28
17
|
|
|
29
18
|
|
|
30
|
-
def clickable(widget):
|
|
31
|
-
class Filter(QObject):
|
|
32
|
-
clicked = Signal()
|
|
33
|
-
|
|
34
|
-
def eventFilter(self, obj, event):
|
|
35
|
-
if obj == widget:
|
|
36
|
-
if event.type() == QEvent.MouseButtonRelease:
|
|
37
|
-
if obj.rect().contains(event.pos()):
|
|
38
|
-
self.clicked.emit()
|
|
39
|
-
# The developer can opt for .emit(obj) to get the object within the slot.
|
|
40
|
-
return True
|
|
41
|
-
return False
|
|
42
|
-
|
|
43
|
-
filter = Filter(widget)
|
|
44
|
-
widget.installEventFilter(filter)
|
|
45
|
-
return filter.clicked
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def h5tree_to_QTree(base_node, base_tree_elt=None, pixmap_items=[]):
|
|
49
|
-
"""
|
|
50
|
-
| Convert a loaded h5 file to a QTreeWidgetItem element structure containing two columns.
|
|
51
|
-
| The first is the name of the h5 current node, the second is the path of the node in the h5 structure.
|
|
52
|
-
|
|
|
53
|
-
| Recursive function discreasing on base_node.
|
|
54
|
-
|
|
55
|
-
================== ======================================== ===============================
|
|
56
|
-
**Parameters** **Type** **Description**
|
|
57
|
-
|
|
58
|
-
*h5file* instance class File from tables module loaded h5 file
|
|
59
|
-
|
|
60
|
-
*base_node* pytables h5 node parent node
|
|
61
|
-
|
|
62
|
-
*base_tree_elt* QTreeWidgetItem parent QTreeWidgetItem element
|
|
63
|
-
================== ======================================== ===============================
|
|
64
|
-
|
|
65
|
-
Returns
|
|
66
|
-
-------
|
|
67
|
-
QTreeWidgetItem
|
|
68
|
-
h5 structure copy converted into QtreeWidgetItem structure.
|
|
69
|
-
|
|
70
|
-
See Also
|
|
71
|
-
--------
|
|
72
|
-
h5tree_to_QTree
|
|
73
|
-
|
|
74
|
-
"""
|
|
75
|
-
|
|
76
|
-
if base_tree_elt is None:
|
|
77
|
-
base_tree_elt = QtWidgets.QTreeWidgetItem([base_node.name, "", base_node.path])
|
|
78
|
-
for node_name, node in base_node.children().items():
|
|
79
|
-
child = QtWidgets.QTreeWidgetItem([node_name, "", node.path])
|
|
80
|
-
if 'pixmap' in node.attrs.attrs_name:
|
|
81
|
-
pixmap_items.append(dict(node=node, item=child))
|
|
82
|
-
klass = node.attrs['CLASS']
|
|
83
|
-
if klass == 'GROUP':
|
|
84
|
-
h5tree_to_QTree(node, child, pixmap_items)
|
|
85
|
-
|
|
86
|
-
base_tree_elt.addChild(child)
|
|
87
|
-
return base_tree_elt, pixmap_items
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def set_enable_recursive(children, enable=False):
|
|
91
|
-
"""Apply the enable state on all children widgets, do it recursively
|
|
92
|
-
|
|
93
|
-
Parameters
|
|
94
|
-
----------
|
|
95
|
-
children: (list) elements children ofa pyqt5 element
|
|
96
|
-
enable: (bool) set enabled state (True) of all children widgets
|
|
97
|
-
"""
|
|
98
|
-
for child in children:
|
|
99
|
-
if not children:
|
|
100
|
-
return
|
|
101
|
-
elif isinstance(child, QtWidgets.QSpinBox) or isinstance(child, QtWidgets.QComboBox) or \
|
|
102
|
-
isinstance(child, QtWidgets.QPushButton) or isinstance(child, QtWidgets.QListWidget):
|
|
103
|
-
child.setEnabled(enable)
|
|
104
|
-
else:
|
|
105
|
-
set_enable_recursive(child.children(), enable)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def widget_to_png_to_bytes(widget, keep_aspect=True, width=200, height=100):
|
|
109
|
-
"""
|
|
110
|
-
Renders the widget content in a png format as a bytes string
|
|
111
|
-
Parameters
|
|
112
|
-
----------
|
|
113
|
-
widget: (QWidget) the widget to render
|
|
114
|
-
keep_aspect: (bool) if True use width and the widget aspect ratio to calculate the height
|
|
115
|
-
if False use set values of width and height to produce the png
|
|
116
|
-
width: (int) the rendered width of the png
|
|
117
|
-
height: (int) the rendered width of the png
|
|
118
|
-
|
|
119
|
-
Returns
|
|
120
|
-
-------
|
|
121
|
-
binary string
|
|
122
|
-
|
|
123
|
-
"""
|
|
124
|
-
png = widget.grab().toImage()
|
|
125
|
-
wwidth = widget.width()
|
|
126
|
-
wheight = widget.height()
|
|
127
|
-
if keep_aspect:
|
|
128
|
-
height = width * wheight / wwidth
|
|
129
|
-
|
|
130
|
-
png = png.scaled(int(width), int(height), QtCore.Qt.KeepAspectRatio)
|
|
131
|
-
buffer = QtCore.QBuffer()
|
|
132
|
-
buffer.open(QtCore.QIODevice.WriteOnly)
|
|
133
|
-
png.save(buffer, "png")
|
|
134
|
-
return buffer.data().data()
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def pngbinary2Qlabel(databinary, scale_height: int = None):
|
|
138
|
-
buff = QBuffer()
|
|
139
|
-
buff.open(QIODevice.WriteOnly)
|
|
140
|
-
buff.write(databinary)
|
|
141
|
-
dat = buff.data()
|
|
142
|
-
pixmap = QtGui.QPixmap()
|
|
143
|
-
pixmap.loadFromData(dat, 'PNG')
|
|
144
|
-
if scale_height is not None and isinstance(scale_height, int):
|
|
145
|
-
pixmap = pixmap.scaledToHeight(scale_height)
|
|
146
|
-
label = QtWidgets.QLabel()
|
|
147
|
-
label.setPixmap(pixmap)
|
|
148
|
-
return label
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
def start_qapplication() -> QtWidgets.QApplication:
|
|
152
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
153
|
-
if config('style', 'darkstyle'):
|
|
154
|
-
import qdarkstyle
|
|
155
|
-
app.setStyleSheet(qdarkstyle.load_stylesheet(qdarkstyle.DarkPalette))
|
|
156
|
-
return app
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
def mkQApp(name: str):
|
|
160
|
-
app = mkQApppg(name)
|
|
161
|
-
if config('style', 'darkstyle'):
|
|
162
|
-
import qdarkstyle
|
|
163
|
-
app.setStyleSheet(qdarkstyle.load_stylesheet(qdarkstyle.DarkPalette))
|
|
164
|
-
return app
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
def exec():
|
|
168
|
-
app = mkQApp()
|
|
169
|
-
if config('style', 'darkstyle'):
|
|
170
|
-
import qdarkstyle
|
|
171
|
-
app.setStyleSheet(qdarkstyle.load_stylesheet(qdarkstyle.DarkPalette))
|
|
172
|
-
return app.exec() if hasattr(app, 'exec') else app.exec_()
|
|
@@ -1,111 +1,8 @@
|
|
|
1
|
-
from
|
|
1
|
+
from pymodaq_gui.utils.widgets.lcd import LCD
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from pymodaq_utils.warnings import deprecation_msg
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
|
|
7
|
-
from
|
|
8
|
-
|
|
9
|
-
import sys
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class LCD(QObject):
|
|
13
|
-
|
|
14
|
-
def __init__(self, parent: QtWidgets.QWidget, **kwargs):
|
|
15
|
-
super().__init__()
|
|
16
|
-
self.Nvals = None
|
|
17
|
-
self.labels = None
|
|
18
|
-
self.parent = parent
|
|
19
|
-
self.viewer0D = None
|
|
20
|
-
self.digits = 3
|
|
21
|
-
self.setupui(**kwargs)
|
|
22
|
-
|
|
23
|
-
def setvalues(self, values: List[np.ndarray]):
|
|
24
|
-
"""
|
|
25
|
-
display values on lcds
|
|
26
|
-
Parameters
|
|
27
|
-
----------
|
|
28
|
-
values: list of 0D ndarray
|
|
29
|
-
|
|
30
|
-
Returns
|
|
31
|
-
-------
|
|
32
|
-
|
|
33
|
-
"""
|
|
34
|
-
while len(values) < self.Nvals:
|
|
35
|
-
values.append(np.array([0.]))
|
|
36
|
-
if len(values) > self.Nvals:
|
|
37
|
-
values = values[:self.Nvals]
|
|
38
|
-
vals = []
|
|
39
|
-
for ind, val in enumerate(values):
|
|
40
|
-
self.lcds[ind].display(val[0])
|
|
41
|
-
vals.append(val)
|
|
42
|
-
self.viewer0D.show_data(DataRaw(name='LCD', data=values))
|
|
43
|
-
|
|
44
|
-
def setupui(self, **kwargs):
|
|
45
|
-
if 'digits' in kwargs:
|
|
46
|
-
self.digits = kwargs['digits']
|
|
47
|
-
if 'Nvals' in kwargs:
|
|
48
|
-
self.Nvals = kwargs['Nvals']
|
|
49
|
-
else:
|
|
50
|
-
self.Nvals = 1
|
|
51
|
-
if 'labels' in kwargs:
|
|
52
|
-
self.labels = kwargs['labels']
|
|
53
|
-
else:
|
|
54
|
-
self.labels = ['CH{:d}'.format(ind) for ind in range(self.Nvals)]
|
|
55
|
-
|
|
56
|
-
while len(self.labels) < self.Nvals:
|
|
57
|
-
self.labels.append('')
|
|
58
|
-
|
|
59
|
-
vlayout = QtWidgets.QVBoxLayout()
|
|
60
|
-
hsplitter = QtWidgets.QSplitter()
|
|
61
|
-
vlayout.addWidget(hsplitter)
|
|
62
|
-
self.parent.setLayout(vlayout)
|
|
63
|
-
form = QtWidgets.QWidget()
|
|
64
|
-
self.viewer0D = Viewer0D(form)
|
|
65
|
-
self.viewer0D.labels = self.labels
|
|
66
|
-
|
|
67
|
-
vlayout = QtWidgets.QVBoxLayout()
|
|
68
|
-
|
|
69
|
-
lcd_layouts = []
|
|
70
|
-
labels = []
|
|
71
|
-
self.lcds = []
|
|
72
|
-
|
|
73
|
-
for ind in range(self.Nvals):
|
|
74
|
-
lcd_layouts.append(QtWidgets.QVBoxLayout())
|
|
75
|
-
labels.append(QtWidgets.QLabel(self.labels[ind]))
|
|
76
|
-
labels[-1].setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
|
77
|
-
self.lcds.append(QtWidgets.QLCDNumber())
|
|
78
|
-
self.lcds[-1].setDigitCount(self.digits)
|
|
79
|
-
lcd_layouts[-1].addWidget(labels[-1])
|
|
80
|
-
lcd_layouts[-1].addWidget(self.lcds[-1])
|
|
81
|
-
vlayout.addLayout(lcd_layouts[-1])
|
|
82
|
-
|
|
83
|
-
if ind != self.Nvals - 1:
|
|
84
|
-
hFrame = QtWidgets.QFrame()
|
|
85
|
-
hFrame.setFrameShape(QtWidgets.QFrame.HLine)
|
|
86
|
-
vlayout.addWidget(hFrame)
|
|
87
|
-
|
|
88
|
-
lcd_widget = QtWidgets.QWidget()
|
|
89
|
-
lcd_widget.setLayout(vlayout)
|
|
90
|
-
hsplitter.addWidget(lcd_widget)
|
|
91
|
-
hsplitter.addWidget(form)
|
|
92
|
-
self.parent.resize(800, 500)
|
|
93
|
-
hsplitter.setSizes([400, 300])
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if __name__ == '__main__':
|
|
97
|
-
from pymodaq.utils.math_utils import gauss1D
|
|
98
|
-
import numpy as np
|
|
99
|
-
|
|
100
|
-
x = np.linspace(0, 200, 201)
|
|
101
|
-
y1 = gauss1D(x, 75, 25)
|
|
102
|
-
y2 = gauss1D(x, 120, 50, 2)
|
|
103
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
104
|
-
Form = QtWidgets.QWidget()
|
|
105
|
-
|
|
106
|
-
prog = LCD(Form, Nvals=2)
|
|
107
|
-
Form.show()
|
|
108
|
-
for ind, data in enumerate(y1):
|
|
109
|
-
prog.setvalues([np.array([data])])
|
|
110
|
-
QtWidgets.QApplication.processEvents()
|
|
111
|
-
sys.exit(app.exec_())
|
|
5
|
+
deprecation_msg('Importing LCD from pymodaq is deprecated '
|
|
6
|
+
'in pymodaq>5.0.0,'
|
|
7
|
+
'please use the same method from the '
|
|
8
|
+
'pymodaq_gui.utils.widgets.lcd module')
|
|
@@ -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):
|
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
|
|
@@ -38,8 +38,6 @@ class DAQ_Move_LECODirector(LECODirector, DAQ_Move_base):
|
|
|
38
38
|
settings: Parameter
|
|
39
39
|
controller: ActuatorDirector
|
|
40
40
|
|
|
41
|
-
is_multiaxes = False
|
|
42
|
-
axes_names = []
|
|
43
41
|
params_client = [] # parameters of a client grabber
|
|
44
42
|
data_actuator_type = DataActuatorType['float'] # DataActuatorType['DataActuator']
|
|
45
43
|
|
|
@@ -47,8 +45,7 @@ class DAQ_Move_LECODirector(LECODirector, DAQ_Move_base):
|
|
|
47
45
|
'get_actuator_value', 'stop_motion', 'position_is',
|
|
48
46
|
'move_done']
|
|
49
47
|
socket_types = ["ACTUATOR"]
|
|
50
|
-
params =
|
|
51
|
-
] + comon_parameters_fun(is_multiaxes=is_multiaxes, axes_names=axes_names) + leco_parameters
|
|
48
|
+
params = comon_parameters_fun() + leco_parameters
|
|
52
49
|
|
|
53
50
|
def __init__(self, parent=None, params_state=None, **kwargs) -> None:
|
|
54
51
|
super().__init__(parent=parent,
|
|
@@ -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
|
|
@@ -29,8 +29,7 @@ class DAQ_xDViewer_LECODirector(LECODirector, DAQ_Viewer_base):
|
|
|
29
29
|
"Status", "Done", "Server Closed",
|
|
30
30
|
"Info", "Infos", "Info_xml", 'x_axis', 'y_axis']
|
|
31
31
|
socket_types = ["GRABBER"]
|
|
32
|
-
params =
|
|
33
|
-
] + comon_parameters + leco_parameters
|
|
32
|
+
params = comon_parameters + leco_parameters
|
|
34
33
|
|
|
35
34
|
def __init__(self, parent=None, params_state=None, grabber_type: str = "0D", **kwargs) -> None:
|
|
36
35
|
super().__init__(parent=parent, params_state=params_state, **kwargs)
|
|
@@ -153,7 +152,8 @@ class DAQ_xDViewer_LECODirector(LECODirector, DAQ_Viewer_base):
|
|
|
153
152
|
self.y_axis = dict(data=data, label=label, units=units)
|
|
154
153
|
self.emit_y_axis()
|
|
155
154
|
|
|
156
|
-
def set_data(self, data: Union[list, str, None],
|
|
155
|
+
def set_data(self, data: Union[list, str, None],
|
|
156
|
+
additional_payload: Optional[list[bytes]]=None) -> None:
|
|
157
157
|
"""
|
|
158
158
|
Set the grabbed data signal.
|
|
159
159
|
|
|
@@ -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,9 +14,10 @@ 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
|
|
19
|
-
from
|
|
17
|
+
from pymodaq_utils.utils import ThreadCommand
|
|
18
|
+
from pymodaq_gui.parameter import ioxml
|
|
19
|
+
from pymodaq_data.data import DataWithAxes
|
|
20
|
+
from pymodaq_utils.serialize.serializer_legacy import SERIALIZABLE, DeSerializer
|
|
20
21
|
from pymodaq.utils.leco.utils import binary_serialization_to_kwargs
|
|
21
22
|
|
|
22
23
|
|
pymodaq/utils/leco/utils.py
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import subprocess
|
|
3
3
|
import sys
|
|
4
|
-
from typing import Any, Optional, Union, get_args
|
|
5
|
-
|
|
4
|
+
from typing import Any, Optional, Union, get_args, TypeVar
|
|
5
|
+
from pymodaq_data import data
|
|
6
|
+
from pymodaq.utils import data
|
|
6
7
|
# import also the DeSerializer for easier imports in dependents
|
|
7
|
-
from
|
|
8
|
-
|
|
8
|
+
from pymodaq_utils.serialize.serializer_legacy import Serializer, DeSerializer, SerializableFactory
|
|
9
|
+
# type: ignore # noqa
|
|
10
|
+
from pymodaq_utils.logger import set_logger
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
logger = set_logger('leco_utils')
|
|
12
|
-
|
|
14
|
+
ser_factory = SerializableFactory()
|
|
13
15
|
JSON_TYPES = Union[str, int, float]
|
|
14
16
|
|
|
17
|
+
SERIALIZABLE = ser_factory.get_serializables()
|
|
18
|
+
|
|
15
19
|
|
|
16
20
|
def serialize_object(pymodaq_object: Union[SERIALIZABLE, Any]) -> Union[str, Any]:
|
|
17
21
|
"""Serialize a pymodaq object, if it is not JSON compatible."""
|
|
18
22
|
if isinstance(pymodaq_object, get_args(JSON_TYPES)):
|
|
19
23
|
return pymodaq_object
|
|
20
|
-
elif isinstance(pymodaq_object, get_args(SERIALIZABLE)):
|
|
21
|
-
return Serializer(pymodaq_object).to_b64_string()
|
|
22
24
|
else:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
return Serializer(pymodaq_object).to_b64_string() # will raise a proper error if the object
|
|
26
|
+
#is not serializable
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
def binary_serialization(
|