Merge branch 'dep_wangsr'

# Conflicts:
#	SlnMesnac.Config/AppConfig.cs
#	SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs
#	SlnMesnac.TouchSocket/TcpServer.cs
#	SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs
#	SlnMesnac.WPF/appsettings.json
master
SoulStar 4 months ago
commit 42d0097363

@ -0,0 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SlnMesnac.Repository.service;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace SlnMesnac.Business.Airport
{
public class AirPortBusiness
{
}
}

@ -0,0 +1,60 @@
using Microsoft.Extensions.Logging;
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.Repository.service;
using SlnMesnac.TouchSocket;
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Business.@base
{
public class BaseStateRefreshBusiness
{
private IAGVStateService _AGVStateService;
private IManipulatorStateService _ManipulatorStateService;
private ILogger<BaseStateRefreshBusiness> _logger;
private static BaseStateRefreshBusiness instance;
public BaseStateRefreshBusiness(ILogger<BaseStateRefreshBusiness> logger, IAGVStateService agvService, IManipulatorStateService manipulatorStateService)
{
_logger = logger;
_AGVStateService = agvService;
_ManipulatorStateService = manipulatorStateService;
}
public static BaseStateRefreshBusiness GetInstance(ILogger<BaseStateRefreshBusiness> logger, IAGVStateService agvService, IManipulatorStateService manipulatorStateService)
{
if (instance == null)
{
instance = new BaseStateRefreshBusiness(logger, agvService, manipulatorStateService);
}
return instance;
}
public bool UpdateAGVStateByResposne(AGVStateRequestEntity request)
{
try
{
var response = AirPorthttpClient.AGVStateRequest(request);
_AGVStateService.UpdateOrAddByResponse(response);
}
catch (Exception e)
{
_logger.LogError("Error:" + e);
}
return true;
}
public bool UpdateManipulatorStateByResposne(ManipulatorStateRequestEntity request)
{
try
{
var response = AirPorthttpClient.ManipulatorStateRequest(request);
_ManipulatorStateService.UpdateOrAddByResponse(response);
}
catch (Exception e)
{
_logger.LogError("Error:" + e);
}
return true;
}
}
}

