change-电表采集数据解析优化

dev
liuwf 2 months ago
parent f29a584283
commit b3a63f8514

@ -0,0 +1,113 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.domain
{
[SugarTable("wcs_agv_status"), TenantAttribute("mes")]
public class WcsAgvStatus
{
/// <summary>
/// 电量
/// </summary>
[SugarColumn(ColumnName = "battery")]
public string Battery { get; set; }
/// <summary>
/// 是否已被排除,被排除后不接受新任务( 1-排除, 0-正常)
/// </summary>
[SugarColumn(ColumnName = "exclType")]
public string ExclType { get; set; }
/// <summary>
/// 地图编号
/// </summary>
[SugarColumn(ColumnName = "mapCode")]
public string MapCode { get; set; }
/// <summary>
/// 是否在线
/// </summary>
[SugarColumn(ColumnName = "online")]
public string Online { get; set; }
/// <summary>
/// 路线
/// </summary>
[SugarColumn(ColumnName = "path")]
public string Path { get; set; }
/// <summary>
/// 背货架的编号
/// </summary>
[SugarColumn(ColumnName = "podCode")]
public string PodCode { get; set; }
/// <summary>
/// 背货架的方向
/// </summary>
[SugarColumn(ColumnName = "podDir")]
public string PodDir { get; set; }
/// <summary>
/// X
/// </summary>
[SugarColumn(ColumnName = "posX")]
public string PosX { get; set; }
/// <summary>
/// Y
/// </summary>
[SugarColumn(ColumnName = "posY")]
public string PosY { get; set; }
/// <summary>
/// 机器人编号
/// </summary>
[SugarColumn(ColumnName = "robotCode", IsPrimaryKey = true)]
public string RobotCode { get; set; }
/// <summary>
/// 机器人方向 (范围 -180~360度)
/// </summary>
[SugarColumn(ColumnName = "robotDir")]
public string RobotDir { get; set; }
/// <summary>
/// 机器人Ip
/// </summary>
[SugarColumn(ColumnName = "robotIp")]
public string RobotIp { get; set; }
/// <summary>
/// 机器人速度
/// </summary>
[SugarColumn(ColumnName = "speed")]
public string Speed { get; set; }
/// <summary>
/// 机器人状态
/// </summary>
[SugarColumn(ColumnName = "status")]
public string Status { get; set; }
/// <summary>
/// 是否暂停 0-否 1-是
/// </summary>
[SugarColumn(ColumnName = "stop")]
public string Stop { get; set; }
/// <summary>
/// 时间
/// </summary>
[SugarColumn(ColumnName = "timestamp")]
public DateTime? Timestamp { get; set; }
/// <summary>
/// 小车名称
/// </summary>
[SugarColumn(ColumnName = "agvName")]
public string AgvName { get; set; }
}
}

