Browse Source

临时数据提交

样式分支
taoye 2 years ago
parent
commit
c7808a665c
21 changed files with 3888 additions and 446 deletions
  1. +1
    -1
      BPASmartClient.Business/Plugin/ConfigMgr.cs
  2. +6
    -0
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  3. BIN
     
  4. BIN
     
  5. BIN
     
  6. +15
    -6
      BPASmartClient.CustomResource/Themes/MyStyle.xaml
  7. +1126
    -0
      BPASmartClient.CustomResource/UserControls/DosingSystem.xaml
  8. +28
    -0
      BPASmartClient.CustomResource/UserControls/DosingSystem.xaml.cs
  9. +0
    -4
      BPASmartClient.Helper/ThreadManage.cs
  10. +8
    -3
      BPASmartClient/App.config
  11. +2
    -2
      BPASmartClient/Control/ShopDeviceConfigView.xaml
  12. +2
    -1
      DosingSystem/BPASmartClient.DosingSystem.csproj
  13. +1
    -6
      DosingSystem/View/HardwareStatusView.xaml
  14. +0
    -79
      DosingSystem/app.manifest
  15. +74
    -0
      FryPot_DosingSystem/AGV/WhichCart.cs
  16. +204
    -203
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  17. +29
    -0
      FryPot_DosingSystem/Control/GlobalVariable.cs
  18. +1190
    -106
      FryPot_DosingSystem/View/AgvView.xaml
  19. +138
    -32
      FryPot_DosingSystem/View/AgvView.xaml.cs
  20. +1040
    -2
      FryPot_DosingSystem/ViewModel/AgvViewModel.cs
  21. +24
    -1
      SmartClient.sln

+ 1
- 1
BPASmartClient.Business/Plugin/ConfigMgr.cs View File

@@ -84,7 +84,7 @@ namespace BPASmartClient.Business
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory());
configurationBuilder.AddApolloConfiguration(p =>
{
p.AppId = "HostComputer";
p.AppId = apoid;
p.MetaServer = apolloUri;
p.Namespaces = new List<string>() { "application", namespa };
});


+ 6
- 0
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj View File

@@ -22,6 +22,9 @@
<None Remove="Fonts\80号-萌趣小鱼体.ttf" />
<None Remove="Fonts\iconfont.ttf" />
<None Remove="Fonts\Quartz Regular.ttf" />
<None Remove="Image\AGV\agv.png" />
<None Remove="Image\AGV\AGV小车.png" />
<None Remove="Image\AGV\AGV炒锅.png" />
<None Remove="Image\AGV\停车位.png" />
<None Remove="Image\AGV\充电桩.png" />
<None Remove="Image\AGV\墙.png" />
@@ -223,6 +226,9 @@
<Resource Include="Fonts\80号-萌趣小鱼体.ttf" />
<Resource Include="Fonts\iconfont.ttf" />
<Resource Include="Fonts\Quartz Regular.ttf" />
<Resource Include="Image\AGV\agv.png" />
<Resource Include="Image\AGV\AGV小车.png" />
<Resource Include="Image\AGV\AGV炒锅.png" />
<Resource Include="Image\AGV\停车位.png" />
<Resource Include="Image\AGV\充电桩.png" />
<Resource Include="Image\AGV\墙.png" />


BIN
View File


BIN
View File


BIN
View File


+ 15
- 6
BPASmartClient.CustomResource/Themes/MyStyle.xaml View File

@@ -172,6 +172,13 @@
<ImageBrush x:Key="imageBJ" ImageSource="/BPASmartClient.CustomResource;component/Image/图层1.png" />
<ImageBrush x:Key="image1" ImageSource="/BPASmartClient.CustomResource;component/Image/shape.png" />
<ImageBrush x:Key="image2" ImageSource="/BPASmartClient.CustomResource;component/Image/shape1.png" />
<Style x:Key="image完成" TargetType="Image">
<Style.Setters>
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Source" Value="/BPASmartClient.CustomResource;component/Image/Cb_Checked.png" />
</Style.Setters>
</Style>

<Style x:Key="image墙" TargetType="Image">
<Style.Setters>
@@ -381,7 +388,7 @@
</Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/物流车.png" />
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/AGV/agv.png" />
</Setter.Value>
</Setter>
</Style.Setters>
@@ -451,8 +458,9 @@

<Style x:Key="border碗" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="50"/>
<Setter Property="Height" Value="80"/>
<Setter Property="Width" Value="40"/>
<Setter Property="Margin" Value="0,-20,0,-20"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Background">
<Setter.Value>
@@ -464,9 +472,9 @@

<Style x:Key="border菜" TargetType="Border">
<Style.Setters>
<Setter Property="Margin" Value="0,3,0,0"/>
<Setter Property="Height" Value="25"/>
<Setter Property="Width" Value="33"/>
<Setter Property="Margin" Value="0,-17,0,0"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="35"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Background">
<Setter.Value>
@@ -1823,9 +1831,10 @@

