feat - 修改前端

master
SoulStar 6 days ago
parent 30b171ac56
commit 1b8f790987

@ -252,10 +252,10 @@ namespace SlnMesnac.Business.@base
try
{
//终止小车当前任务
result = EndTaskAndClearError(agvguid);//////////////////////////////////////////////////////////////////还没改完///////////////////////////////////////////////////////////////
var param = _appConfig.JobConfig.Where(x => x.JobGUID == jobGuid).First();
result = EndTaskAndClearError(agvguid);
var param = _AGVJobService.GetAGVJobByJobGuid(jobGuid);
//调用小车到抓取位置
return DownloadTask(agvguid, jobGuid, param.PointGUID, param.PointParamName);
return DownloadTask(agvguid, jobGuid, param.PointGuid, param.PointParamName);
}
catch (Exception ex)
{
@ -371,9 +371,8 @@ namespace SlnMesnac.Business.@base
}
}
/// <summary>
/// 入库所有满载AGV
/// 入库所有即将满载AGV
/// </summary>
public void ClearFullAGV()
{
@ -382,7 +381,7 @@ namespace SlnMesnac.Business.@base
var list = _AGVStateService.GetAgvState(AgvType.Deliver);
foreach (var record in list)
{
if (record.stackcount >= BaseTaskInfoBusiness.DeliverStackNumber && record.agvworkstate == "待机")
if (record.stackcount >= BaseTaskInfoBusiness.DeliverStackNumber - 2 && record.agvworkstate == "待机")
{
//入库代码
EndTaskAndClearErrorAndDownloadTask(record.agvno,
@ -394,7 +393,7 @@ namespace SlnMesnac.Business.@base
list = _AGVStateService.GetAgvState(AgvType.AMR);
foreach (var record in list)
{
if (record.stackcount >= BaseTaskInfoBusiness.AMRStackNumber && record.agvworkstate == "待机")
if (record.stackcount >= BaseTaskInfoBusiness.AMRStackNumber - 2 && record.agvworkstate == "待机")
{
//入库代码
EndTaskAndClearErrorAndDownloadTask(record.agvno,
@ -410,5 +409,17 @@ namespace SlnMesnac.Business.@base
}
}
/// <summary>
/// 下载AGV模板和点位到数据库
/// </summary>
public bool DownloadAgvJob()
{
List<AGVJob> joblist = new List<AGVJob>();
return false;
}
}
}

@ -29,7 +29,7 @@ namespace SlnMesnac.Config
/// <summary>
/// 系统配置
/// </summary>
#pragma warning disable CS8618 // Non-nullable field 'Data' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
#pragma warning disable CS8618 // Non-nullable field 'Data' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
public class AppConfig : IOptions<AppConfig>
{
/// <summary>
@ -52,41 +52,16 @@ namespace SlnMesnac.Config
/// </summary>
public List<RfidConfig> rfidConfig { get; set; }
/// <summary>
/// 视觉机械臂连接配置
/// AGVC服务器IP
/// </summary>
public List<VisionConfig> visionConfig { get; set; }
/// <summary>
/// AGV配置
/// </summary>
public List<AGVConfig> AGVConfig { get; set; }
/// <summary>
/// 地图点位配置
/// </summary>
public List<PositionConfig> PositionConfig { get; set; }
/// <summary>
/// 模板配置
/// </summary>
public List<JobConfig> JobConfig { get; set; }
public string AGVCIpConfig { get; set; }
/// <summary>
/// Redis配置
/// </summary>
public string redisConfig { get; set; }
/// <summary>
/// AMR
/// </summary>
public string AMRIP { get; set; }
/// <summary>
/// AGV地址配置
/// </summary>

@ -14,6 +14,12 @@ namespace SlnMesnac.Repository.service
/// <returns></returns>
List<AGVJob> GetAGVJobList();
/// <summary>
/// AGVGuid获取Job
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
AGVJob GetAGVJobByJobGuid(string guid);
/// <summary>
/// 根据模板类型获取对应的AGV模板列表

@ -19,6 +19,24 @@ namespace SlnMesnac.Repository.service.Impl
_logger = logger;
}
public AGVJob GetAGVJobByJobGuid(string guid)
{
try
{
var list = _rep.GetList(x => x.JobGuid == guid).FirstOrDefault();
if (list == null)
{
return new AGVJob();
}
return list;
}
catch (Exception ex)
{
_logger.LogError($"获取列表发生错误: {ex.Message}");
return new AGVJob();
}
}
public List<AGVJob> GetAGVJobList()
{
try

@ -31,7 +31,7 @@ namespace SlnMesnac.TouchSocket
private readonly AppConfig _appConfig;
private readonly ILogger<AirPorthttpClient> _logger;
private System.Net.Http.HttpClient _httpClient;
public string Url = "http://192.168.10.199:5102";
public string Url;
public AirPorthttpClient(AppConfig appConfig, ILogger<AirPorthttpClient> logger)
{
@ -58,6 +58,8 @@ namespace SlnMesnac.TouchSocket
public void init()
{
Url = _appConfig.AGVIpConfig;
_httpClient = new HttpClient();
}
@ -328,6 +330,15 @@ namespace SlnMesnac.TouchSocket
}
}
///// <summary>
///// AGV入库接口
///// </summary>
///// <returns></returns>
//public bool AGVInStore(string agvGuid)
//{
//}
///// <summary>
///// 获取当前所有任务模板信息(目前不可用)
///// </summary>

@ -1,19 +0,0 @@
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace SlnMesnac.TouchSocket
{
public class AirportTcpServer : BackgroundService
{
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
return Task.CompletedTask;
}
}
}

@ -33,14 +33,14 @@ namespace SlnMesnac.TouchSocket
{
public ApiServer()
{
AgvInStoreEvent += OnAGVArrival;
}
public delegate void AGVArrivalStart(string message, AGVSingalEntity aGVArrivalSingalEntity);
public delegate void AGVInStoreDelegate(string agvGuid);
/// <summary>
/// AGV到位信号刷新
/// </summary>
public event AGVArrivalStart AGVArrivalStartEvent;
public event AGVInStoreDelegate AgvInStoreEvent;
/// <summary>
/// AGV到位信号接口
@ -48,24 +48,25 @@ namespace SlnMesnac.TouchSocket
/// <param name="messageHeader"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.POST)]
public object AGVSignal(string messageHeader, AGVSingalEntity aGVArrivalSingalEntity)
[WebApi(HttpMethodType.GET)]
public object AGVInStoreSignal(string agvGuid)
{
AGVArrivalStartEvent?.Invoke(messageHeader, aGVArrivalSingalEntity);
AgvInStoreEvent?.Invoke(agvGuid);
return "Success";
}
public void SubscribeToAGVArrivalEvent()
{
// 订阅 AGV 到位事件
AGVArrivalStartEvent += OnAGVArrival;
// 订阅事件
AgvInStoreEvent += OnAGVArrival;
}
// 处理 AGV 到位事件的方法
public void OnAGVArrival(string message, AGVSingalEntity aGVArrivalSingalEntity)
public void OnAGVArrival(string agvGuid)
{
Console.WriteLine($"收到AGV到位信号: {message}");
Console.WriteLine($"AGV编号: {aGVArrivalSingalEntity.AGVNo}, 到达位置: {aGVArrivalSingalEntity.DestinationNo}");
// 这里可以处理更多的业务逻辑,比如记录日志、更新系统状态等
}

@ -55,8 +55,6 @@ namespace SlnMesnac.TouchSocket
public delegate void RefreshClientInfo(TcpService tcpService);
public event RefreshClientInfo? RefreshClientInfoEvent;
public Action<string, bool> RefreshStateAction;
public delegate void GetVisionData(TcpVisionEntity entity, string id);
/// <summary>
@ -108,7 +106,6 @@ namespace SlnMesnac.TouchSocket
{
_logger.LogInformation($"客户端{client.IP}:{client.Port}接入服务成功");
RefreshClientInfoEvent?.Invoke(_service);
RefreshStateAction?.Invoke(client.IP, true);
client.ResetId(client.IP);
TestClientID = client.IP;
VID = client.IP;
@ -117,7 +114,6 @@ namespace SlnMesnac.TouchSocket
_service.Disconnected = (client, e) =>
{
_logger.LogInformation($"客户端{client.IP}:{client.Port}断开连接");
RefreshStateAction?.Invoke(client.IP, false);
RefreshClientInfoEvent?.Invoke(_service);
return EasyTask.CompletedTask;
};

@ -6,9 +6,9 @@
xmlns:local="clr-namespace:SlnMesnac.WPF"
mc:Ignorable="d"
Title="MainWindow" Height="1080" Width="1920"
WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" Topmost="False">
WindowState="Normal" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" Topmost="False">
<Window.Background>
<ImageBrush ImageSource="/Templates/image/background.jpg" />
<ImageBrush ImageSource="/background.png" />
</Window.Background>
<Border Margin="5" Background="Transparent" CornerRadius="10">
@ -24,42 +24,22 @@
<RowDefinition Height="0.7*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="行李空框调度系统" FontSize="50" Foreground="White" FontWeight="Bold"/>
</StackPanel>
<StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!-- <TextBlock Grid.Column="0" Text="白班" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/> -->
<!-- <TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/> -->
<!-- <TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/> -->
</Grid>
</StackPanel>
</Grid>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="行李空框调度系统" FontSize="50" Foreground="White" FontWeight="Bold"/>
</StackPanel>
</Border>
<Border Grid.Row="2" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,5,2,2">
<ContentControl Content="{Binding UserContent}"/>
</Border>
<!-- 按钮状态栏 -->
<Border Grid.Row="3" BorderBrush="#1254AB" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="6,0,6,7">
<Border.Effect>
<DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
</Border.Effect>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1227*"/>
<ColumnDefinition Width="671*"/>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" Height="30" 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"/>
@ -68,115 +48,15 @@
<Button Content="控 制" x:Name="Control" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Control}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="Green" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<!--<Button Content="发送开始抓取" x:Name="TestButton1" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton1}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_1"/>
<Button Content="D无定抓取" x:Name="TestButton11" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton11}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_1"/>
<Button Content="A无定抓取" x:Name="TestButton12" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton12}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_1"/>
<Button Content="发送结束抓取" x:Name="TestButton2" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton2}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_2"/>
<Button Content="调用800小车" x:Name="TestButton3" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton3}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_3"/>
<Button Content="入库800小车" x:Name="TestButton4" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton4}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_4"/>
<Button Content="调用1000小车" x:Name="TestButton8" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton8}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_3"/>
<Button Content="入库1000小车" x:Name="TestButton9" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton9}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_4"/>
<Button Content="复位1000小车" x:Name="TestButton10" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton10}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_4"/>
<Button Content="手动停止任务" x:Name="TestButton5" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton5}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_5"/>
<Button Content="手动清除报警" x:Name="TestButton6" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton6}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_6"/>
<Button Content="流程开始" x:Name="TestButton7" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TestButton7}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0" Click="Button_Click_7"/>-->
</StackPanel>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal" Height="50" Margin="376,0,0,0" Width="253">
<!--多行状态显示-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,0" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1">
<TextBlock Text="连接状态" FontSize="15" Foreground="Black" Margin="2,0,10,0"/>
</StackPanel>
<StackPanel Grid.Column="0">
<Ellipse Width="20" Height="20">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Style.Triggers>
<DataTrigger Binding="{Binding PresentColor}" Value="0">
<Setter Property="Shape.Fill" Value="Orange"/>
</DataTrigger>
<DataTrigger Binding="{Binding PresentColor}" Value="1">
<Setter Property="Shape.Fill" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding PresentColor}" Value="2">
<Setter Property="Shape.Fill" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</StackPanel>
<StackPanel Grid.Row="1" Margin="0,10,0,0" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1">
<TextBlock Text="连接状态" FontSize="15" Foreground="Black" Margin="2,0,10,0"/>
</StackPanel>
<StackPanel Grid.Column="0">
<Ellipse Width="20" Height="20">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Style.Triggers>
<DataTrigger Binding="{Binding PresentColor}" Value="0">
<Setter Property="Shape.Fill" Value="Orange"/>
</DataTrigger>
<DataTrigger Binding="{Binding PresentColor}" Value="1">
<Setter Property="Shape.Fill" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding PresentColor}" Value="2">
<Setter Property="Shape.Fill" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
<!--单行状态显示-->
<!-- 状态显示 -->
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Height="50" Margin="10,10,10,10" Width="253" FlowDirection="RightToLeft">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<!--<ColumnDefinition Width="*"/>-->
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<StackPanel Grid.Column="0" VerticalAlignment="Center" FlowDirection="LeftToRight">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -187,13 +67,13 @@
<Ellipse.Style>
<Style TargetType="Ellipse">
<Style.Triggers>
<DataTrigger Binding="{Binding ShellScannerStatus}" Value="0">
<DataTrigger Binding="{Binding VisionStatus}" Value="0">
<Setter Property="Shape.Fill" Value="Orange"/>
</DataTrigger>
<DataTrigger Binding="{Binding ShellScannerStatus}" Value="1">
<DataTrigger Binding="{Binding VisionStatus}" Value="1">
<Setter Property="Shape.Fill" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding ShellScannerStatus}" Value="2">
<DataTrigger Binding="{Binding VisionStatus}" Value="2">
<Setter Property="Shape.Fill" Value="Red"/>
</DataTrigger>
</Style.Triggers>
@ -202,12 +82,11 @@
</Ellipse>
</StackPanel>
<StackPanel Grid.Column="1" VerticalAlignment="Center">
<TextBlock Text="机械臂" FontSize="15" Foreground="#FFFFFF" Margin="2,0,10,0"/>
<TextBlock Text="视觉" FontSize="15" Foreground="#FFFFFF" Margin="2,0,10,0"/>
</StackPanel>
</Grid>
</StackPanel>
<StackPanel Grid.Column="1">
<StackPanel Grid.Column="1" VerticalAlignment="Center" FlowDirection="LeftToRight">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -218,13 +97,13 @@
<Ellipse.Style>
<Style TargetType="Ellipse">
<Style.Triggers>
<DataTrigger Binding="{Binding BoldScannerStatus}" Value="0">
<DataTrigger Binding="{Binding AGVStatus}" Value="0">
<Setter Property="Shape.Fill" Value="Orange"/>
</DataTrigger>
<DataTrigger Binding="{Binding BoldScannerStatus}" Value="1">
<DataTrigger Binding="{Binding AGVStatus}" Value="1">
<Setter Property="Shape.Fill" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding BoldScannerStatus}" Value="2">
<DataTrigger Binding="{Binding AGVStatus}" Value="2">
<Setter Property="Shape.Fill" Value="Red"/>
</DataTrigger>
</Style.Triggers>
@ -233,49 +112,14 @@
</Ellipse>
</StackPanel>
<StackPanel Grid.Column="1" VerticalAlignment="Center">
<TextBlock Text="AGV" FontSize="15" Foreground="#FFFFFF" Margin="2,0,10,0"/>
<TextBlock Text="AGV服务器" FontSize="15" Foreground="#FFFFFF" Margin="2,0,10,0"/>
</StackPanel>
</Grid>
</StackPanel>
<!--<StackPanel Grid.Column="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<Ellipse Width="30" Height="30">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Style.Triggers>
<DataTrigger Binding="{Binding PlcStatus}" Value="0">
<Setter Property="Shape.Fill" Value="Orange"/>
</DataTrigger>
<DataTrigger Binding="{Binding PlcStatus}" Value="1">
<Setter Property="Shape.Fill" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding PlcStatus}" Value="2">
<Setter Property="Shape.Fill" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</StackPanel>
<StackPanel Grid.Column="1" VerticalAlignment="Center">
<TextBlock Text="PLC状态" FontSize="15" Foreground="#FFFFFF" Margin="2,0,10,0"/>
</StackPanel>
</Grid>
</StackPanel>-->
</Grid>
</StackPanel>
</Grid>
</Border>
</Grid>
</Border>
</Window>

