/// <summary>填充在线节点信息</summary> /// <param name="inf"></param> private void Fill(PingInfo inf) { var olt = this; if (inf.AvailableMemory > 0) { olt.AvailableMemory = (Int32)(inf.AvailableMemory / 1024 / 1024); } if (inf.AvailableFreeSpace > 0) { olt.AvailableFreeSpace = (Int32)(inf.AvailableFreeSpace / 1024 / 1024); } if (inf.CpuRate > 0) { olt.CpuRate = inf.CpuRate; } if (inf.Temperature > 0) { olt.Temperature = inf.Temperature; } if (inf.Battery > 0) { olt.Battery = inf.Battery; } if (inf.UplinkSpeed > 0) { olt.UplinkSpeed = (Int64)inf.UplinkSpeed; } if (inf.DownlinkSpeed > 0) { olt.DownlinkSpeed = (Int64)inf.DownlinkSpeed; } if (inf.ProcessCount > 0) { olt.ProcessCount = inf.ProcessCount; } if (inf.TcpConnections > 0) { olt.TcpConnections = inf.TcpConnections; } if (inf.TcpTimeWait > 0) { olt.TcpTimeWait = inf.TcpTimeWait; } if (inf.TcpCloseWait > 0) { olt.TcpCloseWait = inf.TcpCloseWait; } if (inf.Uptime > 0) { olt.Uptime = inf.Uptime; } if (inf.Delay > 0) { olt.Delay = inf.Delay; } var dt = inf.Time.ToDateTime().ToLocalTime(); if (dt.Year > 2000) { olt.LocalTime = dt; olt.Offset = (Int32)Math.Round((dt - DateTime.Now).TotalSeconds); } if (!inf.Processes.IsNullOrEmpty()) { olt.Processes = inf.Processes; } if (!inf.Macs.IsNullOrEmpty()) { olt.MACs = inf.Macs; } //if (!inf.COMs.IsNullOrEmpty()) olt.COMs = inf.COMs; if (!inf.IP.IsNullOrEmpty()) { olt.IP = inf.IP; } //olt.Data = inf.ToJson(); var dic = inf.ToDictionary(); dic.Remove("Processes"); olt.Data = dic.ToJson(); }