|
|
|
@ -21,6 +21,7 @@ using SlnMesnac.TouchSocket;
|
|
|
|
|
using HslCommunication.Enthernet;
|
|
|
|
|
using SlnMesnac.Config;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using SlnMesnac.Common;
|
|
|
|
|
|
|
|
|
|
#region << 版 本 注 释 >>
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
@ -50,14 +51,19 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
|
|
|
|
|
{
|
|
|
|
|
private ILogger<IndexContentViewModel> _logger;
|
|
|
|
|
private ILogger<BaseTaskInfoBusiness> _taskBusinessLogger;
|
|
|
|
|
private ILogger<BaseStateRefreshBusiness> _stateBusinessLogger;
|
|
|
|
|
//private ILogger<BaseStateRefreshBusiness> _stateBusinessLogger;
|
|
|
|
|
private IAirportTaskService _taskservice;
|
|
|
|
|
private IAGVStateService _agvstateService;
|
|
|
|
|
private BaseTaskInfoBusiness _taskInfoBusiness;
|
|
|
|
|
private BaseStateRefreshBusiness _StateRefreshBusiness;
|
|
|
|
|
private DispatcherTimer _timer;
|
|
|
|
|
private TcpServer _tcpServer;
|
|
|
|
|
private AppConfig _appConfig;
|
|
|
|
|
private AirPorthttpClient _airPorthttpClient;
|
|
|
|
|
|
|
|
|
|
private Idata1_TableService _data1TableService;
|
|
|
|
|
private Idata2_TableService _data2TableService;
|
|
|
|
|
private IT_RP_StationPara_110_1Service _tr_stationPara_110_1Service;
|
|
|
|
|
private IT_RP_StationPara_110_2Service _tr_stationPara_110_2Service;
|
|
|
|
|
|
|
|
|
|
public IndexContentViewModel()
|
|
|
|
|
{
|
|
|
|
@ -67,48 +73,90 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
|
|
|
|
|
_agvstateService = App.ServiceProvider.GetService<IAGVStateService>();
|
|
|
|
|
_tcpServer = App.ServiceProvider.GetService<TcpServer>();
|
|
|
|
|
_appConfig = App.ServiceProvider.GetService<AppConfig>();
|
|
|
|
|
|
|
|
|
|
_taskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_taskBusinessLogger, _taskservice, _agvstateService, _tcpServer);
|
|
|
|
|
_taskInfoBusiness._RefreshLogMessageAction += RefreshLogMessage;
|
|
|
|
|
_taskInfoBusiness._Taskaction += task =>
|
|
|
|
|
{
|
|
|
|
|
if (task != null)
|
|
|
|
|
{
|
|
|
|
|
var x = TaskItems.ToList().Find(x => x.conveyorno == task.conveyorno);
|
|
|
|
|
if (x != null)
|
|
|
|
|
{
|
|
|
|
|
x.id = task.id;
|
|
|
|
|
x.taskno = task.taskno;
|
|
|
|
|
x.flightno = task.flightno;
|
|
|
|
|
x.manipulatorno = task.manipulatorno;
|
|
|
|
|
x.agvno = task.agvno;
|
|
|
|
|
x.taskstate = task.taskstate;
|
|
|
|
|
TaskItems = new ObservableCollection<AirportTask>(TaskItems);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
_airPorthttpClient = App.ServiceProvider.GetService<AirPorthttpClient>();
|
|
|
|
|
|
|
|
|
|
_data1TableService = App.ServiceProvider.GetService<Idata1_TableService>();
|
|
|
|
|
_data2TableService = App.ServiceProvider.GetService<Idata2_TableService>();
|
|
|
|
|
_tr_stationPara_110_1Service = App.ServiceProvider.GetService<IT_RP_StationPara_110_1Service>();
|
|
|
|
|
_tr_stationPara_110_2Service = App.ServiceProvider.GetService<IT_RP_StationPara_110_2Service>();
|
|
|
|
|
_logger = App.ServiceProvider.GetService<ILogger<IndexContentViewModel>>();
|
|
|
|
|
|
|
|
|
|
//_taskInfoBusiness = BaseTaskInfoBusiness.GetInstance(_taskBusinessLogger, _taskservice, _agvstateService, _tcpServer, _airPorthttpClient);
|
|
|
|
|
//_taskInfoBusiness._RefreshLogMessageAction += RefreshLogMessage;
|
|
|
|
|
//_taskInfoBusiness._Taskaction += task =>
|
|
|
|
|
//{
|
|
|
|
|
// if (task != null)
|
|
|
|
|
// {
|
|
|
|
|
// var x = TaskItems.ToList().Find(x => x.conveyorno == task.conveyorno);
|
|
|
|
|
// if (x != null)
|
|
|
|
|
// {
|
|
|
|
|
// x.id = task.id;
|
|
|
|
|
// x.taskno = task.taskno;
|
|
|
|
|
// x.flightno = task.flightno;
|
|
|
|
|
// x.manipulatorno = task.manipulatorno;
|
|
|
|
|
// x.agvno = task.agvno;
|
|
|
|
|
// x.taskstate = task.taskstate;
|
|
|
|
|
// TaskItems = new ObservableCollection<AirportTask>(TaskItems);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//};
|
|
|
|
|
this.Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LoadTaskInfo()
|
|
|
|
|
private async void LoadTaskInfo()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<AirportTask> AirportTaskItem = _taskservice.GetTaskInfos();
|
|
|
|
|
TaskItems = new ObservableCollection<AirportTask>(AirportTaskItem);
|
|
|
|
|
List<data1_Table> _data1Tables = _data1TableService.Getdata1TableListAsync().Result;
|
|
|
|
|
if (_data1Tables != null && _data1Tables.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
List<T_RP_StationPara_110_1> newList = new List<T_RP_StationPara_110_1>();
|
|
|
|
|
|
|
|
|
|
foreach (var data1Table in _data1Tables)
|
|
|
|
|
{
|
|
|
|
|
newList.Add(new T_RP_StationPara_110_1()
|
|
|
|
|
{
|
|
|
|
|
semibarcode = data1Table.dpqrcode,
|
|
|
|
|
scanbarcode = data1Table.jpqrcode,
|
|
|
|
|
state = data1Table.etotaljudge == "OK" ? "1" : "2",
|
|
|
|
|
para1 = data1Table.evalue,
|
|
|
|
|
para2 = data1Table.erangevalue,
|
|
|
|
|
para3 = data1Table.erank,
|
|
|
|
|
para4 = data1Table.bprank,
|
|
|
|
|
para5 = data1Table.e1value,
|
|
|
|
|
para6 = data1Table.e2value,
|
|
|
|
|
para7 = data1Table.e3value,
|
|
|
|
|
para8 = data1Table.e4value,
|
|
|
|
|
inserttime = DateTime.Parse(data1Table.time)
|
|
|
|
|
});
|
|
|
|
|
data1Table.flag = "F";
|
|
|
|
|
var iflag = _data1TableService.UpdateAsync(data1Table).Result;
|
|
|
|
|
if (iflag)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(StringChange.ModeToJson(data1Table));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (newList != null && newList.Count != 0)
|
|
|
|
|
{
|
|
|
|
|
bool insertflag = await _tr_stationPara_110_1Service.AddTaskAsync(newList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
_logger.LogError($"异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private async void LoadEDataInfo()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Init()
|
|
|
|
|
{
|
|
|
|
|
#region 测试数据
|
|
|
|
|
|
|
|
|
|
LoadTaskInfo();
|
|
|
|
|
//LoadEDataInfo();
|
|
|
|
|
//LoadTaskInfo();
|
|
|
|
|
//Thread.Sleep(5000);
|
|
|
|
|
|
|
|
|
|
//_tcpServer.SendReplyGetManualException(
|
|
|
|
@ -144,16 +192,16 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
|
|
|
|
|
//RefreshLogMessage($"6#站台任务下发");
|
|
|
|
|
//RefreshLogMessage($"7#站台任务下发");
|
|
|
|
|
|
|
|
|
|
FlightItems = new ObservableCollection<FlightItem>
|
|
|
|
|
{
|
|
|
|
|
new FlightItem { flightNumber = "航班号:CZ3021", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
new FlightItem { flightNumber = "航班号:CZ3022", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
new FlightItem { flightNumber = "航班号:CZ3023", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
new FlightItem { flightNumber = "航班号:CZ3024", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
new FlightItem { flightNumber = "航班号:CZ3025", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
new FlightItem { flightNumber = "航班号:CZ3026", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
new FlightItem { flightNumber = "航班号:CZ3027", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
};
|
|
|
|
|
//FlightItems = new ObservableCollection<FlightItem>
|
|
|
|
|
//{
|
|
|
|
|
// new FlightItem { flightNumber = "航班号:CZ3021", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
// new FlightItem { flightNumber = "航班号:CZ3022", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
// new FlightItem { flightNumber = "航班号:CZ3023", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
// new FlightItem { flightNumber = "航班号:CZ3024", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
// new FlightItem { flightNumber = "航班号:CZ3025", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
// new FlightItem { flightNumber = "航班号:CZ3026", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
// new FlightItem { flightNumber = "航班号:CZ3027", scheduledTime = "计划/变更:11:28", destination = "经停/目的:深圳",flightStatus="状态:到达",baggageClaim="转盘:1" },
|
|
|
|
|
//};
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 更新时间显示
|
|
|
|
@ -374,7 +422,7 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
|
|
|
|
|
//清表
|
|
|
|
|
_taskservice.DeleteTaskAsync(task);
|
|
|
|
|
//TaskItems = new ObservableCollection<AirportTask>(TaskItems);
|
|
|
|
|
LoadTaskInfo();
|
|
|
|
|
//LoadTaskInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|