<!--#region TextBlock-->
<Style x:Key="80号字体样式" TargetType="TextBlock">
<Setter Property="FontSize" Value="16" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="FontFamily" Value="/BPASmartClient.CustomResource;Component/Fonts/#zihun80hao-mengquxiaoyuti"/>
<Setter Property="Foreground" Value="#FFC6AE82" />
<Setter Property="Foreground" Value="#FFFCD5B5" />
</Style>


+ 1126
- 0
BPASmartClient.CustomResource/UserControls/DosingSystem.xaml
File diff suppressed because it is too large
View File


+ 28
- 0
BPASmartClient.CustomResource/UserControls/DosingSystem.xaml.cs View File

@@ -0,0 +1,28 @@
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 BPASmartClient.CustomResource.UserControls
{
/// <summary>
/// DosingSystem.xaml 的交互逻辑
/// </summary>
public partial class DosingSystem : UserControl
{
public DosingSystem()
{
InitializeComponent();
}
}
}

+ 0
- 4
BPASmartClient.Helper/ThreadManage.cs View File

@@ -32,10 +32,6 @@ namespace BPASmartClient.Helper
if (CancellationTokenSources.ContainsKey(guid + key))
{
CancellationTokenSources[guid + key]?.Cancel();
if (key.Equals("滚筒线1任务线程")||key.Equals("滚筒线2任务线程")||key.Equals("滚筒线3任务线程"))
{
ActionManage.GetInstance.Send("FryPotDosingMainTaskExit");
}
ActionManage.GetInstance.Register(ExitCallback, guid + key);
}
else


+ 8
- 3
BPASmartClient/App.config View File

@@ -6,14 +6,19 @@
<!--<add key="ClientId" value="43"/>-->
<add key="IsEnableTest" value="false"/>

<!--开发环境-->
<!--测试环境-->
<add key="apollouri" value="http://10.2.1.21:28080/"/>
<add key="AppId" value="test1_HostComputer"/>
<add key ="Namespaces" value="DEV.test1.Config"/>

<!--开发环境-->
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
<add key="AppId" value="dev1_common"/>
<add key ="Namespaces" value="DEV.Config"/>
<add key ="Namespaces" value="DEV.Config"/>-->

<!--正式环境-->
<!--<add key="apollouri" value="http://47.108.65.220:28080/"/>
<add key="AppId" value="order"/>
<add key="AppId" value="HostComputer"/>
<add key ="Namespaces" value="TEST1.Config"/>-->

<!--阿里云上报启动方式:API 或者 LOCAL-->


+ 2
- 2
BPASmartClient/Control/ShopDeviceConfigView.xaml View File

@@ -389,7 +389,7 @@
Foreground="{StaticResource TextBlockForeground}"
IcoText="&#xe626;"
MouseLeftButtonDown="IcoButton_MouseLeftButtonDown"
Style="{StaticResource NewButtonStyle}" />
Style="{StaticResource IcoButtonStyle}" />

<pry:IcoButton
Grid.Column="5"
@@ -400,7 +400,7 @@
FontSize="16"
Foreground="{StaticResource TextBlockForeground}"
IcoText="&#xe626;"
Style="{StaticResource NewButtonStyle}" />
Style="{StaticResource IcoButtonStyle}" />

</Grid>



+ 2
- 1
DosingSystem/BPASmartClient.DosingSystem.csproj View File

@@ -5,9 +5,10 @@
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationManifest></ApplicationManifest>
<ApplicationIcon>hbl.ico</ApplicationIcon>
<PlatformTarget>AnyCPU</PlatformTarget>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup>


+ 1
- 6
DosingSystem/View/HardwareStatusView.xaml View File

@@ -17,11 +17,6 @@
</UserControl.DataContext>

<Grid>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="40"
Foreground="Wheat"
Text="硬件状态" />
<pry:DosingSystem/>
</Grid>
</UserControl>

+ 0
- 79
DosingSystem/app.manifest View File

@@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。

<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />

指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->

<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->

<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->

<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->

<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->

<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->

</application>
</compatibility>

<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->

<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->

</assembly>

+ 74
- 0
FryPot_DosingSystem/AGV/WhichCart.cs View File