@ -40,10 +40,7 @@
<TextBlock Text="已装载筐数量:" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
<TextBlock Text="{Binding loadcount}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
</StackPanel>
<!-- <StackPanel Orientation="Horizontal"> -->
<!-- <TextBlock Text="ID" FontSize="18" Foreground="White" Margin="0,10,0,0" Visibility="Visible"/> -->
<!-- <TextBlock Text="{Binding id}" FontSize="18" Foreground="White" Margin="0,10,0,0"/> -->
<!-- </StackPanel> -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,10">
<Button Content="待处理任务" FontSize="14" Style="{StaticResource BUTTON_AGREE}"
Width="80" Height="30" Background="YellowGreen" BorderBrush="YellowGreen" Margin="40,0,0,0"
@ -60,20 +57,9 @@
</DataTemplate>
<DataTemplate x:Key="LogMsgTemplate">
<TextBlock Text="{Binding}" FontSize="16" Foreground="White" TextWrapping="Wrap" MaxWidth="300"/>
<TextBlock Text="{Binding LogMessages}" FontSize="16" Foreground="White" TextWrapping="Wrap" MaxWidth="300"/>
</DataTemplate>
<DataTemplate x:Key="FlightTemplate">
<Border BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" Margin="2,5">
<StackPanel Margin="10,0,0,0">
<TextBlock Text="{Binding flightNumber}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
<TextBlock Text="{Binding scheduledTime}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
<TextBlock Text="{Binding destination}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
<TextBlock Text="{Binding flightStatus}" FontSize="18" Foreground="White" Margin="0,10,0,0"/>
<TextBlock Text="{Binding baggageClaim}" FontSize="18" Foreground="White" Margin="0,10,0,10"/>
</StackPanel>
</Border>
</DataTemplate>
</UserControl.Resources>
<Grid>
@ -86,120 +72,60 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="13*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#1254AB" BorderThickness="2">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<TextBlock Text="任务列表" FontSize="24" Foreground="White" Margin="20,0,0,0"/>
<Button Content="添加" Command="{Binding AddTaskCommand}" FontSize="14" Style="{StaticResource BUTTON_AGREE}" Width="80" Height="30" Background="YellowGreen" BorderBrush="YellowGreen" Margin="20,0,0,0"/>
</StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="AGV状态列表" FontSize="24" Foreground="White" Margin="20,0,0,0"/>
</Border>
<Border Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0">
<Button Content="一键入库" Command="{Binding AddTaskCommand}" FontSize="14"
Style="{StaticResource BUTTON_AGREE}" Width="80" Height="30"
Background="YellowGreen" BorderBrush="YellowGreen" Margin="20,0,0,0"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="1">
<Border Grid.Row="1" BorderBrush="#1254AB" BorderThickness="2" Margin="0,10,0,0">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding TaskItems}" ItemTemplate="{StaticResource TaskTemplate}" />
</ScrollViewer>
</Border>
<Border Grid.Row="2" BorderBrush="#1254AB" BorderThickness="2" Margin="0,10,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="日志信息" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding LogMessages}" ItemTemplate="{StaticResource LogMsgTemplate}" />
</ScrollViewer>
</Grid>
</Border>
</Grid>
</Border>
<Border Grid.Column="1" BorderBrush="#1254AB" BorderThickness="0" CornerRadius="5" Margin="10,0,10,0">
<Border.Background>
<Border Grid.Column="1" BorderBrush="#1245AB" BorderThickness="0" CornerRadius="5" Margin="10,0,10,0">
<!--<Border.Background>
<ImageBrush ImageSource="/Templates/image/between.png" Stretch="Uniform" />
</Border.Background>
</Border.Background>-->
<Grid Margin="15,0">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.7*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.7*"/>
<RowDefinition Height="6.4*"/>
</Grid.RowDefinitions>
<Border Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.9*"/>
<ColumnDefinition Width="0.4*"/>
<ColumnDefinition Width="1.7*"/>
<ColumnDefinition Width="0.4*"/>
<ColumnDefinition Width="1.6*"/>
<ColumnDefinition Width="0.4*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" >
<Button Content="手动呼叫" Command="{Binding ManualCallCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="YellowGreen" BorderBrush="YellowGreen"/>
</Border>
<Border Grid.Column="2">
<Button Content="手动终止" Command="{Binding ManualTerminateCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="Red" BorderBrush="Red"/>
</Border>
<Border Grid.Column="4">
<Button Content="复 位" Command="{Binding ResetCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="#FF9900" BorderBrush="#FF9900"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="2">
<Border Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="0.2*"/>
<ColumnDefinition Width="2.22*"/>
<ColumnDefinition Width="1.11*"/>
<ColumnDefinition Width="2.22*"/>
<ColumnDefinition Width="1.11*"/>
<ColumnDefinition Width="2.22*"/>
<ColumnDefinition Width="1.11*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="1#站台" FontSize="18" Foreground="White"/>
</Border>
<Border Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="4#站台" FontSize="18" Foreground="White"/>
<Border Grid.Column="1" >
<Button Content="" Command="{Binding ManualCallCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="YellowGreen" BorderBrush="YellowGreen"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="2#站台" FontSize="18" Foreground="White"/>
<Border Grid.Column="3">
<Button Content="手动入库" Command="{Binding ManualTerminateCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="Red" BorderBrush="Red"/>
</Border>
<Border Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="5#站台" FontSize="18" Foreground="White"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="6">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="3#站台" FontSize="18" Foreground="White"/>
</Border>
<Border Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="6#站台" FontSize="18" Foreground="White"/>
<Border Grid.Column="5">
<Button Content="终止所有任务" Command="{Binding ResetCommand}" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="40" Background="#FF9900" BorderBrush="#FF9900"/>
</Border>
</Grid>
</Border>
@ -213,15 +139,16 @@
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#1254AB" BorderThickness="2">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Vertical">
<TextBlock Text="航班信息" FontSize="24" Foreground="White" Margin="20,0,0,0"/>
<TextBlock Text="日志信息" FontSize="24" Foreground="White" Margin="20,0,0,0"/>
<TextBlock Text="{Binding CurrentDateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" FontSize="18" Foreground="White" Margin="20,0,0,0"/>
</StackPanel>
</Border>
<Border Grid.Row="1">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding FlightItems}" ItemTemplate="{StaticResource FlightTemplate}" />
</ScrollViewer>
<Border Grid.Row="1" BorderBrush="#1254AB" BorderThickness="2" Margin="0,10,0,0">
<Grid>
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding LogMessages}" ItemTemplate="{StaticResource LogMsgTemplate}" />
</ScrollViewer>
</Grid>
</Border>
</Grid>

