yahaha 2 anni fa
parent
commit
e2fa4ea184
83 ha cambiato i file con 6030 aggiunte e 2064 eliminazioni
  1. +5
    -5
      BPASmartClient.AGV/AGVHelper.cs
  2. BIN
     
  3. +16
    -8
      BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
  4. +2
    -1
      BPASmartClient.CustomResource/Pages/View/RunLogView.xaml
  5. +3
    -1
      BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
  6. +32
    -32
      BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
  7. +34
    -0
      BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs
  8. +79
    -0
      BPASmartClient.CustomResource/RecDictionarys/RecToggleButton.xaml
  9. +10
    -6
      BPASmartClient.Helper/Json.cs
  10. +0
    -1
      BPASmartClient.HubHelper/HubHelper.cs
  11. +9
    -1
      BPASmartClient.JXJFoodBigStation/App.xaml.cs
  12. +15
    -0
      BPASmartClient.JXJFoodBigStation/BPASmartClient.JXJFoodBigStation.csproj
  13. +34
    -3
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Read.cs
  14. +1
    -0
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs
  15. +18
    -0
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/PlcCommAttribute.cs
  16. +14
    -14
      BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs
  17. +32
    -0
      BPASmartClient.JXJFoodBigStation/Model/PlcVarMonitor.cs
  18. +615
    -125
      BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
  19. +3
    -3
      BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs
  20. +1
    -15
      BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs
  21. +26
    -0
      BPASmartClient.JXJFoodBigStation/Properties/Settings.Designer.cs
  22. +6
    -0
      BPASmartClient.JXJFoodBigStation/Properties/Settings.settings
  23. +155
    -0
      BPASmartClient.JXJFoodBigStation/View/HKPlcCommMonitorView.xaml
  24. +28
    -0
      BPASmartClient.JXJFoodBigStation/View/HKPlcCommMonitorView.xaml.cs
  25. +2
    -2
      BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml
  26. +1
    -4
      BPASmartClient.JXJFoodBigStation/View/RecipeSendDownView.xaml
  27. +131
    -0
      BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs
  28. +4
    -8
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
  29. +23
    -9
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs
  30. +1
    -1
      BPASmartClient.JXJFoodSmallStation/App.xaml.cs
  31. +21
    -15
      BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
  32. +1
    -1
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs
  33. +4
    -8
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs
  34. +6
    -6
      BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml
  35. +2
    -2
      BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs
  36. +2
    -2
      BPASmartClient.Modbus/ModbusTcp.cs
  37. +83
    -0
      BPASmartClient.Model/大炒/FryPotMessages.cs
  38. +14
    -0
      BPASmartClient.Model/大炒/LocalFryPotMessage.cs
  39. +32
    -0
      BPASmartClient.Model/大炒/RobotActionModel.cs
  40. +281
    -15
      BPASmartClient.MorkBF/Control_MorkBF.cs
  41. +127
    -0
      BPASmartClient.MorkBF/Convert/FryActionToVisibilityConverter.cs
  42. +48
    -14
      BPASmartClient.MorkBF/GVL_MorkBF.cs
  43. +31
    -1
      BPASmartClient.MorkBF/Model/BF_Food.cs
  44. +14
    -0
      BPASmartClient.MorkBF/Model/Global.cs
  45. +32
    -6
      BPASmartClient.MorkBF/VIew/DebugView.xaml
  46. +9
    -1
      BPASmartClient.MorkBF/VIew/DebugView.xaml.cs
  47. +58
    -33
      BPASmartClient.MorkBF/VIew/FoodManagerView.xaml
  48. +18
    -1
      BPASmartClient.MorkBF/VIew/FoodManagerView.xaml.cs
  49. +39
    -5
      BPASmartClient.MorkBF/ViewModel/DebugViewModel.cs
  50. +93
    -0
      BPASmartClient.MorkBF/ViewModel/FoodManagerViewModel.cs
  51. +1
    -1
      BPASmartClient.MorkBF/ViewModel/MonitorViewModel.cs
  52. +1
    -0
      BPASmartClient.MorkF/Control_MorkF.cs
  53. +3
    -5
      BPASmartClient.S7Net/EntityClassResolution.cs
  54. +8
    -4
      BPASmartClient.S7Net/SiemensHelper.cs
  55. +1
    -2
      BPASmartClient.ViewModel/FoodMenuViewModel.cs
  56. +22
    -22
      DosingSystem/App.xaml.cs
  57. +2
    -12
      DosingSystem/Model/DeviceInquire.cs
  58. +9
    -3
      DosingSystem/View/CommParSetView.xaml
  59. +466
    -409
      DosingSystem/View/ManualControlView.xaml
  60. +38
    -12
      DosingSystem/View/RecipeControlView.xaml
  61. +2
    -2
      DosingSystem/View/RecipeSettingsView.xaml
  62. +39
    -0
      DosingSystem/ViewModel/ManualControlViewModel.cs
  63. +0
    -4
      DosingSystem/ViewModel/NewRecipeViewModel.cs
  64. +44
    -9
      DosingSystem/ViewModel/RecipeControlViewModel.cs
  65. +14
    -14
      FryPot_DosingSystem/App.xaml.cs
  66. +271
    -126
      FryPot_DosingSystem/Control/DeviceOperate.cs
  67. +1799
    -676
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  68. +7
    -1
      FryPot_DosingSystem/Control/GlobalVariable.cs
  69. +2
    -0
      FryPot_DosingSystem/Model/FlowProcessManage.cs
  70. +6
    -1
      FryPot_DosingSystem/Model/FlowProcessModel.cs
  71. +136
    -92
      FryPot_DosingSystem/View/AgvView.xaml
  72. +200
    -166
      FryPot_DosingSystem/View/AgvView.xaml.cs
  73. +236
    -66
      FryPot_DosingSystem/View/DebugView.xaml
  74. +340
    -2
      FryPot_DosingSystem/View/DebugView.xaml.cs
  75. +23
    -13
      FryPot_DosingSystem/View/FlowProcessView.xaml
  76. +28
    -0
      FryPot_DosingSystem/View/FlowProcessView.xaml.cs
  77. +34
    -24
      FryPot_DosingSystem/View/NewRecipeView.xaml.cs
  78. +1
    -1
      FryPot_DosingSystem/View/RecipeSendDownView.xaml
  79. +1
    -1
      FryPot_DosingSystem/View/RecipesSendDown.xaml
  80. +32
    -5
      FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
  81. +43
    -38
      FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs
  82. +2
    -2
      FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs
  83. +4
    -2
      FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs

+ 5
- 5
BPASmartClient.AGV/AGVHelper.cs Vedi File

@@ -471,7 +471,7 @@ namespace BPASmartClient.AGV
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互
httpJobData.loadEquipmentId = 5;
httpJobData.unloadEquipmentId = 4;
httpJobData.unloadEquipmentId = 40;
httpModel.jobData = httpJobData;
string body = "["+JsonConvert.SerializeObject(httpModel)+"]";
//货位到货位
@@ -526,7 +526,7 @@ namespace BPASmartClient.AGV
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互
httpJobData.loadEquipmentId = 6;
httpJobData.unloadEquipmentId = 4;
httpJobData.unloadEquipmentId = 41;
httpModel.jobData = httpJobData;
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]";
//货位到货位
@@ -581,7 +581,7 @@ namespace BPASmartClient.AGV
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互
httpJobData.loadEquipmentId = 7;
httpJobData.unloadEquipmentId = 4;
httpJobData.unloadEquipmentId = 42;
httpModel.jobData = httpJobData;
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]";
//货位到货位
@@ -636,7 +636,7 @@ namespace BPASmartClient.AGV
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互
httpJobData.loadEquipmentId = 8;
httpJobData.unloadEquipmentId = 4;
httpJobData.unloadEquipmentId = 40;
httpModel.jobData = httpJobData;
string body = "["+JsonConvert.SerializeObject(httpModel)+"]";
//货位到货位
@@ -691,7 +691,7 @@ namespace BPASmartClient.AGV
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互
httpJobData.loadEquipmentId = 9;
httpJobData.unloadEquipmentId = 4;
httpJobData.unloadEquipmentId = 41;
httpModel.jobData = httpJobData;
string body = "["+JsonConvert.SerializeObject(httpModel)+"]";
//货位到货位


BIN
Vedi File


+ 16
- 8
BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs Vedi File

@@ -66,15 +66,23 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
lock (runLock)
{
RunLog runLog = new RunLog()
try
{
Date = DateTime.Now.ToString("yyyy-MM-dd"),
Time = DateTime.Now.ToString("HH:mm:ss"),
RunLogInfo = info
};
Sqlite<RunLog>.GetInstance.Base.Add(runLog);
Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); }));
RunLog?.Invoke(info);
RunLog runLog = new RunLog()
{
Date = DateTime.Now.ToString("yyyy-MM-dd"),
Time = DateTime.Now.ToString("HH:mm:ss"),
RunLogInfo = info
};
Sqlite<RunLog>.GetInstance.Base.Add(runLog);
Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); }));
RunLog?.Invoke(info);
}
catch (Exception)
{

// throw;
}
}
}



+ 2
- 1
BPASmartClient.CustomResource/Pages/View/RunLogView.xaml Vedi File

@@ -263,7 +263,8 @@
Margin="10,0,0,0"
HorizontalAlignment="Left"
Style="{StaticResource DataTextBlockStyle}"
Text="{Binding RunLogInfo}" />
Text="{Binding RunLogInfo}"
TextWrapping="Wrap"/>

<Border
Grid.ColumnSpan="6"


+ 3
- 1
BPASmartClient.CustomResource/Pages/View/UserLogView.xaml Vedi File

@@ -417,7 +417,9 @@
Margin="10,0,0,0"
HorizontalAlignment="Left"
Style="{StaticResource DataTextBlockStyle}"
Text="{Binding LogInfo}" />
Text="{Binding LogInfo}"
TextWrapping="Wrap"
/>

<Border
Grid.ColumnSpan="6"


+ 32
- 32
BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs Vedi File

@@ -105,38 +105,38 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}

//分配后的权限
if (res.permission == Enums.Permission.管理员)
{
foreach (var items in MenuManage.GetInstance.menuModels)
{
items.MainMenuVisibility = Visibility.Visible;
foreach (var item in items.subMenumodels)
{
item.SubMenuVisibility = Visibility.Visible;
}
}
}
else
{
if (res.userTreeViewModels != null)
{
if (res.userTreeViewModels.Count > 0)
{
foreach (var items in MenuManage.GetInstance.menuModels)
{
foreach (var item in items.subMenumodels)
{
items.MainMenuVisibility = Visibility.Visible;
if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null)
{
item.SubMenuVisibility = Visibility.Visible;
}
}
}
}
}
}
////分配后的权限
//if (res.permission == Enums.Permission.管理员)
//{
// foreach (var items in MenuManage.GetInstance.menuModels)
// {
// items.MainMenuVisibility = Visibility.Visible;
// foreach (var item in items.subMenumodels)
// {
// item.SubMenuVisibility = Visibility.Visible;
// }
// }
//}
//else
//{
// if (res.userTreeViewModels != null)
// {
// if (res.userTreeViewModels.Count > 0)
// {
// foreach (var items in MenuManage.GetInstance.menuModels)
// {
// foreach (var item in items.subMenumodels)
// {
// items.MainMenuVisibility = Visibility.Visible;
// if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null)
// {
// item.SubMenuVisibility = Visibility.Visible;
// }
// }
// }
// }
// }
//}


ActionManage.GetInstance.Send("PermissionChange");


+ 34
- 0
BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs Vedi File

@@ -20,6 +20,40 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public MainViewModel()
{
NavChangedCommand = new RelayCommand<object>(DoNavChanged);
BPASmartClient.Message. MessageLog.GetInstance.InfoNotify = new Action<string>((o) =>
{
Application.Current?.Dispatcher?.Invoke(() =>
{
//ff20aefe
var temp = new MessageModel()
{
LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254))
};
if (DebugLogViewModel.MessageModels.Count > 0)
DebugLogViewModel.MessageModels.Insert(0, temp);
else
DebugLogViewModel.MessageModels.Add(temp);
});
});

BPASmartClient.Message.MessageLog.GetInstance.ExInfoNotify = new Action<string>((o) =>
{
Application.Current?.Dispatcher?.Invoke(() =>
{
//FFF53F62
var temp = new MessageModel()
{
LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98))
};
if (DebugLogViewModel.MessageModels.Count > 0)
DebugLogViewModel.MessageModels.Insert(0, temp);
else
DebugLogViewModel.MessageModels.Add(temp);
});
});

BPA.Helper.MessageLog.GetInstance.NotifyShow = new Action<string>((o) =>
{
Application.Current?.Dispatcher?.Invoke(() =>


+ 79
- 0
BPASmartClient.CustomResource/RecDictionarys/RecToggleButton.xaml Vedi File

@@ -137,4 +137,83 @@
</Setter>
</Style>
<!--#endregion-->

<!--#region 切换开关 ToggleButton 样式-->
<Style x:Key="SwitchToggleButtonStyle1" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Viewbox>
<Grid x:Name="gr" Opacity="0.8">
<Border
x:Name="border2"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="Left"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Background="Red"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="15">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Visibility="Collapsed" />
</Border>

<Ellipse
Name="ell"
Width="{TemplateBinding Height}"
Height="{TemplateBinding Height}"
Margin="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Fill="#ddd" />

<TextBlock
Name="tb"
Margin="10,0,10,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="{TemplateBinding Content}" />

</Grid>
</Viewbox>
<ControlTemplate.Triggers>
<!-- 控件选中 -->
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="ell" Property="HorizontalAlignment" Value="Right" />
<Setter TargetName="border2" Property="Background" Value="#00c2f4" />
<Setter TargetName="tb" Property="Margin" Value="0,0,15,0" />
</Trigger>

<!-- 控件未选中 -->
<Trigger Property="IsChecked" Value="false">
<Setter TargetName="border2" Property="Background" Value="gray" />
<Setter TargetName="tb" Property="Margin" Value="15,0,0,0" />
</Trigger>

<!-- 鼠标进入 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="gr" Property="Opacity" Value="1" />
</Trigger>

<!-- 控件禁用 -->
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="gr" Property="Opacity" Value="0.5" />
</Trigger>

<!-- 控件启用 -->
<Trigger Property="IsEnabled" Value="True">
<Setter TargetName="gr" Property="Opacity" Value="0.8" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
</ResourceDictionary>

+ 10
- 6
BPASmartClient.Helper/Json.cs Vedi File

@@ -22,6 +22,8 @@ namespace BPASmartClient.Helper

public static T Data { get; set; } = new T();



/// <summary>
/// 保存数据
/// </summary>
@@ -36,12 +38,14 @@ namespace BPASmartClient.Helper
/// </summary>
public static void Read()
{
if (File.Exists(path))
{
string JsonString = File.ReadAllText(path);
var result = JsonConvert.DeserializeObject<T>(JsonString);
if (result != null) { Data = result; }
}
if (File.Exists(path))
{
string JsonString = File.ReadAllText(path);
var result = JsonConvert.DeserializeObject<T>(JsonString);
if (result != null) { Data = result; }
}
}

/// <summary>


+ 0
- 1
BPASmartClient.HubHelper/HubHelper.cs Vedi File

@@ -19,7 +19,6 @@ namespace BPASmartClient.HubHelper
public void Connect(string ip, int port)
{
hubConnection = new HubConnectionBuilder().WithAutomaticReconnect().WithUrl($"http://{ip}:{port}/personhub").Build();//连接

hubConnection.On<object>("Report", (s) => { Report?.Invoke(s); });//客户端注册方法

hubConnection.On<object>("Upstreamrequest", (s) => { Upstreamrequest?.Invoke(s); });//客户端注册方法


+ 9
- 1
BPASmartClient.JXJFoodBigStation/App.xaml.cs Vedi File

@@ -27,8 +27,8 @@ namespace BPASmartClient.JXJFoodBigStation
base.OnStartup(e);
MenuInit();
DataInit();
ProcessControl.GetInstance.Init();
MainView mv = new MainView();
ProcessControl.GetInstance.Init();
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
@@ -134,6 +134,14 @@ namespace BPASmartClient.JXJFoodBigStation
AssemblyName = "BPASmartClient.JXJFoodBigStation",
ToggleWindowPath = "View.HardwareStatusView"
});
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "通讯状态",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.JXJFoodBigStation",
ToggleWindowPath = "View.HKPlcCommMonitorView"
});
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe603;",


+ 15
- 0
BPASmartClient.JXJFoodBigStation/BPASmartClient.JXJFoodBigStation.csproj Vedi File

@@ -17,6 +17,21 @@
<ProjectReference Include="..\BPASmartClient.S7Net\BPASmartClient.S7Net.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>

<ItemGroup>
<Page Update="View\HardwareStatusView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>


+ 34
- 3
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/DB_Read.cs Vedi File

@@ -8,55 +8,86 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
public class DB_Read
{
[PlcComm("plc心跳上报")]
/// <summary>
/// plc心跳上报
/// </summary>
public bool HeartBeat { get; set; }
[PlcComm("配方1允许下发配方")]
/// <summary>
/// 配方1允许下发配方
/// </summary>
public bool IsAllowIssueRecipe1 { get; set; }

[PlcComm("配方2允许下发配方")]
public bool IsAllowIssueRecipe2 { get; set; }

[PlcComm("配方3允许下发配方")]
public bool IsAllowIssueRecipe3 { get; set; }

[PlcComm("配方4允许下发配方")]
public bool IsAllowIssueRecipe4 { get; set; }

[PlcComm("配方1接收配方完成")]
/// <summary>
/// 配方1 接收配方完成
/// </summary>
public bool ReceiveFinishRecipe1 { get; set; }
[PlcComm("配方2接收配方完成")]
public bool ReceiveFinishRecipe2 { get; set; }
[PlcComm("配方3接收配方完成")]
public bool ReceiveFinishRecipe3 { get; set; }
[PlcComm("配方4接收配方完成")]
public bool ReceiveFinishRecipe4 { get; set; }
[PlcComm("配方1配料完成")]
/// <summary>
/// 配方1 配料完成
/// </summary>
public bool Recipe1DosingFinish { get; set; }
[PlcComm("配方2配料完成")]
public bool Recipe2DosingFinish { get; set; }
[PlcComm("配方3配料完成")]
public bool Recipe3DosingFinish { get; set; }
[PlcComm("配方4配料完成")]
public bool Recipe4DosingFinish { get; set; }
[PlcComm("配方1托盘编号")]
/// <summary>
/// 配方1 托盘编号
/// </summary>
public short Recipe1TrayCode { get; set; }
[PlcComm("配方2托盘编号")]
public short Recipe2TrayCode { get; set; }
[PlcComm("配方3托盘编号")]
public short Recipe3TrayCode { get; set; }
[PlcComm("配方4托盘编号")]
public short Recipe4TrayCode { get; set; }
[PlcComm("料仓1实际下料重量")]
public float StockBin1ActualWeight { get; set; }
[PlcComm("料仓2实际下料重量")]
public float StockBin2ActualWeight { get; set; }
[PlcComm("料仓3实际下料重量")]
public float StockBin3ActualWeight { get; set; }
[PlcComm("料仓4实际下料重量")]
public float StockBin4ActualWeight { get; set; }
[PlcComm("料仓5实际下料重量")]
public float StockBin5ActualWeight { get; set; }
[PlcComm("料仓6实际下料重量")]
public float StockBin6ActualWeight { get; set; }
[PlcComm("料仓7实际下料重量")]
public float StockBin7ActualWeight { get; set; }
[PlcComm("料仓8实际下料重量")]
public float StockBin8ActualWeight { get; set; }
[PlcComm("料仓9实际下料重量")]
public float StockBin9ActualWeight { get; set; }
[PlcComm("料仓10实际下料重量")]
public float StockBin10ActualWeight { get; set; }
[PlcComm("料仓11实际下料重量")]
public float StockBin11ActualWeight { get; set; }
[PlcComm("料仓12实际下料重量")]
public float StockBin12ActualWeight { get; set; }
[PlcComm("料仓13实际下料重量")]
public float StockBin13ActualWeight { get; set; }
[PlcComm("料仓14实际下料重量")]
public float StockBin14ActualWeight { get; set; }
}
}

+ 1
- 0
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/HKDeviceStatus.cs Vedi File

