Back to Serial Studio

MDF Lib: include/mdf/ievent.h Source File

lib/mdflib/docs/manual/html/ievent_8h_source.html

3.2.721.0 KB
Original Source

| MDF Lib 2.2

Interface against MDF 3/4 files |

Loading...

Searching...

No Matches

ievent.h

Go to the documentation of this file.

1/*

2 * Copyright 2022 Ingemar Hedvall

3 * SPDX-License-Identifier: MIT

4 */

5

9#pragma once

10#include <mdf/iattachment.h>

11#include <mdf/iblock.h>

12

13#include <cstdint>

14#include <string>

15#include <vector>

16

17namespace mdf {

19enum class EventType : uint8_t {

20RecordingPeriod = 0,

21RecordingInterrupt = 1,

22AcquisitionInterrupt = 2,

23StartRecording = 3,

24StopRecording = 4,

25Trigger = 5,

26Marker = 6

27};

28

30enum class SyncType : uint8_t {

31SyncTime = 1,

32SyncAngle = 2,

33SyncDistance = 3,

34SyncIndex = 4,

35};

36

38enum class RangeType : uint8_t {

39RangePoint = 0,

40RangeStart = 1,

41RangeEnd = 2

42};

43

45enum class EventCause : uint8_t {

46CauseOther = 0,

47CauseError = 1,

48CauseTool = 2,

49CauseScript = 3,

50CauseUser = 4,

51};

52

58class IEvent : public IBlock {

59 public:

60virtual void Name(const std::string& name) = 0;

61 [[nodiscard]] virtual const std::string& Name() const = 0;

62

64virtual void GroupName(const std::string& group_name) = 0;

66 [[nodiscard]] virtual const std::string& GroupName() const = 0;

67

68

69virtual void Type(EventType event_type) = 0;

70 [[nodiscard]] virtual EventType Type() const = 0;

71 [[nodiscard]] std::string TypeToString() const;

72

73virtual void Sync(SyncType sync_type) = 0;

74 [[nodiscard]] virtual SyncType Sync() const = 0;

75

76virtual void Range(RangeType range_type) = 0;

77 [[nodiscard]] virtual RangeType Range() const = 0;

78 [[nodiscard]] std::string RangeToString() const;

79

80virtual void Cause(EventCause cause) = 0;

81 [[nodiscard]] virtual EventCause Cause() const = 0;

82 [[nodiscard]] std::string CauseToString() const;

83

84virtual void CreatorIndex(size_t index) = 0;

85 [[nodiscard]] virtual size_t CreatorIndex() const = 0;

86

87virtual void SyncValue(int64_t value) = 0;

88 [[nodiscard]] virtual int64_t SyncValue() const = 0;

89

90virtual void SyncFactor(double factor) = 0;

91 [[nodiscard]] virtual double SyncFactor() const = 0;

92 [[nodiscard]] std::string ValueToString() const;

93

95virtual void ParentEvent(const IEvent* parent) = 0;

97 [[nodiscard]] virtual const IEvent* ParentEvent() const = 0;

98

100virtual void RangeEvent(const IEvent* range_event) = 0;

102 [[nodiscard]] virtual const IEvent* RangeEvent() const = 0;

103

105virtual void AddScope(const void* scope) = 0;

107 [[nodiscard]] virtual const std::vector<const void*>& Scopes() const = 0;

108

110virtual void AddAttachment(const IAttachment* attachment) = 0;

112 [[nodiscard]] virtual const std::vector<const IAttachment*>& Attachments()

113const = 0;

114

119 [[nodiscard]] virtual IMetaData* CreateMetaData() = 0;

120

125 [[nodiscard]] virtual const IMetaData* MetaData() const = 0;

126

127void Description(const std::string& description);

128 [[nodiscard]] std::string Description() const;

129

130void PreTrig(double pre_trig);

131

132 [[nodiscard]] double PreTrig() const;

133

134void PostTrig(double post_trig);

135

136 [[nodiscard]] double PostTrig() const;

137};

138

139} // namespace mdf

mdf::IAttachment

Interface against an attached file.

Definition iattachment.h:21

mdf::IBlock

Base class for all MDF blocks.

Definition iblock.h:19

mdf::IEvent

Interface against an event block.

Definition ievent.h:58

mdf::IEvent::AddScope

virtual void AddScope(const void *scope)=0

Adds a scope reference.

mdf::IEvent::Scopes

virtual const std::vector< const void * > & Scopes() const =0

Returns referenced CN and CG blocks.

mdf::IEvent::CreatorIndex

virtual size_t CreatorIndex() const =0

Creator index.

mdf::IEvent::Description

std::string Description() const

Returns description.

mdf::IEvent::Range

virtual void Range(RangeType range_type)=0

Sets type of range.

mdf::IEvent::Cause

virtual void Cause(EventCause cause)=0

Sets the cause.

mdf::IEvent::Name

virtual const std::string & Name() const =0

Name.

mdf::IEvent::MetaData

virtual const IMetaData * MetaData() const =0

Returns an constant interface against a MD4 block.

mdf::IEvent::PostTrig

void PostTrig(double post_trig)

Sets the post-trig value (s)

