asc file reader and small log enhancements (#3)

This commit is contained in:
tompzf
2025-12-09 18:37:22 +01:00
committed by GitHub
parent 2fb043b2be
commit f74e494a43
19 changed files with 168 additions and 110 deletions

View File

@@ -43,7 +43,7 @@ namespace asc
switch (eState)
{
case EState::header:
if (ssLine.compare(0, 18, "Begin Triggerblock") == 0)
if (ssLine.compare(0, 18, "Begin TriggerBlock") == 0)
eState = EState::body;
break;
case EState::body:
@@ -72,6 +72,11 @@ namespace asc
return std::make_pair(*m_itCurrent, true);
}
uint32_t CAscReader::GetMessageCount() const
{
return m_lstMessages.size();
}
uint32_t CAscReader::GetLoopCount() const
{
return m_uiLoopCount;

View File

@@ -56,6 +56,12 @@ namespace asc
*/
std::pair<SCanMessage, bool> Get() const;
/**
* @brief Get the number of messages in the asc file
* @return Number of messages which count be read from the asc file.
*/
uint32_t GetMessageCount() const;
/**
* @brief Get the number of loops the data set was sent
* @return Number of loops the data set was sent including the current loop

View File

@@ -53,7 +53,7 @@ namespace asc
fstream << "base hex timestamps absolute" << std::endl;
// Stream trigger block
fstream << "Begin Triggerblock " << std::put_time(std::localtime(&tmSystemTime), "%c") << std::endl;
fstream << "Begin TriggerBlock " << std::put_time(std::localtime(&tmSystemTime), "%c") << std::endl;
fstream << " 0.000000 Start of measurement" << std::endl;
for (const SCanMessage& rsSample : m_lstMessages)
{