@@ -30,6 +30,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
if (res1 != null && res1 is DB_Read data1)
{
PlcRead = data1;
GVL_BigStation.HeartBeatFromPlc = data1.HeartBeat;//读取plc心跳
}
if (res2 != null && res2 is StockBinName data2)
{


+ 18
- 0
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/PlcCommAttribute.cs Vedi File

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

namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
{
[AttributeUsage(AttributeTargets.Property)]
public sealed class PlcCommAttribute:Attribute
{
public PlcCommAttribute(string describe)
{
Describe = describe;
}
public string Describe { get; set; }
}
}

+ 14
- 14
BPASmartClient.JXJFoodBigStation/Model/HK_PLC/StockBinName.cs Vedi File

@@ -10,32 +10,32 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC
public class StockBinName
{
[Siemens(6)]
public string RawMaterialName1 { get; set; }
public string RawMaterialName1 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName2 { get; set; }
public string RawMaterialName2 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName3 { get; set; }
public string RawMaterialName3 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName4 { get; set; }
public string RawMaterialName4 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName5 { get; set; }
public string RawMaterialName5 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName6 { get; set; }
public string RawMaterialName6 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName7 { get; set; }
public string RawMaterialName7 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName8 { get; set; }
public string RawMaterialName8 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName9 { get; set; }
public string RawMaterialName9 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName10 { get; set; }
public string RawMaterialName10 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName11 { get; set; }
public string RawMaterialName11 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName12 { get; set; }
public string RawMaterialName12 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName13 { get; set; }
public string RawMaterialName13 { get; set; } = "";
[Siemens(6)]
public string RawMaterialName14 { get; set; }
public string RawMaterialName14 { get; set; } = "";
}
}

+ 32
- 0
BPASmartClient.JXJFoodBigStation/Model/PlcVarMonitor.cs Vedi File

@@ -0,0 +1,32 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodBigStation.Model
{
public class PlcVarMonitor: ObservableObject
{
private int _serialNum;
public int SerialNum { get { return _serialNum; } set { _serialNum = value;OnPropertyChanged(); } }

private string _variable;
public string Variable { get { return _variable; } set { _variable = value; OnPropertyChanged(); } }

private string _address;
public string Address { get { return _address; } set { _address = value; OnPropertyChanged(); } }

private string _type;
public string Type { get { return _type; } set { _type = value; OnPropertyChanged(); } }

private string _describe;
public string Describe { get { return _describe; } set { _describe = value; OnPropertyChanged(); } }

private string _nowValue;
public string NowValue { get { return _nowValue; } set { _nowValue = value; OnPropertyChanged(); } }
private string _setValue;
public string SetValue { get { return _setValue; } set { _setValue = value; OnPropertyChanged(); } }
}
}

+ 615
- 125
BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
File diff soppresso perché troppo grande
Vedi File


+ 3
- 3
BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs Vedi File

@@ -20,12 +20,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
/// <summary>
/// 生产工单编码
/// </summary>
public string Order_No{get; set; }
public string Order_No { get; set; } = "";
[Siemens(16)]
/// <summary>
/// 产品名称
/// </summary>
public string Product_Code { get; set; }
public string Product_Code { get; set; } = "";
public short job_No { get; set; }
/// <summary>
/// 原料信息
@@ -43,7 +43,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
public class UDT1
{
[Siemens(6)]
public string Material_Name { get; set; }
public string Material_Name { get; set; } = "";
public float Material_Laying_Off_Weight { get; set; }
public short Material_BarrelNum { get; set; }
}


+ 1
- 15
BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs Vedi File

@@ -29,20 +29,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
var res3 = this.Siemens_PLC_S7.ReadClass<DL_DataColl_DB>(2391);
if (res != null && res is DL_Start_DB start)
{
if (a)
{
start.RecipeName = "配方1";
start.RecipeCode = "1201";
start.Order_Request_Ack = true;

for (int i = 0; i < GVL_BigStation.Max_DosingSotckBinNum ; i++)
{
start.Material[i] = new UDT();
start.Material[i].Material_Name = "" + (i +1);
start.Material[i].Material_Weight = 100 + (i + 1);
start.Material[i].Material_BarrelNum = (short)(i + 1);
}
}
if (RTrig.GetInstance("Order_Request").Start(GVL_BigStation.Order_Request) && GVL_BigStation.SiemensSendRecipeStatus == 0)
{
GVL_BigStation.SiemensSendRecipeStatus = 1;
@@ -78,7 +64,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
GVL_BigStation.SiemensSendRecipeStatus = 0;
finish.Ask_For_Finish = false;
finish.ProcessTime = 0;
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2261);
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2361);
}
}
Thread.Sleep(10);


+ 26
- 0
BPASmartClient.JXJFoodBigStation/Properties/Settings.Designer.cs Vedi File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace BPASmartClient.JXJFoodBigStation.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

+ 6
- 0
BPASmartClient.JXJFoodBigStation/Properties/Settings.settings Vedi File

@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>

+ 155
- 0
BPASmartClient.JXJFoodBigStation/View/HKPlcCommMonitorView.xaml Vedi File

@@ -0,0 +1,155 @@
<UserControl x:Class="BPASmartClient.JXJFoodBigStation.View.HKPlcCommMonitorView"
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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.DataContext>
<vm:HKPlcCommMonitorViewModel />
</UserControl.DataContext>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition />
</Grid.RowDefinitions>
<!--#region 表格标题栏设置-->
<Grid
Grid.Row="0"
Margin="0,10,0,0"
Background="#ff0C255F">

<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<TextBlock Text="序号" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"/>
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
</Grid>
<TextBlock Grid.Column="1" FontSize="24" Text="变量名" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
<TextBlock Grid.Column="2" FontSize="24" Text="地址" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
<TextBlock Grid.Column="3" FontSize="24" Text="类型" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
<Grid Grid.Column="4">
<TextBlock Text="描述" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
</Grid>
<TextBlock Grid.Column="5" FontSize="24" Text="当前值" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
<Grid Grid.Column="6">
<TextBlock Text="设定值" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
</Grid>
<TextBlock Grid.Column="7" FontSize="24" Text="功能操作" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" />
<Border Grid.ColumnSpan="10" BorderThickness="1,0,1,0" />
</Grid>
<Grid Grid.Row="1">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" >
<ItemsControl ItemsSource="{Binding PlcInfo}" Foreground="Aqua">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Name="gr" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<TextBlock
FontSize="16"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding SerialNum}" />
<Border
BorderThickness="1,0,1,0"
Cursor="SizeWE" />
</Grid>
<Grid Grid.Column="1">
<TextBlock
FontSize="16"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Variable}" />
<Border
BorderThickness="1,0,1,0"
Cursor="SizeWE" />
</Grid>
<TextBlock
Grid.Column="2"
FontSize="16"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Address }" />
<TextBlock
Grid.Column="3"
FontSize="16"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Type }" />
<Grid Grid.Column="4">
<TextBlock
FontSize="16"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Describe}" />
<Border
BorderThickness="1,0,1,0"
Cursor="SizeWE" />
</Grid>

<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Grid.Column="5"
Text="{Binding NowValue}" FontSize="16" />
<Grid Grid.Column="6">
<TextBox
Text="{Binding SetValue}" Foreground="Aqua" Background="Transparent" FontSize="16" VerticalAlignment="Center" />
<Border
BorderThickness="1,0,1,0"
Cursor="SizeWE" />
</Grid>
<Grid Grid.Column="7">
<pry:IcoButton
Width="100"
Command="{Binding DataContext.SetValueCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
CommandParameter="{Binding SetValue}"
Grid.Column="0"
Margin="50,5,50,5"
Content="设置"
FontSize="20"
Foreground="Aqua"
Style="{StaticResource IcoButtonStyle}" />
<Border
BorderThickness="1,0,1,0"
Cursor="SizeWE" />
</Grid>
<Border
Grid.ColumnSpan="10"
BorderThickness="1,0,1,1" />
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.JXJFoodBigStation/View/HKPlcCommMonitorView.xaml.cs Vedi 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.JXJFoodBigStation.View
{
/// <summary>
/// HKPlcCommMonitor.xaml 的交互逻辑
/// </summary>
public partial class HKPlcCommMonitorView : UserControl
{
public HKPlcCommMonitorView()
{
InitializeComponent();
}
}
}

+ 2
- 2
BPASmartClient.JXJFoodBigStation/View/RecipeReceiveView.xaml Vedi File

@@ -159,7 +159,7 @@
<CheckBox
x:Name="IsUseLocalRecipe"
Margin="0,0,10,0"
Content="应用本地配方"
Content="本地配方"
FontFamily="楷体"
VerticalAlignment="Center"
Foreground="Aqua"
@@ -285,7 +285,7 @@
<Expander.Content>
<StackPanel Margin="36,0,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="托盘桶号:" Foreground="#FF2AB2E7"/>
<TextBlock Text="原料桶号:" Foreground="#FF2AB2E7"/>
<TextBlock Text="{Binding RawMaterialBarrelNum}" Foreground="#FF2AB2E7"/>
</StackPanel>
<StackPanel Orientation="Horizontal">


+ 1
- 4
BPASmartClient.JXJFoodBigStation/View/RecipeSendDownView.xaml Vedi File

@@ -506,7 +506,7 @@
<Expander.Content>
<StackPanel Margin="36,0,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="托盘编号:" Foreground="#FF2AB2E7"/>
<TextBlock Text="原料桶号:" Foreground="#FF2AB2E7"/>
<TextBlock Text="{Binding RawMaterialBarrelNum}" Foreground="#FF2AB2E7"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
@@ -514,14 +514,11 @@
<TextBlock Text="{Binding RawMaterialWeight}" Foreground="#FF2AB2E7"/>
</StackPanel>
</StackPanel>

</Expander.Content>
</Expander>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>


</ScrollViewer>



+ 131
- 0
BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs Vedi File

@@ -0,0 +1,131 @@
using BPA.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace BPASmartClient.JXJFoodBigStation.ViewModel
{
public class HKPlcCommMonitorViewModel:ObservableObject
{
HKDeviceStatus DeviceStatus = new HKDeviceStatus();
public HKPlcCommMonitorViewModel()
{
Type type = typeof(DB_Read);
PropertyInfo[] properties = type.GetProperties();
double Offset = 0.0;
string addressPos = "";
ThreadManage.GetInstance().StartLong(new Action(() =>
{
foreach (PropertyInfo mi in properties)
{
PropertyInfo a = DeviceStatus.PlcRead.GetType().GetProperty(mi.Name);
object ab = a.GetValue(DeviceStatus.PlcRead, null);

int index = Array.FindIndex(PlcInfo.ToArray(), p => p.Describe == mi.Name);
if (index != -1)
{
PlcInfo.ElementAt(index).NowValue = ab.ToString();
}
}
Thread.Sleep(10);
}), "plc变量读取");
foreach (PropertyInfo mi in properties)
{
PropertyInfo a = DeviceStatus.PlcRead.GetType().GetProperty(mi.Name);
object ab = a.GetValue(DeviceStatus.PlcRead, null);
if (mi.PropertyType.Name == "Int16")
{
addressPos = "DBD";
Offset = Math.Ceiling(Offset);
if (Offset / 2.0 - Math.Floor(Offset / 2.0) > 0.0)
{
Offset += 1.0;
}
}
else if (mi.PropertyType.Name == "Boolean")
{
addressPos = "DBX";
Offset = Math.Round(Offset, 1);
if ((Offset - Math.Floor(Offset)) >= 0.8)
{
Offset = Math.Ceiling(Offset);
}
}
else if (mi.PropertyType.Name == "Single")
{
addressPos = "DBD";
Offset = Math.Ceiling(Offset);
if (Offset / 2.0 - Math.Floor(Offset / 2.0) > 0.0)
{
Offset += 1.0;
}
}
var num = DeviceStatus.PlcRead;
var res = a.GetCustomAttribute<PlcCommAttribute>();
string describe = "";
if (res != null)
{
describe = res.Describe;
}
else
{
describe = "";
}
PlcInfo.Add(new PlcVarMonitor()
{
SerialNum = PlcInfo.Count + 1,
Variable = mi.Name,
Address = "DB98." + addressPos + string.Format("{0:N1}", Offset),
Type = mi.PropertyType.Name,
Describe = describe,
NowValue = ab.ToString(),
});

if (mi.PropertyType.Name == "Int16")
{
Offset += 2;
}
else if (mi.PropertyType.Name == "Boolean")
{
Offset += 0.1;
}
else if (mi.PropertyType.Name == "Single")
{
Offset += 4;
}
}

SetValueCommand = new RelayCommand<object>((o) =>
{
if (o != null && o is String setValue)
{
int index = Array.FindIndex(PlcInfo.ToArray(), p => p.SetValue == setValue);
if (index != -1)
{
DeviceStatus.HK_PLC_S7.Write(PlcInfo.ElementAt(index).Address, setValue);
}
}
});
}
/*public static string GetPropertyValue<T>( T t,string PropertyName)
{
Type type = typeof(T);

}*/
public ObservableCollection<PlcVarMonitor> PlcInfo { get; set; } = new ObservableCollection<PlcVarMonitor>();

public RelayCommand<object> SetValueCommand { get; set; }

public RelayCommand Connect { get; set; }
}
}

+ 4
- 8
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs Vedi File

@@ -90,27 +90,23 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel
Json<LocalRecipe>.Save();
});

RemoveCommand = new RelayCommand<string>((recipeCode) => {
RemoveCommand = new RelayCommand<string>((recipeCode) =>
{
var res = Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode);
if (res != null)
{
Recipes.Remove(res);
Json<LocalRecipe>.Save();
}
});
}

public RelayCommand<object> DetailsCommand { get; set; }
// public RelayCommand NewSimulateRecipe { get; set; }
public RelayCommand ClearAllRecipe { get; set; }

public RelayCommand NewRecipe { get; set; }
public bool IsUseLocalRecipe { get; set; } = true;
public bool IsUseLocalRecipe { get { return _isUseLocalRecipe; } set { _isUseLocalRecipe = value; OnPropertyChanged(); } }
public bool _isUseLocalRecipe { get; set; }
public RelayCommand<string> RemoveCommand { get; set; }
public ObservableCollection<RecipeData> Recipes { get; set; } = new ObservableCollection<RecipeData>();
}
}

+ 23
- 9
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs Vedi File

@@ -1,4 +1,6 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
@@ -32,22 +34,34 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel

public RecipeSendDownViewModel()
{
StartCommand = new RelayCommand<string>((recipeName) => {
StartCommand = new RelayCommand<string>((recipeName) =>
{
if (recipeName != null)
{
//配方下发逻辑
var res = Recipes.FirstOrDefault(p => p.RecipeName == recipeName);
if (res != null)
if (GVL_BigStation.IsUseLocalRecipe)
{
Json<LocalRecipe>.Data.Recipes.Add(res);
for (int i = 0; i < Json<LocalRecipe>.Data.Recipes.Count; i++)
//配方下发逻辑
var res = Recipes.FirstOrDefault(p => p.RecipeName == recipeName);
if (res != null)
{
foreach (var item in Json<LocalRecipe>.Data.Recipes.ElementAt(i).RawMaterial)
//Json<LocalRecipe>.Data.Recipes.Add(res);
//for (int i = 0; i < Json<LocalRecipe>.Data.Recipes.Count; i++)
//{
// foreach (var item in Json<LocalRecipe>.Data.Recipes.ElementAt(i).RawMaterial)
// {
// item.RawMaterialLocation = Convert.ToInt32(item.RawMaterialName);
// }
//}
if (!ProcessControl.GetInstance.LocalRecipes.Contains(res))
{
item.RawMaterialLocation = Convert.ToInt32(item.RawMaterialName);
ProcessControl.GetInstance.LocalRecipes.Add(res);
MessageNotify.GetInstance.ShowAlarmLog($"手动下发配方:{recipeName}完成");
}
}
MessageNotify.GetInstance.ShowAlarmLog("手动下发配方完成");
}
else
{
NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, App.MainWindow, "警告", $"未处于本地配方模式,无法下发配方");
}
}
});


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/App.xaml.cs Vedi File

@@ -29,8 +29,8 @@ namespace BPASmartClient.JXJFoodSmallStation
MenuInit();
DataInit();
//DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化
ProcessControl.GetInstance.Init();
MainView mv = new MainView();
ProcessControl.GetInstance.Init();
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)


+ 21
- 15
BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs Vedi File

@@ -51,6 +51,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
public void Init()
{
testData();
Json<RemoteRecipeDataColl>.Data.Recipes = Json<LocalRecipeDataColl>.Data.Recipes;
for (int i = 0; i < 16; i++)
{
if (DeviceInquire.GetInstance.GetDevice(i).DeviceName != null)
@@ -1183,21 +1184,26 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
}
private void testData()
{
RawMaterialsNamePos.Add("A10", 1);
RawMaterialsNamePos.Add("A20", 2);
RawMaterialsNamePos.Add("A30", 3);
RawMaterialsNamePos.Add("A40", 4);
RawMaterialsNamePos.Add("A50", 5);
RawMaterialsNamePos.Add("A60", 6);
RawMaterialsNamePos.Add("A70", 7);
RawMaterialsNamePos.Add("A80", 8);
RawMaterialsNamePos.Add("A90", 9);
RawMaterialsNamePos.Add("A100", 10);
RawMaterialsNamePos.Add("A110", 11);
RawMaterialsNamePos.Add("A120", 12);
RawMaterialsNamePos.Add("A130", 13);
RawMaterialsNamePos.Add("A140", 14);
RawMaterialsNamePos.Add("A150", 15);
RawMaterialsNamePos.Add("0041", 1);
RawMaterialsNamePos.Add("0042", 2);
RawMaterialsNamePos.Add("0043", 3);
RawMaterialsNamePos.Add("0044", 4);
RawMaterialsNamePos.Add("0045", 5);
RawMaterialsNamePos.Add("0046", 6);
RawMaterialsNamePos.Add("0047", 7);
RawMaterialsNamePos.Add("0048", 8);
RawMaterialsNamePos.Add("0049", 9);
RawMaterialsNamePos.Add("0050", 10);
RawMaterialsNamePos.Add("0051", 11);
RawMaterialsNamePos.Add("0052", 12);
RawMaterialsNamePos.Add("0053", 13);
RawMaterialsNamePos.Add("0054", 14);
RawMaterialsNamePos.Add("0055", 15);
RawMaterialsNamePos.Add("0056", 15);
RawMaterialsNamePos.Add("0057", 15);
RawMaterialsNamePos.Add("0058", 15);
RawMaterialsNamePos.Add("0059", 15);
RawMaterialsNamePos.Add("0060", 15);
}
}
}

+ 1
- 1
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs Vedi File

@@ -103,7 +103,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
//AlarmHelper<AlarmInfo>.Init();
//AlarmHelper<AlarmInfo>.Alarm.EStop1 = true;

//TestData();
TestData();
IpAddressLines();
DeviceDataInit();
ThreadManage.GetInstance().StartLong(new Action(() =>


+ 4
- 8
BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs Vedi File

@@ -26,14 +26,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens
var Status = this.Siemens_PLC_S7.ReadClass<XL_Status_DB>(2231);
var Finish = this.Siemens_PLC_S7.ReadClass<XL_Finish_DB>(2261);
var DataColl = this.Siemens_PLC_S7.ReadClass<XL_DataColl_DB>(2291);
if (test)
{
for (int i = 0; i < XL_Status.Powder.Length; i++) {

XL_Status.Powder.ElementAt(i).Powder_Name = ""+i;
}
Siemens_PLC_S7.WriteClass<XL_Status_DB>(XL_Status, 2231);
}
if (Start != null && Start is XL_Start_DB st)
{
if (RTrig.GetInstance("DB2201.DBX450.0").Start(GVL_SmallStation.IsAllowSiemensSendRecipe) && GVL_SmallStation.SiemensSendRecipeStatus == 0)
@@ -80,6 +72,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens
}
if (Status != null && Status is XL_Status_DB state)
{
for (int i = 0; i < XL_Status.Powder.Length; i++)
{
XL_Status.Powder[i] = new PowderStatus();
}
XL_Status = state;
if (RTrig.GetInstance("Allow_AGV_Put[0]").Start(Status.AgvRequestPut))
{


+ 6
- 6
BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml Vedi File

@@ -77,17 +77,17 @@
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<WrapPanel>
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方名称:" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="配方名称:" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" />
</WrapPanel>
<WrapPanel Grid.Column="1">
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方编号:" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="配方编号:" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" />
</WrapPanel>

<WrapPanel Grid.Row="1">
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="托盘编号:" />
<TextBlock Grid.Row="1" Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding TrayCode}" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="托盘编号:" />
<TextBlock Grid.Row="1" Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="{Binding TrayCode}" />
</WrapPanel>
<Button Grid.Column="1" Grid.Row="1" Width="100" Command="{Binding ReturnPage}" HorizontalAlignment="Left" Margin="10,0,0,0">返回</Button>


+ 2
- 2
BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs Vedi File

@@ -28,11 +28,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
}
});
devices = DeviceInquire.GetInstance.devices;
foreach (var device in devices)
/*foreach (var device in devices)
{
device.Serial = Convert.ToInt32(device.DeviceName.Substring(1, device.DeviceName.Length - 1)) / 10;
}
devices = new ObservableCollection<Devices>(devices.OrderBy(item => item.Serial));
devices = new ObservableCollection<Devices>(devices.OrderBy(item => item.Serial));*/
}

