Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
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
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
On-Board Software
Commits
93b4fca1
Commit
93b4fca1
authored
1 month ago
by
Niccolò Betto
Browse files
Options
Downloads
Patches
Plain Diff
[Main][HIL] Add missing breaks in handle event switch statement
parent
0e19cb9a
Branches
Branches containing commit
No related tags found
1 merge request
!129
[Main] Various small fixes to HIL code after testing
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Main/HIL/HIL.cpp
+48
-1
48 additions, 1 deletion
src/Main/HIL/HIL.cpp
with
48 additions
and
1 deletion
src/Main/HIL/HIL.cpp
+
48
−
1
View file @
93b4fca1
...
...
@@ -165,70 +165,109 @@ void MainHILPhasesManager::handleEventImpl(
switch
(
e
)
{
case
Common
::
Events
::
FMM_INIT_ERROR
:
{
printf
(
"[HIL] ------- INIT FAILED ! -------
\n
"
);
break
;
}
case
Common
::
Events
::
FMM_INIT_OK
:
{
setFlagFlightPhase
(
MainFlightPhases
::
CALIBRATION
,
true
);
printf
(
"[HIL] ------- CALIBRATION ! -------
\n
"
);
changed_flags
.
push_back
(
MainFlightPhases
::
CALIBRATION
);
break
;
}
case
Common
::
Events
::
FLIGHT_DISARMED
:
{
setFlagFlightPhase
(
MainFlightPhases
::
CALIBRATION_OK
,
true
);
printf
(
"[HIL] CALIBRATION OK!
\n
"
);
changed_flags
.
push_back
(
MainFlightPhases
::
CALIBRATION_OK
);
break
;
}
case
Common
::
Events
::
FLIGHT_ARMED
:
{
setFlagFlightPhase
(
MainFlightPhases
::
ARMED
,
true
);
printf
(
"[HIL] ------- READY TO LAUNCH ! -------
\n
"
);
changed_flags
.
push_back
(
MainFlightPhases
::
ARMED
);
break
;
}
case
Common
::
Events
::
FLIGHT_LAUNCH_PIN_DETACHED
:
{
setFlagFlightPhase
(
MainFlightPhases
::
LIFTOFF_PIN_DETACHED
,
true
);
printf
(
"[HIL] ------- LIFTOFF PIN DETACHED ! -------
\n
"
);
changed_flags
.
push_back
(
MainFlightPhases
::
LIFTOFF_PIN_DETACHED
);
break
;
}
case
Common
::
Events
::
FLIGHT_LIFTOFF
:
case
Common
::
Events
::
TMTC_FORCE_LAUNCH
:
{
t_liftoff
=
Boardcore
::
TimestampTimer
::
getTimestamp
();
printf
(
"[HIL] ------- LIFTOFF -------: %f, %f
\n
"
,
getCurrentPosition
().
z
,
getCurrentPosition
().
vz
);
changed_flags
.
push_back
(
MainFlightPhases
::
LIFTOFF
);
break
;
}
case
Common
::
Events
::
FLIGHT_MOTOR_SHUTDOWN
:
{
printf
(
"[HIL] ------- SHUTDOWN -------: %f, %f
\n
"
,
getCurrentPosition
().
z
,
getCurrentPosition
().
vz
);
changed_flags
.
push_back
(
MainFlightPhases
::
SHUTDOWN
);
break
;
}
case
Common
::
Events
::
ABK_SHADOW_MODE_TIMEOUT
:
{
setFlagFlightPhase
(
MainFlightPhases
::
AEROBRAKES
,
true
);
registerOutcomes
(
MainFlightPhases
::
AEROBRAKES
);
printf
(
"[HIL] ABK shadow mode timeout
\n
"
);
changed_flags
.
push_back
(
MainFlightPhases
::
AEROBRAKES
);
break
;
}
case
Common
::
Events
::
ADA_SHADOW_MODE_TIMEOUT
:
{
printf
(
"[HIL] ADA shadow mode timeout
\n
"
);
break
;
}
case
Common
::
Events
::
ABK_DISABLE
:
{
setFlagFlightPhase
(
MainFlightPhases
::
AEROBRAKES
,
false
);
printf
(
"[HIL] ABK disabled
\n
"
);
break
;
}
case
Common
::
Events
::
FLIGHT_APOGEE_DETECTED
:
case
Common
::
Events
::
CAN_APOGEE_DETECTED
:
{
setFlagFlightPhase
(
MainFlightPhases
::
AEROBRAKES
,
false
);
registerOutcomes
(
MainFlightPhases
::
APOGEE
);
printf
(
"[HIL] ------- APOGEE DETECTED ! ------- %f, %f
\n
"
,
getCurrentPosition
().
z
,
getCurrentPosition
().
vz
);
changed_flags
.
push_back
(
MainFlightPhases
::
APOGEE
);
break
;
}
case
Common
::
Events
::
FLIGHT_DROGUE_DESCENT
:
case
Common
::
Events
::
TMTC_FORCE_EXPULSION
:
{
setFlagFlightPhase
(
MainFlightPhases
::
PARA1
,
true
);
registerOutcomes
(
MainFlightPhases
::
PARA1
);
printf
(
"[HIL] ------- PARA1 ! ------- %f, %f
\n
"
,
getCurrentPosition
().
z
,
getCurrentPosition
().
vz
);
changed_flags
.
push_back
(
MainFlightPhases
::
PARA1
);
break
;
}
case
Common
::
Events
::
FLIGHT_WING_DESCENT
:
case
Common
::
Events
::
FLIGHT_DPL_ALT_DETECTED
:
case
Common
::
Events
::
TMTC_FORCE_DEPLOYMENT
:
{
setFlagFlightPhase
(
MainFlightPhases
::
PARA1
,
false
);
setFlagFlightPhase
(
MainFlightPhases
::
PARA2
,
true
);
registerOutcomes
(
MainFlightPhases
::
PARA2
);
...
...
@@ -236,8 +275,11 @@ void MainHILPhasesManager::handleEventImpl(
getCurrentPosition
().
z
,
getCurrentPosition
().
vz
);
changed_flags
.
push_back
(
MainFlightPhases
::
PARA2
);
break
;
}
case
Common
::
Events
::
FLIGHT_LANDING_DETECTED
:
case
Common
::
Events
::
TMTC_FORCE_LANDING
:
{
t_stop
=
Boardcore
::
TimestampTimer
::
getTimestamp
();
setFlagFlightPhase
(
MainFlightPhases
::
PARA2
,
false
);
setFlagFlightPhase
(
MainFlightPhases
::
SIMULATION_STOPPED
,
true
);
...
...
@@ -247,8 +289,13 @@ void MainHILPhasesManager::handleEventImpl(
(
double
)
t_stop
/
1000000.0
f
);
printOutcomes
();
break
;
}
default
:
{
printf
(
"%s event
\n
"
,
Common
::
getEventString
(
e
).
c_str
());
break
;
}
}
}
...
...
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