Skip to content

Commit

Permalink
improved waveform upload
Browse files Browse the repository at this point in the history
- might abort upload if hw constraint violated
- indicate upload process in gui and prevent mes start
  • Loading branch information
kay-jahnke authored and timoML committed Dec 17, 2020
2 parents d62bff5 + 98d67c1 commit 85b2b1c
Show file tree
Hide file tree
Showing 20 changed files with 2,076 additions and 976 deletions.
22 changes: 21 additions & 1 deletion config/example/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,21 @@ hardware:

mydummyswitch1:
module.Class: 'switches.switch_dummy.SwitchDummy'
name: 'First' # optional
remember_states: True # optional
switches:
one: ['down', 'up']
two: ['down', 'up']
three: ['low', 'middle', 'high']

mydummyswitch2:
module.Class: 'switches.switch_dummy.SwitchDummy'
name: 'Second' # optional
remember_states: True # optional
switches:
'An even longer name of the switch itself':
- 'Very long name of a random state'
- 'Another very long name of a random state'

myspectrometer:
module.Class: 'spectrometer.spectrometer_dummy.SpectrometerInterfaceDummy'
Expand Down Expand Up @@ -181,9 +193,17 @@ logic:

switchlogic:
module.Class: 'switch_logic.SwitchLogic'
watchdog_interval: 1
autostart_watchdog: True
connect:
switch: 'switchinterfuse'

switchinterfuse:
module.Class: 'interfuse.switch_combiner_interfuse.SwitchCombinerInterfuse'
connect:
switch1: 'mydummyswitch1'
switch2: 'mydummyswitch2'
extend_hardware_name: True

scannerlogic:
module.Class: 'confocal_logic.ConfocalLogic'
Expand Down Expand Up @@ -397,7 +417,7 @@ gui:
savelogic: 'savelogic'

switches:
module.Class: 'switcher.switchgui.SwitchGui'
module.Class: 'switch.switch_gui.SwitchGui'
connect:
switchlogic: 'switchlogic'

Expand Down
4 changes: 4 additions & 0 deletions documentation/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ please use _ni_x_series_in_streamer.py_ as hardware module.
* Added a hardware file to interface Thorlabs filter wheels via scripts
* Bug fixes to core: made error messages sticky, respecting dependencies when restarting.
* Added a config option to regulate pid logic timestep length
* New SwitchInterface and updated logic plus GUI
* Added biexponential fit function, model and estimator


Expand All @@ -98,6 +99,9 @@ or a list of strings for multiple paths.
* There is an option for the fit logic, to give an additional path: `additional_fit_methods_path`
* The connectors and file names of the GUI and logic modules of the QDPlotter have been changed.
* QDPlotter now needs a new connection to the fit logic.
* The tool chain for the switch logic has changed.
To combine multiple switches one needs to use the `switch_combiner_interfuse`
instead of multiple connectors in the logic.

## Release 0.10
Released on 14 Mar 2019
Expand Down
57 changes: 55 additions & 2 deletions gui/pulsed/pulsed_maingui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from gui.colordefs import QudiPalettePale as palette
from gui.fitsettings import FitSettingsDialog
from gui.guibase import GUIBase
from qtpy import QtCore, QtWidgets, uic
from qtpy import QtCore, QtWidgets, uic, QtGui
from qtwidgets.scientific_spinbox import ScienDSpinBox, ScienSpinBox
from enum import Enum

Expand Down Expand Up @@ -390,6 +390,15 @@ def _connect_logic_signals(self):
self.pulsedmasterlogic().sigAnalysisSettingsUpdated.connect(self.analysis_settings_updated)
self.pulsedmasterlogic().sigExtractionSettingsUpdated.connect(self.extraction_settings_updated)

# todo: disconnect new signals
self.pulsedmasterlogic().sigSampleBlockEnsemble.connect(self.sampling_or_loading_busy)
self.pulsedmasterlogic().sigLoadBlockEnsemble.connect(self.sampling_or_loading_busy)
self.pulsedmasterlogic().sigLoadSequence.connect(self.sampling_or_loading_busy)
self.pulsedmasterlogic().sigSampleSequence.connect(self.sampling_or_loading_busy)

self.pulsedmasterlogic().sigLoadedAssetUpdated.connect(self.sampling_or_loading_finished)


self.pulsedmasterlogic().sigBlockDictUpdated.connect(self.update_block_dict)
self.pulsedmasterlogic().sigEnsembleDictUpdated.connect(self.update_ensemble_dict)
self.pulsedmasterlogic().sigSequenceDictUpdated.connect(self.update_sequence_dict)
Expand Down Expand Up @@ -588,6 +597,28 @@ def _setup_toolbar(self):
'from all loaded files.')
self._mw.control_ToolBar.addWidget(self._mw.clear_device_PushButton)

# load animation
self._mw.sampleload_idle = QtGui.QPixmap("artwork/icons/sampload_idle.gif")
self._sampload_movie = QtGui.QMovie("artwork/icons/sampleload_busy_2.gif")

self._mw.sampload_animation = QtWidgets.QLabel(self._mw)

self._mw.sampload_animation.setToolTip('Shows when busy with uploading or sampling.')
# self._mw.sampload_animation.setSizePolicy(sizepolicy)
# a = self._mw.analysis_ToolBar.sizeHint()
# a.setHeight(a.height())
# self._mw.sampload_animation.sizeHint = a
gifHeight = int(self._mw.save_ToolBar.height() * 0.64)
gifSize = QtCore.QSize(gifHeight, gifHeight)
self._sampload_movie.setScaledSize(gifSize)

self._mw.sampload_animation.setPixmap(self._mw.sampleload_idle)
#self._mw.sampload_animation.setMovie(self._sampload_movie)
#self._sampload_movie.start()

self._mw.control_ToolBar.addWidget(self._mw.sampload_animation)
self._mw.sampload_animation.setLayout(QtGui.QHBoxLayout())

self._mw.current_loaded_asset_Label = QtWidgets.QLabel(self._mw)
sizepolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
QtWidgets.QSizePolicy.Fixed)
Expand Down Expand Up @@ -696,7 +727,7 @@ def measurement_status_updated(self, is_running, is_paused):
@return:
"""
# block signals
self._mw.action_run_stop.blockSignals(True)
self._mw.action_run_stop.blockSignals(True) # start stop mes
self._mw.action_continue_pause.blockSignals(True)

# Enable/Disable widgets
Expand Down Expand Up @@ -1883,6 +1914,28 @@ def load_ensemble_clicked(self):
self.pulsedmasterlogic().load_ensemble(ensemble_name)
return

@QtCore.Slot()
def sampling_or_loading_busy(self):
self.log.debug("Deactivating stuff because sampling is busy")
if self.pulsedmasterlogic().status_dict['sampload_busy']:
self._mw.action_run_stop.setEnabled(False)

label = self._mw.current_loaded_asset_Label
label.setText(' loading...')

#self._sampload_movie = QtGui.QMovie("artwork/icons/sampload_busy_2_44.gif")
self._mw.sampload_animation.setMovie(self._sampload_movie)
self._sampload_movie.start()

@QtCore.Slot()
def sampling_or_loading_finished(self):
if not self.pulsedmasterlogic().status_dict['sampload_busy']:
self._mw.action_run_stop.setEnabled(True)

self._sampload_movie.stop()
self._mw.sampload_animation.setPixmap(self._mw.sampleload_idle)


@QtCore.Slot(bool)
def generate_predefined_clicked(self, button_obj=None):
"""
Expand Down
Loading

0 comments on commit 85b2b1c

Please sign in to comment.