|
|
@ -116,13 +116,25 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
/// <param name="palletTasks"></param>
|
|
|
|
/// <param name="palletTasks"></param>
|
|
|
|
private async Task RefreshWcsAgvStatusDataGrid()
|
|
|
|
private async Task RefreshWcsAgvStatusDataGrid()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<WcsAgvStatus> agvList = await sqlSugarClient.AsTenant().GetConnection("mes").Queryable<WcsAgvStatus>().ToListAsync();
|
|
|
|
var query = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<WcsAgvStatus>()
|
|
|
|
|
|
|
|
.LeftJoin<DmsAgvCodeMap>((was, dacm) => long.Parse(was.Status) == dacm.AgvCode)
|
|
|
|
|
|
|
|
.Select((was, dacm) => new WcsAgvStatus
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AgvName = was.AgvName,
|
|
|
|
|
|
|
|
Online = was.Online == "true" ? "在线" : "离线",
|
|
|
|
|
|
|
|
StatusDefine = dacm.AgvStatus,
|
|
|
|
|
|
|
|
Battery = was.Battery,
|
|
|
|
|
|
|
|
Speed = was.Speed,
|
|
|
|
|
|
|
|
PosX = was.PosX,
|
|
|
|
|
|
|
|
PosY = was.PosY,
|
|
|
|
|
|
|
|
Timestamp = was.Timestamp
|
|
|
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WcsAgvStatusDataGrid.Clear();
|
|
|
|
WcsAgvStatusDataGrid.Clear();
|
|
|
|
foreach (var agv in agvList)
|
|
|
|
foreach (var agv in query)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
agv.Online = agv.Online=="true"? "在线": "离线";
|
|
|
|
|
|
|
|
WcsAgvStatusDataGrid.Add(agv);
|
|
|
|
WcsAgvStatusDataGrid.Add(agv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|