change - 提升机地址解析修改,适配13#_L1_HOIST中的第三位字符串类型

dev
WenJY 1 day ago
parent 7da743e2bd
commit 8a28d7d421

@ -184,26 +184,21 @@ public class HoistDispatchHub
} }
/// <summary> /// <summary>
/// 解析起始点内容 /// 解析接驳位编码
/// 14#_L2_02 => 14栋、2层、02货位 /// 13#_L1_HOIST => 13栋、1层、提升机接驳位
/// 14#_L2_03 => 14栋、2层、03货位
/// </summary> /// </summary>
/// <param name="taskCode"></param> private static bool TryParsePointCode(string pointCode, out string building, out string floor, out string location)
/// <param name="building"></param>
/// <param name="floor"></param>
/// <param name="location"></param>
/// <returns></returns>
private bool TryParsePointCode(string taskCode, out string building, out string floor, out string location)
{ {
building = null; building = null;
floor = null; floor = null;
location = null; location = null;
if (string.IsNullOrWhiteSpace(taskCode)) if (string.IsNullOrWhiteSpace(pointCode))
return false; return false;
// 使用正则表达式匹配格式:数字+#+_+L+数字+_+数字(至少一位) // 格式: {楼栋}#_L{楼层}_{位置},位置可为数字或字母(如 HOIST)
// 示例14#_L2_03 var match = System.Text.RegularExpressions.Regex.Match(pointCode, @"^(\d+)#_L(\d+)_(.+)$");
var match = System.Text.RegularExpressions.Regex.Match(taskCode, @"^(\d+)#_L(\d+)_(\d+)$");
if (!match.Success) if (!match.Success)
return false; return false;

@ -62,6 +62,15 @@ namespace Sln.Wcs
handler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; handler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true;
}); });
var service = serviceProvider.GetService<HoistDispatchHub>();
service.TaskDispatch(new BaseDeviceInfo()
{
deviceSerialNo = 1
}, new LiveTaskDetail()
{
startPoint = "13#_L1_HOIST",
endPoint = "13#_L4_HOIST",
});
// var service = serviceProvider.GetService<HikRoBotService>(); // var service = serviceProvider.GetService<HikRoBotService>();
// var res = service.GbTaskSubmit(new GbTaskSubmitDto() // var res = service.GbTaskSubmit(new GbTaskSubmitDto()
// { // {

Loading…
Cancel
Save