Ejemplo n.º 1
0
        private void tsmpMenu_Click(object sender, EventArgs e)
        {
            try
            {
                ToolStripMenuItem tsmp = sender as ToolStripMenuItem;
                if (mesServer == null)
                {
                    return;
                }
                IPEndPoint EndPoint = mesServer.Listeners[0].EndPoint;

                Frm_Msg frm = new Frm_Msg();
                frm.Text        = $"{ mesServer.Listeners[0].EndPoint} <<-- {tsmp.Text}";
                frm.txtMsg.Text = tsmp.Tag.ToString();
                frm.EndPoint    = EndPoint;
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageUtilSkin.ShowTips(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void btnOpenFile_Click(object sender, EventArgs e)
        {
            string filePath = string.Empty;

            switch (tabControlLogType.SelectedIndex)
            {
            case 0:
                filePath = $@"{DirectoryUtil.GetCurrentDirectory()}\Logs\Data_{ DateTime.Now.ToString("yyyy-MM-dd")}.log";
                break;

            case 1:
                filePath = $@"{DirectoryUtil.GetCurrentDirectory()}\Logs\Heart_{ DateTime.Now.ToString("yyyy-MM-dd")}.log";
                break;
            }


            if (FileUtil.FileIsExist(filePath))
            {
                Process.Start("notepad++.exe", filePath);
            }
            else
            {
                MessageUtilSkin.ShowTips($"不存在文件:{filePath}");
            }
        }
Ejemplo n.º 3
0
        private void tsmItemDoc_Click(object sender, EventArgs e)
        {
            string filePath = $@"{DirectoryUtil.GetCurrentDirectory()}\Docs\MES&PLC通讯系统使用说明书.pdf";

            if (FileUtil.FileIsExist(filePath))
            {
                try
                {
                    Process.Start("FoxitReader.exe", filePath);
                }
                catch (Exception)
                {
                    Process.Start(filePath);
                }
            }
            else
            {
                MessageUtilSkin.ShowTips($"不存在文件:{filePath}");
            }
        }
Ejemplo n.º 4
0
        private void pOPStartServerBackWork()
        {
            LoadFinish = false;
            if (m_Bootstrap == null)
            {
                MessageUtilSkin.ShowTips("数据服务器配置加载错误,请检查服务器IP,端口是否设置正确。");
                return;
            }

            StartResult startResult = m_Bootstrap.Start();

            if (startResult == StartResult.Success)
            {
                mesServer = m_Bootstrap.AppServers.Cast <MesServer>().FirstOrDefault();
            }
            else
            {
                mesServer = null;
            }
        }
Ejemplo n.º 5
0
        private void lnkClient_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            META_DevLinkInfo info = BLLFactory <META_DevLink> .Instance.FindSingle($"DevCode='OP010'");

            //测试
            META_ParameterInfo info2 = BLLFactory <META_Parameter> .Instance.FindSingle($"Key='WorkOrder'");

            info2.Value = "TEST002";
            BLLFactory <META_Parameter> .Instance.Update(info2, info2.ID);


            info2 = BLLFactory <META_Parameter> .Instance.FindSingle($"Key='OK_RE'");

            try
            {
                if (mesServer == null)
                {
                    MessageUtilSkin.ShowTips("请启动数据服务器.");
                    return;
                }
                TabControl1.SelectedIndex = 1;
                IPEndPoint EndPoint = mesServer.Listeners[0].EndPoint;

                Frm_Msg frm = new Frm_Msg();
                frm.Text        = $"{ EndPoint.Address}";
                frm.txtMsg.Text = string.Empty;
                frm.EndPoint    = EndPoint;
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageUtilSkin.ShowTips(ex.Message);
            }
        }