Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="writer"></param>
        /// <param name="config"></param>
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            writer.WriteStartArray("请求发送指定的时间范围内 N 个单位数据块的数据");
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 666;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x09_PositionPerHour jT808_CarDVR_Up_0x09_PositionPerHour = new JT808_CarDVR_Up_0x09_PositionPerHour();
                writer.WriteStartObject();
                writer.WriteStartObject($"指定的结束时间之前最近的第{i+1}小时的位置信息记录");
                var hex = reader.ReadVirtualArray(6);
                jT808_CarDVR_Up_0x09_PositionPerHour.StartTime = reader.ReadDateTime_yyMMddHHmmss();
                writer.WriteString($"[{hex.ToArray().ToHexString()}]开始时间", jT808_CarDVR_Up_0x09_PositionPerHour.StartTime);
                for (int j = 0; j < 60; j++)//60钟
                {
                    JT808_CarDVR_Up_0x09_PositionPerMinute jT808_CarDVR_Up_0X09_PositionPerMinute = new JT808_CarDVR_Up_0x09_PositionPerMinute();
                    writer.WriteStartObject($"开始时间之后第{j+1}分钟的平均速度和位置信息");
                    jT808_CarDVR_Up_0X09_PositionPerMinute.GpsLng = reader.ReadInt32();
                    writer.WriteNumber($"[{jT808_CarDVR_Up_0X09_PositionPerMinute.GpsLng.ReadNumber()}]经度", jT808_CarDVR_Up_0X09_PositionPerMinute.GpsLng);
                    jT808_CarDVR_Up_0X09_PositionPerMinute.GpsLat = reader.ReadInt32();
                    writer.WriteNumber($"[{jT808_CarDVR_Up_0X09_PositionPerMinute.GpsLat.ReadNumber()}]纬度", jT808_CarDVR_Up_0X09_PositionPerMinute.GpsLat);
                    jT808_CarDVR_Up_0X09_PositionPerMinute.Height = reader.ReadInt16();
                    writer.WriteNumber($"[{jT808_CarDVR_Up_0X09_PositionPerMinute.Height.ReadNumber()}]高度", jT808_CarDVR_Up_0X09_PositionPerMinute.Height);
                    jT808_CarDVR_Up_0X09_PositionPerMinute.AvgSpeedAfterStartTime = reader.ReadByte();
                    writer.WriteNumber($"[{jT808_CarDVR_Up_0X09_PositionPerMinute.AvgSpeedAfterStartTime.ReadNumber()}]平均速度", jT808_CarDVR_Up_0X09_PositionPerMinute.AvgSpeedAfterStartTime);
                    writer.WriteEndObject();
                }
                writer.WriteEndObject();
                writer.WriteEndObject();
            }
            writer.WriteEndArray();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_CarDVR_Up_0x10 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Up_0x10 value = new JT808_CarDVR_Up_0x10();

            value.JT808_CarDVR_Up_0x10_AccidentSuspectins = new List <JT808_CarDVR_Up_0x10_AccidentSuspectin>();
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 234;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x10_AccidentSuspectin jT808_CarDVR_Up_0x10_AccidentSuspectin = new JT808_CarDVR_Up_0x10_AccidentSuspectin();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.EndTime         = reader.ReadDateTime_yyMMddHHmmss();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.DriverLicenseNo = reader.ReadASCII(18);
                jT808_CarDVR_Up_0x10_AccidentSuspectin.JT808_CarDVR_Up_0x10_DrivingStatuss = new List <JT808_CarDVR_Up_0x10_DrivingStatus>();
                for (int j = 0; j < 100; j++)//100组
                {
                    jT808_CarDVR_Up_0x10_AccidentSuspectin.JT808_CarDVR_Up_0x10_DrivingStatuss.Add(new JT808_CarDVR_Up_0x10_DrivingStatus
                    {
                        Speed        = reader.ReadByte(),
                        StatusSignal = reader.ReadByte()
                    });
                }
                jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLng = reader.ReadInt32();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLat = reader.ReadInt32();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.Height = reader.ReadInt16();
                value.JT808_CarDVR_Up_0x10_AccidentSuspectins.Add(jT808_CarDVR_Up_0x10_AccidentSuspectin);
            }
            return(value);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_CarDVR_Up_0x09 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Up_0x09 value = new JT808_CarDVR_Up_0x09();

            value.JT808_CarDVR_Up_0x09_PositionPerHours = new List <JT808_CarDVR_Up_0x09_PositionPerHour>();
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 666;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x09_PositionPerHour jT808_CarDVR_Up_0x09_PositionPerHour = new JT808_CarDVR_Up_0x09_PositionPerHour()
                {
                    StartTime = reader.ReadDateTime_yyMMddHHmmss(),
                    JT808_CarDVR_Up_0x09_PositionPerMinutes = new List <JT808_CarDVR_Up_0x09_PositionPerMinute>()
                };
                for (int j = 0; j < 60; j++)//60钟
                {
                    jT808_CarDVR_Up_0x09_PositionPerHour.JT808_CarDVR_Up_0x09_PositionPerMinutes.Add(new JT808_CarDVR_Up_0x09_PositionPerMinute
                    {
                        GpsLng = reader.ReadInt32(),
                        GpsLat = reader.ReadInt32(),
                        Height = reader.ReadInt16(),
                        AvgSpeedAfterStartTime = reader.ReadByte()
                    });
                }
                value.JT808_CarDVR_Up_0x09_PositionPerHours.Add(jT808_CarDVR_Up_0x09_PositionPerHour);
            }
            return(value);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x0200_0x06 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0200_0x06 value = new JT808_0x0200_0x06();

            value.AttachInfoId     = reader.ReadByte();
            value.AttachInfoLength = reader.ReadByte();
            value.CarTemperature   = reader.ReadInt16();
            return(value);
        }
Ejemplo n.º 5
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_CarDVR_Up_0x11 value = new JT808_CarDVR_Up_0x11();

            writer.WriteStartArray("请求发送指定的时间范围内 N 个单位数据块的数据");
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 50;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x11_DriveOverTime jT808_CarDVR_Up_0x11_DriveOverTime = new JT808_CarDVR_Up_0x11_DriveOverTime();
                writer.WriteStartObject();
                writer.WriteStartObject($"指定的结束时间前最近的第 {i+1}条超时驾驶记录");
                var hex = reader.ReadVirtualArray(18);
                jT808_CarDVR_Up_0x11_DriveOverTime.DriverLicenseNo = reader.ReadASCII(18);
                writer.WriteString($"[{hex.ToArray().ToHexString()}机动车驾驶证号码]", jT808_CarDVR_Up_0x11_DriveOverTime.DriverLicenseNo);
                hex = reader.ReadVirtualArray(6);
                jT808_CarDVR_Up_0x11_DriveOverTime.ContinueDrivingStartTime = reader.ReadDateTime6();
                writer.WriteString($"[{hex.ToArray().ToHexString()}连续驾驶开始时间]", jT808_CarDVR_Up_0x11_DriveOverTime.ContinueDrivingStartTime);
                hex = reader.ReadVirtualArray(6);
                jT808_CarDVR_Up_0x11_DriveOverTime.ContinueDrivingEndTime = reader.ReadDateTime6();
                writer.WriteString($"[{hex.ToArray().ToHexString()}连续驾驶结束时间]", jT808_CarDVR_Up_0x11_DriveOverTime.ContinueDrivingEndTime);
                writer.WriteStartObject("连续驾驶开始时间所在的最近一次有效位置信息");
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLng = reader.ReadInt32();
                writer.WriteNumber($"[{ jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLng.ReadNumber()}]经度", jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLng);
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLat = reader.ReadInt32();
                writer.WriteNumber($"[{ jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLat.ReadNumber()}纬度", jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLat);
                jT808_CarDVR_Up_0x11_DriveOverTime.StartHeight = reader.ReadInt16();
                writer.WriteNumber($"[{ jT808_CarDVR_Up_0x11_DriveOverTime.StartHeight.ReadNumber()}]高度", jT808_CarDVR_Up_0x11_DriveOverTime.StartHeight);
                writer.WriteEndObject();
                writer.WriteStartObject("连续驾驶结束时间所在的最近一次有效位置信息");
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLng = reader.ReadInt32();
                writer.WriteNumber($"[{ jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLng.ReadNumber()}]经度", jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLng);
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLat = reader.ReadInt32();
                writer.WriteNumber($"[{ jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLat.ReadNumber()}]纬度", jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLat);
                jT808_CarDVR_Up_0x11_DriveOverTime.EndHeight = reader.ReadInt16();
                writer.WriteNumber($"[{ jT808_CarDVR_Up_0x11_DriveOverTime.EndHeight.ReadNumber()}]高度", jT808_CarDVR_Up_0x11_DriveOverTime.EndHeight);
                writer.WriteEndObject();
                writer.WriteEndObject();
                writer.WriteEndObject();
            }
            writer.WriteEndArray();
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="writer"></param>
        /// <param name="config"></param>
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x0200_0x06 value = new JT808_0x0200_0x06();

            value.AttachInfoId = reader.ReadByte();
            writer.WriteNumber($"[{value.AttachInfoId.ReadNumber()}]附加信息Id", value.AttachInfoId);
            value.AttachInfoLength = reader.ReadByte();
            writer.WriteNumber($"[{value.AttachInfoLength.ReadNumber()}]附加信息长度", value.AttachInfoLength);
            value.CarTemperature = reader.ReadInt16();
            writer.WriteNumber($"[{value.CarTemperature.ReadNumber()}]车厢温度", value.CarTemperature);
        }
