Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
        }