@@ -1,13 +0,0 @@ | |||||
| |||||
<Router AppAssembly="@typeof(Program).Assembly"> | |||||
<Found Context="routeData"> | |||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | |||||
</Found> | |||||
<NotFound> | |||||
<LayoutView Layout="@typeof(MainLayout)"> | |||||
<p>Sorry, there's nothing at this address.</p> | |||||
</LayoutView> | |||||
</NotFound> | |||||
</Router> | |||||
<AntContainer /> |
@@ -0,0 +1,13 @@ | |||||
using JT808.Protocol.Interfaces; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace JTTools.Configs | |||||
{ | |||||
public class JT808_GPS51_Config : GlobalConfigBase | |||||
{ | |||||
public override string ConfigId { get; protected set; } = "JT808_GPS51_Config"; | |||||
} | |||||
} |
@@ -0,0 +1,45 @@ | |||||
using Microsoft.AspNetCore.Mvc; | |||||
using System.Net.NetworkInformation; | |||||
using Newtonsoft.Json; | |||||
using JTTools.Configs; | |||||
using JTTools.Dtos; | |||||
using System.Reflection.Emit; | |||||
using JT1078.Protocol; | |||||
namespace JTTools.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[ApiController] | |||||
[Route("jtt/[controller]")] | |||||
public class JT1078Controller : ControllerBase | |||||
{ | |||||
JT1078Serializer serializer; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public JT1078Controller() | |||||
{ | |||||
serializer = new JT1078Serializer(); | |||||
} | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="request"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[Route("Analyze")] | |||||
public ResultDto<JT1078AnalyzeResultDto> Analyze(JT1078AnalyzeDto request) | |||||
{ | |||||
ResultDto<JT1078AnalyzeResultDto> result = new ResultDto<JT1078AnalyzeResultDto>(); | |||||
result.Result = new JT1078AnalyzeResultDto(); | |||||
return result; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,67 @@ | |||||
using Microsoft.AspNetCore.Mvc; | |||||
using JTTools.Configs; | |||||
using JT809.Protocol.Enums; | |||||
using JTTools.Dtos; | |||||
using System.Reflection.Emit; | |||||
using JT808.Protocol; | |||||
using JT808.Protocol.Extensions; | |||||
using Microsoft.OpenApi.Any; | |||||
namespace JTTools.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[ApiController] | |||||
[Route("jtt/[controller]")] | |||||
public class JT19056Controller : ControllerBase | |||||
{ | |||||
JT808CarDVRSerializer Serializer; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="config"></param> | |||||
public JT19056Controller( | |||||
IJT808Config config | |||||
) | |||||
{ | |||||
Serializer = config.GetCarDVRSerializer(); | |||||
} | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="request"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[Route("Analyze")] | |||||
public ResultDto<JT19056AnalyzeResultDto> Analyze(JT19056AnalyzeDto request) | |||||
{ | |||||
ResultDto<JT19056AnalyzeResultDto> result = new ResultDto<JT19056AnalyzeResultDto>(); | |||||
result.Result = new JT19056AnalyzeResultDto(); | |||||
try | |||||
{ | |||||
var data = request.Hex.ToHexBytes(); | |||||
switch (request.ProtocolType) | |||||
{ | |||||
case "up": | |||||
result.Result.JsonValue = Serializer.UpAnalyze(data, options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "down": | |||||
result.Result.JsonValue = Serializer.DownAnalyze(data, options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
default: | |||||
result.Result.JsonValue = ""; | |||||
break; | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
result.Code = 500; | |||||
result.Message = ex.StackTrace??""; | |||||
} | |||||
return result; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,98 @@ | |||||
using Microsoft.AspNetCore.Mvc; | |||||
using System.Net.NetworkInformation; | |||||
using JT808.Protocol; | |||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Exceptions; | |||||
using JTTools.Configs; | |||||
using System.IO; | |||||
using System.Reflection; | |||||
using System.Text; | |||||
using System.Text.Encodings.Web; | |||||
using System.Text.Unicode; | |||||
using JT808.Protocol.Interfaces; | |||||
using JTTools.Dtos; | |||||
using System.Reflection.Emit; | |||||
namespace JTTools.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[ApiController] | |||||
[Route("jtt/[controller]")] | |||||
public class JT808Controller : ControllerBase | |||||
{ | |||||
IJT808Config config; | |||||
JT808_JT1078_Config jT808_JT1078_Config; | |||||
JT808_SuBiao_Config jT808_SuBiao_Config; | |||||
JT808_Streamax_Config jT808_Streamax_Config; | |||||
JT808_YueBiao_Config jT808_YueBiao_Config; | |||||
JT808_GPS51_Config jT808_gps51_Config; | |||||
JT808Serializer Serializer; | |||||
JT808Serializer JTRM_Serializer; | |||||
JT808Serializer JTSuBiao_Serializer; | |||||
JT808Serializer JTYueBiao_Serializer; | |||||
JT808Serializer JTGps51_Serializer; | |||||
JT808Serializer JT1078Serializer; | |||||
JT808Serializer JTPrivateSerializer; | |||||
public JT808Controller( | |||||
IJT808Config config, | |||||
JT808_JT1078_Config jT808_JT1078_Config, | |||||
JT808_SuBiao_Config jT808_SuBiao_Config, | |||||
JT808_Streamax_Config jT808_Streamax_Config, | |||||
JT808_YueBiao_Config jT808_YueBiao_Config, | |||||
JT808_GPS51_Config jT808_gps51_Config | |||||
) | |||||
{ | |||||
this.config = config; | |||||
this.jT808_JT1078_Config = jT808_JT1078_Config; | |||||
this.jT808_SuBiao_Config = jT808_SuBiao_Config; | |||||
this.jT808_Streamax_Config = jT808_Streamax_Config; | |||||
this.jT808_YueBiao_Config = jT808_YueBiao_Config; | |||||
this.jT808_gps51_Config = jT808_gps51_Config; | |||||
this.config.SkipCRCCode = true; | |||||
this.config.SkipCarDVRCRCCode = true; | |||||
Serializer = config.GetSerializer(); | |||||
JT1078Serializer = jT808_JT1078_Config.GetSerializer(); | |||||
JTSuBiao_Serializer = jT808_SuBiao_Config.GetSerializer(); | |||||
JTRM_Serializer = jT808_Streamax_Config.GetSerializer(); | |||||
JTYueBiao_Serializer = jT808_YueBiao_Config.GetSerializer(); | |||||
JTGps51_Serializer = jT808_gps51_Config.GetSerializer(); | |||||
} | |||||
/// <summary> | |||||
/// 序列化字典 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[Route("GetDict")] | |||||
public ResultDto<List<JTTDictDto>> GetDict() | |||||
{ | |||||
return new ResultDto<List<JTTDictDto>> | |||||
{ | |||||
Result=new List<JTTDictDto>{ | |||||
{ new JTTDictDto{Label = "国标(通过包自动识别版本号)" ,Value = "JT808"}}, | |||||
{ new JTTDictDto{Label = "国标扩展JT1078", Value = "JT808_JT1078"}}, | |||||
{ new JTTDictDto{Label = "国标扩展主动安全(苏标)", Value = "JT808_SuBiao"}}, | |||||
{ new JTTDictDto{Label = "国标扩展主动安全(粤标)" ,Value = "JT808_YueBiao"}}, | |||||
{ new JTTDictDto{Label = "公交扩展协议(锐明)", Value = "JT808_JTRM"}}, | |||||
{ new JTTDictDto{Label = "国标(强制使用2013版本解析)" ,Value = "JT2013Force"}}, | |||||
{ new JTTDictDto{Label = "国标扩展私有协议", Value = "JTPrivate"} }, | |||||
{ new JTTDictDto{Label = "国标扩展私有协议(GPS51)", Value = "JT808_GPS51"} } | |||||
} | |||||
}; | |||||
} | |||||
[HttpPost] | |||||
[Route("Analyze")] | |||||
public ResultDto<JT808AnalyzeResultDto> Analyze(JT808AnalyzeDto request) | |||||
{ | |||||
ResultDto<JT808AnalyzeResultDto> result = new ResultDto<JT808AnalyzeResultDto>(); | |||||
result.Result = new JT808AnalyzeResultDto(); | |||||
return result; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,64 @@ | |||||
using Microsoft.AspNetCore.Mvc; | |||||
using System.Net.NetworkInformation; | |||||
using JT809.Protocol; | |||||
using JT809.Protocol.Extensions; | |||||
using Newtonsoft.Json; | |||||
using JT809.Protocol.Configs; | |||||
using JT809.Protocol.Interfaces; | |||||
using JT809.Protocol.Exceptions; | |||||
using JTTools.Configs; | |||||
using JT809.Protocol.Enums; | |||||
using JTTools.Dtos; | |||||
using System.Reflection.Emit; | |||||
using JT808.Protocol; | |||||
namespace JTTools.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[ApiController] | |||||
[Route("jtt/[controller]")] | |||||
public class JT809Controller : ControllerBase | |||||
{ | |||||
JT809_2011_Config config2011; | |||||
JT809_2019_Config config2019; | |||||
JT809Serializer serializer2011; | |||||
JT809Serializer serializer2019; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="config2011"></param> | |||||
/// <param name="config2019"></param> | |||||
public JT809Controller( | |||||
JT809_2011_Config config2011, | |||||
JT809_2019_Config config2019 | |||||
) | |||||
{ | |||||
this.config2011 = config2011; | |||||
this.config2019 = config2019; | |||||
serializer2011 = config2011.GetSerializer(); | |||||
serializer2019 = config2019.GetSerializer(); | |||||
} | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="request"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[Route("Analyze")] | |||||
public ResultDto<JT809AnalyzeResultDto> Analyze(JT809AnalyzeDto request) | |||||
{ | |||||
ResultDto<JT809AnalyzeResultDto> result = new ResultDto<JT809AnalyzeResultDto>(); | |||||
result.Result = new JT809AnalyzeResultDto(); | |||||
return result; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,44 @@ | |||||
using Microsoft.AspNetCore.Mvc; | |||||
using System.Net.NetworkInformation; | |||||
using JTTools.Configs; | |||||
using System.IO; | |||||
using System.Reflection; | |||||
using System.Text; | |||||
using System.Text.Encodings.Web; | |||||
using System.Text.Unicode; | |||||
using JT808.Protocol.Interfaces; | |||||
using JTTools.Dtos; | |||||
using System.Reflection.Emit; | |||||
using JT905.Protocol; | |||||
namespace JTTools.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[ApiController] | |||||
[Route("jtt/[controller]")] | |||||
public class JT905Controller : ControllerBase | |||||
{ | |||||
IJT905Config config; | |||||
JT905Serializer serializer; | |||||
public JT905Controller(IJT905Config config) | |||||
{ | |||||
this.config = config; | |||||
this.serializer = new JT905Serializer(config); | |||||
} | |||||
[HttpPost] | |||||
[Route("Analyze")] | |||||
public ResultDto<JT905AnalyzeResultDto> Analyze(JT905AnalyzeDto request) | |||||
{ | |||||
ResultDto<JT905AnalyzeResultDto> result = new ResultDto<JT905AnalyzeResultDto>(); | |||||
result.Result = new JT905AnalyzeResultDto(); | |||||
return result; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,40 @@ | |||||
using Microsoft.AspNetCore.Mvc; | |||||
using JTTools.Configs; | |||||
using JTTools.Dtos; | |||||
using JTActiveSafety.Protocol; | |||||
using JTActiveSafety.Protocol.Extensions; | |||||
namespace JTTools.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
[ApiController] | |||||
[Route("jtt/[controller]")] | |||||
public class JTActiveSafetyController : ControllerBase | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="request">"30 31 63 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61 6C 61 72 6D 2E 78 6C 73 78 00 00 00 01 00 00 00 05 01 02 03 04 05"</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[Route("Analyze")] | |||||
public ResultDto<JTActiveSafetyAnalyzeResultDto> Analyze(JTActiveSafetyAnalyzeDto request) | |||||
{ | |||||
ResultDto<JTActiveSafetyAnalyzeResultDto> result = new ResultDto<JTActiveSafetyAnalyzeResultDto>(); | |||||
result.Result = new JTActiveSafetyAnalyzeResultDto(); | |||||
try | |||||
{ | |||||
var data = request.Hex.ToHexBytes(); | |||||
result.Result.JsonValue = JTActiveSafetySerializer.Analyze(data, options: JTJsonWriterOptions.Instance); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
result.Code = 500; | |||||
result.Message = ex.StackTrace??""; | |||||
} | |||||
return result; | |||||
} | |||||
} | |||||
} |
@@ -1,22 +0,0 @@ | |||||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | |||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base | |||||
WORKDIR /app | |||||
EXPOSE 80 | |||||
EXPOSE 443 | |||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build | |||||
WORKDIR /src | |||||
COPY ["JTTools/JTTools.csproj", "JTTools/"] | |||||
RUN dotnet restore "JTTools/JTTools.csproj" | |||||
COPY . . | |||||
WORKDIR "/src/JTTools" | |||||
RUN dotnet build "JTTools.csproj" -c Release -o /app/build | |||||
FROM build AS publish | |||||
RUN dotnet publish "JTTools.csproj" -c Release -o /app/publish | |||||
FROM base AS final | |||||
WORKDIR /app | |||||
COPY --from=publish /app/publish . | |||||
ENTRYPOINT ["dotnet", "JTTools.dll"] |
@@ -0,0 +1,13 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT1078AnalyzeDto | |||||
{ | |||||
/// <summary> | |||||
/// hex字符串 | |||||
/// </summary> | |||||
public string Hex { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT1078AnalyzeResultDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string JsonValue { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,17 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT19056AnalyzeDto | |||||
{ | |||||
/// <summary> | |||||
/// up/down | |||||
/// </summary> | |||||
public string ProtocolType { get; set; } = "up"; | |||||
/// <summary> | |||||
/// hex字符串 | |||||
/// </summary> | |||||
public string Hex { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT19056AnalyzeResultDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string JsonValue { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,17 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT808AnalyzeDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string ProtocolType { get; set; } = ""; | |||||
/// <summary> | |||||
/// hex字符串 | |||||
/// </summary> | |||||
public List<string> Hex { get; set; } = new List<string>(); | |||||
} | |||||
} |
@@ -0,0 +1,64 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT808AnalyzeResultDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public bool IsSubpackage { get; set; } = false; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string JsonValue { get; set; } = ""; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public List<JT808PackageInfoDto> Packages{ get; set; } = new List<JT808PackageInfoDto>(); | |||||
} | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT808PackageInfoDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string TerminalPhoneNo { get; set; } = ""; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string MsgId { get; set; } = ""; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public int MsgNum { get; set; } | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string ProtocolVersion { get; set; } = ""; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public int PackgeCount { get; set; } | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public int PackageIndex { get; set; } | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public int DataLength { get; set; } | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public bool Encrypt { get; set; }= false; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string Body { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,35 @@ | |||||
using JT809.Protocol.Configs; | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT809AnalyzeDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string ProtocolType { get; set; } = ""; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public bool IsEncrypt { get; set; } = false; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public long M1 { get; set; } = 0; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public long IA1 { get; set; } = 0; | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public long IC1 { get; set; } = 0; | |||||
/// <summary> | |||||
/// hex字符串 | |||||
/// </summary> | |||||
public string Hex { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT809AnalyzeResultDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string JsonValue { get; set; } = ""; | |||||
} | |||||
} |
@@ -1,14 +0,0 @@ | |||||
using JT809.Protocol.Configs; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace JTTools.Dtos | |||||
{ | |||||
public class JT809RequestDto: JTRequestDto | |||||
{ | |||||
public bool IsEncrypt { get; set; } = false; | |||||
public JT809EncryptOptions EncryptOptions { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,17 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT905AnalyzeDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string ProtocolType { get; set; } = ""; | |||||
/// <summary> | |||||
/// hex字符串 | |||||
/// </summary> | |||||
public List<string> Hex { get; set; } = new List<string>(); | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JT905AnalyzeResultDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string JsonValue { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JTActiveSafetyAnalyzeDto | |||||
{ | |||||
/// <summary> | |||||
/// hex字符串 | |||||
/// </summary> | |||||
public string Hex { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public class JTActiveSafetyAnalyzeResultDto | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
public string JsonValue { get; set; } = ""; | |||||
} | |||||
} |
@@ -1,14 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace JTTools.Dtos | |||||
{ | |||||
public class JTRequestDto | |||||
{ | |||||
public string HexData { get; set; } | |||||
public bool Skip { get; set; } | |||||
public bool Custom { get; set; } | |||||
} | |||||
} |
@@ -1,14 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace JTTools.Dtos | |||||
{ | |||||
public class JTResultDto | |||||
{ | |||||
public int Code { get; set; } | |||||
public string Message { get; set; } | |||||
public object Data { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,17 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
/// <summary> | |||||
/// 字典 | |||||
/// </summary> | |||||
public class JTTDictDto | |||||
{ | |||||
/// <summary> | |||||
/// Label | |||||
/// </summary> | |||||
public string Label { get; set; } = ""; | |||||
/// <summary> | |||||
/// Value | |||||
/// </summary> | |||||
public string Value { get; set; } = ""; | |||||
} | |||||
} |
@@ -0,0 +1,9 @@ | |||||
namespace JTTools.Dtos | |||||
{ | |||||
public class ResultDto<T> | |||||
{ | |||||
public string Message { get; set; } = ""; | |||||
public int Code { get; set; } = 200; | |||||
public T? Result { get; set; } = default; | |||||
} | |||||
} |
@@ -1,29 +0,0 @@ | |||||
using Newtonsoft.Json; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace JTTools | |||||
{ | |||||
public class ByteArrayHexConverter : JsonConverter | |||||
{ | |||||
public override bool CanConvert(Type objectType) => objectType == typeof(byte[]); | |||||
public override bool CanRead => false; | |||||
public override bool CanWrite => true; | |||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) => throw new NotImplementedException(); | |||||
private readonly string _separator; | |||||
public ByteArrayHexConverter(string separator = " ") => _separator = separator; | |||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) | |||||
{ | |||||
var hexString = string.Join(_separator, ((byte[])value).Select(p => p.ToString("X2"))); | |||||
writer.WriteValue(hexString); | |||||
} | |||||
} | |||||
} |
@@ -1,37 +0,0 @@ | |||||
using Microsoft.AspNetCore.Http; | |||||
using Microsoft.AspNetCore.Mvc.Formatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Text.Json; | |||||
using System.Text.Json.Serialization; | |||||
using System.Threading.Tasks; | |||||
namespace JTTools.JsonConvert | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// ref:https://github.com/dotnet/corefx/blob/release/3.0/src/System.Text.Json/tests/Serialization/CustomConverterTests.Array.cs | |||||
/// </summary> | |||||
public class ByteArrayHexTextJsonConverter : JsonConverter<byte[]> | |||||
{ | |||||
public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |||||
{ | |||||
//string hexJson = reader.get(); | |||||
var hexJson = reader.GetString(); | |||||
var list = new List<byte>(); | |||||
foreach (string str in hexJson.Split(new string[] { ",", " " }, StringSplitOptions.RemoveEmptyEntries)) | |||||
{ | |||||
list.Add(Convert.ToByte(str, 16)); | |||||
} | |||||
return list.ToArray(); | |||||
} | |||||
public override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options) | |||||
{ | |||||
var hexString = string.Join(" ", (value).Select(p => p.ToString("X2"))); | |||||
writer.WriteStringValue(hexString); | |||||
} | |||||
} | |||||
} |
@@ -1,16 +0,0 @@ | |||||
@page "/error" | |||||
<h1 class="text-danger">Error.</h1> | |||||
<h2 class="text-danger">An error occurred while processing your request.</h2> | |||||
<h3>Development Mode</h3> | |||||
<p> | |||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred. | |||||
</p> | |||||
<p> | |||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong> | |||||
It can result in displaying sensitive information from exceptions to end users. | |||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> | |||||
and restarting the app. | |||||
</p> |
@@ -1,39 +0,0 @@ | |||||
@page "/" | |||||
<Title Level="1">JTTools</Title> | |||||
<Paragraph> | |||||
<blockquote> | |||||
JT808、JT809、JT1078、JT19056、JTNE(新能源)、JT808主动安全(苏标)解析工具、JT808主动安全(粤标)解析工具 | |||||
</blockquote> | |||||
<ul class="list"> | |||||
<li>支持锐明808公交业务扩展协议</li> | |||||
<li>支持主动安全附件(苏标)分析工具</li> | |||||
<li>808分包解析</li> | |||||
<li>地图-经纬度解析</li> | |||||
<li>808分包的各个包的解析及展示</li> | |||||
<li>支持808(粤标)分析工具</li> | |||||
<li>支持808的2011版本分析工具</li> | |||||
<li>支持808多包解析</li> | |||||
<li>支持808私有协议扩展库</li> | |||||
<li>支持809的2019版本解析808的车辆定位信息包</li> | |||||
<li>支持809的2011版本和补充版本的上传车辆注册信息解析(♥)</li> | |||||
</ul> | |||||
</Paragraph> | |||||
<style> | |||||
.list li { | |||||
position: relative; | |||||
list-style: none; | |||||
padding: 0 0 0 2em !important; | |||||
margin: 0 !important | |||||
} | |||||
.list li::before { | |||||
position: absolute; | |||||
content: "\2022"; | |||||
text-align: center; | |||||
opacity:0.5; | |||||
left: 0; | |||||
font-size: 2em; | |||||
line-height: .75; | |||||
} | |||||
</style> |
@@ -1,633 +0,0 @@ | |||||
@page "/jt1078pack" | |||||
@using JT808.Protocol; | |||||
@using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
@using JT808.Protocol.Extensions; | |||||
@using JT808.Protocol.Exceptions; | |||||
@using JTTools.Configs; | |||||
@using System.Text; | |||||
@using System.Text.Encodings.Web; | |||||
@using System.Text.Unicode; | |||||
@inject IJT808Config config | |||||
@inject JT808_JT1078_Config jT808_JT1078_Config | |||||
@using OneOf; | |||||
@using System.ComponentModel.DataAnnotations; | |||||
@using System.Text.Json; | |||||
@using System.ComponentModel; | |||||
<Space Direction="DirectionVHType.Vertical" Style="width:100%"> | |||||
<SpaceItem> | |||||
<Select DefaultValue="@("0x9101")" TItemValue="string" TItem="string" @bind-Value="@MsgType" OnSelectedItemChanged="OnSelectMsgType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0x9101")" Label="808_打开看视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0x9102")" Label="808_关闭看视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0x9205")" Label="808_查询资源列表" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0x9206")" Label="808_文件上传" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
@if (MsgType == "0x9101") | |||||
{ | |||||
<Form Model="@jT_0X9101_Form"> | |||||
<Row Gutter="8"> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.Sim" Placeholder="123456789012" AllowClear> | |||||
<AddOnBefore>SIM</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.SN" AllowClear> | |||||
<AddOnBefore>流水号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.IPAddress" Placeholder="127.0.0.1" AllowClear> | |||||
<AddOnBefore>IP地址</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.TcpPort" AllowClear> | |||||
<AddOnBefore>Tcp端口</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.UdpPort" AllowClear> | |||||
<AddOnBefore>Udp端口</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.LogicalChannelNo" AllowClear> | |||||
<AddOnBefore>通道号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" DefaultValue="@context.DataType" @bind-Value="@context.DataType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="音视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="双向对讲" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("3")" Label="监听" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("4")" Label="中心广播" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("5")" Label="透传" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" DefaultValue="@context.StreamType" @bind-Value="@context.StreamType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="主码流" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="子码流" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
</Row> | |||||
<FormItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="@Pack">组包</Button> | |||||
</FormItem> | |||||
</Form> | |||||
} | |||||
else if (MsgType == "0x9102") | |||||
{ | |||||
<Form Model="@jT_0x9102_Form"> | |||||
<Row Gutter="8"> | |||||
<GridCol Span="8"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.Sim" Placeholder="123456789012" AllowClear> | |||||
<AddOnBefore>SIM</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="8"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.SN" AllowClear> | |||||
<AddOnBefore>流水号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="8"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.LogicalChannelNo" AllowClear> | |||||
<AddOnBefore>通道号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="8"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.ControlCmd"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="关闭音视频传输指令" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="切换码流(增加暂停和继续)" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="暂停该通道所有流的发送" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("3")" Label="恢复暂停前流的发送,与暂停前的流类型一致" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("4")" Label="关闭双向对讲" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="8"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.CloseAVData"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="关闭该通道有关的音视频数据" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="只关闭该通道有关的音频,保留该通道有关的视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="只关闭该通道有关的视频,保留该通道有关的音频" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="8"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.SwitchStreamType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="主码流" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="子码流" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
</Row> | |||||
<FormItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="@Pack">组包</Button> | |||||
</FormItem> | |||||
</Form> | |||||
} | |||||
else if (MsgType == "0x9205") | |||||
{ | |||||
<Form Model="@jT_0X9205_Form"> | |||||
<Row Gutter="8"> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.Sim" Placeholder="123456789012" AllowClear> | |||||
<AddOnBefore>SIM</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.SN" AllowClear> | |||||
<AddOnBefore>流水号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.LogicalChannelNo" AllowClear> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<DatePicker TValue="DateTime?" ShowTime="@true" | |||||
@bind-Value="@context.BeginTime" | |||||
Format="yyyy-MM-dd HH:mm:ss" | |||||
DisabledDate="date => date <= DateTime.Now"> | |||||
</DatePicker> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<DatePicker TValue="DateTime?" ShowTime="@true" | |||||
@bind-Value="@context.EndTime" | |||||
Format="yyyy-MM-dd HH:mm:ss" | |||||
DisabledDate="date => date <= DateTime.Now" /> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.AlarmFlag"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("00000000000000000000000000000000")" Label="无报警类型" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="超速报警" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="疲劳驾驶" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("3")" Label="预警" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("4")" Label="GNSS模块发生故障" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.MediaType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="音视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="音频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("3")" Label="视频或音视频" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.StreamType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="所有码流" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="主码流" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="子码流" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.MemoryType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="所有存储器" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="主存储器" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="灾备存储器" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
</Row> | |||||
<FormItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="@Pack">组包</Button> | |||||
</FormItem> | |||||
</Form> | |||||
} | |||||
else if (MsgType == "0x9206") | |||||
{ | |||||
<Form Model="@jT_0X9206_Form"> | |||||
<Row Gutter="8"> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.Sim" Placeholder="123456789012" AllowClear> | |||||
<AddOnBefore>SIM</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.SN" AllowClear> | |||||
<AddOnBefore>流水号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.ServerIP" Placeholder="127.0.0.1" AllowClear> | |||||
<AddOnBefore>FTP服务器地址</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.Port" AllowClear> | |||||
<AddOnBefore>FTP服务器端口号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.UserName" Placeholder="127.0.0.1" AllowClear> | |||||
<AddOnBefore>FTP用户名</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.Password" AllowClear> | |||||
<AddOnBefore>FTP密码</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.FileUploadPath" AllowClear> | |||||
<AddOnBefore>文件上传路径</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<AntDesign.Input @bind-Value="@context.LogicalChannelNo" AllowClear> | |||||
<AddOnBefore>逻辑通道号</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<DatePicker TValue="DateTime?" ShowTime="@true" | |||||
@bind-Value="@context.BeginTime" | |||||
Format="yyyy-MM-dd HH:mm:ss" | |||||
DisabledDate="date => date <= DateTime.Now"> | |||||
</DatePicker> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<DatePicker TValue="DateTime?" ShowTime="@true" | |||||
@bind-Value="@context.EndTime" | |||||
Format="yyyy-MM-dd HH:mm:ss" | |||||
DisabledDate="date => date <= DateTime.Now" /> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.AlarmFlag"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("00000000000000000000000000000000")" Label="无报警类型" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="超速报警" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="疲劳驾驶" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("3")" Label="预警" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("4")" Label="GNSS模块发生故障" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.MediaType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="音视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="音频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="视频" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("3")" Label="视频或音视频" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.StreamType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="所有码流" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="主码流" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="子码流" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.MemoryType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="所有存储器" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="主存储器" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="灾备存储器" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
<GridCol Span="6"> | |||||
<FormItem> | |||||
<Select TItemValue="string" TItem="string" @bind-Value="@context.TaskExcuteCondition"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("0")" Label="WI-FI可下载" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("1")" Label="LAN连接时可下载" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("2")" Label="3G/4G连接时可下载" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("7")" Label="WIFI,LAN,3G/4G" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</FormItem> | |||||
</GridCol> | |||||
</Row> | |||||
<FormItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="@Pack">组包</Button> | |||||
</FormItem> | |||||
</Form> | |||||
} | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
<TextArea AllowClear="true" AutoSize="true" MinRows="10" MaxRows="30" @bind-Value="@HexData" /> | |||||
</SpaceItem> | |||||
</Space> | |||||
@code { | |||||
string MsgType = "0x9101"; | |||||
JT_0x9101_Form jT_0X9101_Form = new JT_0x9101_Form(); | |||||
JT_0x9102_Form jT_0x9102_Form = new JT_0x9102_Form(); | |||||
/// <summary> | |||||
/// 1078查询资源列表 | |||||
/// </summary> | |||||
JT_0x9205_Form jT_0X9205_Form = new JT_0x9205_Form(); | |||||
/// <summary> | |||||
/// 1078文件上传 | |||||
/// </summary> | |||||
JT_0x9206_Form jT_0X9206_Form = new JT_0x9206_Form(); | |||||
JT808Serializer JT1078Serializer; | |||||
private string HexData = ""; | |||||
protected override void OnInitialized() | |||||
{ | |||||
JT1078Serializer = jT808_JT1078_Config.GetSerializer(); | |||||
} | |||||
void OnSelectMsgType(string value) | |||||
{ | |||||
MsgType = value; | |||||
} | |||||
void Pack() | |||||
{ | |||||
try | |||||
{ | |||||
JT808Package jT808Package = new JT808Package(); | |||||
JT808Header header = new JT808Header(); | |||||
if (MsgType == "0x9101") | |||||
{ | |||||
header.MsgId = 0x9101; | |||||
header.ManualMsgNum = (ushort)jT_0X9101_Form.SN; | |||||
header.TerminalPhoneNo = jT_0X9101_Form.Sim; | |||||
jT808Package.Header = header; | |||||
JT808_0x9101 jT808_0X9101 = new JT808_0x9101(); | |||||
jT808_0X9101.ServerIp = jT_0X9101_Form.IPAddress; | |||||
jT808_0X9101.TcpPort = (ushort)jT_0X9101_Form.TcpPort; | |||||
jT808_0X9101.UdpPort = (ushort)jT_0X9101_Form.UdpPort; | |||||
jT808_0X9101.ChannelNo = jT_0X9101_Form.LogicalChannelNo; | |||||
jT808_0X9101.DataType = byte.Parse(jT_0X9101_Form.DataType); | |||||
jT808_0X9101.StreamType = byte.Parse(jT_0X9101_Form.StreamType); | |||||
jT808Package.Bodies = jT808_0X9101; | |||||
HexData = JT1078Serializer.Serialize(jT808Package).ToHexString(); | |||||
} | |||||
else if (MsgType == "0x9102") | |||||
{ | |||||
header.MsgId = 0x9102; | |||||
header.ManualMsgNum = (ushort)jT_0x9102_Form.SN; | |||||
header.TerminalPhoneNo = jT_0x9102_Form.Sim; | |||||
jT808Package.Header = header; | |||||
JT808_0x9102 jT808_0X9102 = new JT808_0x9102(); | |||||
jT808_0X9102.ChannelNo = jT_0x9102_Form.LogicalChannelNo; | |||||
jT808_0X9102.ControlCmd = byte.Parse(jT_0x9102_Form.ControlCmd); | |||||
jT808_0X9102.CloseAVData = byte.Parse(jT_0x9102_Form.CloseAVData); | |||||
jT808_0X9102.StreamType = byte.Parse(jT_0x9102_Form.SwitchStreamType); | |||||
jT808Package.Bodies = jT808_0X9102; | |||||
HexData = JT1078Serializer.Serialize(jT808Package).ToHexString(); | |||||
} | |||||
else if (MsgType == "0x9205") | |||||
{ | |||||
header.MsgId = 0x9205; | |||||
header.ManualMsgNum = (ushort)jT_0X9205_Form.SN; | |||||
header.TerminalPhoneNo = jT_0X9205_Form.Sim; | |||||
jT808Package.Header = header; | |||||
JT808.Protocol.MessageBody.JT808_0x0200 jT808_0X0200 = new JT808.Protocol.MessageBody.JT808_0x0200(); | |||||
jT808_0X0200.AlarmFlag = (uint)JT808.Protocol.Enums.JT808Alarm.gnss_ant_not_connected; | |||||
JT808_0x9205 jT808_0X9205 = new JT808_0x9205(); | |||||
jT808_0X9205.ChannelNo = jT_0X9205_Form.LogicalChannelNo; | |||||
jT808_0X9205.BeginTime = (DateTime)jT_0X9205_Form.BeginTime; | |||||
jT808_0X9205.EndTime = (DateTime)jT_0X9205_Form.EndTime; | |||||
jT808_0X9205.AlarmFlag = ulong.Parse(jT_0X9205_Form.AlarmFlag); | |||||
jT808_0X9205.MediaType = byte.Parse(jT_0X9205_Form.MediaType); | |||||
jT808_0X9205.StreamType = byte.Parse(jT_0X9205_Form.MemoryType); | |||||
jT808_0X9205.MemoryType = byte.Parse(jT_0X9205_Form.MemoryType); | |||||
jT808Package.Bodies = jT808_0X9205; | |||||
HexData = JT1078Serializer.Serialize(jT808Package).ToHexString(); | |||||
} | |||||
else if (MsgType == "0x9206") | |||||
{ | |||||
header.MsgId = 0x9206; | |||||
header.ManualMsgNum = (ushort)jT_0X9206_Form.SN; | |||||
header.TerminalPhoneNo = jT_0X9206_Form.Sim; | |||||
jT808Package.Header = header; | |||||
JT808_0x9206 jT808_0X9206 = new JT808_0x9206(); | |||||
jT808_0X9206.ServerIpLength = byte.Parse(jT_0X9206_Form.ServerIP.Length.ToString()); | |||||
jT808_0X9206.ServerIp = jT_0X9206_Form.ServerIP; | |||||
jT808_0X9206.Port = ushort.Parse(jT_0X9206_Form.Port); | |||||
jT808_0X9206.UserName = jT_0X9206_Form.UserName; | |||||
jT808_0X9206.Password = jT_0X9206_Form.Password; | |||||
jT808_0X9206.FileUploadPath = jT_0X9206_Form.FileUploadPath??""; | |||||
jT808_0X9206.BeginTime = (DateTime)jT_0X9206_Form.BeginTime; | |||||
jT808_0X9206.EndTime = (DateTime)jT_0X9206_Form.EndTime; | |||||
jT808_0X9206.AlarmFlag = ulong.Parse(jT_0X9206_Form.AlarmFlag); | |||||
jT808_0X9206.MediaType = byte.Parse(jT_0X9206_Form.MediaType); | |||||
jT808_0X9206.StreamType = byte.Parse(jT_0X9206_Form.MemoryType); | |||||
jT808_0X9206.MemoryPositon = byte.Parse(jT_0X9206_Form.MemoryType); | |||||
jT808_0X9206.TaskExcuteCondition = byte.Parse(jT_0X9206_Form.TaskExcuteCondition); | |||||
jT808Package.Bodies = jT808_0X9206; | |||||
HexData = JT1078Serializer.Serialize(jT808Package).ToHexString(); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
HexData = ex.StackTrace; | |||||
} | |||||
} | |||||
public class JT_0x9101_Form | |||||
{ | |||||
[Required] | |||||
public string Sim { get; set; } = "123456789012"; | |||||
[Required] | |||||
public int SN { get; set; } = new Random().Next(1, 2000); | |||||
[Required] | |||||
public string IPAddress { get; set; } = "127.0.0.1"; | |||||
[Required] | |||||
public int TcpPort { get; set; } | |||||
[Required] | |||||
public int UdpPort { get; set; } | |||||
[Required] | |||||
public byte LogicalChannelNo { get; set; } | |||||
[Required] | |||||
public string DataType { get; set; } = "1"; | |||||
[Required] | |||||
public string StreamType { get; set; } = "1"; | |||||
} | |||||
public class JT_0x9102_Form | |||||
{ | |||||
[Required] | |||||
public string Sim { get; set; } = "123456789012"; | |||||
[Required] | |||||
public int SN { get; set; } = new Random().Next(1, 2000); | |||||
[Required] | |||||
public byte LogicalChannelNo { get; set; } | |||||
[Required] | |||||
public string ControlCmd { get; set; } = "0"; | |||||
[Required] | |||||
public string CloseAVData { get; set; } = "0"; | |||||
[Required] | |||||
public string SwitchStreamType { get; set; } = "1"; | |||||
} | |||||
public class JT_0x9205_Form | |||||
{ | |||||
[Required] | |||||
public string Sim { get; set; } = "123456789012"; | |||||
[Required] | |||||
public int SN { get; set; } = new Random().Next(1, 2000); | |||||
[Required, DisplayName("逻辑通道号")] | |||||
public byte LogicalChannelNo { get; set; } = 4; | |||||
[Required, DisplayName("开始时间")] | |||||
public DateTime? BeginTime { get; set; } = DateTime.Today; | |||||
[Required, DisplayName("结束时间")] | |||||
public DateTime? EndTime { get; set; } = DateTime.Now; | |||||
[Required, DisplayName("报警标志")] | |||||
public string AlarmFlag { get; set; } = "00000000000000000000000000000000"; | |||||
[Required, DisplayName("音视频资源类型")] | |||||
public string MediaType { get; set; } = "0"; | |||||
[Required, DisplayName("码流类型")] | |||||
public string StreamType { get; set; } = "0"; | |||||
[Required, DisplayName("存储器类型")] | |||||
public string MemoryType { get; set; } = "0"; | |||||
} | |||||
public class JT_0x9206_Form | |||||
{ | |||||
[Required] | |||||
public string Sim { get; set; } = "123456789012"; | |||||
[Required] | |||||
public int SN { get; set; } = new Random().Next(1, 2000); | |||||
[Required] | |||||
public byte LogicalChannelNo { get; set; } = 4; | |||||
public string ServerIP { get; set; } = "127.0.0.1"; | |||||
public string Port { get; set; } = "6201"; | |||||
public string UserName { get; set; } = "053500"; | |||||
public string Password { get; set; } = "053500"; | |||||
public string FileUploadPath { get; set; } = "./aaaaaaa"; | |||||
[Required, DisplayName("开始时间")] | |||||
public DateTime? BeginTime { get; set; } = DateTime.Today; | |||||
[Required, DisplayName("结束时间")] | |||||
public DateTime? EndTime { get; set; } = DateTime.Now; | |||||
[Required, DisplayName("报警标志")] | |||||
public string AlarmFlag { get; set; } = "00000000000000000000000000000000"; | |||||
[Required, DisplayName("音视频资源类型")] | |||||
public string MediaType { get; set; } = "0"; | |||||
[Required, DisplayName("码流类型")] | |||||
public string StreamType { get; set; } = "0"; | |||||
[Required, DisplayName("存储器类型")] | |||||
public string MemoryType { get; set; } = "0"; | |||||
public string TaskExcuteCondition { get; set; } = "7"; | |||||
} | |||||
} |
@@ -1,60 +0,0 @@ | |||||
@page "/jt1078" | |||||
@using JT1078.Protocol; | |||||
@using JT1078.Protocol.Extensions; | |||||
@using JTTools.Configs; | |||||
<Space Direction="DirectionVHType.Vertical" Style="width:100%"> | |||||
<SpaceItem> | |||||
<TextArea AllowClear="true" Rows="4" @bind-Value="@HexData" /> | |||||
</SpaceItem> | |||||
@if (isOpen) | |||||
{ | |||||
<SpaceItem> | |||||
<Alert Type="@AlertType.Error" Description="@ErrerMessage" Closable AfterClose="OnDismiss" /> | |||||
</SpaceItem> | |||||
} | |||||
<SpaceItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="Query">分析</Button> | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
<div class="right"> | |||||
<pre> | |||||
@Json | |||||
</pre> | |||||
</div> | |||||
</SpaceItem> | |||||
</Space> | |||||
@code { | |||||
private string HexData = "30 31 63 64 81 E2 10 88 01 12 34 56 78 10 01 10 00 00 01 6B B3 92 CA 7C 02 80 00 28 00 2E 00 00 00 01 61 E1 A2 BF 00 98 CF C0 EE 1E 17 28 34 07 78 8E 39 A4 03 FD DB D1 D5 46 BF B0 63 01 3F 59 AC 34 C9 7A 02 1A B9 6A 28 A4 2C 08"; | |||||
private string Json; | |||||
private string ErrerMessage; | |||||
private bool isOpen = false; | |||||
void OnDismiss() | |||||
{ | |||||
isOpen = !isOpen; | |||||
} | |||||
private void Query() | |||||
{ | |||||
try | |||||
{ | |||||
isOpen = false; | |||||
var data = HexData.ToHexBytes(); | |||||
Json = JT1078Serializer.Analyze(data, options: JTJsonWriterOptions.Instance); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
isOpen = !isOpen; | |||||
Json = ""; | |||||
ErrerMessage = ex.StackTrace; | |||||
} | |||||
} | |||||
} |
@@ -1,104 +0,0 @@ | |||||
@page "/jt19056" | |||||
@using JT808.Protocol; | |||||
@using JT808.Protocol.Extensions; | |||||
@using JTTools.Configs; | |||||
@inject IJT808Config Config | |||||
<Space Direction="DirectionVHType.Vertical" Style="width:100%"> | |||||
<SpaceItem> | |||||
<Select @bind-Value="@wayType" DefaultValue="@("up")" TItemValue="string" TItem="string" OnSelectedItemChanged="@OnSelectWayType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("up")" Label="上行" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("down")" Label="下行" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
<div class="right"> | |||||
<TextArea AllowClear="true" Rows="4" @bind-Value="@HexData" /> | |||||
<pre> | |||||
@Json | |||||
</pre> | |||||
</div> | |||||
</SpaceItem> | |||||
@if (isOpen) | |||||
{ | |||||
<SpaceItem> | |||||
<Alert Type="@AlertType.Error" Description="@ErrerMessage" Closable AfterClose="OnDismiss" /> | |||||
</SpaceItem> | |||||
} | |||||
<SpaceItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="Query">分析</Button> | |||||
</SpaceItem> | |||||
</Space> | |||||
@code { | |||||
private JT808CarDVRSerializer Serializer; | |||||
private static string UpHexData = "55 7A C4 00 00 00 EB"; | |||||
private static string DownHexData = "55 7A C4 00 14 00 20 03 25 10 26 01 20 03 25 10 26 01 00 00 12 34 00 12 34 56 A9"; | |||||
private string HexData = UpHexData; | |||||
string wayType = "up"; | |||||
private void OnSelectWayType(string value) | |||||
{ | |||||
wayType = value; | |||||
switch (wayType) | |||||
{ | |||||
case "up": | |||||
HexData = UpHexData; | |||||
Json = ""; | |||||
break; | |||||
case "down": | |||||
HexData = DownHexData; | |||||
Json = ""; | |||||
break; | |||||
} | |||||
StateHasChanged(); | |||||
} | |||||
private string Json; | |||||
private string ErrerMessage; | |||||
private bool isOpen = false; | |||||
void OnDismiss() | |||||
{ | |||||
isOpen = !isOpen; | |||||
} | |||||
protected override void OnInitialized() | |||||
{ | |||||
Serializer = Config.GetCarDVRSerializer(); | |||||
} | |||||
private void Query() | |||||
{ | |||||
try | |||||
{ | |||||
isOpen = false; | |||||
var data = HexData.ToHexBytes(); | |||||
switch (wayType) | |||||
{ | |||||
case "up": | |||||
Json = Serializer.UpAnalyze(data, options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "down": | |||||
Json = Serializer.DownAnalyze(data, options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
isOpen = !isOpen; | |||||
Json = ""; | |||||
ErrerMessage = ex.StackTrace; | |||||
} | |||||
} | |||||
} |
@@ -1,357 +0,0 @@ | |||||
@page "/jt808" | |||||
@using JT808.Protocol; | |||||
@using JT808.Protocol.Extensions; | |||||
@using JT808.Protocol.Exceptions; | |||||
@using JTTools.Configs; | |||||
@using System.IO; | |||||
@using System.Reflection; | |||||
@using System.Text; | |||||
@using System.Text.Encodings.Web; | |||||
@using System.Text.Unicode; | |||||
@using JT808.Protocol.Interfaces; | |||||
@inject IJT808Config config | |||||
@inject JT808_JT1078_Config jT808_JT1078_Config | |||||
@inject JT808_SuBiao_Config jT808_SuBiao_Config | |||||
@inject JT808_Streamax_Config jT808_Streamax_Config | |||||
@inject JT808_YueBiao_Config jT808_YueBiao_Config | |||||
@using OneOf; | |||||
<Space Direction="DirectionVHType.Vertical" Style="width:100%"> | |||||
<SpaceItem> | |||||
<Alert Type="@AlertType.Warning" ShowIcon="true" Closable Message="小技巧" Description="如有分包或多包,请换行(回车)区分。" /> | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
<Select TItemValue="string" TItem="string" DefaultValue="@("JT808")" @bind-Value="@protocolType" OnSelectedItemChanged="OnSelectProtocolType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Label="国标(通过包自动识别版本号)" Value="@("JT808")" /> | |||||
<SelectOption TItemValue="string" TItem="string" Label="国标扩展JT1078" Value="@("JT808_JT1078")" /> | |||||
<SelectOption TItemValue="string" TItem="string" Label="国标扩展主动安全(苏标)" Value="@("JT808_SuBiao")" /> | |||||
<SelectOption TItemValue="string" TItem="string" Label="国标扩展主动安全(粤标)" Value="@("JT808_YueBiao")" /> | |||||
<SelectOption TItemValue="string" TItem="string" Label="公交扩展协议(锐明)" Value="@("JT808_JTRM")" /> | |||||
<SelectOption TItemValue="string" TItem="string" Label="国标(强制使用2013版本解析)" Value="@("JT2013Force")" /> | |||||
<SelectOption TItemValue="string" TItem="string" Label="国标扩展私有协议" Value="@("JTPrivate")" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</SpaceItem> | |||||
@if (protocolType == "JTPrivate") | |||||
{ | |||||
<SpaceItem> | |||||
<Alert Type="@AlertType.Info" ShowIcon="true" Message="前置条件"> | |||||
<div>1.必须通过【https://github.com/SmallChi/JT808】实现的扩展库才可以支持</div> | |||||
<div>2.上传的文件只在浏览器本地,服务器不会收集任何私有协议库</div> | |||||
</Alert> | |||||
</SpaceItem> | |||||
<InputFile OnChange="@LoadFiles" /> | |||||
@*目前组件不支持 <Upload Name="files" Action="" OnSingleCompleted="OnJTPrivateSingleCompleted"> | |||||
<Button Icon="upload"> | |||||
<span>上传私有协议库(.dll)</span> | |||||
</Button> | |||||
</Upload>*@ | |||||
} | |||||
<SpaceItem> | |||||
<TextArea AllowClear="true" Rows="4" @bind-Value="@HexData" OnPressEnter="OnAreaTextPressEnter" /> | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
<Button Type="primary" @onclick="Query">分析</Button> | |||||
</SpaceItem> | |||||
@if (isOpen) | |||||
{ | |||||
<SpaceItem> | |||||
<Alert Type="@AlertType.Error" Description="@ErrerMessage" Closable AfterClose="OnDismiss" /> | |||||
</SpaceItem> | |||||
} | |||||
<SpaceItem> | |||||
<div style="min-height: 350px"> | |||||
@if (JT808HeaderPackages != null) | |||||
{ | |||||
<Collapse DefaultActiveKey="@(new[]{"1"})"> | |||||
@for (int i = 0; i < JT808HeaderPackages.Count; i++) | |||||
{ | |||||
var item = JT808HeaderPackages[i]; | |||||
var index = i + 1; | |||||
var header = $"序号:{index}"; | |||||
<Panel Key="@index.ToString()"> | |||||
<HeaderTemplate> | |||||
@header | |||||
<Tag Color="orange">终端号:@item.Header.TerminalPhoneNo</Tag> | |||||
<Tag Color="volcano">消息Id:@("0x" + item.Header.MsgId.ToString("X2"))</Tag> | |||||
<Tag Color="purple">消息流水号:@item.Header.MsgNum</Tag> | |||||
<Tag Color="pink">设备版本号:@(((JT808.Protocol.Enums.JT808Version)item.Header.ProtocolVersion).ToString())</Tag> | |||||
<Tag Color="red">总分包数:@item.Header.PackgeCount</Tag> | |||||
<Tag Color="blue">当前页:@item.Header.PackageIndex</Tag> | |||||
<Tag Color="cyan">数据体长度:@item.Header.MessageBodyProperty.DataLength</Tag> | |||||
<Tag Color="geekblue">是否加密:@item.Header.MessageBodyProperty.Encrypt.ToString()</Tag> | |||||
</HeaderTemplate> | |||||
<ChildContent> | |||||
<pre>@item.Bodies.ToHexString()</pre> | |||||
</ChildContent> | |||||
</Panel> | |||||
} | |||||
<Panel Header="合并数据体" Key="9999"> | |||||
<pre>@Json</pre> | |||||
</Panel> | |||||
</Collapse> | |||||
} | |||||
@if (JT808Packages != null) | |||||
{ | |||||
<Collapse DefaultActiveKey="@(new[]{"1"})"> | |||||
@for (int i = 0; i < JT808Packages.Count; i++) | |||||
{ | |||||
var item = JT808Packages[i]; | |||||
var index = i + 1; | |||||
var header = $"序号:{index}"; | |||||
<Panel Header="@header" Key="@index.ToString()"> | |||||
<pre>@item.Json</pre> | |||||
</Panel> | |||||
} | |||||
</Collapse> | |||||
} | |||||
</div> | |||||
</SpaceItem> | |||||
</Space> | |||||
@code { | |||||
private JT808Serializer Serializer; | |||||
private JT808Serializer JTRM_Serializer; | |||||
private JT808Serializer JTSuBiao_Serializer; | |||||
private JT808Serializer JTYueBiao_Serializer; | |||||
private JT808Serializer JT1078Serializer; | |||||
private JT808Serializer JTPrivateSerializer; | |||||
string protocolType = "JT808"; | |||||
private List<JT808HeaderPackage> JT808HeaderPackages; | |||||
private List<JT808PackageInfo> JT808Packages; | |||||
private IJT808Config JT808PrivateConfig; | |||||
private string HexData = HexDataTmp; | |||||
private static string HexDataTmp = "7E 02 00 00 26 12 34 56 78 90 12 00 7D 02 00 00 00 01 00 00 00 02 00 BA 7F 0E 07 E4 F1 1C 00 28 00 3C 00 00 18 10 15 10 10 10 01 04 00 00 00 64 02 02 00 7D 01 13 7E"; | |||||
private static string Hex2013ForceTmp = "7e0102400c01003000068109024a3130303330303030363831857e"; | |||||
private static string HexSubDataTmp = "7E120523A204066657506200EB00020001015A00000023012012191042052012191050190000000000000000000101064446D10120121910221720121910420500000000000000000001010F1FE8EB0120121910023420121910221700000000000000000001010F182D5C0120121909471120121910015500000000000000000001010B38F2430120121909274020121909471100000000000000000001010F056DB40120121909080920121909274000000000000000000001010F0724380120121908483820121909080900000000000000000001010F0530AB0120121908290720121908483800000000000000000001010F05896C0120121908093720121908290700000000000000000001010F02CD3B0120121907500520121908093700000000000000000001010F056FEF0120121907303420121907500500000000000000000001010F043C3401201219072541201219073034000000000000000000010103C26C5F0120121907061120121907254100000000000000000001010F03F0C10120121906464220121907061100000000000000000001010F02F6330120121906271220121906464200000000000000000001010F02E43B0120121906074220121906271200000000000000000001010F033D670120121905481120121906074200000000000000000001010F088BF20120121905284120121905481100000000000000000001010F03F9FE0120121905091020121905284100000000000000000001010F05B1040120121904494020121905091000000000000000000001010F02B3540120121904301020121904494000000000000000000001010F0417B00120121904103920121904301000000000000000000001010F0538970120121903510820121904103900000000000000000001010F054E9E0120121903313820121903510800000000000000000001010F016ECB0120121903120820121903313800000000000000000001010F0333C00120121902523820121903120700000000000000000001010F029D230120121902330720121902523700000000000000000001010F0354E40120121902133720121902330700000000000000000001010F03303D0120121901540720121902133700000000000000000001010F04981E0120121901343720121901540700000000000000000001010F02AD940120121901150820121901343700000000000000000001010EFFD7CF0120121900553720121901150800000000000000000001010F07D9330120121900360720121900553700000000000000000001010F040E740C7E\n7E1205203804066657506200EC000200020120121900163320121900360700000000000000000001010F0CE4CD0120121900002220121900163300000000000000000001010C6F9E7B5D7E"; | |||||
private static string HexYueBiaoDataTmp = "7E0200405C01000000000012345678913CC400000000008C0003015198CF06C158C5000801F200E52203151206110104000716E30302000014040000000015040000000016040000000017020000180300000025040000000030011F310117EF0D49249200000049249011000003DE7E\n7E1205203804066657506200EC000200020120121900163320121900360700000000000000000001010F0CE4CD0120121900002220121900163300000000000000000001010C6F9E7B5D7E"; | |||||
private string ErrerMessage; | |||||
private bool isOpen = false; | |||||
void OnDismiss() | |||||
{ | |||||
isOpen = !isOpen; | |||||
} | |||||
private void OnSelectProtocolType(string value) | |||||
{ | |||||
JT808HeaderPackages = null; | |||||
JT808Packages = null; | |||||
if ("JT808_JT1078" == protocolType) | |||||
{ | |||||
HexData = HexSubDataTmp; | |||||
} | |||||
else if ("JT808_YueBiao" == protocolType) | |||||
{ | |||||
HexData = HexYueBiaoDataTmp; | |||||
} | |||||
else if ("JT2013Force" == protocolType) | |||||
{ | |||||
HexData = Hex2013ForceTmp; | |||||
} | |||||
else | |||||
{ | |||||
HexData = HexDataTmp; | |||||
} | |||||
protocolType = value; | |||||
} | |||||
private void OnAreaTextPressEnter(KeyboardEventArgs eventArgs) | |||||
{ | |||||
HexData += "\n"; | |||||
} | |||||
private async void LoadFiles(InputFileChangeEventArgs e) | |||||
{ | |||||
try | |||||
{ | |||||
using var memoryStream = new MemoryStream(); | |||||
Stream fs = e.File.OpenReadStream(); | |||||
await fs.CopyToAsync(memoryStream); | |||||
Assembly assembly = Assembly.Load(memoryStream.ToArray()); | |||||
JT808PrivateConfig.Register(assembly); | |||||
JTPrivateSerializer = new JT808Serializer(JT808PrivateConfig); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
ErrerMessage = ex.StackTrace; | |||||
} | |||||
} | |||||
protected override void OnInitialized() | |||||
{ | |||||
config.SkipCRCCode=true; | |||||
config.SkipCarDVRCRCCode=true; | |||||
Serializer = config.GetSerializer(); | |||||
JT1078Serializer = jT808_JT1078_Config.GetSerializer(); | |||||
JTSuBiao_Serializer = jT808_SuBiao_Config.GetSerializer(); | |||||
JTRM_Serializer = jT808_Streamax_Config.GetSerializer(); | |||||
JTYueBiao_Serializer = jT808_YueBiao_Config.GetSerializer(); | |||||
JT808PrivateConfig = new LocalLodingConfig(); | |||||
} | |||||
string Json = ""; | |||||
//暂不支持 | |||||
//private void OnJTPrivateSingleCompleted(AntDesign.UploadInfo uploadInfo) | |||||
//{ | |||||
// try | |||||
// { | |||||
// byte[] fs = File.ReadAllBytes(uploadInfo.File.ObjectURL); | |||||
// if (uploadInfo.FileList.Count > 1) | |||||
// { | |||||
// uploadInfo.FileList.RemoveAt(0); | |||||
// } | |||||
// } | |||||
// catch (Exception ex) | |||||
// { | |||||
// } | |||||
//} | |||||
private void Query() | |||||
{ | |||||
try | |||||
{ | |||||
isOpen = false; | |||||
JT808HeaderPackages = null; | |||||
JT808Packages = null; | |||||
Json = ""; | |||||
var hexs = HexData.Split("\n", StringSplitOptions.RemoveEmptyEntries); | |||||
if (hexs.Length > 0) | |||||
{ | |||||
SortedList<int, JT808HeaderPackage> sort = new SortedList<int, JT808HeaderPackage>(); | |||||
JT808Packages = new List<JT808PackageInfo>(); | |||||
var total = 0; | |||||
for (var i = 0; i < hexs.Length; i++) | |||||
{ | |||||
var data = hexs[i].ToHexBytes(); | |||||
var headerPackage = Serializer.HeaderDeserialize(data); | |||||
//处理分包 | |||||
if (headerPackage.Header.MessageBodyProperty.IsPackage) | |||||
{ | |||||
total = headerPackage.Header.PackgeCount; | |||||
sort.Add(headerPackage.Header.PackageIndex, headerPackage); | |||||
} | |||||
else | |||||
{ | |||||
switch (protocolType) | |||||
{ | |||||
case "JT808": | |||||
JT808Packages.Add(new JT808PackageInfo { Order = i, Json = Serializer.Analyze(data, options: JTJsonWriterOptions.Instance) }); | |||||
break; | |||||
case "JT808_JT1078": | |||||
JT808Packages.Add(new JT808PackageInfo { Order = i, Json = JT1078Serializer.Analyze(data, options: JTJsonWriterOptions.Instance) }); | |||||
break; | |||||
case "JT808_SuBiao": | |||||
JT808Packages.Add(new JT808PackageInfo { Order = i, Json = JTSuBiao_Serializer.Analyze(data, options: JTJsonWriterOptions.Instance) }); | |||||
break; | |||||
case "JT808_YueBiao": | |||||
JT808Packages.Add(new JT808PackageInfo { Order = i, Json = JTYueBiao_Serializer.Analyze(data, options: JTJsonWriterOptions.Instance) }); | |||||
break; | |||||
case "JT808_JTRM": | |||||
JT808Packages.Add(new JT808PackageInfo { Order = i, Json = JTRM_Serializer.Analyze(data, options: JTJsonWriterOptions.Instance) }); | |||||
break; | |||||
case "JT2013Force": | |||||
JT808Packages.Add(new JT808PackageInfo { Order = i, Json = Serializer.Analyze(data, JT808.Protocol.Enums.JT808Version.JTT2013Force, options: JTJsonWriterOptions.Instance) }); | |||||
break; | |||||
case "JTPrivate": | |||||
if (JTPrivateSerializer != null) | |||||
{ | |||||
JT808Packages.Add(new JT808PackageInfo { Order = i, Json = JTPrivateSerializer.Analyze(data, options: JTJsonWriterOptions.Instance) }); | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
if (sort.Count > 0) | |||||
{ | |||||
List<byte> bodies = new List<byte>(); | |||||
ushort msgid = 0; | |||||
foreach (var item in sort) | |||||
{ | |||||
msgid = item.Value.Header.MsgId; | |||||
bodies = bodies.Concat(item.Value.Bodies).ToList(); | |||||
} | |||||
JT808HeaderPackages = sort.Select(s => s.Value).ToList(); | |||||
if (sort.Count == total) | |||||
{ | |||||
switch (protocolType) | |||||
{ | |||||
case "JT808": | |||||
Json = Serializer.Analyze(msgid, bodies.ToArray(), options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "JT808_JT1078": | |||||
Json = JT1078Serializer.Analyze(msgid, bodies.ToArray(), options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "JT808_SuBiao": | |||||
Json = JTSuBiao_Serializer.Analyze(msgid, bodies.ToArray(), options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "JT808_YueBiao": | |||||
Json = JTYueBiao_Serializer.Analyze(msgid, bodies.ToArray(), options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "JT808_JTRM": | |||||
Json = JTRM_Serializer.Analyze(msgid, bodies.ToArray(), options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "JT2013Force": | |||||
Json = Serializer.Analyze(msgid, bodies.ToArray(), JT808.Protocol.Enums.JT808Version.JTT2013Force, options: JTJsonWriterOptions.Instance); | |||||
break; | |||||
case "JTPrivate": | |||||
if (JTPrivateSerializer != null) | |||||
{ | |||||
Json = JTPrivateSerializer.Analyze(msgid, bodies.ToArray(), options: JTJsonWriterOptions.Instance); | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
Json = "包数不匹配,请确认清楚!"; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
catch (JT808Exception ex) | |||||
{ | |||||
isOpen = !isOpen; | |||||
ErrerMessage = ex.Message; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
isOpen = !isOpen; | |||||
ErrerMessage = ex.StackTrace; | |||||
} | |||||
} | |||||
public class LocalLodingConfig : GlobalConfigBase | |||||
{ | |||||
public override string ConfigId { get; protected set; } = "LocalConfig"; | |||||
} | |||||
public class JT808PackageInfo | |||||
{ | |||||
public int Order { get; set; } | |||||
public string Json { get; set; } | |||||
} | |||||
} |
@@ -1,207 +0,0 @@ | |||||
@page "/jt809" | |||||
@using JT809.Protocol; | |||||
@using JT809.Protocol.Extensions; | |||||
@using Newtonsoft.Json; | |||||
@using JT809.Protocol.Configs; | |||||
@using JT809.Protocol.Interfaces; | |||||
@using JT809.Protocol.Exceptions; | |||||
@using JTTools.Configs; | |||||
@using JT809.Protocol.Enums; | |||||
@using OneOf; | |||||
@using AntDesign; | |||||
@inject JT809_2011_Config Config2011 | |||||
@inject JT809_2019_Config Config2019 | |||||
<Space Direction="DirectionVHType.Vertical" Style="width:100%"> | |||||
<SpaceItem> | |||||
<Select @bind-Value="@version" DefaultValue="@("v2011")" TItemValue="string" TItem="string" OnSelectedItemChanged="OnSelectVersion"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("v2011")" Label="2011版本" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("v2019")" Label="2019版本" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
<Select TItemValue="string" TItem="string" DefaultValue="@("none")" @bind-Value="@encryptType" OnSelectedItemChanged="OnSelectEncryptType"> | |||||
<SelectOptions> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("none")" Label="未加密" /> | |||||
<SelectOption TItemValue="string" TItem="string" Value="@("encrypt")" Label="加密" /> | |||||
</SelectOptions> | |||||
</Select> | |||||
</SpaceItem> | |||||
@if (encryptType == "encrypt") | |||||
{ | |||||
<SpaceItem> | |||||
<AntDesign.Input @bind-Value="@M1"> | |||||
<AddOnBefore>M1</AddOnBefore> | |||||
</AntDesign.Input> | |||||
<AntDesign.Input @bind-Value="@IA1"> | |||||
<AddOnBefore>IA1</AddOnBefore> | |||||
</AntDesign.Input> | |||||
<AntDesign.Input @bind-Value="@IC1"> | |||||
<AddOnBefore>IC1</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</SpaceItem> | |||||
} | |||||
<SpaceItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="Query">分析</Button> | |||||
</SpaceItem> | |||||
</Space> | |||||
@if (isOpen) | |||||
{ | |||||
<Alert Type="@AlertType.Error" Description="@ErrerMessage" Closable AfterClose="OnDismiss" /> | |||||
} | |||||
<div class="right"> | |||||
<TextArea AllowClear="true" Rows="4" @bind-Value="@HexData" /> | |||||
<pre> | |||||
@Json | |||||
</pre> | |||||
</div> | |||||
@code { | |||||
private JT809Serializer Serializer2011; | |||||
private JT809Serializer Serializer2019; | |||||
private string HexData2011 = "5B 00 00 00 92 00 00 06 82 94 00 01 33 EF B8 01 00 00 00 00 00 27 0F D4 C1 41 31 32 33 34 35 00 00 00 00 00 00 00 00 00 00 00 00 00 02 94 01 00 00 00 5C 01 00 02 00 00 00 00 5A 01 AC 3F 40 12 3F FA A1 00 00 00 00 5A 01 AC 4D 50 03 73 6D 61 6C 6C 63 68 69 00 00 00 00 00 00 00 00 31 32 33 34 35 36 37 38 39 30 31 00 00 00 00 00 00 00 00 00 31 32 33 34 35 36 40 71 71 2E 63 6F 6D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BA D8 5D"; | |||||
private string HexData2019 = "5B 00 00 00 C9 00 00 06 82 17 00 01 34 15 F4 01 00 00 00 00 00 27 0F 00 00 00 00 5E 02 A5 07 B8 D4 C1 41 31 32 33 34 35 00 00 00 00 00 00 00 00 00 00 00 00 00 02 17 01 00 00 00 8B 01 02 03 04 05 06 07 08 09 10 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E7 D3 5D"; | |||||
private string HexData = ""; | |||||
private string Json; | |||||
string encryptType = "none"; | |||||
string version = "v2011"; | |||||
JT809EncryptOptions EncryptOptions; | |||||
private string ErrerMessage; | |||||
private bool isOpen = false; | |||||
private long M1; | |||||
private long IA1; | |||||
private long IC1; | |||||
void OnDismiss() | |||||
{ | |||||
isOpen = !isOpen; | |||||
} | |||||
public void OnSelectVersion(string value) | |||||
{ | |||||
this.version = value; | |||||
switch (version) | |||||
{ | |||||
case "v2011": | |||||
this.HexData = HexData2011; | |||||
break; | |||||
case "v2019": | |||||
this.HexData = HexData2019; | |||||
break; | |||||
} | |||||
StateHasChanged(); | |||||
} | |||||
private void OnSelectEncryptType(string value) | |||||
{ | |||||
encryptType = value; | |||||
StateHasChanged(); | |||||
} | |||||
protected override void OnInitialized() | |||||
{ | |||||
Serializer2011 = Config2011.GetSerializer(); | |||||
Serializer2019 = Config2019.GetSerializer(); | |||||
EncryptOptions = new JT809EncryptOptions(); | |||||
HexData = HexData2011; | |||||
StateHasChanged(); | |||||
} | |||||
private void Query() | |||||
{ | |||||
try | |||||
{ | |||||
isOpen = false; | |||||
var data = HexData.ToHexBytes(); | |||||
switch (version) | |||||
{ | |||||
case "v2011": | |||||
if (encryptType == "none") | |||||
{ | |||||
Json = Serializer2011.Analyze(data, JTJsonWriterOptions.Instance); | |||||
} | |||||
else | |||||
{ | |||||
IJT809Config jt809ConfigInternal = new JT809Config2011(Guid.NewGuid().ToString()); | |||||
SetEncryptOptions(); | |||||
jt809ConfigInternal.EncryptOptions = EncryptOptions; | |||||
JT809Serializer jT809SerializerInternal = new JT809Serializer(jt809ConfigInternal); | |||||
Json = jT809SerializerInternal.Analyze(data, JTJsonWriterOptions.Instance); | |||||
} | |||||
break; | |||||
case "v2019": | |||||
if (encryptType == "none") | |||||
{ | |||||
Json = Serializer2019.Analyze(data, JTJsonWriterOptions.Instance); | |||||
} | |||||
else | |||||
{ | |||||
IJT809Config jt809ConfigInternal = new JT809Config2019(Guid.NewGuid().ToString()); | |||||
SetEncryptOptions(); | |||||
jt809ConfigInternal.EncryptOptions = EncryptOptions; | |||||
JT809Serializer jT809SerializerInternal = new JT809Serializer(jt809ConfigInternal); | |||||
Json = jT809SerializerInternal.Analyze(data, JTJsonWriterOptions.Instance); | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
catch (JT809Exception ex) | |||||
{ | |||||
isOpen = !isOpen; | |||||
Json = ""; | |||||
ErrerMessage = ex.Message; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
isOpen = !isOpen; | |||||
Json = ""; | |||||
ErrerMessage = ex.StackTrace; | |||||
} | |||||
} | |||||
private void SetEncryptOptions() | |||||
{ | |||||
EncryptOptions.M1 = (uint)M1; | |||||
EncryptOptions.IA1 = (uint)IA1; | |||||
EncryptOptions.IC1 = (uint)IC1; | |||||
} | |||||
class JT809Config2011 : JT809GlobalConfigBase | |||||
{ | |||||
public JT809Config2011(string configId) | |||||
{ | |||||
ConfigId = configId; | |||||
} | |||||
public override string ConfigId { get; } | |||||
} | |||||
class JT809Config2019 : JT809GlobalConfigBase | |||||
{ | |||||
public JT809Config2019(string configId) | |||||
{ | |||||
ConfigId = configId; | |||||
Version = JT809Version.JTT2019; | |||||
} | |||||
public override string ConfigId { get; } | |||||
} | |||||
} |
@@ -1,58 +0,0 @@ | |||||
@page "/jtas" | |||||
@using JTActiveSafety.Protocol; | |||||
@using JTActiveSafety.Protocol.Extensions; | |||||
@using JTTools.Configs; | |||||
<Space Direction="DirectionVHType.Vertical" Style="width:100%"> | |||||
<SpaceItem> | |||||
<div class="right"> | |||||
<TextArea AllowClear="true" Rows="4" @bind-Value="@HexData" /> | |||||
<pre> | |||||
@Json | |||||
</pre> | |||||
</div> | |||||
</SpaceItem> | |||||
<SpaceItem> | |||||
<Button Type="@ButtonType.Primary" @onclick="Query">分析</Button> | |||||
</SpaceItem> | |||||
@if (isOpen) | |||||
{ | |||||
<SpaceItem> | |||||
<Alert Type="@AlertType.Error" Description="@ErrerMessage" Closable AfterClose="OnDismiss" /> | |||||
</SpaceItem> | |||||
} | |||||
</Space> | |||||
@code { | |||||
private string HexData = "30 31 63 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61 6C 61 72 6D 2E 78 6C 73 78 00 00 00 01 00 00 00 05 01 02 03 04 05"; | |||||
private string Json; | |||||
private string ErrerMessage; | |||||
private bool isOpen = false; | |||||
void OnDismiss() | |||||
{ | |||||
isOpen = !isOpen; | |||||
} | |||||
private void Query() | |||||
{ | |||||
try | |||||
{ | |||||
isOpen = false; | |||||
var data = HexData.ToHexBytes(); | |||||
Json = JTActiveSafetySerializer.Analyze(data, options: JTJsonWriterOptions.Instance); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
isOpen = !isOpen; | |||||
Json = ""; | |||||
ErrerMessage = ex.StackTrace; | |||||
} | |||||
} | |||||
} |
@@ -1,181 +0,0 @@ | |||||
@page "/map" | |||||
@using System.Text; | |||||
@using System.Text.Encodings.Web; | |||||
@using System.Text.Unicode; | |||||
@using System.ComponentModel.DataAnnotations; | |||||
@using System.Text.Json; | |||||
@inject IJSRuntime JsRuntime | |||||
<AntDesign.Space Direction="DirectionVHType.Vertical" Style="width:100%"> | |||||
<AntDesign.SpaceItem> | |||||
<RadioGroup @bind-Value="coordinateType" Size="large" TValue="string" OnChange="@OnSelectedCoordinateTypeChanged"> | |||||
<Radio RadioButton Value="@("WGS84")">WGS84</Radio> | |||||
<Radio RadioButton Value="@("GCJ02")">GCJ02</Radio> | |||||
<Radio RadioButton Value="@("BD09")">BD09</Radio> | |||||
</RadioGroup> | |||||
</AntDesign.SpaceItem> | |||||
<AntDesign.SpaceItem> | |||||
<AntDesign.Input @bind-Value="LngLat" Size="large" AllowClear> | |||||
<AddOnBefore>经纬度</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</AntDesign.SpaceItem> | |||||
<AntDesign.SpaceItem> | |||||
<Button Type="primary" @onclick="Convert" Size="large"> | |||||
转换 | |||||
</Button> | |||||
<Button Type="primary" @onclick="CreateMarker" Size="large"> | |||||
创建标注点 | |||||
</Button> | |||||
</AntDesign.SpaceItem> | |||||
<AntDesign.SpaceItem> | |||||
<AntDesign.Input @bind-Value="WGS84_LngLat" Size="large" readonly> | |||||
<AddOnBefore>WGS84坐标系</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</AntDesign.SpaceItem> | |||||
<AntDesign.SpaceItem> | |||||
<AntDesign.Input @bind-Value="GCJ02_LngLat" Size="large" readonly> | |||||
<AddOnBefore>GCJ02坐标系</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</AntDesign.SpaceItem> | |||||
<AntDesign.SpaceItem> | |||||
<AntDesign.Input @bind-Value="BD09_LngLat" Size="large" readonly> | |||||
<AddOnBefore>BD09坐标系</AddOnBefore> | |||||
</AntDesign.Input> | |||||
</AntDesign.SpaceItem> | |||||
@if (isOpen) | |||||
{ | |||||
<AntDesign.SpaceItem> | |||||
<Alert Type="@AlertType.Error" Description="@ErrerMessage" Closable AfterClose="OnDismiss" /> | |||||
</AntDesign.SpaceItem> | |||||
} | |||||
<AntDesign.SpaceItem> | |||||
<div id="mapContainer" style="width: 100%; height: 768px; "></div> | |||||
</AntDesign.SpaceItem> | |||||
</AntDesign.Space> | |||||
@code { | |||||
string coordinateType = "GCJ02"; | |||||
private string LngLat = "113.87132,22.568962"; | |||||
private string WGS84_LngLat; | |||||
private string GCJ02_LngLat; | |||||
private string BD09_LngLat; | |||||
private string ErrerMessage; | |||||
private bool isOpen = false; | |||||
protected override async void OnInitialized() | |||||
{ | |||||
await JsRuntime.InvokeVoidAsync("mapInit"); | |||||
} | |||||
void OnDismiss() | |||||
{ | |||||
isOpen = !isOpen; | |||||
} | |||||
void OnSelectedCoordinateTypeChanged(string e) | |||||
{ | |||||
isOpen = false; | |||||
if (string.IsNullOrEmpty(LngLat)) | |||||
{ | |||||
return; | |||||
} | |||||
string[] arr = LngLat.Split(new string[] { ",", ",", "|", ":", ";", ";" }, StringSplitOptions.RemoveEmptyEntries); | |||||
List<double> wgs84s = new List<double>(); | |||||
List<double> gcj02s = new List<double>(); | |||||
List<double> bd09s = new List<double>(); | |||||
for (var i = 0; i < arr.Length; i = i + 2) | |||||
{ | |||||
try | |||||
{ | |||||
if (double.TryParse(arr[i], out double lng) && double.TryParse(arr[i + 1], out double lat)) | |||||
{ | |||||
if (e == "WGS84") | |||||
{ | |||||
wgs84s.Add(lng); | |||||
wgs84s.Add(lat); | |||||
var gcj02 = Coordtransform.Wgs84togcj02(lng, lat); | |||||
gcj02s.Add(gcj02[0]); | |||||
gcj02s.Add(gcj02[1]); | |||||
var bd09 = Coordtransform.Wgs84tobd09(lng, lat); | |||||
bd09s.Add(bd09[0]); | |||||
bd09s.Add(bd09[1]); | |||||
} | |||||
else if (e == "GCJ02") | |||||
{ | |||||
gcj02s.Add(lng); | |||||
gcj02s.Add(lat); | |||||
var wgs84 = Coordtransform.Gcj02towgs84(lng, lat); | |||||
wgs84s.Add(wgs84[0]); | |||||
wgs84s.Add(wgs84[1]); | |||||
var bd09 = Coordtransform.Gcj02tobd09(lng, lat); | |||||
bd09s.Add(bd09[0]); | |||||
bd09s.Add(bd09[1]); | |||||
} | |||||
else if (e == "BD09") | |||||
{ | |||||
bd09s.Add(lng); | |||||
bd09s.Add(lat); | |||||
var wgs84 = Coordtransform.Bd09towgs84(lng, lat); | |||||
wgs84s.Add(wgs84[0]); | |||||
wgs84s.Add(wgs84[1]); | |||||
var gcj02 = Coordtransform.Bd09togcj02(lng, lat); | |||||
gcj02s.Add(gcj02[0]); | |||||
gcj02s.Add(gcj02[1]); | |||||
} | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
isOpen = true; | |||||
ErrerMessage = ex.Message; | |||||
break; | |||||
} | |||||
} | |||||
WGS84_LngLat = string.Join(',', wgs84s); | |||||
GCJ02_LngLat = string.Join(',', gcj02s); | |||||
BD09_LngLat = string.Join(',', bd09s); | |||||
} | |||||
[JSInvokable] | |||||
public void Convert() | |||||
{ | |||||
OnSelectedCoordinateTypeChanged(coordinateType); | |||||
} | |||||
[JSInvokable] | |||||
public async void CreateMarker() | |||||
{ | |||||
if (string.IsNullOrEmpty(GCJ02_LngLat)) | |||||
{ | |||||
return; | |||||
} | |||||
string[] arr = GCJ02_LngLat.Split(',', StringSplitOptions.RemoveEmptyEntries); | |||||
if (arr.Length == 2) | |||||
{ | |||||
await JsRuntime.InvokeVoidAsync("createMarker", arr); | |||||
} | |||||
else if (arr.Length > 2) | |||||
{ | |||||
List<List<string>> latlngs = new List<List<string>>(); | |||||
for (var i = 0; i < arr.Length; i = i + 2) | |||||
{ | |||||
List<string> latlng = new List<string>(); | |||||
latlng.Add(arr[i]); | |||||
latlng.Add(arr[i + 1]); | |||||
latlngs.Add(latlng); | |||||
} | |||||
await JsRuntime.InvokeVoidAsync("createMarkers", latlngs); | |||||
} | |||||
} | |||||
} |
@@ -1,33 +0,0 @@ | |||||
@page "/" | |||||
@namespace JTTools.Pages | |||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | |||||
@{ | |||||
Layout = null; | |||||
} | |||||
<!DOCTYPE html> | |||||
<html lang="en"> | |||||
<head> | |||||
<meta charset="utf-8" /> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |||||
<meta name="keywords" content="JT808|gb808|JT809|gb809|JT1078|JTT1078|JT19056|gb19056|在线解析工具" /> | |||||
<meta name="description" content="道路运输车辆卫星定位协议在线解析工具" /> | |||||
<title>JTTools解析工具</title> | |||||
<base href="~/" /> | |||||
<link rel="icon" href="logo.png" type="image/x-icon"> | |||||
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet"> | |||||
<script type="text/javascript" src='//webapi.amap.com/maps?v=1.4.15&key=1beaad9c96973cf1614ab8703cb60356&plugin=AMap.MouseTool'> | |||||
</script> | |||||
<!-- UI组件库 1.0 --> | |||||
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script> | |||||
</head> | |||||
<body> | |||||
<app> | |||||
<component type="typeof(App)" render-mode="Server" /> | |||||
</app> | |||||
<script src="_content/AntDesign/js/ant-design-blazor.js"></script> | |||||
<script src="~/js/map.js"></script> | |||||
<script src="_framework/blazor.server.js"></script> | |||||
</body> | |||||
</html> |
@@ -1,62 +0,0 @@ | |||||
@inherits LayoutComponentBase | |||||
<Layout> | |||||
<Sider Breakpoint="@BreakpointType.Lg" | |||||
CollapsedWidth="0" | |||||
OnBreakpoint="broken => { | |||||
Console.WriteLine(broken); | |||||
}" | |||||
OnCollapse="collapsed => { | |||||
Console.WriteLine(collapsed); | |||||
}"> | |||||
<NavMenu /> | |||||
</Sider> | |||||
<Layout> | |||||
<Header Class="site-layout-sub-header-background" Style="padding: 0;"> | |||||
<iframe id="github-star" style="border:none;vertical-align: middle;position:absolute;right:50px;top:25px;" width="105" height="20" src="https://ghbtns.com/github-btn.html?user=SmallChi&repo=JTTools&type=watch&count=true"></iframe> | |||||
</Header> | |||||
<Content Style="overflow: auto; margin: 24px 16px 0;"> | |||||
<div class="site-layout-background" style="padding: 24px; min-height: 360px"> | |||||
@Body | |||||
</div> | |||||
</Content> | |||||
<Footer class="ant-layout-footer " Style="text-align: center;"><a href="http://www.beian.miit.gov.cn" target="_blank">Copyright © 2015-2020 SmallChi. All Rights Reserved. 粤ICP备19128140号-1</a></Footer> | |||||
</Layout> | |||||
</Layout> | |||||
<style> | |||||
body, html { | |||||
font-size: 15px; | |||||
overflow-x: hidden; | |||||
} | |||||
#components-layout-demo-responsive .logo { | |||||
height: 32px; | |||||
background: rgba(255, 255, 255, 0.2); | |||||
margin: 16px; | |||||
} | |||||
.site-layout-sub-header-background { | |||||
background: #fff; | |||||
} | |||||
.site-layout-background { | |||||
background: #fff; | |||||
} | |||||
.ant-layout { | |||||
height: 100%; | |||||
} | |||||
.ant-layout .ant-layout-header h4 { | |||||
font-size: 30px; | |||||
padding: 0 35px; | |||||
} | |||||
.ant-layout-footer { | |||||
text-align: center; | |||||
width: 100%; | |||||
bottom: 0; | |||||
} | |||||
</style> |
@@ -1,27 +0,0 @@ | |||||
<Menu Theme="MenuTheme.Dark" Mode="MenuMode.Inline" DefaultSelectedKeys=@(new[]{"home"})> | |||||
<MenuItem Key="home" RouterLink="" RouterMatch="NavLinkMatch.All"> | |||||
<img alt="logo" src="logo.svg" style="height:24px;margin-right: 16px;"> | |||||
<span class="nav-text">主页</span> | |||||
</MenuItem> | |||||
<MenuItem Key="jt808" RouterLink="jt808"> | |||||
<span class="nav-text">JT808分析工具</span> | |||||
</MenuItem> | |||||
<MenuItem Key="jt809" RouterLink="jt809"> | |||||
<span class="nav-text">JT809分析工具</span> | |||||
</MenuItem> | |||||
<MenuItem Key="jt1078" RouterLink="jt1078"> | |||||
<span class="nav-text">JT1078分析工具</span> | |||||
</MenuItem> | |||||
<MenuItem Key="jt1078pack" RouterLink="jt1078pack"> | |||||
<span class="nav-text">JT1078组包工具</span> | |||||
</MenuItem> | |||||
<MenuItem Key="jt19056" RouterLink="jt19056"> | |||||
<span class="nav-text">JT19056分析工具</span> | |||||
</MenuItem> | |||||
<MenuItem Key="jtas" RouterLink="jtas"> | |||||
<span class="nav-text">JTActiveSafety分析工具</span> | |||||
</MenuItem> | |||||
<MenuItem Key="map" RouterLink="map"> | |||||
<span class="nav-text">地图-经纬度解析</span> | |||||
</MenuItem> | |||||
</Menu> |
@@ -1,237 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace JTTools | |||||
{ | |||||
public class Coordtransform | |||||
{ | |||||
//定义一些常量 | |||||
private const double x_PI = 3.14159265358979324 * 3000.0 / 180.0; | |||||
private const double PI = 3.1415926535897932384626;// π | |||||
private const double a = 6378245.0;// 长半轴 | |||||
private const double ee = 0.00669342162296594323;// 偏心率平方 | |||||
/// <summary> | |||||
/// 百度坐标系 (BD-09) 与 火星坐标系 (GCJ-02)的转换 | |||||
/// 即 百度 转 谷歌、高德 | |||||
/// </summary> | |||||
/// <param name="bd_lon"></param> | |||||
/// <param name="bd_lat"></param> | |||||
/// <returns></returns> | |||||
public static double[] Bd09togcj02(double bd_lon, double bd_lat) | |||||
{ | |||||
double x = bd_lon - 0.0065; | |||||
double y = bd_lat - 0.006; | |||||
double z = Math.Sqrt(x * x + y * y) - 0.00002 * Math.Sin(y * x_PI); | |||||
double theta = Math.Atan2(y, x) - 0.000003 * Math.Cos(x * x_PI); | |||||
double gg_lng = z * Math.Cos(theta); | |||||
double gg_lat = z * Math.Sin(theta); | |||||
return new[] { gg_lng, gg_lat }; | |||||
} | |||||
/// <summary> | |||||
/// 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换 | |||||
/// 即谷歌、高德 转 百度 | |||||
/// </summary> | |||||
/// <param name="lng"></param> | |||||
/// <param name="lat"></param> | |||||
/// <returns></returns> | |||||
public static double[] Gcj02tobd09(double lng, double lat) | |||||
{ | |||||
double z = Math.Sqrt(lng * lng + lat * lat) + 0.00002 * Math.Sin(lat * x_PI); | |||||
double theta = Math.Atan2(lat, lng) + 0.000003 * Math.Cos(lng * x_PI); | |||||
double bd_lng = z * Math.Cos(theta) + 0.0065; | |||||
double bd_lat = z * Math.Sin(theta) + 0.006; | |||||
return new[] { bd_lng, bd_lat }; | |||||
} | |||||
/// <summary> | |||||
/// WGS84转GCj02 | |||||
/// </summary> | |||||
/// <param name="lng"></param> | |||||
/// <param name="lat"></param> | |||||
/// <returns></returns> | |||||
public static double[] Wgs84togcj02(double lng, double lat) | |||||
{ | |||||
if (Out_of_china(lng, lat)) | |||||
{ | |||||
return new[] { lng, lat }; | |||||
} | |||||
else | |||||
{ | |||||
double dlat = Transformlat(lng - 105.0, lat - 35.0); | |||||
double dlng = Transformlng(lng - 105.0, lat - 35.0); | |||||
double radlat = lat / 180.0 * PI; | |||||
double magic = Math.Sin(radlat); | |||||
magic = 1 - ee * magic * magic; | |||||
double sqrtmagic = Math.Sqrt(magic); | |||||
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI); | |||||
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.Cos(radlat) * PI); | |||||
double mglat = lat + dlat; | |||||
double mglng = lng + dlng; | |||||
return new[] { mglng, mglat }; | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 批量WGS84转GCj02 | |||||
/// </summary> | |||||
/// <param name="wgs84s">[[lng,lat],...]</param> | |||||
/// <returns></returns> | |||||
public static List<double[]> Wgs84togcj02(List<double[]> wgs84s) | |||||
{ | |||||
List<double[]> gcj02s = new List<double[]>(); | |||||
foreach (var wgs84 in wgs84s) | |||||
{ | |||||
var lng = wgs84[0]; | |||||
var lat = wgs84[1]; | |||||
if (Out_of_china(lng, lat)) | |||||
{ | |||||
gcj02s.Add( new[] { lng, lat }); | |||||
} | |||||
else | |||||
{ | |||||
double dlat = Transformlat(lng - 105.0, lat - 35.0); | |||||
double dlng = Transformlng(lng - 105.0, lat - 35.0); | |||||
double radlat = lat / 180.0 * PI; | |||||
double magic = Math.Sin(radlat); | |||||
magic = 1 - ee * magic * magic; | |||||
double sqrtmagic = Math.Sqrt(magic); | |||||
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI); | |||||
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.Cos(radlat) * PI); | |||||
double mglat = lat + dlat; | |||||
double mglng = lng + dlng; | |||||
gcj02s.Add( new[] { mglng, mglat }); | |||||
} | |||||
} | |||||
return gcj02s; | |||||
} | |||||
/// <summary> | |||||
/// GCJ02 转换为 WGS84 | |||||
/// </summary> | |||||
/// <param name="lng"></param> | |||||
/// <param name="lat"></param> | |||||
/// <returns></returns> | |||||
public static double[] Gcj02towgs84(double lng, double lat) | |||||
{ | |||||
if (Out_of_china(lng, lat)) | |||||
{ | |||||
return new[] { lng, lat }; | |||||
} | |||||
else | |||||
{ | |||||
double dlat = Transformlat(lng - 105.0, lat - 35.0); | |||||
double dlng = Transformlng(lng - 105.0, lat - 35.0); | |||||
double radlat = lat / 180.0 * PI; | |||||
double magic = Math.Sin(radlat); | |||||
magic = 1 - ee * magic * magic; | |||||
double sqrtmagic = Math.Sqrt(magic); | |||||
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI); | |||||
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.Cos(radlat) * PI); | |||||
double mglat = lat + dlat; | |||||
double mglng = lng + dlng; | |||||
return new[] { lng * 2 - mglng, lat * 2 - mglat }; | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 批量GCJ02 转换为 WGS84 | |||||
/// </summary> | |||||
/// <param name="gcj02s">[[lng,lat],...]</param> | |||||
/// <returns></returns> | |||||
public static List<double[]> Gcj02towgs84(List<double[]> gcj02s) | |||||
{ | |||||
List<double[]> wgs84s = new List<double[]>(); | |||||
foreach (var gcj02 in gcj02s) | |||||
{ | |||||
var lng = gcj02[0]; | |||||
var lat = gcj02[1]; | |||||
if (Out_of_china(lng, lat)) | |||||
{ | |||||
wgs84s.Add(new[] { lng, lat }); | |||||
} | |||||
else | |||||
{ | |||||
double dlat = Transformlat(lng - 105.0, lat - 35.0); | |||||
double dlng = Transformlng(lng - 105.0, lat - 35.0); | |||||
double radlat = lat / 180.0 * PI; | |||||
double magic = Math.Sin(radlat); | |||||
magic = 1 - ee * magic * magic; | |||||
double sqrtmagic = Math.Sqrt(magic); | |||||
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI); | |||||
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.Cos(radlat) * PI); | |||||
double mglat = lat + dlat; | |||||
double mglng = lng + dlng; | |||||
wgs84s.Add(new[] { lng * 2 - mglng, lat * 2 - mglat }); | |||||
} | |||||
} | |||||
return wgs84s; | |||||
} | |||||
public static double Transformlat(double lng, double lat) | |||||
{ | |||||
double ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.Sqrt(Math.Abs(lng)); | |||||
ret += (20.0 * Math.Sin(6.0 * lng * PI) + 20.0 * Math.Sin(2.0 * lng * PI)) * 2.0 / 3.0; | |||||
ret += (20.0 * Math.Sin(lat * PI) + 40.0 * Math.Sin(lat / 3.0 * PI)) * 2.0 / 3.0; | |||||
ret += (160.0 * Math.Sin(lat / 12.0 * PI) + 320 * Math.Sin(lat * PI / 30.0)) * 2.0 / 3.0; | |||||
return ret; | |||||
} | |||||
public static double Transformlng(double lng, double lat) | |||||
{ | |||||
double ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.Sqrt(Math.Abs(lng)); | |||||
ret += (20.0 * Math.Sin(6.0 * lng * PI) + 20.0 * Math.Sin(2.0 * lng * PI)) * 2.0 / 3.0; | |||||
ret += (20.0 * Math.Sin(lng * PI) + 40.0 * Math.Sin(lng / 3.0 * PI)) * 2.0 / 3.0; | |||||
ret += (150.0 * Math.Sin(lng / 12.0 * PI) + 300.0 * Math.Sin(lng / 30.0 * PI)) * 2.0 / 3.0; | |||||
return ret; | |||||
} | |||||
/// <summary> | |||||
/// 判断是否在国内,不在国内则不做偏移 | |||||
/// 纬度3.86~53.55,经度73.66~135.05 | |||||
/// </summary> | |||||
/// <param name="lng"></param> | |||||
/// <param name="lat"></param> | |||||
/// <returns></returns> | |||||
public static bool Out_of_china(double lng, double lat) | |||||
{ | |||||
return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55); ; | |||||
} | |||||
/// <summary> | |||||
/// WGS84坐标系->百度坐标系 | |||||
/// </summary> | |||||
/// <param name="lon"></param> | |||||
/// <param name="lat"></param> | |||||
/// <returns></returns> | |||||
public static double[] Wgs84tobd09(double lon, double lat) | |||||
{ | |||||
var gcj02 = Wgs84togcj02(lon, lat); | |||||
return Gcj02tobd09(gcj02[0], gcj02[1]); | |||||
} | |||||
/// <summary> | |||||
/// 百度坐标系->WGS84坐标系 | |||||
/// </summary> | |||||
/// <param name="bd_lon"></param> | |||||
/// <param name="bd_lat"></param> | |||||
/// <returns></returns> | |||||
public static double[] Bd09towgs84(double bd_lon, double bd_lat) | |||||
{ | |||||
var gcj02 = Bd09togcj02(bd_lon, bd_lat); | |||||
return Gcj02towgs84(gcj02[0], gcj02[1]); | |||||
} | |||||
} | |||||
} |
@@ -1,10 +0,0 @@ | |||||
@using System.Net.Http | |||||
@using Microsoft.AspNetCore.Authorization | |||||
@using Microsoft.AspNetCore.Components.Authorization | |||||
@using Microsoft.AspNetCore.Components.Forms | |||||
@using Microsoft.AspNetCore.Components.Routing | |||||
@using Microsoft.AspNetCore.Components.Web | |||||
@using Microsoft.JSInterop | |||||
@using JTTools | |||||
@using JTTools.Shared | |||||
@using AntDesign |
@@ -0,0 +1,130 @@ | |||||
html { | |||||
font-size: 14px; | |||||
} | |||||
@media (min-width: 768px) { | |||||
html { | |||||
font-size: 16px; | |||||
} | |||||
} | |||||
main>.container { | |||||
padding: 60px 15px 0; | |||||
} | |||||
.bd-placeholder-img { | |||||
font-size: 1.125rem; | |||||
text-anchor: middle; | |||||
-webkit-user-select: none; | |||||
-moz-user-select: none; | |||||
user-select: none; | |||||
} | |||||
@media (min-width: 768px) { | |||||
.bd-placeholder-img-lg { | |||||
font-size: 3.5rem; | |||||
} | |||||
} | |||||
.b-example-divider { | |||||
width: 100%; | |||||
height: 3rem; | |||||
background-color: rgba(0, 0, 0, .1); | |||||
border: solid rgba(0, 0, 0, .15); | |||||
border-width: 1px 0; | |||||
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15); | |||||
} | |||||
.b-example-vr { | |||||
flex-shrink: 0; | |||||
width: 1.5rem; | |||||
height: 100vh; | |||||
} | |||||
.bi { | |||||
vertical-align: -.125em; | |||||
fill: currentColor; | |||||
} | |||||
.nav-scroller { | |||||
position: relative; | |||||
z-index: 2; | |||||
height: 2.75rem; | |||||
overflow-y: hidden; | |||||
} | |||||
.nav-scroller .nav { | |||||
display: flex; | |||||
flex-wrap: nowrap; | |||||
padding-bottom: 1rem; | |||||
margin-top: -1px; | |||||
overflow-x: auto; | |||||
text-align: center; | |||||
white-space: nowrap; | |||||
-webkit-overflow-scrolling: touch; | |||||
} | |||||
.btn-bd-primary { | |||||
--bd-violet-bg: #712cf9; | |||||
--bd-violet-rgb: 112.520718, 44.062154, 249.437846; | |||||
--bs-btn-font-weight: 600; | |||||
--bs-btn-color: var(--bs-white); | |||||
--bs-btn-bg: var(--bd-violet-bg); | |||||
--bs-btn-border-color: var(--bd-violet-bg); | |||||
--bs-btn-hover-color: var(--bs-white); | |||||
--bs-btn-hover-bg: #6528e0; | |||||
--bs-btn-hover-border-color: #6528e0; | |||||
--bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); | |||||
--bs-btn-active-color: var(--bs-btn-hover-color); | |||||
--bs-btn-active-bg: #5a23c8; | |||||
--bs-btn-active-border-color: #5a23c8; | |||||
} | |||||
.bd-mode-toggle { | |||||
z-index: 1500; | |||||
} | |||||
.bd-mode-toggle .dropdown-menu .active .bi { | |||||
display: block !important; | |||||
} | |||||
@keyframes fade-in { | |||||
from { | |||||
opacity: 0; | |||||
} | |||||
} | |||||
@keyframes fade-out { | |||||
to { | |||||
opacity: 0; | |||||
} | |||||
} | |||||
@keyframes slide-from-right { | |||||
from { | |||||
transform: translateX(90px); | |||||
} | |||||
} | |||||
@keyframes slide-to-left { | |||||
to { | |||||
transform: translateX(-90px); | |||||
} | |||||
} | |||||
/* define animations for the old and new content */ | |||||
::view-transition-old(slide-it) { | |||||
animation: 180ms cubic-bezier(0.4, 0, 1, 1) both fade-out, | |||||
600ms cubic-bezier(0.4, 0, 0.2, 1) both slide-to-left; | |||||
} | |||||
::view-transition-new(slide-it) { | |||||
animation: 420ms cubic-bezier(0, 0, 0.2, 1) 90ms both fade-in, | |||||
600ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right; | |||||
} | |||||
/* tie the view transition to a given CSS class */ | |||||
.sample-transition { | |||||
view-transition-name: slide-it; | |||||
} |
@@ -0,0 +1,84 @@ | |||||
<!doctype html> | |||||
<html lang="en" class="h-100" data-bs-theme="auto"> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |||||
<meta name="keywords" content="JT808|gb808|JT809|gb809|JT1078|JTT1078|JT19056|gb19056|JT905|GB905|808|809|905|在线解析工具" /> | |||||
<meta name="description" content="道路运输车辆卫星定位协议在线解析工具" /> | |||||
<title>JTTools解析工具</title> | |||||
<meta name="author" content="SmallChi(Koike)、TK-Liu" /> | |||||
<link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.min.css" /> | |||||
<link rel="stylesheet" href="/css/site.css" /> | |||||
<script src="/lib/bootstrap/dist/js/bootstrap.bundle.min.js" type="text/javascript"></script> | |||||
</head> | |||||
<body class="d-flex flex-column h-100"> | |||||
<header> | |||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> | |||||
<div class="container-fluid"> | |||||
<a class="navbar-brand" href="#">JTTools解析工具</a> | |||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" | |||||
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> | |||||
<span class="navbar-toggler-icon"></span> | |||||
</button> | |||||
<div class="collapse navbar-collapse" id="navbarCollapse"> | |||||
<ul class="navbar-nav me-auto mb-2 mb-md-0"> | |||||
<li class="nav-item"> | |||||
<a class="nav-link active" href="#">JT808解析工具</a> | |||||
<!-- <a class="nav-link active" aria-current="page" href="#">JT808</a> --> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">JT809解析工具</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">JT1078解析工具</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">JT1078(组包工具)</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">JT19056解析工具</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">JT905解析工具</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">主动安全解析工具</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">经纬度解析</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">广告推广(勿点)</a> | |||||
</li> | |||||
</ul> | |||||
<div> | |||||
<iframe src="https://ghbtns.com/github-btn.html?user=SmallChi&repo=JTTools&type=star&count=true&size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"> | |||||
</iframe> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</nav> | |||||
</header> | |||||
<main class="flex-shrink-0"> | |||||
<div class="container"> | |||||
<div class="sample-transition"> | |||||
<h1>Initial Content</h1> | |||||
</div> | |||||
</div> | |||||
</main> | |||||
<footer class="footer mt-auto py-3 bg-body-tertiary"> | |||||
<div class="container" style="text-align: center;"> | |||||
<span class="text-body-secondary"> | |||||
<a href="http://www.beian.miit.gov.cn" target="_blank">Copyright © 2015-2024 SmallChi. All Rights Reserved.粤ICP备19128140号-1</a> | |||||
</span> | |||||
</div> | |||||
</footer> | |||||
<script src="/js/site.js" type="text/javascript"></script> | |||||
</body> | |||||
</html> |
@@ -1,41 +0,0 @@ | |||||
function mapInit() { | |||||
console.debug("mapinit"); | |||||
//延迟加载下 | |||||
setTimeout(() => { | |||||
window.map = new AMap.Map('mapContainer', { | |||||
zoom: 12, | |||||
center: [114.085947, 22.547] | |||||
}); | |||||
}, 1500) | |||||
} | |||||
function createMarker(gcj02_lng,gcj02_lat) { | |||||
console.debug("Marker", gcj02_lng, gcj02_lat); | |||||
var marker = new AMap.Marker({ | |||||
position: new AMap.LngLat(gcj02_lng, gcj02_lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] | |||||
icon: new AMap.Icon({ | |||||
imageSize: new AMap.Size(36, 36), | |||||
}) | |||||
}); | |||||
window.map.add(marker); | |||||
window.map.setFitView(marker); | |||||
} | |||||
function createMarkers(arr) { | |||||
console.debug("Markers", arr); | |||||
var lastMarker = null; | |||||
for (var i = 0; i < arr.length; i++) { | |||||
var item = arr[i]; | |||||
var marker = new AMap.Marker({ | |||||
position: new AMap.LngLat(item[0], item[1]), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] | |||||
icon: new AMap.Icon({ | |||||
imageSize: new AMap.Size(36, 36), | |||||
}) | |||||
}); | |||||
if ((arr.length - 1) === i) { | |||||
lastMarker = marker; | |||||
} | |||||
window.map.add(marker); | |||||
} | |||||
window.map.setFitView(lastMarker); | |||||
} |
@@ -0,0 +1 @@ | |||||
|
@@ -0,0 +1,22 @@ | |||||
The MIT License (MIT) | |||||
Copyright (c) 2011-2021 Twitter, Inc. | |||||
Copyright (c) 2011-2021 The Bootstrap Authors | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy | |||||
of this software and associated documentation files (the "Software"), to deal | |||||
in the Software without restriction, including without limitation the rights | |||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||||
copies of the Software, and to permit persons to whom the Software is | |||||
furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice shall be included in | |||||
all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||||
THE SOFTWARE. |
@@ -0,0 +1,21 @@ | |||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org/ | |||||
Permission is hereby granted, free of charge, to any person obtaining | |||||
a copy of this software and associated documentation files (the | |||||
"Software"), to deal in the Software without restriction, including | |||||
without limitation the rights to use, copy, modify, merge, publish, | |||||
distribute, sublicense, and/or sell copies of the Software, and to | |||||
permit persons to whom the Software is furnished to do so, subject to | |||||
the following conditions: | |||||
The above copyright notice and this permission notice shall be | |||||
included in all copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@@ -1,54 +0,0 @@ | |||||
<svg width="150" height="150" xmlns="http://www.w3.org/2000/svg"> | |||||
<defs> | |||||
<linearGradient x1="62.1023273%" y1="0%" x2="108.19718%" y2="37.8635764%" id="linearGradient-1"> | |||||
<stop stop-color="#4285eb" offset="0%"/> | |||||
<stop stop-color="#2ec7ff" offset="100%"/> | |||||
</linearGradient> | |||||
<linearGradient x1="69.644116%" y1="0%" x2="54.0428975%" y2="108.456714%" id="linearGradient-2"> | |||||
<stop stop-color="#29cdff" offset="0%"/> | |||||
<stop stop-color="#148eff" offset="37.8600687%"/> | |||||
<stop stop-color="#0a60ff" offset="100%"/> | |||||
</linearGradient> | |||||
<linearGradient x1="69.6908165%" y1="-12.9743587%" x2="16.7228981%" y2="117.391248%" id="linearGradient-3"> | |||||
<stop stop-color="#fa816e" offset="0%"/> | |||||
<stop stop-color="#f74a5c" offset="41.472606%"/> | |||||
<stop stop-color="#f51d2c" offset="100%"/> | |||||
</linearGradient> | |||||
<linearGradient id="svg_7" y2="114.942679%" x2="30.4400914%" y1="-35.6905737%" x1="68.1279872%"> | |||||
<stop offset="0%" stop-color="#fa8e7d"/> | |||||
<stop offset="51.2635191%" stop-color="#f74a5c"/> | |||||
<stop offset="100%" stop-color="#f51d2c"/> | |||||
</linearGradient> | |||||
</defs> | |||||
<g> | |||||
<title>background</title> | |||||
<rect x="-1" y="-1" width="152" height="152" id="canvas_background" fill="none"/> | |||||
</g> | |||||
<g> | |||||
<title>Layer 1</title> | |||||
<g id="logo"> | |||||
<g id="Group-28-Copy-5"> | |||||
<g id="Group-27-Copy-3"> | |||||
<g id="Group-25" fill-rule="nonzero" transform="rotate(-45 75.09999847412107,74.99369812011717) "> | |||||
<g id="2"> | |||||
<path d="m66.6,-20.8l-87.4,87.3c-4.7,4.7 -4.7,12.3 0,17l87.4,87.3c4.7,4.7 12.3,4.7 17,0l36.6,-36.6c4.2,-4.2 4.2,-11 0,-15.2c-4.2,-4.2 -11,-4.2 -15.2,0l-27.8,27.7c-1.2,1.2 -2.9,1.2 -4.1,0l-69.8,-69.7c-1.2,-1.2 -1.2,-2.9 0,-4.1l69.8,-69.8c1.2,-1.1 2.9,-1.1 4.1,0l27.8,27.8c4.2,4.2 11,4.2 15.2,0c4.2,-4.2 4.2,-11 0,-15.2l-36.6,-36.6c-4.7,-4.6 -12.3,-4.6 -17,0.1z" id="Shape" fill="url(#linearGradient-1)"/> | |||||
<path d="m66.6,-20.8l-87.4,87.3c-4.7,4.7 -4.7,12.3 0,17l87.4,87.3c4.7,4.7 12.3,4.7 17,0l36.6,-36.6c4.2,-4.2 4.2,-11 0,-15.2c-4.2,-4.2 -11,-4.2 -15.2,0l-27.8,27.7c-1.2,1.2 -2.9,1.2 -4.1,0l-69.8,-69.7c-1.2,-1.2 -1.2,-2.9 0,-4.1l69.8,-69.8c2.9,-2.5 7.7,-7.6 14.6,-8.7c5.2,-0.9 10.9,1 17,5.8c-4.1,-4.1 -11.1,-11.2 -21.1,-21.1c-4.7,-4.6 -12.3,-4.6 -17,0.1z" id="Shape" fill="url(#linearGradient-2)"/> | |||||
</g> | |||||
<path d="m128.7,110.9c4.2,4.2 11,4.2 15.2,0l27.1,-27.1c4.7,-4.7 4.7,-12.2 0,-16.9l-27.3,-27.2c-4.2,-4.2 -11.1,-4.2 -15.3,0c-4.2,4.2 -4.2,11.1 0,15.3l18.5,18.4c1.1,1.1 1.1,2.9 0,4.1l-18.2,18.1c-4.2,4.2 -4.2,11 0,15.3z" id="Shape" fill="url(#linearGradient-3)"/> | |||||
</g> | |||||
<g id="svg_12" stroke="null"> | |||||
<g id="svg_10" transform="matrix(0.8258963114077542,0,0,0.8258963114077542,-56.51399713907371,-91.58370441367168) " stroke="null"> | |||||
<title transform="translate(-1.4210854715202004e-14,1.2108057737350464) translate(-1.4210854715202004e-14,-1.2108057737350464) translate(-1.4210854715202004e-14,-1.2108057737350464) translate(-1.4210854715202004e-14,-1.2108057737350464) translate(-1.2108057737350464,-1.4210854715202004e-14) translate(-1.2108057737350464,-1.4210854715202004e-14) translate(-27.84853172302246,-27.84853172302246) ">background</title> | |||||
<rect x="114.281386" y="152.87249" width="99" height="90" id="svg_8" fill="none" stroke="null"/> | |||||
</g> | |||||
<g id="svg_11" transform="matrix(0.8258963114077542,0,0,0.8258963114077542,-56.51399713907371,-91.58370441367168) " stroke="null"> | |||||
<title transform="translate(-1.4210854715202004e-14,1.2108057737350464) translate(-1.4210854715202004e-14,-1.2108057737350464) translate(-1.4210854715202004e-14,-1.2108057737350464) translate(-1.4210854715202004e-14,-1.2108057737350464) translate(-1.2108057737350464,-1.4210854715202004e-14) translate(-1.2108057737350464,-1.4210854715202004e-14) translate(-27.84853172302246,-27.84853172302246) ">Layer 1</title> | |||||
<path d="m211.168257,182.078597a55.758,55.758 0 0 1 -54.67601,46.972a40.5,40.5 0 0 1 -7.99199,-0.485a24.492,24.492 0 0 1 -20.369,-23.088a23.784,23.784 0 0 1 47.561,-0.336c0.1,3.942 -1.608,7.4 -5.11801,7.5c-3.75,0 -5.508,-2.676 -5.508,-6.28201l0,-10.01999a6.137,6.137 0 0 0 -6.09,-6.143l-8.4,0a14.621,14.621 0 1 0 10.8,24.36499l0.294,-0.438l0.294,0.486a10.343,10.343 0 0 0 8.82,4.2a11.658,11.658 0 0 0 10.8,-12.186a31.71,31.71 0 0 0 -0.87,-7.745a29.675,29.675 0 0 0 -58.672,6.426a30.047,30.047 0 0 0 29.285,29.675s2.2,0.2 4.68,0.143a63.335,63.335 0 0 0 33.96501,-10.133c0.144,-0.09999 0.28799,0.1 0.19199,0.246a49.854,49.854 0 0 1 -38.836,15.881a35.045,35.045 0 0 1 -35.669,-35.957a36.267,36.267 0 0 1 14.568,-29.045a35.523,35.523 0 0 1 20.957,-6.918l11.274,0a31.72,31.72 0 0 0 23.4,-10.331a0.438,0.438 0 0 1 0.238,-0.136a0.447,0.447 0 0 1 0.479,0.209a0.453,0.453 0 0 1 0.062,0.269a31.8,31.8 0 0 1 -4.919,14.225a0.431,0.431 0 0 0 -0.05299,0.244a0.44,0.44 0 0 0 0.29,0.379a0.437,0.437 0 0 0 0.248,0.013a34.088,34.088 0 0 0 23.7,-19.542a0.623,0.623 0 0 1 0.219,-0.211a0.6,0.6 0 0 1 0.589,0a0.615,0.615 0 0 1 0.219,0.211a43.2,43.2 0 0 1 4.238,27.552l0,0.00001zm-59.87,14.136a8.769,8.769 0 1 0 8.768,8.768l0,-8.186a0.632,0.632 0 0 0 -0.6,-0.6l-8.168,0.018z" fill="url(#svg_7)" id="svg_6" stroke="null"/> | |||||
</g> | |||||
</g> | |||||
</g> | |||||
</g> | |||||
</g> | |||||
</g> | |||||
</svg> |