Skip to content

Commit cbae2cc

Browse files
committed
Cancel Event
1 parent cb037fc commit cbae2cc

3 files changed

Lines changed: 6 additions & 32 deletions

File tree

Svc/FpySequencer/FpySequencer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void FpySequencer::cmdResponseIn_handler(FwIndexType portNum, //!< T
360360
void FpySequencer ::seqCancelIn_handler(FwIndexType portNum) {
361361
// only state you can't cancel in is IDLE
362362
if (sequencer_getState() == State::IDLE) {
363-
this->log_WARNING_HI_InvalidCommand(static_cast<I32>(sequencer_getState()));
363+
this->log_WARNING_HI_InvalidCancel(static_cast<I32>(sequencer_getState()));
364364
return;
365365
}
366366
this->sequencer_sendSignal_cmd_CANCEL();

Svc/FpySequencer/FpySequencerEvents.fppi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ event InvalidSeqRunCall($state: I32) \
66
severity warning high \
77
format "Cannot run sequence from a port in state {}"
88

9+
event InvalidCancel($state: I32) \
10+
severity warning high \
11+
format "Cannot cancel sequence in state {}"
12+
913
event FileOpenError(
1014
filePath: string
1115
errorCode: I32

Svc/FpySequencer/test/ut/FpySequencerTestMain.cpp

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3196,7 +3196,7 @@ TEST_F(FpySequencerTester, seqCancelIn) {
31963196
this->invoke_to_seqCancelIn(0);
31973197
this->tester_doDispatch();
31983198
// should fail if we're in IDLE
3199-
ASSERT_EVENTS_InvalidCommand_SIZE(1);
3199+
ASSERT_EVENTS_InvalidCancel_SIZE(1);
32003200

32013201
dispatchCurrentMessages(cmp);
32023202
ASSERT_EQ(this->tester_getState(), State::IDLE);
@@ -3211,36 +3211,6 @@ TEST_F(FpySequencerTester, seqCancelIn) {
32113211
ASSERT_from_seqDoneOut(0, 0, 0, Fw::CmdResponse::EXECUTION_ERROR);
32123212
}
32133213

3214-
3215-
TEST_F(FpySequencerTester, flag_EXIT_ON_CMD_FAIL) {
3216-
// test a simple seq that fails because a cmd fails
3217-
this->paramSet_FLAG_DEFAULT_EXIT_ON_CMD_FAIL(true, Fw::ParamValid::VALID);
3218-
this->paramSend_FLAG_DEFAULT_EXIT_ON_CMD_FAIL(0, 0);
3219-
this->clearHistory();
3220-
allocMem();
3221-
add_CONST_CMD(123);
3222-
writeAndRun();
3223-
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
3224-
// okay now send in a failure
3225-
invoke_to_cmdResponseIn(0, 123, 0x00010001, Fw::CmdResponse::EXECUTION_ERROR);
3226-
dispatchUntilState(State::IDLE);
3227-
ASSERT_CMD_RESPONSE_SIZE(1);
3228-
ASSERT_CMD_RESPONSE(0, 0, get_OPCODE_RUN(), Fw::CmdResponse::EXECUTION_ERROR);
3229-
3230-
// now test that it doesn't fail if we set flag to false
3231-
this->paramSet_FLAG_DEFAULT_EXIT_ON_CMD_FAIL(false, Fw::ParamValid::VALID);
3232-
this->paramSend_FLAG_DEFAULT_EXIT_ON_CMD_FAIL(0, 0);
3233-
this->clearHistory();
3234-
// cmd is already in seq, can just rerun
3235-
writeAndRun();
3236-
dispatchUntilState(State::RUNNING_AWAITING_STATEMENT_RESPONSE);
3237-
// okay now send in a failure
3238-
invoke_to_cmdResponseIn(0, 123, 0x00020002, Fw::CmdResponse::EXECUTION_ERROR);
3239-
dispatchUntilState(State::IDLE);
3240-
ASSERT_CMD_RESPONSE_SIZE(1);
3241-
ASSERT_CMD_RESPONSE(0, 0, get_OPCODE_RUN(), Fw::CmdResponse::OK);
3242-
}
3243-
32443214
// ----------------------------------------------------------------------
32453215
// Stack Unit Tests
32463216
// ----------------------------------------------------------------------

0 commit comments

Comments
 (0)