Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECSS Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
AcubeSat-OBC
ECSS Services
Commits
a047f3f3
Unverified
Commit
a047f3f3
authored
5 years ago
by
Grigoris Pavlakis
Browse files
Options
Downloads
Patches
Plain Diff
Add getters for PTC and PFC sub-fields
parent
a2bc3640
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inc/Services/Parameter.hpp
+1
-0
1 addition, 0 deletions
inc/Services/Parameter.hpp
src/Services/Parameter.cpp
+10
-1
10 additions, 1 deletion
src/Services/Parameter.cpp
src/Services/ParameterService.cpp
+2
-27
2 additions, 27 deletions
src/Services/ParameterService.cpp
with
13 additions
and
28 deletions
inc/Services/Parameter.hpp
+
1
−
0
View file @
a047f3f3
...
...
@@ -67,6 +67,7 @@ class Parameter {
ValueType
getCurrentValue
();
uint8_t
getPTC
();
uint8_t
getPFC
();
};
...
...
This diff is collapsed.
Click to expand it.
src/Services/Parameter.cpp
+
10
−
1
View file @
a047f3f3
...
...
@@ -24,4 +24,13 @@ void Parameter::setCurrentValue(ValueType newVal) {
ValueType
Parameter
::
getCurrentValue
()
{
return
currentValue
;
}
\ No newline at end of file
}
uint8_t
Parameter
::
getPTC
()
{
return
ptc
;
}
uint8_t
Parameter
::
getPFC
()
{
return
pfc
;
}
This diff is collapsed.
Click to expand it.
src/Services/ParameterService.cpp
+
2
−
27
View file @
a047f3f3
#include
"Services/ParameterService.hpp"
#include
"Services/Parameter.hpp"
ParameterService
::
ParameterService
()
{
ParameterService
::
ParameterService
()
{
// test addings
addNewParameter
(
3
,
14
);
addNewParameter
(
3
,
14
);
// // Test code, setting up some of the parameter fields
//
// time_t currTime = time(nullptr);
// struct tm* today = localtime(&currTime);
//
// Parameter test1, test2;
//
// test1.currentValue = today->tm_hour; // the current hour
// test1.ptc = 3; // unsigned int
// test1.pfc = 14; // 32 bits
//
// test2.currentValue = today->tm_min; // the current minute
// test2.ptc = 3; // unsigned int
// test2.pfc = 14; // 32 bits
//
// // MAKE SURE THE IDS ARE UNIQUE WHEN INSERTING!
// /**
// * @todo: Make a separate insert() function for parameter insertion to protect from blunders
// * if needed to
// */
//
// paramsList.insert(std::make_pair(0, test1));
// paramsList.insert(std::make_pair(1, test2));
//
//#endif
}
bool
ParameterService
::
addNewParameter
(
uint8_t
ptc
,
uint8_t
pfc
,
uint32_t
initialValue
,
UpdatePtr
ptr
)
{
...
...
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