NXX 2 yıl önce
ebeveyn
işleme
f13dca0b8d
80 değiştirilmiş dosya ile 5897 ekleme ve 2405 silme
  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. +639
    -359
      BPASmartClient.MorkF/Control_MorkF.cs
  38. +1
    -11
      BPASmartClient.MorkF/ML_MorkF.cs
  39. +9
    -8
      BPASmartClient.MorkF/MaterialOperation.cs
  40. +8
    -8
      BPASmartClient.MorkF/View/DebugView.xaml
  41. +7
    -1
      BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
  42. +3
    -5
      BPASmartClient.S7Net/EntityClassResolution.cs
  43. +8
    -4
      BPASmartClient.S7Net/SiemensHelper.cs
  44. +1
    -1
      BPASmartClient.ScreenLib/BPASmartClient.ScreenLib.csproj
  45. +4
    -4
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml
  46. +4
    -4
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml
  47. +4
    -4
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl3.xaml
  48. +16
    -8
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml
  49. +1
    -1
      BPASmartClient.ScreenSplitMeals/App.config
  50. +34
    -0
      BeDesignerSCADA/Converters/MathAbsConverter.cs
  51. +22
    -22
      DosingSystem/App.xaml.cs
  52. +2
    -12
      DosingSystem/Model/DeviceInquire.cs
  53. +9
    -3
      DosingSystem/View/CommParSetView.xaml
  54. +466
    -409
      DosingSystem/View/ManualControlView.xaml
  55. +38
    -12
      DosingSystem/View/RecipeControlView.xaml
  56. +2
    -2
      DosingSystem/View/RecipeSettingsView.xaml
  57. +39
    -0
      DosingSystem/ViewModel/ManualControlViewModel.cs
  58. +0
    -4
      DosingSystem/ViewModel/NewRecipeViewModel.cs
  59. +44
    -9
      DosingSystem/ViewModel/RecipeControlViewModel.cs
  60. +14
    -14
      FryPot_DosingSystem/App.xaml.cs
  61. +271
    -126
      FryPot_DosingSystem/Control/DeviceOperate.cs
  62. +1799
    -676
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  63. +7
    -1
      FryPot_DosingSystem/Control/GlobalVariable.cs
  64. +2
    -0
      FryPot_DosingSystem/Model/FlowProcessManage.cs
  65. +6
    -1
      FryPot_DosingSystem/Model/FlowProcessModel.cs
  66. +136
    -92
      FryPot_DosingSystem/View/AgvView.xaml
  67. +200
    -166
      FryPot_DosingSystem/View/AgvView.xaml.cs
  68. +236
    -66
      FryPot_DosingSystem/View/DebugView.xaml
  69. +340
    -2
      FryPot_DosingSystem/View/DebugView.xaml.cs
  70. +23
    -13
      FryPot_DosingSystem/View/FlowProcessView.xaml
  71. +28
    -0
      FryPot_DosingSystem/View/FlowProcessView.xaml.cs
  72. +34
    -24
      FryPot_DosingSystem/View/NewRecipeView.xaml.cs
  73. +1
    -1
      FryPot_DosingSystem/View/RecipeSendDownView.xaml
  74. +1
    -1
      FryPot_DosingSystem/View/RecipesSendDown.xaml
  75. +32
    -5
      FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
  76. +43
    -38
      FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs
  77. +2
    -2
      FryPot_DosingSystem/ViewModel/RecipeSetDownViewModel.cs
  78. +4
    -2
      FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs
  79. +20
    -10
      WpfTest/MainWindow.xaml.cs
  80. +1
    -1
      WpfTest/WpfTest.csproj

+ 5
- 5
BPASmartClient.AGV/AGVHelper.cs Dosyayı Görüntüle

@@ -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)+"]";
//货位到货位



+ 16
- 8
BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 3
- 3
BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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)


+ 639
- 359
BPASmartClient.MorkF/Control_MorkF.cs
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 1
- 11
BPASmartClient.MorkF/ML_MorkF.cs Dosyayı Görüntüle

