pymodaq 4.4.7__py3-none-any.whl → 5.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pymodaq might be problematic. Click here for more details.
- pymodaq/__init__.py +57 -91
- pymodaq/control_modules/daq_move.py +64 -46
- pymodaq/control_modules/daq_move_ui.py +34 -12
- pymodaq/control_modules/daq_viewer.py +55 -30
- pymodaq/control_modules/daq_viewer_ui.py +6 -6
- pymodaq/control_modules/mocks.py +1 -1
- pymodaq/control_modules/move_utility_classes.py +51 -43
- pymodaq/control_modules/utils.py +43 -20
- pymodaq/control_modules/viewer_utility_classes.py +54 -18
- pymodaq/daq_utils/daq_utils.py +6 -0
- pymodaq/dashboard.py +639 -323
- pymodaq/examples/function_plotter.py +13 -12
- pymodaq/examples/tcp_client.py +1 -1
- pymodaq/extensions/__init__.py +1 -1
- pymodaq/extensions/bayesian/bayesian_optimisation.py +44 -32
- pymodaq/extensions/bayesian/utils.py +10 -10
- pymodaq/extensions/console.py +7 -6
- pymodaq/extensions/daq_logger/__init__.py +1 -0
- pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +30 -30
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger.py +16 -15
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger_models.py +2 -0
- pymodaq/{utils/h5modules → extensions/daq_logger}/h5logging.py +7 -8
- pymodaq/extensions/daq_scan.py +42 -34
- pymodaq/extensions/daq_scan_ui.py +18 -18
- pymodaq/extensions/h5browser.py +2 -3
- pymodaq/extensions/pid/__init__.py +4 -2
- pymodaq/extensions/pid/daq_move_PID.py +3 -3
- pymodaq/extensions/pid/pid_controller.py +59 -50
- pymodaq/extensions/pid/utils.py +10 -5
- pymodaq/extensions/utils.py +33 -3
- pymodaq/post_treatment/load_and_plot.py +10 -7
- pymodaq/resources/preset_default.xml +1 -1
- pymodaq/updater.py +107 -0
- pymodaq/utils/array_manipulation.py +4 -384
- pymodaq/utils/calibration_camera.py +12 -9
- pymodaq/utils/chrono_timer.py +11 -10
- pymodaq/utils/config.py +3 -458
- pymodaq/utils/daq_utils.py +9 -715
- pymodaq/utils/data.py +17 -2959
- pymodaq/utils/enums.py +4 -74
- pymodaq/utils/exceptions.py +0 -4
- pymodaq/utils/gui_utils/__init__.py +8 -8
- pymodaq/utils/gui_utils/loader_utils.py +26 -1
- pymodaq/utils/gui_utils/utils.py +8 -162
- pymodaq/utils/gui_utils/widgets/lcd.py +6 -109
- pymodaq/utils/h5modules/__init__.py +0 -4
- pymodaq/utils/h5modules/module_saving.py +9 -8
- pymodaq/utils/leco/__init__.py +2 -2
- pymodaq/utils/leco/daq_move_LECODirector.py +3 -6
- pymodaq/utils/leco/daq_xDviewer_LECODirector.py +5 -5
- pymodaq/utils/leco/director_utils.py +2 -2
- pymodaq/utils/leco/leco_director.py +3 -3
- pymodaq/utils/leco/pymodaq_listener.py +4 -3
- pymodaq/utils/leco/utils.py +11 -9
- pymodaq/utils/logger.py +4 -76
- pymodaq/utils/managers/batchscan_manager.py +16 -19
- pymodaq/utils/managers/modules_manager.py +30 -17
- pymodaq/utils/managers/overshoot_manager.py +48 -6
- pymodaq/utils/managers/preset_manager.py +39 -59
- pymodaq/utils/managers/preset_manager_utils.py +28 -22
- pymodaq/utils/managers/remote_manager.py +12 -10
- pymodaq/utils/math_utils.py +4 -582
- pymodaq/utils/messenger.py +4 -64
- pymodaq/utils/parameter/__init__.py +6 -9
- pymodaq/utils/parameter/utils.py +4 -328
- pymodaq/utils/scanner/scan_config.py +1 -1
- pymodaq/utils/scanner/scan_factory.py +16 -12
- pymodaq/utils/{plotting → scanner}/scan_selector.py +19 -20
- pymodaq/utils/scanner/scanner.py +10 -8
- pymodaq/utils/scanner/scanners/_1d_scanners.py +8 -5
- pymodaq/utils/scanner/scanners/_2d_scanners.py +5 -5
- pymodaq/utils/scanner/scanners/sequential.py +8 -8
- pymodaq/utils/scanner/scanners/tabular.py +9 -9
- pymodaq/utils/scanner/utils.py +6 -4
- pymodaq/utils/svg/svg_viewer2D.py +3 -4
- pymodaq/utils/tcp_ip/mysocket.py +4 -110
- pymodaq/utils/tcp_ip/serializer.py +4 -801
- pymodaq/utils/tcp_ip/tcp_server_client.py +15 -13
- pymodaq-5.0.1.dist-info/METADATA +242 -0
- pymodaq-5.0.1.dist-info/RECORD +122 -0
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/WHEEL +1 -1
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/entry_points.txt +1 -0
- pymodaq/examples/custom_app.py +0 -258
- pymodaq/examples/custom_viewer.py +0 -112
- pymodaq/examples/parameter_ex.py +0 -138
- pymodaq/examples/preset_MockCamera.xml +0 -1
- pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.py +0 -142
- pymodaq/post_treatment/daq_measurement/daq_measurement_GUI.ui +0 -232
- pymodaq/post_treatment/daq_measurement/daq_measurement_main.py +0 -391
- pymodaq/post_treatment/daq_measurement/process_from_QtDesigner_DAQ_Measurement_GUI.bat +0 -2
- pymodaq/post_treatment/process_to_scalar.py +0 -263
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/algo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/input.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/random.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/target.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -238
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127453
- pymodaq/resources/QtDesigner_Ressources/__init__.py +0 -0
- pymodaq/resources/QtDesigner_Ressources/credit.rst +0 -7
- pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
- pymodaq/resources/VERSION +0 -2
- pymodaq/resources/config_template.toml +0 -96
- pymodaq/resources/triangulation_data.npy +0 -0
- pymodaq/utils/abstract/__init__.py +0 -48
- pymodaq/utils/db/__init__.py +0 -0
- pymodaq/utils/db/db_logger/__init__.py +0 -0
- pymodaq/utils/factory.py +0 -82
- pymodaq/utils/gui_utils/custom_app.py +0 -133
- pymodaq/utils/gui_utils/dock.py +0 -107
- pymodaq/utils/gui_utils/file_io.py +0 -94
- pymodaq/utils/gui_utils/layout.py +0 -34
- pymodaq/utils/gui_utils/list_picker.py +0 -38
- pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
- pymodaq/utils/gui_utils/widgets/label.py +0 -24
- pymodaq/utils/gui_utils/widgets/push.py +0 -149
- pymodaq/utils/gui_utils/widgets/qled.py +0 -62
- pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
- pymodaq/utils/gui_utils/widgets/table.py +0 -263
- pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
- pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -110
- pymodaq/utils/h5modules/backends.py +0 -1022
- pymodaq/utils/h5modules/browsing.py +0 -627
- pymodaq/utils/h5modules/data_saving.py +0 -1107
- pymodaq/utils/h5modules/exporter.py +0 -119
- pymodaq/utils/h5modules/exporters/__init__.py +0 -0
- pymodaq/utils/h5modules/exporters/base.py +0 -111
- pymodaq/utils/h5modules/exporters/flimj.py +0 -63
- pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
- pymodaq/utils/h5modules/saving.py +0 -866
- pymodaq/utils/h5modules/utils.py +0 -115
- pymodaq/utils/managers/action_manager.py +0 -489
- pymodaq/utils/managers/parameter_manager.py +0 -279
- pymodaq/utils/managers/roi_manager.py +0 -740
- pymodaq/utils/parameter/ioxml.py +0 -545
- pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
- pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
- pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
- pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
- pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
- pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
- pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
- pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
- pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
- pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -166
- pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
- pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
- pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
- pymodaq/utils/plotting/__init__.py +0 -0
- pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
- pymodaq/utils/plotting/data_viewers/base.py +0 -286
- pymodaq/utils/plotting/data_viewers/viewer.py +0 -275
- pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
- pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -826
- pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
- pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
- pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
- pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
- pymodaq/utils/plotting/gant_chart.py +0 -123
- pymodaq/utils/plotting/image_viewer.py +0 -97
- pymodaq/utils/plotting/items/__init__.py +0 -0
- pymodaq/utils/plotting/items/axis_scaled.py +0 -93
- pymodaq/utils/plotting/items/crosshair.py +0 -94
- pymodaq/utils/plotting/items/image.py +0 -388
- pymodaq/utils/plotting/navigator.py +0 -353
- pymodaq/utils/plotting/plotter/plotter.py +0 -94
- pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
- pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
- pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
- pymodaq/utils/plotting/utils/__init__.py +0 -0
- pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
- pymodaq/utils/plotting/utils/filter.py +0 -585
- pymodaq/utils/plotting/utils/lineout.py +0 -226
- pymodaq/utils/plotting/utils/plot_utils.py +0 -579
- pymodaq/utils/plotting/utils/signalND.py +0 -1347
- pymodaq/utils/plotting/widgets.py +0 -76
- pymodaq/utils/qvariant.py +0 -12
- pymodaq/utils/slicing.py +0 -63
- pymodaq/utils/units.py +0 -216
- pymodaq-4.4.7.dist-info/METADATA +0 -163
- pymodaq-4.4.7.dist-info/RECORD +0 -446
- /pymodaq/{post_treatment/daq_analysis → daq_utils}/__init__.py +0 -0
- /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
- /pymodaq/{post_treatment/daq_measurement → extensions/daq_logger/db}/__init__.py +0 -0
- {pymodaq-4.4.7.dist-info → pymodaq-5.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
from qtpy import QtWidgets, QtCore, QtGui
|
|
2
|
-
from qtpy.QtCore import QObject, Signal, QLocale
|
|
3
|
-
import sys
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class TreeLayout(QObject):
|
|
7
|
-
"""
|
|
8
|
-
qtpy class object based on QtreeWidget
|
|
9
|
-
The function populate_tree has to be used in order to populate the tree with structure as nested lists of dicts
|
|
10
|
-
|
|
11
|
-
"""
|
|
12
|
-
status_sig = Signal(str)
|
|
13
|
-
item_clicked_sig = Signal(object)
|
|
14
|
-
item_double_clicked_sig = Signal(object)
|
|
15
|
-
|
|
16
|
-
def __init__(self, parent=None, col_counts=1, labels=None):
|
|
17
|
-
|
|
18
|
-
super().__init__()
|
|
19
|
-
|
|
20
|
-
if parent is None:
|
|
21
|
-
parent = QtWidgets.QWidget()
|
|
22
|
-
self.parent = parent
|
|
23
|
-
|
|
24
|
-
self.setupUi()
|
|
25
|
-
|
|
26
|
-
self.tree.setColumnCount(col_counts)
|
|
27
|
-
if labels is not None:
|
|
28
|
-
self.tree.setHeaderLabels(labels)
|
|
29
|
-
|
|
30
|
-
self.open_tree_pb.clicked.connect(self.expand_all)
|
|
31
|
-
self.close_tree_pb.clicked.connect(self.collapse_all)
|
|
32
|
-
self.open_tree_selected_pb.clicked.connect(self.open_tree_selection)
|
|
33
|
-
|
|
34
|
-
self.tree.itemClicked.connect(self.item_clicked_sig.emit)
|
|
35
|
-
self.tree.itemDoubleClicked.connect(self.item_double_clicked_sig.emit)
|
|
36
|
-
|
|
37
|
-
def _current_text(self, col_index: int = 2):
|
|
38
|
-
return self.tree.currentItem().text(col_index)
|
|
39
|
-
|
|
40
|
-
def current_node_path(self):
|
|
41
|
-
return self._current_text(2)
|
|
42
|
-
|
|
43
|
-
def expand_all(self):
|
|
44
|
-
self.tree.expandAll()
|
|
45
|
-
|
|
46
|
-
def collapse_all(self):
|
|
47
|
-
self.tree.collapseAll()
|
|
48
|
-
|
|
49
|
-
@property
|
|
50
|
-
def treewidget(self):
|
|
51
|
-
return self.tree
|
|
52
|
-
|
|
53
|
-
def setupUi(self):
|
|
54
|
-
vlayout = QtWidgets.QVBoxLayout()
|
|
55
|
-
hlayout = QtWidgets.QHBoxLayout()
|
|
56
|
-
|
|
57
|
-
self.tree = CustomTree()
|
|
58
|
-
vlayout.addWidget(self.tree)
|
|
59
|
-
|
|
60
|
-
iconopen = QtGui.QIcon()
|
|
61
|
-
iconopen.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/tree.png"), QtGui.QIcon.Normal,
|
|
62
|
-
QtGui.QIcon.Off)
|
|
63
|
-
self.open_tree_pb = QtWidgets.QPushButton('Open Tree')
|
|
64
|
-
self.open_tree_pb.setIcon(iconopen)
|
|
65
|
-
|
|
66
|
-
iconopensel = QtGui.QIcon()
|
|
67
|
-
iconopensel.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/tree.png"), QtGui.QIcon.Normal,
|
|
68
|
-
QtGui.QIcon.Off)
|
|
69
|
-
self.open_tree_selected_pb = QtWidgets.QPushButton('Open Selected')
|
|
70
|
-
self.open_tree_selected_pb.setIcon(iconopensel)
|
|
71
|
-
|
|
72
|
-
iconclose = QtGui.QIcon()
|
|
73
|
-
iconclose.addPixmap(QtGui.QPixmap(":/icons/Icon_Library/CollapseAll.png"), QtGui.QIcon.Normal,
|
|
74
|
-
QtGui.QIcon.Off)
|
|
75
|
-
self.close_tree_pb = QtWidgets.QPushButton('Close Tree')
|
|
76
|
-
self.close_tree_pb.setIcon(iconclose)
|
|
77
|
-
|
|
78
|
-
hlayout.addWidget(self.open_tree_pb)
|
|
79
|
-
hlayout.addWidget(self.open_tree_selected_pb)
|
|
80
|
-
hlayout.addWidget(self.close_tree_pb)
|
|
81
|
-
|
|
82
|
-
vlayout.addLayout(hlayout)
|
|
83
|
-
|
|
84
|
-
self.parent.setLayout(vlayout)
|
|
85
|
-
|
|
86
|
-
def open_tree_selection(self):
|
|
87
|
-
self.tree_open_children(self.tree.selectedIndexes()[0])
|
|
88
|
-
|
|
89
|
-
def tree_open_children(self, item_index):
|
|
90
|
-
try:
|
|
91
|
-
if not (item_index.isValid()):
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
self.tree.expand(item_index)
|
|
95
|
-
except Exception as e:
|
|
96
|
-
self.status_sig.emit(str(e))
|
|
97
|
-
|
|
98
|
-
def tree_open_parents(self, item_index):
|
|
99
|
-
try:
|
|
100
|
-
if not (item_index.isValid()):
|
|
101
|
-
return
|
|
102
|
-
flag = True
|
|
103
|
-
empty = QtCore.QModelIndex()
|
|
104
|
-
parent = item_index
|
|
105
|
-
while flag:
|
|
106
|
-
parent = parent.parent()
|
|
107
|
-
if parent != empty:
|
|
108
|
-
self.tree.expand(parent)
|
|
109
|
-
else:
|
|
110
|
-
flag = False
|
|
111
|
-
break
|
|
112
|
-
except Exception as e:
|
|
113
|
-
self.status_sig.emit(str(e))
|
|
114
|
-
|
|
115
|
-
def populate_tree(self, data_dict):
|
|
116
|
-
try:
|
|
117
|
-
parents = []
|
|
118
|
-
for data in data_dict:
|
|
119
|
-
str_list = [str(data['name'])]
|
|
120
|
-
if 'filename' in data.keys():
|
|
121
|
-
str_list.append(data['filename'])
|
|
122
|
-
if 'info' in data.keys():
|
|
123
|
-
str_list.append(data['info'])
|
|
124
|
-
parent = QtWidgets.QTreeWidgetItem(str_list)
|
|
125
|
-
Items = self.populate_sub_tree(data['contents'])
|
|
126
|
-
parent.addChildren(Items)
|
|
127
|
-
parents.append(parent)
|
|
128
|
-
|
|
129
|
-
self.tree.addTopLevelItems(parents)
|
|
130
|
-
except Exception as e:
|
|
131
|
-
self.status_sig.emit(str(e))
|
|
132
|
-
|
|
133
|
-
def populate_sub_tree(self, datas):
|
|
134
|
-
try:
|
|
135
|
-
parents = []
|
|
136
|
-
for data in datas:
|
|
137
|
-
str_list = [str(data['name'])]
|
|
138
|
-
if 'filename' in data.keys():
|
|
139
|
-
str_list.append(data['filename'])
|
|
140
|
-
if 'info' in data.keys():
|
|
141
|
-
str_list.append(data['info'])
|
|
142
|
-
parent = QtWidgets.QTreeWidgetItem(str_list)
|
|
143
|
-
if 'contents' in data.keys():
|
|
144
|
-
if type(data['contents']) == list:
|
|
145
|
-
Items = self.populate_sub_tree(data['contents'])
|
|
146
|
-
parent.addChildren(Items)
|
|
147
|
-
parents.append(parent)
|
|
148
|
-
return parents
|
|
149
|
-
except Exception as e:
|
|
150
|
-
self.status_sig.emit(str(e))
|
|
151
|
-
return parents
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
class CustomTree(QtWidgets.QTreeWidget):
|
|
155
|
-
|
|
156
|
-
def __init__(self, parent=None):
|
|
157
|
-
super().__init__(parent)
|
|
158
|
-
self.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if __name__ == '__main__':
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
app = QtWidgets.QApplication(sys.argv)
|
|
165
|
-
Form = QtWidgets.QWidget()
|
|
166
|
-
prog = TreeLayout(Form, col_counts=2, labels=["Material", "File"])
|
|
167
|
-
|
|
168
|
-
# example of actions to add to the tree widget in order to show a context menu
|
|
169
|
-
detector_action = QtWidgets.QAction("Grab from camera", None)
|
|
170
|
-
prog.tree.addAction(detector_action)
|
|
171
|
-
########################
|
|
172
|
-
|
|
173
|
-
Form.show()
|
|
174
|
-
data = [dict(name='papa', contents=[
|
|
175
|
-
dict(name='fiston', contents=[dict(name='subfiston', contents='baby', filename='Cest pas sorcier')]),
|
|
176
|
-
dict(name='fiston1', contents=[dict(name='subfiston', contents='baby', filename='Cest pas malin')]),
|
|
177
|
-
dict(name='fiston2', contents=[dict(name='subfiston', contents='baby', filename='Cest pas normal')])]),
|
|
178
|
-
dict(name='maman', contents=[dict(name='fistone', contents=[dict(name='subfistone', contents='baby')])])]
|
|
179
|
-
prog.populate_tree(data)
|
|
180
|
-
# filename='C:\\Data\\2019\\20190220\\Dataset_20190220_004\\Dataset_20190220_004.h5'
|
|
181
|
-
# import tables
|
|
182
|
-
# h5_file = tables.open_file(filename, mode = "a")
|
|
183
|
-
# for node in h5_file.walk_nodes():
|
|
184
|
-
# print(node)
|
|
185
|
-
# base_node = h5_file.root
|
|
186
|
-
# base_tree_item, pixmap_items = h5tree_to_QTree(h5_file, base_node)
|
|
187
|
-
# prog.ui.Tree.addTopLevelItem(base_tree_item)
|
|
188
|
-
sys.exit(app.exec_())
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
Created the 19/10/2023
|
|
4
|
-
|
|
5
|
-
@author: Sebastien Weber
|
|
6
|
-
"""
|
|
7
|
-
import datetime
|
|
8
|
-
|
|
9
|
-
from qtpy import QtWidgets, QtCore
|
|
10
|
-
from qtpy.QtCore import QObject
|
|
11
|
-
|
|
12
|
-
from pymodaq.utils.parameter import ParameterTree, Parameter
|
|
13
|
-
from pymodaq.utils.config import Config, create_toml_from_dict
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class TreeFromToml(QObject):
|
|
17
|
-
""" Create a ParameterTree from a configuration file"""
|
|
18
|
-
|
|
19
|
-
def __init__(self, config: Config = None, capitalize=True):
|
|
20
|
-
super().__init__()
|
|
21
|
-
|
|
22
|
-
if config is None:
|
|
23
|
-
config = Config()
|
|
24
|
-
self._config = config
|
|
25
|
-
params = [{'title': 'Config path', 'name': 'config_path', 'type': 'str',
|
|
26
|
-
'value': str(self._config.config_path),
|
|
27
|
-
'readonly': True}]
|
|
28
|
-
params.extend(self.dict_to_param(config.to_dict(), capitalize=capitalize))
|
|
29
|
-
|
|
30
|
-
self.settings = Parameter.create(title='settings', name='settings', type='group',
|
|
31
|
-
children=params)
|
|
32
|
-
self.settings_tree = ParameterTree()
|
|
33
|
-
self.settings_tree.setParameters(self.settings, showTop=False)
|
|
34
|
-
|
|
35
|
-
def show_dialog(self) -> bool:
|
|
36
|
-
|
|
37
|
-
self.dialog = QtWidgets.QDialog()
|
|
38
|
-
self.dialog.setWindowTitle('Please enter new configuration values!')
|
|
39
|
-
self.dialog.setLayout(QtWidgets.QVBoxLayout())
|
|
40
|
-
buttonBox = QtWidgets.QDialogButtonBox(parent=self.dialog)
|
|
41
|
-
|
|
42
|
-
buttonBox.addButton('Save', buttonBox.AcceptRole)
|
|
43
|
-
buttonBox.accepted.connect(self.dialog.accept)
|
|
44
|
-
buttonBox.addButton('Cancel', buttonBox.RejectRole)
|
|
45
|
-
buttonBox.rejected.connect(self.dialog.reject)
|
|
46
|
-
|
|
47
|
-
self.dialog.layout().addWidget(self.settings_tree)
|
|
48
|
-
self.dialog.layout().addWidget(buttonBox)
|
|
49
|
-
self.dialog.setWindowTitle('Configuration entries')
|
|
50
|
-
res = self.dialog.exec()
|
|
51
|
-
|
|
52
|
-
if res == self.dialog.Accepted:
|
|
53
|
-
with open(self._config.config_path, 'w') as f:
|
|
54
|
-
config_dict = self.param_to_dict(self.settings)
|
|
55
|
-
config_dict.pop('config_path')
|
|
56
|
-
create_toml_from_dict(config_dict, self._config.config_path)
|
|
57
|
-
return res
|
|
58
|
-
|
|
59
|
-
@classmethod
|
|
60
|
-
def param_to_dict(cls, param: Parameter) -> dict:
|
|
61
|
-
config = dict()
|
|
62
|
-
for child in param.children():
|
|
63
|
-
if 'group' in child.opts['type']:
|
|
64
|
-
config[child.name()] = cls.param_to_dict(child)
|
|
65
|
-
else:
|
|
66
|
-
if child.opts['type'] == 'datetime':
|
|
67
|
-
config[child.name()] = datetime.fromtimestamp(
|
|
68
|
-
child.value().toSecsSinceEpoch()) # convert QDateTime to python datetime
|
|
69
|
-
elif child.opts['type'] == 'date':
|
|
70
|
-
qdt = QtCore.QDateTime()
|
|
71
|
-
qdt.setDate(child.value())
|
|
72
|
-
pdt = datetime.fromtimestamp(qdt.toSecsSinceEpoch())
|
|
73
|
-
config[child.name()] = pdt.date()
|
|
74
|
-
elif child.opts['type'] == 'list':
|
|
75
|
-
config[child.name()] = child.opts['limits']
|
|
76
|
-
else:
|
|
77
|
-
config[child.name()] = child.value()
|
|
78
|
-
return config
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def dict_to_param(cls, config: dict, capitalize=True) -> Parameter:
|
|
82
|
-
params = []
|
|
83
|
-
for key in config:
|
|
84
|
-
if isinstance(config[key], dict):
|
|
85
|
-
params.append({'title': f'{key.capitalize() if capitalize else key}:',
|
|
86
|
-
'name': key, 'type': 'group',
|
|
87
|
-
'children': cls.dict_to_param(config[key], capitalize=capitalize),
|
|
88
|
-
'expanded': 'user' in key.lower() or 'general' in key.lower()})
|
|
89
|
-
else:
|
|
90
|
-
param = {'title': f'{key.capitalize() if capitalize else key}:',
|
|
91
|
-
'name': key, 'value': config[key]}
|
|
92
|
-
if isinstance(config[key], float):
|
|
93
|
-
param['type'] = 'float'
|
|
94
|
-
elif isinstance(config[key], bool): # placed before int because a bool is an instance of int
|
|
95
|
-
param['type'] = 'bool'
|
|
96
|
-
elif isinstance(config[key], int):
|
|
97
|
-
param['type'] = 'int'
|
|
98
|
-
elif isinstance(config[key], datetime.datetime):
|
|
99
|
-
param['type'] = 'datetime'
|
|
100
|
-
elif isinstance(config[key], datetime.date):
|
|
101
|
-
param['type'] = 'date'
|
|
102
|
-
elif isinstance(config[key], str):
|
|
103
|
-
param['type'] = 'str'
|
|
104
|
-
elif isinstance(config[key], list):
|
|
105
|
-
param['type'] = 'list'
|
|
106
|
-
param['limits'] = config[key]
|
|
107
|
-
param['value'] = config[key][0]
|
|
108
|
-
param['show_pb'] = True
|
|
109
|
-
params.append(param)
|
|
110
|
-
return params
|