private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            myScan.ini("COM7");
            AddMessage("软件加载完成");
            string openimgrst = Camera.OpenCamera("[0] Integrated Camera", "DirectShow") ? "相机打开成功" : "相机打开失败";

            AddMessage(openimgrst);
            Run();
            UpdateUI();
        }
        private void AppLoadedEventCommandExecute()
        {
            //throw new NotImplementedException();
            plc.Start();
            bool rst = cam1.OpenCamera("CAM01", "GigEVision");

            if (rst)
            {
                addMessage("相机打开成功");
            }
            else
            {
                addMessage("相机打开失败");
            }
            run();
        }
 private void AppLoadedEventCommandExecute()
 {
     AddMessage("软件加载完成");
     try
     {
         Mysql mysql = new Mysql();
         if (mysql.Connect())
         {
             string  stm = $"SELECT NOW()";
             DataSet ds  = mysql.Select(stm);
             AddMessage($"数据库连接成功{ ds.Tables["table0"].Rows[0][0]}");
             StatusDataBase = true;
         }
         else
         {
             AddMessage("数据库未连接");
             StatusDataBase = false;
         }
         mysql.DisConnect();
     }
     catch (Exception ex)
     {
         AddMessage($"数据库连接失败{ex.Message}");
         StatusDataBase = false;
     }
     #region 初始化相机
     if (mycam.OpenCamera(cameraName, cameraInterface))
     {
         AddMessage("相机打开成功");
     }
     else
     {
         AddMessage("相机打开失败");
     }
     #endregion
     tcpNet.StartTCPConnect();
     Run();
 }