/// <summary> /// 处理命令回复状态 /// </summary> /// <param name="tx300"></param> private void HandleCommandResponsed(TX300 tx300) { CommandInstance.Update(f => f.DestinationNo == tx300.TerminalID && f.Command == "0x" + CustomConvert.IntToDigit(tx300.CommandID, CustomConvert.HEX, 4) && f.ScheduleTime >= DateTime.Now.AddMinutes(-3) && f.Status >= (byte)CommandStatus.SentByTCP && f.Status <= (byte)CommandStatus.SentToDest, act => { act.Status = (byte)CommandStatus.Returned; }); }
/// <summary> /// 更新命令的发送状态 /// </summary> /// <param name="obj"></param> private void UpdateCommand(TB_Command obj, CommandStatus status) { CommandInstance.Update(f => f.id == obj.id, act => { act.Status = (byte)status; if (status == CommandStatus.SentByTCP) { act.ActualSendTime = DateTime.Now; } }); }