public static Configuration.Message AddMessage(string messageName, string canId, Configuration.Node node, Configuration.Bus parentBus) { if (messageName == null) { throw new ArgumentNullException(nameof(messageName)); } if (canId == null) { throw new ArgumentNullException(nameof(canId)); } if (node == null) { throw new ArgumentNullException(nameof(node)); } if (parentBus == null) { throw new ArgumentNullException(nameof(parentBus)); } Configuration.Message message = new Configuration.Message { name = messageName, id = "0x" + CanUtilities.Trim0x(canId) }; NodeRef nodeRef = new NodeRef { id = node.id }; message.Producer.Add(nodeRef); parentBus.Message.Add(message); return(message); }
private TreeNode AddNode(TreeNodeCollection nodes, string nodeName, int nodeType, Configuration.Node node, Configuration.Bus bus, Configuration.Message message, Configuration.Signal signal) { TreeNode newTreeNode = nodes.Add(nodeName); CanTreeTag newTreeTag = new CanTreeTag { NodeType = nodeType, Bus = bus, Node = node, Message = message, Signal = signal }; newTreeNode.Tag = newTreeTag; int imageIndex = 0; switch (nodeType) { case CanTreeTag.BUS: imageIndex = 0; break; case CanTreeTag.NODE: imageIndex = 1; break; case CanTreeTag.MESSAGE: imageIndex = 2; newTreeNode.ToolTipText = "(" + message.id + ")"; break; case CanTreeTag.SIGNAL: imageIndex = 3; newTreeNode.ToolTipText = "(" + message.id + "): Offset:" + signal.offset + " Length: " + signal.length; break; } newTreeNode.ImageIndex = imageIndex; newTreeNode.SelectedImageIndex = imageIndex; return(newTreeNode); }
public Configuration.Message AddMessage(string messageName, string canId, Configuration.Node node, Configuration.Bus parentBus) { Configuration.Message message = new Configuration.Message { name = messageName, id = "0x" + MyExtensions.Trim0x(canId) }; NodeRef nodeRef = new NodeRef { id = node.id }; message.Producer.Add(nodeRef); parentBus.Message.Add(message); return(message); }