public override DbCaches.Entities.BYDQBaseEntity CreatEntity(BaseEntity baseEntity) { var protocol = baseEntity as RemoteDebugUP; var entity = new RemoteDebugUPEntity(); entity.Encryption = protocol.Encryption; entity.Type = protocol.Type; entity.CMD = protocol.CMD; entity.FunctionNumber = (int)protocol.FunctionCode; entity.ResponseSign = protocol.ResponseSign; entity.FunctionStatus = protocol.FunctionStatus; entity.UniqueIdentity = protocol.UniqueIdentity; entity.ProductType = protocol.ProductType; entity.CloudProductCode = protocol.CloudProductCode; entity.TimeStamp = protocol.TimeStamp.ToString(); entity.Time = BytesExtend.ConvertLongToDateTime(long.Parse(protocol.TimeStamp.ToString())); entity.UUID = protocol.UUID; entity.CNT = (int)protocol.CNT; entity.SEQ = (int)protocol.SEQ; entity.DiagnosticResult = (int)protocol.DiagnosticResult; entity.DiagnosticData = ProtoBufSerialize.Serialize(protocol.DataUnitList);//JsonConvert.SerializeObject(protocol.DataUnitList); var strBase64 = protocol.DataUnitList.Aggregate(string.Empty, (current, diagnosticDataUp) => current + (ToHex(diagnosticDataUp.SIDDiagnosticResult) + ",")); entity.DiagnosticDataToHex = strBase64.Substring(0, strBase64.Length - 1); return(entity); }
/// <summary> /// 生成数据库实体 /// </summary> /// <param name="baseEntity"></param> /// <returns></returns> public override DbCaches.Entities.BYDQBaseEntity CreatEntity(BaseEntity baseEntity) { var protocol = baseEntity as RemoteDebugDown; var entity = new RemoteDebugDownEntity(); entity.Encryption = protocol.Encryption; entity.Type = protocol.Type; entity.CMD = protocol.CMD; entity.FunctionNumber = (int)protocol.FunctionCode; entity.ResponseSign = protocol.ResponseSign; entity.FunctionStatus = protocol.FunctionStatus; entity.UniqueIdentity = protocol.UniqueIdentity; entity.ProductType = protocol.ProductType; entity.CloudProductCode = protocol.CloudProductCode; entity.TimeStamp = protocol.TimeStamp.ToString(); entity.Time = BytesExtend.ConvertLongToDateTime(long.Parse(protocol.TimeStamp.ToString())); entity.UUID = protocol.UUID; entity.CNT = (int)protocol.CNT; entity.SEQ = (int)protocol.SEQ; entity.DiagnosticDataType = (int)protocol.DiagnosticDataType; entity.SecurityAuthentication = (int)protocol.SecurityAuthentication; entity.DiagnosticMode = (int)protocol.DiagnosticMode; entity.SendCANID = (int)protocol.SendCANID; entity.RecCANID = (int)protocol.RecCANID; entity.FrameType = (int)protocol.FrameType; entity.KeyK = (int)protocol.KeyK; entity.SIDCNT = (int)protocol.SIDCNT; entity.DiagnosticDataList = ProtoBufSerialize.Serialize(protocol.DataUnitList);//JsonConvert.SerializeObject(protocol.DataUnitList); return(entity); }
/// <summary> /// 生成数据库实体 /// </summary> /// <param name="baseEntity"></param> /// <returns></returns> public override BYDQBaseEntity CreatEntity(BaseEntity baseEntity) { var protocol = baseEntity as EventTrigger; var entity = new EventTriggerEntity(); entity.Encryption = protocol.Encryption; entity.Type = protocol.Type; entity.CMD = protocol.CMD; entity.FunctionNumber = (int)protocol.FunctionCode; entity.ResponseSign = protocol.ResponseSign; entity.FunctionStatus = protocol.FunctionStatus; entity.UniqueIdentity = protocol.UniqueIdentity; entity.ProductType = protocol.ProductType; entity.CloudProductCode = protocol.CloudProductCode; entity.TimeStamp = protocol.TimeStamp.ToString(); entity.Time = BytesExtend.ConvertLongToDateTime(long.Parse(protocol.TimeStamp.ToString())); entity.UUID = protocol.UUID; entity.DbDT = protocol.DT.ToString(); entity.EventCode = protocol.EventCode; return(entity); }
/// <summary> /// 生成数据库实体 /// </summary> /// <param name="baseEntity"></param> /// <returns></returns> public override BYDQBaseEntity CreatEntity(BaseEntity baseEntity) { var protocol = baseEntity as DataMonitor; var entity = new DataMonitorEntity(); entity.Encryption = protocol.Encryption; entity.Type = protocol.Type; entity.CMD = protocol.CMD; entity.FunctionNumber = (int)protocol.FunctionCode; entity.ResponseSign = protocol.ResponseSign; entity.FunctionStatus = protocol.FunctionStatus; entity.UniqueIdentity = protocol.UniqueIdentity; entity.ProductType = protocol.ProductType; entity.CloudProductCode = protocol.CloudProductCode; entity.TimeStamp = protocol.TimeStamp.ToString(); entity.Time = BytesExtend.ConvertLongToDateTime(long.Parse(protocol.TimeStamp.ToString())); entity.UUID = protocol.UUID; entity.SignType = protocol.SignType; entity.DbCNT = (int)protocol.CNT; entity.DbSEQ = (int)protocol.SEQ; entity.CanMessageData = ProtoBufSerialize.Serialize(protocol.DataUnitList);//JsonConvert.SerializeObject(protocol.DataUnitList); return(entity); }
public override DbCaches.Entities.BYDQBaseEntity CreatEntity(BaseEntity baseEntity) { int offset = 0; var protocol = baseEntity as DispatchInstructionDown; var entity = new DispatchInstructionDownEntity(); entity.Encryption = protocol.Encryption; entity.Type = protocol.Type; entity.CMD = protocol.CMD; entity.FunctionNumber = (int)protocol.FunctionCode; entity.ResponseSign = protocol.ResponseSign; entity.FunctionStatus = protocol.FunctionStatus; entity.UniqueIdentity = protocol.UniqueIdentity; entity.ProductType = protocol.ProductType; entity.CloudProductCode = protocol.CloudProductCode; entity.TimeStamp = protocol.TimeStamp.ToString(); entity.Time = BytesExtend.ConvertLongToDateTime(long.Parse(protocol.TimeStamp.ToString())); entity.UUID = protocol.UUID; entity.Time1 = protocol.Time1.ReadBytes6Time(ref offset); offset = 0; entity.Time2 = protocol.Time2.ReadBytes6Time(ref offset); return(entity); }