Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public int SetCarAlarmStatus(DataRow dataRow_0, DataRow dataRow_1, string string_0)
        {
            int num = AlamStatus.IsAlarm(string_0, base.GetDrInt(dataRow_1, "statu"), Convert.ToInt64(dataRow_1["carStatuEx"]));

            if (num == 1)
            {
                dataRow_0["CarStatus"] = 1;
                dataRow_0["AlarmType"] = 1;
                return(num);
            }
            dataRow_0["CarStatus"] = 2;
            dataRow_0["AlarmType"] = 2;
            return(num);
        }
Ejemplo n.º 3
0
        public int GetAlarmTypeValue(string string_1, int int_0, long long_0)
        {
            AlarmType type            = this.method_1(string_1);
            ArrayList alarmCode       = this.GetAlarmCode(string_1, int_0);
            ArrayList alarmCodeExList = AlamStatus.GetAlarmCodeExList(long_0);
            int       num             = 1;

            foreach (long num2 in alarmCode)
            {
                if (num2 == -2147483648L)
                {
                    return(1);
                }
                if ((type.AlarmSwitch & num2) != 0L)
                {
                    if ((type.AlarmFlag & num2) != 0L)
                    {
                        return(1);
                    }
                    if (((type.ShowAlarm & num2) != 0L) && (num != 2))
                    {
                        num = 3;
                    }
                    else
                    {
                        num = 2;
                    }
                }
            }
            foreach (long num3 in alarmCodeExList)
            {
                if ((type.AlarmSwitchExt & num3) != 0L)
                {
                    if ((type.AlarmFlagExt & num3) != 0L)
                    {
                        return(1);
                    }
                    if (((type.ShowAlarmExt & num3) != 0L) && (num != 2))
                    {
                        num = 3;
                    }
                    else
                    {
                        num = 2;
                    }
                }
            }
            return(num);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 初始化程序数据,开启线程
        /// </summary>
        public static void AppInitDataAndStarRun()
        {
            try
            {
                CarDataInfoBuffer.LoadAllCarInfoList();
            }
            catch (Exception exception)
            {
                ErrorMsg msg = new ErrorMsg("BussinessHelper", "StartRun", "车辆缓存信息加载错误:" + exception.Message);
                new LogHelper().WriteError(msg);

                Thread.Sleep(0x1388);
            }
            try
            {
                CarAlarmType.LoadAllCarAlarmTypeList();
            }
            catch (Exception exception2)
            {
                ErrorMsg msg2 = new ErrorMsg("BussinessHelper", "StartRun", "报警类型数据加载错误:" + exception2.Message);
                new LogHelper().WriteError(msg2);
                Thread.Sleep(0x1388);
            }
            try
            {
                AlamStatus.LoadAllAlarmStatu();
            }
            catch (Exception exception3)
            {
                ErrorMsg msg3 = new ErrorMsg("BussinessHelper", "StartRun", "报警状态数据加载错误:" + exception3.Message);
                new LogHelper().WriteError(msg3);
                Thread.Sleep(0x1388);
            }
            upNewPosition.Start();
            upResponse.Start();
            upOutEquipmentData.Start();
            upOtherData.Start();
        }
Ejemplo n.º 6
0
        public ArrayList GetAlarmCode(string string_1, int int_0)
        {
            ArrayList alarmCodeList = AlamStatus.GetAlarmCodeList(int_0);
            AlarmType type          = this.method_1(string_1);

            if (((type.cust_AlarmSwitch != 0) && (type.cust_AlarmName != null)) && (type.cust_AlarmName.Length > 0))
            {
                if (alarmCodeList == null)
                {
                    alarmCodeList = new ArrayList();
                }
                string[] strArray = type.cust_AlarmName.Split(new char[] { '*' });
                long     num      = 0L;
                for (int i = 0; i <= (strArray.Length - 2); i++)
                {
                    num = Convert.ToInt32(strArray[i].Substring(0, strArray[i].IndexOf("/")));
                    if ((num & int_0) != 0L)
                    {
                        alarmCodeList.Add(num);
                    }
                }
            }
            return(alarmCodeList);
        }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
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);
        }