Commit 2c8ba0ff authored by Flavio TARSETTI's avatar Flavio TARSETTI

[widgets][toolchaineditor] add schema_version on loop/patch channel_colors

parent 7295763e
...@@ -1535,8 +1535,6 @@ class Toolchain(QWidget): ...@@ -1535,8 +1535,6 @@ class Toolchain(QWidget):
new_block_name = init_name + "_" + str(init_name_count) new_block_name = init_name + "_" + str(init_name_count)
block_item["name"] = new_block_name block_item["name"] = new_block_name
self.web_representation["channel_colors"][new_block_name] = "#000000"
block = Block( block = Block(
BlockType.LOOPS.name, self.block_config, self.connection_config BlockType.LOOPS.name, self.block_config, self.connection_config
) )
...@@ -1626,7 +1624,8 @@ class Toolchain(QWidget): ...@@ -1626,7 +1624,8 @@ class Toolchain(QWidget):
new_block_name = init_name + "_" + str(init_name_count) new_block_name = init_name + "_" + str(init_name_count)
block_item["name"] = new_block_name block_item["name"] = new_block_name
self.web_representation["channel_colors"][new_block_name] = "#000000" if block_type == BlockType.DATASETS.name:
self.web_representation["channel_colors"][new_block_name] = "#000000"
block = Block(block_type, self.block_config, self.connection_config) block = Block(block_type, self.block_config, self.connection_config)
block.load(self, block_item) block.load(self, block_item)
...@@ -1738,6 +1737,8 @@ class Toolchain(QWidget): ...@@ -1738,6 +1737,8 @@ class Toolchain(QWidget):
if self.web_representation is not None: if self.web_representation is not None:
data["representation"] = self.web_representation data["representation"] = self.web_representation
has_loops = False
for block_type in BlockType: for block_type in BlockType:
block_type_list = [] block_type_list = []
for block in self.blocks: for block in self.blocks:
...@@ -1751,6 +1752,7 @@ class Toolchain(QWidget): ...@@ -1751,6 +1752,7 @@ class Toolchain(QWidget):
block_data["evaluator_inputs"] = block.evaluator_inputs block_data["evaluator_inputs"] = block.evaluator_inputs
block_data["processor_outputs"] = block.processor_outputs block_data["processor_outputs"] = block.processor_outputs
block_data["evaluator_outputs"] = block.evaluator_outputs block_data["evaluator_outputs"] = block.evaluator_outputs
has_loops = True
else: else:
if block.inputs is not None: if block.inputs is not None:
block_data["inputs"] = block.inputs block_data["inputs"] = block.inputs
...@@ -1780,6 +1782,9 @@ class Toolchain(QWidget): ...@@ -1780,6 +1782,9 @@ class Toolchain(QWidget):
data["connections"] = connection_list data["connections"] = connection_list
if has_loops:
data["schema_version"] = 2
return data return data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment