From 34e64b35c6c32b71155dfa0e37681d278f376b41 Mon Sep 17 00:00:00 2001
From: oboulle <olivier.boulle@inria.fr>
Date: Thu, 26 Oct 2023 11:13:34 +0200
Subject: [PATCH] func to set new block size

---
 file_to_dna.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/file_to_dna.py b/file_to_dna.py
index 1d3ac91..c4920ef 100755
--- a/file_to_dna.py
+++ b/file_to_dna.py
@@ -28,11 +28,21 @@ bsaI_size = 7
 extern_extremity_size = primer_size + overhang_size + bsaI_size + buffer_size # size of non-payload dna part at the extern extremities (start of first block and end of last block)
 intern_extremity_size = overhang_size + bsaI_size + buffer_size # size of non-payload dna part at the extremities between blocks
   
-max_total_block_size = 500 # maximum allowed size for a complete block
-min_total_block_size = 500 # minimum allowed size for a complete block
+max_total_block_size = 300 # maximum allowed size for a complete block
+min_total_block_size = 300 # minimum allowed size for a complete block
 n_block_max = 10 # maximum assembled number of blocks
 
 
+
+def set_block_size(new_size: int):
+    """
+    change the value of the blocks size
+    """
+    global max_total_block_size
+    global min_total_block_size
+    max_total_block_size, min_total_block_size = new_size, new_size
+    
+
 def compute_check_sum(binary_string: str) -> str:
     """
     calculate the check_sum binary value associated with the binary string
@@ -111,7 +121,6 @@ def encode_file(input_path: str, output_path: str) -> None:
     objective is to fit the payload in the lowest number of blocks, but all blocks must be the same size after addition of non coding stuff (primer/buffer/overhang/bsaI) 
     """
     
-    #TODO    
     binary_string = convert_file_to_bits(input_path) # get the binary string representing the file content
     #binary_string = input_path #TODO REMOVE
 
-- 
GitLab