using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DBFactory; using System.Net.Sockets; using System.Threading; using System.Linq; using Microsoft.VisualBasic; using System.IO.Ports; using System.Resources; using System.Drawing.Drawing2D; namespace wcfControlMonitorClient { /// /// Creator:Richard.liu /// 调度程序主窗口 /// public partial class FrmControlMonitor : WeifenLuo.WinFormsUI.Docking.DockContent { StringBuilder sql = new StringBuilder(); Model.MDevice devinfo; FrmDeviceStatus _deviceStatus = new FrmDeviceStatus(); DBFactory.DBOperator dbo = CStaticClass.dbo; DBFactory.DBOperator dbo1 = new DBFactory.DBOperator(); private static FrmControlMonitor _formInstance; public static FrmControlMonitor FormInstance { get { if (_formInstance == null) { _formInstance = new FrmControlMonitor(); } return _formInstance; } set { _formInstance = value; } } public FrmControlMonitor() { InitializeComponent(); //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; ////设定字体大小为12px //this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, ((byte)(134))); _formInstance = this; } #region 方法 public void FlashPanit(string obj, bool visible) { this.Controls[obj].Visible = visible; } public void FlashPanit(string obj, Image backgroundImage) { this.Controls[obj].BackgroundImage = backgroundImage; } public void FlashPanit(string obj, ImageLayout backgroundImageLayout) { this.Controls[obj].BackgroundImageLayout = backgroundImageLayout; } public void FlashPanit(string obj, int top, int left) { this.Controls[obj].Top = top; this.Controls[obj].Left = left; } public void FlashPanit(string obj, string text, bool append) { if (append == true) { this.Controls[obj].Text += text; } else { this.Controls[obj].Text = text; } } public string GetObjectText(string obj) { return this.Controls[obj].Text; } public void MonitorRefresh(object dataSource) { #region Added by DingXiaoxu for Dock TaskList on 20101219 FrmTaskList.FormInstance.MonitorRefresh(dataSource); #endregion //this.dgvMonitor.DataSource = dataSource; ////20100108 //dataSource = null; } public void ManagerRefresh(object dataSource) { #region Added by DingXiaoxu for Dock TaskList on 20101219 FrmTaskList.FormInstance.ManagerRefresh(dataSource); #endregion //this.dgvManager.DataSource = dataSource; ////20100108 //dataSource = null; } #endregion protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.ExStyle |= 0x02000000;//WS_CLIPCHILDREN 两个窗体叠加时,重叠部分不重绘 return cp; } } private void timerFlash_Tick(object sender, EventArgs e) { string[] DS; char[] dd = new char[1] { '.' }; Model.MDevice device; TimeSpan ts = DateTime.Now.TimeOfDay; DataView dv; DataView dvJY; this.SuspendLayout(); //richard.liu20140806 try { #region if (CStaticClass.WCFOK == true) { sql.Remove(0, sql.Length);//richard.liu20140806 sql.Append("SELECT F_DeviceIndex FROM T_Base_Device WHERE (F_LockedState = - 1) "); dvJY = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;//richard.liu20140806 dvJY.Sort = "F_DeviceIndex"; //// 成品库堆垛机 Button stackcp1 = this.bzjk3; Button stackcp2 = this.bzjk4; Button stackcp3 = this.bzjk5; //Button stackcp4 = bt11004; //Button stackcp5 = bt11005; //Button stackcp9 = bt11009; //Button stackcp10 = bt11010; //Button stackcp11 = bt11011; //Button stackcp12 = bt11012; ////// 成品堆垛机载物 TextBox twcp1 = this.bzjk3w; TextBox twcp2 = this.bzjk4w; TextBox twcp3 = this.bzjk5w; //TextBox twcp4 = t11004; //TextBox twcp5 = t11005; int smallbarcode = 0; int bigbarcode = 0; int stackInitX = 0; double StackcpInitXX = 0; //Panel pp = plAccessorial1; //Panel pRxkS = RxkPl; double startXadd = 0;//第一列图上坐标 double startDadd = 0;//第一列图上坐标 double kcpX = 0;//图上货架长度/小包货架实际长度 double kcpD = 0;//图上货架长度/吨包货架实际长度 double startcode2 = 0;//第一列对应的实际坐标 if (this.tabControl1.SelectedTab.Name == "tabPage3")// 成品1楼 { //pp = plAccessorial1; kcpX = (double)(pictureBox29.Size.Width) / 16; //图上货架长度/小包货架实际长度55列 kcpD = (double)(pictureBox29.Size.Width) /16;//图上货架长度/吨包实际长度55列 startXadd = 466; startDadd = 466; } #region 每层楼监视画面 #region 设备状态动画 foreach (Button ctrl in ZjkXPl.Controls.OfType