AmmosSource
guix
|
Last change
on this file since 44aebd3 was 1e781ba, checked in by recknagel <recknagel@…>, 3 years ago |
|
former radardex-project
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | class AmmosSingleFrame():
|
|---|
| 2 |
|
|---|
| 3 | def __init__(self, global_frame_header, global_frame_body):
|
|---|
| 4 | self.global_frame_header = global_frame_header
|
|---|
| 5 | self.global_frame_body = global_frame_body
|
|---|
| 6 |
|
|---|
| 7 | def data(self):
|
|---|
| 8 | return self.global_frame_body.data_bytes_only()
|
|---|
| 9 |
|
|---|
| 10 | def size_correct(self):
|
|---|
| 11 | return (self.global_frame_header.frame_length == (24 + self.global_frame_header.data_header_length +
|
|---|
| 12 | (self.global_frame_body.data_header.block_count *
|
|---|
| 13 | (self.global_frame_body.data_header.block_length + 4))))
|
|---|
| 14 | # FIXME: Use str method instead
|
|---|
| 15 |
|
|---|
| 16 | def __str__(self):
|
|---|
| 17 | output = (
|
|---|
| 18 | "Global frame header\n" +
|
|---|
| 19 | "-------------------\n" +
|
|---|
| 20 | "Frame tyoe:" + str(self.global_frame_header.frame_type) + "\n" +
|
|---|
| 21 | "Frame count:" + str(self.global_frame_header.running_frame_number) + "\n" +
|
|---|
| 22 | "Data header length:" + str(self.global_frame_header.data_header_length) + " bytes\n" +
|
|---|
| 23 | "Frame length:" + str(self.global_frame_header.frame_length) + " bytes\n"
|
|---|
| 24 | )
|
|---|
| 25 | return output
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.