@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FryPot_DosingSystem.AGV
{
/// <summary>
/// 控制车辆型号
/// </summary>
public enum WhichCart
{
一号车,
二号车,
三号车,
四号车,
}
/// <summary>
/// 控制车辆运动方式
/// </summary>
public enum CartMotionTrajectory
{
Stop,//停止

qc_1,//取菜品 1号流水线取菜
qc_2,//取菜品 2号流水线取菜
qc_3,//取菜品 3号流水线取菜

yc_1_1,//运输菜品 1号流水线-1号炒锅
yc_1_2,//运输菜品 1号流水线-2号炒锅
yc_1_3,//运输菜品 1号流水线-3号炒锅
yc_1_4,//运输菜品 1号流水线-4号炒锅
yc_1_5,//运输菜品 1号流水线-5号炒锅

yc_2_1,//运输菜品 2号流水线-1号炒锅
yc_2_2,//运输菜品 2号流水线-2号炒锅
yc_2_3,//运输菜品 2号流水线-3号炒锅
yc_2_4,//运输菜品 2号流水线-4号炒锅
yc_2_5,//运输菜品 2号流水线-5号炒锅

yc_3_1,//运输菜品 3号流水线-1号炒锅
yc_3_2,//运输菜品 3号流水线-2号炒锅
yc_3_3,//运输菜品 3号流水线-3号炒锅
yc_3_4,//运输菜品 3号流水线-4号炒锅
yc_3_5,//运输菜品 3号流水线-5号炒锅

hs_1,//1号炒锅-运输空碗到-空碗流水线
hs_2,//2号炒锅-运输空碗到-空碗流水线
hs_3,//3号炒锅-运输空碗到-空碗流水线
hs_4,//4号炒锅-运输空碗到-空碗流水线

hj,//空碗流水线-回到充电桩或者停车桩
}

/// <summary>
/// 是否
/// </summary>
public enum IsBool
{
Yes,
No,
OnllYes
}
/// <summary>
/// 是否运行
/// </summary>
public enum IsRun
{
Start,
Stop
}
}

+ 204
- 203
FryPot_DosingSystem/Control/DosingLogicControl.cs View File

@@ -84,9 +84,9 @@ namespace FryPot_DosingSystem.Control
bool LThreeErrorRecipe;//线体3错误配方标识
#endregion
#region agv临时变量
bool agvArriveUpLoad = false;//agv是否到达线体1料位置
bool agvArriveLTwoUpLoad = false;//agv是否到达线体2料位置
bool agvArriveLThreeUpLoad = false;//agv是否到达线体3料位置
bool agvArriveUpLoad = false;//agv是否到达线体1料位置
bool agvArriveLTwoUpLoad = false;//agv是否到达线体2料位置
bool agvArriveLThreeUpLoad = false;//agv是否到达线体3料位置

bool agvArriveUnLoad = false;//线体1 agv是否到达炒锅送料位置
bool LTwoagvArriveUnLoad = false;//线体2 agv是否到达炒锅送料位置
@@ -224,7 +224,7 @@ namespace FryPot_DosingSystem.Control
ActionManage.GetInstance.Register(new Action(() => { globalVar.ExitMainTask = true; }), "FryPotDosingMainTaskExit");
HubHelper.GetInstance.Report = new Action<object>(AgvTaskUpReportDataAnalysis);
HubHelper.GetInstance.Upstreamrequest = new Action<object>(AgvFeedBackUpReportDataAnalysis);
ResetProgram();
// ResetProgram();
ReadPlcData();
MainTask();
CommandRegist();
@@ -449,7 +449,7 @@ namespace FryPot_DosingSystem.Control
globalVar = new GlobalVariable();
ReicpeNum = 0;
ReadPlcData();
//MainTask();
MainTask();
MessageLog.GetInstance.ShowUserLog("主任务重启完成");

}));
@@ -633,7 +633,6 @@ namespace FryPot_DosingSystem.Control
}
else
{

hardWareStatusModel.RollerTwoModel.RollerAlarmState = Color.FromRgb(255, 51, 153);//有故障
}
if (globalVar.rollerLineTwo.OutMaterialingSingle == 1)//运行中
@@ -757,7 +756,7 @@ namespace FryPot_DosingSystem.Control
//LOneFryPotOutputMaterial();
//LTwoFryPotOutputMaterial();
//LThreeFryPotOutputMaterial();
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute();Thread.Sleep(10);}) , "滚筒线1任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute();Thread.Sleep(10); }) , "滚筒线1任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoProcessExecute(); Thread.Sleep(10); }), "滚筒线2任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeProcessExecute(); Thread.Sleep(10); }), "滚筒线3任务线程");

@@ -774,7 +773,9 @@ namespace FryPot_DosingSystem.Control
LOneRecipeDataToPlc();
LOneLoadRoller();
LOneFryPotInputMaterial();
LOneFallMaterial();
LOneFryPotOutputMaterial();
LOneEmptyOperate();
globalVar.LOneTaskLock = false;


@@ -792,7 +793,9 @@ namespace FryPot_DosingSystem.Control
LTwoRecipeDataToPlc();
LTwoAgvLoadRoller();
LTwoFryPotInputMaterial();
LTwoFallMaterial();
LTwoFryPotOutputMaterial();
LTwoEmptyOperate();
globalVar.LTwoTaskLock = false;

}
@@ -808,7 +811,9 @@ namespace FryPot_DosingSystem.Control
LThreeRecipeDataToPlc();
LThreeAgvLoadRoller();
LThreeFryPotInputMaterial();
LThreeFallMaterial();
LThreeFryPotOutputMaterial();
LThreeEmptyOperate();
globalVar.LThreeTaskLock = false;

}
@@ -1114,25 +1119,28 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LOneFryPotInputMaterial()
{
if (OutputMaterialQuene.Count > 0 && !globalVar.InOrOutputLock)
if (OutputMaterialQuene.Count > 0 && agvArriveUnLoad && globalVar.AgvToFryPot&&!globalVar.PotOneInputMaterialArrive)
{
while (!agvArriveUnLoad)//等待agv到达炒锅位置
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvArriveUnLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV到达【1】号线体指定炒锅下料位置");
AgvArriveFryPotOneOrFourSingleSetDown();
agvArriveUnLoad = false;
globalVar.PotOneInputMaterialArrive = true;
}
}