@@ -43,17 +43,7 @@ namespace BPASmartClient.MorkF
{
get
{
var ret = _ArriveComplete;
_ArriveComplete = false;
if(ret)
{
MessageLog.GetInstance.Show("到达上升沿为true");
}
else
{
MessageLog.GetInstance.Show("到达上升沿为false");
}
return ret;
return _ArriveComplete;
}
set
{


+ 9
- 8
BPASmartClient.MorkF/MaterialOperation.cs Dosyayı Görüntüle

@@ -6,19 +6,20 @@ using System.Threading.Tasks;

namespace BPASmartClient.MorkF
{
public class Coordinate
{
public int X { get; set; } = 0;

public int Y { get; set; } = 0;
}

/// <summary>
/// 菜品库操作类
/// </summary>
internal class MaterialOperation
{
/// <summary>
/// x轴坐标
/// </summary>
public int x;
/// <summary>
/// y轴坐标
/// </summary>
public int y;
public Coordinate coordinate { get; set; } = new Coordinate();

/// <summary>
/// 炒锅编号
/// </summary>


+ 8
- 8
BPASmartClient.MorkF/View/DebugView.xaml Dosyayı Görüntüle

@@ -89,7 +89,7 @@
<TextBlock Text="移动速度:" Margin="5,0"/>
<TextBox Text="{Binding MoveSpeed}" Width="70" Margin="5,0" VerticalAlignment="Center" />
<Button Content="设定" Command="{Binding SetSpeed}" Cursor="Hand" Margin="5,0,10,0" />
<Button Content="感应器1测距" Margin="5,0" Command="{Binding GetDistance_1}"/>
<Button Content="感应器1测距" Margin="5,0" Command="{Binding GetDistance_1}" Cursor="Hand"/>
<TextBox Text="{Binding SensingDistance_1}" Margin="5,0" Width="60" IsReadOnly="True"/>
<Button Content="感应器2测距" Margin="5,0" Command="{Binding GetDistance_2}"/>
<TextBox Text="{Binding SensingDistance_2}" Margin="5,0" Width="60" IsReadOnly="True"/>
@@ -107,15 +107,15 @@
<WrapPanel Grid.Row="3" Orientation="Horizontal" >
<Button Content="夹爪正转" Command="{Binding PawTurnFront}" Margin="5,0" Cursor="Hand"/>
<Button Content="夹爪反转" Command="{Binding PawTurnBack}" Margin="5,0" Cursor="Hand"/>
<RadioButton Content="位置1" Margin="5,0" IsEnabled="True" IsChecked="{Binding PawPositon1}" Command="{Binding GetDistance_1}" GroupName="PawTurn"/>
<RadioButton Content="位置2" Margin="5,0" IsEnabled="True" IsChecked="{Binding PawPositon2}" Command="{Binding GetDistance_2}" GroupName="PawTurn"/>
<RadioButton Content="位置3" Margin="5,0 " IsEnabled="True" IsChecked="{Binding PawPositon3}" Command="{Binding GetDistance_3}" GroupName="PawTurn"/>
<RadioButton Content="位置1" Margin="5,0" IsEnabled="True" IsChecked="{Binding PawPositon1}" Command="{Binding PawToPoint1}" GroupName="PawTurn"/>
<RadioButton Content="位置2" Margin="5,0" IsEnabled="True" IsChecked="{Binding PawPositon2}" Command="{Binding PawToPoint2}" GroupName="PawTurn"/>
<RadioButton Content="位置3" Margin="5,0 " IsEnabled="True" IsChecked="{Binding PawPositon3}" Command="{Binding PawToPoint3}" GroupName="PawTurn"/>
</WrapPanel>
<WrapPanel Grid.Row="4" Orientation="Horizontal" >
<RadioButton Content="上" Margin="5,0" IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunUp}" Command="{Binding GetDistance_1}" GroupName="ArmRun"/>
<RadioButton Content="下" Margin="5,0" IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunDown}" Command="{Binding GetDistance_2}" GroupName="ArmRun"/>
<RadioButton Content="左" Margin="5,0 " IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunLeft}" Command="{Binding GetDistance_3}" GroupName="ArmRun"/>
<RadioButton Content="右" Margin="5,0 " IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunRight}" Command="{Binding GetDistance_3}" GroupName="ArmRun"/>
<RadioButton Content="上" Margin="5,0" IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunUp}" GroupName="ArmRun"/>
<RadioButton Content="下" Margin="5,0" IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunDown}" GroupName="ArmRun"/>
<RadioButton Content="左" Margin="5,0 " IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunLeft}" GroupName="ArmRun"/>
<RadioButton Content="右" Margin="5,0 " IsEnabled="{Binding ArmRunEnable}" IsChecked="{Binding ArmRunRight}" GroupName="ArmRun"/>
<Button Content="{Binding ArmButtonName}" Command="{Binding ArmRun}" Margin="5,0" Cursor="Hand">
</Button>
</WrapPanel>