@ -9,6 +9,7 @@
<ItemGroup>
<None Remove="appsettings.json" />
<None Remove="background.png" />
<None Remove="Templates\image\background.jpg" />
<None Remove="Templates\image\between.png" />
</ItemGroup>
@ -20,6 +21,7 @@
</ItemGroup>
<ItemGroup>
<Resource Include="background.png" />
<Resource Include="Templates\image\between.png" />
</ItemGroup>
@ -53,4 +55,10 @@
<Resource Include="Templates\image\background.jpg" />
</ItemGroup>
<ItemGroup>
<None Update="Templates\image\background.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

@ -45,8 +45,8 @@ namespace SlnMesnac.WPF
//注册PLC工厂
services.AddPlcFactorySetup();
//注册httpClient
//services.AddHostedService<AirPorthttpClient>();
//注册ApiServer
//services.AddHostedService<ApiServer>();
//注册TCPServer
//services.AddHostedService<TcpServer>();

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

@ -195,18 +195,11 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
}
/// <summary>
/// 机械臂复位,停止所有任务,复位所有小车
/// 未知刷新类
/// </summary>
public void StopAllTask()
{
//机械臂复位
//所有任务设置为已终止
//所有小车任务结束
}
/// <param name="airportTask"></param>
public async void RefreshTaskItems(AirportTask airportTask)
{
try
@ -230,16 +223,20 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
}
}
#region 参数定义
/// <summary>
/// 任务列表
/// </summary>
private ObservableCollection<AirportTask> _taskItems = new ObservableCollection<AirportTask>();
public ObservableCollection<AirportTask> TaskItems
{
get => _taskItems;
set => SetProperty(ref _taskItems, value);
}
/// <summary>
/// 日志信息
/// </summary>
@ -250,10 +247,12 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
get => _logMessages;
set => SetProperty(ref _logMessages, value);
}
/// <summary>
/// 日期时间
/// </summary>
private DateTime _currentDateTime;
public DateTime CurrentDateTime
{
get => _currentDateTime;
@ -265,15 +264,18 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
}
}
}
/// <summary>
/// 航班信息
/// </summary>
private ObservableCollection<FlightItem> _flightItems = new ObservableCollection<FlightItem>();
public ObservableCollection<FlightItem> FlightItems
{
get => _flightItems;
set => SetProperty(ref _flightItems, value);
}
#endregion
/// <summary>
@ -301,6 +303,7 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
}
}
/// <summary>
/// 系统运行日志输出
/// </summary>
@ -332,6 +335,7 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
}
});
}
/// <summary>
/// 添加任务
/// </summary>
@ -415,22 +419,13 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
}
}
/// <summary>
/// 手动呼叫
/// </summary>
[RelayCommand]
private void ManualCall()
{
MessageBox.Show("手动呼叫");
}
/// <summary>
/// 手动终止
/// </summary>
[RelayCommand]
private void ManualTerminate()
{
MessageBox.Show("手动终止");
MessageBox.Show("入库");
}
/// <summary>
@ -439,7 +434,8 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
[RelayCommand]
private void Reset()
{
MessageBox.Show("复位");
MessageBox.Show("终止成功");
}
}