public void LOneFallMaterial()
{
if (!globalVar.InOrOutputLock && (globalVar.fryPotOne.InputMaterialArrivedSingle == 1 || globalVar.fryPotFour.InputMaterialArrivedSingle == 1) && globalVar.PotOneInputMaterialArrive&&OutputMaterialQuene.Count>0&&!globalVar.PotOneOutputRollerArrive)
{
FryPotOneRollerTroubleCheck();
if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//炒锅滚筒无故障
{
//炒锅滚筒进料运行到位处理
FryPotOneOrFourInputMaterialRollerOperate();
AgvFromFryPotOneOrFourToClean();//上游下发搬运任务给AGV
globalVar.InOrOutputLock = true;
globalVar.PotOneOutputRollerArrive = true;
}

}
}
/// <summary>
@@ -1140,25 +1148,27 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LTwoFryPotInputMaterial()
{
if (LTwoOutputMaterialQuene.Count > 0 && !globalVar.LTwoInOrOutputLock)
if (LTwoOutputMaterialQuene.Count > 0 && LTwoagvArriveUnLoad && globalVar.LTwoAgvToFryPot && !globalVar.LTwoPotInputMaterialArrive)
{
while (!LTwoagvArriveUnLoad)//等待agv到达炒锅位置
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
LTwoagvArriveUnLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号线体指定炒锅下料位置");
AgvArriveFryPotTwoOrFiveSingleSetDown();
LTwoagvArriveUnLoad = false;
globalVar.LTwoPotInputMaterialArrive = true;
}
}
public void LTwoFallMaterial()
{
if (!globalVar.LTwoInOrOutputLock && (globalVar.fryPotTwo.InputMaterialArrivedSingle == 1 || globalVar.fryPotFive.InputMaterialArrivedSingle == 1) && globalVar.LTwoPotInputMaterialArrive && LTwoOutputMaterialQuene.Count > 0 && !globalVar.LTwoPotOutputRollerArrive)
{
FryPotTwoRollerTroubleCheck();
if (FryPotTwoAlarm == 1 || FryPotFiveAlarm == 1)//炒锅滚筒无故障
{
//炒锅滚筒进料运行到位处理
FryPotTwoOrFiveInputMaterialRollerOperate();
AgvFromFryPotTwoOrFiveToClean();//上游下发搬运任务给AGV
globalVar.LTwoInOrOutputLock = true;
globalVar.LTwoPotOutputRollerArrive = true;
}

}
}
/// <summary>
@@ -1166,25 +1176,28 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LThreeFryPotInputMaterial()
{
if (LThreeOutputMaterialQuene.Count > 0 && !globalVar.LThreeInOrOutputLock)
if (LThreeOutputMaterialQuene.Count > 0 && LThreeagvArriveUnLoad && globalVar.LThreeAgvToFryPot && !globalVar.LThreePotInputMaterialArrive)
{
while (!LThreeagvArriveUnLoad)//等待agv到达炒锅位置
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
LThreeagvArriveUnLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号线体指定炒锅下料位置");
AgvArriveFryPotThreeSingleSetDown();
LThreeagvArriveUnLoad = false;
globalVar.LThreePotInputMaterialArrive = true;
}
}

