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

Import/tlm packetizer #878

Merged
merged 23 commits into from
Aug 18, 2021
Merged

Import/tlm packetizer #878

merged 23 commits into from
Aug 18, 2021

Conversation

timcanham
Copy link
Collaborator

@timcanham timcanham commented Jul 30, 2021

Originating Project/Creator @timcanham
Affected Component Svc/TlmPacketizer
Affected Architectures(s) All
Related Issue(s)
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 PR contains the Svc/TlmPacketizer component and updates to the autocoder scripts to support generating packet C++ code. It is not the final delivery; there are some dependency issues to sort out, and the packetizer script isn't fully complete. This is meant to deliver the component and scripts to avoid diverging too much.

Rationale

This is a useful alternative to Svc/TlmChan if fixed packets make more sense.

Testing/Review Recommendations

The Ref application is tested to show it runs normally. You can exercise the SET_LEVEL command with a 0 argument and see the LevelSet evr and SendLevel channel.

Future Work

The dependency issues discovered during development need to be fixed, and the full end-to-end testing would need to be completed.

@github-actions
Copy link

github-actions bot commented Jul 30, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • Coverity
  • packetize
  • packetizer
  • Packetizing
  • PTLM
  • schduler
  • TLMPACKETIZER
  • TLMPACKETIZERCOMPONENTIMPLCFG
  • TLMPACKETIZERTYPES
  • vfd
Previously acknowledged words that are now absent FIXME 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 import/TlmPacketizer 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/890129235" > "$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

@lgtm-com
Copy link

lgtm-com bot commented Jul 30, 2021

This pull request introduces 13 alerts when merging b47ef5d into d3fa31c - view on LGTM.com

new alerts:

  • 7 for Testing equality to None
  • 4 for Unused import
  • 2 for Unused local variable

@github-actions
Copy link

github-actions bot commented Jul 30, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • Coverity
  • packetize
  • packetizer
  • Packetizing
  • PTLM
  • schduler
  • TLMPACKETIZER
  • TLMPACKETIZERCOMPONENTIMPLCFG
  • TLMPACKETIZERTYPES
  • vfd
Previously acknowledged words that are now absent FIXME 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 import/TlmPacketizer 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/890173704" > "$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

@github-actions
Copy link

github-actions bot commented Jul 30, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • Coverity
  • packetize
  • packetizer
  • Packetizing
  • PTLM
  • TLMPACKETIZER
  • TLMPACKETIZERCOMPONENTIMPLCFG
  • TLMPACKETIZERTYPES
  • vfd
Previously acknowledged words that are now absent FIXME 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 import/TlmPacketizer 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/890182818" > "$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

@timcanham
Copy link
Collaborator Author

Note: I'll work through the lgtm warnings when I submit the final script.

@timcanham timcanham marked this pull request as ready for review July 30, 2021 22:01
@lgtm-com
Copy link

lgtm-com bot commented Jul 30, 2021

This pull request introduces 13 alerts when merging cfe5980 into d3fa31c - view on LGTM.com

new alerts:

  • 7 for Testing equality to None
  • 4 for Unused import
  • 2 for Unused local variable

@github-actions
Copy link

github-actions bot commented Jul 30, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • Coverity
  • packetize
  • packetizer
  • Packetizing
  • PTLM
  • TLMPACKETIZER
  • TLMPACKETIZERCOMPONENTIMPLCFG
  • TLMPACKETIZERTYPES
  • vfd
Previously acknowledged words that are now absent FIXME 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 import/TlmPacketizer 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/890220347" > "$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

@lgtm-com
Copy link

lgtm-com bot commented Jul 30, 2021

This pull request introduces 13 alerts when merging f4448fd into d3fa31c - view on LGTM.com

new alerts:

  • 7 for Testing equality to None
  • 4 for Unused import
  • 2 for Unused local variable

@github-actions
Copy link

github-actions bot commented Jul 31, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • Coverity
  • packetize
  • packetizer
  • Packetizing
  • PTLM
  • TLMPACKETIZER
  • TLMPACKETIZERCOMPONENTIMPLCFG
  • TLMPACKETIZERTYPES
  • vfd
Previously acknowledged words that are now absent FIXME 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 import/TlmPacketizer 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/890413982" > "$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

@lgtm-com
Copy link

lgtm-com bot commented Jul 31, 2021

This pull request introduces 5 alerts when merging 6c5bfc0 into d3fa31c - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Unused local variable

1 similar comment
@lgtm-com
Copy link

lgtm-com bot commented Jul 31, 2021

This pull request introduces 5 alerts when merging 6c5bfc0 into d3fa31c - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Unused local variable

@github-actions
Copy link

github-actions bot commented Aug 11, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • packetizer
  • TLMPACKETIZER
  • TLMPACKETIZERCOMPONENTIMPLCFG
  • TLMPACKETIZERTYPES
Previously acknowledged words that are now absent FIXME 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 import/TlmPacketizer 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/897032957" > "$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

@lgtm-com
Copy link

lgtm-com bot commented Aug 11, 2021

This pull request introduces 5 alerts when merging 9d728b4 into e7ba8aa - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Unused local variable

@github-actions
Copy link

github-actions bot commented Aug 11, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • packetizer
  • TLMPACKETIZER
  • TLMPACKETIZERCOMPONENTIMPLCFG
  • TLMPACKETIZERTYPES
Previously acknowledged words that are now absent FIXME 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 import/TlmPacketizer 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/897052223" > "$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

@lgtm-com
Copy link

lgtm-com bot commented Aug 11, 2021

This pull request introduces 5 alerts when merging 865517a into e7ba8aa - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Aug 12, 2021

This pull request introduces 5 alerts when merging 5b683d6 into e7ba8aa - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Aug 12, 2021

This pull request introduces 5 alerts when merging 3bf09f8 into e7ba8aa - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Unused local variable

@LeStarch LeStarch merged commit da000c9 into nasa:devel Aug 18, 2021
@timcanham timcanham deleted the import/TlmPacketizer branch August 25, 2021 17:49
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