Skip to content

Commit c065a69

Browse files
committed
Set global timestamp source ids as timestamp source in events from non-continuous sources
1 parent e8046c3 commit c065a69

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

Source/Processors/Channel/InfoObjects.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,10 @@ EventChannel::EventChannel(EventChannelTypes type, unsigned int nChannels, unsig
342342
source, subproc),
343343
m_type(type),
344344
m_timestampOrigin(source->isGeneratesTimestamps() ? timestampsFromContinuousSource : timestampsFromGlobalSource ),
345-
m_timestampOriginProcessor(source->getNodeId()),
346-
m_timestampOriginSubProcessor(subproc)
345+
m_timestampOriginProcessor(source->isGeneratesTimestamps() ? source->getNodeId() :
346+
GenericProcessor::getNodeIdFromFullId(CoreServices::getGlobalTimestampSourceFullId())),
347+
m_timestampOriginSubProcessor(source->isGeneratesTimestamps() ? subproc:
348+
GenericProcessor::getSubProcessorFromFullId(CoreServices::getGlobalTimestampSourceFullId()))
347349
{
348350
initializeEvent(nChannels, dataLength);
349351
}

Source/Processors/Channel/InfoObjects.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,18 @@ class PLUGIN_API EventChannel :
398398
/** Returns which kind of origin the timestamps for these events have */
399399
EventTimestampOrigin getTimestampOrigin() const;
400400

401-
/** Returns the processor id which generated the timestamps, in case they are derived from a channel. Otherwise it returns the same as getSourceNodeId()*/
401+
/** Returns, for each value of getTimestampOrigin()
402+
-For timestampsFromContinuousSource: the same value as getNodeId()
403+
-For timestampsFromGlobalSource: the value global source id, zero if it is software-based
404+
-For timestampsDerivedFromChannel: the node ID of the processor which generated the channel this event is based on
405+
*/
402406
uint16 getTimestampOriginProcessor() const;
403407

404-
/** Returns the subprocessor index which generated the timestamps, in case they are derived from a channel. Otherwise it returns the same as getSubProcessorIdx()*/
408+
/** Returns, for each value of getTimestampOrigin()
409+
-For timestampsFromContinuousSource: the same value as getSubProcessorIdx()
410+
-For timestampsFromGlobalSource: the value global source subprocessor, zero if it is software-based
411+
-For timestampsDerivedFromChannel: the subprocessor index of the processor which generated the channel this event is based on
412+
*/
405413
uint16 getTimestampOriginSubProcessor() const;
406414

407415
InfoObjectType getInfoObjectType() const override;

0 commit comments

Comments
 (0)