Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 更新任务状态
 /// 更新到数据库
 /// </summary>
 /// <param name="dt"></param>
 /// <returns></returns>
 public int Update(Model.Synergismlogdt dt, BaseOp op)
 {
     return(op.Update(dt));
 }
Exemplo n.º 5
0
 public Model.Synergismlogdt GetPrevious(Model.Synergismlogdt dt, BaseOp op)
 {
     return(op.GetPrevious(dt));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 取下一结点任务
 /// </summary>
 /// <param name="detail"></param>
 /// <returns></returns>
 public List <Model.Synergismlogdt> GetNext(Model.Synergismlogdt detail, BaseOp op)
 {
     return(op.GetNext(detail));
 }
Exemplo n.º 7
0
 /// <summary>
 /// 获取上一条
 /// </summary>
 /// <param name="dt"></param>
 /// <returns></returns>
 public Model.Synergismlogdt GetModel(string autoid, BaseOp op)
 {
     return(op.GetModel(autoid));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public int Update(Model.Synergismlog model, BaseOp op)
 {
     return(op.Update(model));
 }
Exemplo n.º 9
0
 public int Update(Model.Synergismlog log, BaseOp op)
 {
     return(op.Update(log));
 }