using SlMesDbIterface; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; using System.ComponentModel; using System.Windows.Forms; using DC_A95; using ExternalDataSync; using MainLineRepair; using NPOITest; namespace MesWork { /// /// /// public partial class Temp { } /// /// 事件处理 /// public partial class MesWorkForm { /// /// 打开监控界面 /// /// /// private void label_Monitor_PLC_Click(object sender, EventArgs e) { new OpcForm(IsDemoMesServer).Show(this); } /// /// 关闭按钮 /// /// /// private void label_ExitSys_Click(object sender, EventArgs e) { if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { timer_OnLine_Show.Enabled = false; timer_ShowStation.Enabled = false; CloseDeviceConn(); //StopServer(); LogRecord.LogRecord.Insert_Log(Type_Log.Login, "", "退出MES系统!!!!"); System.Diagnostics.Process.GetCurrentProcess().Kill(); } } private void label_PlanManage_Click(object sender, System.EventArgs e) { var planquery = new PlanExecute_Query.PlanExecute(); planquery.ShowDialog(); } /// /// 鼠标移动 /// /// /// private void C_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if (allowDrag & isMouseDown) { var control = (Control)sender; int left = control.Left + e.X - mouseOffset.X; int top = control.Top + e.Y - mouseOffset.Y; control.Location = new Point(left, top); } } /// /// 打开调试界面 /// /// /// private void label_Test_RW_Click(object sender, EventArgs e) { new F_TestPage().Show(this); } /// /// 打开监控画面 /// /// /// private void Panel_Click(object sender, EventArgs e) { if (MesWorkForm.allowDrag) { return; } var panel = (Panel)sender; var stationName = panel.Tag.ToString(); if (!MesWorkForm.list_OpenForm.Contains(stationName)) { var stationShow = new TagDataEngineStatusShowDialog(stationName); stationShow.Show(this); MesWorkForm.list_OpenForm.Add(stationName); } } /// /// 查看消息提示 /// /// /// private void Panel_MouseHover(object sender, EventArgs e) { var panel = (Panel)sender; new ToolTip().SetToolTip(panel, panel.Tag.ToString()); } /// /// 打开日志 /// /// /// private void btn_QueryLog_Click(object sender, EventArgs e) { new LogRecord.LogRecord(this.Width, this.Height).Show(this); } /// /// 保存布局 /// /// /// private void btn_SaveLyout_Click(object sender, EventArgs e) { FuncOperation.SaveLyout(); } /// /// 打开参数配置 /// /// /// private void label_ParamConfig_Click(object sender, EventArgs e) { new ParamConfigPage().ShowDialog(); } /// /// 按下鼠标 /// /// /// private void C_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left) { mouseOffset.X = e.X; mouseOffset.Y = e.Y; isMouseDown = true; } } /// /// 抬起鼠标 /// /// /// private void C_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left) { isMouseDown = false; } } /// /// 工位管理 /// /// /// private void label_StationManage_Click(object sender, System.EventArgs e) { var dlg = new F_StationManage(); dlg.ShowDialog(); } } }