@ -0,0 +1,221 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
namespace SlnMesnac.Model.domain
{
[SugarTable("wcs_task"), TenantAttribute("mes")]
public class WcsTask
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnName = "objid")]
public long ObjId { get; set; }
/// <summary>
/// wcs_warehouse_order 主键id
/// </summary>
[SugarColumn(ColumnName = "master_id")]
public long? MasterId { get; set; }
/// <summary>
/// wms出入库记录表id
/// </summary>
[SugarColumn(ColumnName = "order_id")]
public long? OrderId { get; set; }
/// <summary>
/// 流水号
/// </summary>
[SugarColumn(ColumnName = "serial_no")]
public long? SerialNo { get; set; }
/// <summary>
/// 设备编号
/// </summary>
[SugarColumn(ColumnName = "equipment_no")]
public string EquipmentNo { get; set; }
/// <summary>
/// 容器号(托盘或者箱号)
/// </summary>
[SugarColumn(ColumnName = "container_no")]
public string ContainerNo { get; set; }
/// <summary>
/// 任务类型,字典表
/// </summary>
[SugarColumn(ColumnName = "task_type")]
public int? TaskType { get; set; }
/// <summary>
/// 任务状态,字典表
/// </summary>
[SugarColumn(ColumnName = "task_status")]
public int? TaskStatus { get; set; }
/// <summary>
/// 物料ID
/// </summary>
[SugarColumn(ColumnName = "material_id")]
public long? MaterialId { get; set; }
/// <summary>
/// 物料号
/// </summary>
[SugarColumn(ColumnName = "material_no")]
public string MaterialNo { get; set; }
/// <summary>
/// 数量
/// </summary>
[SugarColumn(ColumnName = "qty")]
public int? Qty { get; set; }
/// <summary>
/// 起始点编号
/// </summary>
[SugarColumn(ColumnName = "start_point_no")]
public string StartPointNo { get; set; }
/// <summary>
/// 起始点id
/// </summary>
[SugarColumn(ColumnName = "start_point_id")]
public long? StartPointId { get; set; }
/// <summary>
/// 当前点编号
/// </summary>
[SugarColumn(ColumnName = "curr_point_no")]
public string CurrPointNo { get; set; }
/// <summary>
/// 当前点id
/// </summary>
[SugarColumn(ColumnName = "curr_point_id")]
public long? CurrPointId { get; set; }
/// <summary>
/// 下一点位id
/// </summary>
[SugarColumn(ColumnName = "next_point_id")]
public long? NextPointId { get; set; }
/// <summary>
/// 下一点位编号
/// </summary>
[SugarColumn(ColumnName = "next_point_no")]
public string NextPointNo { get; set; }
/// <summary>
/// 结束点编号
/// </summary>
[SugarColumn(ColumnName = "end_point_no")]
public string EndPointNo { get; set; }
/// <summary>
/// 结束点id
/// </summary>
[SugarColumn(ColumnName = "end_point_id")]
public long? EndPointId { get; set; }
/// <summary>
/// 所属楼层
/// </summary>
[SugarColumn(ColumnName = "floor_no")]
public int? FloorNo { get; set; }
/// <summary>
/// 是否可用 0:不可用 1:可用
/// </summary>
[SugarColumn(ColumnName = "use_flag")]
public int UseFlag { get; set; } = 1;
/// <summary>
/// 创建者
/// </summary>
[SugarColumn(ColumnName = "create_by")]
public string CreateBy { get; set; } = "SYS";
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "create_time")]
public DateTime CreateTime { get; set; } = DateTime.Now;
/// <summary>
/// 更新者
/// </summary>
[SugarColumn(ColumnName = "update_by")]
public string UpdateBy { get; set; } = "SYS";
/// <summary>
/// 更新时间
/// </summary>
[SugarColumn(ColumnName = "update_time")]
public DateTime UpdateTime { get; set; } = DateTime.Now;
/// <summary>
/// 备用字段1
/// </summary>
[SugarColumn(ColumnName = "ud1")]
public int? Ud1 { get; set; }
/// <summary>
/// 备用字段2
/// </summary>
[SugarColumn(ColumnName = "ud2")]
public string Ud2 { get; set; }
/// <summary>
/// 备用字段3
/// </summary>
[SugarColumn(ColumnName = "ud3")]
public string Ud3 { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnName = "remark")]
public string Remark { get; set; }
/// <summary>
/// 来源楼层
/// </summary>
[SugarColumn(ColumnName = "from_floor_no")]
public int? FromFloorNo { get; set; }
/// <summary>
/// 是否为空
/// </summary>
[SugarColumn(ColumnName = "is_empty")]
public string IsEmpty { get; set; }
/// <summary>
/// 执行情况
/// </summary>
[SugarColumn(ColumnName = "ctu_execute")]
public string CtuExecute { get; set; }
/// <summary>
/// Agv返回code
/// </summary>
[SugarColumn(ColumnName = "taskCode")]
public string TaskCode { get; set; }
/// <summary>
/// 是否删除
/// </summary>
[SugarColumn(ColumnName = "is_delete")]
public int IsDelete { get; set; } = 0;
/// <summary>
/// 是否停止
/// </summary>
[SugarColumn(ColumnName = "is_stop")]
public int? IsStop { get; set; }
}
}