public RelayCommand<object> ChangeNameCommand { get; set; }


+ 2
- 2
BPASmartClient.Modbus/ModbusTcp.cs Vedi File

@@ -38,7 +38,7 @@ namespace BPASmartClient.Modbus

public Action Disconnect { get; set; }

public bool IsReconnect { get; set; } = true; //true=启用重连,false=禁用重连
public bool IsReconnect { get; set; } = false; //true=启用重连,false=禁用重连

/// <summary>
/// 判断是否连接成功
@@ -430,7 +430,7 @@ namespace BPASmartClient.Modbus
{
commandType = CommandType.Inputs;
}
Show?.Invoke($"成功,地址:{address},值:{value}");
//Show?.Invoke($"成功,地址:{address},值:{value}");
return true;
}
catch (Exception ex)


+ 83
- 0
BPASmartClient.Model/大炒/FryPotMessages.cs Vedi File

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

namespace BPASmartClient.Model.大炒
{
public class FryPotMessages
{
public string GoodName { get; set; }
public string GoodKey { get; set; }
public List<FryPotProcess> fryPotProcesses { get; set; } = new List<FryPotProcess>();
}

public class FryPotProcess
{
/// <summary>
/// 步骤
/// </summary>
public int FryTime { get; set; }
/// <summary>
/// 动作
/// </summary>
public FryAction fryActions { get; set; }
/// <summary>
/// 加热时间 单位s
/// </summary>
public int FryDuration { get; set; } = 0;
/// <summary>
/// 加热挡位 1-5
/// </summary>
public int FryGear { get; set; } = 0;
/// <summary>
/// 搅拌挡位 小炒1-10 大炒1-5
/// </summary>
public int StirGear { get; set; } = 0;
/// <summary>
/// 翻转速度0到800
/// </summary>
public int TurnSpeed { get; set; }= 0;
/// <summary>
/// 炒制位置1到4
/// </summary>
public int FryPosition { get; set; }
/// <summary>
/// 辅料,调料,或者菜品集合
/// </summary>
public List<Accessories> accessories { get; set; } = new List<Accessories>();

}

public class Accessories
{
/// <summary>
/// 位置
/// </summary>
public int Loc { get; set; }
/// <summary>
/// 重量
/// </summary>
public int Qry { get; set; }
}

public enum FryAction
{
冷锅加热,
热油,
加调料,
加辅料,
炒制菜品,
}

public enum FryRepot
{
开始,
热锅,
炒菜,
出餐,
完成,
}
}

+ 14
- 0
BPASmartClient.Model/大炒/LocalFryPotMessage.cs Vedi File

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

namespace BPASmartClient.Model.大炒
{
public class LocalFryPotMessage
{
public ObservableCollection<FryPotMessages> FryPotMessage { get; set; } = new ObservableCollection<FryPotMessages>();
}
}

+ 32
- 0
BPASmartClient.Model/大炒/RobotActionModel.cs Vedi File

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

namespace BPASmartClient.Model.大炒
{
public class RobotAction_Pot
{
public int Pot { get; set; }
public RobotActionModel robotActionModel { get; set; }
}

public enum RobotActionModel
{
无任务,
取1号炒锅荤菜盆倒1号炒锅,
取1号炒锅素菜盆1倒1号炒锅,
取1号炒锅素菜盆2倒1号炒锅,
取1号炒锅调料盆倒入1号炒锅,
取1号炒锅辅料盆1倒入1号炒锅,
取1号空盆出餐,

取2号炒锅荤菜盆1倒2号炒锅 = 20,
取2号炒锅素菜盆1倒2号炒锅 = 21,
取2号炒锅素菜盆2倒2号炒锅 =22,
取2号炒锅调料盆倒入2号炒锅 =23,
取2号炒锅辅料盆1倒入2号炒锅 =24,
取2号空盆出餐 =25,
}
}

+ 281
- 15
BPASmartClient.MorkBF/Control_MorkBF.cs Vedi File

@@ -1,10 +1,13 @@
using BPA.Message;
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Business;
using BPASmartClient.Device;
using BPASmartClient.EventBus;
using BPASmartClient.Helper;
using BPASmartClient.Model;
using BPASmartClient.Model.大炒;
using BPASmartClient.MorkBF.Model;
using BPASmartClient.MorkBF.ViewModel;
using System;
using System.Collections.Generic;
@@ -13,6 +16,9 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static BPASmartClient.EventBus.EventBus;
using static BPASmartClient.Model.大炒.FryPotMessages;
using ActionManage = BPA.Helper.ActionManage;
using ThreadManage = BPA.Helper.ThreadManage;

namespace BPASmartClient.MorkBF
{
@@ -24,7 +30,8 @@ namespace BPASmartClient.MorkBF

public override void DoMain()
{

IsHealth = true;
BPASmartClient.Helper.Json<LocalFryPotMessage>.Read();
MonitorViewModel.DeviceId = DeviceId;
CommandRegist();//调试
ServerInit();
@@ -44,8 +51,6 @@ namespace BPASmartClient.MorkBF
OrderCount++;
DeviceProcessLogShow($"接收到{OrderCount}次订单");

}

});
@@ -60,7 +65,6 @@ namespace BPASmartClient.MorkBF
if (@event is MaterialDeliveryEvent material)
{
orderMaterialDelivery = material.orderMaterialDelivery;

}
});

@@ -132,11 +136,55 @@ namespace BPASmartClient.MorkBF

public override void MainTask()
{
if(morkBF.FirePan1_Order.Count>0&& morkBF.FirePot1_InitCompleted&&morkBF.FirePot2_IsAuto&&!morkBF.FirePan1_Busy)
{
ThreadManage.GetInstance().Start(FirePot1_Process, "炒锅1流程");
}

if(morkBF.RobotActinQueue.Count>0&&! morkBF.Robot_Origin)//机器人在原点为
{
if( morkBF.RobotActinQueue.TryDequeue(out RobotAction_Pot robotAction))
{
morkBF.Robot_IsBusy =true;
RobotProcess(robotAction);
}
}
}

private void FirePot1_Process()
{
if(morkBF.FirePan1_Order.TryDequeue(out FryPotMessages result))
{
morkBF.FirePan1_Busy = true;
foreach (var item in result.fryPotProcesses)
{
switch (item.fryActions)
{
case FryAction.冷锅加热:
FirePot_PotPerHeat(item, 1);
break;

case FryAction.热油:
FirePot_HeatOil(item,1);
break;

case FryAction.加调料:
FirePot_AddSeasoning(item, 1);
break;
case FryAction.加辅料:
break;
case FryAction.炒制菜品:
FirePot_FryFood(item,1);
break;

default:
break;
}
}
}
}

private void FirePot2_Process()
@@ -144,6 +192,192 @@ namespace BPASmartClient.MorkBF
}


#region 炒锅流程功能
/// <summary>
/// 冷锅预热
/// </summary>
private void FirePot_PotPerHeat(FryPotProcess item,int i)
{
if(i == 1)//炒锅1
{
FirePot1_SetFireGear(item.FryGear);
FirePot1_StartFire(true);
}
else if(i == 2)//炒锅2
{
FirePot2_SetFireGear(item.FryGear);
FirePot2_StartFire(true);
}
Thread.Sleep(item.FryDuration);
}

/// <summary>
/// 热油
/// </summary>
private void FirePot_HeatOil(FryPotProcess item, int i)
{
if (item.FryGear != 0)
{
FirePot1_SetFireGear(item.FryGear);//设定加热挡位
FirePot1_StartFire(true);//开启加热
}
if (item.StirGear != 0)
{
FirePot1_SetStirGear(item.StirGear);//设定搅拌挡位
FirePot1_StartFire(true);//开启搅拌
}
Thread.Sleep(item.FryDuration);//加热时间;
}

/// <summary>
/// 加调料
/// </summary>
private void FirePot_AddSeasoning(FryPotProcess item,int i)
{
if(i == 1)
{
morkBF.RobotActinQueue.Enqueue(new RobotAction_Pot { Pot =1,robotActionModel = RobotActionModel.取1号炒锅调料盆倒入1号炒锅});
Thread.Sleep(item.FryDuration);

}

else if(i == 2)
{
morkBF.RobotActinQueue.Enqueue(new RobotAction_Pot { Pot = 2, robotActionModel = RobotActionModel.取2号炒锅调料盆倒入2号炒锅 });
Thread.Sleep(item.FryDuration);
}
}

/// <summary>
/// 加辅料
/// </summary>
private void FirePot_AddAccessories(FryPotProcess item, int i)
{
if (i == 1)
{

morkBF.RobotActinQueue.Enqueue(new RobotAction_Pot { Pot = 1, robotActionModel = RobotActionModel.取1号炒锅辅料盆1倒入1号炒锅 });
Thread.Sleep(item.FryDuration);

}

else if (i == 2)
{
morkBF.RobotActinQueue.Enqueue(new RobotAction_Pot { Pot = 2, robotActionModel = RobotActionModel.取2号炒锅辅料盆1倒入2号炒锅 });
Thread.Sleep(item.FryDuration);
}

}

/// <summary>
/// 炒制菜品
/// </summary>
private void FirePot_FryFood(FryPotProcess item, int i)
{
if (i == 1)
{
morkBF.RobotActinQueue.Enqueue(new RobotAction_Pot { Pot = 1, robotActionModel = (RobotActionModel)item.accessories[0].Loc });
while (!morkBF.FirePot1_CompleteSingle[item.accessories[0].Loc])//取菜信号是否完成
{
Thread.Sleep(100);
}
Thread.Sleep(item.FryDuration);

}

else if (i == 2)
{
morkBF.RobotActinQueue.Enqueue(new RobotAction_Pot { Pot = 2, robotActionModel = (RobotActionModel)(item.accessories[0].Loc+19) });//炒制菜品位置
while (!morkBF.FirePot2_CompleteSingle[item.accessories[0].Loc])//取菜信号是否完成
{
Thread.Sleep(100);
}
Thread.Sleep(item.FryDuration);
}
}
#endregion

/// <summary>
/// 机器人进程
/// </summary>
/// <param name="robotAction"></param>
private void RobotProcess(RobotAction_Pot robotAction)
{
Robot_Write("GI0",(int)robotAction.robotActionModel);
while (morkBF.Robot_ActionCallback != (int)robotAction.robotActionModel)//机器人动作执行完动作反馈
{
Thread.Sleep(100);
}
if(robotAction.Pot == 1)//炒锅1
{
if (robotAction.robotActionModel == RobotActionModel.取1号空盆出餐)
{
Robot_Write("GM521", true);//炒锅去投料位置
while(!morkBF.Robot_ArriveFirePot1)//机器人到位,请求1#炒锅倒菜
{
Thread.Sleep(100);
}
FirePot_Write("M11.6", true);//炒锅去出餐倒料位置
while (!morkBF.FirePot1_PotOnOutFoodPosition)//炒锅在出餐倒料位置反馈
{
Thread.Sleep(1000);
}
Thread.Sleep(20 * 1000);//等待20s出餐

}
else
{
FirePot_Write("M11.7", true);//炒锅去投料位置
while (!morkBF.FirePot1_PotOnIntoFoodPosition)//等待炒锅允许倒料
{
Thread.Sleep(100);
}
Robot_Write("GM520", true);//机器人投料
}
}
else if (robotAction.Pot == 2)
{
if (robotAction.robotActionModel == RobotActionModel.取1号空盆出餐)
{
Robot_Write("GM531", true);//炒锅去投料位置
while (!morkBF.Robot_ArriveFirePot2)//机器人到位,请求1#炒锅倒菜
{
Thread.Sleep(100);
}
FirePot_Write("M16.6", true);//炒锅去出餐倒料位置
while (!morkBF.FirePot2_PotOnOutFoodPosition)//炒锅在出餐倒料位置反馈
{
Thread.Sleep(1000);
}
Thread.Sleep(20 * 1000);//等待20s出餐

}
else
{
FirePot_Write("M16.7", true);
while (!morkBF.FirePot2_PotOnIntoFoodPosition)
{
Thread.Sleep(100);
}
Robot_Write("GM530", true);
}
}
while(!morkBF.Robot_Origin)
{
Thread.Sleep(1000);
}
morkBF.Robot_IsBusy = false;
MessageLog.GetInstance.Show($"机器人完成[{robotAction.robotActionModel.ToString()}]任务");
}

public override void ReadData()
{
GetStatus("M20.0",new Action<object>((o)=>
@@ -228,9 +462,10 @@ namespace BPASmartClient.MorkBF
if (o == null) return;
if (o is bool[] values && values.Length == 7)
{
morkBF.Robot_FirePot1OutMeal = values[0];
morkBF.Robot_FirePot1OutVegetables1 = values[1];
morkBF.Robot_FirePot1OutVegetables2 = values[2];

morkBF.FirePot1_CompleteSingle[0] = values[0];
morkBF.FirePot1_CompleteSingle[1] = values[1];
morkBF.FirePot1_CompleteSingle[2] = values[2];
morkBF.Robot_FirePot1OutSeasoning = values[3];
morkBF.Robot_FirePot1OutAccessories = values[4];
morkBF.Robot_ArriveFirePot1 = values[5];
@@ -243,9 +478,9 @@ namespace BPASmartClient.MorkBF
if (o == null) return;
if (o is bool[] values && values.Length == 7)
{
morkBF.Robot_FirePot2OutMeal = values[0];
morkBF.Robot_FirePot2OutVegetables1 = values[1];
morkBF.Robot_FirePot2OutVegetables2 = values[2];
morkBF.FirePot2_CompleteSingle[0] = values[0];
morkBF.FirePot2_CompleteSingle[1] = values[1];
morkBF.FirePot2_CompleteSingle[2] = values[2];
morkBF.Robot_FirePot2OutSeasoning = values[3];
morkBF.Robot_FirePot2OutAccessories = values[4];
morkBF.Robot_ArriveFirePot2 = values[5];
@@ -319,7 +554,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("VW100", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅1加热启停
@@ -332,6 +567,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("M10.0", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅1设置搅拌挡位
@@ -344,6 +580,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("VW102", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅1搅拌启停
@@ -356,6 +593,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("M10.1", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 设置炒锅1翻转速度
@@ -368,6 +606,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("VW104", value);
}
Thread.Sleep(200);
}
#endregion

@@ -383,7 +622,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("VW130", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅2加热启停
@@ -396,6 +635,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("M15.0", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅2设置搅拌挡位
@@ -408,6 +648,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("VW132", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅2搅拌启停
@@ -420,6 +661,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("M15.1", value);
}
Thread.Sleep(200);
}
/// <summary>
/// 设置炒锅2翻转速度
@@ -432,6 +674,7 @@ namespace BPASmartClient.MorkBF
{
FirePot_Write("VW134", value);
}
Thread.Sleep(200);
}

#endregion
@@ -476,6 +719,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M15.5", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅去位置1
@@ -495,6 +739,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.2", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅去位置2
@@ -514,6 +759,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.3", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅去位置3
@@ -533,6 +779,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.4", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅去位置4
@@ -552,6 +799,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.5", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅去出餐位置
@@ -571,6 +819,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.6", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 炒锅去投料位置
@@ -590,6 +839,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.7", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 出餐启动
@@ -610,6 +860,7 @@ namespace BPASmartClient.MorkBF
}

}
Thread.Sleep(200);
}
/// <summary>
/// 清洗
@@ -622,13 +873,15 @@ namespace BPASmartClient.MorkBF
{
if (i == 1)
{
FirePot_Write("M10.7", true);
if(morkBF.FirePot1_OnOrigin) FirePot_Write("M10.7", true);

}
else if (i == 2)
{
FirePot_Write("M15.7", true);
if (morkBF.FirePot2_OnOrigin) FirePot_Write("M15.7", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 抽水启动
@@ -648,6 +901,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.0", true);
}
}
Thread.Sleep(200);
}
/// <summary>
/// 抽油启动
@@ -667,6 +921,7 @@ namespace BPASmartClient.MorkBF
FirePot_Write("M16.1", true);
}
}
Thread.Sleep(200);
}
#endregion

@@ -677,6 +932,7 @@ namespace BPASmartClient.MorkBF
private void RobotStart()
{
Robot_Write("GM600",true);
Thread.Sleep(200);
}
/// <summary>
/// 机器人停止
@@ -684,6 +940,7 @@ namespace BPASmartClient.MorkBF
private void RobotStop()
{
Robot_Write("GM601", true);
Thread.Sleep(200);
}
/// <summary>
/// 机器人复位
@@ -691,6 +948,7 @@ namespace BPASmartClient.MorkBF
private void RobotReset()
{
Robot_Write("GM602", true);
Thread.Sleep(200);
}
/// <summary>
/// 机器人程序重启
@@ -698,6 +956,7 @@ namespace BPASmartClient.MorkBF
private void RobotProgramStart()
{
Robot_Write("GM603", true);
Thread.Sleep(200);
}
/// <summary>
/// 1号炒锅允许机器人投料(炒锅在投料位给出)
@@ -705,6 +964,7 @@ namespace BPASmartClient.MorkBF
private void Robot_Pot1AllowInMaterail()
{
Robot_Write("GM520", true);
Thread.Sleep(200);
}
/// <summary>
/// 1号炒锅出餐倒料到减速位
@@ -712,6 +972,7 @@ namespace BPASmartClient.MorkBF
private void Robot_Pot1OutFoodInSlowDown()
{
Robot_Write("GM621", true);
Thread.Sleep(200);
}
/// <summary>
/// 1号炒锅出餐倒料完成
@@ -719,6 +980,7 @@ namespace BPASmartClient.MorkBF
private void Robot_Pot1OutFood()
{
Robot_Write("GM522", true);
Thread.Sleep(200);
}
/// <summary>
/// 2号炒锅允许机器人投料(炒锅在投料位给出)
@@ -726,6 +988,7 @@ namespace BPASmartClient.MorkBF
private void Robot_Pot2AllowInMaterail()
{
Robot_Write("GM530", true);
Thread.Sleep(200);
}
/// <summary>
/// 2号炒锅出餐倒料到减速位。开始倒菜
@@ -733,6 +996,7 @@ namespace BPASmartClient.MorkBF
private void Robot_Pot2OutFoodInSlowDown()
{
Robot_Write("GM531", true);
Thread.Sleep(200);
}
/// <summary>
/// 2号炒锅出餐倒料完成
@@ -740,6 +1004,7 @@ namespace BPASmartClient.MorkBF
private void Robot_Pot2OutFood()
{
Robot_Write("GM532", true);
Thread.Sleep(200);
}
/// <summary>
///
@@ -751,6 +1016,7 @@ namespace BPASmartClient.MorkBF
{
Robot_Write("GI0",value);
}
Thread.Sleep(200);
}
#endregion



+ 127
- 0
BPASmartClient.MorkBF/Convert/FryActionToVisibilityConverter.cs Vedi File

@@ -0,0 +1,127 @@
using BPASmartClient.Model.大炒;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace BPASmartClient.MorkBF.Convert
{
public class StirToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Visibility visibility = Visibility.Visible;
if (value != null && value is FryAction fryAction)
{
switch (fryAction)
{
case FryAction.冷锅加热:
visibility = Visibility.Collapsed;
break;
case FryAction.热油:
visibility = Visibility.Visible;
break;
case FryAction.加调料:
visibility = Visibility.Collapsed;
break;
case FryAction.加辅料:
visibility = Visibility.Collapsed;
break;
case FryAction.炒制菜品:
visibility = Visibility.Visible;
break;
default:
break;
}
}
return visibility;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

public class FirePositionToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Visibility visibility = Visibility.Visible;
if (value != null && value is FryAction fryAction)
{
switch (fryAction)
{
case FryAction.冷锅加热:
visibility = Visibility.Visible;
break;
case FryAction.热油:
visibility = Visibility.Visible;
break;
case FryAction.加调料:
visibility = Visibility.Collapsed;
break;
case FryAction.加辅料:
visibility = Visibility.Collapsed;
break;
case FryAction.炒制菜品:
visibility = Visibility.Visible;
break;
default:
break;
}
}
return visibility;
}


public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

public class AccessoriesToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Visibility visibility = Visibility.Visible;
if (value != null && value is FryAction fryAction)
{
switch (fryAction)
{
case FryAction.冷锅加热:
visibility = Visibility.Collapsed;
break;
case FryAction.热油:
visibility = Visibility.Collapsed;
break;
case FryAction.加调料:
visibility = Visibility.Visible;
break;
case FryAction.加辅料:
visibility = Visibility.Visible;
break;
case FryAction.炒制菜品:
visibility = Visibility.Visible;
break;
default:
break;
}
}
return visibility;
}


public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}


