Exemplo n.º 1
0
        public NetworkSignalForm(Configuration.Signal signal)
        {
            InitializeComponent();
            InitialiseCombo();

            this.signal = signal;

            SignalNameTextBox.Text       = signal.name;
            OffsetComboBox.SelectedIndex = OffsetComboBox.FindStringExact(signal.offset);
            int length = Int32.Parse(signal.length);

            SetTypeCombox(signal.Value.type, length);
        }
Exemplo n.º 2
0
        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);
        }