-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update/cmd sequencer heli #882
Changes from 11 commits
1fcf137
8f1829a
f1f8063
bf8f88e
a26a85f
a6a5d86
fd1a131
14af21c
c923ab5
a0c6a29
1d3060a
73c0abd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,15 @@ | |
// \copyright | ||
// Copyright (C) 2009-2018 California Institute of Technology. | ||
// ALL RIGHTS RESERVED. United States Government Sponsorship | ||
// acknowledged. | ||
// acknowledged. Any commercial use must be negotiated with the Office | ||
// of Technology Transfer at the California Institute of Technology. | ||
// | ||
// This software may be subject to U.S. export control laws and | ||
// regulations. By accepting this document, the user agrees to comply | ||
// with all U.S. export laws and regulations. User has the | ||
// responsibility to obtain export licenses, or other export authority | ||
// as may be required before exporting such information to foreign | ||
// countries or providing access to foreign persons. | ||
// ====================================================================== | ||
|
||
#include <Fw/Types/Assert.hpp> | ||
|
@@ -26,8 +33,13 @@ namespace Svc { | |
// ---------------------------------------------------------------------- | ||
|
||
CmdSequencerComponentImpl:: | ||
#if FW_OBJECT_NAMES == 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use this check anymore. Just keep line 37-38. We intercept the name at a higher level such that this construct is not needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, remove those. Also in the header file. |
||
CmdSequencerComponentImpl(const char* name) : | ||
CmdSequencerComponentBase(name), | ||
#else | ||
CmdSequencerComponentImpl(void) : | ||
CmdSequencerComponentBase(), | ||
#endif | ||
m_FPrimeSequence(*this), | ||
m_sequence(&this->m_FPrimeSequence), | ||
m_loadCmdCount(0), | ||
|
@@ -38,7 +50,10 @@ namespace Svc { | |
m_executedCount(0), | ||
m_totalExecutedCount(0), | ||
m_sequencesCompletedCount(0), | ||
m_timeout(0) | ||
m_timeout(0), | ||
m_blockState(SEQ_NO_BLOCK), | ||
m_opCode(0), | ||
m_cmdSeq(0) | ||
{ | ||
|
||
} | ||
|
@@ -60,9 +75,9 @@ namespace Svc { | |
|
||
void CmdSequencerComponentImpl :: | ||
allocateBuffer( | ||
const NATIVE_INT_TYPE identifier, | ||
NATIVE_INT_TYPE identifier, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these inputs should remain
Should be:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const updates added. |
||
Fw::MemAllocator& allocator, | ||
const NATIVE_UINT_TYPE bytes | ||
NATIVE_UINT_TYPE bytes | ||
) | ||
{ | ||
this->m_sequence->allocateBuffer(identifier, allocator, bytes); | ||
|
@@ -94,13 +109,18 @@ namespace Svc { | |
void CmdSequencerComponentImpl::CS_RUN_cmdHandler( | ||
FwOpcodeType opCode, | ||
U32 cmdSeq, | ||
const Fw::CmdStringArg& fileName) { | ||
const Fw::CmdStringArg& fileName, | ||
SeqBlkState block) { | ||
|
||
if (not this->requireRunMode(STOPPED)) { | ||
this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); | ||
return; | ||
} | ||
|
||
this->m_blockState = block; | ||
this->m_cmdSeq = cmdSeq; | ||
this->m_opCode = opCode; | ||
|
||
// load commands | ||
if (not this->loadFile(fileName)) { | ||
this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); | ||
|
@@ -115,7 +135,9 @@ namespace Svc { | |
this->performCmd_Step(); | ||
} | ||
|
||
this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_OK); | ||
if (SEQ_NO_BLOCK == this->m_blockState) { | ||
this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_OK); | ||
} | ||
} | ||
|
||
void CmdSequencerComponentImpl::CS_VALIDATE_cmdHandler( | ||
|
@@ -184,6 +206,20 @@ namespace Svc { | |
this->log_ACTIVITY_HI_CS_PortSequenceStarted(this->m_sequence->getLogFileName()); | ||
} | ||
|
||
void CmdSequencerComponentImpl :: | ||
seqCancelIn_handler( | ||
const NATIVE_INT_TYPE portNum | ||
) { | ||
if (RUNNING == this->m_runMode) { | ||
this->performCmd_Cancel(); | ||
this->log_ACTIVITY_HI_CS_SequenceCanceled(this->m_sequence->getLogFileName()); | ||
++this->m_cancelCmdCount; | ||
this->tlmWrite_CS_CancelCommands(this->m_cancelCmdCount); | ||
} else { | ||
this->log_WARNING_LO_CS_NoSequenceActive(); | ||
} | ||
} | ||
|
||
void CmdSequencerComponentImpl::CS_CANCEL_cmdHandler( | ||
FwOpcodeType opCode, U32 cmdSeq) { | ||
if (RUNNING == this->m_runMode) { | ||
|
@@ -230,6 +266,11 @@ namespace Svc { | |
this->seqDone_out(0,0,0,Fw::COMMAND_EXECUTION_ERROR); | ||
} | ||
|
||
if (SEQ_BLOCK == this->m_blockState) { | ||
this->cmdResponse_out(this->m_opCode, this->m_cmdSeq, Fw::COMMAND_EXECUTION_ERROR); | ||
} | ||
|
||
this->m_blockState = SEQ_NO_BLOCK; | ||
} | ||
|
||
void CmdSequencerComponentImpl :: | ||
|
@@ -304,6 +345,8 @@ namespace Svc { | |
this->cmdResponse_out(opcode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR); | ||
return; | ||
} | ||
|
||
this->m_blockState = SEQ_NO_BLOCK; | ||
this->m_runMode = RUNNING; | ||
this->performCmd_Step(); | ||
this->log_ACTIVITY_HI_CS_CmdStarted(this->m_sequence->getLogFileName()); | ||
|
@@ -417,6 +460,13 @@ namespace Svc { | |
if (this->isConnected_seqDone_OutputPort(0)) { | ||
this->seqDone_out(0,0,0,Fw::COMMAND_OK); | ||
} | ||
|
||
if (SEQ_BLOCK == this->m_blockState) { | ||
this->cmdResponse_out(this->m_opCode, this->m_cmdSeq, Fw::COMMAND_OK); | ||
} | ||
|
||
this->m_blockState = SEQ_NO_BLOCK; | ||
|
||
} | ||
|
||
void CmdSequencerComponentImpl::commandComplete(const U32 opcode) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml-model href="../../Autocoders/schema/ISF/command_schema.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?> | ||
|
||
<!--============ CmdSequencer Commands =================================== --> | ||
|
||
<commands> | ||
<command kind="async" opcode="0" mnemonic="CS_RUN"> | ||
<comment>Run a command sequence file</comment> | ||
<args> | ||
<arg type="string" name="fileName" size="240"> | ||
<comment>The name of the sequence file</comment> | ||
</arg> | ||
</args> | ||
</command> | ||
<command kind="async" opcode="0" mnemonic="CS_RUN"> | ||
<comment>Run a command sequence file</comment> | ||
<args> | ||
<arg type="string" name="fileName" size="100"> | ||
<comment>The name of the sequence file</comment> | ||
</arg> | ||
<arg type="ENUM" name="block"> | ||
<comment>Return command status when complete or not</comment> | ||
<enum name="SeqBlkState"> | ||
<item name="SEQ_BLOCK"/> | ||
<item name="SEQ_NO_BLOCK"/> | ||
</enum> | ||
</arg> | ||
</args> | ||
</command> | ||
<command kind="async" opcode="1" mnemonic="CS_VALIDATE"> | ||
<comment>Validate a command sequence file</comment> | ||
<args> | ||
<arg type="string" name="fileName" size="240"> | ||
<arg type="string" name="fileName" size="100"> | ||
<comment>The name of the sequence file</comment> | ||
</arg> | ||
</args> | ||
</command> | ||
<command kind="async" opcode="2" mnemonic="CS_CANCEL"> | ||
<comment>Cancel a command sequence</comment> | ||
</command> | ||
<command kind="async" opcode="3" mnemonic="CS_START"> | ||
<comment>Start running a command sequence</comment> | ||
</command> | ||
<command kind="async" opcode="4" mnemonic="CS_STEP"> | ||
<comment>Perform one step in a command sequence. Valid only if CmdSequencer is in MANUAL run mode.</comment> | ||
</command> | ||
<command kind="async" opcode="5" mnemonic="CS_AUTO"> | ||
<comment>Set the run mode to AUTO.</comment> | ||
</command> | ||
<command kind="async" opcode="6" mnemonic="CS_MANUAL"> | ||
<comment>Set the run mode to MANUAL.</comment> | ||
</command> | ||
<command kind="async" opcode="2" mnemonic="CS_CANCEL"> | ||
<comment>Cancel a command sequence</comment> | ||
</command> | ||
<command kind="async" opcode="3" mnemonic="CS_START"> | ||
<comment>Start running a command sequence</comment> | ||
</command> | ||
<command kind="async" opcode="4" mnemonic="CS_STEP"> | ||
<comment>Perform one step in a command sequence. Valid only if CmdSequencer is in MANUAL run mode.</comment> | ||
</command> | ||
<command kind="async" opcode="5" mnemonic="CS_AUTO"> | ||
<comment>Set the run mode to AUTO.</comment> | ||
</command> | ||
<command kind="async" opcode="6" mnemonic="CS_MANUAL"> | ||
<comment>Set the run mode to MANUAL.</comment> | ||
</command> | ||
</commands> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up headers:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A ton of these updated!