+ 48
- 14
BPASmartClient.MorkBF/GVL_MorkBF.cs Vedi File

@@ -1,4 +1,5 @@
using BPASmartClient.Device;
using BPASmartClient.Model.大炒;
using BPASmartClient.MorkBF.Model;
using System;
using System.Collections.Concurrent;
@@ -14,11 +15,15 @@ namespace BPASmartClient.MorkBF
/// <summary>
/// 炒锅1订单队列
/// </summary>
public ConcurrentQueue<BF_Food> FirePan1_Order { get; set; } = new ConcurrentQueue<BF_Food>();
public ConcurrentQueue<FryPotMessages> FirePan1_Order { get; set; } = new ConcurrentQueue<FryPotMessages>();
/// <summary>
/// 炒锅2订单队列
/// </summary>
public ConcurrentQueue<BF_Food> FirePan2_Order { get; set; } = new ConcurrentQueue<BF_Food>();
public ConcurrentQueue<FryPotMessages> FirePan2_Order { get; set; } = new ConcurrentQueue<FryPotMessages>();
/// <summary>
/// 机器人队列
/// </summary>
public ConcurrentQueue<RobotAction_Pot> RobotActinQueue { get; set; } = new ConcurrentQueue<RobotAction_Pot>();
/// <summary>
/// 炒锅1忙碌
/// </summary>
@@ -247,30 +252,39 @@ namespace BPASmartClient.MorkBF
#endregion

#region 机器人数据读取
public bool Robot_IsBusy;


/// <summary>
/// 机器人在原点位
/// </summary>
[VariableMonitor("机器人在原点位", "GM105", "4201")]
public bool Robot_Origin { get; set; }

/// <summary>
/// 1号锅倒荤菜完成
/// </summary>
[VariableMonitor("1号锅倒荤菜完成", "GM500", "4596")]
[VariableMonitor("机器人#1号锅倒荤菜完成", "GM500", "4596")]
public bool Robot_FirePot1OutMeal{ get; set; }
/// <summary>
/// 1号炒锅倒素菜1完成
/// </summary>
[VariableMonitor("1号炒锅倒素菜1完成", "GM501", "4597")]
[VariableMonitor("机器人#1号炒锅倒素菜1完成", "GM501", "4597")]
public bool Robot_FirePot1OutVegetables1{ get; set; }
/// <summary>
/// 1号炒锅倒素菜2完成
/// </summary>
[VariableMonitor("1号炒锅倒素菜2完成", "GM502", "4598")]
[VariableMonitor("机器人#1号炒锅倒素菜2完成", "GM502", "4598")]
public bool Robot_FirePot1OutVegetables2{ get; set; }
/// <summary>
/// 1号炒锅倒调料完成
/// </summary>
[VariableMonitor("1号炒锅倒调料完成", "GM503", "4599")]
[VariableMonitor("机器人#1号炒锅倒调料完成", "GM503", "4599")]
public bool Robot_FirePot1OutSeasoning{ get; set; }
/// <summary>
/// 1号炒锅倒辅料完成
/// </summary>
[VariableMonitor("1号炒锅倒辅料完成", "GM504", "4600")]
[VariableMonitor("机器人#1号炒锅倒辅料完成", "GM504", "4600")]
public bool Robot_FirePot1OutAccessories{ get; set; }
/// <summary>
/// 机器人到位,请求1#炒锅倒菜
@@ -280,7 +294,7 @@ namespace BPASmartClient.MorkBF
/// <summary>
/// 1号炒锅出餐完成
/// </summary>
[VariableMonitor("1号炒锅出餐完成", "GM506", "4602")]
[VariableMonitor("机器人#1号炒锅出餐完成", "GM506", "4602")]
public bool Robot_FirePot1OutFoodComplete{ get; set; }


@@ -290,12 +304,12 @@ namespace BPASmartClient.MorkBF
/// <summary>
/// 2号锅倒荤菜完成
/// </summary>
[VariableMonitor("2号锅倒荤菜完成", "GM510", "4606")]
[VariableMonitor("机器人#2号锅倒荤菜完成", "GM510", "4606")]
public bool Robot_FirePot2OutMeal { get; set; }
/// <summary>
/// 2号炒锅倒素菜1完成
/// </summary>
[VariableMonitor("2号炒锅倒素菜1完成", "GM511", "4607")]
[VariableMonitor("机器人#2号炒锅倒素菜1完成", "GM511", "4607")]
public bool Robot_FirePot2OutVegetables1{ get; set; }
/// <summary>
/// 2号炒锅倒素菜2完成
@@ -305,22 +319,22 @@ namespace BPASmartClient.MorkBF
/// <summary>
/// 2号炒锅倒调料完成
/// </summary>
[VariableMonitor("2号炒锅倒调料完成", "GM513", "4609")]
[VariableMonitor("机器人#2号炒锅倒调料完成", "GM513", "4609")]
public bool Robot_FirePot2OutSeasoning{ get; set; }
/// <summary>
/// 2号炒锅倒辅料完成
/// </summary>
[VariableMonitor("2号炒锅倒辅料完成", "GM514", "4610")]
[VariableMonitor("机器人#2号炒锅倒辅料完成", "GM514", "4610")]
public bool Robot_FirePot2OutAccessories{ get; set; }
/// <summary>
/// 机器人到位,请求1#炒锅倒菜
/// </summary>
[VariableMonitor("机器人到位,请求1#炒锅倒菜", "GM515", "4611")]
[VariableMonitor("机器人#机器人到位,请求1#炒锅倒菜", "GM515", "4611")]
public bool Robot_ArriveFirePot2{ get; set; }
/// <summary>
/// 2号炒锅出餐完成
/// </summary>
[VariableMonitor("2号炒锅出餐完成", "GM516", "4612")]
[VariableMonitor("机器人#2号炒锅出餐完成", "GM516", "4612")]
public bool Robot_FirePot2OutFoodComplete{ get; set; }
/// <summary>
/// 机器人动作反馈
@@ -330,7 +344,27 @@ namespace BPASmartClient.MorkBF

#endregion

public Dictionary<int, bool> FirePot1_CompleteSingle { get; set; }

public Dictionary<int, bool> FirePot2_CompleteSingle { get; set; }


public GVL_MorkBF()
{
FirePot1_CompleteSingle = new Dictionary<int, bool>
{
{1,Robot_FirePot1OutMeal },
{2,Robot_FirePot1OutVegetables1 },
{3,Robot_FirePot1OutVegetables2 },
};
FirePot2_CompleteSingle = new Dictionary<int, bool>
{
{1,Robot_FirePot2OutMeal },
{2,Robot_FirePot2OutVegetables1 },
{3,Robot_FirePot2OutVegetables2 },
};

}

public DateTime FirePan1_Date;
public DateTime FirePan2_Date;


+ 31
- 1
BPASmartClient.MorkBF/Model/BF_Food.cs Vedi File

@@ -17,6 +17,8 @@ namespace BPASmartClient.MorkBF.Model
/// </summary>
public string FoodID { get; set; }

public List<BF_PotAction> PotActions { get; set; } = new List<BF_PotAction>();

}

public class BF_PotAction
@@ -40,7 +42,7 @@ namespace BPASmartClient.MorkBF.Model
/// <summary>
/// 动作
/// </summary>
public string Actions
public PotAction Actions
{
get;
set;
@@ -62,4 +64,32 @@ namespace BPASmartClient.MorkBF.Model
set;
}
}


public enum PotAction
{
加热开启,
加热关闭,
搅拌开启,
搅拌关闭,

加调料,
加菜品,
加辅料,
加热时间,

抽油启动,
抽水启动,
出餐启动,

炒锅回原点,
炒制位置1,
炒制位置2,
炒制位置3,
炒制位置4,
炒锅去出餐倒料位置,
炒锅去投料位置,


}
}

+ 14
- 0
BPASmartClient.MorkBF/Model/Global.cs Vedi File

@@ -0,0 +1,14 @@
using BPASmartClient.Model.大炒;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkBF.Model
{
public class Global
{
public static FryPotMessages GLoFryMessage { get; set; } = new FryPotMessages();
}
}

+ 32
- 6
BPASmartClient.MorkBF/VIew/DebugView.xaml Vedi File

@@ -21,14 +21,40 @@
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<GroupBox Header="炒锅1" FontSize="22">


<WrapPanel Grid.Row="1" Orientation="Horizontal">
<Button Content="添加新菜品" Width="200" Click="Button_Click"/>
<ListBox Grid.Row="1" ItemsSource="{Binding fryPotMessages}">
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<WrapPanel Orientation="Horizontal" IsItemsHost="True"></WrapPanel>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemTemplate>
<DataTemplate>
<Border Margin="5,10">
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/>
</Border.Background>
<StackPanel Orientation="Horizontal" Margin="10">
<TextBlock Text="{Binding GoodName}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="10,0"/>
<Button Content="编辑" Command="{Binding DataContext.MenuEditCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="10,0"/>
<Button Content="删除 " Command="{Binding DataContext.MenuDeleteCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="10,0"/>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<GroupBox Grid.Row="2" Header="炒锅1" FontSize="22">
<WrapPanel Orientation="Horizontal">
<Button Content="复位" Width="110" Margin="10,5" Command="{Binding FirePot_ResetCommand}" CommandParameter="1"/>
<TextBlock Text="加热挡位" Margin="10,5"/>
<ComboBox Width="80" ItemsSource="{Binding FireGear}" Margin="10,5" SelectedItem="{Binding FirePot1_FireGear}"/>
@@ -57,7 +83,7 @@
</WrapPanel>

</GroupBox>
<GroupBox Grid.Row="1" Header="炒锅2" FontSize="22">
<GroupBox Grid.Row="3" Header="炒锅2" FontSize="22">
<WrapPanel Grid.Row="1" Orientation="Horizontal">
<Button Content="复位" Width="110" Margin="10,5" Command="{Binding FirePot_ResetCommand}" CommandParameter="1"/>
<TextBlock Text="加热挡位" Margin="10,5"/>
@@ -86,7 +112,7 @@
<Button Content="炒锅去投料位置" Width="110" Margin="10,5" Command="{Binding FirePot_PotGotoInFoodPositionCommand}" CommandParameter="2"/>
</WrapPanel>
</GroupBox>
<GroupBox Grid.Row="3" Header="机器人" FontSize="22">
<GroupBox Grid.Row="4" Header="机器人" FontSize="22">
<WrapPanel Orientation="Horizontal">
<Button Content="机器人启动" Width="110" Margin="10,5" Command="{Binding RobotStartCommand}"/>
<Button Content="复位" Width="110" Margin="10,5" Command="{Binding RobotResetCommand}"/>


+ 9
- 1
BPASmartClient.MorkBF/VIew/DebugView.xaml.cs Vedi File

@@ -1,4 +1,5 @@
using System;
using BPASmartClient.MorkBF.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -24,5 +25,12 @@ namespace BPASmartClient.MorkBF.VIew
{
InitializeComponent();
}

private void Button_Click(object sender, RoutedEventArgs e)
{
Global.GLoFryMessage = null;
FoodManagerView foodManagerView = new FoodManagerView();
foodManagerView.ShowDialog();
}
}
}

+ 58
- 33
BPASmartClient.MorkBF/VIew/FoodManagerView.xaml Vedi File

@@ -4,47 +4,72 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BPASmartClient.MorkBF.VIew"
xmlns:con="clr-namespace:BPASmartClient.MorkBF.Convert"
xmlns:vm ="clr-namespace:BPASmartClient.MorkBF.ViewModel"
mc:Ignorable="d"
Title="FoodManagerView" Height="450" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent">
Title="FoodManagerView" Height="450" Width="1020" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent">
<Window.DataContext>
<vm:FoodManagerViewModel/>
</Window.DataContext>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<con:StirToVisibilityConverter x:Key="StirToVisibilityConverter" />
<con:FirePositionToVisibilityConverter x:Key="FirePositionToVisibilityConverter" />
<con:AccessoriesToVisibilityConverter x:Key="AccessoriesToVisibilityConverter" />
</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Height="45">
<TextBlock Text="菜品名称:" Margin="10,0"/>
<TextBox Text="{Binding FoodName}" Width="160" Margin="10,0" FontSize="16"/>
<Button Content="添加新步骤" Margin="10,0" Style="{StaticResource ButtonStyle}" Height="36" />
<Button Content="保存" Margin="10,0" Style="{StaticResource ButtonStyle}" Height="36" Width="80"/>
<Button Content="退出" Margin="10,0" Style="{StaticResource ButtonStyle}" Height="36" Width="80"/>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ListBox >
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ComboBox />
<Button Content="删除"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Border CornerRadius="1,60,00,70" Background="#1E1E1E" >
<Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
<Grid.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/不规则矩形.png"/>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Height="45">
<TextBlock Text="菜品名称:" Margin="10,0"/>
<TextBox Text="{Binding GoodName}" Width="160" Margin="10,0" FontSize="16"/>
<Button Content="添加新步骤" Margin="10,0" Style="{StaticResource ButtonStyle}" Height="36" Command="{Binding AddCommand}"/>
<Button Content="保存" Margin="10,0" Style="{StaticResource ButtonStyle}" Height="36" Width="80" Command="{Binding SaveCommand}"/>
<Button Content="退出" Margin="10,0" Style="{StaticResource ButtonStyle}" Height="36" Width="80" Click="Button_Click"/>
</StackPanel>
<Grid Grid.Row="1">
<ListBox ItemsSource="{Binding FryPotProcesses}" FontSize="15">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,10">
<TextBlock Text="步骤--" Margin="10,0,2,0" VerticalAlignment="Center"/>
<TextBlock Text="{Binding FryTime}" VerticalAlignment="Center"/>
<TextBlock Text="加热时间--" Margin="10,0,2,0" VerticalAlignment="Center"/>
<TextBox Text="{Binding FryDuration}" Margin="10,0" Width="40" VerticalAlignment="Center"/>
<TextBlock Text="动作--" Margin="10,0,2,0" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding DataContext.FryAction,RelativeSource={RelativeSource AncestorType=Window,Mode=FindAncestor}}"
SelectedItem="{Binding fryActions}" Width="100" IsReadOnly="True" Margin="2,0,10,0"/>
<TextBlock Text="加热挡位--" Margin="10,0,2,0" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding DataContext.Gear,RelativeSource={RelativeSource AncestorType=Window,Mode=FindAncestor}}"
SelectedItem="{Binding FryGear}" Width="50" Margin="2,0,10,0" />
<TextBlock Text="搅拌挡位--" Margin="10,0,2,0" VerticalAlignment="Center"
Visibility="{Binding fryActions,Converter={StaticResource StirToVisibilityConverter}}"/>
<ComboBox ItemsSource="{Binding DataContext.Gear,RelativeSource={RelativeSource AncestorType=Window,Mode=FindAncestor}}" SelectedItem="{Binding StirGear}" Width="50" Margin="2,0,10,0"
Visibility="{Binding fryActions,Converter={StaticResource StirToVisibilityConverter}}"/>
<TextBlock Text="炒制位置--" Margin="10,0,2,0" VerticalAlignment="Center"
Visibility="{Binding fryActions,Converter={StaticResource FirePositionToVisibilityConverter}}"/>
<ComboBox ItemsSource="{Binding DataContext.PotPostion,RelativeSource={RelativeSource AncestorType=Window,Mode=FindAncestor} }" SelectedItem="{Binding FryPosition}" Width="50" Margin="2,0,10,0"
Visibility="{Binding fryActions,Converter={StaticResource FirePositionToVisibilityConverter}}"/>
<TextBlock Text="物料位置--" Margin="10,0,2,0" VerticalAlignment="Center"
Visibility="{Binding fryActions,Converter={StaticResource AccessoriesToVisibilityConverter}}"/>
<TextBox Text="{Binding accessories[0].Loc}" VerticalAlignment="Center" Width="50"
Visibility="{Binding fryActions,Converter={StaticResource AccessoriesToVisibilityConverter}}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Grid>
</Border>
</Window>

+ 18
- 1
BPASmartClient.MorkBF/VIew/FoodManagerView.xaml.cs Vedi File

@@ -1,4 +1,6 @@
using System;

using BPASmartClient.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -22,6 +24,21 @@ namespace BPASmartClient.MorkBF.VIew
public FoodManagerView()
{
InitializeComponent();
ActionManage.GetInstance.CancelRegister("FoodManagerViewClose");
ActionManage.GetInstance.Register(new Action(()=>
{
this.Close();
}), "FoodManagerViewClose");
}

private void Button_Click(object sender, RoutedEventArgs e)
{
ActionManage.GetInstance.Send("FoodManagerViewClose");
}

private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
}
}

+ 39
- 5
BPASmartClient.MorkBF/ViewModel/DebugViewModel.cs Vedi File

@@ -1,19 +1,50 @@
using System;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPASmartClient.Helper;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using BPASmartClient.Model.大炒;
using BPASmartClient.MorkBF.Model;
using BPASmartClient.MorkBF.VIew;

namespace BPASmartClient.MorkBF.ViewModel
{
[INotifyPropertyChanged]
partial class DebugViewModel
{
{

public ObservableCollection<FryPotMessages> fryPotMessages { get; set; } = Json<LocalFryPotMessage>.Data.FryPotMessage;

[RelayCommand]
private void MenuEdit(object o)
{
if (o == null) return;
if(o is FryPotMessages value)
{
Global.GLoFryMessage = value;
FoodManagerView foodManagerView = new FoodManagerView();
foodManagerView.ShowDialog();
}
}

[RelayCommand]
private void MenuDelete(object o)
{
if (o == null) return;
if (o is FryPotMessages value)
{
fryPotMessages.Remove(value);
}
Json<LocalFryPotMessage>.Save();
}




/// <summary>
/// 加热挡位
/// </summary>
@@ -369,5 +400,8 @@ namespace BPASmartClient.MorkBF.ViewModel
}

#endregion


}
}

+ 93
- 0
BPASmartClient.MorkBF/ViewModel/FoodManagerViewModel.cs Vedi File

@@ -0,0 +1,93 @@
using BPASmartClient.Helper;
using BPASmartClient.Model.大炒;
using BPASmartClient.MorkBF.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.MorkBF.ViewModel
{
[INotifyPropertyChanged]
partial class FoodManagerViewModel
{
/// <summary>
/// 菜品步骤
/// </summary>
public ObservableCollection<FryPotProcess> FryPotProcesses { get; set; } =new ObservableCollection<FryPotProcess>();

public ObservableCollection<FryAction> FryAction { get; set; } = new ObservableCollection<FryAction>();

public ObservableCollection<int> Gear { get; set; } = new ObservableCollection<int>() { 0,1, 2, 3, 4, 5 };

public ObservableCollection<int> PotPostion { get; set; } = new ObservableCollection<int>() { 1, 2,3, 4 };

[ObservableProperty]
private string _goodName;
[RelayCommand]
private void Add()
{
FryPotProcesses.Add(new FryPotProcess() { FryTime = FryPotProcesses.Count + 1 });
}

[RelayCommand]
private void Save()
{
if (string.IsNullOrEmpty(GoodName)) return;
if (Global.GLoFryMessage != null)
{
var res = Json<LocalFryPotMessage>.Data.FryPotMessage.FirstOrDefault(p => p.GoodKey == Global.GLoFryMessage.GoodKey);
if (res != null)
{
res.GoodName = GoodName;
res.fryPotProcesses = FryPotProcesses.ToList();
}
}
else
{
if (Json<LocalFryPotMessage>.Data.FryPotMessage.FirstOrDefault(p => p.GoodName == _goodName) != null) return;
Json<LocalFryPotMessage>.Data.FryPotMessage.Add(new FryPotMessages
{
GoodName = GoodName,
GoodKey = new Guid().ToString(),
fryPotProcesses = FryPotProcesses.ToList()
});
}
Json<LocalFryPotMessage>.Save();
ActionManage.GetInstance.Send("FoodManagerViewClose");
}

[RelayCommand]
private void Delete(object o)
{
if (o == null) return;
if (o is FryPotProcess value)
{
FryPotProcesses.Remove(value);
}
}



public FoodManagerViewModel()
{
foreach(var item in Enum.GetValues(typeof(FryAction)))
{
FryAction.Add((FryAction)item);
}

if (Global.GLoFryMessage != null)//编辑
{
GoodName = Global.GLoFryMessage.GoodName;
FryPotProcesses = new ObservableCollection<FryPotProcess>(Global.GLoFryMessage.fryPotProcesses);
}
}
}
}

+ 1
- 1
BPASmartClient.MorkBF/ViewModel/MonitorViewModel.cs Vedi File

@@ -10,7 +10,7 @@ using System.Collections.ObjectModel;