public void LThreeFallMaterial()
{
if (!globalVar.LThreeInOrOutputLock && globalVar.fryPotThree.InputMaterialArrivedSingle == 1 && globalVar.LThreePotInputMaterialArrive && LThreeOutputMaterialQuene.Count > 0 && !globalVar.LThreePotOutputRollerArrive)
{
FryPotThreeRollerTroubleCheck();
if (FryPotThreeAlarm == 1)//炒锅滚筒无故障
{
//炒锅滚筒进料运行到位处理
FryPotThreeInputMaterialRollerOperate();
AgvFromFryPotThreeToClean();//上游下发搬运任务给AGV
globalVar.LThreeInOrOutputLock = true;
globalVar.LThreePotOutputRollerArrive = true;
}

}
}
/// <summary>
@@ -1228,117 +1241,123 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LOneFryPotOutputMaterial()
{
if (OutputMaterialQuene.Count > 0 && globalVar.InOrOutputLock)
if (OutputMaterialQuene.Count > 0 && globalVar.InOrOutputLock && agvArriveUpLoad && globalVar.PotOneOutputRollerArrive&& !globalVar.AgvArrivePot)
{
AgvFromFryPotOneOrFourToClean();//上游下发搬运任务给AGV
while (!agvArriveUpLoad)//等待agv到达炒锅位置
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvArriveUpLoad = false;

MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线对应炒锅空桶上料位置");
AgvArriveFryPotOneOrFourOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
agvArriveUpLoad = false;
globalVar.AgvArrivePot = true;
}
}
public void LOneEmptyOperate()
{
if ((globalVar.fryPotOne.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 1) && agvFryPotEmptyRollerArrive&&OutputMaterialQuene.Count>0&& globalVar.AgvArrivePot)
{
FryPotOneRollerTroubleCheck();
if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//无故障
{
FryPotOneOrFourOutEmpetyRollerOperate();
if (OutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
{
while (!agvFryPotEmptyRollerArrive)//等待AGV拿到出桶空桶
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvFryPotEmptyRollerArrive = false;
agvArriveUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV在【1】号滚筒线对应炒锅空桶上料完成,将进行空桶回收");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineLoadRoller = true;
globalVar.InOrOutputLock = false;
globalVar.LoadRoller = false;
globalVar.AgvToFryPot = false;
globalVar.PotOneInputMaterialArrive = false;
globalVar.PotOneOutputRollerArrive = false;
globalVar.AgvArrivePot = false;
}
}

}

}
/// <summary>
/// 线体2对应炒锅出桶
/// </summary>
public void LTwoFryPotOutputMaterial()
{
if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoInOrOutputLock)
if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoInOrOutputLock && agvArriveLTwoUpLoad && globalVar.LTwoPotOutputRollerArrive && !globalVar.LTwoAgvArrivePot)
{
AgvFromFryPotTwoOrFiveToClean();//上游下发搬运任务给AGV
while (!agvArriveLTwoUpLoad)//等待agv到达炒锅上料位置
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvArriveLTwoUpLoad = false;

MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线对应炒锅空桶上料位置");
AgvArriveFryPotTwoOrFiveOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
agvArriveLTwoUpLoad = false;
globalVar.LTwoAgvArrivePot = true;
}
}

public void LTwoEmptyOperate()
{
if ((globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFive.EmptyBarrelArrivedSingle == 1) && LTwoagvFryPotEmptyRollerArrive && LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoAgvArrivePot)
{
FryPotTwoRollerTroubleCheck();
if (FryPotTwoAlarm == 1 || FryPotFiveAlarm == 1)//无故障
{
FryPotTwoOrFiveOutEmpetyRollerOperate();
if (LTwoOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
{
while (!LTwoagvFryPotEmptyRollerArrive)//等待AGV拿到出桶空桶
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
LTwoagvFryPotEmptyRollerArrive = false;
agvArriveLTwoUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV在【2】号滚筒线对应炒锅空桶上料完成,将进行空桶回收");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineTwoLoadRoller = true;
globalVar.LTwoInOrOutputLock = false;
globalVar.LTwoLoadRoller = false;
globalVar.LTwoAgvToFryPot = false;
globalVar.LTwoPotInputMaterialArrive = false;
globalVar.LTwoPotOutputRollerArrive = false;
globalVar.LTwoAgvArrivePot = false;
}
}

}

}
/// <summary>
/// 线体3对应炒锅出桶
/// </summary>
public void LThreeFryPotOutputMaterial()
{
if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock)
if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock && agvArriveLThreeUpLoad && globalVar.LThreePotOutputRollerArrive && !globalVar.LThreeAgvArrivePot)
{
AgvFromFryPotThreeToClean();//上游下发搬运任务给AGV
while (!agvArriveLThreeUpLoad)//等待agv到达炒锅位置
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvArriveLThreeUpLoad = false;

MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线对应炒锅空桶上料位置");
AgvArriveFryPotThreeOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
agvArriveLThreeUpLoad = false;
globalVar.LThreeAgvArrivePot = true;
}
}

