Commit 8cb44c9d authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][toolchaineditor] Use instance of ExperimentResource and implement refresh

parent c620eef3
......@@ -71,6 +71,7 @@ from ..backend.asset import AssetType
from ..backend.assetmodel import AssetModel
from ..backend.resourcemodels import AlgorithmResourceModel
from ..backend.resourcemodels import DatasetResourceModel
from ..backend.resourcemodels import experiment_resources
from ..decorators import frozen
from .editor import AbstractAssetEditor
from .toolchainscene import ToolchainScene
......@@ -1854,10 +1855,13 @@ class ToolchainEditor(AbstractAssetEditor):
self.autonomous_loop_evaluator_list = []
self.toolchain.dataChanged.connect(self.dataChanged)
self.contextChanged.connect(self.__onContextChanged)
self.contextChanged.connect(self.__reloadData)
@pyqtSlot()
def __onContextChanged(self):
def __reloadData(self):
# ensure the experiments related data are up to date
experiment_resources.refresh()
algorithm_model = AlgorithmResourceModel()
algorithm_model.setAnalyzerEnabled(False)
algorithm_model.setTypes([Algorithm.SEQUENTIAL, Algorithm.AUTONOMOUS])
......@@ -1913,6 +1917,17 @@ class ToolchainEditor(AbstractAssetEditor):
self.analyzer_list,
)
def refresh(self):
"""Reimpl"""
super().refresh()
self.__reloadData()
def _asset_models(self):
"""Returns a list of all asset models used"""
return [self.toolchain_model]
def _load_json(self, json_object):
"""Load the json object passed as parameter"""
......
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