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
e0c5ec7b
Commit
e0c5ec7b
authored
6 years ago
by
athatheocsd
Browse files
Options
Downloads
Patches
Plain Diff
Tests for observables added and variable name mistakes fixed
parent
cd1641c3
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/EventReportService.hpp
+5
-14
5 additions, 14 deletions
inc/Services/EventReportService.hpp
src/Services/EventReportService.cpp
+3
-1
3 additions, 1 deletion
src/Services/EventReportService.cpp
test/Services/EventReportService.cpp
+24
-1
24 additions, 1 deletion
test/Services/EventReportService.cpp
with
32 additions
and
16 deletions
inc/Services/EventReportService.hpp
+
5
−
14
View file @
e0c5ec7b
...
...
@@ -21,7 +21,7 @@ private:
std
::
bitset
<
numberOfEvents
>
stateOfEvents
;
public:
// Variables that count the event reports per severity level
uint16_t
lowSeverityReport
s
Count
;
uint16_t
lowSeverityReportCount
;
uint16_t
mediumSeverityReportCount
;
uint16_t
highSeverityReportCount
;
...
...
@@ -39,16 +39,16 @@ public:
EventReportService
()
{
stateOfEvents
.
set
();
serviceType
=
5
;
lowSeverityReport
s
Count
=
0
;
lowSeverityReportCount
=
0
;
mediumSeverityReportCount
=
0
;
highSeverityReportCount
=
0
;
disabledEventsCount
=
0
;
lowSeverityEventCount
=
0
;
mediumSeverityEventCount
=
0
;
highSeverityEventCount
=
0
;
lastLowSeverityReportID
=
-
1
;
lastMediumSeverityReportID
=
-
1
;
lastHighSeverityReportID
=
-
1
;
lastLowSeverityReportID
=
65535
;
lastMediumSeverityReportID
=
65535
;
lastHighSeverityReportID
=
65535
;
}
/**
...
...
@@ -171,15 +171,6 @@ public:
std
::
bitset
<
numberOfEvents
>
getStateOfEvents
()
{
return
stateOfEvents
;
}
/**
* Getter for count of disabled events
*/
uint16_t
getDisabledEventsCount
()
{
uint16_t
numberOfDisabledEvents
=
stateOfEvents
.
size
()
-
stateOfEvents
.
count
();
return
numberOfDisabledEvents
;
}
};
#endif //ECSS_SERVICES_EVENTREPORTSERVICE_HPP
This diff is collapsed.
Click to expand it.
src/Services/EventReportService.cpp
+
3
−
1
View file @
e0c5ec7b
...
...
@@ -24,7 +24,7 @@ EventReportService::lowSeverityAnomalyReport(Event eventID, const uint8_t *data,
lowSeverityEventCount
++
;
// TM[5,2]
if
(
stateOfEvents
[
static_cast
<
uint16_t
>
(
eventID
)]
==
1
)
{
lowSeverityReport
s
Count
++
;
lowSeverityReportCount
++
;
Message
report
=
createTM
(
2
);
report
.
appendEnum16
(
eventID
);
report
.
appendString
(
length
,
data
);
...
...
@@ -75,6 +75,7 @@ void EventReportService::enableReportGeneration(uint16_t length, Event *eventID)
stateOfEvents
[
static_cast
<
uint16_t
>
(
eventID
[
i
])]
=
1
;
}
}
disabledEventsCount
=
stateOfEvents
.
size
()
-
stateOfEvents
.
count
();
}
void
EventReportService
::
disableReportGeneration
(
uint16_t
length
,
Event
*
eventID
)
{
...
...
@@ -87,6 +88,7 @@ void EventReportService::disableReportGeneration(uint16_t length, Event *eventID
stateOfEvents
[
static_cast
<
uint16_t
>
(
eventID
[
i
])]
=
0
;
}
}
disabledEventsCount
=
stateOfEvents
.
size
()
-
stateOfEvents
.
count
();
}
void
EventReportService
::
requestListOfDisabledEvents
()
{
...
...
This diff is collapsed.
Click to expand it.
test/Services/EventReportService.cpp
+
24
−
1
View file @
e0c5ec7b
...
...
@@ -144,5 +144,28 @@ TEST_CASE("List of Disabled Events Report TM[5,8]", "[service][st05]") {
TEST_CASE
(
"List of observables 6.5.6"
,
"[service][st05]"
)
{
EventReportService
eventReportService
;
EventReportService
::
Event
eventID
[]
=
{
EventReportService
::
HighSeverityUnknownEvent
};
eventReportService
.
disableReportGeneration
(
1
,
eventID
);
}
const
unsigned
char
eventReportData
[]
=
"HelloWorld"
;
eventReportService
.
highSeverityAnomalyReport
(
EventReportService
::
HighSeverityUnknownEvent
,
eventReportData
,
10
);
eventReportService
.
mediumSeverityAnomalyReport
(
EventReportService
::
MediumSeverityUnknownEvent
,
eventReportData
,
10
);
CHECK
(
eventReportService
.
lowSeverityReportCount
==
0
);
CHECK
(
eventReportService
.
mediumSeverityReportCount
==
1
);
CHECK
(
eventReportService
.
highSeverityReportCount
==
0
);
CHECK
(
eventReportService
.
lowSeverityEventCount
==
0
);
CHECK
(
eventReportService
.
mediumSeverityEventCount
==
1
);
CHECK
(
eventReportService
.
highSeverityEventCount
==
1
);
CHECK
(
eventReportService
.
disabledEventsCount
==
1
);
CHECK
(
eventReportService
.
lastLowSeverityReportID
==
65535
);
CHECK
(
eventReportService
.
lastMediumSeverityReportID
==
5
);
CHECK
(
eventReportService
.
lastHighSeverityReportID
==
65535
);
}
\ No newline at end of file
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