internal BaseOp[] Decode(byte[] gameBytes) { var list = new List <BaseOp>(); for (int i = 0; i < gameBytes.Length; i++) { var pos = Memory.GameStartAddress + i; var msb = gameBytes[i]; var lsb = gameBytes[++i]; CurrentOp = Convert.ToUInt16((msb << 8) | lsb); var generalOp = (byte)((msb & 0xF0) >> 4); BaseOp op = null; if (generalFunctions.ContainsKey(generalOp)) { op = generalFunctions[generalOp].Invoke(); } else { op = new OpUnknown(CurrentOp); } op.Pos = pos; list.Add(op); } return(list.ToArray()); }
/// <summary> /// 取首结点 /// 默认首结点为完成 /// </summary> /// <param name="main"></param> /// <returns></returns> public Model.Synergismlogdt GetFrist(Model.Synergismlog main, BaseOp op) { Model.Synergismlogdt detail = new U8.Interface.Bus.ApiService.Model.Synergismlogdt(); detail.Cvouchertype = main.Cvouchertype; detail.Ilineno = 1; detail.Id = main.Id.ToString(); detail.Cstatus = ApiService.DAL.Constant.SynergisnLogDT_Cstatus_Complete; return(detail); }
internal BaseOp DecodeOp(byte msb, byte lsb) { CurrentOp = Convert.ToUInt16((msb << 8) | lsb); var generalOp = (byte)((msb & 0xF0) >> 4); BaseOp op = null; if (generalFunctions.ContainsKey(generalOp)) { op = generalFunctions[generalOp].Invoke(); } else { op = new OpUnknown(CurrentOp); } return(op); }
/// <summary> /// 更新任务状态 /// 更新到数据库 /// </summary> /// <param name="dt"></param> /// <returns></returns> public int Update(Model.Synergismlogdt dt, BaseOp op) { return(op.Update(dt)); }
public Model.Synergismlogdt GetPrevious(Model.Synergismlogdt dt, BaseOp op) { return(op.GetPrevious(dt)); }
/// <summary> /// 取下一结点任务 /// </summary> /// <param name="detail"></param> /// <returns></returns> public List <Model.Synergismlogdt> GetNext(Model.Synergismlogdt detail, BaseOp op) { return(op.GetNext(detail)); }
/// <summary> /// 获取上一条 /// </summary> /// <param name="dt"></param> /// <returns></returns> public Model.Synergismlogdt GetModel(string autoid, BaseOp op) { return(op.GetModel(autoid)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(Model.Synergismlog model, BaseOp op) { return(op.Update(model)); }
public int Update(Model.Synergismlog log, BaseOp op) { return(op.Update(log)); }