Skip to content
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

Merged
merged 12 commits into from
Aug 12, 2021
Merged

Conversation

timcanham
Copy link
Collaborator

Originating Project/Creator Mars Helicopter/@timcanham
Affected Component CmdSequencer
Affected Architectures(s) All
Related Issue(s) #696
Has Unit Tests (y/n) y
Builds Without Errors (y/n) y
Unit Tests Pass (y/n) y
Documentation Included (y/n) y

Change Description

This change brings in improvements from Mars Helicopter that allows invoking a sequence and having the command return immediately and not wait for the sequence to complete.

Rationale

This allows flexibility in how the sequences are started. It allows multiple sequences to run in parallel if there are multiple sequence engines.

Testing/Review Recommendations

Review the updated command logic with the CS_RUN command with the SEQ_BLOCK and SEQ_NO_BLOCK argument options.

Future Work

None

@timcanham timcanham requested a review from LeStarch August 2, 2021 01:34
@timcanham timcanham self-assigned this Aug 2, 2021
@github-actions
Copy link

github-actions bot commented Aug 2, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • commmand
  • Inavalid
Previously acknowledged words that are now absent lxr
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:timcanham/fprime.git repository
on the update/CmdSequencer-Heli branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/nasa/fprime/issues/comments/890648323" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")
  

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  
update_files
rm $comment_body
git add -u

@@ -26,8 +33,13 @@ namespace Svc {
// ----------------------------------------------------------------------

CmdSequencerComponentImpl::
#if FW_OBJECT_NAMES == 1
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, remove those. Also in the header file.

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up headers:

// Copyright (C) 2009-2018 California Institute of Technology.
// ALL RIGHTS RESERVED.  United States Government Sponsorship
// acknowledged.

Copy link
Collaborator Author

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!

@@ -60,9 +75,9 @@ namespace Svc {

void CmdSequencerComponentImpl ::
allocateBuffer(
const NATIVE_INT_TYPE identifier,
NATIVE_INT_TYPE identifier,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these inputs should remain const here like they were before. This affects:

NATIVE_INT_TYPE identifier,
...
NATIVE_UINT_TYPE bytes

Should be:

const NATIVE_INT_TYPE identifier,
...
const NATIVE_UINT_TYPE bytes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const updates added.

@LeStarch LeStarch merged commit a214e6e into nasa:devel Aug 12, 2021
@timcanham timcanham deleted the update/CmdSequencer-Heli branch August 25, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants