예제 #1
0
파일: DownData.cs 프로젝트: lexzh/Myproject
 private CarPartInfo method_5(DataRow dataRow_0, out CmdParam.CommMode commMode_0)
 {
     CarPartInfo info = new CarPartInfo();
     ReceiveDataBase base2 = new ReceiveDataBase();
     int num = int.Parse(dataRow_0["carstatu"].ToString());
     info.AccStatus = base2.GetACCStatus(num);
     long num2 = 0L;
     if (dataRow_0.Table.Columns.Contains("CarStatuEx"))
     {
         num2 = long.Parse(dataRow_0["carStatuEx"].ToString());
     }
     CarAlarmType type = new CarAlarmType();
     string str = AlamStatus.GetStatusNameByCarStatu((long) num) + AlamStatus.GetStatusNameByCarStatuExt(num2) + type.GetCustAlarmName(dataRow_0["telephone"].ToString(), num);
     string str2 = "0";
     if (base2.isPosStatus(num))
     {
         str2 = dataRow_0["starNum"].ToString();
     }
     int num3 = int.Parse(dataRow_0["commflag"].ToString());
     commMode_0 = (CmdParam.CommMode) num3;
     string str3 = dataRow_0["speed"].ToString();
     info.Speed = str3.Substring(0, str3.IndexOf('.') + 3);
     info.TransportStatu = base2.GetTransportStatus(int.Parse(dataRow_0["TransportStatus"].ToString()));
     info.StatusName = str;
     info.GpsTime = Convert.ToDateTime(dataRow_0["gpstime"]).ToString("yyyy-MM-dd HH:mm:ss");
     info.ReceTime = Convert.ToDateTime(dataRow_0["ReceTime"]).ToString("yyyy-MM-dd HH:mm:ss");
     info.DistanceDiff = dataRow_0["DistanceDiff"].ToString();
     info.StarNum = str2;
     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.Lat = dataRow_0["latitude"].ToString();
     info.Lon = dataRow_0["longitude"].ToString();
     info.Lat = info.Lat.Substring(0, info.Lat.IndexOf('.') + 7);
     info.Lon = info.Lon.Substring(0, info.Lon.IndexOf('.') + 7);
     string aCCStatus = base2.GetACCStatus(base2.GetDrInt(dataRow_0, "carstatu"));
     if ("关".Equals(aCCStatus))
     {
         info.AccOn = "0";
     }
     else
     {
         info.AccOn = "1";
     }
     if (base2.GetDrInt(dataRow_0, "TransportStatus") == 3)
     {
         info.IsFill = "1";
     }
     else
     {
         info.IsFill = "0";
     }
     if (base2.isPosStatus(base2.GetDrInt(dataRow_0, "carstatu")))
     {
         info.GpsValid = "1";
     }
     else
     {
         info.GpsValid = "0";
     }
     info.Direct = Convert.ToInt32(dataRow_0["Direct"]);
     return info;
 }
예제 #2
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);
            }
        }
예제 #3
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);
        }
예제 #4
0
파일: Car.cs 프로젝트: lexzh/Myproject
 /// <summary>
 /// 查找区域内的车辆并返回末次位置信息
 /// </summary>
 /// <param name="minLng"></param>
 /// <param name="minLat"></param>
 /// <param name="maxLng"></param>
 /// <param name="maxLat"></param>
 /// <param name="strAreaCode"></param>
 /// <param name="strUseId"></param>
 /// <returns></returns>
 public DataTable GetRefRegion(double minLng, double minLat, double maxLng, double maxLat, string strAreaCode, string strUseId)
 {
     string str = "WebGpsClient_GetCarsInSelArea";
     SqlParameter[] parameterArray = new SqlParameter[] { new SqlParameter("@MinX", minLng), new SqlParameter("@MinY", minLat), new SqlParameter("@MaxX", maxLng), new SqlParameter("@MaxY", maxLat), new SqlParameter("@AreaCode", strAreaCode), new SqlParameter("@userID", strUseId) };
     DataTable table = new SqlDataAccess().getDataBySP(str, parameterArray);
     DataTable table2 = this.method_3();
     CarAlarmType type = new CarAlarmType();
     foreach (DataRow row in table.Rows)
     {
         Bussiness.CarInfo dataCarInfoBySimNum = CarDataInfoBuffer.GetDataCarInfoBySimNum(row["telephone"].ToString());
         if (dataCarInfoBySimNum != null)
         {
             DataRow row2 = table2.NewRow();
             row2["CarNum"] = dataCarInfoBySimNum.CarNum;
             string str2 = row["speed"].ToString();
             row2["Speed"] = str2.Substring(0, str2.IndexOf('.') + 3);
             string str3 = row["Latitude"].ToString();
             string str4 = row["Longitude"].ToString();
             row2["Longitude"] = str4.Substring(0, str4.IndexOf('.') + 7);
             row2["Latitude"] = str3.Substring(0, str3.IndexOf('.') + 7);
             row2["SimNum"] = dataCarInfoBySimNum.SimNum;
             row2["SvrTime"] = dataCarInfoBySimNum.SvrEndTime;
             row2["AreaName"] = dataCarInfoBySimNum.AreaName;
             row2["CarId"] = dataCarInfoBySimNum.CarId;
             int carStatu = Convert.ToInt32(row["CarStatu"]);
             long carStatuEx = 0L;
             if (table.Columns.Contains("CarStatuEx"))
             {
                 carStatuEx = Convert.ToInt64(row["CarStatuEx"]);
             }
             row2["StatuName"] = AlamStatus.GetStatusNameByCarStatu((long) carStatu) + AlamStatus.GetStatusNameByCarStatuExt(carStatuEx) + type.GetCustAlarmName(dataCarInfoBySimNum.SimNum, carStatu);
             row2["GpsTime"] = row["gpstime"].ToString();
             if (AlamStatus.IsAlarmReport(Convert.ToInt32(row["reserved"])))
             {
                 row2["CarStatus"] = 1;
             }
             else
             {
                 row2["CarStatus"] = 2;
             }
             row2["AlarmType"] = type.GetAlarmTypeValue(dataCarInfoBySimNum.SimNum, carStatu, carStatuEx);
             int result = 0;
             int.TryParse(row["TransportStatus"].ToString(), out result);
             if (result == 3)
             {
                 row2["IsFill"] = 1;
             }
             else
             {
                 row2["IsFill"] = 0;
             }
             if (base.isPosStatus(carStatu))
             {
                 row2["GpsValid"] = 1;
             }
             else
             {
                 row2["GpsValid"] = 0;
             }
             if ((carStatu & 0x4000) == 0)
             {
                 row2["AccOn"] = 0;
             }
             else
             {
                 row2["AccOn"] = 1;
             }
             table2.Rows.Add(row2);
         }
     }
     return table2;
 }
예제 #5
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;
     }
 }
예제 #6
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;
 }