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
49b8220a
Unverified
Commit
49b8220a
authored
6 years ago
by
Dimitrios Stoupis
Browse files
Options
Downloads
Patches
Plain Diff
Add a list implementation of the time scheduled activities
parent
88efa24a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/Services/TimeBasedSchedulingService.hpp
+16
-5
16 additions, 5 deletions
inc/Services/TimeBasedSchedulingService.hpp
with
16 additions
and
5 deletions
inc/Services/TimeBasedSchedulingService.hpp
+
16
−
5
View file @
49b8220a
#ifndef ECSS_SERVICES_TIMEBASEDSCHEDULINGSERVICE_HPP
#define ECSS_SERVICES_TIMEBASEDSCHEDULINGSERVICE_HPP
#include
"etl/vector.h"
#include
"etl/iterator.h"
#include
"etl/String.hpp"
#include
"etl/list.h"
#include
"Service.hpp"
#include
"ErrorHandler.hpp"
#include
"MessageParser.hpp"
...
...
@@ -96,10 +94,23 @@ private:
/**
* @brief Hold the scheduled activities
*
* @details The scheduled activities in this
vector
are ordered by their release time, as the
* @details The scheduled activities in this
list
are ordered by their release time, as the
* standard requests.
*/
etl
::
vector
<
ScheduledActivity
,
ECSS_MAX_NUMBER_OF_TIME_SCHED_ACTIVITIES
>
scheduledActivities
;
etl
::
list
<
ScheduledActivity
,
ECSS_MAX_NUMBER_OF_TIME_SCHED_ACTIVITIES
>
scheduledActivities
;
/**
* @brief Sort the activities by their release time
*
* @details The ECSS standard requires that the activities are sorted in the TM message
* response. Also it is better to have the activities sorted.
*/
inline
void
sortActivitiesReleaseTime
(
etl
::
list
<
ScheduledActivity
,
ECSS_MAX_NUMBER_OF_TIME_SCHED_ACTIVITIES
>
&
schedActivities
)
{
schedActivities
.
sort
([](
ScheduledActivity
const
&
leftSide
,
ScheduledActivity
const
&
rightSide
)
{
return
leftSide
.
requestReleaseTime
<
rightSide
.
requestReleaseTime
;
});
}
/**
* @brief Define a friend in order to be able to access private members during testing
...
...
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