private int MaxDifferenceValue = 5;//穿梭车条码最大误差值。 public override void Initialize(Context context) { OrderIndex = 0; if (dtCarAddress == null) { SysCarAddressDal cad = new SysCarAddressDal(); dtCarAddress = cad.CarAddress(); } if (dtCarOrder == null) { dtCarOrder = new DataTable(); DataColumn dc1 = new DataColumn("CAR_NO", Type.GetType("System.String")); DataColumn dc2 = new DataColumn("State", Type.GetType("System.String")); DataColumn dc3 = new DataColumn("CurStation", Type.GetType("System.Int32")); DataColumn dc4 = new DataColumn("OrderNo", Type.GetType("System.Int32")); DataColumn dc5 = new DataColumn("ToStation", Type.GetType("System.Int32")); DataColumn dc6 = new DataColumn("WriteItem", Type.GetType("System.String")); DataColumn dc7 = new DataColumn("ToStationOrder", Type.GetType("System.Int32")); dtCarOrder.Columns.Add(dc1); dtCarOrder.Columns.Add(dc2); dtCarOrder.Columns.Add(dc3); dtCarOrder.Columns.Add(dc4); dtCarOrder.Columns.Add(dc5); dtCarOrder.Columns.Add(dc6); dtCarOrder.Columns.Add(dc7); } THOK.MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); blnOutOrder = conf.Attributes["IsOutOrder"] == "1" ? true : false; base.Initialize(context); }
//process.Initialize(context);初始化的时候执行 public override void Initialize(Context context) { try { base.Initialize(context); //堆垛机收发报文的错误信息代码 CraneErrMessageDal errDal = new CraneErrMessageDal(); dtErrMesage = errDal.GetErrMessageList(); NCK001 = 100; for (int i = 1; i <= 6; i++) { string CraneNo = i.ToString().PadLeft(2, '0'); if (!dCraneWait.ContainsKey(CraneNo)) { dCraneWait.Add(CraneNo, null); } } THOK.MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); blnOutOrder = conf.Attributes["IsOutOrder"] == "1" ? true : false; } catch (Exception ex) { Logger.Error("THOK.XC.Process.Process_Crane.CraneProcess堆垛机初始化出错,原因:" + ex.Message); } }
//process.Initialize(context);初始化的时候执行 public override void Initialize(Context context) { try { base.Initialize(context); //堆垛机收发报文的错误信息代码 CraneErrMessageDal errDal = new CraneErrMessageDal(); dtErrMesage = errDal.GetErrMessageList(); NCK001 = 100; for (int i = 1; i <= 6; i++) { string CraneNo = i.ToString().PadLeft(2, '0'); if (!dCraneWait.ContainsKey(CraneNo)) { dCraneWait.Add(CraneNo, null); } } THOK.MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); blnOutOrder = conf.Attributes["IsOutOrder"] == "1" ? true : false; } catch (Exception ex) { Logger.Error("THOK.XC.Process.Process_Crane.CraneProcess堆垛机初始化出错,原因:" + ex.Message); } }
public override void Initialize(Context context) { OrderIndex = 0; if (dtCarAddress == null) { SysCarAddressDal cad = new SysCarAddressDal(); dtCarAddress = cad.CarAddress(); } if (dtCarOrder == null) { dtCarOrder = new DataTable(); DataColumn dc1 = new DataColumn("CAR_NO", Type.GetType("System.String")); DataColumn dc2 = new DataColumn("State", Type.GetType("System.String")); DataColumn dc3 = new DataColumn("CurStation", Type.GetType("System.Int32")); DataColumn dc4 = new DataColumn("OrderNo", Type.GetType("System.Int32")); DataColumn dc5 = new DataColumn("ToStation", Type.GetType("System.Int32")); DataColumn dc6 = new DataColumn("WriteItem", Type.GetType("System.String")); DataColumn dc7 = new DataColumn("ToStationOrder", Type.GetType("System.Int32")); dtCarOrder.Columns.Add(dc1); dtCarOrder.Columns.Add(dc2); dtCarOrder.Columns.Add(dc3); dtCarOrder.Columns.Add(dc4); dtCarOrder.Columns.Add(dc5); dtCarOrder.Columns.Add(dc6); dtCarOrder.Columns.Add(dc7); } THOK.MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); blnOutOrder = conf.Attributes["IsOutOrder"] == "1" ? true : false; base.Initialize(context); }
public override void Initialize(Context context) { MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); PortName = conf.Attributes["PortName"]; BaudRate = int.Parse(conf.Attributes["BaudRate"]); base.Initialize(context); }
/// <summary> /// 获取库区编码 /// </summary> /// <returns></returns> public static string GetAreaCode() { MCP.Config.Configuration confg = new MCP.Config.Configuration(); confg.Load("Config.xml"); string AreaCode = confg.Attributes["AreaCode"]; confg.Release(); return(AreaCode); }
public static string GetTaskTest() { MCP.Config.Configuration confg = new MCP.Config.Configuration(); confg.Load("Config.xml"); string TaskTest = confg.Attributes["TaskTest"]; confg.Release(); return(TaskTest); }
public frmCellQuery() { InitializeComponent(); //设置双缓冲 SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); Filter.EnableFilter(dgvMain); pnlData.Visible = true; pnlData.Dock = DockStyle.Fill; pnlChart.Visible = false; pnlChart.Dock = DockStyle.Fill; pnlChart.MouseWheel += new MouseEventHandler(pnlChart_MouseWheel); this.PColor.Visible = false; MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); WarehouseCode = conf.Attributes["WarehouseCode"]; WarehouseFilter = string.Format("CMD_Shelf.WarehouseCode='{0}'", WarehouseCode); if (WarehouseCode == "A") { Rows = 5; Columns = 45; pages = 7; sbShelf.Minimum = 0; sbShelf.Maximum = 210; fontSize = 10; } else if (WarehouseCode == "B") { Rows = 5; Columns = 45; pages = 6; sbShelf.Maximum = 180; fontSize = 10; } else { Rows = 10; Columns = 72; pages = 7; sbShelf.Maximum = 210; fontSize = 8; } }
public static void InitRFID() { MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); string RFIDConnetIP = conf.Attributes["RFIDConnetIP"]; string Antenna = conf.Attributes["Antenna"]; string Q = conf.Attributes["Q"]; string IsLoop = conf.Attributes["IsLoop"]; isTryReconnNet = conf.Attributes["isTryReconnNet"] == "1" ? true : false; tryReconnNetTimeSpan = int.Parse(conf.Attributes["tryReconnNetTimeSpan"]); reader = new IRP1.Reader("Reader1", "TCPIP_Client", RFIDConnetIP); IRP1.Reader.OnApiException += new Core.ApiExceptionHandle(Reader_OnApiException); scanMsg = new IRP1.ReadTag(IRP1.ReadTag.ReadMemoryBank.EPC_TID_UserData_6C); scanMsg.Q = byte.Parse(Q); scanMsg.IsLoop = ((IsLoop == "1") ? true : false); scanMsg.Antenna = byte.Parse(Antenna); }
public override void Initialize(Context context) { try { dtDeviceAlarm = bll.FillDataTable("WCS.SelectDeviceAlarm", new DataParameter[] { new DataParameter("{0}", "Flag=1") }); tmWorkTimer.Interval = 1000; tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker); MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); //WarehouseCode = conf.Attributes["WarehouseCode"]; InTaskCount = int.Parse(conf.Attributes["InTaskCount"]); base.Initialize(context); } catch (Exception ex) { Logger.Error("CraneProcess堆垛机初始化出错,原因:" + ex.Message); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm = new Main(); bool ExisFlag = false; System.Diagnostics.Process currentProccess = System.Diagnostics.Process.GetCurrentProcess(); System.Diagnostics.Process[] currentProccessArray = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Process p in currentProccessArray) { if (p.ProcessName == currentProccess.ProcessName && p.Id != currentProccess.Id) { ExisFlag = true; break; } } if (ExisFlag) { MessageBox.Show("仓储调度监控系统!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { Account.frmLogin myLogin = new Account.frmLogin(); if (myLogin.ShowDialog() == DialogResult.OK) { MCP.Config.Configuration conf = new MCP.Config.Configuration(); conf.Load("Config.xml"); WarehouseCode = conf.Attributes["WarehouseCode"]; WcsUrl = conf.Attributes["WcsUrl"]; SendInterval = int.Parse(conf.Attributes["SendInterval"]); RequireAPReady = int.Parse(conf.Attributes["RequireAPReady"]); Application.Run(mainForm); } } }
private string GetCellEdit() { MCP.Config.Configuration confg = new MCP.Config.Configuration(); confg.Load("Config.xml"); string AreaCode = confg.Attributes["ShowCellEdit"]; confg.Release(); return AreaCode; }