Skip to content

Commit

Permalink
Merge pull request #21 from ifm/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
cwiede authored Jan 3, 2021
2 parents 3ed0cae + e51f230 commit 9d76351
Show file tree
Hide file tree
Showing 19 changed files with 343 additions and 51 deletions.
79 changes: 37 additions & 42 deletions doc/manual/tutorial.rst

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions nexxT/core/ConfigFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def load(config, file):
return config

@staticmethod
def save(config, file=None):
def save(config, file=None, forceGuiState=False):
"""
Save the configuration to the given file (or overwrite the existing file).
:param config: A Configuration instance
Expand All @@ -83,10 +83,20 @@ def save(config, file=None):
# catching a broad exception is exactly wanted here
oldCfg = None
if oldCfg is not None:
cfg, guistate = ConfigFileLoader._split(cfg, oldCfg)
cfgWithOldGuiState, guistate = ConfigFileLoader._split(cfg, oldCfg)
if not forceGuiState:
cfg = cfgWithOldGuiState
validatorGuiState.validate(guistate)
else:
guistate = None

if "_guiState" in cfg and "PlaybackControl_folder" in cfg["_guiState"]:
del cfg["_guiState"]["PlaybackControl_folder"]
if "_guiState" in cfg and "PlaybackControl_recent" in cfg["_guiState"]:
del cfg["_guiState"]["PlaybackControl_recent"]
if "_guiState" in cfg and "RecordingControl_directory" in cfg["_guiState"]:
del cfg["_guiState"]["RecordingControl_directory"]

with file.open("w", encoding='utf-8') as fp:
json.dump(cfg, fp, indent=2, ensure_ascii=False)
if guistate is not None:
Expand Down
19 changes: 19 additions & 0 deletions nexxT/filters/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def onInit(self):
def onStart(self):
"""
Registers itself to the recording control service
:return:
"""
self._propertyChanged(self.propertyCollection(), "buffer_samples")
Expand All @@ -109,6 +110,7 @@ def _propertyChanged(self, propColl, name):
def onStop(self):
"""
De-registers itself from the recording control service
:return:
"""
srv = Services.getService("RecordingControl")
Expand Down Expand Up @@ -142,6 +144,7 @@ def _startRecording(self, directory):
def startRecording(self, directory):
"""
Called on a recording start event.
:param directory: the directory where the recording is expected to be created.
:return:
"""
Expand All @@ -159,6 +162,7 @@ def _stopRecording(self):
def stopRecording(self):
"""
Called on a recording stop event.
:param directory: the directory where the recording is expected to be created.
:return:
"""
Expand All @@ -167,6 +171,7 @@ def stopRecording(self):
def onPortDataChanged(self, port):
"""
Called when new data arrives at a port.
:param port: the port where the new data is available.
:return:
"""
Expand Down Expand Up @@ -222,6 +227,7 @@ class Hdf5Reader(Filter):
def startPlayback(self):
"""
slot called when the playback shall be started
:return:
"""
if not self._playing and self._timer is not None:
Expand All @@ -233,6 +239,7 @@ def startPlayback(self):
def pausePlayback(self):
"""
slot called when the playback shall be paused
:return:
"""
if self._playing and self._timer is not None:
Expand All @@ -247,6 +254,7 @@ def pausePlayback(self):
def stepForward(self, stream):
"""
slot called to step one frame in stream forward
:param stream: a string instance or None (all streams are selected)
:return:
"""
Expand All @@ -256,6 +264,7 @@ def stepForward(self, stream):
def stepBackward(self, stream):
"""
slot called to step one frame in stream backward
:param stream: a string instance or None (all streams are selected)
:return:
"""
Expand All @@ -266,6 +275,7 @@ def stepBackward(self, stream):
def seekBeginning(self):
"""
slot called to go to the beginning of the file
:return:
"""
self.pausePlayback()
Expand All @@ -277,6 +287,7 @@ def seekBeginning(self):
def seekEnd(self):
"""
slot called to go to the end of the file
:return:
"""
self.pausePlayback()
Expand All @@ -290,6 +301,7 @@ def seekEnd(self):
def seekTime(self, tgtDatetime):
"""
slot called to go to the specified time
:param tgtDatetime: a QDateTime instance
:return:
"""
Expand Down Expand Up @@ -321,6 +333,7 @@ def seekTime(self, tgtDatetime):
def setSequence(self, filename):
"""
slot called to set the sequence file name
:param filename: a string instance
:return:
"""
Expand All @@ -330,6 +343,7 @@ def setSequence(self, filename):
def setTimeFactor(self, factor):
"""
slot called to set the time factor
:param factor: a float
:return:
"""
Expand Down Expand Up @@ -357,6 +371,7 @@ def __init__(self, env):
def onOpen(self):
"""
overloaded from Filter
:return:
"""
srv = Services.getService("PlaybackControl")
Expand All @@ -367,6 +382,7 @@ def onOpen(self):
def onStart(self):
"""
overloaded from Filter
:return:
"""
if self._name is not None:
Expand Down Expand Up @@ -397,6 +413,7 @@ def onStart(self):
def onStop(self):
"""
overloaded from Filter
:return:
"""
if self._currentFile is not None:
Expand All @@ -411,6 +428,7 @@ def onStop(self):
def onClose(self):
"""
overloaded from Filter
:return:
"""
srv = Services.getService("PlaybackControl")
Expand All @@ -419,6 +437,7 @@ def onClose(self):
def onSuggestDynamicPorts(self):
"""
overloaded from Filter
:return:
"""
try:
Expand Down
2 changes: 2 additions & 0 deletions nexxT/services/ConsoleLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ConsoleLogger(QObject):
def log(self, level, message, file, line): # pylint: disable=no-self-use
"""
Called from c++ to log a message.
:param level: logging compatible log level
:param message: message as a string
:param file: file which originated the log message
Expand All @@ -54,6 +55,7 @@ def log(self, level, message, file, line): # pylint: disable=no-self-use
def qtMessageHandler(qtMsgType, qMessageLogContext, msg):
"""
Qt message handler for handling qt messages in normal logging.
:param qtMsgType: qt log level
:param qMessageLogContext: qt log context
:param msg: message as a string
Expand Down
Loading

0 comments on commit 9d76351

Please sign in to comment.