@ -29,30 +29,29 @@ namespace SlnMesnac.Config
/// <summary>
/// 系统配置
/// </summary>
#pragma warning disable CS8618 // Non-nullable field 'Data' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
#pragma warning disable CS8618 // Non-nullable field 'Data' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
public class AppConfig : IOptions<AppConfig>
{
/// <summary>
/// 日志文件路径
/// </summary>
public string logPath { get; set; }
/// <summary>
/// Sql连接配置
/// </summary>
public List<SqlConfig> sqlConfig { get; set; }
/// <summary>
/// PLC连接配置
/// </summary>
public List<PlcConfig> plcConfig { get; set; }
/// <summary>
/// RFID连接配置
/// </summary>
public List<RfidConfig> rfidConfig { get; set; }
/// <summary>
/// Redis配置
/// </summary>
@ -61,9 +60,22 @@ namespace SlnMesnac.Config
/// <summary>
/// AMR
/// </summary>
public string AMRIP { get; set; }
/// </summary>
/// AGV地址配置
/// </summary>
public string AGVIpConfig { get; set; }
/// <summary>
/// 机械臂地址配置
/// </summary>
public string ManipulatorIpConfig { get; set; }
/// <summary>
/// 机械臂地址配置
/// </summary>
public string TCPVisionConfig { get; set; }
public AppConfig Value => this;

@ -1,5 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using SlnMesnac.Config;
using SlnMesnac.Model.domain;
using SqlSugar;
using System;
using System.Collections.Generic;
@ -31,6 +32,7 @@ namespace SlnMesnac.Extensions
{
public static class SqlsugarSetup
{
/// <summary>
/// 注册SqlSugar
/// </summary>

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.AirportApiEntity
{
public class AGVArrivalSingalEntity
{
/// <summary>
/// AGV编号
/// </summary>
public string AGVNo { get; set; }
/// <summary>
/// AGV类型
/// </summary>
public string AGVType { get; set; }
/// <summary>
/// 目的地编号
/// </summary>
public string DestinationNo { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string TaskNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
}

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.AirportApiEntity
{
public class AGVCallSingalEntity
{
/// <summary>
/// AGV编号
/// </summary>
public string AGVNo { get; set; }
/// <summary>
/// AGV类型
/// </summary>
public string AGVType { get; set; }
/// <summary>
/// 起始地编号
/// </summary>
public string StartingPointNo { get; set; }
/// <summary>
/// 目的地编号
/// </summary>
public string DestinationNo { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string TaskNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
}

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.AirportApiEntity
{
public class AGVStateRequestEntity
{
/// <summary>
/// AGV编号
/// </summary>
public string AGVNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
public class AGVStateResponseEntity
{
/// <summary>
/// AGV编号
/// </summary>
public string AGVNo { get; set; }
/// <summary>
/// AGV类型1机械臂小车2运载小车
/// </summary>
public string AGVType { get; set; }
/// <summary>
/// AGV报警状态1正常2故障
/// </summary>
public string AGVAlarmState { get; set; }
/// <summary>
/// AGV工作状态1空闲2忙碌
/// </summary>
public string AGVWorkState { get; set; }
/// <summary>
/// 报警信息
/// </summary>
public string AlarmText { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string TaskNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
}

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.AirportApiEntity
{
public class ManipulatorStartWorkEntity
{
/// <summary>
/// 机械臂编号
/// </summary>
public string ManipulatorNo { get; set; }
/// <summary>
/// 运载小车编号
/// </summary>
public string CarryAGVNo { get; set; }
/// <summary>
/// 传送带编号
/// </summary>
public string ConveyorNo { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string TaskNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
}

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.AirportApiEntity
{
public class ManipulatorStateRequestEntity
{
/// <summary>
/// 机械臂编号
/// </summary>
public string ManipulatorNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
public class ManipulatorStateResponseEntity
{
/// <summary>
/// 机械臂编号
/// </summary>
public string ManipulatorNo { get; set; }
/// <summary>
/// 机械臂报警状态1正常2故障
/// </summary>
public string ManipulatorAlarmState { get; set; }
/// <summary>
/// 机械臂工作状态1空闲2工作
/// </summary>
public string ManipulatorWorkState { get; set; }
/// <summary>
/// 报警信息
/// </summary>
public string AlarmText { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string TaskNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
}

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.AirportApiEntity
{
public class ManipulatorWorkDoneEntity
{
/// <summary>
/// 机械臂编号
/// </summary>
public string ManipulatorNo { get; set; }
/// <summary>
/// 运载小车编号
/// </summary>
public string CarryAGVNo { get; set; }
/// <summary>
/// 传送带编号
/// </summary>
public string ConveyorNo { get; set; }
/// <summary>
/// 此次抓取数量
/// </summary>
public int NowCarryNumber { get; set; }
/// <summary>
/// 小车装载数量
/// </summary>
public int CarrierLoadNumber { get; set; }
/// <summary>
/// 此次工作总抓取数量
/// </summary>
public int AllCarryNumber { get; set; }
/// <summary>
/// 装载方向1机械臂小车2装载小车
/// </summary>
public string LoadLocation { get; set; }
/// <summary>
/// 工作是否结束0未结束1结束
/// </summary>
public string WorkIsDone { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string TaskNo { get; set; }
/// <summary>
/// 信号发送时间
/// </summary>
public string SignalSendTime { get; set; }
}
}

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.domain
{
public class AGVLog
{
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int ID { get; set; }
/// <summary>
/// AGV编号
/// </summary>
public string AGVNo { get; set; }
/// <summary>
/// AGV类型
/// </summary>
public string AGVType { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string ?TaskNo { get; set; }
/// <summary>
/// AGV报警状态1正常2故障
/// </summary>
public string AGVAlarmState { get; set; }
/// <summary>
/// AGV工作状态1空闲2忙碌
/// </summary>
public string AGVWorkState { get; set; }
/// <summary>
/// 报警内容
/// </summary>
public string ?AlarmText { get; set; }
/// <summary>
/// 日志时间
/// </summary>
public DateTime LogTime { get; set; }
}
}

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.domain
{
public class AGVSetting
{
/// <summary>
/// 自增编号
/// </summary>
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int ID { get; set; }
/// <summary>
/// AGV编号
/// </summary>
public string AGVNo { get; set; }
/// <summary>
/// AGV类型
/// </summary>
public string AGVType { get; set; }
}
}

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.domain
{
public class ManipulatorLog
{
/// <summary>
/// 自增编号
/// </summary>
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int ID { get; set; }
/// <summary>
/// 机械臂编号
/// </summary>
public string ManipulatorNo { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string ?TaskNo { get; set; }
/// <summary>
/// 机械臂报警状态1正常2故障
/// </summary>
public string ManipulatorAlarmState { get; set; }
/// <summary>
/// 机械臂工作状态1空闲2忙碌
/// </summary>
public string ManipulatorWorkState { get; set; }
/// <summary>
/// 报警内容
/// </summary>
public string ?AlarmText { get; set; }
/// <summary>
/// 日志时间
/// </summary>
public DateTime LogTime { get; set; }
}
}

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.domain
{
public class ManipulatorSetting
{
/// <summary>
/// 自增编号
/// </summary>
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int ID { get; set; }
/// <summary>
/// 机械臂编号
/// </summary>
public string ManipulatorNo { get; set; }
/// <summary>
/// 机械臂所属AGV编号
/// </summary>
public string RelatedAGVNo { get; set; }
}
}

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.domain
{
public class ManipulatorState
{
/// <summary>
/// 自增编号
/// </summary>
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int ID { get; set; }
/// <summary>
/// 机械臂编号
/// </summary>
public string ManipulatorNo { get; set; }
/// <summary>
/// 任务编号
/// </summary>
public string ?TaskNo { get; set; }
/// <summary>
/// 机械臂报警状态1正常2故障
/// </summary>
public string ManipulatorAlarmState { get; set; }
/// <summary>
/// 机械臂工作状态1空闲2忙碌
/// </summary>
public string ManipulatorWorkState { get; set; }
/// <summary>
/// 刷新时间
/// </summary>
public DateTime RefreshTime { get; set; }
}
}

@ -13,7 +13,7 @@ namespace SlnMesnac.Quartz.Job
{
private readonly ILogger<GetTaskInfo_Job> _logger;
private IAirportTaskService _service;
private BaseTaskInfoBusiness _taskInfoBusiness;
private BaseTaskInfoBusiness _taskInfoBusiness;
public GetTaskInfo_Job(ILogger<GetTaskInfo_Job> logger, IAirportTaskService service)
{
_logger = logger;

@ -1,5 +1,6 @@
using Microsoft.Extensions.Logging;
using Quartz;
using SlnMesnac.Repository.service;
using System;
using System.Collections.Generic;
using System.Text;
@ -38,9 +39,12 @@ namespace SlnMesnac.Quartz.Job
_logger = logger;
}
public Task Execute(IJobExecutionContext context)
{
_logger.LogInformation($"执行Job2{DateTime.Now.ToString("HH:mm:ss")}");
return Task.CompletedTask;
}
}

@ -1,5 +1,7 @@
using Microsoft.Extensions.Logging;
using Quartz;
using SlnMesnac.Repository.service;
using SlnMesnac.Repository.service.Impl;
using System;
using System.Collections.Generic;
using System.Text;
@ -33,9 +35,12 @@ namespace SlnMesnac.Quartz.Job
{
private readonly ILogger<MyJob> _logger;
//private readonly IAirportTaskService _airportTaskService;
public MyJob(ILogger<MyJob> logger)
{
_logger = logger;
//airportTaskService = airportTaskService;
}
public Task Execute(IJobExecutionContext context)

@ -40,12 +40,9 @@ namespace SlnMesnac.Quartz
// trigger.WithCronSchedule("*/3 * * * * ?").WithIdentity("MyJob", "MyJobGroup") // 示例每3s执行一次
//);
q.ScheduleJob<GetAgvState_Job>(trigger =>
trigger.WithCronSchedule("*/5 * * * * ?").WithIdentity("GetAgvState_Job", "GetAgvState_JobGroup") // 示例每5s执行一次
);
q.ScheduleJob<MyJob>(trigger =>
trigger.WithCronSchedule("*/5 * * * * ?").WithIdentity("MyJob", "GetAgvState_JobGroup") // 示例每5s执行一次
);
//q.ScheduleJob<Job2>(trigger =>
// trigger.WithCronSchedule("*/5 * * * * ?").WithIdentity("Job2", "Job2Group") // 示例每5s执行一次
//);
});
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

@ -1,3 +1,4 @@
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.Model.domain;
using SlnMesnac.Model.Enum;
using SlnMesnac.Repository.service.@base;
@ -23,5 +24,18 @@ namespace SlnMesnac.Repository.service
/// <returns></returns>
Task<bool> UpdateAsync(AGVState record);
/// <summary>
/// 查询所有AGV状态
/// </summary>
/// <returns></returns>
List<AGVState> GetAllAGVState();
/// <summary>
/// 根据响应数据插入或更新数据
/// </summary>
/// <param name="response"></param>
/// <returns></returns>
Task<bool> UpdateOrAddByResponse(AGVStateResponseEntity response);
}
}

@ -10,12 +10,12 @@ namespace SlnMesnac.Repository.service
public interface IAirportTaskService : IBaseService<AirportTask>
{
/// <summary>
/// 获取站台任务列表
/// <EFBFBD><EFBFBD>ȡվ̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
/// </summary>
/// <returns></returns>
List<AirportTask> GetTaskInfos();
/// <summary>
/// 获取待执行任务列表
/// <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
/// </summary>
/// <returns></returns>
List<AirportTask> GetAGVTaskInfos();
@ -28,7 +28,7 @@ namespace SlnMesnac.Repository.service
Task<List<AirportTask>> GetTaskInfoListAsync(string ConveyorNo);
/// <summary>
/// 更新任务列表
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
/// </summary>
/// <param name="record"></param>
/// <returns></returns>
@ -49,4 +49,4 @@ namespace SlnMesnac.Repository.service
/// <returns></returns>
Task<bool> DeleteTaskAsync(AirportTask record);
}
}
}

@ -0,0 +1,39 @@
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service.@base;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace SlnMesnac.Repository.service
{
public interface IManipulatorStateService : IBaseService<ManipulatorState>
{
/// <summary>
/// 查询空闲的机械臂信息
/// </summary>
/// <returns></returns>
List<ManipulatorState> GetFreeManipulatorState();
/// <summary>
/// 查询所有机械臂信息
/// </summary>
/// <returns></returns>
List<ManipulatorState> GetAllManipulatorState();
/// <summary>
/// 更新机械臂设备状态信息
/// </summary>
/// <param name="record"></param>
/// <returns></returns>
Task<bool> UpdateAsync(ManipulatorState record);
/// <summary>
/// 更新或插入机械臂设备状态信息
/// </summary>
/// <param name="response"></param>
/// <returns></returns>
Task<bool> UpdateOrAddByResponse(ManipulatorStateResponseEntity response);
}
}

@ -1,10 +1,12 @@
using Microsoft.Extensions.Logging;
using SlnMesnac.Common;
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.Model.domain;
using SlnMesnac.Model.Enum;
using SlnMesnac.Repository.service.@base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
@ -24,13 +26,27 @@ namespace SlnMesnac.Repository.service.Impl
try
{
Expression<Func<AGVState, bool>> exp = x => true;
exp = exp.And(x =>(x.agvno != null || x.agvno != "") && (x.taskno == null || x.taskno == "") && x.agvworkstate == "任务空闲" && (x.agvalarmstate == null || x.agvalarmstate == "") && x.agvtype == _AgvType);
exp = exp.And(x =>(x.agvno != null || x.agvno != "") && (x.taskno == null || x.taskno == "") && x.agvworkstate == "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" && (x.agvalarmstate == null || x.agvalarmstate == "") && x.agvtype == _AgvType);
agvStateInfoList = base._rep.GetList(exp);
}
catch (Exception ex)
{
_logger.LogError($"通过物料类型获取物料信息异常:{ex.Message}");
_logger.LogError($"<22><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>AGV<47><56>Ϣ<EFBFBD>쳣:{ex.Message}");
}
return agvStateInfoList;
}
public List<AGVState> GetAllAGVState()
{
List<AGVState> agvStateInfoList = null;
try
{
agvStateInfoList = base._rep.GetList();
}
catch (Exception ex)
{
_logger.LogError($"<22><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>AGV<47><56>Ϣ<EFBFBD>쳣:{ex.Message}");
}
return agvStateInfoList;
}
@ -41,5 +57,36 @@ namespace SlnMesnac.Repository.service.Impl
return result;
}
public async Task<bool> UpdateOrAddByResponse(AGVStateResponseEntity response)
{
AGVState record = new AGVState()
{
agvno = response.AGVNo,
agvalarmstate = response.AGVAlarmState,
agvtype = response.AGVType,
agvworkstate = response.AGVWorkState,
refreshtime = DateTime.Now,
taskno = response.TaskNo,
};
bool result = false;
try
{
var list = GetAllAGVState();
if (list.Where(x => x.agvno == response.AGVNo).Count() == 0)
{
result = _rep.Insert(record);
}
else
{
record.id = list.Where(x => x.agvno == response.AGVNo).FirstOrDefault().id;
result = await _rep.UpdateAsync(record);
}
}
catch (Exception ex)
{
_logger.LogError($"<22><>е<EFBFBD><D0B5>״̬<D7B4><CCAC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>쳣:{ex.Message}");
}
return result;
}
}
}

@ -0,0 +1,92 @@
using Microsoft.Extensions.Logging;
using SlnMesnac.Common;
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service.@base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace SlnMesnac.Repository.service.Impl
{
public class ManipulatorStateServiceImpl : BaseServiceImpl<ManipulatorState>, IManipulatorStateService
{
private ILogger<ManipulatorStateServiceImpl> _logger;
public ManipulatorStateServiceImpl(Repository<ManipulatorState> rep, ILogger<ManipulatorStateServiceImpl> logger) : base(rep)
{
_logger = logger;
}
public List<ManipulatorState> GetAllManipulatorState()
{
var list = new List<ManipulatorState>();
try
{
list = base._rep.GetList();
}
catch (Exception ex)
{
_logger.LogError($"所有机械臂状态信息获取异常:{ex.Message}");
}
return list;
}
public List<ManipulatorState> GetFreeManipulatorState()
{
var list = new List<ManipulatorState>();
try
{
list = base._rep.GetList()
.Where(x => x.ManipulatorNo != "" && (x.TaskNo == null || x.TaskNo == "") && x.ManipulatorWorkState == "任务空闲")
.ToList();
}
catch (Exception ex)
{
_logger.LogError($"空闲机械臂状态信息获取异常:{ex.Message}");
}
return list;
}
public async Task<bool> UpdateAsync(ManipulatorState record)
{
bool result = await _rep.UpdateAsync(record);
return result;
}
public async Task<bool> UpdateOrAddByResponse(ManipulatorStateResponseEntity response)
{
ManipulatorState record = new ManipulatorState()
{
ManipulatorNo = response.ManipulatorNo,
ManipulatorAlarmState = response.ManipulatorAlarmState,
ManipulatorWorkState = response.ManipulatorWorkState,
TaskNo = response.TaskNo,
RefreshTime = DateTime.Now,
};
bool result = false;
try
{
var list = GetAllManipulatorState();
if (list.Where(x => x.ManipulatorNo == response.ManipulatorNo).Count() == 0)
{
result = _rep.Insert(record);
}
else
{
record.ID = list.Where(x => x.ManipulatorNo == response.ManipulatorNo).FirstOrDefault().ID;
result = await _rep.UpdateAsync(record);
}
}
catch(Exception ex)
{
_logger.LogError($"机械臂状态信息更新异常:{ex.Message}");
}
return result;
}
}
}

@ -0,0 +1,133 @@
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SlnMesnac.Config;
using SlnMesnac.Model.AirportApiEntity;
using SQLitePCL;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Text.Json;
using TouchSocket.Rpc;
using TouchSocket.Sockets;
using TouchSocket.WebApi;
using JsonSerializer = System.Text.Json.JsonSerializer;
using Microsoft.Extensions.Logging;
namespace SlnMesnac.TouchSocket
{
public class AirPorthttpClient : BackgroundService
{
private readonly AppConfig _appConfig;
private readonly ILogger<AirPorthttpClient> _logger;
public AirPorthttpClient(AppConfig appConfig, ILogger<AirPorthttpClient> logger)
{
_appConfig = appConfig;
_logger = logger;
}
public static WebApiClient AirportAGVClient;
public static WebApiClient AirportManipulatorClient;
private WebApiClient CreateWebApiClient(string IpHost)
{
var client = new WebApiClient();
try
{
client.Connect(IpHost);
_logger.LogInformation(IpHost + "连接成功");
}
catch (Exception ex)
{
_logger.LogError("ERROR: " + ex.Message);
return null;
}
return client;
}
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
try
{
AirportAGVClient = CreateWebApiClient(_appConfig.AGVIpConfig);
AirportManipulatorClient = CreateWebApiClient(_appConfig.ManipulatorIpConfig);
}
catch (Exception ex)
{
_logger.LogError("ERROR: " + ex.Message);
return Task.FromException(ex);
}
return Task.CompletedTask;
}
/// <summary>
/// AGV呼叫请求
/// </summary>
/// <returns></returns>
public static string AGVCallRequest()
{
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:", null, new AGVArrivalSingalEntity());
return responseValue.ToString();
}
/// <summary>
/// 机械臂开始工作请求
/// </summary>
/// <returns></returns>
public static string ManipulatorStartRequest()
{
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:", null, new AGVArrivalSingalEntity());
return responseValue.ToString();
}
/// <summary>
/// AGV状态请求
/// </summary>
/// <param name="aGVStateRequest"></param>
/// <returns></returns>
public static AGVStateResponseEntity AGVStateRequest(AGVStateRequestEntity aGVStateRequest)
{
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:/m1/5051269-4712337-default/apitest/AGVtest", null, aGVStateRequest);
if (responseValue == null)
{
return new AGVStateResponseEntity();
}
string json = responseValue.ToString();
if (string.IsNullOrEmpty(json))
{
return new AGVStateResponseEntity();
}
AGVStateResponseEntity aGVStateResponseEntity = new AGVStateResponseEntity();
aGVStateResponseEntity = JsonSerializer.Deserialize<AGVStateResponseEntity>(json);
return aGVStateResponseEntity;
}
/// <summary>
/// 机械臂状态请求
/// </summary>
/// <param name="manipulatorStateRequest"></param>
/// <returns></returns>
public static ManipulatorStateResponseEntity ManipulatorStateRequest(ManipulatorStateRequestEntity manipulatorStateRequest)
{
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:/m1/5051269-4712337-default/apitest/manipulatortest", null, manipulatorStateRequest);
if (responseValue == null)
{
return new ManipulatorStateResponseEntity();
}
string json = responseValue.ToString();
if (string.IsNullOrEmpty(json))
{
return new ManipulatorStateResponseEntity();
}
ManipulatorStateResponseEntity manipulatorState = new ManipulatorStateResponseEntity();
manipulatorState = JsonSerializer.Deserialize<ManipulatorStateResponseEntity>(json);
return manipulatorState;
}
}
}

@ -0,0 +1,19 @@
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace SlnMesnac.TouchSocket
{
public class AirportTcpServer : BackgroundService
{
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
return Task.CompletedTask;
}
}
}

@ -1,4 +1,5 @@
using System;
using SlnMesnac.Model.AirportApiEntity;
using System;
using System.Collections.Generic;
using System.Text;
using TouchSocket.Rpc;
@ -30,80 +31,64 @@ namespace SlnMesnac.TouchSocket
{
public class ApiServer: RpcServer
{
public ApiServer()
{
public delegate void RefreshScanInfoInCenterStart();
/// <summary>
/// 入库开始事件刷新
/// </summary>
public event RefreshScanInfoInCenterStart RefreshScanInfoInCenterStartEvent;
public delegate void RefreshScanInfoInCenterStop();
/// <summary>
/// 入库结束事件刷新
/// </summary>
public event RefreshScanInfoInCenterStop RefreshScanInfoInCenterStopEvent;
public delegate void RefreshScanInfoOutCenterStart();
/// <summary>
/// 出库开始事件刷新
/// </summary>
public event RefreshScanInfoOutCenterStart RefreshScanInfoOutCenterStartEvent;
}
public delegate void RefreshScanInfoOutCenterStop();
public delegate void AGVArrivalStart(string message, AGVArrivalSingalEntity aGVArrivalSingalEntity);
/// <summary>
/// 出库结束事件刷新
/// AGV到位信号刷新
/// </summary>
public event RefreshScanInfoOutCenterStop RefreshScanInfoOutCenterStopEvent;
public event AGVArrivalStart AGVArrivalStartEvent;
/// <summary>
/// 入库开始
/// AGV到位信号接口
/// </summary>
/// <param name="messageHeader"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.POST)]
public object getScanInfoInCenterStart(string messageHeader)
public object AGVArrivalSignal(string messageHeader, AGVArrivalSingalEntity aGVArrivalSingalEntity)
{
RefreshScanInfoInCenterStartEvent?.Invoke();
return true;
AGVArrivalStartEvent?.Invoke(messageHeader, aGVArrivalSingalEntity);
return "Success";
}
public delegate void ManipulatorWorkDoneStart(string message, ManipulatorWorkDoneEntity manipulatorWorkDoneEntity);
/// <summary>
/// 机械臂抓取完毕事件刷新
/// </summary>
public event ManipulatorWorkDoneStart ManipulatorWorkDoneEvent;
/// <summary>
/// 入库结束
/// 机械臂抓取完毕信号接口
/// </summary>
/// <param name="messageHeader"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.POST)]
public object getScanInfoInCenterStop(string messageHeader)
public object ManipulatorWorkDone(string messageHeader, ManipulatorWorkDoneEntity manipulatorWorkDoneEntity)
{
RefreshScanInfoInCenterStopEvent?.Invoke();
return true;
ManipulatorWorkDoneEvent?.Invoke(messageHeader, manipulatorWorkDoneEntity);
return "Success";
}
/// <summary>
/// 出库开始
/// </summary>
/// <param name="messageHeader"></param>
/// <returns></returns>
[WebApi(HttpMethodType.POST)]
public object getScanInfoOutCenterStart(string messageHeader)
public void SubscribeToAGVArrivalEvent()
{
RefreshScanInfoOutCenterStartEvent?.Invoke();
return true;
// 订阅 AGV 到位事件
AGVArrivalStartEvent += OnAGVArrival;
}
/// <summary>
/// 出库结束
/// </summary>
/// <param name="messageHeader"></param>
/// <returns></returns>
[WebApi(HttpMethodType.POST)]
public object getScanInfoOutCenterStop(string messageHeader)
// 处理 AGV 到位事件的方法
public void OnAGVArrival(string message, AGVArrivalSingalEntity aGVArrivalSingalEntity)
{
RefreshScanInfoOutCenterStopEvent?.Invoke();
return true;
Console.WriteLine($"收到AGV到位信号: {message}");
Console.WriteLine($"AGV编号: {aGVArrivalSingalEntity.AGVNo}, 到达位置: {aGVArrivalSingalEntity.DestinationNo}");
// 这里可以处理更多的业务逻辑,比如记录日志、更新系统状态等
}
}
}

@ -0,0 +1,87 @@
using Microsoft.Extensions.Logging;
using Serilog.Core;
using SlnMesnac.Config;
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.TouchSocket.Entity;
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using TouchSocket.Sockets;
namespace SlnMesnac.TouchSocket
{
public class BufferDataAnalysis
{
public static TcpVisionEntity BufferRootAnalysis(byte[] bytes)
{
TcpVisionEntity entity;
//数据校验从起始符开始到数据位按字节求和得出的结果对256求余
if(bytes.Length <= 2)
{
return null;
}
int checkDatalength = bytes.Length - 2;
byte checksum = bytes[checkDatalength];
byte[] checkData = new byte[checkDatalength];
Array.Copy(bytes, 0, checkData, 0, checkDatalength);
int sum = 0;
foreach (byte b in checkData)
{
sum += b;
}
int count = sum % 256;
if (count == checksum)
{
entity = new TcpVisionEntity();
entity.Checksum = checksum;
}
else
{
return null;
}
int index = 2;
//取序列号
entity.SN = new byte[2] { bytes[index], bytes[index + 1] };
index += 2;
//取时间戳
entity.Timestamp = new byte[4] { bytes[index], bytes[index + 1], bytes[index + 2], bytes[index + 3] };
index += 4;
//取命令字
entity.Command = bytes[index];
index += 1;
//取数据位长度
entity.DataLength = bytes[index];
index += 1;
//取数据位
byte[] dataBytes = new byte[entity.DataLength];
Array.Copy(bytes, index, dataBytes, 0, entity.DataLength);
entity.DataBytes = dataBytes;
index += entity.DataLength;
return entity;
}
public byte[] DataCombine(byte[] bytes)
{
return null;
}
public static byte[] GetCurrentUnixTimestampAsBytes()
{
// 获取当前的Unix时间戳表示自1970-01-01以来的秒数
int unixTimestamp = (int)(DateTimeOffset.UtcNow.ToUnixTimeSeconds());
// 将时间戳转换为字节数组
byte[] bytes = BitConverter.GetBytes(unixTimestamp);
return bytes;
}
}
}

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.TouchSocket.Entity
{
public class TcpVisionEntity
{
/// <summary>
/// 序列号
/// </summary>
public byte[] SN { get; set; }
/// <summary>
/// 时间戳
/// </summary>
public byte[] Timestamp { get; set; }
/// <summary>
/// 命令字
/// </summary>
public byte Command { get; set; }
/// <summary>
/// 数据长度
/// </summary>
public byte DataLength { get; set; }
/// <summary>
/// 数据位
/// </summary>
public byte[]? DataBytes { get; set; }
/// <summary>
/// 校验和
/// </summary>
public byte Checksum { get; set; }
}
}

@ -12,6 +12,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SlnMesnac.Model\SlnMesnac.Model.csproj" />
<ProjectReference Include="..\SlnMesnac.Serilog\SlnMesnac.Serilog.csproj" />
</ItemGroup>

@ -1,7 +1,12 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using SlnMesnac.Config;
using SlnMesnac.TouchSocket.Entity;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using TouchSocket.Core;
using TouchSocket.Sockets;
@ -29,10 +34,13 @@ using TouchSocket.Sockets;
#endregion << 版 本 注 释 >>
namespace SlnMesnac.TouchSocket
{
public class TcpServer
public class TcpServer : BackgroundService
{
private ILogger<TcpServer> _logger;
private readonly TcpService _service;
private readonly AppConfig _appConfig;
/// <summary>
/// 接收客户端指令委托
/// </summary>
@ -44,27 +52,64 @@ namespace SlnMesnac.TouchSocket
public Action<String, bool> RefreshStateAction;
public TcpServer(ILogger<TcpServer> logger,TcpService tcpService)
public delegate void GetVisionData(TcpVisionEntity entity);
/// <summary>
/// 视觉系统反馈给上位机调度系统状态
/// </summary>
public event GetVisionData? VisionSysStateEvent;
/// <summary>
/// 视觉系统回复给上位机调度系统开始工作状态
/// </summary>
public event GetVisionData? VisionStartWorkEvent;
/// <summary>
/// 一次码垛完成,发送码垛结果
/// </summary>
public event GetVisionData? StackWorkDoneEvent;
/// <summary>
/// 视觉系统发送给机器人码垛位置定位结果
/// </summary>
public event GetVisionData? StackRobotLocationEvent;
/// <summary>
/// 人工异常处理完成并更新计数
/// </summary>
public event GetVisionData? ManualExceptionDealDoneEvent;
private string ClientID = "";
public TcpServer(ILogger<TcpServer> logger,TcpService tcpService, AppConfig appConfig)
{
_logger = logger;
_service = tcpService;
_appConfig = appConfig;
}
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
Init(_appConfig.TCPVisionConfig);
return Task.CompletedTask;
}
public void Init(int serverPort)
public void Init(string serverPort)
{
try
{
_service.Connecting = (client, e) => {
_service.Connecting = (client, e) => {
_logger.LogInformation($"客户端{client.IP}正在接入服务");
return EasyTask.CompletedTask;
};
_service.Connected = (client, e) => {
_service.Connected = (client, e) => {
_logger.LogInformation($"客户端{client.IP}接入服务成功");
RefreshClientInfoEvent?.Invoke(_service);
RefreshStateAction?.Invoke(client.IP,true);
ClientID = client.Id;
return EasyTask.CompletedTask;
};
_service.Disconnected = (client, e) => {
_service.Disconnected = (client, e) => {
_logger.LogInformation($"客户端{client.IP}断开连接");
RefreshStateAction?.Invoke(client.IP, false);
RefreshClientInfoEvent?.Invoke(_service);
@ -81,15 +126,18 @@ namespace SlnMesnac.TouchSocket
{
RefreshStateAction?.Invoke(client.IP, true);
}
//var mes = Encoding.UTF8.GetString(e.ByteBlock.Buffer, 0, e.ByteBlock.Len);//注意数据长度是byteBlock.Len
byte[] receivedBuffer = new byte[e.ByteBlock.Len];
Array.Copy(e.ByteBlock.Buffer, 0, receivedBuffer, 0, e.ByteBlock.Len);
ReceivedClientBufferEvent?.Invoke(receivedBuffer);
//ReceivedClientBufferEvent?.Invoke(receivedBuffer);
DataClassify(BufferDataAnalysis.BufferRootAnalysis(receivedBuffer));
return EasyTask.CompletedTask;
};
_service.Setup(new TouchSocketConfig()//载入配置
.SetListenIPHosts(new IPHost[] { new IPHost($"0.0.0.0:{serverPort}") })
.SetListenIPHosts(new IPHost[] { new IPHost(serverPort) })
.ConfigureContainer(a =>//容器的配置顺序应该在最前面
{
a.AddConsoleLogger();
@ -110,15 +158,37 @@ namespace SlnMesnac.TouchSocket
}
/// <summary>
/// 向所有客户端发送心跳
/// 数据类型区分
/// </summary>
public void SendHeartBeat()
/// <param name="entity"></param>
public void DataClassify(TcpVisionEntity entity)
{
var clients = _service.SocketClients.GetClients();
foreach (var item in clients)
if(entity == null)
{
_service.Send(item.Id,"heartbeat");
_logger.LogError("数据格式校验错误!");
return;
}
switch(entity.Command)
{
case 10: VisionSysStateEvent?.Invoke(entity); break;
case 11: VisionStartWorkEvent?.Invoke(entity); break;
case 12: StackWorkDoneEvent?.Invoke(entity); break;
case 13: StackRobotLocationEvent?.Invoke(entity); break;
case 14: ManualExceptionDealDoneEvent?.Invoke(entity); break;
default: _logger.LogInformation("未知命令字!"); return;
}
}
///// <summary>
///// 向所有客户端发送心跳
///// </summary>
//public void SendHeartBeat()
//{
// var clients = _service.SocketClients.GetClients();
// foreach (var item in clients)
// {
// _service.Send(item.Id,"heartbeat");
// }
//}
}
}

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Builder;
using TouchSocket.Sockets;
using TouchSocket.WebApi;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
@ -34,7 +35,7 @@ namespace SlnMesnac.TouchSocket
/// </summary>
public static class TouchSocketSetup
{
public static IApplicationBuilder UseTouchSocketExtensions(this IApplicationBuilder app)
{
var _server = app.ApplicationServices.GetService<TcpServer>();

@ -109,4 +109,6 @@ namespace SlnMesnac.TouchSocket
await e.InvokeNext();
}
}
}

@ -1,4 +1,6 @@
using SlnMesnac.WPF.ViewModel;
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.TouchSocket;
using SlnMesnac.WPF.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
@ -27,5 +29,17 @@ namespace SlnMesnac.WPF
this.DataContext = new MainWindowViewModel();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var a = AirPorthttpClient.ManipulatorStateRequest(new ManipulatorStateRequestEntity());
var b = AirPorthttpClient.AGVStateRequest(new AGVStateRequestEntity());
return;
}
}
}

@ -45,6 +45,12 @@ namespace SlnMesnac.WPF
//注册PLC工厂
services.AddPlcFactorySetup();
//注册httpClient
services.AddHostedService<AirPorthttpClient>();
//注册TCPServer
services.AddHostedService<TcpServer>();
//注册RFID工厂
//services.AddRfidFactorySetup();
@ -52,7 +58,7 @@ namespace SlnMesnac.WPF
//services.AddQuartzSetUp();
}
/// <summary>
/// AutoFac自动注入
/// </summary>

@ -48,9 +48,12 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
{
private ILogger<IndexContentViewModel> _logger;
private ILogger<BaseTaskInfoBusiness> _taskBusinessLogger;
private ILogger<BaseStateRefreshBusiness> _stateBusinessLogger;
private IAirportTaskService _taskservice;
private IAGVStateService _agvstateService;
private IManipulatorStateService _monipulatorstateService;
private BaseTaskInfoBusiness _taskInfoBusiness;
private BaseStateRefreshBusiness _StateRefreshBusiness;
private DispatcherTimer _timer;
private TcpServer _tcpServer;
@ -105,6 +108,11 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
LoadTaskInfo();
//_StateRefreshBusiness.UpdateManipulatorStateByResposne(
// new Model.AirportApiEntity.ManipulatorStateRequestEntity()
// { ManipulatorNo = "1", SignalSendTime = DateTime.Now.ToString()});
//List<AirportTask> AirportTaskItem = _taskservice.GetTaskInfos();
//TaskItems = new ObservableCollection<AirportTask>(AirportTaskItem);
// TaskItems = new ObservableCollection<AirportTask>
// {
// new AirportTask { TaskCode = "1", StationName = "1#站台", TaskDetails = "入库P04->C01", Status = "任务状态:执行中" },

@ -8,7 +8,7 @@
},
"AllowedHosts": "*",
"AppConfig": {
"logPath": "F:\\Mesnac\\2023部门项目\\机场AGV调度\\HightWay_AirPot_WCS\\SlnMesnac.WPF\\bin\\Debug\\net6.0-windows\\log",
"logPath": "D:\\WorkCode\\AirPortWCS\\SlnMesnac.WPF\\bin\\Debug\\net6.0-windows\\log",
"SqlConfig": [
//{
// "configId": "mes",
@ -23,7 +23,7 @@
{
"configId": "AGV",
"dbType": 2,
"connStr": "Data Source=F:\\Mesnac\\2023部门项目\\机场AGV调度\\HightWay_AirPot_WCS\\SlnMesnac.WPF\\bin\\Debug\\net6.0-windows\\data\\Airport_db.sqlite;"
"connStr": "Data Source=D:\\WorkCode\\AirPortWCS\\SlnMesnac.WPF\\bin\\Debug\\net6.0-windows\\data\\Airport_db.sqlite"
}
],
"PlcConfig": [
@ -62,8 +62,11 @@
],
"AMRIP": "127.0.0.1",
"redisConfig": "175.27.215.92:6379,password=redis@2023"
"redisConfig": "175.27.215.92:6379,password=redis@2023",
"AGVIpConfig": "127.0.0.1:4523",
"ManipulatorIpConfig": "127.0.0.1:4523",
"TCPVisionConfig": "127.0.0.1:6000"
}
}

@ -0,0 +1,30 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Quartz;
using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.Repository.service;
namespace SlnMesnac.Controllers
{
/// <summary>
/// 任务调度
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class AirportController
{
private readonly ILogger<BaseUserController> _logger;
/// <summary>
///
/// </summary>
/// <param name="logger"></param>
/// <param name="service"></param>
public AirportController(ILogger<BaseUserController> logger)
{
_logger = logger;
}
}
}

@ -1,18 +1,8 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:32147",
"sslPort": 44302
}
},
{
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
//"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@ -20,11 +10,29 @@
"SlnMesnac": {
"commandName": "Project",
"launchBrowser": true,
//"launchUrl": "swagger",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"applicationUrl": "http://localhost:5000"
},
"WSL": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "http://localhost:5000"
},
"distributionName": ""
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:32147",
"sslPort": 44302
}
}
}
}

@ -12,6 +12,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SlnMesnac.Business\SlnMesnac.Business.csproj" />
<ProjectReference Include="..\SlnMesnac.Config\SlnMesnac.Config.csproj" />
<ProjectReference Include="..\SlnMesnac.Extensions\SlnMesnac.Extensions.csproj" />
<ProjectReference Include="..\SlnMesnac.Model\SlnMesnac.Model.csproj" />

@ -4,6 +4,7 @@ using SlnMesnac.Quartz;
using SlnMesnac.Serilog;
using SlnMesnac.Extensions;
using System.Runtime.Serialization;
using SlnMesnac.Business.Airport;
namespace SlnMesnac
{
@ -79,6 +80,8 @@ namespace SlnMesnac
//注册任务调度
services.AddQuartzSetUp();
//添加服务
//services.AddHostedService<AirPortBusiness>();
}

@ -10,6 +10,6 @@
"AppConfig": {
"logPath": "E:\\桌面\\日常代码\\SlnMesnac\\SlnMesnac\\bin\\Debug\\net6.0",
"mesConnStr": "server=.;uid=sa;pwd=123456;database=JiangYinMENS",
"mcsConnStr": "Data Source=175.27.215.92/helowin;User ID=aucma_scada;Password=aucma"
"mcsConnStr": "Data Source=175.27.215.92/helowin;User ID=aucma_scada;Password=aucma",
}
}

Loading…
Cancel
Save