namespace BPASmartClient.MorkBF.ViewModel
{
public class MonitorViewModel : ObservableObject
public class MonitorViewModel
{
public MonitorViewModel()
{


+ 1
- 0
BPASmartClient.MorkF/Control_MorkF.cs Vedi File

@@ -19,6 +19,7 @@ namespace BPASmartClient.MorkF
{
public class Control_MorkF : BaseDevice
{
/// <summary>
/// while循环最大sleep次数
/// </summary>


+ 3
- 5
BPASmartClient.S7Net/EntityClassResolution.cs Vedi File

@@ -55,9 +55,9 @@ namespace BPASmartClient.S7Net
numBytes += len;
break;
default:
numBytes = GetClassSize(Activator.CreateInstance(type), numBytes, isInnerProperty: true);
if (type.IsClass) IncrementToEven(ref numBytes);
else if (!type.IsPrimitive && !type.IsEnum && type.IsValueType) IncrementToEven(ref numBytes);
numBytes = GetClassSize(Activator.CreateInstance(type), numBytes, isInnerProperty: true);
break;
}

@@ -221,15 +221,13 @@ namespace BPASmartClient.S7Net
break;
default:
{
object obj2 = Activator.CreateInstance(propertyType);
numBytes = FromBytes(obj2, bytes, numBytes);

numBytes = Math.Ceiling(numBytes);
if (numBytes / 2.0 - Math.Floor(numBytes / 2.0) > 0.0)
{
numBytes += 1.0;
}

object obj2 = Activator.CreateInstance(propertyType);
numBytes = FromBytes(obj2, bytes, numBytes);
obj = obj2;
break;
}


+ 8
- 4
BPASmartClient.S7Net/SiemensHelper.cs Vedi File

@@ -2,7 +2,6 @@
using System.Net;
using System.Text;
using BPASmartClient.S7Net;
using System.Text;

namespace BPASmartClient.S7Net
{
@@ -106,12 +105,17 @@ namespace BPASmartClient.S7Net
return $"失败,地址:{address},值:{value},断开连接";
}
}

public void WriteString(int db,string txt, int startAddress = 0)
/// <summary>
///
/// </summary>
/// <param name="db">DB号</param>
/// <param name="txt">字符串</param>
/// <param name="startAddress">字节偏移地址</param>
public void WriteString(int db, string txt, int startAddress = 0)
{
var temp = Encoding.ASCII.GetBytes(txt);
var bytes = S7.Net.Types.S7String.ToByteArray(txt, temp.Length);
myPlc.WriteBytes(DataType.DataBlock,db, startAddress, bytes);
myPlc.WriteBytes(DataType.DataBlock, db, startAddress, bytes);

}
public TResult ReadClass<TResult>(int db, int startByteAdr = 0) where TResult : class, new()


+ 1
- 2
BPASmartClient.ViewModel/FoodMenuViewModel.cs Vedi File

@@ -19,8 +19,7 @@ namespace BPASmartClient.ViewModel

public FoodMenuViewModel()
{
FoodMenus.Add(new FoodMenuModel { GoodKey = "1111", GoodName = "小炒肉" });
FoodMenus.Add(new FoodMenuModel { GoodKey = "222", GoodName = "大炒肉大炒肉大炒肉" });
StartOrder = new RelayCommand<object>((o) =>
{
ActionManage.GetInstance.Send("开始下单", o);


+ 22
- 22
DosingSystem/App.xaml.cs Vedi File

@@ -96,19 +96,19 @@ namespace BPASmartClient.DosingSystem

ParSet.Add(new SubMenumodel()
{
SubMenuName = "设备控制参数设置",
SubMenuName = "设备参数设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.CommParSetView"
});

ParSet.Add(new SubMenumodel()
{
SubMenuName = "出料口管理设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.OutletManagementView"
});
//ParSet.Add(new SubMenumodel()
//{
// SubMenuName = "出料口管理设置",
// SubMenuPermission = new Permission[] { Permission.管理员 },
// AssemblyName = "BPASmartClient.DosingSystem",
// ToggleWindowPath = "View.OutletManagementView"
//});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
@@ -186,13 +186,13 @@ namespace BPASmartClient.DosingSystem
ToggleWindowPath = "Pages.View.DebugLogView"
});

InfoLog.Add(new SubMenumodel()
{
SubMenuName = "报表数据",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.ReportView"
});
//InfoLog.Add(new SubMenumodel()
//{
// SubMenuName = "报表数据",
// SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 },
// AssemblyName = "BPASmartClient.CustomResource",
// ToggleWindowPath = "Pages.View.ReportView"
//});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
@@ -255,13 +255,13 @@ namespace BPASmartClient.DosingSystem
ToggleWindowPath = "Pages.View.UserManagerView"
});

UserManager.Add(new SubMenumodel()
{
SubMenuName = "NFC登录管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.NfcSetView"
});
//UserManager.Add(new SubMenumodel()
//{
// SubMenuName = "NFC登录管理",
// SubMenuPermission = new Permission[] { Permission.管理员 },
// AssemblyName = "BPASmartClient.CustomResource",
// ToggleWindowPath = "Pages.View.NfcSetView"
//});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
{


+ 2
- 12
DosingSystem/Model/DeviceInquire.cs Vedi File

@@ -114,7 +114,7 @@ namespace BPASmartClient.DosingSystem
{
if (!string.IsNullOrEmpty(Json<DevicePar>.Data.BaseParModel.NetworkSegAddress)) IPSegment = Json<DevicePar>.Data.BaseParModel.NetworkSegAddress;
else Json<DevicePar>.Data.BaseParModel.NetworkSegAddress = IPSegment;
//TestData();
TestData();
IpAddressLines();
SiemensDevice.GetInstance.Connect(Json<DevicePar>.Data.BaseParModel.DeviceAddress);
DeviceDataInit();
@@ -197,12 +197,6 @@ namespace BPASmartClient.DosingSystem
DeviceLists[ip].modbusTcp.IsReconnect = false;
App.Current.Dispatcher.Invoke(new Action(() =>
{
//DeviceListViewModel.devices.Add(new Devices()
//{
// DeviceName = DeviceName,
// IpAddress = ip
//});//加入连接的(有名称的)设备列表

devices.Add(new Devices() { DeviceName = DeviceName, IpAddress = ip });

if (TopDeviceCurrentStatuses.Count <= 7)
@@ -244,20 +238,16 @@ namespace BPASmartClient.DosingSystem
DS.modbusTcp.ConnectFail = new Action(() =>
{
if (!InvalidIP.Contains(ip)) InvalidIP.Add(ip);
//MessageLog.GetInstance.ShowAlarmLog($"设备{ip}连接失败");
});

DS.modbusTcp.Disconnect = new Action(() =>
{
if (InvalidIP.Contains(ip)) InvalidIP.Remove(ip);
//var res = DeviceListViewModel.devices.FirstOrDefault(P => P.IpAddress == ip);
var res = devices.FirstOrDefault(P => P.IpAddress == ip);
//if (res != null && DeviceListViewModel.devices.Contains(res))
if (res != null && devices.Contains(res))
{
App.Current.Dispatcher.Invoke(new Action(() =>
{
//DeviceListViewModel.devices.Remove(res);
devices.Remove(res);
var item = Global.DeviceRawMaterials.FirstOrDefault(P => P.RawMaterialName == res.DeviceName);
if (item != null) Global.DeviceRawMaterials.Remove(item);
@@ -307,7 +297,6 @@ namespace BPASmartClient.DosingSystem
modbusTcp.ShowEx = new Action<string>((s) => { MessageNotify.GetInstance.ShowRunLog(s); });
this.DeviceName = DeviceName;
AlarmHelper<AlarmInfo>.Init();

if (modbusTcp.Connected)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
@@ -353,6 +342,7 @@ namespace BPASmartClient.DosingSystem
{
modbusTcp.SetReal(DeviceAddress.WeightSet, Value);//写入配方量
modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入
MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置重量:{Value}");
//配料设备参数写入
var res = Json<DevicePar>.Data.deviceParModels.FirstOrDefault(p => p.MaterialName == DeviceName);
if (res != null)


+ 9
- 3
DosingSystem/View/CommParSetView.xaml Vedi File

@@ -125,7 +125,10 @@
Text="{Binding CommBaseParModel.BlockCylinderCount, UpdateSourceTrigger=PropertyChanged}" />
</Grid>

<Grid Background="Transparent" Width="350" Margin="5">
<Grid
Width="350"
Margin="5"
Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
@@ -146,7 +149,10 @@
Text="{Binding CommBaseParModel.PalletCylinderCount, UpdateSourceTrigger=PropertyChanged}" />
</Grid>

<Grid Background="Transparent" Width="350" Margin="5">
<Grid
Width="350"
Margin="5"
Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
@@ -171,7 +177,7 @@

<!--<Grid Grid.Row="2" Grid.ColumnSpan="4">
<ListView
Grid.Column="1"
Background="Transparent"
BorderBrush="#00BEFA"


+ 466
- 409
DosingSystem/View/ManualControlView.xaml Vedi File

@@ -52,417 +52,474 @@
<UserControl.DataContext>
<vm:ManualControlViewModel />
</UserControl.DataContext>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
<StackPanel Margin="8">

<!--#region 升降气缸-->
<Grid
Name="cy"
Grid.Row="0"
Margin="5"
Visibility="{Binding cylinderModels, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder
Grid.RowSpan="2"
Width="{Binding ElementName=cy, Path=ActualWidth}"
Height="{Binding ElementName=cy, Path=ActualHeight}" />

<StackPanel Background="Transparent">
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,10,0,0"
VerticalAlignment="Top"
FontSize="16"
Foreground="Aqua"
Text="升降气缸控制" />
</Grid>
<ListView
Name="list1"
Grid.Row="1"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding cylinderModels}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Disabled" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />

<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition />
</Grid.RowDefinitions>

<StackPanel
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">

<ToggleButton
Width="100"
Height="30"
Margin="5,0,5,0"
Background="Transparent"
Command="{Binding SystemStart}"
Content="{Binding SystemControlText}"
FontSize="20"
Style="{StaticResource SwitchToggleButtonStyle1}" />

<ToggleButton
Width="100"
Height="30"
Margin="5,0,5,0"
Background="Transparent"
Command="{Binding ModelSwitch}"
Content="{Binding ModelSwitchText}"
FontSize="20"
Style="{StaticResource SwitchToggleButtonStyle1}" />

<!--<Button
Width="150"
Height="40"
Margin="10,0,10,0"
Command="{Binding SystemStart}"
Content="{Binding SystemControlText}"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />

<Button
Width="150"
Height="40"
Margin="10,0,10,0"
Command="{Binding ModelSwitch}"
Content="{Binding ModelSwitchText}"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />-->

</StackPanel>

<ScrollViewer
Grid.Row="1"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Hidden">
<StackPanel Margin="8">

<!--#region 升降气缸-->
<Grid
Name="cy"
Grid.Row="0"
Margin="5"
Visibility="{Binding cylinderModels, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder
Grid.RowSpan="2"
Width="{Binding ElementName=cy, Path=ActualWidth}"
Height="{Binding ElementName=cy, Path=ActualHeight}" />

<StackPanel Background="Transparent">
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,10,0,0"
VerticalAlignment="Top"
FontSize="16"
Foreground="Aqua"
Text="升降气缸控制" />
</Grid>
<ListView
Name="list1"
Grid.Row="1"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding cylinderModels}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Disabled" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />

<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />

<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Grid>
<!--#endregion-->
<!--#region 阻挡气缸-->
<Grid
Name="zd"
Grid.Row="1"
Margin="5"
Visibility="{Binding BlockCylinders, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder Width="{Binding ElementName=zd, Path=ActualWidth}" Height="{Binding ElementName=zd, Path=ActualHeight}" />
<StackPanel>
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="Aqua"
Text="阻挡气缸控制" />
</Grid>
<ListView
Name="list2"
Grid.Row="1"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding BlockCylinders}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />
<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />
<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />
<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />
<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Grid>
<!--#endregion-->
<!--#region 阻挡气缸-->
<Grid
Name="zd"
Grid.Row="1"
Margin="5"
Visibility="{Binding BlockCylinders, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder Width="{Binding ElementName=zd, Path=ActualWidth}" Height="{Binding ElementName=zd, Path=ActualHeight}" />
<StackPanel>
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="Aqua"
Text="阻挡气缸控制" />
</Grid>
<ListView
Name="list2"
Grid.Row="1"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding BlockCylinders}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />
<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />
<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Grid>
<!--#endregion-->
<!--#region 托盘气缸-->
<Grid
Name="tp"
Grid.Row="2"
Margin="5"
Visibility="{Binding PalletCylinders, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder
Grid.RowSpan="2"
Width="{Binding ElementName=tp, Path=ActualWidth}"
Height="{Binding ElementName=tp, Path=ActualHeight}" />
<StackPanel>
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="Aqua"
Text="托盘气缸控制" />
</Grid>
<ListView
Name="list3"
Grid.Row="2"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding PalletCylinders}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />
<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />
<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />
<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />
<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Grid>
<!--#endregion-->
<!--#region 托盘气缸-->
<Grid
Name="tp"
Grid.Row="2"
Margin="5"
Visibility="{Binding PalletCylinders, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder
Grid.RowSpan="2"
Width="{Binding ElementName=tp, Path=ActualWidth}"
Height="{Binding ElementName=tp, Path=ActualHeight}" />
<StackPanel>
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="Aqua"
Text="托盘气缸控制" />
</Grid>
<ListView
Name="list3"
Grid.Row="2"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding PalletCylinders}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />
<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />
<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Grid>
<!--#endregion-->
<!--#region 上下桶工位气缸-->
<Grid
Name="onGrid"
Grid.Row="2"
Margin="5"
Visibility="{Binding OtherHandCylinders, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder
Grid.RowSpan="2"
Width="{Binding ElementName=onGrid, Path=ActualWidth}"
Height="{Binding ElementName=onGrid, Path=ActualHeight}" />
<StackPanel>
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="Aqua"
Text="上下桶工位气缸控制" />
</Grid>
<ListView
Name="list4"
Grid.Row="2"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding OtherHandCylinders}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />
<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />
<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />
<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />
<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Grid>
<!--#endregion-->
<!--#region 上下桶工位气缸-->
<Grid
Name="onGrid"
Grid.Row="2"
Margin="5"
Visibility="{Binding OtherHandCylinders, Converter={StaticResource CountIsVisiableConvert}}">
<pry:ImageBorder
Grid.RowSpan="2"
Width="{Binding ElementName=onGrid, Path=ActualWidth}"
Height="{Binding ElementName=onGrid, Path=ActualHeight}" />
<StackPanel>
<Grid Height="40">
<Image
Margin="2,3,0,0"
HorizontalAlignment="Left"
Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
<TextBlock
Margin="10,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Foreground="Aqua"
Text="上下桶工位气缸控制" />
</Grid>
<ListView
Name="list4"
Grid.Row="2"
Margin="0,0,0,20"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding OtherHandCylinders}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />

<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />

<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>


</Grid>
<!--#endregion-->

</StackPanel>
</ScrollViewer>
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />

<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />

<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />

<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>


</Grid>
<!--#endregion-->

</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>

+ 38
- 12
DosingSystem/View/RecipeControlView.xaml Vedi File

@@ -880,7 +880,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="{Binding RecipStatus,Converter={StaticResource RecipeStatusConvert}}"
Foreground="{Binding RecipStatus, Converter={StaticResource RecipeStatusConvert}}"
Text="{Binding RecipStatus}" />
<Border
Grid.ColumnSpan="10"
@@ -912,26 +912,29 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>

<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="auto" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition />
<RowDefinition Height="10" />
</Grid.RowDefinitions>

<Image
Grid.RowSpan="3"
Source="/BPASmartClient.CustomResource;component/Image/组合边框2.1.png"
Grid.RowSpan="5"
Source="/BPASmartClient.CustomResource;component/Image/背景边框4.png"
Stretch="Fill" />
<Image
Grid.RowSpan="3"
<!--<Image
Grid.RowSpan="4"
Source="/BPASmartClient.CustomResource;component/Image/组合边框2.png"
Stretch="Fill" />
Stretch="Fill" />-->

<TextBlock
Grid.Row="0"
Margin="10,15,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="0,5,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Top"
FontSize="18"
Foreground="#FF2AB2E7"
Text="{Binding RecipeName}" />
@@ -939,7 +942,9 @@
<!--#region 表格标题栏设置-->
<Grid
Grid.Row="1"
Margin="5,8"
Height="30"
Margin="5,0"
VerticalAlignment="Top"
Background="#ff0C255F">

<Grid.ColumnDefinitions>
@@ -1011,6 +1016,27 @@
</ItemsControl.ItemTemplate>
</ItemsControl>

<Button
Grid.Row="3"
Height="40"
Margin="20,0,20,0"
VerticalContentAlignment="Center"
Command="{Binding DataContext.CancelRecipeCommand, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
CommandParameter="{Binding}"
Content="取消配料"
FontSize="16"
Style="{StaticResource ControlButtonStyle}" />

<!--<Button
Grid.Row="3"
Height="40"
Margin="5,0,5,0"
Command="{Binding CancelRecipeCommand}"
CommandParameter="{Binding}"
Content="取消配料"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />-->

</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>


+ 2
- 2
DosingSystem/View/RecipeSettingsView.xaml Vedi File

@@ -65,14 +65,14 @@
IcoText="&#xe626;"
Style="{StaticResource IcoButtonStyle}" />-->

<Button
<!--<Button
Width="140"
Height="30"
Margin="10 0"
Command="{Binding NewMaterital}"
Content="新建原料"
FontSize="16"
Style="{StaticResource ImageButtonStyle}" />
Style="{StaticResource ImageButtonStyle}" />-->

<Button
Width="140"


+ 39
- 0
DosingSystem/ViewModel/ManualControlViewModel.cs Vedi File

@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using BPA.Helper;
using System.Collections.ObjectModel;
using System.Threading;
using BPASmartClient.S7Net;

namespace BPASmartClient.DosingSystem.ViewModel
{
@@ -13,6 +14,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
public ManualControlViewModel()
{
Init();
for (int i = 0; i < Json<DevicePar>.Data.BaseParModel.LiftCylinderCount; i++)
{
cylinderModels.Add(new CylinderModel()
@@ -98,6 +100,19 @@ namespace BPASmartClient.DosingSystem.ViewModel
}
});

SystemStart = new BPARelayCommand(() =>
{
SiemensDevice.GetInstance.MySiemens.Write("M10.0", SystemControlText == "停止" ? false : true);
var res = SiemensDevice.GetInstance.MySiemens.Read<bool>("M10.0");
SystemControlText = res ? "停止" : "启动";
});
ModelSwitch = new BPARelayCommand(() =>
{
SiemensDevice.GetInstance.MySiemens.Write("M10.1", ModelSwitchText == "手动" ? true : false);
var res = SiemensDevice.GetInstance.MySiemens.Read<bool>("M10.1");
ModelSwitchText = res ? "自动" : "手动";
});

ThreadManage.GetInstance().StartLong(new Action(() =>
{
for (int i = 0; i < cylinderModels.Count; i++)
@@ -115,10 +130,22 @@ namespace BPASmartClient.DosingSystem.ViewModel
OtherHandCylinders.ElementAt(1).RightTog = GlobalDevice.PlcData.UnderCylinderDetection.HomeSignal;
OtherHandCylinders.ElementAt(1).LeftTog = GlobalDevice.PlcData.UnderCylinderDetection.InPlaceSignal;

//SystemControlText = GlobalDevice.PlcData.SystemStartOrStop ? "停止系统" : "启动系统";
//ModelSwitchText = GlobalDevice.PlcData.HandOrAuto ? "自动" : "手动";

Thread.Sleep(100);
}), "手动气缸状态监控");
}

private void Init()
{
var res = SiemensDevice.GetInstance.MySiemens.Read<bool>("M10.0");
SystemControlText = res ? "停止" : "启动";

var res1 = SiemensDevice.GetInstance.MySiemens.Read<bool>("M10.1");
ModelSwitchText = res1 ? "自动" : "手动";
}

/// <summary>
/// 升降气缸
/// </summary>
@@ -143,6 +170,18 @@ namespace BPASmartClient.DosingSystem.ViewModel

public BPARelayCommand<object> Close { get; set; }

public BPARelayCommand SystemStart { get; set; }
public BPARelayCommand ModelSwitch { get; set; }


public string SystemControlText { get { return _mSystemControlText; } set { _mSystemControlText = value; OnPropertyChanged(); } }
private string _mSystemControlText;


public string ModelSwitchText { get { return _mModelSwitchText; } set { _mModelSwitchText = value; OnPropertyChanged(); } }
private string _mModelSwitchText;


}

public class CylinderModel : NotifyBase


+ 0
- 4
DosingSystem/ViewModel/NewRecipeViewModel.cs Vedi File

@@ -118,7 +118,6 @@ namespace BPASmartClient.DosingSystem.ViewModel
MessageNotify.GetInstance.ShowDialog("配方名称已经存在!", DialogType.Warning);
return;
}

ObservableCollection<RawMaterialModel> TempRawMaterials = new ObservableCollection<RawMaterialModel>();
RawMaterials.ToList()?.ForEach(item =>
{
@@ -134,7 +133,6 @@ namespace BPASmartClient.DosingSystem.ViewModel
}
TempRawMaterials.Add(item);
});

Json<LocaPar>.Data.Recipes.Add(new RecipeModel()
{
RecipeName = RecipeName,
@@ -143,8 +141,6 @@ namespace BPASmartClient.DosingSystem.ViewModel
Json<LocaPar>.Save();
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"新建配方成功!");
}


ActionManage.GetInstance.Send("CloseNewRecipeView");
});



+ 44
- 9
DosingSystem/ViewModel/RecipeControlViewModel.cs Vedi File

@@ -14,6 +14,8 @@ using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.Model.柔性味魔方;
using BPASmartClient.Model;
using System.Diagnostics;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System.Data.SqlClient;

namespace BPASmartClient.DosingSystem.ViewModel
{
@@ -25,10 +27,40 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
StartCommand = new BPARelayCommand<object>(RecipeIssued);
ChangeRecipeStateCommand = new BPARelayCommand<object>(ChangeRecipeState);
CancelRecipeCommand = new BPARelayCommand<object>(CancelRecipe);
RecipeRun();
RecipeStatusInquire();
}

private async void CancelRecipe(object o)
{
if (o != null && o is RecipeModel recipe)
{
var res = MessageNotify.GetInstance.ShowDialog($"是否取消配方 【{recipe.RecipeName}】制作", DialogType.Warning);
if (res)
{
int index = Recipes.ToList().FindIndex(p => p.RecipeName == recipe.RecipeName);
if (index >= 0 && index < Recipes.Count)
{
await Task.Factory.StartNew(new Action(() =>
{

Recipes.ElementAt(index).IsEnable = true;
Json<LocaPar>.Data.Recipes.ElementAt(index).IsEnable = true;
Recipes.ElementAt(index).Are.Set();
App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); }));
SiemensDevice.GetInstance.MySiemens.Write("M10.5", true);
Thread.Sleep(1000);
SiemensDevice.GetInstance.MySiemens.Write("M10.5", false);
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方 [{recipe.RecipeName}] 取消成功");
}));
}
}

}

}