@ -37,6 +37,7 @@ namespace SlnMesnac.WPF.ViewModel
private IAGVJobService _agvJobService;
private IVisionSettingService _visionSettingService;
private TcpServer _tcpServer;
private ApiServer _apiServer;
//代码生成
private readonly GenerateControl generateControl = new GenerateControl();
private IndexContent indexContent = new IndexContent();
@ -130,17 +131,13 @@ namespace SlnMesnac.WPF.ViewModel
_baseAGVBusiness = BaseAGVBusiness.GetInstance(_baseAGVBusinessLogger, _airPorthttpClient, _AGVStateService, _AGVMapPointService, _appConfig, _agvJobService, _AGVSettingService);
_visionBusiness = VisionBusiness.GetInstance(_VisionBusinessLogger, _tcpServer, _Taskservice, _visionSettingService, _AGVStateService, _agvJobService);
_baseStateRefreshBusiness = BaseStateRefreshBusiness.GetInstance(_StateRefreshBusinessLogger, _AGVStateService, _airPorthttpClient, _AGVSettingService);
_apiServer = new ApiServer();
ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj));
FormControlCommand = new RelayCommand<object>(x => FormControl(x));
StopAllTaskActionInvoke();
_tcpServer.RefreshStateAction += (_clientIP, _state) =>
{
if (_clientIP == _appConfig.AMRIP)
{
ShellScannerStatus = _state ? 1 : 2;
}
};
//
UserContent = indexContent;
}
@ -193,8 +190,8 @@ namespace SlnMesnac.WPF.ViewModel
_baseTaskInfoBusiness.TaskStateUpdateTimerOperation(TimerControl.Stop);
break;
case "TestButton":
bool a = _AGVStateService.ResetAGVStackCount(_appConfig.AGVConfig.Where(x => x.AGVName == "S800-B").First().AGVGUID.ToString());
_logger.LogInformation($"测试按钮运行{a.ToString()}");
_logger.LogInformation($"测试按钮运行");
break;
default:
break;

