protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher) { try { bool needNotify = false; string lineCode = stateItem.ItemName.Split("_"[0])[0]; string channelGroup = stateItem.ItemName.Split("_"[0])[1]; string channelType = stateItem.ItemName.Split("_"[0])[2]; object obj = ObjectUtil.GetObject(stateItem.State); int sortNo = obj != null?Convert.ToInt32(obj) : 0; if (sortNo == 0) { return; } sortNo = sortNo + Convert.ToInt32(Context.Attributes["SupplyAheadCount-" + lineCode + "-" + channelGroup + "-" + channelType]); needNotify = AddNextSupply(lineCode, channelGroup, channelType, sortNo); if (needNotify) { WriteToProcess("LedStateProcess", "Refresh", null); WriteToProcess("ScannerStateProcess", "Refresh", null); dispatcher.WriteToProcess("DataRequestProcess", "SupplyRequest", 1); } } catch (Exception e) { Logger.Error("补货批次生成处理失败,原因:" + e.Message); } }
protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher) { try { bool needNotify = false; switch (stateItem.ItemName) { case "FirstBatch": needNotify = AddFirstSupply(); break; } if (needNotify) { WriteToProcess("LedStateProcess", "Refresh", null); WriteToProcess("ScannerStateProcess", "Refresh", null); dispatcher.WriteToProcess("DataRequestProcess", "SupplyRequest", 1); } } catch (Exception e) { Logger.Error("补货批次生成处理失败,原因:" + e.Message); } }
public void Show(LedItem[] ledItems) { dispatcher.WriteToProcess("LEDProcess", ledCode, ledItems); }