+ 7
- 1
BPASmartClient.MorkF/ViewModel/DebugViewModel.cs Dosyayı Görüntüle

@@ -96,6 +96,9 @@ namespace BPASmartClient.MorkF.ViewModel
public RelayCommand PawTurnBack { get; set; }//夹爪反转
public RelayCommand SetArmPosition { get; set; }//机器臂位置设定
public RelayCommand ArmRun { get; set; }//机械臂运动
public RelayCommand PawToPoint1 { get; set; }//感应测距1
public RelayCommand PawToPoint2 { get; set; }//感应测距2
public RelayCommand PawToPoint3 { get; set; }//感应测距3

#endregion

@@ -207,8 +210,11 @@ namespace BPASmartClient.MorkF.ViewModel
StopElectromagnetism = new RelayCommand(() => { ActionManage.GetInstance.Send("Electromagnetism", new List<bool> { true });});//电磁阀关闭
SetSpeed = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("SetSpeed", new List<int> { MoveSpeed });
ActionManage.GetInstance.Send("SetSpeed", new List<int> { MoveSpeed });
});//设定速度
PawToPoint1 = new RelayCommand(() => { ActionManage.GetInstance.Send("PawToPoint1"); });//爪子去1号位
PawToPoint2 = new RelayCommand(() => { ActionManage.GetInstance.Send("PawToPoint2"); });//爪子去2号位
PawToPoint3 = new RelayCommand(() => { ActionManage.GetInstance.Send("PawToPoint3"); });//爪子去3号位
GetDistance_1 = new RelayCommand(() => { ActionManage.GetInstance.Send("GetDistance_1"); });//感应距离1
GetDistance_2 = new RelayCommand(() => { ActionManage.GetInstance.Send("GetDistance_2"); });//感应距离2
GetDistance_3 = new RelayCommand(() => { ActionManage.GetInstance.Send("GetDistance_3"); });//感应距离3


+ 3
- 5
BPASmartClient.S7Net/EntityClassResolution.cs Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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
- 1
BPASmartClient.ScreenLib/BPASmartClient.ScreenLib.csproj Dosyayı Görüntüle

@@ -19,7 +19,7 @@
</COMReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BPA.CustomResource" Version="1.0.14" />
<PackageReference Include="BPA.CustomResource" Version="1.0.16" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1418.22" />
</ItemGroup>



+ 4
- 4
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml Dosyayı Görüntüle

@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -45,7 +45,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
@@ -132,7 +132,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -144,7 +144,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>


+ 4
- 4
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml Dosyayı Görüntüle

@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -45,7 +45,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
@@ -131,7 +131,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -143,7 +143,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>


+ 4
- 4
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl3.xaml Dosyayı Görüntüle

@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_6,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -45,7 +45,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_6,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
@@ -131,7 +131,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_5,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -143,7 +143,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_5,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>


+ 16
- 8
BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml Dosyayı Görüntüle

