Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
HRE Test stand On-Board Software
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Old Rockets
HRE Test stand On-Board Software
Commits
60da2213
Commit
60da2213
authored
3 years ago
by
Alberto Nidasio
Browse files
Options
Downloads
Patches
Plain Diff
[CLI] Implemented commands logging
parent
6673c8a9
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3705
failed
3 years ago
Stage: build-release
Stage: build-debug
Stage: lint
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/board/CLI/CLI.cpp
+4
-0
4 additions, 0 deletions
src/board/CLI/CLI.cpp
src/board/CLI/CLIData.h
+54
-0
54 additions, 0 deletions
src/board/CLI/CLIData.h
with
58 additions
and
0 deletions
src/board/CLI/CLI.cpp
+
4
−
0
View file @
60da2213
...
...
@@ -31,6 +31,8 @@
#include
<iostream>
#include
"CLIData.h"
using
namespace
miosix
;
using
namespace
Boardcore
;
...
...
@@ -96,6 +98,8 @@ void CLI::run()
std
::
string
line
;
std
::
getline
(
std
::
cin
,
line
);
Logger
::
getInstance
().
log
(
CommandData
{
line
});
commandRate
=
1000.0
/
(
miosix
::
getTick
()
-
lastCommandTick
);
lastCommandTick
=
miosix
::
getTick
();
...
...
This diff is collapsed.
Click to expand it.
src/board/CLI/CLIData.h
0 → 100644
+
54
−
0
View file @
60da2213
/* Copyright (c) 2022 Skyward Experimental Rocketry
* Author: Alberto Nidasio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma once
#include
<drivers/timer/TimestampTimer.h>
#include
<stdint.h>
#include
<cstring>
#include
<string>
namespace
HRETestStand
{
struct
CommandData
{
uint64_t
timestamp
;
char
command
[
100
];
CommandData
(
std
::
string
command
)
:
timestamp
(
Boardcore
::
TimestampTimer
::
getTimestamp
())
{
memcpy
(
this
->
command
,
command
.
c_str
(),
command
.
size
()
<
99
?
command
.
size
()
+
1
:
100
);
}
static
std
::
string
header
()
{
return
"timestamp,command
\n
"
;
}
void
print
(
std
::
ostream
&
os
)
const
{
os
<<
timestamp
<<
","
<<
command
<<
"
\n
"
;
}
};
}
// namespace HRETestStand
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment