waterliu99 4 лет назад
Родитель
Сommit
afd6f906dc
3 измененных файлов: 8 добавлений и 8 удалений
  1. +2
    -2
      src/JT808.Protocol/MessageBody/JT808_0x8602.cs
  2. +2
    -2
      src/JT808.Protocol/MessageBody/JT808_0x8604.cs
  3. +4
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8606.cs

+ 2
- 2
src/JT808.Protocol/MessageBody/JT808_0x8602.cs Просмотреть файл

@@ -187,7 +187,7 @@ namespace JT808.Protocol.MessageBody
areaProperty.LowRightPointLng = reader.ReadUInt32(); areaProperty.LowRightPointLng = reader.ReadUInt32();
writer.WriteNumber($"[{areaProperty.LowRightPointLng.ReadNumber()}]右下点经度", areaProperty.LowRightPointLng); writer.WriteNumber($"[{areaProperty.LowRightPointLng.ReadNumber()}]右下点经度", areaProperty.LowRightPointLng);
ReadOnlySpan<char> areaProperty16Bit = Convert.ToString(areaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan(); ReadOnlySpan<char> areaProperty16Bit = Convert.ToString(areaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan();
bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0");
bool bit0Flag = areaProperty16Bit.Slice(0,1).ToString().Equals("0");
if (!bit0Flag) if (!bit0Flag)
{ {
areaProperty.StartTime = reader.ReadDateTime6(); areaProperty.StartTime = reader.ReadDateTime6();
@@ -195,7 +195,7 @@ namespace JT808.Protocol.MessageBody
areaProperty.EndTime = reader.ReadDateTime6(); areaProperty.EndTime = reader.ReadDateTime6();
writer.WriteString($"[{ areaProperty.EndTime.Value.ToString("yyMMddHHmmss")}]起始时间", areaProperty.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss")); writer.WriteString($"[{ areaProperty.EndTime.Value.ToString("yyMMddHHmmss")}]起始时间", areaProperty.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
} }
bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0");
bool bit1Flag = areaProperty16Bit.Slice(1, 1).ToString().Equals("0");
if (!bit1Flag) if (!bit1Flag)
{ {
areaProperty.HighestSpeed = reader.ReadUInt16(); areaProperty.HighestSpeed = reader.ReadUInt16();


+ 2
- 2
src/JT808.Protocol/MessageBody/JT808_0x8604.cs Просмотреть файл

@@ -201,7 +201,7 @@ namespace JT808.Protocol.MessageBody
writer.WriteString($"[bit0]{areaPropertyBits[0]}", areaPropertyBits[0] == '1' ? "根据时间" : "无"); writer.WriteString($"[bit0]{areaPropertyBits[0]}", areaPropertyBits[0] == '1' ? "根据时间" : "无");
} }
writer.WriteEndObject(); writer.WriteEndObject();
bool bit0Flag = areaPropertyBits.Slice(areaPropertyBits.Length - 1).ToString().Equals("0");
bool bit0Flag = areaPropertyBits.Slice(0,1).ToString().Equals("0");
if (!bit0Flag) if (!bit0Flag)
{ {
value.StartTime = reader.ReadDateTime6(); value.StartTime = reader.ReadDateTime6();
@@ -209,7 +209,7 @@ namespace JT808.Protocol.MessageBody
value.EndTime = reader.ReadDateTime6(); value.EndTime = reader.ReadDateTime6();
writer.WriteString($"[{ value.EndTime.Value.ToString("yyMMddHHmmss")}]结束时间", value.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss")); writer.WriteString($"[{ value.EndTime.Value.ToString("yyMMddHHmmss")}]结束时间", value.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
} }
bool bit1Flag = areaPropertyBits.Slice(areaPropertyBits.Length - 2, 1).ToString().Equals("0");
bool bit1Flag = areaPropertyBits.Slice(1, 1).ToString().Equals("0");
if (!bit1Flag) if (!bit1Flag)
{ {
value.HighestSpeed = reader.ReadUInt16(); value.HighestSpeed = reader.ReadUInt16();


+ 4
- 4
src/JT808.Protocol/MessageBody/JT808_0x8606.cs Просмотреть файл

@@ -192,7 +192,7 @@ namespace JT808.Protocol.MessageBody
writer.WriteString($"[bit0]{routeProperty16Bit[0]}", routeProperty16Bit[0] == '1' ? "根据时间" : "无"); writer.WriteString($"[bit0]{routeProperty16Bit[0]}", routeProperty16Bit[0] == '1' ? "根据时间" : "无");
} }
writer.WriteEndObject(); writer.WriteEndObject();
bool bit0Flag = routeProperty16Bit.Slice(routeProperty16Bit.Length - 1).ToString().Equals("0");
bool bit0Flag = routeProperty16Bit.Slice(0,1).ToString().Equals("0");
if (!bit0Flag) if (!bit0Flag)
{ {
value.StartTime = reader.ReadDateTime6(); value.StartTime = reader.ReadDateTime6();
@@ -219,7 +219,7 @@ namespace JT808.Protocol.MessageBody
writer.WriteNumber($"[{ jT808InflectionPointProperty.SectionWidth.ReadNumber()}]路段宽度", jT808InflectionPointProperty.SectionWidth); writer.WriteNumber($"[{ jT808InflectionPointProperty.SectionWidth.ReadNumber()}]路段宽度", jT808InflectionPointProperty.SectionWidth);
jT808InflectionPointProperty.SectionProperty = reader.ReadByte(); jT808InflectionPointProperty.SectionProperty = reader.ReadByte();
writer.WriteNumber($"[{ jT808InflectionPointProperty.SectionProperty.ReadNumber()}]路段属性", jT808InflectionPointProperty.SectionProperty); writer.WriteNumber($"[{ jT808InflectionPointProperty.SectionProperty.ReadNumber()}]路段属性", jT808InflectionPointProperty.SectionProperty);
ReadOnlySpan<char> sectionProperty8Bit = Convert.ToString(jT808InflectionPointProperty.SectionProperty, 2).PadLeft(8, '0').AsSpan();
ReadOnlySpan<char> sectionProperty8Bit =string.Join("", Convert.ToString(jT808InflectionPointProperty.SectionProperty, 2).PadLeft(8, '0').Reverse()).AsSpan();
writer.WriteStartObject($"路段属性对象[{sectionProperty8Bit.ToString()}]"); writer.WriteStartObject($"路段属性对象[{sectionProperty8Bit.ToString()}]");
writer.WriteString($"[bit4~bit7]保留", sectionProperty8Bit.Slice(4, 4).ToString()); writer.WriteString($"[bit4~bit7]保留", sectionProperty8Bit.Slice(4, 4).ToString());
writer.WriteString($"[bit3]进路线是否报警给平台-{sectionProperty8Bit[3]}", sectionProperty8Bit[3] == '0' ? "无" : "限速"); writer.WriteString($"[bit3]进路线是否报警给平台-{sectionProperty8Bit[3]}", sectionProperty8Bit[3] == '0' ? "无" : "限速");
@@ -227,7 +227,7 @@ namespace JT808.Protocol.MessageBody
writer.WriteString($"[bit1]{sectionProperty8Bit[1]}", sectionProperty8Bit[1] == '0' ? "东经" : "西经"); writer.WriteString($"[bit1]{sectionProperty8Bit[1]}", sectionProperty8Bit[1] == '0' ? "东经" : "西经");
writer.WriteString($"[bit0]{sectionProperty8Bit[0]}", sectionProperty8Bit[0] == '0' ? "无" : "行驶时间"); writer.WriteString($"[bit0]{sectionProperty8Bit[0]}", sectionProperty8Bit[0] == '0' ? "无" : "行驶时间");
writer.WriteEndObject(); writer.WriteEndObject();
bool sectionBit0Flag = sectionProperty8Bit.Slice(sectionProperty8Bit.Length - 1).ToString().Equals("0");
bool sectionBit0Flag = sectionProperty8Bit.Slice(0,1).ToString().Equals("0");
if (!sectionBit0Flag) if (!sectionBit0Flag)
{ {
jT808InflectionPointProperty.SectionLongDrivingThreshold = reader.ReadUInt16(); jT808InflectionPointProperty.SectionLongDrivingThreshold = reader.ReadUInt16();
@@ -235,7 +235,7 @@ namespace JT808.Protocol.MessageBody
jT808InflectionPointProperty.SectionDrivingUnderThreshold = reader.ReadUInt16(); jT808InflectionPointProperty.SectionDrivingUnderThreshold = reader.ReadUInt16();
writer.WriteNumber($"[{ jT808InflectionPointProperty.SectionDrivingUnderThreshold.Value.ReadNumber()}]路段行驶不足阈值", jT808InflectionPointProperty.SectionDrivingUnderThreshold.Value); writer.WriteNumber($"[{ jT808InflectionPointProperty.SectionDrivingUnderThreshold.Value.ReadNumber()}]路段行驶不足阈值", jT808InflectionPointProperty.SectionDrivingUnderThreshold.Value);
} }
bool sectionBit1Flag = sectionProperty8Bit.Slice(sectionProperty8Bit.Length - 2, 1).ToString().Equals("0");
bool sectionBit1Flag = sectionProperty8Bit.Slice(1, 1).ToString().Equals("0");
if (!sectionBit1Flag) if (!sectionBit1Flag)
{ {
jT808InflectionPointProperty.SectionHighestSpeed = reader.ReadUInt16(); jT808InflectionPointProperty.SectionHighestSpeed = reader.ReadUInt16();


Загрузка…
Отмена
Сохранить