Revise event code gen

Make event logging function const when there is no throttling
This commit is contained in:
Rob Bocchino 2024-11-13 19:18:13 -08:00
parent fa19db4919
commit b0ee596940
19 changed files with 78 additions and 73 deletions

View File

@ -293,7 +293,12 @@ case class ComponentEvents (
FormalParamsCppWriter.Value
),
CppDoc.Type("void"),
writeBody(id, event)
writeBody(id, event),
CppDoc.Function.NonSV,
event.throttle match {
case Some(_) => CppDoc.Function.NonConst
case None => CppDoc.Function.Const
}
)
)
)

View File

@ -2335,7 +2335,7 @@ F32 ActiveEventsComponentBase ::
// ----------------------------------------------------------------------
void ActiveEventsComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -2531,7 +2531,7 @@ void ActiveEventsComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -2610,7 +2610,7 @@ void ActiveEventsComponentBase ::
}
void ActiveEventsComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -2801,7 +2801,7 @@ void ActiveEventsComponentBase ::
}
void ActiveEventsComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1041,7 +1041,7 @@ class ActiveEventsComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1058,14 +1058,14 @@ class ActiveEventsComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1079,7 +1079,7 @@ class ActiveEventsComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -4598,7 +4598,7 @@ void ActiveSerialComponentBase ::
// ----------------------------------------------------------------------
void ActiveSerialComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -4794,7 +4794,7 @@ void ActiveSerialComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -4873,7 +4873,7 @@ void ActiveSerialComponentBase ::
}
void ActiveSerialComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -5064,7 +5064,7 @@ void ActiveSerialComponentBase ::
}
void ActiveSerialComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1851,7 +1851,7 @@ class ActiveSerialComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1868,14 +1868,14 @@ class ActiveSerialComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1889,7 +1889,7 @@ class ActiveSerialComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -4478,7 +4478,7 @@ namespace M {
// ----------------------------------------------------------------------
void ActiveTestComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -4674,7 +4674,7 @@ namespace M {
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -4753,7 +4753,7 @@ namespace M {
}
void ActiveTestComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -4944,7 +4944,7 @@ namespace M {
}
void ActiveTestComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1835,7 +1835,7 @@ namespace M {
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1852,14 +1852,14 @@ namespace M {
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1873,7 +1873,7 @@ namespace M {
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -1515,7 +1515,7 @@ F32 PassiveEventsComponentBase ::
// ----------------------------------------------------------------------
void PassiveEventsComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -1711,7 +1711,7 @@ void PassiveEventsComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -1790,7 +1790,7 @@ void PassiveEventsComponentBase ::
}
void PassiveEventsComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -1981,7 +1981,7 @@ void PassiveEventsComponentBase ::
}
void PassiveEventsComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -806,7 +806,7 @@ class PassiveEventsComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -823,14 +823,14 @@ class PassiveEventsComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -844,7 +844,7 @@ class PassiveEventsComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -2684,7 +2684,7 @@ void PassiveSerialComponentBase ::
// ----------------------------------------------------------------------
void PassiveSerialComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -2880,7 +2880,7 @@ void PassiveSerialComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -2959,7 +2959,7 @@ void PassiveSerialComponentBase ::
}
void PassiveSerialComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -3150,7 +3150,7 @@ void PassiveSerialComponentBase ::
}
void PassiveSerialComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1274,7 +1274,7 @@ class PassiveSerialComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1291,14 +1291,14 @@ class PassiveSerialComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1312,7 +1312,7 @@ class PassiveSerialComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -2916,7 +2916,7 @@ void PassiveTestComponentBase ::
// ----------------------------------------------------------------------
void PassiveTestComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -3112,7 +3112,7 @@ void PassiveTestComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -3191,7 +3191,7 @@ void PassiveTestComponentBase ::
}
void PassiveTestComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -3382,7 +3382,7 @@ void PassiveTestComponentBase ::
}
void PassiveTestComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1373,7 +1373,7 @@ class PassiveTestComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1390,14 +1390,14 @@ class PassiveTestComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1411,7 +1411,7 @@ class PassiveTestComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -2335,7 +2335,7 @@ F32 QueuedEventsComponentBase ::
// ----------------------------------------------------------------------
void QueuedEventsComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -2531,7 +2531,7 @@ void QueuedEventsComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -2610,7 +2610,7 @@ void QueuedEventsComponentBase ::
}
void QueuedEventsComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -2801,7 +2801,7 @@ void QueuedEventsComponentBase ::
}
void QueuedEventsComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1041,7 +1041,7 @@ class QueuedEventsComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1058,14 +1058,14 @@ class QueuedEventsComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1079,7 +1079,7 @@ class QueuedEventsComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -4598,7 +4598,7 @@ void QueuedSerialComponentBase ::
// ----------------------------------------------------------------------
void QueuedSerialComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -4794,7 +4794,7 @@ void QueuedSerialComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -4873,7 +4873,7 @@ void QueuedSerialComponentBase ::
}
void QueuedSerialComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -5064,7 +5064,7 @@ void QueuedSerialComponentBase ::
}
void QueuedSerialComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1851,7 +1851,7 @@ class QueuedSerialComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1868,14 +1868,14 @@ class QueuedSerialComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1889,7 +1889,7 @@ class QueuedSerialComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!

View File

@ -4476,7 +4476,7 @@ void QueuedTestComponentBase ::
// ----------------------------------------------------------------------
void QueuedTestComponentBase ::
log_ACTIVITY_HI_EventActivityHigh()
log_ACTIVITY_HI_EventActivityHigh() const
{
// Get the time
Fw::Time _logTime;
@ -4672,7 +4672,7 @@ void QueuedTestComponentBase ::
log_COMMAND_EventCommand(
const Fw::StringBase& str1,
const Fw::StringBase& str2
)
) const
{
// Get the time
Fw::Time _logTime;
@ -4751,7 +4751,7 @@ void QueuedTestComponentBase ::
}
void QueuedTestComponentBase ::
log_DIAGNOSTIC_EventDiagnostic(E e)
log_DIAGNOSTIC_EventDiagnostic(E e) const
{
// Get the time
Fw::Time _logTime;
@ -4942,7 +4942,7 @@ void QueuedTestComponentBase ::
}
void QueuedTestComponentBase ::
log_WARNING_HI_EventWarningHigh(S s)
log_WARNING_HI_EventWarningHigh(S s) const
{
// Get the time
Fw::Time _logTime;

View File

@ -1833,7 +1833,7 @@ class QueuedTestComponentBase :
//! Log event EventActivityHigh
//!
//! An activity high event with no params
void log_ACTIVITY_HI_EventActivityHigh();
void log_ACTIVITY_HI_EventActivityHigh() const;
//! Log event EventActivityLowThrottled
//!
@ -1850,14 +1850,14 @@ class QueuedTestComponentBase :
void log_COMMAND_EventCommand(
const Fw::StringBase& str1, //!< A string
const Fw::StringBase& str2 //!< Another string
);
) const;
//! Log event EventDiagnostic
//!
//! A diagnostic event with enum params
void log_DIAGNOSTIC_EventDiagnostic(
E e //!< An enum
);
) const;
//! Log event EventFatalThrottled
//!
@ -1871,7 +1871,7 @@ class QueuedTestComponentBase :
//! A warning high event with struct params
void log_WARNING_HI_EventWarningHigh(
S s //!< A struct
);
) const;
//! Log event EventWarningLowThrottled
//!