Beispiel #1
0
 public void removeBeckhoffDisplay()
 {
     DisplayFolder.BeckhoffDisplay BeckhoffDisplay2Del = Grid1.FindName("BeckhoffDisplay") as DisplayFolder.BeckhoffDisplay;
     //BeckhoffDisplay2Del.stopThread();
     Grid1.Children.Remove(BeckhoffDisplay2Del);
     Grid1.UnregisterName(BeckhoffDisplay2Del.Name);
 }
Beispiel #2
0
 private void destroyBeckhoffDisplay()
 {
     DisplayFolder.BeckhoffDisplay BeckhoffDisplay2Del = Grid1.FindName("BeckhoffDisplay") as DisplayFolder.BeckhoffDisplay;
     if (BeckhoffDisplay2Del != null)
     {
         BeckhoffDisplay2Del.exitControl();
     }
 }
Beispiel #3
0
        private void showBeckhoffDisplay()
        {
            opcRealated.opcUA.opcUAServer curServer = connectBeckhoff();
            m_Server = curServer;
            DisplayFolder.BeckhoffDisplay newBeckhoffDisplay;

            if (curServer != null)
            {
                newBeckhoffDisplay      = new DisplayFolder.BeckhoffDisplay(curServer);
                newBeckhoffDisplay.Name = "BeckhoffDisplay";

                newBeckhoffDisplay.Width  = 900;
                newBeckhoffDisplay.Height = 660;

                newBeckhoffDisplay.HorizontalAlignment = HorizontalAlignment.Center;
                newBeckhoffDisplay.VerticalAlignment   = VerticalAlignment.Center;
                Grid1.Children.Add(newBeckhoffDisplay);
                Grid1.RegisterName(newBeckhoffDisplay.Name, newBeckhoffDisplay);
                newBeckhoffDisplay.SetValue(Grid.RowSpanProperty, 2);
            }
            else
            {
                MessageBox.Show("无法连接OPC UA服务器", "警告", MessageBoxButton.OK, MessageBoxImage.Warning);
                newBeckhoffDisplay      = new DisplayFolder.BeckhoffDisplay();
                newBeckhoffDisplay.Name = "BeckhoffDisplay";

                newBeckhoffDisplay.Width  = 900;
                newBeckhoffDisplay.Height = 660;

                newBeckhoffDisplay.HorizontalAlignment = HorizontalAlignment.Center;
                newBeckhoffDisplay.VerticalAlignment   = VerticalAlignment.Center;
                Grid1.Children.Add(newBeckhoffDisplay);
                Grid1.RegisterName(newBeckhoffDisplay.Name, newBeckhoffDisplay);
                newBeckhoffDisplay.SetValue(Grid.RowSpanProperty, 2);
            }
        }