public void LThreeEmptyOperate()
{
if (globalVar.fryPotThree.EmptyBarrelArrivedSingle == 1 && LThreeagvFryPotEmptyRollerArrive && LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeAgvArrivePot)
{
FryPotThreeRollerTroubleCheck();
if (FryPotThreeAlarm == 1)//无故障
if (FryPotThreeAlarm == 1 )//无故障
{
FryPotThreeOutEmpetyRollerOperate();
if (LThreeOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
{
while (!LThreeagvFryPotEmptyRollerArrive)//等待AGV拿到出桶空桶
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
LThreeagvFryPotEmptyRollerArrive = false;
agvArriveLThreeUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV在【3】号滚筒线对应炒锅空桶上料完成,将进行空桶回收");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineThreeLoadRoller = true;
globalVar.LThreeInOrOutputLock = false;
globalVar.LThreeLoadRoller = false;
globalVar.LThreeAgvToFryPot = false;
globalVar.LThreePotInputMaterialArrive = false;
globalVar.LThreePotOutputRollerArrive = false;
globalVar.LThreeAgvArrivePot = false;
}
}

}

}
/// <summary>
/// 炒锅滚筒进料运行到位处理
@@ -1393,18 +1412,18 @@ namespace FryPot_DosingSystem.Control
switch (OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100)
{
case 1:
while (globalVar.fryPotOne.InputMaterialArrivedSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
//while (globalVar.fryPotOne.InputMaterialArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
case 4:
while (globalVar.fryPotFour.InputMaterialArrivedSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
//while (globalVar.fryPotFour.InputMaterialArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break;
}
}
@@ -1493,18 +1512,18 @@ namespace FryPot_DosingSystem.Control
switch (OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100)
{
case 1:
while (globalVar.fryPotOne.EmptyBarrelArrivedSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
//while (globalVar.fryPotOne.EmptyBarrelArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶到达出桶位置,正在出桶"); break;
case 4:
while (globalVar.fryPotFour.EmptyBarrelArrivedSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
//while (globalVar.fryPotFour.EmptyBarrelArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶到达出桶位置,正在出桶"); break;
}
}
@@ -1754,30 +1773,23 @@ namespace FryPot_DosingSystem.Control
/// <param name="lineAlarm"></param>
public void AgvFromLineOneToFryPot()
{
erp: if (AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble == 0)//无故障
erp: if (AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble ==0)
{
while (!agvArriveUpLoad)//等待AGV到线体装料位置
if (agvArriveUpLoad && globalVar.LoadRoller && globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.AgvToFryPot)//无故障
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvArriveUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(InputMaterialQuene);
if (InputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
while (!(globalVar.rollerLineOne.StationEight == materialInfo.materialType.MaterialLoc))//等待线体工号位8存放对应原料桶号
MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(InputMaterialQuene);
if (InputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
OutputMaterialQuene.Enqueue(materialInfo);
agvArriveUpLoad = false;
globalVar.AgvToFryPot = true;
//原料到位,agv到位,agv自行运料到炒锅
}
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
OutputMaterialQuene.Enqueue(materialInfo);
//原料到位,agv到位,agv自行运料到炒锅
}


}
}
else//有故障
{
@@ -1800,26 +1812,20 @@ namespace FryPot_DosingSystem.Control
{
erp: if (AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble == 0)//无故障
{
while (!agvArriveLTwoUpLoad)//等待AGV到线体装料位置
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvArriveLTwoUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LTwoInputMaterialQuene);
if (LTwoInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
if (agvArriveLTwoUpLoad && globalVar.LTwoLoadRoller && globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LTwoAgvToFryPot)//无故障
{
while (!(globalVar.rollerLineTwo.StationEight == materialInfo.materialType.MaterialLoc))//等待线体工号位8存放对应原料桶号
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LTwoInputMaterialQuene);
if (LTwoInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
LTwoOutputMaterialQuene.Enqueue(materialInfo);
agvArriveLTwoUpLoad = false;
globalVar.LTwoAgvToFryPot = true;
//原料到位,agv到位,agv自行运料到炒锅
}
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
LTwoOutputMaterialQuene.Enqueue(materialInfo);
//原料到位,agv到位,agv运料到炒锅


}

}
@@ -1844,26 +1850,20 @@ namespace FryPot_DosingSystem.Control
{
erp: if (AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble == 0)//无故障
{
while (!agvArriveLThreeUpLoad)//等待AGV到线体装料位置
if (agvArriveLThreeUpLoad && globalVar.LThreeLoadRoller && globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LThreeAgvToFryPot)//无故障
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
agvArriveLThreeUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LThreeInputMaterialQuene);
if (LThreeInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
while (!(globalVar.rollerLineThree.StationEight == materialInfo.materialType.MaterialLoc))//等待线体工号位8存放对应原料桶号
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LThreeInputMaterialQuene);
if (LThreeInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
LThreeOutputMaterialQuene.Enqueue(materialInfo);
agvArriveLThreeUpLoad = false;
globalVar.LThreeAgvToFryPot = true;
//原料到位,agv到位,agv自行运料到炒锅
}
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
LThreeOutputMaterialQuene.Enqueue(materialInfo);
//原料到位,agv到位,agv运料到炒锅


}

}
@@ -1926,14 +1926,8 @@ namespace FryPot_DosingSystem.Control
{
if (AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble == 0)//输送线无故障
{
if (InputMaterialQuene.Count > 0)
if (InputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineLoadRoller && globalVar.rollerLineOne.OutMaterialingSingle == 1 && !globalVar.LoadRoller)
{
while (!globalVar.AllowAgvToLineLoadRoller || globalVar.rollerLineOne.OutMaterialingSingle == 0)
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId)
goto e;
@@ -1942,74 +1936,81 @@ namespace FryPot_DosingSystem.Control
LOnerobotJobId = id;
Thread.Sleep(500);
LineCarryTaskErrorCodeAnalysis(info, 1);
globalVar.LoadRoller = true;


}
}
else
{
MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【1】故障!!!");
// lineAlarm = -1;
}
// lineAlarm = 1;
//else
//{
// MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【1】故障!!!");
// // lineAlarm = -1;
//}
//// lineAlarm = 1;
}
public void AgvToLineTwoLoadRoller()
{
if (AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble == 0)//输送线无故障
{
if (LTwoInputMaterialQuene.Count > 0)
if (LTwoInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineTwoLoadRoller && globalVar.rollerLineTwo.OutMaterialingSingle == 1 && !globalVar.LTwoLoadRoller)
{
while (!globalVar.AllowAgvToLineTwoLoadRoller || globalVar.rollerLineTwo.OutMaterialingSingle == 0) //后续考虑是否用while
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
p: string id = Guid.NewGuid().ToString();
e: string id = Guid.NewGuid().ToString("N");
if (id == LTworobotJobId)
goto p;
goto e;

string info = AGVHelper.GetInstance.AgvToLineTwoLoadRoller(id);
// MessageLog.GetInstance.ShowRunLog("AGV去【2】号滚筒线装桶");
LTworobotJobId = id;
Thread.Sleep(500);
LineCarryTaskErrorCodeAnalysis(info, 2);
globalVar.LTwoLoadRoller = true;
}

}
else
{
MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【2】故障!!!");
//lineAlarm = -1;
}
// lineAlarm = 1;
}
public void AgvToLineThreeLoadRoller()
{
if (AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble == 0)//输送线无故障
{
if (LThreeInputMaterialQuene.Count > 0)
if (LThreeInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineThreeLoadRoller && globalVar.rollerLineThree.OutMaterialingSingle == 1 && !globalVar.LThreeLoadRoller)
{
while (!globalVar.AllowAgvToLineThreeLoadRoller || globalVar.rollerLineThree.OutMaterialingSingle == 0) //后续考虑是否用while
{
Thread.Sleep(5);
if (globalVar.ExitMainTask)
return;
}
g: string id = Guid.NewGuid().ToString();
e: string id = Guid.NewGuid().ToString("N");
if (id == LThreerobotJobId)
goto g;
goto e;

string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id);
// MessageLog.GetInstance.ShowRunLog("AGV去【3】号滚筒线装桶");
LThreerobotJobId = id;
Thread.Sleep(500);
LineCarryTaskErrorCodeAnalysis(info, 3);
globalVar.LThreeLoadRoller = true;
}

}
else
{
MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【3】故障!!!");
// lineAlarm = -1;
}
// lineAlarm = 1;

//if (AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble == 0)//输送线无故障
//{
// if (LThreeInputMaterialQuene.Count > 0)
// {
// while (!globalVar.AllowAgvToLineThreeLoadRoller || globalVar.rollerLineThree.OutMaterialingSingle == 0) //后续考虑是否用while
// {
// Thread.Sleep(5);
// if (globalVar.ExitMainTask)
// return;
// }
// g: string id = Guid.NewGuid().ToString();
// if (id == LThreerobotJobId)
// goto g;
// string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id);
// // MessageLog.GetInstance.ShowRunLog("AGV去【3】号滚筒线装桶");
// LThreerobotJobId = id;
// Thread.Sleep(500);
// LineCarryTaskErrorCodeAnalysis(info, 3);
// }

//}
//else
//{
// MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【3】故障!!!");
// // lineAlarm = -1;
//}
}
/// <summary>
/// 1号线体数据下发


+ 29
- 0
FryPot_DosingSystem/Control/GlobalVariable.cs View File

@@ -115,7 +115,36 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public string LThreeCurrentRecipeName { get; set; } = string.Empty;
#endregion
#region 线体1流程互锁变量

public bool LoadRoller { get; set; }

public bool AgvToFryPot { get; set; }

public bool PotOneInputMaterialArrive { get; set; }
public bool PotOneOutputRollerArrive { get; set; }
public bool AgvArrivePot { get; set; }
#endregion
#region 线体2流程互锁变量

public bool LTwoLoadRoller { get; set; }

public bool LTwoAgvToFryPot { get; set; }

public bool LTwoPotInputMaterialArrive { get; set; }
public bool LTwoPotOutputRollerArrive { get; set; }
public bool LTwoAgvArrivePot { get; set; }
#endregion
#region 线体3流程互锁变量

public bool LThreeLoadRoller { get; set; }

public bool LThreeAgvToFryPot { get; set; }

public bool LThreePotInputMaterialArrive { get; set; }
public bool LThreePotOutputRollerArrive { get; set; }
public bool LThreeAgvArrivePot { get; set; }
#endregion
}
/// <summary>
/// 滚筒线1相关变量