mdf::IEvent::SyncFactor

virtual double SyncFactor() const =0

Sync factor.

mdf::IEvent::Description

void Description(const std::string &description)

Sets description.

mdf::IEvent::RangeToString

std::string RangeToString() const

Range to string.

mdf::IEvent::AddAttachment

virtual void AddAttachment(const IAttachment *attachment)=0

Adds an attachment reference.

mdf::IEvent::Sync

virtual SyncType Sync() const =0

Type of sync.

mdf::IEvent::ParentEvent

virtual void ParentEvent(const IEvent *parent)=0

Sets the parent event.

mdf::IEvent::GroupName

virtual const std::string & GroupName() const =0

Returns the group name.

mdf::IEvent::Cause

virtual EventCause Cause() const =0

Cause of event.

mdf::IEvent::Range

virtual RangeType Range() const =0

Type of range.

mdf::IEvent::CreateMetaData

virtual IMetaData * CreateMetaData()=0

Returns an interface against an MD4 block.

mdf::IEvent::PreTrig

double PreTrig() const

Returns the pre-trig value (s).

mdf::IEvent::RangeEvent

virtual void RangeEvent(const IEvent *range_event)=0

Sets the range.

mdf::IEvent::CauseToString

std::string CauseToString() const

Cause to string.

mdf::IEvent::GroupName

virtual void GroupName(const std::string &group_name)=0

Sets the group name.

mdf::IEvent::RangeEvent

virtual const IEvent * RangeEvent() const =0

Returns the range.

mdf::IEvent::Name

virtual void Name(const std::string &name)=0

Sets the name.

mdf::IEvent::ParentEvent

virtual const IEvent * ParentEvent() const =0

Returns the parent event.

mdf::IEvent::CreatorIndex

virtual void CreatorIndex(size_t index)=0

Sets the creator index.

mdf::IEvent::TypeToString

std::string TypeToString() const

Typ as string.

mdf::IEvent::SyncFactor

virtual void SyncFactor(double factor)=0

Sets the factor.

mdf::IEvent::PreTrig

void PreTrig(double pre_trig)

Sets the pre-trig time (s).

mdf::IEvent::Sync

virtual void Sync(SyncType sync_type)=0

Sets type of sync.

mdf::IEvent::PostTrig

double PostTrig() const

Returns the post-trig value (s).

mdf::IEvent::SyncValue

virtual int64_t SyncValue() const =0

Sync value.

mdf::IEvent::Type

virtual void Type(EventType event_type)=0

Sets type of event.

mdf::IEvent::ValueToString

std::string ValueToString() const

Sync value as string.

mdf::IEvent::SyncValue

virtual void SyncValue(int64_t value)=0

Sets the sync value.

mdf::IEvent::Type

virtual EventType Type() const =0

Type of event.

mdf::IEvent::Attachments

virtual const std::vector< const IAttachment * > & Attachments() const =0

Returns a list of attachment references.

mdf::IMetaData

Interface against an meta data block (MD) in a MDF4 file.

Definition imetadata.h:27

iattachment.h

Interface against an attached file.

iblock.h

All MDF blocks inherits from the IBlock class. The interface class is used internally in lists....

mdf

Main namespace for the MDF library.

Definition canmessage.h:17

mdf::RangeType

RangeType

Type of range.

Definition ievent.h:38

mdf::RangeType::RangeStart

@ RangeStart

First in a range.

mdf::RangeType::RangePoint

@ RangePoint

Defines a point.

mdf::RangeType::RangeEnd

@ RangeEnd

Last in a range.

mdf::SyncType

SyncType

Type of synchronization value (default time)

Definition ievent.h:30

mdf::SyncType::SyncDistance

@ SyncDistance

Sync value represent distance (m).

mdf::SyncType::SyncAngle

@ SyncAngle

Sync value represent angle (rad).

mdf::SyncType::SyncIndex

@ SyncIndex

Sync value represent sample index.

mdf::SyncType::SyncTime

@ SyncTime

Sync value represent time (s).

mdf::EventCause

EventCause

Type of cause.

Definition ievent.h:45

mdf::EventCause::CauseUser

@ CauseUser

A user generated this event.

mdf::EventCause::CauseOther

@ CauseOther

Unknown source.

mdf::EventCause::CauseScript

@ CauseScript

A script generated this event.

mdf::EventCause::CauseError

@ CauseError

An error generated this event.

mdf::EventCause::CauseTool

@ CauseTool

The tool generated this event.

mdf::EventType

EventType

Type of event.

Definition ievent.h:19

mdf::EventType::Marker

@ Marker

Another generic event (maybe range).

mdf::EventType::StopRecording

@ StopRecording

Stop recording event.

mdf::EventType::StartRecording

@ StartRecording

Start recording event.

mdf::EventType::RecordingPeriod

@ RecordingPeriod

Specifies a recording period (range).

mdf::EventType::RecordingInterrupt

@ RecordingInterrupt

The recording was interrupted.

mdf::EventType::AcquisitionInterrupt

@ AcquisitionInterrupt

The data acquisition was interrupted.

mdf::EventType::Trigger

@ Trigger

Generic event (no range).


Generated by 1.12.0