private void AddOutputArgumentUserControl(string value, string description, string name, TypeInfo typeInfo) { ArgumentUserControl argumentUserControl = new ArgumentUserControl { Dock = DockStyle.Top }; argumentUserControl.Initialise(value, description, name, typeInfo); outputArgumentsPanel.Controls.Add(argumentUserControl); }
private void AddMonitoredVariableUserControl(string value, string description, string name, TypeInfo typeInfo, NodeId nodeId) { ArgumentUserControl argumentUserControl = new ArgumentUserControl { Dock = DockStyle.Top }; argumentUserControl.Initialise(value, description, name, typeInfo); argumentUserControl.Name = nodeId.ToString(); monitoredVariablePanel.Controls.Add(argumentUserControl); }
private void SetOutputArgumentValueForUserControl(List <object> values) { if (values.Count != outputArgumentsPanel.Controls.Count) { return; } for (int index = 0; index < outputArgumentsPanel.Controls.Count; index++) { ArgumentUserControl inputArgumentUserControl = (ArgumentUserControl)outputArgumentsPanel.Controls[index]; inputArgumentUserControl.ValueInput = values[index]; } }
private void MonitoredItemNotification(MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs e) { try { if (!(e.NotificationValue is MonitoredItemNotification monitoredItemNotification)) { return; } for (int index = 0; index < monitoredVariablePanel.Controls.Count; index++) { if (monitoredVariablePanel.Controls[index].Name != monitoredItem.ResolvedNodeId.ToString()) { continue; } ArgumentUserControl argumentUserControl = (ArgumentUserControl)monitoredVariablePanel.Controls[index]; argumentUserControl.ValueInput = monitoredItemNotification.Value.WrappedValue.ToString(); } } catch (Exception ex) { InformationDisplay($"Monitored Item Notification exception: {ex.StackTrace}"); } }