Ejemplo n.º 1
0
 /// <summary>
 /// 显示日志
 /// </summary>
 /// <param name="e"></param>
 private void ShowTcpLog(CUILogArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <CUILogArgs>(ShowTcpLog), e);
     }
     else
     {
         tcpLog.Log(e.info, e.log, e.save);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 日志提示
 /// </summary>
 /// <param name="e"></param>
 private void ShowLog(CUILogArgs e)
 {
     try
     {
         if (this.InvokeRequired)
         {
             this.Invoke(new Action <CUILogArgs>(ShowLog), e);
         }
         else
         {
             runLog.Log(e.info, e.log, e.save);
         }
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 重启端口连接
        /// </summary>
        private void ResetCom()
        {
            try
            {
                string er = string.Empty;

                if (!comMon.FindPSocId(out er))
                {
                    btnFindId.BackColor = Color.Transparent;

                    comMon.OnConed -= new CPSoC4.EventOnConHander(OnCConArgs);

                    comMon = null;

                    btnCon.Text = "Open";

                    ShowStatus(er, true);

                    return;
                }

                if (!comMon.OpenPSoc(cmbPSoC.Text, out er))
                {
                    ShowStatus(er, true);

                    btnCon.Text = "Open";

                    return;
                }

                if (!comMon.InitialPSoc(para, out er))
                {
                    ShowStatus(er, true);

                    btnCon.Text = "Open";

                    return;
                }
            }
            catch (Exception ex)
            {
                runLog.Log(ex.ToString(), udcRunLog.ELog.Err);
            }
        }