private void method_7(DataRow dataRow_0, DataTable dataTable_0) { int drInt = base.GetDrInt(dataRow_0, "commFlag"); CarPartInfo info = new CarPartInfo(); DataRow row = dataTable_0.NewRow(); string statusNameByCarStatu = AlamStatus.GetStatusNameByCarStatu((long)base.GetDrInt(dataRow_0, "statu")); if (base.isPosStatus(base.GetDrInt(dataRow_0, "statu"))) { info.StarNum = base.GetDrStr(dataRow_0, "starNum"); row["GpsValid"] = 1; } else { row["GpsValid"] = 0; info.StarNum = "0"; } info.AccStatus = base.GetACCStatus(base.GetDrInt(dataRow_0, "zip_carstatu")); string drStr = base.GetDrStr(dataRow_0, "zip_speed"); info.Speed = drStr.Substring(0, drStr.IndexOf('.') + 3); info.TransportStatu = base.GetTransportStatus(base.GetDrInt(dataRow_0, "zip_TransportStatus")); info.StatusName = statusNameByCarStatu; info.GpsTime = base.GetDrStr(dataRow_0, "gpstime"); info.DistanceDiff = base.GetDrStr(dataRow_0, "zip_DistanceDiff"); string str3 = base.GetDrStr(dataRow_0, "latitude1"); string str4 = base.GetDrStr(dataRow_0, "longitude1"); info.Lat = str3.Substring(0, str3.IndexOf('.') + 7); info.Lon = str4.Substring(0, str4.IndexOf('.') + 7); row["GpsTime"] = info.GpsTime; row["receTime"] = base.GetDrStr(dataRow_0, "instime"); row["OrderID"] = base.GetDrStr(dataRow_0, "orderId"); row["CarNum"] = base.GetDrStr(dataRow_0, "carNum"); row["CarId"] = base.GetDrStr(dataRow_0, "carId"); row["SimNum"] = base.GetDrStr(dataRow_0, "phone"); row["OrderType"] = "接收"; row["OrderName"] = "压缩定位信息报文"; row["msgType"] = 0x42; row["OrderResult"] = "成功"; row["CommFlag"] = base.GetCommFlagName(drInt); row["Describe"] = info.GetCarCurrentInfo() + base.GetCommFlagName(drInt); row["Longitude"] = info.Lon; row["Latitude"] = info.Lat; row["IsImportWatch"] = base.GetDrInt(dataRow_0, "isImportWatch"); row["IsFill"] = (base.GetDrInt(dataRow_0, "zip_TransportStatus") == 3) ? 1 : 0; row["AccOn"] = ((base.GetDrInt(dataRow_0, "zip_carstatu") & 0x4000) == 0) ? 0 : 1; row["statuName"] = info.StatusName; row["Distance"] = info.DistanceDiff; row["Direct"] = base.GetDrInt(dataRow_0, "zip_direct"); row["speed"] = drStr; dataTable_0.Rows.Add(row); }
public void GetCarPartInfo(DataRow dataRow_0, DataRow dataRow_1, CarPartInfo info) { string drStr = base.GetDrStr(dataRow_1, "phone"); int drInt = base.GetDrInt(dataRow_1, "statu"); long num2 = 0L; if (dataRow_1["carStatuEx"] != DBNull.Value) { num2 = Convert.ToInt64(dataRow_1["carStatuEx"]); } dataRow_0["Status"] = drInt; dataRow_0["StatusEx"] = num2; if (base.isPosStatus(drInt)) { info.StarNum = base.GetDrStr(dataRow_1, "starNum"); dataRow_0["GpsValid"] = 1; } else { dataRow_0["GpsValid"] = 0; info.StarNum = "0"; } info.AccStatus = base.GetACCStatus(drInt); info.TransportStatu = base.GetTransportStatus(base.GetDrInt(dataRow_1, "TransportStatus")); info.StatusName = AlamStatus.GetStatusNameByCarStatu((long)drInt) + AlamStatus.GetStatusNameByCarStatuExt(num2) + this.carAlarmType_0.GetCustAlarmName(drStr, drInt); info.GpsTime = base.GetDrStr(dataRow_1, "gpstime"); info.DistanceDiff = base.GetDrStr(dataRow_1, "DistanceDiff"); if (info.DistanceDiff.Length <= 3) { info.DistanceDiff = "0." + info.DistanceDiff; } else { info.DistanceDiff = info.DistanceDiff.Insert(info.DistanceDiff.Length - 3, "."); info.DistanceDiff = info.DistanceDiff.Substring(0, info.DistanceDiff.Length - 1); } info.Speed = base.GetDrStr(dataRow_1, "speed"); info.Speed = info.Speed.Substring(0, info.Speed.IndexOf('.') + 3); info.Lat = base.GetDrStr(dataRow_1, "latitude"); info.Lon = base.GetDrStr(dataRow_1, "longitude"); info.Lat = info.Lat.Substring(0, info.Lat.IndexOf('.') + 7); info.Lon = info.Lon.Substring(0, info.Lon.IndexOf('.') + 7); }
public DataTable GetReplayData(string string_0, string string_1, string string_2, int int_0, int int_1, int int_2, int int_3, string string_3, string string_4) { DataTable table = this.method_2(); try { new TrackReplay(); int num = int_0; DataTable table2 = this.method_0(string_0, string_1, string_2, num, int_1, int_2, 0); DataView defaultView = table2.DefaultView; int num2 = 0; int num3 = 0; long num4 = 0L; int result = 0; string str = string.Empty; string str2 = string.Empty; CarAlarmType type = new CarAlarmType(); Car car = new Car(); for (int i = 0; i < defaultView.Count; i++) { DataRow row = table.NewRow(); row["CarNum"] = defaultView[i]["carNum"].ToString(); row["CarId"] = defaultView[i]["carid"].ToString(); row["Longitude"] = defaultView[i]["Longitude"].ToString(); row["Latitude"] = defaultView[i]["Latitude"].ToString(); row["Speed"] = defaultView[i]["speed"].ToString(); str = Convert.ToString(defaultView[i]["SimNum"]); num2 = Convert.ToInt32(defaultView[i]["reserved"]); row["Reserved"] = num2; if (num2 == 0x28b) { row["Reserved"] = "是"; } else { row["Reserved"] = "否"; } num3 = Convert.ToInt32(defaultView[i]["CarStatu"]); if (table2.Columns.Contains("CarStatuEx")) { num4 = long.Parse(defaultView[i]["CarStatuEx"].ToString()); } str2 = AlamStatus.GetStatusNameByCarStatu((long)num3) + AlamStatus.GetStatusNameByCarStatuExt(num4) + type.GetCustAlarmName(str, num3); float num7 = float.Parse(defaultView[i]["distanceDiff"].ToString()) / 1000f; if (num7 < 0f) { num7 = 0f; } row["Distance"] = string.Format("{0:F2}", num7); row["GpsTime"] = defaultView[i]["gpstime"].ToString(); row["CarStatusList"] = str2; row["CarStatus"] = AlamStatus.IsAlarmReport(num2) ? 1 : 2; row["AlarmType"] = type.GetAlarmTypeValue(string_2, num3, num4); int.TryParse(defaultView[i]["TransportStatus"].ToString(), out result); row["IsFill"] = (result == 3) ? 1 : 0; row["GpsValid"] = car.isPosStatus(num3) ? 1 : 0; row["AccOn"] = ((num3 & 0x4000) == 0) ? 0 : 1; row["Direct"] = defaultView[i]["Direct"].ToString(); table.Rows.Add(row); } return(table); } catch (Exception exception) { ErrorMsg msg = new ErrorMsg("TrackReplay", "GetTrackData", exception.Message); new LogHelper().WriteError(msg); DataRow row2 = table.NewRow(); table.Clear(); row2["Error"] = exception.Message; row2["Hand"] = string_3; table.Rows.Add(row2); return(table); } }
public DataTable GetReplayData(string BeginTime, string EndTime, string Tele, int RecordCount, int PageNum, int PageCount, int IsComputeMile, int IsQueryPic) { DataTable table = null; try { table = this.method_1(BeginTime, EndTime, Tele, RecordCount, PageNum, PageCount, IsComputeMile, IsQueryPic); table.Columns.Add(new DataColumn("StatuList")); table.Columns.Add(new DataColumn("AlarmType")); table.Columns.Add(new DataColumn("IsFill")); table.Columns.Add(new DataColumn("AccOn")); table.Columns.Add(new DataColumn("GpsValid")); int num = 0; int num2 = 0; long num3 = 0L; string str = string.Empty; CarAlarmType type = new CarAlarmType(); foreach (DataRow row in table.Rows) { str = row["SimNum"].ToString(); row["CarNum"].ToString(); num = Convert.ToInt32(row["reserved"]); num2 = int.Parse(row["carStatu"].ToString()); if (table.Columns.Contains("CarStatuEx")) { num3 = long.Parse(row["CarStatuEx"].ToString()); } row["StatuList"] = AlamStatus.GetStatusNameByCarStatu((long)num2) + AlamStatus.GetStatusNameByCarStatuExt(num3) + type.GetCustAlarmName(str, num2); if (AlamStatus.IsAlarmReport(num)) { row["carStatu"] = 1; } else { row["carStatu"] = 2; } row["AlarmType"] = type.GetAlarmTypeValue(Tele, num2, num3); int result = 0; int.TryParse(row["TransportStatus"].ToString(), out result); if (result == 3) { row["IsFill"] = 1; } else { row["IsFill"] = 0; } if (base.isPosStatus(num2)) { row["GpsValid"] = 1; } else { row["GpsValid"] = 0; } if ((num2 & 0x4000) == 0) { row["AccOn"] = 0; } else { row["AccOn"] = 1; } } return(table); } catch (Exception exception) { LogHelper helper = new LogHelper(); ErrorMsg msg = new ErrorMsg("TrackReplay", helper.GetCallFunction(), helper.GetExceptionMsg(exception)); helper.WriteError(msg); } return(table); }