+
+ if trigger_id == "btn-ctrl-add":
+ # Add selected test to the list of tests in store:
+ if phy and area and test and cores and framesizes and testtypes:
+
+ # TODO: Add validation
+
+ if store_sel is None:
+ store_sel = list()
+
+ for core in cores:
+ for framesize in framesizes:
+ for ttype in testtypes:
+ tid = (
+ f"{phy.replace('af_xdp', 'af-xdp')}-"
+ f"{area}-"
+ f"{framesize.lower()}-"
+ f"{core.lower()}-"
+ f"{test}-"
+ f"{ttype.lower()}"
+ )
+ if tid not in [itm["id"] for itm in store_sel]:
+ store_sel.append({
+ "id": tid,
+ "phy": phy,
+ "area": area,
+ "test": test,
+ "framesize": framesize.lower(),
+ "core": core.lower(),
+ "testtype": ttype.lower()
+ })
+ return (no_update, store_sel, _list_tests(), None,
+ None, None, no_update)
+
+ elif trigger_id in ("btn-sel-display", "dpr-period"):
+ fig, style = trending_tput(
+ self.data, store_sel, self.layout, d_start, d_end
+ )
+ return (fig, no_update, no_update,
+ no_update, no_update, no_update, style)
+
+ elif trigger_id == "btn-sel-remove":
+ if list_sel:
+ new_store_sel = list()
+ for item in store_sel:
+ if item["id"] not in list_sel:
+ new_store_sel.append(item)
+ store_sel = new_store_sel
+ if store_sel:
+ fig, style = trending_tput(
+ self.data, store_sel, self.layout, d_start, d_end
+ )
+ return (fig, store_sel, _list_tests(),
+ no_update, no_update, no_update, style)
+ else:
+ style={
+ "vertical-align": "top",
+ "display": "none",
+ "width": "80%",
+ "padding": "5px"
+ }
+ return (no_update, store_sel, _list_tests(),
+ no_update, no_update, no_update, style)