diff --git a/SlnMesnac.Business/base/BaseAGVBusiness.cs b/SlnMesnac.Business/base/BaseAGVBusiness.cs new file mode 100644 index 0000000..937debc --- /dev/null +++ b/SlnMesnac.Business/base/BaseAGVBusiness.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SlnMesnac.Business.@base +{ + public class BaseAGVBusiness + { + + } +} diff --git a/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs b/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs index e01a058..e31ff74 100644 --- a/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs +++ b/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs @@ -30,7 +30,11 @@ namespace SlnMesnac.Business.@base return instance; } - public bool UpdateAGVStateByResposne() + /// + /// 调用接口更新所有AGV的状态 + /// + /// + public bool UpdateALLAGVStateByResposne() { try { diff --git a/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs b/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs index d36fad3..95d0f5b 100644 --- a/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs +++ b/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs @@ -14,6 +14,8 @@ using SlnMesnac.Model.Enum; using HslCommunication.Enthernet; using System.Threading; using SlnMesnac.TouchSocket.Entity; +using SlnMesnac.Model.AirportApiEntity; +using System.Linq; namespace SlnMesnac.Business.@base { @@ -26,7 +28,13 @@ namespace SlnMesnac.Business.@base private ILogger _logger; private IAirportTaskService _Taskservice; private IAGVStateService _AGVStateService; - public BaseTaskInfoBusiness(ILogger logger, IAirportTaskService Taskservice, IAGVStateService agvService, TcpServer tcpServer) + private AirPorthttpClient _airpttpClient; + public BaseTaskInfoBusiness( + ILogger logger, + IAirportTaskService Taskservice, + IAGVStateService agvService, + TcpServer tcpServer, + AirPorthttpClient airPorthttpClient) { _logger = logger; _tcpServer = tcpServer; @@ -34,9 +42,45 @@ namespace SlnMesnac.Business.@base _tcpServer.ReceiveStackWorkDoneEvent += _tcpServer_StackWorkDoneEvent; _Taskservice = Taskservice; _AGVStateService = agvService; + _airpttpClient = airPorthttpClient; InitClearTimer(); //doWhileGetAGVTaskInfo(); } + + public static BaseTaskInfoBusiness GetInstance( + ILogger logger, + IAirportTaskService Taskservice, + IAGVStateService agvService, + TcpServer tcpServer, + AirPorthttpClient airPorthttpClient) + { + if (instance == null) + { + instance = new BaseTaskInfoBusiness(logger, Taskservice, agvService, tcpServer, airPorthttpClient); + } + return instance; + } + + /// + /// 调用接口更新指定的任务状态 + /// + /// + public void RefreshTaskStateForResopnse(AGVRequestTaskStateDetailEntity request) + { + AGVResponseEntity response = _airpttpClient.AGVGetTaskStateDetailRequest(request); + if (response.code == 1) + { + _logger.LogError("返回错误:" + response.message); + return; + } + if (response.code == 0) + { + AirportTask record = new AirportTask(); + List list = _Taskservice.GetTaskInfos(); + //list.Where(x => x.taskno == response.Data + } + } + /// /// 一次码垛完成,发送码垛结果 /// @@ -91,7 +135,7 @@ namespace SlnMesnac.Business.@base //任务异常 else if (entity.DataBytes[0] == 0x01) { - + } } } @@ -102,15 +146,6 @@ namespace SlnMesnac.Business.@base } } - public static BaseTaskInfoBusiness GetInstance(ILogger logger, IAirportTaskService Taskservice, IAGVStateService agvService, TcpServer tcpServer) - { - if (instance == null) - { - instance = new BaseTaskInfoBusiness(logger, Taskservice,agvService, tcpServer); - } - return instance; - } - private void doWhileGetAGVTaskInfo() { try @@ -119,7 +154,7 @@ namespace SlnMesnac.Business.@base { while (true) { - GetAGVTaskInfo(null,null); + GetAGVTaskInfo(null, null); Task.Delay(1000); } @@ -138,7 +173,7 @@ namespace SlnMesnac.Business.@base { Interval = 1000, // 每天执行一次 AutoReset = true, - + }; timer.Elapsed += GetAGVTaskInfo; timer.Start(); @@ -160,7 +195,7 @@ namespace SlnMesnac.Business.@base foreach (var TaskItem in Task) { //AGV未派发,AMR未派发 - if (string.IsNullOrEmpty(TaskItem.agvno) && string.IsNullOrEmpty(TaskItem.manipulatorno)) + if (string.IsNullOrEmpty(TaskItem.deliveragvno) && string.IsNullOrEmpty(TaskItem.amragvno)) { _RefreshLogMessageAction?.Invoke($"正在为AGV,AMR分配任务..."); _logger.LogInformation($"正在为AGV,AMR分配任务"); @@ -170,7 +205,7 @@ namespace SlnMesnac.Business.@base //查询机械臂状态 } //AGV已派发,AMR未派发 - if (!string.IsNullOrEmpty(TaskItem.agvno) && string.IsNullOrEmpty(TaskItem.manipulatorno)) + if (!string.IsNullOrEmpty(TaskItem.deliveragvno) && string.IsNullOrEmpty(TaskItem.amragvno)) { //查询AMR状态 CreateAMRTask(TaskItem); @@ -179,7 +214,7 @@ namespace SlnMesnac.Business.@base _logger.LogInformation($"正在为AMR分配任务"); } //AGV未派发,AMR已派发 - if (string.IsNullOrEmpty(TaskItem.agvno) && !string.IsNullOrEmpty(TaskItem.manipulatorno)) + if (string.IsNullOrEmpty(TaskItem.deliveragvno) && !string.IsNullOrEmpty(TaskItem.amragvno)) { _RefreshLogMessageAction?.Invoke($"正在为AGV分配任务..."); @@ -192,7 +227,7 @@ namespace SlnMesnac.Business.@base } } - + @@ -232,7 +267,7 @@ namespace SlnMesnac.Business.@base _AGVStateService.UpdateAsync(AgvItem); //更新任务信息表状态为执行中 - AirportTask.manipulatorno = AgvItem.agvno; + AirportTask.amragvno = AgvItem.agvno; AirportTask.taskstate = "执行中"; _Taskservice.UpdateTaskAsync(AirportTask); break; @@ -257,7 +292,7 @@ namespace SlnMesnac.Business.@base try { iflag = true; - List State = GetAgvState(AgvType.AGV); + List State = GetAgvState(AgvType.Deliver); foreach (var AgvItem in State) { //根据规则筛选最优AGV @@ -276,7 +311,7 @@ namespace SlnMesnac.Business.@base _AGVStateService.UpdateAsync(AgvItem); //更新任务信息表状态为执行中 - AirportTask.agvno = AgvItem.agvno; + AirportTask.deliveragvno = AgvItem.agvno; AirportTask.taskstate = "执行中"; _Taskservice.UpdateTaskAsync(AirportTask); break; @@ -290,6 +325,7 @@ namespace SlnMesnac.Business.@base return iflag; } } + /// /// 获取agv设备状态 /// @@ -332,7 +368,7 @@ namespace SlnMesnac.Business.@base } Thread.Sleep(100); } - + }); } catch (Exception ex) diff --git a/SlnMesnac.Model/Enum/AgvType.cs b/SlnMesnac.Model/Enum/AgvType.cs index e260700..8e6d543 100644 --- a/SlnMesnac.Model/Enum/AgvType.cs +++ b/SlnMesnac.Model/Enum/AgvType.cs @@ -6,7 +6,7 @@ namespace SlnMesnac.Model.Enum { public enum AgvType { - AGV = 1, + Deliver = 1, AMR = 2, } } diff --git a/SlnMesnac.Model/domain/AGVMapPoint.cs b/SlnMesnac.Model/domain/AGVMapPoint.cs new file mode 100644 index 0000000..9c1df78 --- /dev/null +++ b/SlnMesnac.Model/domain/AGVMapPoint.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SlnMesnac.Model.domain +{ + /// + /// AGV已激活地图点位表 + /// + public class AGVMapPoint + { + /// + /// 自增编号 + /// + [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int ID { get; set; } + + /// + /// 地图ID + /// + public string MapID { get; set; } + + /// + /// 点位ID + /// + public string PointGuid { get; set; } + + /// + /// 位置点类型 0:普通 1:⾼精度 2:充电桩 3:闲置点 + /// + public string? PointType { get; set; } + + /// + /// 点位名称 + /// + public string? PointName { get; set; } + + /// + /// 地图名称 + /// + public string? MapName { get; set; } + + + } +} diff --git a/SlnMesnac.Model/domain/AGVSetting.cs b/SlnMesnac.Model/domain/AGVSetting.cs index 53c0456..1f48505 100644 --- a/SlnMesnac.Model/domain/AGVSetting.cs +++ b/SlnMesnac.Model/domain/AGVSetting.cs @@ -18,7 +18,7 @@ namespace SlnMesnac.Model.domain public string AGVNo { get; set; } /// - /// AGV类型 + /// AGV类型 1:DeliverAGV 2: AMRAGV /// public string AGVType { get; set; } } diff --git a/SlnMesnac.Model/domain/AGVState.cs b/SlnMesnac.Model/domain/AGVState.cs index b0893cc..90a98ff 100644 --- a/SlnMesnac.Model/domain/AGVState.cs +++ b/SlnMesnac.Model/domain/AGVState.cs @@ -11,10 +11,6 @@ namespace SlnMesnac.Repository [SugarTable("AGVState")] public partial class AGVState { - public AGVState(){ - - - } /// /// Desc: /// Default: @@ -32,7 +28,7 @@ namespace SlnMesnac.Repository public string agvno {get;set;} /// - /// Desc:AGV类型 1:AMR 2: 机械臂 + /// Desc:AGV类型 1:DeliverAGV 2: AMRAGV /// Default: /// Nullable:False /// diff --git a/SlnMesnac.Model/domain/AirportTask.cs b/SlnMesnac.Model/domain/AirportTask.cs index 1574354..9d0f940 100644 --- a/SlnMesnac.Model/domain/AirportTask.cs +++ b/SlnMesnac.Model/domain/AirportTask.cs @@ -11,113 +11,125 @@ namespace SlnMesnac.Repository [SugarTable("AirportTask")] public partial class AirportTask { - public AirportTask(){ - - - } - /// - /// Desc: - /// Default: - /// Nullable:False - /// - [SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="ID")] - public int id {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:False - /// - [SugarColumn(ColumnName="TaskNo")] - public string taskno {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="ConveyorNo")] - public string conveyorno {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="FlightNo")] - public string flightno {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="ManipulatorNo")] - public string manipulatorno {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="ManipulatorAGVIsArrive")] - public string manipulatoragvisarrive {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="AGVNo")] - public string agvno {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="AGVIsArrive")] - public string agvisarrive {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="TotalCount")] - public int? totalcount {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="LoadCount")] - public int? loadcount {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="TaskState")] - public string taskstate {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="StartTime")] - public DateTime? starttime {get;set;} - - /// - /// Desc: - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="FinishTime")] - public DateTime? finishtime {get;set;} - + public AirportTask() + { + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "ID")] + public int id { get; set; } + + /// + /// Desc:任务编号 + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnName = "TaskNo")] + public string taskno { get; set; } + + /// + /// Desc:传送带编号 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "ConveyorNo")] + public string conveyorno { get; set; } + + /// + /// Desc:航班编号 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "FlightNo")] + public string flightno { get; set; } + + /// + /// Desc:AMRAGV编号 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "AMRAGVNo")] + public string amragvno { get; set; } + + /// + /// Desc:AMRAGV是否到达 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "AMRAGVIsArrive")] + public string amragvisarrive { get; set; } + + /// + /// Desc:搬运AGV编号 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "DeliverAGVNo")] + public string deliveragvno { get; set; } + + /// + /// Desc:搬运AGV是否到达 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "DeliverAGVIsArrive")] + public string deliveragvisarrive { get; set; } + + /// + /// Desc:总数量 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "TotalCount")] + public int? totalcount { get; set; } + + /// + /// Desc:已装载数量 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "LoadCount")] + public int? loadcount { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "TaskState")] + public string taskstate { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "StartTime")] + public DateTime? starttime { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "FinishTime")] + public DateTime? finishtime { get; set; } + + /// + /// 运载小车任务编号 + /// + [SugarColumn(ColumnName = "DeliverAGVTaskNo")] + public string deliveragvTaskNo { get; set; } + + /// + /// 机械臂小车任务编号 + /// + [SugarColumn(ColumnName = "AMRAGVTaskNo")] + public string amragvTaskNo { get; set; } } } diff --git a/SlnMesnac.Model/domain/ManipulatorLog.cs b/SlnMesnac.Model/domain/ManipulatorLog.cs index 821c003..50725f2 100644 --- a/SlnMesnac.Model/domain/ManipulatorLog.cs +++ b/SlnMesnac.Model/domain/ManipulatorLog.cs @@ -15,7 +15,7 @@ namespace SlnMesnac.Model.domain /// /// 机械臂编号 /// - public string ManipulatorNo { get; set; } + public string amragvno { get; set; } /// /// 任务编号 diff --git a/SlnMesnac.Model/domain/ManipulatorSetting.cs b/SlnMesnac.Model/domain/ManipulatorSetting.cs index b8fedff..2e38320 100644 --- a/SlnMesnac.Model/domain/ManipulatorSetting.cs +++ b/SlnMesnac.Model/domain/ManipulatorSetting.cs @@ -15,7 +15,7 @@ namespace SlnMesnac.Model.domain /// /// 机械臂编号 /// - public string ManipulatorNo { get; set; } + public string amragvno { get; set; } /// /// 机械臂所属AGV编号 diff --git a/SlnMesnac.Model/domain/ManipulatorState.cs b/SlnMesnac.Model/domain/ManipulatorState.cs index 65b7b6c..338adea 100644 --- a/SlnMesnac.Model/domain/ManipulatorState.cs +++ b/SlnMesnac.Model/domain/ManipulatorState.cs @@ -15,7 +15,7 @@ namespace SlnMesnac.Model.domain /// /// 机械臂编号 /// - public string ManipulatorNo { get; set; } + public string amragvno { get; set; } /// /// 任务编号 diff --git a/SlnMesnac.Model/domain/VisionTask.cs b/SlnMesnac.Model/domain/VisionTask.cs new file mode 100644 index 0000000..b006c68 --- /dev/null +++ b/SlnMesnac.Model/domain/VisionTask.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SlnMesnac.Model.domain +{ + public class VisionTask + { + /// + /// 自增编号 + /// + [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int ID { get; set; } + + /// + /// 视觉任务编号 + /// + public string? VisionTaskID { get; set; } + + /// + /// 总数量 + /// + public int TotalCount { get; set; } + + /// + /// 已抓取数量 + /// + public int LoadedCount { get; set; } + + /// + /// 刷新时间 + /// + public DateTime? RefreshTime { get; set; } + + /// + /// 所属总任务编号 + /// + public string? AirportTaskID { get; set; } + + + } +} diff --git a/SlnMesnac.Repository/service/IAGVSettingService.cs b/SlnMesnac.Repository/service/IAGVSettingService.cs new file mode 100644 index 0000000..d974188 --- /dev/null +++ b/SlnMesnac.Repository/service/IAGVSettingService.cs @@ -0,0 +1,18 @@ +using SlnMesnac.Model.domain; +using SlnMesnac.Model.Enum; +using SlnMesnac.Repository.service.@base; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SlnMesnac.Repository.service +{ + public interface IAGVSettingService : IBaseService + { + /// + /// 查询所有AGV状态 + /// + /// + List GetAllAgvSetting(); + } +} diff --git a/SlnMesnac.Repository/service/IAirportTaskService.cs b/SlnMesnac.Repository/service/IAirportTaskService.cs index 8c6d7e4..c665cb6 100644 --- a/SlnMesnac.Repository/service/IAirportTaskService.cs +++ b/SlnMesnac.Repository/service/IAirportTaskService.cs @@ -10,17 +10,17 @@ namespace SlnMesnac.Repository.service public interface IAirportTaskService : IBaseService { /// - /// ��ȡվ̨�����б� + /// ȡϢ /// /// List GetTaskInfos(); + /// - /// ��ȡ��ִ�������б� + /// ȡAGVϢ /// /// List GetAGVTaskInfos(); - /// /// վ̨Ųѯб /// @@ -28,22 +28,21 @@ namespace SlnMesnac.Repository.service Task> GetTaskInfoListAsync(string ConveyorNo); /// - /// ���������б� + /// Ϣ /// /// /// Task UpdateTaskAsync(AirportTask record); - /// - /// + /// Ϣ /// /// /// Task AddTaskAsync(AirportTask record); /// - /// ɾ + /// ɾϢ /// /// /// diff --git a/SlnMesnac.Repository/service/Impl/AGVSettingServiceImpl.cs b/SlnMesnac.Repository/service/Impl/AGVSettingServiceImpl.cs new file mode 100644 index 0000000..88b2d26 --- /dev/null +++ b/SlnMesnac.Repository/service/Impl/AGVSettingServiceImpl.cs @@ -0,0 +1,32 @@ +using Microsoft.Extensions.Logging; +using SlnMesnac.Model.domain; +using SlnMesnac.Repository.service.@base; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SlnMesnac.Repository.service.Impl +{ + public class AGVSettingServiceImpl : BaseServiceImpl, IAGVSettingService + { + private ILogger _logger; + public AGVSettingServiceImpl(Repository repository, ILogger logger) : base(repository) + { + _logger = logger; + } + + public List GetAllAgvSetting() + { + List agvSettingList = null; + try + { + agvSettingList = base._rep.GetList(); + } + catch (Exception ex) + { + _logger.LogError($"所有AGV设置获取错误:{ex.Message}"); + } + return agvSettingList; + } + } +} diff --git a/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs b/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs index 579f3f9..c69eace 100644 --- a/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs +++ b/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs @@ -19,6 +19,7 @@ namespace SlnMesnac.Repository.service.Impl { _logger = logger; } + public List GetAgvState(AgvType AgvType) { string _AgvType = Convert.ToString(((int)AgvType).ToString()); @@ -62,6 +63,11 @@ namespace SlnMesnac.Repository.service.Impl return result; } + /// + /// 根据响应数据更新AGV状态 + /// + /// + /// public async Task UpdateOrAddByResponse(AGVResponseEntity> response) { List records = new List(); diff --git a/SlnMesnac.Repository/service/Impl/AirportTaskServiceImpl.cs b/SlnMesnac.Repository/service/Impl/AirportTaskServiceImpl.cs index 2009ff8..e1552cf 100644 --- a/SlnMesnac.Repository/service/Impl/AirportTaskServiceImpl.cs +++ b/SlnMesnac.Repository/service/Impl/AirportTaskServiceImpl.cs @@ -51,7 +51,7 @@ namespace SlnMesnac.Repository.service.Impl List taskInfos = null; try { - String sql = "SELECT id,ConveyorNo,TaskNo,FlightNo,AGVNo,MAX(StartTime) as StartTime,TaskState, TotalCount ,LoadCount FROM AirportTask group by ConveyorNo "; + 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(sql); } catch (Exception ex) @@ -70,7 +70,7 @@ namespace SlnMesnac.Repository.service.Impl List taskInfos = null; try { - String sql = "select *from ( SELECT id, ConveyorNo,TaskNo,FlightNo,AGVNo,ManipulatorNo,MAX(StartTime) as StartTime,TaskState, TotalCount ,LoadCount FROM AirportTask group by ConveyorNo )"; + string sql = "select *from ( SELECT id, ConveyorNo,TaskNo,FlightNo,DeliverAGVNo, amragvno,MAX(StartTime) as StartTime,TaskState, TotalCount ,LoadCount FROM AirportTask group by ConveyorNo )"; taskInfos = base._rep.AsTenant().GetConnection("AGV").Ado.SqlQuery(sql); } catch (Exception ex) @@ -99,6 +99,7 @@ namespace SlnMesnac.Repository.service.Impl bool result = await _rep.InsertAsync(record); return result; } + public async Task DeleteTaskAsync(AirportTask record) { bool iFlag = await _rep.DeleteAsync(record); diff --git a/SlnMesnac.WPF/Page/IndexPage/DetailTaskContent.xaml b/SlnMesnac.WPF/Page/IndexPage/DetailTaskContent.xaml index 113bb7b..7d6ac5a 100644 --- a/SlnMesnac.WPF/Page/IndexPage/DetailTaskContent.xaml +++ b/SlnMesnac.WPF/Page/IndexPage/DetailTaskContent.xaml @@ -86,7 +86,7 @@ - + diff --git a/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs b/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs index 20732c6..d9bd170 100644 --- a/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs @@ -58,6 +58,7 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage private DispatcherTimer _timer; private TcpServer _tcpServer; private AppConfig _appConfig; + private AirPorthttpClient _airPorthttpClient; public IndexContentViewModel() { @@ -67,8 +68,9 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage _agvstateService = App.ServiceProvider.GetService(); _tcpServer = App.ServiceProvider.GetService(); _appConfig = App.ServiceProvider.GetService(); + _airPorthttpClient = App.ServiceProvider.GetService(); - _taskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_taskBusinessLogger, _taskservice, _agvstateService, _tcpServer); + _taskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_taskBusinessLogger, _taskservice, _agvstateService, _tcpServer, _airPorthttpClient); _taskInfoBusiness._RefreshLogMessageAction += RefreshLogMessage; _taskInfoBusiness._Taskaction += task => { @@ -80,8 +82,8 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage x.id = task.id; x.taskno = task.taskno; x.flightno = task.flightno; - x.manipulatorno = task.manipulatorno; - x.agvno = task.agvno; + x.amragvno = task.amragvno; + x.deliveragvno = task.deliveragvno; x.taskstate = task.taskstate; TaskItems = new ObservableCollection(TaskItems); @@ -117,7 +119,7 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage //_StateRefreshBusiness.UpdateManipulatorStateByResposne( // new Model.AirportApiEntity.ManipulatorStateRequestEntity() - // { ManipulatorNo = "1", SignalSendTime = DateTime.Now.ToString()}); + // { amragvno = "1", SignalSendTime = DateTime.Now.ToString()}); //List AirportTaskItem = _taskservice.GetTaskInfos(); //TaskItems = new ObservableCollection(AirportTaskItem); // TaskItems = new ObservableCollection @@ -180,10 +182,10 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage { foreach (var VARIABLE in TaskItems) { - if (VARIABLE.agvno == airportTask.conveyorno) + if (VARIABLE.deliveragvno == airportTask.conveyorno) { VARIABLE.taskstate = airportTask.taskstate; - VARIABLE.agvno = airportTask.agvno; + VARIABLE.deliveragvno = airportTask.deliveragvno; VARIABLE.totalcount = airportTask.totalcount; VARIABLE.loadcount = airportTask.loadcount; } @@ -317,8 +319,8 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage x.id = task.id; x.taskno = task.taskno; x.flightno = task.flightno; - x.manipulatorno = task.manipulatorno; - x.agvno = task.agvno; + x.amragvno = task.amragvno; + x.deliveragvno = task.deliveragvno; x.taskstate = task.taskstate; TaskItems = new ObservableCollection(TaskItems); } diff --git a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs index f9f2f58..d60850d 100644 --- a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs @@ -25,6 +25,7 @@ namespace SlnMesnac.WPF.ViewModel private readonly GenerateControl generateControl = new GenerateControl(); private IndexContent indexContent = new IndexContent(); private AppConfig _appConfig; + private AirPorthttpClient _airPorthttpClient; #region 参数定义 /// @@ -95,7 +96,8 @@ namespace SlnMesnac.WPF.ViewModel _AGVStateService = App.ServiceProvider.GetService(); _BaseTaskInfoBusinesslogger = App.ServiceProvider.GetService>(); _tcpServer = App.ServiceProvider.GetService(); - BaseTaskInfoBusiness.GetInstance(_BaseTaskInfoBusinesslogger, _Taskservice, _AGVStateService, _tcpServer); + _airPorthttpClient = App.ServiceProvider.GetService(); + BaseTaskInfoBusiness.GetInstance(_BaseTaskInfoBusinesslogger, _Taskservice, _AGVStateService, _tcpServer, _airPorthttpClient); ControlOnClickCommand = new RelayCommand(obj => ControlOnClick(obj)); FormControlCommand = new RelayCommand(x => FormControl(x)); _tcpServer.RefreshStateAction+= (_clientIP, _state) =>