+ 1190
- 106
FryPot_DosingSystem/View/AgvView.xaml
File diff suppressed because it is too large
View File


+ 138
- 32
FryPot_DosingSystem/View/AgvView.xaml.cs View File

@@ -1,4 +1,5 @@
using FryPot_DosingSystem.ViewModel;
using FryPot_DosingSystem.AGV;
using FryPot_DosingSystem.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -26,42 +27,147 @@ namespace FryPot_DosingSystem.View
{
InitializeComponent();
this.DataContext = AgvViewModel.GetInstance();
控制命令.ItemsSource = AgvViewModel.GetInstance().GetCommand();
}

private void Button_Click(object sender, RoutedEventArgs e)
{
AnimationByPath(yunshuche,qc_1);
}

/// <summary>
/// 路径动画
/// </summary>
/// <param name="cvs">画板</param>
/// <param name="path">路径</param>
/// <param name="target">动画对象</param>
/// <param name="duration">时间</param>
private void AnimationByPath(TextBox target, Path path, int duration = 5)
{
target.RenderTransformOrigin = new Point(0.5, 0.5);
int id = 1;
if (sender is Button)
{
byte[] data;
bool istrue = false;
Button button = sender as Button;
if (button.Tag != null)
{
switch (button.Tag.ToString())
{
case "设置有车":
try
{
id=int.Parse(tcz_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-5 的数字!");
return;
}
AgvViewModel.GetInstance().Set停车桩(id, IsBool.Yes);
break;
case "设置无车":
try
{
id = int.Parse(tcz_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-5 的数字!");
return;
}
AgvViewModel.GetInstance().Set停车桩(id, IsBool.No);
break;
case "启动":
try
{
id = int.Parse(liaotong_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-5 的数字!");
return;
}
AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Start);
break;
case "停止":
try
{
id = int.Parse(liaotong_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-5 的数字!");
return;
}
AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Stop);
break;
case "设置物料":
try
{
id = int.Parse(liaotongwuliao_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-8 的数字!");
return;
}
AgvViewModel.GetInstance().Set滚筒线上数量(id, liaotongwuliaoshuliang_text.Text);
break;
case "小车停止":
try
{
id = int.Parse(xiaoche_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set小车停止(id);
break;
case "运行小车":
try
{
id = int.Parse(xiaoche_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set小车运动(id, AgvViewModel.GetInstance().GetCommandValue(控制命令.Text));
break;
case "有菜和碗":
try
{
id = int.Parse(xiaochewuping_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.Yes);
break;
case "只有碗":
try
{
id = int.Parse(xiaochewuping_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.OnllYes);
break;
case "无物品":
try
{
id = int.Parse(xiaochewuping_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.No);
break;

MatrixTransform matrix = new MatrixTransform();
TransformGroup groups = new TransformGroup();
groups.Children.Add(matrix);
target.RenderTransform = groups;
string registname = "matrix" + Guid.NewGuid().ToString().Replace("-", "");
this.RegisterName(registname, matrix);
MatrixAnimationUsingPath matrixAnimation = new MatrixAnimationUsingPath();
matrixAnimation.PathGeometry = PathGeometry.CreateFromGeometry(Geometry.Parse(path.Data.ToString()));
matrixAnimation.Duration = new Duration(TimeSpan.FromSeconds(duration));
matrixAnimation.DoesRotateWithTangent = true;//跟随路径旋转
matrixAnimation.RepeatBehavior = RepeatBehavior.Forever;//循环
Storyboard story = new Storyboard();
story.Children.Add(matrixAnimation);
Storyboard.SetTargetName(matrixAnimation, registname);
Storyboard.SetTargetProperty(matrixAnimation, new PropertyPath(MatrixTransform.MatrixProperty));
}
}
}
}

story.FillBehavior = FillBehavior.Stop;
story.Begin(target, true);
}
}
}

+ 1040
- 2
FryPot_DosingSystem/ViewModel/AgvViewModel.cs
File diff suppressed because it is too large
View File


+ 24
- 1
SmartClient.sln View File

@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
# Blend for Visual Studio Version 17
VisualStudioVersion = 17.0.32002.185
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DRCoffee", "BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj", "{31E9DC70-5889-4BA5-A5BA-FFDE66AFF314}"
@@ -116,6 +116,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDemo", "TestDemo\TestDe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.HubHelper", "BPASmartClient.HubHelper\BPASmartClient.HubHelper.csproj", "{099E047C-F40E-47A3-A5BA-81FC1500D5E8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTM", "BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj", "{76B6B333-0109-4EE8-A9B2-3E53A7421D92}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1090,6 +1092,26 @@ Global
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x64.Build.0 = Release|Any CPU
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.ActiveCfg = Release|Any CPU
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|ARM64.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x64.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x64.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x86.ActiveCfg = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Debug|x86.Build.0 = Debug|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|Any CPU.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM64.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|ARM64.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x64.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x64.Build.0 = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x86.ActiveCfg = Release|Any CPU
{76B6B333-0109-4EE8-A9B2-3E53A7421D92}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1143,6 +1165,7 @@ Global
{E7168B03-68E5-4285-BB95-5660F877577A} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{A49E1C5A-9489-451C-9CE6-CEA586234B84} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{099E047C-F40E-47A3-A5BA-81FC1500D5E8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{76B6B333-0109-4EE8-A9B2-3E53A7421D92} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Loading…
Cancel
Save