@ -63,11 +63,14 @@
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal"> <StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<Button Content="首 页" x:Name="Index" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Index}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="10,0,10,0"/> <Button Content="首 页" x:Name="Index" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Index}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="10,0,10,0"/>
<Button Content="设备监控" x:Name="DevMonitor" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=DevMonitor}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/> <Button Content="设备监控" x:Name="DevMonitor" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=DevMonitor}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/>
<Button Content="生产管理" x:Name="ProdMgmt" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ProdMgmt}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/> <Button Content="生产管理" Visibility="Collapsed" x:Name="ProdMgmt" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ProdMgmt}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/>
<Button Content="手动叫料" x:Name="ManualDelivery" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ManualDelivery}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/> <Button Content="手动叫料" x:Name="ManualDelivery" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ManualDelivery}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/>
<Button Content="AGV监听" x:Name="ManualDelivery1" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ManualDelivery}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/>
<Button Content="生产统计" x:Name="ProdStatistics" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ProdStatistics}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/> <Button Content="生产统计" x:Name="ProdStatistics" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ProdStatistics}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#0099FF" BorderBrush="#0099FF" Margin="0,0,10,0"/>
<Button Content="代码生成" x:Name="Generate" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Generate}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/> <Button Content="代码生成" Visibility="Collapsed" x:Name="Generate" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Generate}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="参数配置" x:Name="ConfigInfo" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ConfigInfo}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/> <Button Content="参数配置" x:Name="ConfigInfo" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=ConfigInfo}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="配方管理" x:Name="RecipeManage" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=RecipeManage}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/> <Button Content="配方管理" x:Name="RecipeManage" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=RecipeManage}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>

@ -0,0 +1,99 @@
<UserControl x:Class="SlnMesnac.WPF.Page.AgvAndTaskMonitorPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SlnMesnac.WPF.Page"
mc:Ignorable="d"
d:DesignHeight="750" d:DesignWidth="1920" Background="Transparent">
<Grid Margin="5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="CadetBlue" BorderThickness="0,0,0,0" CornerRadius="0" Background="Transparent" Margin="1,6,5,5" >
<TextBlock Text="AGV实时状态" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--计划列表-->
<Border Grid.Row="1" Grid.Column="0" BorderBrush="Green" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<DataGrid Grid.Row="0" ItemsSource="{Binding PalletTaskDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding AgvName}" Header="AGV名称" Width="3*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Online}" Header="在线状态" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Battery}" Header="电量" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Speed}" Header="速度" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding PosX}" Header="X轴坐标" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding PosY}" Header="Y轴坐标" Width="*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Timestamp}" Header="更新时间" Width="3*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
</Border>
<Border Grid.Row="1" BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="CadetBlue" BorderThickness="0,0,0,0" CornerRadius="0" Background="Transparent" Margin="1,6,5,5" >
<TextBlock Text="AGV任务列表" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--计划列表-->
<Border Grid.Row="1" Grid.Column="0" BorderBrush="Green" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<DataGrid Grid.Row="0" ItemsSource="{Binding BarCodeTaskDataGrid}" Background="Transparent"
FontSize="15" ColumnHeaderHeight="35"
RowHeight="31" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding ObjId}" Header="序号" Width="1*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding BarCode}" Header="条码" Width="3*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="3*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="3*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding RecordTime ,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="记录时间" Width="2*" IsReadOnly="True"/>
<!--<DataGridTextColumn Binding="{Binding RealEndTime ,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="完成时间" Width="1*" IsReadOnly="True"/>-->
<DataGridTemplateColumn Header="操作" Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button Content="删除" CommandParameter="{Binding BarCode}" Background="Red" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="Red" BorderThickness="0" Width="45" Command="{Binding DataContext.DeleteBarCodeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
</Border>
</Grid>
</UserControl>

@ -0,0 +1,31 @@
using SlnMesnac.WPF.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SlnMesnac.WPF.Page
{
/// <summary>
/// ProdStatisticsPage.xaml 的交互逻辑
/// </summary>
public partial class AgvAndTaskMonitorPage : UserControl
{
public AgvAndTaskMonitorPage()
{
InitializeComponent();
this.DataContext = new ProdStatisticsViewModel();
}
}
}

@ -49,6 +49,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Page\AgvAndTaskMonitorPage.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Page\Window\InputDialogWindow.xaml.cs"> <Compile Update="Page\Window\InputDialogWindow.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>

Loading…
Cancel
Save