add - 添加机械臂联和AGV自动控制,任务全流程大致写完

master
SoulStar 3 months ago
parent 4608f56271
commit 35118ff75d

@ -332,7 +332,7 @@ namespace SlnMesnac.Business.@base
{ {
return null; return null;
} }
int min = lists.Min(x => x.stackcount); int min = lists.Min(x => x.stackcount); //小车不可能是满的还空闲
AGVState agv = lists.Where(x => x.stackcount == min).FirstOrDefault(); AGVState agv = lists.Where(x => x.stackcount == min).FirstOrDefault();
//var list = _AGVStateService //var list = _AGVStateService
return agv; return agv;

@ -1,10 +1,16 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using SlnMesnac.Model.domain;
using SlnMesnac.Model.Enum;
using SlnMesnac.Repository;
using SlnMesnac.Repository.service; using SlnMesnac.Repository.service;
using SlnMesnac.TouchSocket; using SlnMesnac.TouchSocket;
using SlnMesnac.TouchSocket.Entity; using SlnMesnac.TouchSocket.Entity;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Transactions;
namespace SlnMesnac.Business.@base namespace SlnMesnac.Business.@base
{ {
@ -17,14 +23,20 @@ namespace SlnMesnac.Business.@base
private static VisionBusiness instance; private static VisionBusiness instance;
private TcpServer _tcpServer; private TcpServer _tcpServer;
private IAirportTaskService _airportTaskService; private IAirportTaskService _airportTaskService;
private IVisionSettingService _visionSettingService;
private IAGVStateService _aGVStateService;
private IAGVJobService _AGVJobService;
private BaseAGVBusiness _baseAGVBusiness; private BaseAGVBusiness _baseAGVBusiness;
public VisionBusiness(ILogger<VisionBusiness> logger, TcpServer tcpServer, IAirportTaskService airportTaskService) public VisionBusiness(ILogger<VisionBusiness> logger, TcpServer tcpServer, IAirportTaskService airportTaskService, IVisionSettingService visionSettingService, IAGVStateService aGVStateService, IAGVJobService aGVJobService)
{ {
_logger = logger; _logger = logger;
_tcpServer = tcpServer; _tcpServer = tcpServer;
_airportTaskService = airportTaskService; _airportTaskService = airportTaskService;
_visionSettingService = visionSettingService;
_aGVStateService = aGVStateService;
_AGVJobService = aGVJobService;
//视觉系统回复状态 //视觉系统回复状态
_tcpServer.ReceiveVisionSysStateEvent += VisionStateRequest; _tcpServer.ReceiveVisionSysStateEvent += VisionStateRequest;
@ -32,17 +44,19 @@ namespace SlnMesnac.Business.@base
_tcpServer.ReceiveVisionStartWorkEvent += GetVisionWorkState; _tcpServer.ReceiveVisionStartWorkEvent += GetVisionWorkState;
//视觉系统通知一次码垛完成结果 //视觉系统通知一次码垛完成结果
_tcpServer.ReceiveStackWorkDoneEvent += StackResultSend; _tcpServer.ReceiveStackWorkDoneEvent += StackResultSend;
//_tcpServer.ReceiveStackWorkDoneEvent += AutoStackResultSend;
//视觉系统通知人工异常处理完成 //视觉系统通知人工异常处理完成
_tcpServer.ReceiveManualExceptionDealDoneEvent += GetManualExceptionDealDone; _tcpServer.ReceiveManualExceptionDealDoneEvent += GetManualExceptionDealDone;
//视觉系统回复复位结果 //视觉系统回复复位结果
_tcpServer.ReceiveStackRobotResetEvent += GetResetResult; _tcpServer.ReceiveStackRobotResetEvent += GetResetResult;
_AGVJobService = aGVJobService;
} }
public static VisionBusiness GetInstance(ILogger<VisionBusiness> logger, TcpServer tcpServer, IAirportTaskService airportTaskService) public static VisionBusiness GetInstance(ILogger<VisionBusiness> logger, TcpServer tcpServer, IAirportTaskService airportTaskService, IVisionSettingService visionSettingService, IAGVStateService aGVStateService, IAGVJobService aGVJobService)
{ {
if (instance == null) if (instance == null)
{ {
instance = new VisionBusiness(logger, tcpServer, airportTaskService); instance = new VisionBusiness(logger, tcpServer, airportTaskService, visionSettingService, aGVStateService, aGVJobService);
} }
return instance; return instance;
} }
@ -107,6 +121,262 @@ namespace SlnMesnac.Business.@base
} }
} }
/// <summary>
/// 收到堆筐请求
/// </summary>
/// <param name="entity"></param>
/// <param name="id"></param>
/// <exception cref="Exception"></exception>
public void AutoStackResultSend(TcpVisionEntity entity, string id)
{
if (entity.DataLength == 1)
{
if (entity.DataBytes[0] == 0x00)
{
_logger.LogInformation($"视觉系统一次码垛结束,码垛完成 Deliver:{VDCount} AMR:{VACount}");
//上位机回复收到码垛结果
_tcpServer.SendReplayStackResult(id);
VisionSetting record = _visionSettingService.GetList(x => x.VisionID == id).ToList().First();
AirportTask airportTask = _airportTaskService.GetTaskInfos(x => x.amragvno == record.AMRGUID &&
x.visiontaskno == (BitConverter.ToInt16(entity.SN, 0) - 1).ToString() && x.taskstate == "抓取中").First();
//成功码垛先码垛计数
StackCount(airportTask, entity.DataBytes[1]);
//////////////下面是下一次码垛的综合判断条件//////////////
//先判断总数是否需要继续工作
if (airportTask.totalcount > airportTask.loadcount)
{
//如上一次是AMR 如有Deliver 判断是否到达 到达向deliver发送开始工作没就判断amr是否装满 继续向amr
//上一次是AMR
if (entity.DataBytes[1] == 0x01)
{
//妹有Deliver的任务小车号和是否已到达都没有amr肯定能抓完 继续amr抓取
if (string.IsNullOrEmpty(airportTask.deliveragvno) && string.IsNullOrEmpty(airportTask.deliveragvisarrive))
{
//一直向amr抓直到抓满
RequestVisionStartWork(StackState.AMRNoPositioning, id);
}
//有Delievr任务有任务号且状态为未到达继续amr抓取
else if (!string.IsNullOrEmpty(airportTask.deliveragvno) && airportTask.deliveragvisarrive == "未到达")
{
//判断AMR小车是否装满没满就开装满了就结束开始循环判断deliver是否到达
//amr没满 继续装amr
if (_aGVStateService.GetSingleAGVState(airportTask.amragvno).stackcount < BaseTaskInfoBusiness.AMRStackNumber)
{
RequestVisionStartWork(StackState.AMRNoPositioning, id);
}
//AMR满了
else
{
AirportTask task;
//结束抓取、循环判断deliver是否到达到了就向新的Deliver开始抓取
Task.Run(() =>
{
//请求复位
RequestVisionReplace(id);
while (true)
{
//循环判断该任务的deliver是否到达
Task.Delay(1000);
task = _airportTaskService.GetTaskInfos(x => x.amragvno == record.AMRGUID && x.taskstate == "抓取中").First();
if (task.deliveragvisarrive == "已到达")
{
RequestVisionStartWork(StackState.AGVNeedPositioning, id);
break;
}
}
});
}
}
//有Deliver任务有任务号且已到达向Deliver发送开始抓取
else if (!string.IsNullOrEmpty(airportTask.deliveragvno) && airportTask.deliveragvisarrive == "已到达")
{
RequestVisionStartWork(StackState.AGVNeedPositioning, id);
}
//异常情况
else
{
throw new Exception($"任务 {airportTask.taskno} 状态异常!请清除任务并重新下发任务!");
}
}
//如上一次是deliver-->则判断deliver是否装满-->装满则deliver入库-->判断剩下的数量用不用调新的deliver-->用就调新的deliver然后发向amr抓取(还得判断AMR是否抓满)-->不用就直接向amr抓取
//上一次是Deliver
else if (entity.DataBytes[1] == 0x00)
{
//判断Deliver是否装满,装满就直接入库,未装满继续装
//deliver没满继续装
if (_aGVStateService.GetSingleAGVState(airportTask.deliveragvno).stackcount < BaseTaskInfoBusiness.DeliverStackNumber)
{
RequestVisionStartWork(StackState.AGVNoPositioning, id);
}
//deliver满了入库然后判断
else
{
//入库代码
_baseAGVBusiness.EndTaskAndClearErrorAndDownloadTask(airportTask.deliveragvno,
_AGVJobService.GetAGVJobListByTypeAndConveyorNo("800入库", airportTask.conveyorno).JobName);
airportTask.deliveragvno = null;
airportTask.deliveragvisarrive = null;
_airportTaskService.UpdateTaskAsync(airportTask);
//判断剩下的数量用不用调用新的deliver
//剩下的数量不用 直接向amr抓取
int amrleft = BaseTaskInfoBusiness.AMRStackNumber - _aGVStateService.GetSingleAGVState(airportTask.amragvno).stackcount;
if (airportTask.totalcount - airportTask.loadcount < amrleft)
{
RequestVisionStartWork(StackState.AMRNeedPositioning, id);
}
//剩下的数量需要调用并判断向AMR抓取
else
{
//调新的deliver
AGVState newagv = _baseAGVBusiness.GetBestAGV(AgvType.Deliver);
_baseAGVBusiness.EndTaskAndClearErrorAndDownloadTask(newagv.agvno,
_AGVJobService.GetAGVJobListByTypeAndConveyorNo("800入位", airportTask.conveyorno).JobName);
airportTask.deliveragvno = newagv.agvno;
airportTask.deliveragvisarrive = "未到达";
_airportTaskService.UpdateTaskAsync(airportTask);
//amr无容量结束抓取等待Deliver到达
if (amrleft == 0)
{
AirportTask task;
//结束抓取、循环判断deliver是否到达到了就向新的Deliver开始抓取
Task.Run(() =>
{
//请求复位
RequestVisionReplace(id);
while (true)
{
//循环判断该任务的deliver是否到达
Task.Delay(1000);
task = _airportTaskService.GetTaskInfos(x => x.amragvno == record.AMRGUID && x.taskstate == "抓取中").First();
if (task.deliveragvisarrive == "已到达")
{
RequestVisionStartWork(StackState.AGVNeedPositioning, id);
break;
}
}
});
}
//amr有容量
else
{
RequestVisionStartWork(StackState.AMRNeedPositioning, id);
}
}
}
}
//未知代码
else
{
throw new Exception($"任务 {airportTask.taskno} 未知上次码垛代码!请检查视觉系统状态!");
}
}
//总数达标,结束任务,复位机械臂,调回小车,任务状态调整
else
{
_baseAGVBusiness.EndTaskAndClearErrorAndDownloadTask(airportTask.amragvno,
_AGVJobService.GetAGVJobListByTypeAndConveyorNo("1000入库", airportTask.conveyorno).JobName);
airportTask.amragvno = null;
airportTask.amragvisarrive = null;
airportTask.visiontaskno = null;
if (!string.IsNullOrEmpty(airportTask.deliveragvno))
{
_baseAGVBusiness.EndTaskAndClearErrorAndDownloadTask(airportTask.deliveragvno,
_AGVJobService.GetAGVJobListByTypeAndConveyorNo("800入库", airportTask.conveyorno).JobName);
airportTask.deliveragvno = null;
airportTask.deliveragvisarrive = null;
}
airportTask.finishtime = DateTime.Now;
airportTask.taskstate = "已完成";
_airportTaskService.UpdateTaskAsync(airportTask);
}
}
//码垛过程失败
else if (entity.DataBytes[0] == 0x01)
{
_logger.LogError($"视觉系统一次码垛结束,码垛过程失败,重新发送码垛信号");
if (entity.DataBytes[1] == 0x01)
{
//发送向复合机器人AMR码垛的信号
RequestVisionStartWork(StackState.AMRNoPositioning, id);
_logger.LogInformation("下一次码垛开始,方向:复合机器人");
}
else if (entity.DataBytes[1] == 0x00)
{
//发送向搬运机器人AGVDeliver码垛的信号
RequestVisionStartWork(StackState.AGVNoPositioning, id);
_logger.LogInformation("下一次码垛开始,方向:搬运机器人");
}
else
{
_logger.LogError($"码垛失败返回未知码垛结果代码,请手动重新发送码垛信号");
}
}
//码垛检查失败
else if (entity.DataBytes[0] == 0x02)
{
_logger.LogError($"视觉系统一次码垛结束,码垛检查失败,请手动矫正并手动开始下一次码垛");
//仍然要码垛计数,只是筐码的不准
VisionSetting record = _visionSettingService.GetList(x => x.VisionID == id).ToList().First();
AirportTask airportTask = _airportTaskService.GetTaskInfos(x => x.amragvno == record.AMRGUID &&
x.visiontaskno == (BitConverter.ToInt16(entity.SN, 0) - 1).ToString() && x.taskstate == "抓取中").First();
StackCount(airportTask, entity.DataBytes[1]);
}
//未知代码
else
{
_logger.LogError($"视觉系统一次码垛结束,未知返回代码!请检查视觉系统状态!");
throw new Exception($"视觉系统 {id }一次码垛结束,未知返回代码!请检查视觉系统状态!");
}
}
//数据格式错误
else
{
_logger.LogError($"视觉系统一次码垛结束,返回数据格式错误,请检查视觉系统状态!");
}
}
public void StackCount(AirportTask airportTask, byte lastCount)
{
//AMR码垛计数
if (lastCount == 0x01)
{
airportTask.loadcount++;
AGVState aGVState = _aGVStateService.GetSingleAGVState(airportTask.amragvno);
aGVState.stackcount++;
//判断返回结果
if (_aGVStateService.UpdateAsync(aGVState).Result || _airportTaskService.UpdateTaskAsync(airportTask).Result)
{
_logger.LogInformation($"计数更新成功 {airportTask.amragvno} AMR: {aGVState.stackcount} Total: {airportTask.loadcount}");
}
else
{
_logger.LogError("计数更新失败!");
throw new Exception("计数更新失败!");
}
}
//Deliver码垛计数
else if (lastCount == 0x00)
{
airportTask.loadcount++;
AGVState aGVState = _aGVStateService.GetSingleAGVState(airportTask.deliveragvno);
aGVState.stackcount++;
//判断返回结果
if (_aGVStateService.UpdateAsync(aGVState).Result || _airportTaskService.UpdateTaskAsync(airportTask).Result)
{
_logger.LogInformation($"计数更新成功 {airportTask.amragvno} AMR: {aGVState.stackcount} Total: {airportTask.loadcount}");
}
else
{
_logger.LogError("计数更新失败!");
throw new Exception("计数更新失败!");
}
}
else
{
throw new Exception($"任务 {airportTask.taskno} 未知上次码垛代码!请检查视觉系统状态!");
}
}
int VDCount = 1; int VDCount = 1;
int VACount = 0; int VACount = 0;
int VDTotal = 8; int VDTotal = 8;
@ -127,16 +397,7 @@ namespace SlnMesnac.Business.@base
//上位机回复收到码垛结果 //上位机回复收到码垛结果
_tcpServer.SendReplayStackResult(id); _tcpServer.SendReplayStackResult(id);
//这里写是否继续下一次码垛的判断条件 //这里写是否继续下一次码垛的判断条件
//判断总数是否继续工作 //判断总数是否继续工作
if (true)
{
}
//如有Deliver 判断是否到达 到达向deliver发送开始工作
//如上一次是deliver-->则判断deliver是否装满-->装满则deliver入库-->判断剩下的数量用不用调新的deliver-->用就调新的deliver然后发向amr抓取-->不用就直接向amr抓取
if ((VDCount < VDTotal && Vjudge == true && TotalJudge == true) || (VACount < VATotal && Vjudge == false && TotalJudge == true)) if ((VDCount < VDTotal && Vjudge == true && TotalJudge == true) || (VACount < VATotal && Vjudge == false && TotalJudge == true))
{ {
//如果码垛没结束继续发下一次的码垛信号 //如果码垛没结束继续发下一次的码垛信号
@ -209,7 +470,7 @@ namespace SlnMesnac.Business.@base
/// </summary> /// </summary>
public void GetResetResult(TcpVisionEntity entity, string id) public void GetResetResult(TcpVisionEntity entity, string id)
{ {
if(entity.DataLength == 0x01) if (entity.DataLength == 0x01)
{ {
if (entity.DataBytes[0] == 0x00) if (entity.DataBytes[0] == 0x00)
{ {

@ -4,7 +4,7 @@ using System.Text;
namespace SlnMesnac.Model.domain namespace SlnMesnac.Model.domain
{ {
public class ManipulatorSetting public class VisionSetting
{ {
/// <summary> /// <summary>
/// 自增编号 /// 自增编号
@ -13,14 +13,14 @@ namespace SlnMesnac.Model.domain
public int ID { get; set; } public int ID { get; set; }
/// <summary> /// <summary>
/// 机械臂编号 /// 视觉编号
/// </summary> /// </summary>
public string amragvno { get; set; } public string VisionID { get; set; }
/// <summary> /// <summary>
/// 机械臂所属AGV编号 /// 机械臂所属AMR编号
/// </summary> /// </summary>
public string RelatedAGVNo { get; set; } public string AMRGUID { get; set; }
} }
} }

@ -2,6 +2,7 @@ using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service.@base; using SlnMesnac.Repository.service.@base;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -15,6 +16,12 @@ namespace SlnMesnac.Repository.service
/// <returns></returns> /// <returns></returns>
List<AirportTask> GetTaskInfos(); List<AirportTask> GetTaskInfos();
/// <summary>
/// 获取所有任务信息
/// </summary>
/// <returns></returns>
List<AirportTask> GetTaskInfos(Expression<Func<AirportTask, bool>> expression);
/// <summary> /// <summary>
/// 获取AGV任务信息 /// 获取AGV任务信息
/// </summary> /// </summary>

@ -0,0 +1,38 @@
using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service.@base;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
namespace SlnMesnac.Repository.service
{
public interface IVisionSettingService : IBaseService<VisionSetting>
{
/// <summary>
/// 获取视觉配置列表
/// </summary>
/// <returns></returns>
List<VisionSetting> GetList();
/// <summary>
/// 获取视觉配置列表
/// </summary>
/// <returns></returns>
List<VisionSetting> GetList(Expression<Func<VisionSetting, bool>> expression);
/// <summary>
/// 根据ID获取单条视觉配置
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
VisionSetting GetVisionSettingByID(string id);
/// <summary>
/// 根据AMRGUID获取单条视觉配置
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
VisionSetting GetVisionSettingByAMRGUID(string guid);
}
}

@ -34,7 +34,7 @@ namespace SlnMesnac.Repository.service.Impl
{ {
try try
{ {
var list = _rep.GetList().Where(x => x.JobType == jobType).ToList(); var list = _rep.GetList(x => x.JobType == jobType).ToList();
return list; return list;
} }
catch (Exception ex) catch (Exception ex)
@ -48,7 +48,7 @@ namespace SlnMesnac.Repository.service.Impl
{ {
try try
{ {
AGVJob record = GetAGVJobListByJobType(jobType).Where(x => x.ConveyorNo == conveyorno).First(); AGVJob record = _rep.GetList(x => x.ConveyorNo == conveyorno && x.JobType == jobType).First();
return record; return record;
} }
catch (Exception ex) catch (Exception ex)

@ -138,8 +138,7 @@ namespace SlnMesnac.Repository.service.Impl
{ {
try try
{ {
var lists = GetAllAGVState(); return _rep.GetList(x => x.agvno == AGVguid).First();
return lists.Where(x => x.agvno == AGVguid).First();
} }
catch (Exception ex) catch (Exception ex)
{ {

@ -62,6 +62,26 @@ namespace SlnMesnac.Repository.service.Impl
return taskInfos; return taskInfos;
} }
/// <summary>
/// 获取所有的任务信息
/// </summary>
/// <returns></returns>
public List<AirportTask> GetTaskInfos(Expression<Func<AirportTask, bool>> expression)
{
List<AirportTask> taskInfos = null;
try
{
//string sql = "SELECT id,ConveyorNo,TaskNo,FlightNo,DeliverAGVNo, MAX(StartTime) as StartTime,TaskState, TotalCount ,LoadCount FROM AirportTask group by ConveyorNo ";
//taskInfos = base._rep.AsTenant().GetConnection("AGV").Ado.SqlQuery<AirportTask>(sql);
taskInfos = _rep.GetList(expression);
}
catch (Exception ex)
{
_logger.LogError($"获取任务信息异常:{ex.Message}");
}
return taskInfos;
}
/// <summary> /// <summary>
/// 获取AGV任务信息 /// 获取AGV任务信息
/// </summary> /// </summary>

@ -0,0 +1,71 @@
using Microsoft.Extensions.Logging;
using SlnMesnac.Model.domain;
using SlnMesnac.Repository.service.@base;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
namespace SlnMesnac.Repository.service.Impl
{
public class VisionSettingServiceImpl : BaseServiceImpl<VisionSetting>, IVisionSettingService
{
private ILogger<VisionSettingServiceImpl> _logger;
public VisionSettingServiceImpl(Repository<VisionSetting> repository, ILogger<VisionSettingServiceImpl> logger) : base(repository)
{
_logger = logger;
}
public List<VisionSetting> GetList()
{
try
{
return _rep.GetList();
}
catch (Exception ex)
{
_logger.LogError($"获取视觉配置列表错误");
return null;
}
}
public List<VisionSetting> GetList(Expression<Func<VisionSetting, bool>> expression)
{
try
{
return _rep.GetList(expression);
}
catch (Exception ex)
{
_logger.LogError($"获取视觉配置列表错误");
return null;
}
}
public VisionSetting GetVisionSettingByAMRGUID(string guid)
{
try
{
return _rep.GetSingle(x => x.AMRGUID == guid);
}
catch(Exception ex)
{
_logger.LogError($"根据AMRGUID获取视觉配置错误");
return null;
}
}
public VisionSetting GetVisionSettingByID(string id)
{
try
{
return _rep.GetSingle(x => x.VisionID == id);
}
catch (Exception ex)
{
_logger.LogError($"根据VisionID获取视觉配置错误");
return null;
}
}
}
}

@ -58,6 +58,7 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
private IAGVStateService _agvstateService; private IAGVStateService _agvstateService;
private IAGVMapPointService _agvmapPointService; private IAGVMapPointService _agvmapPointService;
private IAGVJobService _agvJobService; private IAGVJobService _agvJobService;
private IVisionSettingService _visionSettingService;
private BaseTaskInfoBusiness _taskInfoBusiness; private BaseTaskInfoBusiness _taskInfoBusiness;
private BaseStateRefreshBusiness _StateRefreshBusiness; private BaseStateRefreshBusiness _StateRefreshBusiness;
private BaseAGVBusiness _baseAGVBusiness; private BaseAGVBusiness _baseAGVBusiness;
@ -79,11 +80,12 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
_agvmapPointService = App.ServiceProvider.GetService<IAGVMapPointService>(); _agvmapPointService = App.ServiceProvider.GetService<IAGVMapPointService>();
_agvstateService = App.ServiceProvider.GetService<IAGVStateService>(); _agvstateService = App.ServiceProvider.GetService<IAGVStateService>();
_agvJobService = App.ServiceProvider.GetService<IAGVJobService>(); _agvJobService = App.ServiceProvider.GetService<IAGVJobService>();
_visionSettingService = App.ServiceProvider.GetService<IVisionSettingService>();
_tcpServer = App.ServiceProvider.GetService<TcpServer>(); _tcpServer = App.ServiceProvider.GetService<TcpServer>();
_appConfig = App.ServiceProvider.GetService<AppConfig>(); _appConfig = App.ServiceProvider.GetService<AppConfig>();
_airPorthttpClient = App.ServiceProvider.GetService<AirPorthttpClient>(); _airPorthttpClient = App.ServiceProvider.GetService<AirPorthttpClient>();
_visionBusiness = VisionBusiness.GetInstance(_visionBusinessLogger, _tcpServer, _taskservice); _visionBusiness = VisionBusiness.GetInstance(_visionBusinessLogger, _tcpServer, _taskservice, _visionSettingService, _agvstateService, _agvJobService);
_baseAGVBusiness = BaseAGVBusiness.GetInstance(_AGVBusinessLogger, _airPorthttpClient, _agvstateService, _agvmapPointService, _appConfig); _baseAGVBusiness = BaseAGVBusiness.GetInstance(_AGVBusinessLogger, _airPorthttpClient, _agvstateService, _agvmapPointService, _appConfig);
_taskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_taskBusinessLogger, _taskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_taskBusinessLogger,
_taskservice, _agvstateService, _agvmapPointService, _agvJobService, _taskservice, _agvstateService, _agvmapPointService, _agvJobService,

@ -32,6 +32,7 @@ namespace SlnMesnac.WPF.ViewModel
private IAGVMapPointService _AGVMapPointService; private IAGVMapPointService _AGVMapPointService;
private IAGVSettingService _AGVSettingService; private IAGVSettingService _AGVSettingService;
private IAGVJobService _agvJobService; private IAGVJobService _agvJobService;
private IVisionSettingService _visionSettingService;
private TcpServer _tcpServer; private TcpServer _tcpServer;
//代码生成 //代码生成
private readonly GenerateControl generateControl = new GenerateControl(); private readonly GenerateControl generateControl = new GenerateControl();
@ -116,13 +117,14 @@ namespace SlnMesnac.WPF.ViewModel
_AGVMapPointService = App.ServiceProvider.GetService<IAGVMapPointService>(); _AGVMapPointService = App.ServiceProvider.GetService<IAGVMapPointService>();
_AGVSettingService = App.ServiceProvider.GetService<IAGVSettingService>(); _AGVSettingService = App.ServiceProvider.GetService<IAGVSettingService>();
_agvJobService = App.ServiceProvider.GetService<IAGVJobService>(); _agvJobService = App.ServiceProvider.GetService<IAGVJobService>();
_visionSettingService = App.ServiceProvider.GetService<IVisionSettingService>();
_tcpServer = App.ServiceProvider.GetService<TcpServer>(); _tcpServer = App.ServiceProvider.GetService<TcpServer>();
_airPorthttpClient = App.ServiceProvider.GetService<AirPorthttpClient>(); _airPorthttpClient = App.ServiceProvider.GetService<AirPorthttpClient>();
_baseTaskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_BaseTaskInfoBusinesslogger, _baseTaskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_BaseTaskInfoBusinesslogger,
_Taskservice, _AGVStateService, _AGVMapPointService, _agvJobService, _Taskservice, _AGVStateService, _AGVMapPointService, _agvJobService,
_tcpServer, _airPorthttpClient, _baseAGVBusiness, _visionBusiness); _tcpServer, _airPorthttpClient, _baseAGVBusiness, _visionBusiness);
_baseAGVBusiness = BaseAGVBusiness.GetInstance(_baseAGVBusinessLogger, _airPorthttpClient, _AGVStateService, _AGVMapPointService, _appConfig); _baseAGVBusiness = BaseAGVBusiness.GetInstance(_baseAGVBusinessLogger, _airPorthttpClient, _AGVStateService, _AGVMapPointService, _appConfig);
_visionBusiness = VisionBusiness.GetInstance(_VisionBusinessLogger, _tcpServer, _Taskservice); _visionBusiness = VisionBusiness.GetInstance(_VisionBusinessLogger, _tcpServer, _Taskservice, _visionSettingService, _AGVStateService, _agvJobService);
_baseStateRefreshBusiness = BaseStateRefreshBusiness.GetInstance(_StateRefreshBusinessLogger, _AGVStateService, _airPorthttpClient, _AGVSettingService); _baseStateRefreshBusiness = BaseStateRefreshBusiness.GetInstance(_StateRefreshBusinessLogger, _AGVStateService, _airPorthttpClient, _AGVSettingService);
ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj)); ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj));
FormControlCommand = new RelayCommand<object>(x => FormControl(x)); FormControlCommand = new RelayCommand<object>(x => FormControl(x));

Loading…
Cancel
Save