private void ListFeedbackConnections() { InputEditorControl control; FeedbackDecoderConnection connection; if (!this.Element.Properties.IsFeedback || this.Element.Properties.NumberOfFeedbackConnections <= 0) { tabFeedbackConnections.PageVisible = false; return; } // Create connection controls for (int i = 1; i <= this.Element.Properties.NumberOfFeedbackConnections; i++) { connection = FeedbackDecoderConnection.GetByIndex(this.Element, i); if (connection != null) { control = new InputEditorControl(connection); } else { control = new InputEditorControl(this.Element); } control.ConnectionIndex = i; control.Text = string.Format("Sensor connection {0}", i); control.Dock = DockStyle.Top; tabFeedbackConnections.Controls.Add(control); control.BringToFront(); } }
private void ListInputs() { InputEditorControl connection; if (!this.Element.Properties.IsFeedback) { tabBlockInputs.PageVisible = false; return; } // Get element inputs this.Element.FeedbackConnections = OTCContext.Project.GetDeviceConnections(this.Element, Device.DeviceType.SensorModule); // Create connection controls for (int i = 0; i < this.Element.FeedbackConnections.Length; i++) { if (this.Element.FeedbackConnections[i] != null) { connection = new InputEditorControl(this.Element.FeedbackConnections[i]); } else { connection = new InputEditorControl(this.Element); } connection.ConnectionIndex = i + 1; connection.Text = string.Format("Sensor connection {0}", i + 1); connection.Dock = System.Windows.Forms.DockStyle.Top; tabBlockInputs.Controls.Add(connection); connection.BringToFront(); } }