F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Events.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Events.cpp
3 // \author Bocchino
4 // \brief Implementation for CmdSequencerComponentImpl::Sequence::Events
5 //
6 // Copyright (C) 2009-2018 California Institute of Technology.
7 // ALL RIGHTS RESERVED. United States Government Sponsorship
8 // acknowledged.
9 // ======================================================================
10 
11 #include "Fw/Types/Assert.hpp"
13 
14 namespace Svc {
15 
17  Events(Sequence& sequence) :
18  m_sequence(sequence)
19  {
20 
21  }
22 
24  fileCRCFailure(const U32 storedCRC, const U32 computedCRC)
25  {
26  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
27  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
28  component.log_WARNING_HI_CS_FileCrcFailure(
29  logFileName,
30  storedCRC,
31  computedCRC
32  );
33  component.error();
34  }
35 
37  fileInvalid(const CmdSequencer_FileReadStage::t stage, const I32 error)
38  {
39  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
40  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
41  component.log_WARNING_HI_CS_FileInvalid(
42  logFileName,
43  stage,
44  error
45  );
46  component.error();
47  }
48 
51  {
52  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
53  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
54  component.log_WARNING_HI_CS_FileNotFound(logFileName);
55  component.error();
56  }
57 
60  {
61  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
62  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
63  component.log_WARNING_HI_CS_FileReadError(logFileName);
64  component.error();
65  }
66 
68  fileSizeError(const U32 size)
69  {
70  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
71  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
72  component.log_WARNING_HI_CS_FileSizeError(
73  logFileName,
74  size
75  );
76  component.error();
77  }
78 
80  recordInvalid(const U32 recordNumber, const I32 error)
81  {
82  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
83  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
84  component.log_WARNING_HI_CS_RecordInvalid(
85  logFileName,
86  recordNumber,
87  error
88  );
89  component.error();
90  }
91 
93  recordMismatch(const U32 numRecords, const U32 extraBytes)
94  {
95  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
96  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
97  component.log_WARNING_HI_CS_RecordMismatch(
98  logFileName,
99  numRecords,
100  extraBytes
101  );
102  // TODO: Should this be an error?
103  }
104 
106  timeBaseMismatch(const TimeBase currTimeBase, const TimeBase seqTimeBase)
107  {
108  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
109  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
110  component.log_WARNING_HI_CS_TimeBaseMismatch(
111  logFileName,
112  currTimeBase,
113  seqTimeBase
114  );
115  component.error();
116  }
117 
120  const FwTimeContextStoreType currTimeContext,
121  const FwTimeContextStoreType seqTimeContext
122  )
123  {
124  Fw::LogStringArg& logFileName = this->m_sequence.getLogFileName();
125  CmdSequencerComponentImpl& component = this->m_sequence.m_component;
126  component.log_WARNING_HI_CS_TimeContextMismatch(
127  logFileName,
128  currTimeContext,
129  seqTimeContext
130  );
131  component.error();
132  }
133 
134 }
135 
Svc::CmdSequencerComponentImpl::Sequence::Events::timeBaseMismatch
void timeBaseMismatch(const TimeBase currTimeBase, const TimeBase seqTimeBase)
Time base mismatch.
Definition: Events.cpp:106
Fw::LogStringArg
Definition: LogString.hpp:11
Svc::CmdSequencerComponentImpl::Sequence::Events::fileInvalid
void fileInvalid(const CmdSequencer_FileReadStage::t stage, const I32 error)
File invalid.
Definition: Events.cpp:37
Svc::CmdSequencerComponentImpl::Sequence::Events::Events
Events(Sequence &sequence)
Construct an Events object.
Definition: Events.cpp:17
Svc::CmdSequencerComponentImpl::Sequence::Events::fileCRCFailure
void fileCRCFailure(const U32 storedCRC, const U32 computedCRC)
File CRC failure.
Definition: Events.cpp:24
Svc::CmdSequencerComponentImpl::Sequence::Events::fileSizeError
void fileSizeError(const U32 size)
File size error.
Definition: Events.cpp:68
TimeBase
TimeBase
Definition: FpConfig.hpp:324
FwTimeContextStoreType
#define FwTimeContextStoreType
Storage conversion for time context in scripts/ground interface.
Definition: FpConfig.hpp:337
Assert.hpp
Svc::CmdSequencerComponentImpl::Sequence::Events::fileNotFound
void fileNotFound()
File not found.
Definition: Events.cpp:50
Svc::CmdSequencerComponentImpl::Sequence::Events::timeContextMismatch
void timeContextMismatch(const FwTimeContextStoreType currTimeContext, const FwTimeContextStoreType seqTimeContext)
Time context mismatch.
Definition: Events.cpp:119
Svc::CmdSequencerComponentImpl::Sequence::Events::recordMismatch
void recordMismatch(const U32 numRecords, const U32 extraBytes)
Record mismatch.
Definition: Events.cpp:93
Svc::CmdSequencerComponentImpl::Sequence::Events::fileReadError
void fileReadError()
File read error.
Definition: Events.cpp:59
Svc
Definition: ActiveRateGroupImplCfg.hpp:18
Svc::CmdSequencerComponentImpl
Definition: CmdSequencerImpl.hpp:22
CmdSequencerImpl.hpp
Svc::CmdSequencerComponentImpl::Sequence::Events::recordInvalid
void recordInvalid(const U32 recordNumber, const I32 error)
Record invalid.
Definition: Events.cpp:80
Svc::CmdSequencerComponentImpl::Sequence
A sequence with unspecified binary format.
Definition: CmdSequencerImpl.hpp:50