public void KepWriteStatus(ParamClass pc, ParamClass.ParamEnum pe) { PC = pc; PE = pe; Start_Event(this, null); _status = 0; tTimer.Start(); }
//执行入口 public void Excute(ParamClass pc, string potCode, string matCode, decimal targetQuantity) { CurrentDsMaterial = new DsMaterial(); CurrentDsMaterial.MaterialId = Golbal.WaterModel.Id.ToString(); CurrentDsMaterial.MaterialCode = Golbal.WaterModel.Code; CurrentDsMaterial.MaterialName = Golbal.WaterModel.Name; CurrentDsMaterial.MaterialQuantity = targetQuantity; CurrentDsMaterial.Unit = Golbal.WaterModel.Unit; CurrentDsMaterial.Price = Golbal.WaterModel.Price.Value; pc.FucEndWater(potCode, matCode, targetQuantity); base.KepWriteStatus(pc, ParamClass.ParamEnum.助剂配送状态); }
//配方结束 public void FormulaEnd(ParamClass pc) { pc.OpcSyncWrite(ParamClass.ParamEnum.配方状态, "1"); Thread.Sleep(500); if (pc.配方状态 == "1") { End_Event(this, null); } else { FormulaEnd(pc); } }
private static List <object> ToArray(ParamClass paramClass) { var result = new List <object>(); if (paramClass.Entries.Count == 1) { return(result); } var content = (ParamClass)paramClass.Entries[1]; foreach (var entry in content.Entries.OfType <ParamClass>()) { var entryData = (ParamClass)entry.Entries[0]; if (entryData.Entries[0] is ParamValue) { result.Add(null); } else { var type = ((ParamArray)((ParamClass)entryData.Entries[0]).Entries[0]).Array.Entries[0].Value as string; switch (type) { case "ARRAY": result.Add(ToArray(entryData)); break; case "STRING": result.Add((string)((ParamValue)entryData.Entries[1]).Value.Value); break; case "SCALAR": result.Add((float)((ParamValue)entryData.Entries[1]).Value.Value); break; case "BOOL": result.Add(((int)((ParamValue)entryData.Entries[1]).Value.Value) != 0); break; case "NOTHING": result.Add(null); break; default: break; } } } return(result); }
public event EventHandler End_Event; //结束事件 //配方开始 public void FormulaStart(ParamClass pc) { pc.OpcSyncWrite(ParamClass.ParamEnum.水洗配方状态, "0"); Thread.Sleep(100); if (pc.水洗配方状态 == "0") { Start_Event(this, null); } else { FormulaStart(pc); } }
//执行入口 public void Excute(ParamClass pc, string potCode, decimal targetQuantity) { CurrentDsMaterial = new DsMaterial(); CurrentDsMaterial.MaterialId = Golbal.WaterModel.Id.ToString(); CurrentDsMaterial.MaterialCode = Golbal.WaterModel.Code; CurrentDsMaterial.MaterialName = Golbal.WaterModel.Name; CurrentDsMaterial.MaterialQuantity = targetQuantity; CurrentDsMaterial.Unit = Golbal.WaterModel.Unit; CurrentDsMaterial.Price = Golbal.WaterModel.Price.Value; pc.FucWaterDS(potCode, targetQuantity); base.KepWriteStatus(pc, ParamClass.ParamEnum.机台放水状态); TargetQuantity = targetQuantity; IsPercent = false; tTimer.Start(); }
public override int AddItem(ParamClass val) { return(3); }
public abstract int AddItem(ParamClass val);
private int MethodStandard(ParamClass value) { return(value.RequiredKeySizeInBytes + 2); }
//执行入口 public void Excute(ParamClass pc, string potCode, DsMaterial dsMaterial) { CurrentDsMaterial = dsMaterial; pc.FucMaterialDS(potCode, CurrentDsMaterial.MaterialCode, CurrentDsMaterial.MaterialQuantity); base.KepWriteStatus(pc, ParamClass.ParamEnum.助剂配送状态); }
/// <summary> /// Constructor /// </summary> /// <param name="iInputs">Number of input streams</param> /// <param name="iOutputs">Number of output streams</param> /// <param name="iParams">Number of parameters</param> /// <param name="iTimeFormats">What time formats the parameters support</param> /// <remarks> /// This constructor will be called from the constructor of the class that implements /// IMediaObjectImpl. See <see cref="IMediaObjectImpl"/> for a step by step description /// of the process. /// </remarks> protected IMediaObjectImpl(int iInputs, int iOutputs, int iParams, TimeFormatFlags iTimeFormats) { iInstanceCount++; m_Log = new Logging(iInstanceCount); m_Log.Write("-------------------------------\r\n"); m_Log.Write(string.Format("bConstructor {0}\r\n", iInstanceCount)); m_NumInputs = iInputs; m_NumOutputs = iOutputs; m_fTypesSet = false; m_fFlushed = true; m_fResourcesAllocated = false; m_InputInfo = new PinDef[m_NumInputs]; m_OutputInfo = new PinDef[m_NumOutputs]; // Protect ourselves from incorrectly written children m_Params = new ParamClass(iParams, iTimeFormats); }
public override int AddItem (ParamClass val) { return 3; }
public abstract int AddItem (ParamClass val);