Ejemplo n.º 7
0
        public JT808_CarDVR_Up_0x11 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Up_0x11 value = new JT808_CarDVR_Up_0x11();

            value.JT808_CarDVR_Up_0x11_DriveOverTimes = new List <JT808_CarDVR_Up_0x11_DriveOverTime>();
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 50;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x11_DriveOverTime jT808_CarDVR_Up_0x11_DriveOverTime = new JT808_CarDVR_Up_0x11_DriveOverTime();
                jT808_CarDVR_Up_0x11_DriveOverTime.DriverLicenseNo          = reader.ReadASCII(18);
                jT808_CarDVR_Up_0x11_DriveOverTime.ContinueDrivingStartTime = reader.ReadDateTime6();
                jT808_CarDVR_Up_0x11_DriveOverTime.ContinueDrivingEndTime   = reader.ReadDateTime6();
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLng = reader.ReadInt32();
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsStartLat = reader.ReadInt32();
                jT808_CarDVR_Up_0x11_DriveOverTime.StartHeight = reader.ReadInt16();
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLng   = reader.ReadInt32();
                jT808_CarDVR_Up_0x11_DriveOverTime.GpsEndLat   = reader.ReadInt32();
                jT808_CarDVR_Up_0x11_DriveOverTime.EndHeight   = reader.ReadInt16();
                value.JT808_CarDVR_Up_0x11_DriveOverTimes.Add(jT808_CarDVR_Up_0x11_DriveOverTime);
            }
            return(value);
        }
Ejemplo n.º 8
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_CarDVR_Up_0x10 value = new JT808_CarDVR_Up_0x10();

            writer.WriteStartArray("请求发送指定的时间范围内 N 个单位数据块的数据");
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 234;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x10_AccidentSuspectin jT808_CarDVR_Up_0x10_AccidentSuspectin = new JT808_CarDVR_Up_0x10_AccidentSuspectin();
                writer.WriteStartObject();
                writer.WriteStartObject($"指定的结束时间之前最近的第{i+1}条事故疑点记录");
                var hex = reader.ReadVirtualArray(6);
                jT808_CarDVR_Up_0x10_AccidentSuspectin.EndTime = reader.ReadDateTime6();
                writer.WriteString($"[{hex.ToArray().ToHexString()}]行驶结束时间", jT808_CarDVR_Up_0x10_AccidentSuspectin.EndTime);
                hex = reader.ReadVirtualArray(18);
                jT808_CarDVR_Up_0x10_AccidentSuspectin.DriverLicenseNo = reader.ReadASCII(18);
                writer.WriteString($"[{hex.ToArray().ToHexString()}]机动车驾驶证号码", jT808_CarDVR_Up_0x10_AccidentSuspectin.DriverLicenseNo);
                for (int j = 0; j < 100; j++)//100组
                {
                    JT808_CarDVR_Up_0x10_DrivingStatus jT808_CarDVR_Up_0X10_DrivingStatus = new JT808_CarDVR_Up_0x10_DrivingStatus();
                    if (j == 0)
                    {
                        writer.WriteStartObject("行驶结束时的速度");
                    }
                    else
                    {
                        writer.WriteStartObject($"行驶结束时间前 { (j * 0.2).ToString("F1")} 秒时的速度");
                    }
                    jT808_CarDVR_Up_0X10_DrivingStatus.Speed = reader.ReadByte();
                    writer.WriteNumber($"[{ jT808_CarDVR_Up_0X10_DrivingStatus.Speed.ReadNumber()}]速度", jT808_CarDVR_Up_0X10_DrivingStatus.Speed);
                    jT808_CarDVR_Up_0X10_DrivingStatus.StatusSignal = reader.ReadByte();
                    writer.WriteNumber($"[{ jT808_CarDVR_Up_0X10_DrivingStatus.StatusSignal.ReadNumber()}]状态信号", jT808_CarDVR_Up_0X10_DrivingStatus.StatusSignal);
                    writer.WriteEndObject();
                }
                jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLng = reader.ReadInt32();
                writer.WriteNumber($"[{ jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLng.ReadNumber()}]经度", jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLng);
                jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLat = reader.ReadInt32();
                writer.WriteNumber($"[{   jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLat.ReadNumber()}]纬度", jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLat);
                jT808_CarDVR_Up_0x10_AccidentSuspectin.Height = reader.ReadInt16();
                writer.WriteNumber($"[{  jT808_CarDVR_Up_0x10_AccidentSuspectin.Height.ReadNumber()}]高度", jT808_CarDVR_Up_0x10_AccidentSuspectin.Height);
                writer.WriteEndObject();
                writer.WriteEndObject();
            }
            writer.WriteEndArray();
        }