/// <summary>
/// 配方下发
/// </summary>
@@ -45,11 +77,11 @@ namespace BPASmartClient.DosingSystem.ViewModel
{
string ip = Recipes.ElementAt(index).RawMaterials.ElementAt(i).DeviceIp;
var device = DeviceInquire.GetInstance.GetDevice(ip);
//if (!device.IsConnected)
//{
// MessageNotify.GetInstance.ShowDialog($"设备 【{device.DeviceName}】 未连接,不允许下发此配方", DialogType.Error);
// return;
//}
if (!device.IsConnected)
{
MessageNotify.GetInstance.ShowDialog($"设备 【{device.DeviceName}】 未连接,不允许下发此配方", DialogType.Error);
return;
}
}
}
Recipes.ElementAt(index).IsEnable = false;
@@ -112,7 +144,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
int a = data.SetBitValue((byte)tInfo.ElementAt(i).ElementAt(m).Loc, true);
byte[] test1 = a.ToBytes(BPA.Helper.DataFormat.ABCD);
int item = test1.ToInt();
SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBD{2 + (tempDevice.DeviceNum - 1) * 4}", item);
SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBD{2 + (tempDevice.DeviceNum - 1) * 4}", item, 5);
MessageNotify.GetInstance.ShowRunLog($"下发配方DB4.DBD{2 + (tempDevice.DeviceNum - 1) * 4} :{item.ToBinString()}");
}
}
@@ -129,7 +161,7 @@ namespace BPASmartClient.DosingSystem.ViewModel
}
}
}
SiemensDevice.GetInstance.MySiemens.Write("DB4.DBD198", BarrelNum.Count);//配方使用桶数写入
SiemensDevice.GetInstance.MySiemens.Write("DB4.DBD198", BarrelNum.Count, 5);//配方使用桶数写入
/*if (recipeData.Count <= 0)
{
MessageNotify.GetInstance.ShowRunLog("配方数据解析失败");
@@ -453,8 +485,9 @@ namespace BPASmartClient.DosingSystem.ViewModel
int a = 0.SetBitValue((byte)(DeviceNum), true);
byte[] test1 = a.ToBytes(BPA.Helper.DataFormat.ABCD);
int item = test1.ToInt();
SiemensDevice.GetInstance.MySiemens.Write("DB4.DBD130", item);
MessageNotify.GetInstance.ShowRunLog($"DB4.DBD130:{item.ToBinString()}");
SiemensDevice.GetInstance.MySiemens.Write("DB4.DBD130", item, 5);
//MessageNotify.GetInstance.ShowRunLog($"DB4.DBD130:{item.ToBinString()}");
MessageNotify.GetInstance.ShowRunLog($"DB4.DBD130:{item}");
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方{Recipes.ElementAt(i).RawMaterials.ElementAt(loc).DeviceIp},出料完成,状态复位");
}
}
@@ -538,6 +571,8 @@ namespace BPASmartClient.DosingSystem.ViewModel

public BPARelayCommand<object> ChangeRecipeStateCommand { get; set; }

public BPARelayCommand<object> CancelRecipeCommand { get; set; }

public static ObservableCollection<RecipeModel> Recipes { get; set; } = Json<LocaPar>.Data.Recipes;

public static string CurrentRecipeName { get { return _RecipeName; } set { _RecipeName = value; OnStaticPropertyChanged(); } }


+ 14
- 14
FryPot_DosingSystem/App.xaml.cs Vedi File

@@ -51,7 +51,7 @@ namespace FryPot_DosingSystem
//开启实时PLC数据读取
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序
AlarmHelper<AlarmInfo>.Init();//报警实时监控
HubHelper.GetInstance.Connect("172.16.12.100", 8089);
Task.Run(()=> { HubHelper.GetInstance.Connect("172.16.12.100", 8089); });

}
else
@@ -164,7 +164,7 @@ namespace FryPot_DosingSystem
ParamSet.Add(new SubMenumodel()
{
SubMenuName = "PLC变量配置",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.VariableConfigView"
});
@@ -204,7 +204,7 @@ namespace FryPot_DosingSystem
});
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "炒锅状态数据监控",
SubMenuName = "炒锅状态数据",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员, Permission.观察员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.FryPotMonitorView"
@@ -253,13 +253,13 @@ namespace FryPot_DosingSystem
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserManageView"
});
UserManager.Add(new SubMenumodel()
{
SubMenuName = "NFC登录设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.NfcSetView"
});
//UserManager.Add(new SubMenumodel()
//{
// SubMenuName = "NFC登录设置",
// SubMenuPermission = new Permission[] { Permission.管理员 },
// AssemblyName = "BPASmartClient.CustomResource",
// ToggleWindowPath = "Pages.View.NfcSetView"
//});
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe66d;",
@@ -269,11 +269,11 @@ namespace FryPot_DosingSystem
subMenumodels = UserManager,
});
#endregion
#region 调试界面
#region 手动控制界面
ObservableCollection<SubMenumodel> DebugManage = new ObservableCollection<SubMenumodel>();
DebugManage.Add(new SubMenumodel()
{
SubMenuName = "单一流程调试",
SubMenuName = "手动控制",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.DebugView"
@@ -282,7 +282,7 @@ namespace FryPot_DosingSystem
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe683;",
MainMenuName = "调试界面",
MainMenuName = "操作界面",
Alias = "Debug Management",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 },
subMenumodels = DebugManage,
@@ -291,7 +291,7 @@ namespace FryPot_DosingSystem
}
private void LoginDataInite()
{
//Config.GetInstance.Init();//用户数据初始化
Config.GetInstance.Init();//用户数据初始化
Json<RecipeManage>.Read();
}
}


+ 271
- 126
FryPot_DosingSystem/Control/DeviceOperate.cs Vedi File

@@ -140,21 +140,56 @@ namespace FryPot_DosingSystem.Control
IsConfig = false;
MessageNotify.GetInstance.ShowRunLog("PLC变量配置加载失败:文件无数据,请重新配置并重启软件");
}
//Variables.Add(new PlcVariableModel() { Address = "D2001", Length = 8 });//1号线体滚筒工位号
//Variables.Add(new PlcVariableModel() { Address = "D2011", Length = 8 });//2号线体滚筒工位号
//Variables.Add(new PlcVariableModel() { Address = "D2021", Length = 8 });//3号线体滚筒工位号
//Variables.Add(new PlcVariableModel() { Address = "D2031", Length = 9 });//输送线出料状态
//Variables.Add(new PlcVariableModel() { Address = "D2040", Length = 5 });//炒锅1-5进料滚筒运行
//Variables.Add(new PlcVariableModel() { Address = "D2045", Length = 5 });//炒锅1-5进料到位信号
//Variables.Add(new PlcVariableModel() { Address = "D2050", Length = 5 });//炒锅1-5空桶到位信号
//Variables.Add(new PlcVariableModel() { Address = "D2055", Length = 5 });//炒锅1-5空桶呼叫AGV
//Variables.Add(new PlcVariableModel() { Address = "D2060", Length = 5 });//炒锅1空桶洗桶呼叫AGV
//Variables.Add(new PlcVariableModel() { Address = "D2065", Length = 5 });//炒锅1-5空桶滚筒运行
//Variables.Add(new PlcVariableModel() { Address = "D2070", Length = 5 });//炒锅1-5滚筒故障信号
//Variables.Add(new PlcVariableModel() { Address = "D2075", Length = 1 });//洗桶进桶滚筒运行信号
//Variables.Add(new PlcVariableModel() { Address = "D2076", Length = 1 });//洗桶出桶呼叫AGV
//Variables.Add(new PlcVariableModel() { Address = "D2077", Length = 1 });// 洗桶出桶滚筒运行信号
//Variables.Add(new PlcVariableModel() { Address = "D2078", Length = 3 });//1-3滚筒线体配方完成信号
//消息注册
modbus.ShowEx += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryOneModbus.ShowEx += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryTwoModbus.ShowEx += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryThreeModbus.ShowEx += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryFourModbus.ShowEx += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryFiveModbus.ShowEx += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});

modbus.Show += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryOneModbus.Show += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryTwoModbus.Show += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryThreeModbus.Show += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryFourModbus.Show += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
fryFiveModbus.Show += new Action<string>((s) =>
{
if (s != null) MessageNotify.GetInstance.ShowRunLog(s);
});
}
public void Connect()
{
@@ -176,17 +211,28 @@ namespace FryPot_DosingSystem.Control
string DeviceName = devices.Devices[i].DeviceName;
switch (DeviceName)
{
case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("滚筒线PLC连接成功"); break;
case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); break;
case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); break;
case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); break;
case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC连接成功"); break;
case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC连接成功"); break;
case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break;
case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break;
case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break;
case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break;
case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break;
case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break;
}

}


if (modbus.Connected)
MessageNotify.GetInstance.ShowRunLog("滚筒线PLC连接成功");
if (fryOneModbus.Connected)
MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC连接成功");
if (fryTwoModbus.Connected)
MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC连接成功");
if (fryThreeModbus.Connected)
MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC连接成功");
if (fryFourModbus.Connected)
MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC连接成功");
if (fryFiveModbus.Connected)
MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC连接成功");
}
}
}
@@ -198,30 +244,39 @@ namespace FryPot_DosingSystem.Control
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//滚筒线
Connected = modbus.Connected;
if (Connected)
try
{
foreach (var item in Variables)
Connected = modbus.Connected;
if (Connected)
{
var res = modbus.Read(item.Address, item.Length);//读取plc数据
if (Data.ContainsKey(item.Address))
{
Data[item.Address] = res;
}
else
foreach (var item in Variables)
{
Data.TryAdd(item.Address, res);
var res = modbus.Read(item.Address, item.Length);//读取plc数据
if (Data.ContainsKey(item.Address))
{
Data[item.Address] = res;
}
else
{
Data.TryAdd(item.Address, res);
}
}
}


}
else
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "滚筒输送线");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port));
Thread.Sleep(10000);
}
}
else
catch (Exception)
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "滚筒输送线");
if (res != null)
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("滚筒线PLC重连成功");

// throw;
}
Thread.Sleep(10);
}), $"滚筒线实时数据读取线程");
@@ -231,151 +286,195 @@ namespace FryPot_DosingSystem.Control

ThreadManage.GetInstance().StartLong(new Action(() =>
{
//炒锅1
FryOneConnected = fryOneModbus.Connected;
if (FryOneConnected)
try
{
foreach (var item in FryOneVariables)
//炒锅1
FryOneConnected = fryOneModbus.Connected;
if (FryOneConnected)
{
var res = fryOneModbus.Read(item.Address, item.Length);//读取plc数据
if (FryOneData.ContainsKey(item.Address))
foreach (var item in FryOneVariables)
{
FryOneData[item.Address] = res;
}
else
{
FryOneData.TryAdd(item.Address, res);
var res = fryOneModbus.Read(item.Address, item.Length);//读取plc数据
if (FryOneData.ContainsKey(item.Address))
{
FryOneData[item.Address] = res;
}
else
{
FryOneData.TryAdd(item.Address, res);
}
}
//Thread.Sleep(50);

}
//Thread.Sleep(50);
else
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅1");
if (res != null)
fryOneModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port));

Thread.Sleep(10000);
}
}
else
catch (Exception)
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅1");
if (res != null)
fryOneModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC重连成功");

//throw;
}
Thread.Sleep(10);
}), $"炒锅1实时数据读取线程");
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//炒锅2
FryTwoConnected = fryTwoModbus.Connected;
if (FryTwoConnected)
try
{
foreach (var item in FryTwoVariables)
//炒锅2
FryTwoConnected = fryTwoModbus.Connected;
if (FryTwoConnected)
{
var res = fryTwoModbus.Read(item.Address, item.Length);//读取plc数据
if (FryTwoData.ContainsKey(item.Address))
foreach (var item in FryTwoVariables)
{
FryTwoData[item.Address] = res;
}
else
{
FryTwoData.TryAdd(item.Address, res);
var res = fryTwoModbus.Read(item.Address, item.Length);//读取plc数据
if (FryTwoData.ContainsKey(item.Address))
{
FryTwoData[item.Address] = res;
}
else
{
FryTwoData.TryAdd(item.Address, res);
}
}
}


else
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅2");
if (res != null)
fryTwoModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port));
Thread.Sleep(10000);
}
}
else
catch (Exception)
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅2");
if (res != null)
fryTwoModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC重连成功");

//throw;
}
Thread.Sleep(10);
}), $"炒锅2实时数据读取线程");
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//炒锅3
FryThreeConnected = fryThreeModbus.Connected;
if (FryThreeConnected)
try
{
foreach (var item in FryThreeVariables)
FryThreeConnected = fryThreeModbus.Connected;
if (FryThreeConnected)
{
var res = fryThreeModbus.Read(item.Address, item.Length);//读取plc数据
if (FryThreeData.ContainsKey(item.Address))
{
FryThreeData[item.Address] = res;
}
else
foreach (var item in FryThreeVariables)
{
FryThreeData.TryAdd(item.Address, res);
var res = fryThreeModbus.Read(item.Address, item.Length);//读取plc数据
if (FryThreeData.ContainsKey(item.Address))
{
FryThreeData[item.Address] = res;
}
else
{
FryThreeData.TryAdd(item.Address, res);
}
}
}
//Thread.Sleep(50);
//Thread.Sleep(50);

}
else
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅3");
if (res != null)
fryThreeModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port));
Thread.Sleep(10000);
}
}
else
catch (Exception)
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅3");
if (res != null)
fryThreeModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC重连成功");

//throw;
}
Thread.Sleep(10);
}), $"炒锅3实时数据读取线程");
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//炒锅4
FryFourConnected = fryFourModbus.Connected;
if (FryFourConnected)
try
{
foreach (var item in FryFourVariables)
//炒锅4
FryFourConnected = fryFourModbus.Connected;
if (FryFourConnected)
{
var res = fryFourModbus.Read(item.Address, item.Length);//读取plc数据
if (FryFourData.ContainsKey(item.Address))
{
FryFourData[item.Address] = res;
}
else
foreach (var item in FryFourVariables)
{
FryFourData.TryAdd(item.Address, res);
var res = fryFourModbus.Read(item.Address, item.Length);//读取plc数据
if (FryFourData.ContainsKey(item.Address))
{
FryFourData[item.Address] = res;
}
else
{
FryFourData.TryAdd(item.Address, res);
}
}
}
//Thread.Sleep(50);
//Thread.Sleep(50);

}
else
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅4");
if (res != null)
fryFourModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port));
Thread.Sleep(10000);
}
}
else
catch (Exception)
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅4");
if (res != null)
fryFourModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC重连成功");

//throw;
}
Thread.Sleep(10);
}), $"炒锅4实时数据读取线程");
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//炒锅5
FryFiveConnected = fryFiveModbus.Connected;
if (FryFiveConnected)
try
{
foreach (var item in FryFiveVariables)
//炒锅5
FryFiveConnected = fryFiveModbus.Connected;
if (FryFiveConnected)
{
var res = fryFiveModbus.Read(item.Address, item.Length);//读取plc数据
if (FryFiveData.ContainsKey(item.Address))
{
FryFiveData[item.Address] = res;
}
else
foreach (var item in FryFiveVariables)
{
FryFiveData.TryAdd(item.Address, res);
var res = fryFiveModbus.Read(item.Address, item.Length);//读取plc数据
if (FryFiveData.ContainsKey(item.Address))
{
FryFiveData[item.Address] = res;
}
else
{
FryFiveData.TryAdd(item.Address, res);
}
}
}
// Thread.Sleep(50);
// Thread.Sleep(50);

}
else
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅5");
if (res != null)
fryFiveModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port));
Thread.Sleep(10000);
}
}
else
catch (Exception)
{
DeviceManage devices = Json<DeviceManage>.Data;
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅5");
if (res != null)
fryFiveModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC重连成功");

// throw;
}
Thread.Sleep(10);
}), $"炒锅5实时数据读取线程");
@@ -414,6 +513,16 @@ namespace FryPot_DosingSystem.Control
{
fryOneModbus.Write(address,value);
}
/// <summary>
/// 炒锅1工艺目标重量偏差
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
public void WritePotOneRealPlcData(string address, float value)
{
fryOneModbus.SetReal(address, value);
}

/// <summary>
/// 炒锅2工艺数据
/// </summary>
@@ -425,6 +534,15 @@ namespace FryPot_DosingSystem.Control

}
/// <summary>
/// 炒锅2工艺目标重量偏差
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
public void WritePotTwoRealPlcData(string address, float value)
{
fryTwoModbus.SetReal(address, value);
}
/// <summary>
/// 炒锅3工艺数据
/// </summary>
/// <param name="address"></param>
@@ -435,6 +553,15 @@ namespace FryPot_DosingSystem.Control

}
/// <summary>
/// 炒锅3工艺目标重量偏差
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
public void WritePotThreeRealPlcData(string address, float value)
{
fryThreeModbus.SetReal(address, value);
}
/// <summary>
/// 炒锅4工艺数据
/// </summary>
/// <param name="address"></param>
@@ -445,6 +572,15 @@ namespace FryPot_DosingSystem.Control
fryFourModbus.Write(address,value);
}
/// <summary>
/// 炒锅4工艺目标重量偏差
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
public void WritePotFourRealPlcData(string address, float value)
{
fryFourModbus.SetReal(address, value);
}
/// <summary>
/// 炒锅5工艺数据
/// </summary>
/// <param name="address"></param>
@@ -454,6 +590,15 @@ namespace FryPot_DosingSystem.Control
fryFiveModbus.Write(address, value);

}
/// <summary>
/// 炒锅5工艺目标重量偏差
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
public void WritePotFiveRealPlcData(string address, float value)
{
fryFiveModbus.SetReal(address, value);
}
public ConcurrentDictionary<string, object> GetAllData()
{
return Data;


+ 1799
- 676
FryPot_DosingSystem/Control/DosingLogicControl.cs
File diff soppresso perché troppo grande
Vedi File


+ 7
- 1
FryPot_DosingSystem/Control/GlobalVariable.cs Vedi File

@@ -131,6 +131,7 @@ namespace FryPot_DosingSystem.Control
public bool LoadRoller { get; set; }

public bool AgvToFryPot { get; set; }

public bool PotOneInputMaterialArrive { get; set; }
public bool PotOneOutputRollerArrive { get; set; }
@@ -160,14 +161,19 @@ namespace FryPot_DosingSystem.Control
public int LOneMaterialNum { get; set; } = 0;
public int LOneFryPotSerial { get; set; } = 0;
public int LOneCurrentCookingStep { get; set; } = 0;
public int LFourCurrentCookingStep { get; set; } = 0;
public bool agvArriveUpLoad { get; set; }
public bool agvArriveUnLoad { get; set; }
public bool agvFryPotEmptyRollerArrive { get; set; }
public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public bool agvLineOneLoadCom { get; set; }//线体1上料完成
public bool agvLineOneLoadCom { get; set; }//线体1满料桶上料完成
//2022.11.1 新增


public int LTwoMaterialNum { get; set; } = 0;
public int LTwoFryPotSerial { get; set; } =0;
public int LFiveCurrentCookingStep { get; set; } = 0;
public int LTwoCurrentCookingStep { get; set; } = 0;
public bool agvArriveLTwoUpLoad { get; set; }
public bool LTwoagvArriveUnLoad { get; set; }


+ 2
- 0
FryPot_DosingSystem/Model/FlowProcessManage.cs Vedi File

@@ -11,6 +11,8 @@ namespace FryPot_DosingSystem.Model
internal class FlowProcessManage:ObservableObject
{
public string RecipeName { get; set; }
public float targetWeightOffset { get { return _targetWeightOffset; } set { _targetWeightOffset = value;OnPropertyChanged(); }}
private float _targetWeightOffset;
public ObservableCollection<FlowProcessModel> fpModels { get; set; } = new ObservableCollection<FlowProcessModel>();
}
}

+ 6
- 1
FryPot_DosingSystem/Model/FlowProcessModel.cs Vedi File

@@ -30,11 +30,16 @@ namespace FryPot_DosingSystem.Model
public double FrySpeed { get { return _frySpeed; }set { _frySpeed = value;OnPropertyChanged(); } }
private double _frySpeed;
/// <summary>
/// 炒制重量
/// 添加重量
/// </summary>
public double FryWeight { get { return _fryMaterialWeight; } set { _fryMaterialWeight = value; OnPropertyChanged(); } }
private double _fryMaterialWeight;
/// <summary>
/// 目标重量
/// </summary>
public ushort TargeWeight { get { return _targetWeight; }set { _targetWeight = value;OnPropertyChanged(); } }
private ushort _targetWeight;
/// <summary>
/// 炒制温度
/// </summary>
public double FryTemperature { get { return _fryTemperature; } set { _fryTemperature = value;OnPropertyChanged(); } }


+ 136
- 92
FryPot_DosingSystem/View/AgvView.xaml Vedi File

@@ -566,7 +566,7 @@
</Setter.Value>
</Setter>
</Style>

<Style x:Key="停车位" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF1F4D69"/>
@@ -1344,7 +1344,7 @@
<Grid>

<!--#region 测试按钮-->
<Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="100,0,100,80" Grid.Column="2">
<!--<Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="100,0,100,80" Grid.Column="2">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="0"/>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,20,20,0" Orientation="Horizontal">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="AGV模拟测试" Margin="20,20,20,5" Width="35" FontSize="20" Foreground="#FFFCD5B5" />
@@ -1353,6 +1353,7 @@
<TextBox x:Name="tcz_text" Margin="5">1</TextBox>
<Button Margin="5" Click="Button_Click" Tag="设置有车" Cursor="Hand">设置有车</Button>
<Button Margin="5" Click="Button_Click" Tag="设置无车" Cursor="Hand">设置无车</Button>
</StackPanel>

<StackPanel>
@@ -1395,7 +1396,7 @@
</StackPanel>

</StackPanel>
</Grid>
</Grid>-->


<!--#endregion-->
@@ -1530,124 +1531,166 @@
<TextBox Style="{StaticResource 炒锅}" Text="{Binding wokModel_5.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBlock Style="{DynamicResource 80号字体样式}" FontSize="16" Width="18" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(5)号</TextBlock>
</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="0">
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="0" Height="360">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="一号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="105"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="一号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
Text="{Binding wokModel_1.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Tag="{Binding wokModel_1.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding wokModel_1.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
<ListBox ItemsSource="{Binding wokModel_1.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<Grid Grid.Row="1">
<ListBox x:Name="potOne" ItemsSource="{Binding wokModel_1.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>

</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="1">
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="1" Height="360">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="二号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="105"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="二号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
Text="{Binding wokModel_2.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Tag="{Binding wokModel_2.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding wokModel_2.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
<ListBox ItemsSource="{Binding wokModel_2.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<Grid Grid.Row="1">
<ListBox x:Name="potTwo" ItemsSource="{Binding wokModel_2.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="2">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="三号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="2" Height="360">

<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10" />
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="105"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel >
<TextBlock Style="{DynamicResource 80号字体样式}" Text="三号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
Text="{Binding wokModel_3.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Tag="{Binding wokModel_3.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding wokModel_3.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
<ListBox ItemsSource="{Binding wokModel_3.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<Grid Grid.Row="1">
<ListBox x:Name="potThree" ItemsSource="{Binding wokModel_3.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>

</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="3">
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="3" Height="360">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="四号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="105"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="四号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
Text="{Binding wokModel_4.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Tag="{Binding wokModel_4.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding wokModel_4.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
<ListBox ItemsSource="{Binding wokModel_4.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<Grid Grid.Row="1">
<ListBox x:Name="potFour" ItemsSource="{Binding wokModel_4.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" />
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Grid>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="4">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="五号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="4" Height="360">
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10" />
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="105"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="五号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" />
<StackPanel Orientation="Horizontal" Margin="20,5,20,0">
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" />
<TextBlock Style="{DynamicResource 80号字体样式}"
Text="{Binding wokModel_5.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Tag="{Binding wokModel_5.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding wokModel_5.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" />
<ListBox ItemsSource="{Binding wokModel_5.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10">
<Grid Grid.Row="1">
<ListBox x:Name="potFive" ItemsSource="{Binding wokModel_5.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="15,5,15,5">
@@ -1657,8 +1700,9 @@
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</ListBox>
</Grid>
</Grid>
</Grid>
</Grid>

@@ -1733,7 +1777,7 @@
<LinearGradientBrush>
<GradientStop Offset="0.3" Color="Gray"/>
<GradientStop Offset="0.7" Color="White"/>
</LinearGradientBrush>
</Path.Fill>
<Path.Data>


+ 200
- 166
FryPot_DosingSystem/View/AgvView.xaml.cs Vedi File

@@ -1,4 +1,6 @@
using FryPot_DosingSystem.AGV;

using BPASmartClient.Helper;
using FryPot_DosingSystem.AGV;
using FryPot_DosingSystem.ViewModel;
using System;
using System.Collections.Generic;
@@ -23,177 +25,209 @@ namespace FryPot_DosingSystem.View
/// </summary>
public partial class AgvView : UserControl
{
private static readonly object O_lock = new object();
public AgvView()
{
InitializeComponent();
this.DataContext = AgvViewModel.GetInstance();
控制命令.ItemsSource = AgvViewModel.GetInstance().GetCommand();
}
// 控制命令.ItemsSource = AgvViewModel.GetInstance().GetCommand();

private void Button_Click(object sender, RoutedEventArgs e)
{
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-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Start);
break;
case "停止":
try
{
id = int.Parse(liaotong_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
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;
case "启动炒锅":
try
{
id = int.Parse(guntongchaoguo_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Start);
break;
case "停止炒锅":
try
{
id = int.Parse(guntongchaoguo_text.Text.ToString());
}
catch (Exception ex)
{
MessageBox.Show("只能输入 1-4 的数字!");
return;
}
AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Stop);
break;
case "清洗桶数":
AgvViewModel.GetInstance().SetCleanRollerNum(2);
break;
}
}
}
}
//public void PotDisplay(object num)
//{
// lock (O_lock)
// {
// switch (num)
// {
// case 1:
// potOne.Items.MoveCurrentToLast();
// potOne.ScrollIntoView(potOne.Items.CurrentItem); break;
// case 2:
// potTwo.Items.MoveCurrentToLast();
// potTwo.ScrollIntoView(potTwo.Items.CurrentItem); break;
// case 3:
// potThree.Items.MoveCurrentToLast();
// potThree.ScrollIntoView(potThree.Items.CurrentItem); break;
// case 4:
// potFour.Items.MoveCurrentToLast();
// potFour.ScrollIntoView(potFour.Items.CurrentItem); break;
// case 5:
// potFive.Items.MoveCurrentToLast();
// potFive.ScrollIntoView(potFive.Items.CurrentItem); break;

// }
// }

//}



//private void Button_Click(object sender, RoutedEventArgs e)
//{
// 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-4 的数字!");
// return;
// }
// AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Start);
// break;
// case "停止":
// try
// {
// id = int.Parse(liaotong_text.Text.ToString());
// }
// catch (Exception ex)
// {
// MessageBox.Show("只能输入 1-4 的数字!");
// 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;
// case "启动炒锅":
// try
// {
// id = int.Parse(guntongchaoguo_text.Text.ToString());
// }
// catch (Exception ex)
// {
// MessageBox.Show("只能输入 1-4 的数字!");
// return;
// }
// AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Start);
// break;
// case "停止炒锅":
// try
// {
// id = int.Parse(guntongchaoguo_text.Text.ToString());
// }
// catch (Exception ex)
// {
// MessageBox.Show("只能输入 1-4 的数字!");
// return;
// }
// AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Stop);
// break;
// case "清洗桶数":
// AgvViewModel.GetInstance().SetCleanRollerNum(2);
// break;
// }
// }
// }
//}
}
}

+ 236
- 66
FryPot_DosingSystem/View/DebugView.xaml Vedi File

@@ -11,18 +11,24 @@
<vm:DebugViewModel/>
</UserControl.DataContext>
<UserControl.Resources>
<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="Width" Value="100"></Setter>
<Setter Property="Height" Value="30"/>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="Orange"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Margin" Value="3,3"/>
<Setter Property="Foreground" Value="SkyBlue"/>
<Setter Property="FontSize" Value="13"/>
</Style>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<!--<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="Width" Value="100"></Setter>
<Setter Property="Height" Value="30"/>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="Orange"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Margin" Value="3,3"/>
<Setter Property="Foreground" Value="SkyBlue"/>
<Setter Property="FontSize" Value="13"/>
</Style>-->
</ResourceDictionary>
</UserControl.Resources>

<Grid>
@@ -30,47 +36,54 @@
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<UniformGrid Columns="2">
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink">
<GroupBox Grid.Column="1" Header="1号滚筒线" Foreground="Aqua" BorderBrush="Pink">
<WrapPanel Orientation="Horizontal">
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineRunning}"></Button>
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>-->
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineRunning}"></Button>
-->
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>-->
<!--
<ComboBox SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding LineOneRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体1任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button>
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EmptyRollerCleanTaskRestart}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>-->
<Button Margin="3,3" Content="线体1任务重置" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button>

<Button Margin="3,3" Content="空桶清洗任务重置" Width="140" VerticalAlignment="Top" Command="{Binding EmptyRollerCleanTaskRestart}"/>

<Button Content="线体1出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_34" Width="145"/>
<Button Content="线体1出桶复位" Width="140" Click="Button_Click_15" Margin="3,3" VerticalAlignment="Top" />

<Button Content="AGV线体1上料就位" Margin="3,3" Width="120" Command="{Binding AGVLOneArrive}"/>

<Button Content="AGV线体1空桶上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveLineOneEmptyRollerLoc}"/>


<!--<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体1到炒锅1" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/>
<Button Content="线体1到炒锅4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click"/>
<Button Content="线体2到炒锅2" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_1"/>
<Button Content="线体2到炒锅5" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_2"/>
<Button Content="线体3到炒锅3" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_3"/>
<Button Content="炒锅1到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_4"/>
<Button Content="炒锅2到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_5"/>
<Button Content="炒锅3到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_6"/>
<Button Content="炒锅4到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_7"/>
<Button Content="炒锅5到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_8"/>
<Button Content="线体1到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_9"/>
<Button Content="线体2到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_10"/>
<Button Content="线体3到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_11"/>
<Button Content="清洗到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_12"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>-->

</WrapPanel>


</GroupBox>
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体1上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLOneArrive}"/>
<GroupBox Grid.Column="2" Header="2号滚筒线" Foreground="Aqua">

<WrapPanel Orientation="Horizontal">
<Button Margin="3,3" Content="线体2任务重置" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button>
<Button Content="空桶清洗任务重置" Width="140" Margin="3,3" VerticalAlignment="Top" Command="{Binding LineTwoEmptyRollerCleanTaskRestart}"/>
<Button Content="线体2出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_35" Width="145"/>
<Button Content="线体2出桶复位" Width="140" Click="Button_Click_16" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV线体2上料就位" Margin="3,3" Width="120" Command="{Binding AGVLTwoArrive}"/>
<Button Content="AGV线体2空桶上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveLineTwoEmptyRollerLoc}"/>
<!--
<Button Content="AGV线体1上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineOneLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotDownArrive}">
</Button>
@@ -86,33 +99,41 @@
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
</UniformGrid>
</UniformGrid>
<UniformGrid Columns="2" Grid.Row="1">
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink">
<GroupBox Grid.Column="1" Header="3号滚筒线" Foreground="Aqua" BorderBrush="Pink">
<WrapPanel Orientation="Horizontal">
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineTwoRunning}"></Button>

<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineTwoRunning}"></Button>
-->
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>-->
<!--
<ComboBox SelectionChanged="ComboBox_SelectionChanged_1" ItemsSource="{Binding LineTwoRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体2任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button>
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoEmptyRollerCleanTaskRestart}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>-->
<Button Content="线体3任务重置" Margin="3,3" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button>
<Button Content="空桶清洗任务重置" Width="140" Margin="3,3" VerticalAlignment="Top" Command="{Binding LineThreeEmptyRollerCleanTaskRestart}"/>
<Button Content="线体3出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_36" Width="145"/>
<Button Content="线体3出桶复位" Width="140" Click="Button_Click_17" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV线体3上料就位" Margin="3,3" Width="120" Command="{Binding AGVLThreeArrive}"/>
<Button Content="AGV线体3空桶上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/>
<!--<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua">
<GroupBox Grid.Column="2" Header="回桶线" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体2上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLTwoArrive}"/>
<Button Content="回桶线进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_44" Width="145"/>
<Button Content="回桶线信号复位" Width="140" Click="Button_Click_13" Margin="3,3" VerticalAlignment="Top" />
<!--
<Button Content="AGV线体2上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineTwoLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotTwoDownArrive}">
</Button>
@@ -128,31 +149,159 @@
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
</UniformGrid>
<UniformGrid Columns="2" Grid.Row="2">
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink">
<GroupBox Grid.Column="1" Header="1号炒锅" Foreground="Aqua" BorderBrush="Pink">
<WrapPanel Orientation="Horizontal">
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button>
<Button Content="炒锅1料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_38" Width="145"/>
<Button Content="炒锅1进桶复位" Width="140" Click="Button_Click_18" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅1空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_29" Width="145"/>
<Button Content="炒锅1出桶复位" Width="140" Click="Button_Click_23" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅1配方复位" Width="140" Click="Button_Click_45" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV炒锅1下料就位" RenderTransformOrigin="0.5,0.5" Margin="3,3" Width="145" Command="{Binding AGVFryPotDownArrive}"/>
<Button Content="AGV炒锅1空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotUpArrive}"/>
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button>
-->
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>-->
<!--
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>-->


<!--<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
<GroupBox Grid.Column="2" Header="2号炒锅" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="炒锅2料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_39" Width="145"/>
<Button Content="炒锅2进桶复位" Width="140" Click="Button_Click_19" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅2空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_30" Width="145"/>
<Button Content="炒锅2出桶复位" Width="140" Click="Button_Click_24" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅2配方复位" Width="140" Click="Button_Click_46" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV炒锅2下料就位" Margin="3,3" RenderTransformOrigin="0.5,0.5" Width="145" Command="{Binding AGVFryPotTwoDownArrive}"/>
<Button Content="AGV炒锅2空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotTwoUpArrive}"/>
<!--<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/>
<Button Content="AGV线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}">
</Button>
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotThreeUpArrive}"/>
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotThreeGetEmptyRoller}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体3任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button>
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeEmptyRollerCleanTaskRestart}"/>
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体3空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/>
<Button Content="AGV线体3空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineThreeLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocCom}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
</UniformGrid>
<UniformGrid Columns="2" Grid.Row="3">
<GroupBox Grid.Column="1" Header="3号炒锅" Foreground="Aqua" BorderBrush="Pink">
<WrapPanel Orientation="Horizontal">
<Button Content="炒锅3料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_40" Width="145"/>
<Button Content="炒锅3进桶复位" Width="140" Click="Button_Click_20" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅3空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_31" Width="145"/>
<Button Content="炒锅3出桶复位" Width="140" Click="Button_Click_25" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅3配方复位" Width="140" Click="Button_Click_47" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV炒锅3下料就位" RenderTransformOrigin="0.5,0.5" Margin="3,3" Width="145" Command="{Binding AGVFryPotThreeDownArrive}"/>
<Button Content="AGV炒锅3空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotThreeUpArrive}"/>
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button>
-->
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>-->
<!--
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>-->


<!--<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
<GroupBox Grid.Column="2" Header="4号炒锅" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="炒锅4料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_41" Width="145"/>
<Button Content="炒锅4进桶复位" Width="140" Click="Button_Click_21" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅4空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_32" Width="145"/>
<Button Content="炒锅4出桶复位" Width="140" Click="Button_Click_26" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅4配方复位" Width="140" Click="Button_Click_48" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV炒锅4下料就位" RenderTransformOrigin="0.5,0.5" Margin="3,3" Width="145" Command="{Binding AGVFryPotDownArrive}"/>
<Button Content="AGV炒锅4空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotUpArrive}"/>
<!--<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/>
<Button Content="AGV线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}">
</Button>
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotThreeUpArrive}"/>
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotThreeGetEmptyRoller}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体3空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/>
<Button Content="AGV线体3空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineThreeLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocCom}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel>-->
</WrapPanel>
</GroupBox>

</UniformGrid>
<UniformGrid Columns="2" Grid.Row="4">
<GroupBox Grid.Column="1" Header="5号炒锅" Foreground="Aqua" BorderBrush="Pink">
<WrapPanel Orientation="Horizontal">
<Button Content="炒锅5料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_42" Width="145"/>
<Button Content="炒锅5进桶复位" Width="140" Click="Button_Click_22" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅5空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_33" Width="145"/>
<Button Content="炒锅5出桶复位" Width="140" Click="Button_Click_27" Margin="3,3" VerticalAlignment="Top" />
<Button Content="炒锅5配方复位" Width="140" Click="Button_Click_49" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV炒锅5下料就位" Margin="3,3" RenderTransformOrigin="0.5,0.5" Width="145" Command="{Binding AGVFryPotTwoDownArrive}"/>
<Button Content="AGV炒锅5空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotTwoUpArrive}"/>
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button>
-->
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>-->
<!--
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>-->


<!--<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua">
<GroupBox Grid.Column="2" Header="洗桶机" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/>

<Button Content="洗桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_43" Width="145"/>
<Button Content="洗桶机进桶信号复位" Width="140" Click="Button_Click_14" Margin="3,3" VerticalAlignment="Top" />
<Button Content="洗桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_37" Width="145"/>
<Button Content="洗桶机出桶信号复位" Width="140" Click="Button_Click_28" Margin="3,3" VerticalAlignment="Top" />
<Button Content="AGV空桶清洗上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<!--<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/>
<Button Content="AGV线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}">
</Button>
@@ -168,10 +317,31 @@
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel>
</WrapPanel>-->
</WrapPanel>
</GroupBox>
</UniformGrid>
<GroupBox Grid.Row="5" Header="AGV路径手动调度" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="线体1到炒锅1" Margin="5,3" VerticalAlignment="Top" Command="{Binding AgvDebug}"/>
<Button Content="线体1到炒锅4" Margin="5,3" VerticalAlignment="Top" Click="Button_Click"/>
<Button Content="线体2到炒锅2" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_1"/>
<Button Content="线体2到炒锅5" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_2"/>
<Button Content="线体3到炒锅3" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_3"/>
<Line Stroke="Transparent" StrokeThickness="2" X1="0" X2="1720" Y1="0" Y2="0"/>
<Button Content="炒锅1到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_4"/>
<Button Content="炒锅2到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_5"/>
<Button Content="炒锅3到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_6"/>
<Button Content="炒锅4到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_7"/>
<Button Content="炒锅5到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_8"/>
<Line Stroke="Transparent" StrokeThickness="2" X1="0" X2="1720" Y1="0" Y2="0"/>
<Button Content="线体1到洗桶机" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_9"/>
<Button Content="线体2到洗桶机" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_10"/>
<Button Content="线体3到洗桶机" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_11"/>
<Button Content="洗桶机到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_12"/>

</WrapPanel>
</GroupBox>
</Grid>

</UserControl>
</UserControl>

+ 340
- 2
FryPot_DosingSystem/View/DebugView.xaml.cs Vedi File

@@ -1,10 +1,12 @@
using BPASmartClient.AGV;
using BPASmartClient.Helper;
using FryPot_DosingSystem.Control;
using FryPot_DosingSystem.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -127,7 +129,343 @@ namespace FryPot_DosingSystem.View
AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(Guid.NewGuid().ToString("D"));

}

/// <summary>
/// 回桶线信号复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_13(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1067",0);
}
/// <summary>
/// 空桶洗桶信号复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_14(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1065", 0);
}
/// <summary>
/// 线体1AGV进料复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_15(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1052", 0);
}
/// <summary>
/// 线体2AGV进料复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_16(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1053", 0);
}
/// <summary>
/// 线体3AGV进料复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_17(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1054", 0);
}
/// <summary>
/// 炒锅1进桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_18(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1055", 0);
}
/// <summary>
/// 炒锅2进桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_19(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1056", 0);
}
/// <summary>
/// 炒锅3进桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_20(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1057", 0);
}
/// <summary>
/// 炒锅4进桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_21(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1058", 0);
}
/// <summary>
/// 炒锅5进桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_22(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1059", 0);
}
/// <summary>
/// 炒锅1出桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_23(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1060", 0);
}
/// <summary>
/// 炒锅2出桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_24(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1061", 0);
}
/// <summary>
/// 炒锅3出桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_25(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1062", 0);
}
/// <summary>
/// 炒锅4出桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_26(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1063", 0);
}
/// <summary>
/// 炒锅5出桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_27(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1064", 0);
}
/// <summary>
/// 洗桶机出桶复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_28(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1066", 0);
}
/// <summary>
/// 炒锅1空桶AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_29(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1060", 1);
}
/// <summary>
/// 炒锅2空桶AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_30(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1061", 1);
}
/// <summary>
/// 炒锅3空桶AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_31(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1062", 1);
}
/// <summary>
/// 炒锅4空桶AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_32(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1063", 1);
}
/// <summary>
/// 炒锅5空桶AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_33(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1064", 1);
}
/// <summary>
/// 线体1AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_34(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1052", 1);
}
/// <summary>
/// 线体2AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_35(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1053", 1);
}
/// <summary>
/// 线体3AGV到位信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_36(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1054", 1);
}
/// <summary>
/// 洗桶机出桶g
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_37(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1066", 1);
}
/// <summary>
/// 炒锅1进桶信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_38(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1055", 1);
}
/// <summary>
/// 炒锅2进桶信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_39(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1056", 1);
}
/// <summary>
/// 炒锅3进桶信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_40(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1057", 1);
}
/// <summary>
/// 炒锅4进桶信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_41(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1058", 1);
}
/// <summary>
/// 炒锅5进桶信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_42(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1059", 1);
}
/// <summary>
/// 洗桶机进桶信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_43(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1065", 1);
}
/// <summary>
/// 回桶线进桶信号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_44(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePlcData("D1067", 1);
}
/// <summary>
/// 炒锅1配方复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_45(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePotOnePlcData("D2999",1);
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotOnePlcData("D2999", 0); }));
}
/// <summary>
/// 炒锅2配方复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_46(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 1);
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 0); }));
}
/// <summary>
/// 炒锅3配方复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_47(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePotThreePlcData("D2999", 1);
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotThreePlcData("D2999", 0); }));
}
/// <summary>
/// 炒锅4配方复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_48(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePotFourPlcData("D2999", 1);
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotFourPlcData("D2999", 0); }));
}
/// <summary>
/// 炒锅5配方复位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click_49(object sender, RoutedEventArgs e)
{
DeviceOperate.GetInstance.WritePotFivePlcData("D2999", 1);
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotFivePlcData("D2999", 0); }));
}
}
}

+ 23
- 13
FryPot_DosingSystem/View/FlowProcessView.xaml Vedi File

@@ -7,7 +7,7 @@
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
mc:Ignorable="d"
Title="FlowProcessView" Height="650" Width="940" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True">
Title="FlowProcessView" Height="675" Width="1075" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True">
<Window.DataContext>
<vm:FlowProcessSetViewModel/>
</Window.DataContext>
@@ -389,6 +389,7 @@
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="40"/>
@@ -407,12 +408,13 @@
<Button Content="取消" Height="30" Width="100" Margin="0,0,10,0" Background="Transparent" FontSize="18" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Command="{Binding CloseWindowCommand}"></Button>

</StackPanel>
<Grid Grid.Row="2" Background="#FF2AB2E7" Margin="0,0,0,8">
<Grid Grid.Row="2" Background="#FF2AB2E7" Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="87"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="92"/>
<ColumnDefinition Width="92"/>
<ColumnDefinition Width="112"/>
<ColumnDefinition Width="112"/>
<ColumnDefinition Width="92"/>
<ColumnDefinition Width="92"/>
<ColumnDefinition Width="92"/>
@@ -425,23 +427,30 @@
<GridSplitter BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="1" Text="原料/桶号设定" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="1" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="2" Text="速度设定" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/>
<TextBlock Grid.Column="2" Text="速度(Hz)" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="2" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="3" Text="重量设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18" ></TextBlock>
<TextBlock Grid.Column="3" Text="添加重量(Kg)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18" ></TextBlock>
<GridSplitter Grid.Column="3" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="4" Text="温度设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<TextBlock Grid.Column="4" Text="目标重量(Kg)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18" ></TextBlock>
<GridSplitter Grid.Column="4" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="5" Text="时间设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<TextBlock Grid.Column="5" Text="温度(℃)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="5" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="6" Text="小火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<TextBlock Grid.Column="6" Text="时间(M)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="6" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="7" Text="火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<TextBlock Grid.Column="7" Text="火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="7" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="8" Text="火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<TextBlock Grid.Column="8" Text="火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="8" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="9" Text="强火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<TextBlock Grid.Column="9" Text="大火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="9" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="10" Text="强火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
</Grid>
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden">
<StackPanel Grid.Row="3" VerticalAlignment="Center" Orientation="Horizontal" Margin="0,0,0,5">
<TextBlock Text="目标重量偏差设置:" FontSize="20" Foreground="#FF2AB2E7" VerticalAlignment="Center"/>
<TextBox Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#e69519" Cursor="Hand" Text="{Binding targetWeightOffset}" FontSize="18" Width="200" TextChanged="TextBox_TextChanged_10" Height="35" VerticalContentAlignment="Center"/>
<TextBlock Text="Kg" FontSize="20" Foreground="#FF2AB2E7" VerticalAlignment="Center"/>
</StackPanel>
<ScrollViewer Grid.Row="4" VerticalScrollBarVisibility="Hidden">
<ItemsControl x:Name="itemcontrols" AlternationCount="{Binding flowProcessModels.Count}" ItemsSource="{Binding flowProcessModels}" Margin="0,1,0,-1">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@@ -455,7 +464,8 @@
RelativeSource TemplatedParent}}" Foreground="SkyBlue" Width="87" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Background="Transparent" BorderBrush="#FF2AB2E7" BorderThickness="1,1,0.5,1"/>
<ComboBox ItemsSource="{Binding DataContext.FlowItems, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" Text="{Binding FryMaterialNum}" Style="{StaticResource BaseComboBoxStyle}" IsReadOnly="True" Width="120" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FrySpeed}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged"/>
<TextBox Text="{Binding FryWeight}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_1"/>
<TextBox Text="{Binding FryWeight}" Width="112" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_1"/>
<TextBox Text="{Binding TargeWeight}" Width="112" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_8"/>
<TextBox Text="{Binding FryTemperature}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_2"/>
<TextBox Text="{Binding FryPeriodTime}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,1,1" TextChanged="TextBox_TextChanged_3"/>


+ 28
- 0
FryPot_DosingSystem/View/FlowProcessView.xaml.cs Vedi File

@@ -160,6 +160,34 @@ namespace FryPot_DosingSystem.View
}
}

private void TextBox_TextChanged_8(object sender, TextChangedEventArgs e)
{
if (sender is TextBox txt)
{
txt.Text = TextLimit(txt.Text);
}
}


private void TextBox_TextChanged_10(object sender, TextChangedEventArgs e)
{
if (sender is TextBox txtbox)
{
if (Regex.IsMatch(txtbox.Text, @"^[0-9]+(.[1-9]{0,1})?$"))//验证整数或1位小数
{
txtbox.Text = txtbox.Text.Trim();

}
else
{
// MessageBox.Show("原料重量非法输入", "警告", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
txtbox.Text = string.Empty;
}

}
}

//private void ComboBox_KeyUp(object sender, KeyEventArgs e)
//{
// var res = sender as ComboBox;


+ 34
- 24
FryPot_DosingSystem/View/NewRecipeView.xaml.cs Vedi File

@@ -76,14 +76,18 @@ namespace FryPot_DosingSystem.View
{
if (sender is TextBox txt)
{
if (new Regex("^[1-8]$").IsMatch(txt.Text))//全匹配
if (txt.Text != null)
{

}
else
{
txt.Text = string.Empty;
if (new Regex("^[1-8]$").IsMatch(txt.Text))//全匹配
{

}
else
{
txt.Text = string.Empty;
}
}
}
}

@@ -160,17 +164,20 @@ namespace FryPot_DosingSystem.View
{
if (sender is TextBox txtbox)
{
if (Regex.IsMatch(txtbox.Text, @"^\+?[1-9][0-9]*$"))//非零正整数
{
txtbox.Text = txtbox.Text.Trim();

}
else
if (txtbox != null)
{
// MessageBox.Show("原料重量非法输入", "警告", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
txtbox.Text = string.Empty;
if (Regex.IsMatch(txtbox.Text, @"^\+?[0-9][0-9]*$"))//非零正整数
{
txtbox.Text = txtbox.Text.Trim();

}
else
{
// MessageBox.Show("原料重量非法输入", "警告", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
txtbox.Text = string.Empty;
}
}

}
}

@@ -178,17 +185,20 @@ namespace FryPot_DosingSystem.View
{
if (sender is TextBox txtbox)
{
if (Regex.IsMatch(txtbox.Text, @"^[0-9]+(.[1-9]{0,1})?$"))//验证整数或1位小数
if (txtbox.Text != null)
{
txtbox.Text = txtbox.Text.Trim();

if (Regex.IsMatch(txtbox.Text, @"^[0-9]+(.[1-9]{0,1})?$"))//验证整数或1位小数
{
txtbox.Text = txtbox.Text.Trim();

}
else
{
// MessageBox.Show("原料重量非法输入", "警告", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
txtbox.Text = string.Empty;
}
}
else
{
// MessageBox.Show("原料重量非法输入", "警告", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
txtbox.Text = string.Empty;
}

}
}
}


+ 1
- 1
FryPot_DosingSystem/View/RecipeSendDownView.xaml Vedi File

@@ -26,7 +26,7 @@
<RowDefinition Height="50"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button>
<!--<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button>-->
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding Recipes}">
<ItemsControl.ItemsPanel>


+ 1
- 1
FryPot_DosingSystem/View/RecipesSendDown.xaml Vedi File

@@ -49,7 +49,7 @@
<RowDefinition Height="50"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button>
<!--<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button>-->
<ScrollViewer Name="sv" Grid.Row="1" PreviewMouseWheel="ScrollViewer_PreviewMouseWheel" VerticalScrollBarVisibility="Hidden" >
<ListView
VerticalAlignment="Top"


+ 32
- 5
FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs Vedi File

@@ -3,6 +3,7 @@ using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.Helper;
using FryPot_DosingSystem.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
@@ -14,13 +15,17 @@ using System.Windows;

namespace FryPot_DosingSystem.ViewModel
{
internal class FlowProcessSetViewModel
internal class FlowProcessSetViewModel:ObservableObject
{

public int Id { get; set; } = 0;
public static int materialNum { get; set; }
public ObservableCollection<FlowProcessModel> flowProcessModels { get; set; } = new ObservableCollection<FlowProcessModel>();

/// <summary>
/// 目标重量偏差
/// </summary>
public string targetWeightOffset { get { return _targetWeightOffset; } set { _targetWeightOffset = value;OnPropertyChanged(); } }
private string _targetWeightOffset="0";
public string currentRecipeName { get; set; }
public static int currentItemId { get; set; }
public RelayCommand CloseWindowCommand { get; set; }
@@ -66,6 +71,7 @@ namespace FryPot_DosingSystem.ViewModel
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess?.RecipeName == recipeName?.ToString());
if (res != null && res is NewRecipeModel recipe) //编辑已有工艺
{
targetWeightOffset = recipe.FlowProcess.targetWeightOffset.ToString();
foreach (var item in recipe.materialCollection)
{
if (!FlowItems.Contains(item.MaterialLoc.ToString()))
@@ -73,7 +79,7 @@ namespace FryPot_DosingSystem.ViewModel
}
foreach (var item in recipe.FlowProcess.fpModels)
{
flowProcessModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent });
flowProcessModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, TargeWeight=item.TargeWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent });
}

// ActionManage.GetInstance.Send("MaterialNum", recipe.materialCollection.Count);
@@ -92,7 +98,7 @@ namespace FryPot_DosingSystem.ViewModel
FlowItems.Add(item.MaterialLoc.ToString());//下拉框
}
ActionManage.GetInstance.Send("MaterialNum", name.materialCollection.Count);
name.FlowProcess.fpModels = flowProcessModels;
//name.FlowProcess.fpModels = flowProcessModels;
}

}
@@ -110,6 +116,17 @@ namespace FryPot_DosingSystem.ViewModel
if (name != null)
{
name.FlowProcess.RecipeName = currentRecipeName.ToString();
if (float.TryParse(targetWeightOffset.Trim(), out float offset))
{
name.FlowProcess.targetWeightOffset = offset;//目标重量偏差
}
else
{
MessageBox.Show("非法目标重量偏差设置", "提示", MessageBoxButton.OK, MessageBoxImage.Error);
name.FlowProcess.targetWeightOffset = 0.0F;
return;
}
//工艺桶号重复性检测
foreach (var item in name.materialCollection)
{
@@ -122,11 +139,21 @@ namespace FryPot_DosingSystem.ViewModel
return;
}
}
//工艺步骤中清洗工艺重复性检测
if (flowProcessModels.FirstOrDefault(p=>p.FryMaterialNum=="清洗")!=null)
{
if (flowProcessModels.Where(p => p.FryMaterialNum == "清洗").Count() > 1||flowProcessModels.IndexOf(flowProcessModels.FirstOrDefault(p => p.FryMaterialNum == "清洗"))<flowProcessModels.Count-1)
{
MessageNotify.GetInstance.ShowUserLog("保存失败,清洗工艺重复或非法配置");
MessageBox.Show("保存失败,清洗工艺重复或非法配置", "提示", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
// name.FlowProcess.fpModels = flowProcessModels;
name.FlowProcess.fpModels.Clear();
foreach (var item in flowProcessModels)
{
name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent });
name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight,TargeWeight=item.TargeWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent });
}

//foreach (var item in name.materialCollection)


+ 43
- 38
FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs Vedi File

@@ -43,7 +43,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand SaveAs { get; set; }
public NewRecipeViewModel()
{
Json<RecipeManage>.Read();
Json<MaterialNames>.Read();
MaterialNames.GetInstance.Names = Json<MaterialNames>.Data.Names;
materialNames = Json<MaterialNames>.Data.Names;
@@ -51,6 +51,7 @@ namespace FryPot_DosingSystem.ViewModel
{
if (Id != null && Id is string strId)
{
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == strId);
if (res != null && res is NewRecipeModel rom)
{
@@ -102,24 +103,25 @@ namespace FryPot_DosingSystem.ViewModel
if (materials.Count<=8&& materials.Count> 0)
{
//int lineNum= materials.ElementAt(0).MaterialLoc / 100;
// //桶号正确性验证
// for (int i = 0; i < materials.Count; i++)
// {
// if (materials.ElementAt(i).MaterialLoc / 100 != lineNum|| materials.ElementAt(i).MaterialLoc % 100!=i+1||lineNum<=0||lineNum>5)
// {
// MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】");
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效");
// ActionManage.GetInstance.Send("CloseNewRecipeView");
// return;
// }
// }
int lineNum = materials.ElementAt(0).MaterialLoc / 100;
//桶号正确性验证
for (int i = 0; i < materials.Count; i++)
{
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5)
{
MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效");
ActionManage.GetInstance.Send("CloseNewRecipeView");
return;
}
}

prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID);
if (res == null)
{
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, FlowProcess=new FlowProcessManage(), materialCollection = materials,DataTime=DateTime.Now.ToShortDateString()});//配方添加
}
else
{
@@ -145,21 +147,23 @@ namespace FryPot_DosingSystem.ViewModel
{
if (materials.Count > 0 && materials.Count <= 8)
{
//int lineNum = materials.ElementAt(0).MaterialLoc / 100;
////桶号正确性验证
//for (int i = 0; i < materials.Count; i++)
//{
// if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5)
// {
// MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效");
// ActionManage.GetInstance.Send("CloseNewRecipeView");
// return;
// }
//}
int lineNum = materials.ElementAt(0).MaterialLoc / 100;
//桶号正确性验证
for (int i = 0; i < materials.Count; i++)
{
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5)
{
MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效");
ActionManage.GetInstance.Send("CloseNewRecipeView");
return;
}
}
bom.materialCollection = materials;
bom.RecipeName = RecipeName;
bom.UpdateTime = DateTime.Now.ToShortDateString();
if (bom.FlowProcess != null)
bom.FlowProcess.RecipeName = RecipeName;
Json<RecipeManage>.Save();
MessageNotify.GetInstance.ShowUserLog($"配方【{RecipeName}】修改成功");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"修改配方【{RecipeName}】成功");
@@ -181,24 +185,25 @@ namespace FryPot_DosingSystem.ViewModel
{
if (materials.Count>0&& materials.Count<=8)//验证配方中原料桶数
{
//int lineNum = materials.ElementAt(0).MaterialLoc / 100;
////桶号正确性验证
//for (int i = 0; i < materials.Count; i++)
//{
// if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5)
// {
// MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效");
// ActionManage.GetInstance.Send("CloseNewRecipeView");
// return;
// }
//}
int lineNum = materials.ElementAt(0).MaterialLoc / 100;
//桶号正确性验证
for (int i = 0; i < materials.Count; i++)
{
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5)
{
MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效");
ActionManage.GetInstance.Send("CloseNewRecipeView");
return;
}
}

prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID);
if (res == null)
{
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, materialCollection = materials });//配方添加
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, DataTime = DateTime.Now.ToShortDateString(), RecipeName = RecipeName, materialCollection = materials,FlowProcess=new FlowProcessManage()});//配方添加
//Json<RecipeManage>.Save();
}
else
{


+ 2
- 2
FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs Vedi File

@@ -30,7 +30,7 @@ namespace FryPot_DosingSystem.ViewModel
public ObservableCollection<NewRecipeModel> Recipes { get; set; } = new ObservableCollection<NewRecipeModel>();
public RecipeSetDownViewModel()
{
Json<RecipeManage>.Read();
//Json<RecipeManage>.Read();
Recipes =Json<RecipeManage>.Data.Recipes;
RecipeSetDownCommand = new RelayCommand<object>((Id) =>
{
@@ -42,7 +42,7 @@ namespace FryPot_DosingSystem.ViewModel
RecipeSetDown(new NewRecipeModel[] { res });
//res.RecipeSetInfo = "配方下发成功";
//Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; });
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!");
}
else
{


+ 4
- 2
FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs Vedi File

@@ -49,7 +49,7 @@ namespace FryPot_DosingSystem.ViewModel

public RecipeSetViewModel()
{
Json<RecipeManage>.Read();
// Json<RecipeManage>.Read();
recipeModels =Json<RecipeManage>.Data.Recipes;
int count = recipeModels.Count;
bool sign = false;
@@ -70,6 +70,7 @@ namespace FryPot_DosingSystem.ViewModel
else
{
sign = true;
Json<RecipeManage>.Data.Recipes.RemoveAt(Json<RecipeManage>.Data.Recipes.Count - 1);
}
}
}
@@ -104,9 +105,10 @@ namespace FryPot_DosingSystem.ViewModel
var res = recipeModels.FirstOrDefault(p => p.RecipeId == strId);
if (res != null && res is NewRecipeModel nes)
{
recipeModels.Remove(res);//删除配方
recipeModels.Remove(nes);//删除配方
Json<RecipeManage>.Save();//保存配方
count = recipeModels.Count;
MessageNotify.GetInstance.ShowUserLog($"成功删除配方【{nes.RecipeName}】");
}
}
});


Caricamento…
Annulla
Salva