private string GetCommandData(TB_HISTORIES data) { var ret = ""; var buffer = Wbs.Utilities.CustomConvert.GetBytes(data.message_content); var start = 0; switch (data.command_id) { case "0xDD00": ret = string.Format("Signal: {0}({1})", buffer[8], Utility.ASU2DBM(buffer[8])); break; case "0x1000": ret = "Please going to page <code>Map</code> to check out the data."; break; case "0x6000": ret = string.Format("RPM: {0}, Fuel: {1}", BitConverter.ToUInt16(buffer, 5), OilTempers.GetOilLeftDX((ushort)(BitConverter.ToUInt16(buffer, 29) * 500 / 1024)).ToString()); break; case "0x6004": start = data.terminal_type == Wbs.Protocol.TerminalTypes.DX ? 5 : 1; ret = string.Format("Worktime: {0}", EquipmentBLL.GetRuntime((int?)BitConverter.ToUInt32(buffer, start), 0.0, true)); break; case "0x600B": ret = string.Format("Worktime: {0}", EquipmentBLL.GetRuntime((int?)BitConverter.ToUInt32(buffer, 0), 0.0, true)); break; case "0x6007": ret = string.Format("Security: {0}", _0x6007.GetSecurity(buffer[1])); break; case "0x3000": ret = string.Format("Security: {0}", _0x3000.GetFlag(buffer[0])); break; case "0xDD02": ret = string.Format("Satellite: {0}", _0xDD02.GetStatus(buffer[0])); break; } return(ret); }
/// <summary> /// 显示我作为购买者名下的所有设备列表 /// </summary> private void ShowMyDevices() { var items = EquipmentInstance.FindList(f => f.Customer == me.id && f.Deleted == false); var html = ""; foreach (var item in items) { var eng = EquipmentInstance.GetEngStatus(item); html += "<dl class=\"invest-type\" id=\"" + item.id.ToString() + "\">" + " <dt>" + " <span class=\"iconleft\">" + " <img class=\"img-rounded ex\" src=\"" + item.TB_EquipmentModel.TB_EquipmentType.Image + "\">" + " </span>" + EquipmentInstance.GetFullNumber(item) + " <em class=\"status\">" + item.TB_EquipmentModel.TB_EquipmentType.Name + "</em>" + " </dt>" + " <dd>" + " <span class=\"text-" + (eng.Equals("ON") ? "success" : "danger") + "\"><span class=\"signal cell-engine\"></span> Engine " + eng + "</span>" + " <em class=\"status\"><span class=\"glyphicon glyphicon-time\"></span> " + EquipmentBLL.GetRuntime(item.Runtime + item.InitializedRuntime, item.CompensatedHours.Value) + "</em>" + " </dd>" + " <dd>" + " <span class=\"text-info\"><span class=\"signal cell-signal-" + Utility.ASU2Signal(item.Signal.Value) + "\"></span> Signal: " + Utility.ASU2DBM(item.Signal.Value) + "dBm(ASU: " + item.Signal + ")</span>" + " <div class=\"total-num\">" + Utility.GetOnlineStyle(item.OnlineStyle, item.OnlineTime, false) + "</div>" + " </dd>" + " <dd class=\"desc\"><span class=\"glyphicon glyphicon-globe\"></span> " + item.GpsAddress + "</dd>" + "</dl>"; } equipmentItems.InnerHtml = html; }