Skip to content

Commit 28c2c13

Browse files
authored
Add --file-uplink-chunk-size argument (#273)
1 parent b230d9c commit 28c2c13

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/fprime_gds/common/pipeline/files.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self):
2525
self.__downlinker = None
2626

2727
def setup_file_handling(
28-
self, down_store, file_encoder, file_decoder, distributor, log_dir, cooldown=0.5
28+
self, down_store, file_encoder, file_decoder, distributor, log_dir, cooldown=0.5, chunk=256,
2929
):
3030
"""
3131
Sets up the file handling (uplink and downlink) from a pair of encoders and decoders.
@@ -37,8 +37,9 @@ def setup_file_handling(
3737
:param distributor: data distributor to register handshaking to
3838
:param log_dir: log directory to output downlink logs
3939
:param cooldown: cooldown period between uplink packets
40+
:param chunk: size of the data payload for a file uplink
4041
"""
41-
self.__uplinker = fprime_gds.common.files.uplinker.FileUplinker(file_encoder, cooldown=cooldown)
42+
self.__uplinker = fprime_gds.common.files.uplinker.FileUplinker(file_encoder, cooldown=cooldown, chunk=chunk)
4243
self.__downlinker = fprime_gds.common.files.downlinker.FileDownlinker(
4344
down_store, log_dir=log_dir
4445
)

src/fprime_gds/common/pipeline/standard.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def setup(
6363
logging_prefix=None,
6464
data_logging_enabled=True,
6565
cooldown=0.5,
66+
chunk=256,
6667
):
6768
"""
6869
Setup the standard pipeline for moving data from the middleware layer through the GDS layers using the standard
@@ -74,6 +75,7 @@ def setup(
7475
:param logging_prefix: logging prefix. Defaults to not logging at all.
7576
:param packet_spec: location of packetized telemetry XML specification.
7677
:param cooldown: cooldown period between file uplink packets
78+
:param chunk: size of the data payload for a file uplink
7779
"""
7880
self.distributor = fprime_gds.common.distributor.distributor.Distributor()
7981
self.client_socket = self.__transport_type()
@@ -99,6 +101,7 @@ def setup(
99101
self.distributor,
100102
logging_prefix,
101103
cooldown=cooldown,
104+
chunk=chunk,
102105
)
103106
# Register distributor to client socket
104107
self.client_socket.register(self.distributor)

src/fprime_gds/executables/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,14 @@ def get_arguments(self) -> Dict[Tuple[str, ...], Dict[str, Any]]:
10911091
"type": float,
10921092
"help": "Cooldown period between file uplink packets. Default: %(default)s S",
10931093
},
1094+
("--file-uplink-chunk-size",): {
1095+
"dest": "file_uplink_chunk_size",
1096+
"action": "store",
1097+
"default": 256,
1098+
"required": False,
1099+
"type": int,
1100+
"help": "Size of the data payload for a file uplink. Default: %(default)s",
1101+
},
10941102
}
10951103

10961104
def handle_arguments(self, args, **kwargs):
@@ -1130,6 +1138,7 @@ def pipeline_factory(args_ns, pipeline=None) -> StandardPipeline:
11301138
"logging_prefix": args_ns.logs,
11311139
"data_logging_enabled": not args_ns.disable_data_logging,
11321140
"cooldown": args_ns.file_uplink_cooldown,
1141+
"chunk": args_ns.file_uplink_chunk_size,
11331142
}
11341143
pipeline = pipeline if pipeline else StandardPipeline()
11351144
pipeline.transport_implementation = args_ns.connection_transport

0 commit comments

Comments
 (0)