Package org.bidib.wizard.utils
Class NodeUtils
java.lang.Object
org.bidib.wizard.utils.NodeUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddImportError(Map<String, Object> params, String message) static org.bidib.wizard.api.model.NodeInterfaceconfigureFromBiDiB(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, CvDefinitionTreeModelRegistry cvDefinitionTreeModelRegistry, org.bidib.wizard.api.model.NodeInterface node, Map<String, Object> importParams, org.bidib.jbidibc.core.schema.bidib2.BiDiB bidib, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper, boolean restoreCVs, boolean restoreFeatures, boolean restoreNodeString, boolean restoreMacroContent, boolean restoreAccessoryContent) Configure the node from the provided BiDiB data.static org.bidib.jbidibc.core.schema.bidib2.BiDiBconvertToBiDiB(org.bidib.wizard.api.model.NodeInterface node, Map<String, CvNode> cvNumberToNodeMap, String lang, boolean skipCvValues, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper) Convert the node to BiDiB data.static StringfindFirmwareReleaseOfBackup(org.bidib.jbidibc.core.schema.bidib2.BiDiB bidib) Find the firmware release version of the backup.static org.bidib.wizard.api.model.NodeInterfacefindNodeByUuid(Iterable<org.bidib.wizard.api.model.NodeInterface> nodes, long uuid) Find a node by its node uuid in the provided list of nodes.static CvDefinitionTreeTableModelgetCvDefinitionTreeTableModel(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.context.ApplicationContext context) getCvNumberToNodeMap(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.context.ApplicationContext context) static <P extends org.bidib.wizard.model.ports.Port<?>>
PgetPort(List<P> ports, int portNumber, boolean sourceIsFlatPortModel, boolean targetIsFlatPortModel) static voidloadDataFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, boolean loadMacroContent, boolean loadCvs) Load data from node.static org.bidib.wizard.api.model.MacroloadMacroContentFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.model.Macro macro) static StringprepareLabel(org.bidib.wizard.api.model.NodeInterface node) Prepare the node label based on the user string with fallback to node.toString().static voidsetCurrentPortType(org.bidib.wizard.model.ports.GenericPort genericPort, org.bidib.jbidibc.messages.enums.LcOutputType portType)
-
Field Details
-
IMPORT_ERRORS
- See Also:
-
-
Constructor Details
-
NodeUtils
public NodeUtils()
-
-
Method Details
-
findNodeByUuid
public static org.bidib.wizard.api.model.NodeInterface findNodeByUuid(Iterable<org.bidib.wizard.api.model.NodeInterface> nodes, long uuid) Find a node by its node uuid in the provided list of nodes.- Parameters:
nodes- the list of nodesuuid- the uuid of the node to find- Returns:
- the found node or
nullif no node was found with the provided node uuid
-
prepareLabel
Prepare the node label based on the user string with fallback to node.toString().- Parameters:
node- the node- Returns:
- the node label
-
findFirmwareReleaseOfBackup
Find the firmware release version of the backup.- Parameters:
bidib- the bidib instance- Returns:
- the firmware release version or
nullif not available
-
configureFromBiDiB
public static org.bidib.wizard.api.model.NodeInterface configureFromBiDiB(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, CvDefinitionTreeModelRegistry cvDefinitionTreeModelRegistry, org.bidib.wizard.api.model.NodeInterface node, Map<String, Object> importParams, org.bidib.jbidibc.core.schema.bidib2.BiDiB bidib, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper, boolean restoreCVs, boolean restoreFeatures, boolean restoreNodeString, boolean restoreMacroContent, boolean restoreAccessoryContent) Configure the node from the provided BiDiB data.- Parameters:
node- the nodebidib- the BiDiB data- Returns:
- the configured node
-
setCurrentPortType
public static void setCurrentPortType(org.bidib.wizard.model.ports.GenericPort genericPort, org.bidib.jbidibc.messages.enums.LcOutputType portType) -
addImportError
-
convertToBiDiB
public static org.bidib.jbidibc.core.schema.bidib2.BiDiB convertToBiDiB(org.bidib.wizard.api.model.NodeInterface node, Map<String, CvNode> cvNumberToNodeMap, String lang, boolean skipCvValues, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper) Convert the node to BiDiB data.- Parameters:
node- the node- Returns:
- the BiDiB data
-
getPort
public static <P extends org.bidib.wizard.model.ports.Port<?>> P getPort(List<P> ports, int portNumber, boolean sourceIsFlatPortModel, boolean targetIsFlatPortModel) -
getCvNumberToNodeMap
-
getCvDefinitionTreeTableModel
public static CvDefinitionTreeTableModel getCvDefinitionTreeTableModel(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.context.ApplicationContext context) -
loadDataFromNode
public static void loadDataFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, boolean loadMacroContent, boolean loadCvs) Load data from node.- Parameters:
connectionId- the connection idnodeService- the node serviceswitchingNodeService- the switching node servicenode- the nodeloadMacroContent- load macro content from nodeloadCvs- load CVs from node
-
loadMacroContentFromNode
public static org.bidib.wizard.api.model.Macro loadMacroContentFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.model.Macro macro)
-