@ -26,6 +26,11 @@
"connStr": "Data Source=D:\\WorkCode\\AirPortWCS\\SlnMesnac.WPF\\bin\\Debug\\net6.0-windows\\data\\Airport_db.sqlite"
}
],
"redisConfig": "175.27.215.92:6379,password=redis@2023",
"AGVIpConfig": "http://192.168.10.199:5102",
"TCPVisionConfig": "127.0.0.1:6000",
"PlcConfig": [
{
"configId": 1,
@ -59,107 +64,11 @@
"equipKey": "test2",
"isFlage": true
}
],
"visionConfig": [
{
"VisionId": 1,
"VisionIp": "127.0.0.1",
"VisionPort": 7001,
"AGVID": "1",
"VisionState": "1",
"IsFlag": true
},
{
"VisionId": 2,
"VisionIp": "127.0.0.1",
"VisionPort": 7002,
"AGVID": "2",
"VisionState": "1",
"IsFlag": true
}
],
"AGVConfig": [
{
"AGVGUID": "f3358c0cee904204a9d53323171f3d1d",
"AGVName": "S800-A",
"AGVIp": "192.168.10.102"
},
{
"AGVGUID": "53773a420771497b8b699e949e9eaacb",
"AGVName": "S800-B",
"AGVIp": "192.168.10.104"
},
{
"AGVGUID": "88db096830b74d1e92a5a3ec20e1da19",
"AGVName": "S1000-A",
"AGVIp": "192.168.10.103"
},
{
"AGVGUID": "85a8e57c9fdc45a89686f62f03f54489",
"AGVName": "S1000-B",
"AGVIp": "192.168.10.101"
}
],
"PositionConfig": [
{
"PointGUID": "8491f5771c824bab80a497cc9af63772",
"PointName": "800装货点",
"PointParamName": "p1"
},
{
"PointGUID": "eea2fc77b5214aadb997d30ac0f586c4",
"PointName": "1000装货点",
"PointParamName": "p1"
},
{
"PointGUID": "f53a8eca76834c1d8cb2d02ed9738837",
"PointName": "卸货点",
"PointParamName": "p1"
}
],
"JobConfig": [
{
"JobGUID": "e5aed3a665ae4900bc6c65e8e04a97fa",
"JobName": "800小车进入位置任务pause",
"PointGUID": "8491f5771c824bab80a497cc9af63772",
"PointName": "800装货点",
"PointParamName": "p1"
},
{
"JobGUID": "ccf742e56beb4ed18f2de640fdcc0827",
"JobName": "800小车入库任务pause",
"PointGUID": "8491f5771c824bab80a497cc9af63772",
"PointName": "800装货点",
"PointParamName": "p1"
},
{
"JobGUID": "5be844b06bbb4bfbb71e3813a9770a9d",
"JobName": "1000小车入库任务pause",
"PointGUID": "eea2fc77b5214aadb997d30ac0f586c4",
"PointName": "1000装货点",
"PointParamName": "p1"
},
{
"JobGUID": "4ee967b8a086465e9b9453eedf17e0b1",
"JobName": "1000小车进入位置任务pause",
"PointGUID": "eea2fc77b5214aadb997d30ac0f586c4",
"PointName": "1000装货点",
"PointParamName": "p1"
},
{
"JobGUID": "5e43baba09c44504b2b02be1ee4b5710",
"JobName": "1000校正模板",
"PointGUID": "eea2fc77b5214aadb997d30ac0f586c4",
"PointName": "1000装货点",
"PointParamName": "p1"
}
],
]
"AMRIP": "127.0.0.1",
"redisConfig": "175.27.215.92:6379,password=redis@2023",
"AGVIpConfig": "http://192.168.10.199:5102",
"TCPVisionConfig": "127.0.0.1:6000"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Loading…
Cancel
Save