@@ -203,7 +203,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_1}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_NoodleUpOrDown[0]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>
@@ -220,7 +220,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_2}" Value="true">
<DataTrigger Binding="{Binding ViewData..Morks_NoodleUpOrDown[1]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>
@@ -244,7 +244,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_3}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_NoodleUpOrDown[2]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>
@@ -261,7 +261,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_4}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_NoodleUpOrDown[3]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>
@@ -285,7 +285,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_5}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_NoodleUpOrDown[4]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>
@@ -302,7 +302,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_6}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_NoodleUpOrDown[5]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>
@@ -345,10 +345,18 @@
<Setter Property="Foreground" Value="#a70909"></Setter>
<Setter Property="Text" Value="缺碗"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_NoBowMeas}" Value="true">
<DataTrigger Binding="{Binding ViewData.MorkS_NoBowMeas1}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="充足"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoBowMeas1}" Value="false">
<Setter Property="Foreground" Value="#a70909"/>
<Setter Property="Text" Value="缺大碗"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoBowMeas2}" Value="false">
<Setter Property="Foreground" Value="#a70909"/>
<Setter Property="Text" Value="缺小碗"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -375,7 +383,7 @@
<Setter Property="Foreground" Value="#a70909"></Setter>
<Setter Property="Text" Value="缺面"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData.MorkS_SiloMeas}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_SiloMeasDown}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="充足"></Setter>
</DataTrigger>


+ 1
- 1
BPASmartClient.ScreenSplitMeals/App.config Dosyayı Görüntüle

@@ -8,7 +8,7 @@
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>

<add key="一号屏" value="0"/>
<add key="二号屏" value="0"/>
<add key="二号屏" value="1"/>
<add key="三号屏" value="0"/>
</appSettings>
</configuration>

+ 34
- 0
BeDesignerSCADA/Converters/MathAbsConverter.cs Dosyayı Görüntüle

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

namespace BeDesignerSCADA.Converters
{
[ValueConversion(typeof(float), typeof(float))]
public class MathAbsConverter : IValueConverter
{
static MathAbsConverter()
{
Instance = new MathAbsConverter();
}

public static MathAbsConverter Instance
{
get;
private set;
}

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return Math.Abs((float)value);
}

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

+ 22
- 22
DosingSystem/App.xaml.cs Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 7
- 1
FryPot_DosingSystem/Control/GlobalVariable.cs Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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}】");
}
}
});


+ 20
- 10
WpfTest/MainWindow.xaml.cs Dosyayı Görüntüle

@@ -250,17 +250,18 @@ namespace WpfTest
},
MorkS_OrderCount = new Random().Next(0, 100),
MorkS_ErrorOrderCount = new Random().Next(0, 100),
MorkS_NoodleUpOrDown_1 = k2 == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_2 = k2 == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_3 = k2 == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_4 = k2 == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_5 = k2 == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_6 = k2 == 0 ? "true" : "false",
Morks_NoodleUpOrDown = new bool[] {
true,true,true,true,false,true
},

MorkS_Temp = false,// k2 == 0 ? "true" : "false",
MorkS_BinLocation = new Random().Next(0, 6),
Morks_SiloMeasUp = k2 == 0 ,
Morks_SiloMeasDown = k2 == 0,
MorkS_NoBowMeas1= new Random().Next(0, 2)==1,
MorkS_NoBowMeas2 = new Random().Next(0, 2) == 1,


MorkS_Temp = "false",// k2 == 0 ? "true" : "false",
MorkS_BinLocation = new Random().Next(0, 6).ToString(),
MorkS_SiloMeas = k2 == 0 ? "true" : "false",
MorkS_NoBowMeas = k2 == 0 ? "true" : "false",
MakeOrder = new List<OrderMakeModel> {
new OrderMakeModel { GoodName= name_s_zm[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=ORDER_STATUS.WAIT, SortNum="007".ToString()},
new OrderMakeModel { GoodName= name_s_zm[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=ORDER_STATUS.WAIT, SortNum="008".ToString()},
@@ -284,6 +285,15 @@ namespace WpfTest
{
IsRun = k2 == 0 ? IsRun.运行 : IsRun.停止,
WorkStatus = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_1 = WorkStatus.待机,
WorkStatus_2 = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_3 = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_4 = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_5 = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_6 = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
RobotStatu1= k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
RobotStatu2 = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,

RobotStatu = k2 == 0 ? WorkStatus.工作 : WorkStatus.待机,
//Alarm = new List<AlarmModel> {
// new AlarmModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },


+ 1
- 1
WpfTest/WpfTest.csproj Dosyayı Görüntüle

@@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BPA.CustomResource" Version="1.0.14" />
<PackageReference Include="BPA.CustomResource" Version="1.0.16" />
</ItemGroup>

</Project>

Yükleniyor…
İptal
Kaydet