@@ -25,7 +25,7 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
if (string.IsNullOrEmpty(name)) name = typeof(AlarmT).Name; | |||
if (_Instance == null) _Instance = new ConcurrentDictionary<string, AlarmT>(); | |||
if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new AlarmT()); | |||
return _Instance[name]; | |||
return _Instance[name]; | |||
} | |||
} | |||
private AlarmHelper() { } | |||
@@ -234,7 +234,7 @@ | |||
<ScrollViewer | |||
Grid.Row="2" | |||
HorizontalScrollBarVisibility="Hidden" | |||
VerticalScrollBarVisibility="Hidden"> | |||
VerticalScrollBarVisibility="Visible"> | |||
<Grid> | |||
<!--#region 实时报警信息--> | |||
@@ -310,7 +310,7 @@ | |||
<ScrollViewer | |||
Grid.Row="2" | |||
HorizontalScrollBarVisibility="Hidden" | |||
VerticalScrollBarVisibility="Hidden"> | |||
VerticalScrollBarVisibility="Visible"> | |||
<Grid> | |||
<!--#region 实时报警信息--> | |||
@@ -57,6 +57,7 @@ namespace BPASmartClient.JXJFoodBigStation | |||
Json<LocalRecipe>.Save(); | |||
Json<RemoteRecipe>.Save(); | |||
Json<RawMaterialData>.Save(); | |||
Json<BomMaterial>.Save(); | |||
base.OnExit(e); | |||
MessageNotify.GetInstance.LogSave(); | |||
ThreadManage.GetInstance().Dispose(); | |||
@@ -104,6 +105,13 @@ namespace BPASmartClient.JXJFoodBigStation | |||
AssemblyName = "BPASmartClient.JXJFoodBigStation", | |||
ToggleWindowPath = "View.StockBinRawMaterialView" | |||
}); | |||
StockBinManage.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "MES原料数据", | |||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||
AssemblyName = "BPASmartClient.JXJFoodBigStation", | |||
ToggleWindowPath = "View.BomOfMaterialView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
@@ -141,7 +149,7 @@ namespace BPASmartClient.JXJFoodBigStation | |||
InfoLog.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "调试日志", | |||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 }, | |||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.DebugLogView" | |||
}); | |||
@@ -223,6 +231,7 @@ namespace BPASmartClient.JXJFoodBigStation | |||
Json<LocalRecipe>.Read(); | |||
Json<RemoteRecipe>.Read(); | |||
Json<RawMaterialData>.Read(); | |||
Json<BomMaterial>.Read(); | |||
} | |||
} | |||
@@ -32,6 +32,9 @@ | |||
<AutoGen>True</AutoGen> | |||
<DependentUpon>Settings.settings</DependentUpon> | |||
</Compile> | |||
<Compile Update="View\BomOfMaterialView.xaml.cs"> | |||
<SubType>Code</SubType> | |||
</Compile> | |||
<Compile Update="View\StockBinRawMaterialView.xaml.cs"> | |||
<SubType>Code</SubType> | |||
</Compile> | |||
@@ -52,6 +55,10 @@ | |||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | |||
<SubType>Designer</SubType> | |||
</Page> | |||
<Page Update="View\BomOfMaterialView.xaml"> | |||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | |||
<SubType>Designer</SubType> | |||
</Page> | |||
<Page Update="View\StockBinRawMaterialView.xaml"> | |||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | |||
<SubType>Designer</SubType> | |||
@@ -16,13 +16,32 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// plc心跳上传 | |||
/// </summary> | |||
public static bool HeartBeatFromPlc { get; set; } | |||
/// <summary> | |||
/// 订单取消的状态位 | |||
/// </summary> | |||
public static bool Order_Cancel { get; set; } | |||
/// <summary> | |||
/// 订单取消的配方号 | |||
/// </summary> | |||
public static string Order_CancelRecipeCode { get; set; } = ""; | |||
public static int Order_CancelStep { get; set; } | |||
/// <summary> | |||
/// 第一个配方的配料时间 | |||
/// </summary> | |||
public static DateTime DosingRecipe1Time { get; set; } | |||
/// <summary> | |||
/// 第二个配方的配料时间 | |||
/// </summary> | |||
public static DateTime DosingRecipe2Time { get; set; } | |||
/// <summary> | |||
/// 第三个配方的配料时间 | |||
/// </summary> | |||
public static DateTime DosingRecipe3Time { get; set; } | |||
/// <summary> | |||
/// 第四个配方的配料时间 | |||
/// </summary> | |||
public static DateTime DosingRecipe4Time { get; set; } | |||
/// <summary> | |||
/// plc心跳下发 | |||
/// </summary> | |||
@@ -48,14 +67,29 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// </summary> | |||
public static bool IsUseLocalRecipe { get; set; } = false; | |||
/// <summary> | |||
/// 洗桶的标识符 | |||
/// </summary> | |||
public static bool BarrelWasherSign { get; set; } | |||
/// <summary> | |||
/// 订单请求 | |||
/// </summary> | |||
public static bool Order_Request { get; set; } = false; | |||
/// <summary> | |||
/// 下发配方的状态位 | |||
/// </summary> | |||
public static int SiemensSendRecipeStatus { get; set; } = 0; | |||
/// <summary> | |||
/// 大料站最大的料仓数目 | |||
/// </summary> | |||
public const int Max_DosingSotckBinNum = 14; | |||
public static StockBinName stockBinName { get; set; } = new StockBinName(); | |||
/// <summary> | |||
/// 原料的名称和原料编号对应,Mes提供的信息 | |||
/// </summary> | |||
public static Dictionary<string, string> RawMaterialsNameCode { get; set; } = new Dictionary<string, string>(); | |||
public static ushort AGVPutTray { get; set; } | |||
public static ushort AGVGetTray { get; set; } | |||
@@ -64,30 +98,37 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
public static ushort TrayCylinder { get; set; } | |||
public static DB_Read HKPlc_Read = new DB_Read(); | |||
public static bool IsUseLocalName { get; set; } = true; | |||
public static bool IsAllowHKPlcConnect { get; set; } | |||
public static bool IsAllowSiemensConnect { get; set; } | |||
/// <summary> | |||
/// 海科plc初始化完成标志 | |||
/// 是否连接海科PLC | |||
/// </summary> | |||
public static bool HKPlcInitComple { get; set; } | |||
public static bool IsAllowHKPlcConnect { get; set; } | |||
/// <summary> | |||
/// 西门子plc初始化完成标志 | |||
/// 是否连接西门子PLC | |||
/// </summary> | |||
public static bool SiemensInitComple { get; set; } | |||
public static bool IsAllowSiemensConnect { get; set; } | |||
/// <summary> | |||
/// | |||
/// 配方1配料完成 | |||
/// </summary> | |||
public static bool Recipe1DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 配方2配料完成 | |||
/// </summary> | |||
public static bool Recipe2DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 配方3配料完成 | |||
/// </summary> | |||
public static bool Recipe3DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 配方4配料完成 | |||
/// </summary> | |||
public static bool Recipe4DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 订单是否是洗桶 | |||
/// </summary> | |||
public static bool Order_IsWashingBarrel { get; set; } = false; | |||
public static int TrayEnable { get; set; } = 15; | |||
} | |||
} |
@@ -18,7 +18,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
public bool IsConnected => HK_PLC_S7.IsConnected; | |||
public DB_Read PlcRead = new DB_Read(); | |||
public DL_DataColl_DB DataColl =new DL_DataColl_DB(); | |||
public StockBinName StockBinName = new StockBinName(); | |||
public void Init() | |||
{ | |||
try | |||
@@ -29,12 +28,17 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
catch (Exception ex) { | |||
MessageNotify.GetInstance.ShowRunLog("DB99块初始化值 失败"); | |||
} | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{/* | |||
var res = HK_PLC_S7.ReadClass<StockBinName>(97);//料仓里原料的编码 | |||
if (res != null && res is StockBinName data9) | |||
{ | |||
GVL_BigStation.stockBinName = data9; | |||
}*/ | |||
if (IsConnected) | |||
{ | |||
var res1 = HK_PLC_S7.ReadClass<DB_Read>(98); | |||
var res2 = HK_PLC_S7.ReadClass<StockBinName>(97); | |||
var res2 = HK_PLC_S7.ReadClass<StockBinName>(97);//料仓里原料的编码 | |||
if (res1 != null && res1 is DB_Read data1) | |||
{ | |||
PlcRead = data1; | |||
@@ -42,7 +46,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
} | |||
if (res2 != null && res2 is StockBinName data2) | |||
{ | |||
StockBinName = data2; | |||
GVL_BigStation.stockBinName = data2; | |||
} | |||
var res3 = HK_PLC_S7.ReadClass<DL_DataColl_DB>(48); | |||
if (res3 != null && res3 is DL_DataColl_DB data) | |||
@@ -1,13 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
{ | |||
public class HKPlcCommAddress | |||
{ | |||
} | |||
} |
@@ -9,33 +9,33 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
{ | |||
public class StockBinName | |||
{ | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName1 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName2 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName3 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName4 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName5 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName6 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName7 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName8 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName9 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName10 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName11 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName12 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName13 { get; set; } = ""; | |||
[Siemens(6)] | |||
[Siemens(4)] | |||
public string RawMaterialName14 { get; set; } = ""; | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public class BomMaterial | |||
{ | |||
public ObservableCollection<RawMaterial> RawMaterials { get; set; } = new ObservableCollection<RawMaterial>(); | |||
} | |||
} |
@@ -10,10 +10,16 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
public class RawMaterial :ObservableObject | |||
{ | |||
private int _mIp; | |||
public int DeviceIp { get { return _mIp; } set { _mIp = value; }} | |||
public int DeviceIp { get { return _mIp; } set { _mIp = value; OnPropertyChanged(); } } | |||
public short RawMaterialCount { get { return _mRawMaterialCount; } set { _mRawMaterialCount = value; OnPropertyChanged(); } } | |||
private short _mRawMaterialCount; | |||
public int RawMaterialCount { get { return _mRawMaterialCount; } set { _mRawMaterialCount = value; OnPropertyChanged(); } } | |||
private int _mRawMaterialCount; | |||
/// <summary> | |||
/// 原料中文名 | |||
/// </summary> | |||
public string RawMaterialChineseName { get { return _mRawMaterialChineseName; } set { _mRawMaterialChineseName = value; OnPropertyChanged(); } } | |||
private string _mRawMaterialChineseName; | |||
/// <summary> | |||
/// 原料名称 | |||
@@ -36,7 +42,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// <summary> | |||
/// 实际的下料中重量 | |||
/// </summary> | |||
public float Laying_Off_Weight { get { return _mLaying_Off_Weight; } set { _mLaying_Off_Weight = value; } } | |||
public float Laying_Off_Weight { get { return _mLaying_Off_Weight; } set { _mLaying_Off_Weight = value; OnPropertyChanged(); } } | |||
private float _mLaying_Off_Weight; | |||
/// <summary> | |||
@@ -62,73 +62,22 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||
} | |||
if (res2 != null && res2 is DL_Finish_DB finish) | |||
{ | |||
if (GVL_BigStation.Recipe1DosingFinish == true) | |||
if (finish.Ask_For_Finish_PLC &&(GVL_BigStation.Recipe1DosingFinish || GVL_BigStation.Recipe2DosingFinish || GVL_BigStation.Recipe3DosingFinish || GVL_BigStation.Recipe4DosingFinish)) | |||
{ | |||
if (RTrig.GetInstance("Ask_For_Finish_PLC").Start(finish.Ask_For_Finish_PLC)) | |||
finish.Order_No = ""; | |||
finish.Product_Code = ""; | |||
finish.job_No = 0; | |||
for (int i = 0; i < 20; i++) | |||
{ | |||
finish.Order_No = ""; | |||
finish.Product_Code = ""; | |||
finish.job_No = 0; | |||
for (int i = 0; i < 20; i++) | |||
{ | |||
finish.Material[i] = new UDT1(); | |||
} | |||
finish.Ask_For_Finish = false; | |||
finish.ProcessTime = 0; | |||
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2361); | |||
GVL_BigStation.Recipe1DosingFinish = false; | |||
} | |||
} | |||
else if (GVL_BigStation.Recipe2DosingFinish == true) | |||
{ | |||
if (RTrig.GetInstance("Ask_For_Finish_PLC").Start(finish.Ask_For_Finish_PLC)) | |||
{ | |||
finish.Order_No = ""; | |||
finish.Product_Code = ""; | |||
finish.job_No = 0; | |||
for (int i = 0; i < 20; i++) | |||
{ | |||
finish.Material[i] = new UDT1(); | |||
} | |||
finish.Ask_For_Finish = false; | |||
finish.ProcessTime = 0; | |||
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2361); | |||
GVL_BigStation.Recipe2DosingFinish = false; | |||
} | |||
} | |||
else if (GVL_BigStation.Recipe3DosingFinish == true) | |||
{ | |||
if (RTrig.GetInstance("Ask_For_Finish_PLC").Start(finish.Ask_For_Finish_PLC)) | |||
{ | |||
finish.Order_No = ""; | |||
finish.Product_Code = ""; | |||
finish.job_No = 0; | |||
for (int i = 0; i < 20; i++) | |||
{ | |||
finish.Material[i] = new UDT1(); | |||
} | |||
finish.Ask_For_Finish = false; | |||
finish.ProcessTime = 0; | |||
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2361); | |||
GVL_BigStation.Recipe3DosingFinish = false; | |||
} | |||
} | |||
else if (GVL_BigStation.Recipe4DosingFinish == true) | |||
{ | |||
if (RTrig.GetInstance("Ask_For_Finish_PLC").Start(finish.Ask_For_Finish_PLC)) | |||
{ | |||
finish.Order_No = ""; | |||
finish.Product_Code = ""; | |||
finish.job_No = 0; | |||
for (int i = 0; i < 20; i++) | |||
{ | |||
finish.Material[i] = new UDT1(); | |||
} | |||
finish.Ask_For_Finish = false; | |||
finish.ProcessTime = 0; | |||
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2361); | |||
GVL_BigStation.Recipe4DosingFinish = false; | |||
finish.Material[i] = new UDT1(); | |||
} | |||
finish.Ask_For_Finish = false; | |||
finish.ProcessTime = 0; | |||
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2361); | |||
if (GVL_BigStation.Recipe1DosingFinish) GVL_BigStation.Recipe1DosingFinish = false; | |||
if (GVL_BigStation.Recipe2DosingFinish) GVL_BigStation.Recipe2DosingFinish = false; | |||
if (GVL_BigStation.Recipe3DosingFinish) GVL_BigStation.Recipe3DosingFinish = false; | |||
if (GVL_BigStation.Recipe4DosingFinish) GVL_BigStation.Recipe4DosingFinish = false; | |||
} | |||
} | |||
Thread.Sleep(10); | |||
@@ -0,0 +1,122 @@ | |||
<UserControl x:Class="BPASmartClient.JXJFoodBigStation.View.BomOfMaterialView" | |||
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:BomOfMaterialViewModel /> | |||
</UserControl.DataContext> | |||
<Grid Margin="10"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50" /> | |||
<RowDefinition Height="40" /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<!--#region 表格标题栏设置--> | |||
<Grid> | |||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal"> | |||
<pry:IcoButton | |||
Margin="5" | |||
Command="{Binding AddMaterial}" | |||
Content="新增数据" | |||
FontSize="28" | |||
Foreground="Aqua" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
<pry:IcoButton | |||
Margin="5" | |||
Command="{Binding SaveMaterials}" | |||
Content="保存参数" | |||
FontSize="28" | |||
Foreground="Aqua" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</StackPanel> | |||
</Grid> | |||
<Grid | |||
Grid.Row="1" | |||
Margin="0,10,0,0" | |||
Background="#ff0C255F"> | |||
<Grid.ColumnDefinitions> | |||
<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,1,1,1" 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 Grid.Row="2"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible" > | |||
<ItemsControl ItemsSource="{Binding RawMaterialInfo}" Foreground="Aqua"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Name="gr" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<Grid Grid.Column="0" Margin="5"> | |||
<TextBlock | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RawMaterialCount}" /> | |||
</Grid> | |||
<Grid Grid.Column="1" Margin="5"> | |||
<TextBox | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RawMaterialName}" /> | |||
</Grid> | |||
<Grid Grid.Column="2"> | |||
<TextBox | |||
Width="200" | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RawMaterialChineseName}" /> | |||
</Grid> | |||
<Grid Grid.Column="3"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> | |||
<pry:IcoButton | |||
Margin="3,4,4,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Background="#11F53F62" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RawMaterialCount}" | |||
Content="删除" | |||
EnterBackground="#22F53F62" | |||
Foreground="#FFF53F62" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</StackPanel> | |||
</Grid> | |||
</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> |
@@ -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 BomOfMaterialView : UserControl | |||
{ | |||
public BomOfMaterialView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -78,19 +78,90 @@ | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding ClearAllRecipe}" | |||
Content="清除所有配方" | |||
Content="清除西门子所有配方" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
</StackPanel> | |||
</Grid> | |||
<Grid Grid.Row="1"> | |||
<WrapPanel> | |||
<TextBlock Text="心跳:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding Heartbeat}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
</Grid.ColumnDefinitions> | |||
<StackPanel> | |||
<WrapPanel> | |||
<TextBlock Text="plc心跳:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding Heartbeat}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="订单号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBox Width="300" Margin="5" Text="{Binding CancelRecipeCode}" FontSize="24" VerticalAlignment="Center"></TextBox> | |||
<Button Style="{StaticResource ImageButtonStyle}" Width="120" Height="40" FontSize="20" Content="取消订单" Margin="5" Command="{Binding CancelRecipeCommand}"></Button> | |||
</WrapPanel> | |||
</StackPanel> | |||
<StackPanel Grid.Column="1"> | |||
<WrapPanel> | |||
<TextBlock Text="料仓名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBinName}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓1名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin1Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓2名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin2Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓3名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin3Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓4名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin4Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓5名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin5Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓6名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin6Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓7名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin7Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓8名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin8Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓9名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin9Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓10名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin10Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓11名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin11Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓12名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin12Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓13名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin13Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Text="料仓14名称:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding StockBin14Name}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
</StackPanel> | |||
</Grid> | |||
</Grid> | |||
</UserControl> |
@@ -529,7 +529,7 @@ | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
HorizontalScrollBarVisibility="Hidden" | |||
VerticalScrollBarVisibility="Hidden"> | |||
VerticalScrollBarVisibility="Visible"> | |||
<ItemsControl ItemsSource="{Binding RawMaterial}"> | |||
<ItemsControl.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -13,12 +13,12 @@ | |||
<Grid Margin="10"> | |||
<Grid.RowDefinitions> | |||
<!--<RowDefinition Height="60" />--> | |||
<RowDefinition Height="60" /> | |||
<RowDefinition Height="40" /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<!--#region 表格标题栏设置--> | |||
<Grid> | |||
<!--<Grid> | |||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal"> | |||
<pry:IcoButton | |||
Margin="10" | |||
@@ -36,12 +36,11 @@ | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</StackPanel> | |||
</Grid> | |||
</Grid>--> | |||
<Grid | |||
Grid.Row="1" | |||
Grid.Row="0" | |||
Margin="0,10,0,0" | |||
Background="#ff0C255F"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="1*"/> | |||
<ColumnDefinition Width="1*"/> | |||
@@ -50,19 +49,18 @@ | |||
</Grid.ColumnDefinitions> | |||
<Grid Grid.Column="0"> | |||
<TextBlock Text="序号" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"/> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
<Border BorderThickness="1,1,1,1" 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" /> | |||
<TextBlock Grid.Column="3" FontSize="24" Text="原料名称" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
</Grid> | |||
<Grid Grid.Row="2"> | |||
<Grid Grid.Row="1"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" > | |||
<ItemsControl ItemsSource="{Binding RawMaterialInfo}" Foreground="Aqua"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Name="gr" > | |||
<Grid Name="gr" Margin="5"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
@@ -81,8 +79,7 @@ | |||
</Grid> | |||
<Grid Grid.Column="1" Margin="5"> | |||
<TextBox | |||
Width="50" | |||
<TextBlock | |||
FontSize="16" | |||
TextAlignment="Center" | |||
HorizontalAlignment="Center" | |||
@@ -94,8 +91,7 @@ | |||
</Grid> | |||
<Grid Grid.Column="2" Margin="5"> | |||
<TextBox | |||
Width="50" | |||
<TextBlock | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
@@ -105,7 +101,15 @@ | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Grid Grid.Column="3"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> | |||
<TextBlock | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RawMaterialChineseName}" /> | |||
<Border | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
<!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> | |||
<pry:IcoButton | |||
Margin="3,4,4,0" | |||
HorizontalAlignment="Center" | |||
@@ -119,7 +123,7 @@ | |||
Foreground="#FFF53F62" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</StackPanel> | |||
</StackPanel>--> | |||
</Grid> | |||
</Grid> | |||
@@ -0,0 +1,75 @@ | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.CustomResource.UserControls; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.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 BomOfMaterialViewModel : ObservableObject | |||
{ | |||
public BomOfMaterialViewModel() | |||
{ | |||
RawMaterialInfo = Json<BomMaterial>.Data.RawMaterials; | |||
/*if (RawMaterialInfo.Count ==0) | |||
{ | |||
Json<BomMaterial>.Data.RawMaterials.Clear(); | |||
ProcessControl.GetInstance.RawMaterialNameWithCode();//原料的名称和编码对应 :西门子mes定义的物料编码 | |||
foreach (var item in GVL_BigStation.RawMaterialsNameCode) | |||
{ | |||
Json<BomMaterial>.Data.RawMaterials.Add(new RawMaterial() { RawMaterialCount = Json<BomMaterial>.Data.RawMaterials.Count + 1, RawMaterialName = item.Key, RawMaterialChineseName = item.Value }); | |||
} | |||
RawMaterialInfo = Json<BomMaterial>.Data.RawMaterials; | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"读取程序的Bom清单"); | |||
}*/ | |||
AddMaterial = new RelayCommand(() => | |||
{ | |||
RawMaterialInfo.Add(new RawMaterial() | |||
{ | |||
RawMaterialCount = Json<BomMaterial>.Data.RawMaterials.Count +1 , | |||
}); | |||
}); | |||
SaveMaterials = new RelayCommand(() => | |||
{ | |||
if (MessageNotify.GetInstance.ShowDialog("请确认是否保存!") == true) | |||
{ | |||
Json<BomMaterial>.Save(); | |||
MessageNotify.GetInstance.ShowUserLog($"Mes物料清单保存成功"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"原料与料仓对应关系保存成功"); | |||
} | |||
}); | |||
RemoveCommand = new RelayCommand<int>((Count) => | |||
{ | |||
if (Count is int cnt) | |||
{ | |||
var res = RawMaterialInfo.FirstOrDefault(p => p.RawMaterialCount == cnt); | |||
if (res != null) | |||
{ | |||
if (MessageNotify.GetInstance.ShowDialog("请确认是否删除!") == true) | |||
{ | |||
RawMaterialInfo.Remove(res); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"删除成功"); | |||
} | |||
} | |||
} | |||
}); | |||
} | |||
public ObservableCollection<RawMaterial> RawMaterialInfo { get; set; } = new ObservableCollection<RawMaterial>(); | |||
public RelayCommand AddMaterial { get; set; } | |||
public RelayCommand SaveMaterials { get; set; } | |||
public RelayCommand<int> RemoveCommand { get; set; } | |||
} | |||
} |
@@ -10,6 +10,7 @@ using System.Collections.ObjectModel; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Reflection; | |||
using System.Runtime.CompilerServices; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
@@ -49,10 +50,36 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
Json<RemoteRecipe>.Data.Recipes.Clear(); | |||
GVL_BigStation.SiemensSendRecipeStatus = 0; | |||
}); | |||
CancelRecipeCommand = new RelayCommand(() => | |||
{ | |||
if (Json<RemoteRecipe>.Data.Recipes != null) | |||
{ | |||
int index = Array.FindIndex(Json<RemoteRecipe>.Data.Recipes.ToArray(), p => p.RecipeCode == CancelRecipeCode); | |||
if (index >= 0) | |||
{ | |||
GVL_BigStation.Order_Cancel = true; | |||
GVL_BigStation.Order_CancelRecipeCode = CancelRecipeCode; | |||
} | |||
} | |||
}); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
Heartbeat = GVL_BigStation.HeartBeatFromPlc; | |||
Thread.Sleep(100); | |||
StockBin1Name = GVL_BigStation.stockBinName.RawMaterialName1; | |||
StockBin2Name = GVL_BigStation.stockBinName.RawMaterialName2; | |||
StockBin3Name = GVL_BigStation.stockBinName.RawMaterialName3; | |||
StockBin4Name = GVL_BigStation.stockBinName.RawMaterialName4; | |||
StockBin5Name = GVL_BigStation.stockBinName.RawMaterialName5; | |||
StockBin6Name = GVL_BigStation.stockBinName.RawMaterialName6; | |||
StockBin7Name = GVL_BigStation.stockBinName.RawMaterialName7; | |||
StockBin8Name = GVL_BigStation.stockBinName.RawMaterialName8; | |||
StockBin9Name = GVL_BigStation.stockBinName.RawMaterialName9; | |||
StockBin10Name = GVL_BigStation.stockBinName.RawMaterialName10; | |||
StockBin11Name = GVL_BigStation.stockBinName.RawMaterialName11; | |||
StockBin12Name = GVL_BigStation.stockBinName.RawMaterialName12; | |||
StockBin13Name = GVL_BigStation.stockBinName.RawMaterialName13; | |||
StockBin14Name = GVL_BigStation.stockBinName.RawMaterialName14; | |||
}), "设备状态读取",true); | |||
} | |||
public RelayCommand Tray1InPlace { get; set; } | |||
@@ -62,7 +89,45 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
public RelayCommand Tray5InPlace { get; set; } | |||
public RelayCommand ClearTrayInPlace { get; set; } | |||
public RelayCommand ClearAllRecipe { get; set; } | |||
public bool Heartbeat { get { return _mHeartbeat; } set { _mHeartbeat = value; OnPropertyChanged(); } } | |||
private bool _mHeartbeat; | |||
public static bool Heartbeat { get { return _mHeartbeat; } set { _mHeartbeat = value; OnStaticPropertyChanged(); } } | |||
private static bool _mHeartbeat; | |||
public string CancelRecipeCode { get { return _CancelRecipeCode; } set { _CancelRecipeCode = value; OnPropertyChanged(); } } | |||
public string _CancelRecipeCode { get; set; } | |||
public static string StockBin1Name { get { return _StockBin1Name; } set { _StockBin1Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin1Name { get; set; } | |||
public static string StockBin2Name { get { return _StockBin2Name; } set { _StockBin2Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin2Name { get; set; } | |||
public static string StockBin3Name { get { return _StockBin3Name; } set { _StockBin3Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin3Name { get; set; } | |||
public static string StockBin4Name { get { return _StockBin4Name; } set { _StockBin4Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin4Name { get; set; } | |||
public static string StockBin5Name { get { return _StockBin5Name; } set { _StockBin5Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin5Name { get; set; } | |||
public static string StockBin6Name { get { return _StockBin6Name; } set { _StockBin6Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin6Name { get; set; } | |||
public static string StockBin7Name { get { return _StockBin7Name; } set { _StockBin7Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin7Name { get; set; } | |||
public static string StockBin8Name { get { return _StockBin8Name; } set { _StockBin8Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin8Name { get; set; } | |||
public static string StockBin9Name { get { return _StockBin9Name; } set { _StockBin9Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin9Name { get; set; } | |||
public static string StockBin10Name { get { return _StockBin10Name; } set { _StockBin10Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin10Name { get; set; } | |||
public static string StockBin11Name { get { return _StockBin11Name; } set { _StockBin11Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin11Name { get; set; } | |||
public static string StockBin12Name { get { return _StockBin12Name; } set { _StockBin12Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin12Name { get; set; } | |||
public static string StockBin13Name { get { return _StockBin13Name; } set { _StockBin13Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin13Name { get; set; } | |||
public static string StockBin14Name { get { return _StockBin14Name; } set { _StockBin14Name = value; OnStaticPropertyChanged(); } } | |||
public static string _StockBin14Name { get; set; } | |||
public RelayCommand CancelRecipeCommand { get; set; } | |||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged; | |||
public static void OnStaticPropertyChanged([CallerMemberName] string PropName = "") | |||
{ | |||
StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(PropName)); | |||
} | |||
} | |||
} |
@@ -34,7 +34,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
IsWashingBarrel = rm.IsWashingBarrel; | |||
foreach (var item in rm.RawMaterial) | |||
{ | |||
item.RawMaterialCount = (short)Array.FindIndex(ProcessControl.GetInstance.RawMaterialsInfo.ToArray(), p => p.RawMaterialName == item.RawMaterialName); | |||
item.RawMaterialCount = Array.FindIndex(ProcessControl.GetInstance.RawMaterialsInfo.ToArray(), p => p.RawMaterialName == item.RawMaterialName); | |||
RawMaterialsInfo.Add(item); | |||
} | |||
} | |||
@@ -69,13 +69,13 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
if (IsWashingBarrel) | |||
{ | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode,RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel }); | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode,RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType="洗桶" }); | |||
if (RawMaterialsInfo.Count > 0) | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, App.MainWindow, "提示", $"订单类型为洗桶,不保存原料信息"); | |||
} | |||
else | |||
{ | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel }); | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "配料" }); | |||
} | |||
Json<LocalRecipe>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方保存完成"); | |||
@@ -110,7 +110,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
} | |||
}); | |||
RemoveRecipe = new RelayCommand<short>((index) => { | |||
RemoveRecipe = new RelayCommand<int>((index) => { | |||
var res = RawMaterialsInfo.FirstOrDefault(p => p.RawMaterialCount == index); | |||
if (res != null) | |||
RawMaterialsInfo.Remove(res); | |||
@@ -137,7 +137,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
public RelayCommand Comfirm { get; set; } | |||
public RelayCommand<short> RemoveRecipe { get; set; } | |||
public RelayCommand<int> RemoveRecipe { get; set; } | |||
public ObservableCollection<RawMaterial> RawMaterialsInfo { get; set; } = new ObservableCollection<RawMaterial>() ; | |||
@@ -47,7 +47,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
if (!ProcessControl.GetInstance.LocalRecipes.Contains(res)) | |||
{ | |||
ProcessControl.GetInstance.LocalRecipes.Add(res); | |||
MessageNotify.GetInstance.ShowAlarmLog($"手动下发配方:{recipeName}完成"); | |||
MessageNotify.GetInstance.ShowRunLog($"手动下发配方:{recipeName}完成"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方下发完成"); | |||
} | |||
} | |||
@@ -22,33 +22,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
public StockBinRawMaterialViewModel() | |||
{ | |||
RawMaterialInfo = Json<RawMaterialData>.Data.RawMaterial; | |||
RemoveCommand = new RelayCommand<Object>((loc) => | |||
{ | |||
if (loc is int pos) | |||
{ | |||
var res = RawMaterialInfo.FirstOrDefault(p => p.RawMaterialLocation == pos); | |||
if (res != null) RawMaterialInfo.Remove(res); | |||
} | |||
}); | |||
SaveRawMaterialPara = new RelayCommand(() => | |||
{ | |||
Json<RawMaterialData>.Save(); | |||
foreach (var item in Json<RawMaterialData>.Data.RawMaterial) | |||
{ | |||
MessageNotify.GetInstance.ShowUserLog($"料仓位置:"+ item.RawMaterialLocation+ ",物料编码:" + item.RawMaterialName); | |||
} | |||
MessageNotify.GetInstance.ShowUserLog($"原料与料仓对应关系保存成功"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"原料与料仓对应关系保存成功"); | |||
}); | |||
UpdateRawMaterial = new RelayCommand(() => | |||
{ | |||
RawMaterialInfo.Add(new RawMaterial() { RawMaterialCount = (short)(RawMaterialInfo.Count + 1)}); | |||
}); | |||
} | |||
public ObservableCollection<RawMaterial> RawMaterialInfo { get; set; } = new ObservableCollection<RawMaterial>(); | |||
public RelayCommand<Object> RemoveCommand { get; set; } | |||
public RelayCommand SaveRawMaterialPara { get; set; } | |||
public RelayCommand UpdateRawMaterial { get; set; } | |||
public ObservableCollection<RawMaterial> RawMaterialInfo => ProcessControl.GetInstance.HardWareRawMaterialInfo; | |||
} | |||
} |
@@ -37,6 +37,7 @@ namespace BPASmartClient.JXJFoodSmallStation | |||
} | |||
BPASmartClient.Helper.SystemHelper.GetInstance.CreateDesktopShortcut(); | |||
base.OnStartup(e); | |||
MenuInit(); | |||
DataInit(); | |||
Init(); | |||
@@ -249,7 +250,13 @@ namespace BPASmartClient.JXJFoodSmallStation | |||
AssemblyName = "BPASmartClient.JXJFoodSmallStation", | |||
ToggleWindowPath = "View.DeviceListView" | |||
}); | |||
DeviceMonitor.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "变量监控", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.JXJFoodSmallStation", | |||
ToggleWindowPath = "View.PlcVarMonitorView" | |||
}); | |||
DeviceMonitor.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "设备状态", | |||
@@ -0,0 +1,20 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
[AttributeUsage(AttributeTargets.Property)] | |||
public sealed class PlcCommAttribute:Attribute | |||
{ | |||
public PlcCommAttribute(string address,string des) | |||
{ | |||
Address = address; | |||
Describe = des; | |||
} | |||
public string Describe { get; set; } | |||
public string Address { get; set; } | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
public class PlcInfos: ObservableObject | |||
{ | |||
public int Count { get { return _Count; } set { _Count = value;OnPropertyChanged(); } } | |||
private int _Count { get; set; } | |||
public string Name { get { return _Name; } set { _Name = value; OnPropertyChanged(); } } | |||
private string _Name { get; set; } | |||
public string Address { get { return _Address; } set { _Address = value; OnPropertyChanged(); } } | |||
private string _Address { get; set; } | |||
public string Type { get { return _Type; } set { _Type = value; OnPropertyChanged(); } } | |||
private string _Type { get; set; } | |||
public string Describe { get { return _Describe; } set { _Describe = value; OnPropertyChanged(); } } | |||
private string _Describe { get; set; } | |||
public string Value { get { return _Value; } set { _Value = value; OnPropertyChanged(); } } | |||
private string _Value { get; set; } | |||
} | |||
} |
@@ -1,4 +1,5 @@ | |||
using BPASmartClient.JXJFoodSmallStation.Model.Siemens; | |||
using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC; | |||
using BPASmartClient.JXJFoodSmallStation.Model.Siemens; | |||
using System; | |||
using System.Collections.Concurrent; | |||
using System.Collections.Generic; | |||
@@ -15,12 +16,24 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
public static GVL_SmallStation GetInstance => SmallStation ?? (SmallStation = new GVL_SmallStation()); | |||
private GVL_SmallStation() { } | |||
public static PlcReadAddressDB3 plcReadDataDB3 { get; set; } = new PlcReadAddressDB3(); | |||
/// <summary> | |||
/// 订单取消 | |||
/// </summary> | |||
public static bool Order_Cancel { get; set; } | |||
/// <summary> | |||
/// 取消订单的编号 | |||
/// </summary> | |||
public static string Order_CancelRecipeCode { get; set; } = ""; | |||
/// <summary> | |||
/// 托盘1托盘到位 逻辑完成 | |||
/// </summary> | |||
public static bool TrayLogicFinish { get; set; } = false; | |||
public static int Tray1LogicFinish { get; set; } = 0; | |||
/// <summary> | |||
/// 托盘2托盘到位 逻辑完成 | |||
/// </summary> | |||
public static int Tray2LogicFinish { get; set; } = 0; | |||
/// <summary> | |||
/// 托盘1有货架 | |||
/// </summary> | |||
@@ -29,20 +42,39 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// 托盘2有货架 | |||
/// </summary> | |||
public static bool Station2HaveTray { get; set; } | |||
/// <summary> | |||
/// 托盘2有货架 | |||
/// </summary> | |||
public static int nStep { get; set; } | |||
/// <summary> | |||
/// 托盘1传感器信号 | |||
/// </summary> | |||
public static bool Station1Sensor { get; set; } | |||
/// <summary> | |||
/// 托盘2传感器信号 | |||
/// </summary> | |||
public static bool Station2Sensor { get; set; } | |||
/// <summary> | |||
/// 托盘1气缸信号 | |||
/// </summary> | |||
public static bool Station1Cylinder { get; set; } | |||
/// <summary> | |||
/// 托盘2气缸信号 | |||
/// </summary> | |||
public static bool Station2Cylinder { get; set; } | |||
/// <summary> | |||
/// AGV放托盘1完成 | |||
/// </summary> | |||
public static bool AGV_PutTray1Finish { get; set; } | |||
/// <summary> | |||
/// AGV取托盘1完成 | |||
/// </summary> | |||
public static bool AGV_GetTray1Finish { get; set; } | |||
public static bool AGV_PutTray2Finish { get; set; } | |||
public static bool AGV_GetTray2Finish { get; set; } | |||
public static bool CylinderReset { get; set; } | |||
/// <summary> | |||
/// 配料站料仓数目 | |||
@@ -59,13 +91,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// </summary> | |||
public static bool IsAllowSiemensSendRecipe { get; set; } = false; | |||
/// <summary> | |||
/// 西门子下发配方状态 0:等待下发配方 1:请求下发配方 2:上位机接收配方 3:配方接收完成 4:请求配料 5:西门子开始配料确认 6:配方配料完成 7:配料完成确认 | |||
/// 西门子下发配方状态 0:等待下发配方 1:请求下发配方 2:上位机接收配方 3:配方接收配方完成 4:上位机向西门子请求配料 5:西门子确认开始配料 6:西门子确认开始配料 信号复位 | |||
/// </summary> | |||
public static int SiemensSendRecipeStatus { get; set; } = 0; | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 | |||
/// </summary> | |||
public int RecipeStatusID { get; set; } = 0; | |||
public int RecipeStatusIDTray1 { get; set; } = 0; | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 | |||
@@ -146,6 +178,35 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// 系统运行状态 | |||
/// </summary> | |||
public static int Time { get; set; } = 1000; | |||
/// <summary> | |||
/// 取消订单的步骤: 1-9:配料过程中配方1取消配方 10-19:配料过程中配方2取消配方 20-29:下发订单的过程中取消订单(订单未到达上位机) 30-39:下发订单的过程中取消订单(订单未到达PLC) | |||
/// </summary> | |||
public static int OrderCancelStep = 0; | |||
/// <summary> | |||
/// 机器人的状态 | |||
/// </summary> | |||
public static ushort RobotStatus = 0; | |||
/// <summary> | |||
/// 机器人的状态 | |||
/// </summary> | |||
public static byte RobotProgramNum = 0; | |||
#endregion | |||
} | |||
public enum IssueRecipeCondition | |||
{ | |||
等待小料站PLC允许下配方, | |||
等待西门子下发配方, | |||
等待西门子下发配方信号复位, | |||
等待上位机请求配料, | |||
等待西门子确认配料, | |||
等待西门子确认配料信号复位, | |||
} | |||
public enum ProcessCondition | |||
{ | |||
等待AGV到位, | |||
等待小料站PLC接受配方完成, | |||
等待配方配料完成, | |||
等待AGV取托盘完成 | |||
} | |||
} |
@@ -1,41 +0,0 @@ | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.Modbus; | |||
using System; | |||
using System.Collections.Concurrent; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC | |||
{ | |||
public class DataComm | |||
{ | |||
public volatile static DataComm Instance; | |||
public static DataComm GetInstance => Instance ?? (new DataComm()); | |||
public DataComm() { } | |||
/// <summary> | |||
/// 是否允许配料 | |||
/// </summary> | |||
public bool IsAllowDosing { get { return _mIsAllowDosing; } set { _mIsAllowDosing = value; } } | |||
private bool _mIsAllowDosing; | |||
public bool DosingFinishToPLC { get { return _mDosingFinishToPLC; } set { _mDosingFinishToPLC = value; } } | |||
private bool _mDosingFinishToPLC; | |||
private int _mStockBinLocationToPLC; | |||
public int StockBinLocationToPLC { get { return _mStockBinLocationToPLC; } set { _mStockBinLocationToPLC = value; } } | |||
public bool StatusSignToBPA { get { return _mStatusSignToBPA; } set { _mStatusSignToBPA = value; } } | |||
private bool _mStatusSignToBPA; | |||
private int _mStockBinLocationToBPA; | |||
public int StockBinLocationToBPA { get { return _mStockBinLocationToBPA; } set { _mStockBinLocationToBPA = value; } } | |||
private int _mBarrelNumToPLC; | |||
public int BarrelNumToPLC { get { return _mBarrelNumToPLC; } set { _mBarrelNumToPLC = value; } } | |||
/*public ConcurrentDictionary<int, StockBinLocations> DeviceLists = new ConcurrentDictionary<int, StockBinLocations>();*/ | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC | |||
{ | |||
public class HKDeviceRead | |||
{ | |||
public bool HeartBeat { get; set; } | |||
public bool SystemMode { get; set; } | |||
public bool SystemStart { get; set; } | |||
public bool SystemPause { get; set; } | |||
} | |||
} |
@@ -27,42 +27,47 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC | |||
{ | |||
DeviceStatus = data; | |||
} | |||
var res1 = this.HK_PLC_S7.ReadClass<PlcReadAddressDB3>(3); | |||
if (res1 != null && res1 is PlcReadAddressDB3 data1) | |||
{ | |||
GVL_SmallStation.plcReadDataDB3 = data1; | |||
} | |||
} | |||
}),"海科PLC设备状态",true); | |||
} | |||
/// <summary> | |||
/// 单个配料机配料完成 | |||
/// </summary> | |||
/// <param name="value"></param> | |||
public void SingleDosing(uint value) | |||
{ | |||
if (IsConnected) | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.SingleStockBinLocationToPLC, value); | |||
HK_PLC_S7.Write(HKPlcCommAddress.SingleDosingFinishToPLC, (ushort)1); | |||
} | |||
} | |||
/// <summary> | |||
/// 复位plc允许接料信号 | |||
/// </summary> | |||
public void AllowDosingSignReset() | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.IsAllowDosing,(ushort)0); | |||
} | |||
/// <summary> | |||
/// 复位plc到达某料仓信号 | |||
/// </summary> | |||
public void StockStateSignReset() | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.StockState, (ushort)0); | |||
} | |||
/// <summary> | |||
/// 复位一个配方配料完成信号 | |||
/// </summary> | |||
public void RecipeDosingFinishReset() | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.RecipeDosingFinish, (ushort)0); | |||
} | |||
///// <summary> | |||
///// 单个配料机配料完成 | |||
///// </summary> | |||
///// <param name="value"></param> | |||
//public void SingleDosing(uint value) | |||
//{ | |||
// if (IsConnected) | |||
// { | |||
// HK_PLC_S7.Write(HKPlcCommAddress.SingleStockBinLocationToPLC, value); | |||
// HK_PLC_S7.Write(HKPlcCommAddress.SingleDosingFinishToPLC, (ushort)1); | |||
// } | |||
//} | |||
///// <summary> | |||
///// 复位plc允许接料信号 | |||
///// </summary> | |||
//public void AllowDosingSignReset() | |||
//{ | |||
// HK_PLC_S7.Write(HKPlcCommAddress.IsAllowDosing,(ushort)0); | |||
//} | |||
///// <summary> | |||
///// 复位plc到达某料仓信号 | |||
///// </summary> | |||
//public void StockStateSignReset() | |||
//{ | |||
// HK_PLC_S7.Write(HKPlcCommAddress.StockState, (ushort)0); | |||
//} | |||
///// <summary> | |||
///// 复位一个配方配料完成信号 | |||
///// </summary> | |||
//public void RecipeDosingFinishReset() | |||
//{ | |||
// HK_PLC_S7.Write(HKPlcCommAddress.RecipeDosingFinish, (ushort)0); | |||
//} | |||
/// <summary> | |||
/// 下发配方数据 | |||
/// </summary> | |||
@@ -1,4 +1,5 @@ | |||
using System; | |||
using BPASmartClient.JXJFoodSmallStation.Model.GVL; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
@@ -8,8 +9,170 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC | |||
{ | |||
public class PlcReadAddressDB3 | |||
{ | |||
public bool[] VarBool { get; set; } =new bool[17]; | |||
public Single[] BarrelPos { get; set; } = new Single[8]; | |||
public bool[] IsAllowDosing { get; set; } = new bool[8]; | |||
[PlcComm("DB3.DBX0.0","心跳")] | |||
public bool HeartBeat { get; set; } | |||
[PlcComm("DB3.DBX0.1", "备用1")] | |||
public bool Standby1 { get; set; } | |||
[PlcComm("DB3.DBX0.2", "备用2")] | |||
public bool Standby2 { get; set; } | |||
[PlcComm("DB3.DBX0.3", "备用3")] | |||
public bool Standby3 { get; set; } | |||
[PlcComm("DB3.DBX0.4", "备用4")] | |||
public bool Standby4 { get; set; } | |||
[PlcComm("DB3.DBX0.5", "备用5")] | |||
public bool Standby5 { get; set; } | |||
[PlcComm("DB3.DBX0.6", "备用6")] | |||
public bool Standby6 { get; set; } | |||
[PlcComm("DB3.DBX0.7", "工站1有托盘")] | |||
public bool WorkStation1HaveTray { get; set; } | |||
[PlcComm("DB3.DBX1.0", "工站2有托盘")] | |||
public bool WorkStation2HaveTray { get; set; } | |||
[PlcComm("DB3.DBX1.1", "工站1配料完成")] | |||
public bool WorkStation1DosingComplete { get; set; } | |||
[PlcComm("DB3.DBX1.2", "工站2配料完成")] | |||
public bool WorkStation2DosingComplete { get; set; } | |||
[PlcComm("DB3.DBX1.3", "工站1接收配方完成")] | |||
public bool WorkStation1ReceviceRecipeComplete { get; set; } | |||
[PlcComm("DB3.DBX1.4", "工站2接收配方完成")] | |||
public bool WorkStation2ReceviceRecipeComplete { get; set; } | |||
[PlcComm("DB3.DBX1.5", "工站1气缸报警")] | |||
public bool WorkStation1CylinderAlarm { get; set; } | |||
[PlcComm("DB3.DBX1.6", "工站2气缸报警")] | |||
public bool WorkStation2CylinderAlarm { get; set; } | |||
[PlcComm("DB3.DBX1.7", "允许配方1下发配方")] | |||
public bool AllowRecipe1Issue { get; set; } | |||
[PlcComm("DB3.DBX2.0", "允许配方2下发配方")] | |||
public bool AllowRecipe2Issue { get; set; } | |||
[PlcComm("DB3.DBX2.1", "工站1传感器信号")] | |||
public bool WorkStation1Sensor { get; set; } | |||
[PlcComm("DB3.DBX2.2", "工站2传感器信号")] | |||
public bool WorkStation2Sensor { get; set; } | |||
[PlcComm("DB3.DBX2.3", "工站1气缸信号,false=伸出")] | |||
public bool WorkStation1Cylinder { get; set; } | |||
[PlcComm("DB3.DBX2.4", "工站2气缸信号,false=伸出")] | |||
public bool WorkStation2Cylinder { get; set; } | |||
[PlcComm("DB3.DBX2.5", "工站1取消订单")] | |||
public bool WorkStation1OrderCancel { get; set; } | |||
[PlcComm("DB3.DBX2.6", "工站2取消订单")] | |||
public bool WorkStation2OrderCancel { get; set; } | |||
[PlcComm("DB3.DBX2.7", "备用7")] | |||
public bool Standby7 { get; set; } | |||
[PlcComm("DB3.DBB3", "备用")] | |||
public byte Standby81 { get; set; } | |||
[PlcComm("DB3.DBB4", "备用")] | |||
public byte Standby82 { get; set; } | |||
[PlcComm("DB3.DBB5", "备用")] | |||
public byte Standby83 { get; set; } | |||
[PlcComm("DB3.DBW6", "备用")] | |||
public int Standby9 { get; set; } | |||
[PlcComm("DB3.DBD10", "工站1_1号桶的位置")] | |||
public int WorkStation1Barrel1Pos { get; set; } | |||
[PlcComm("DB3.DBD14", "工站1_2号桶的位置")] | |||
public int WorkStation1Barrel2Pos { get; set; } | |||
[PlcComm("DB3.DBD18", "工站1_3号桶的位置")] | |||
public int WorkStation1Barrel3Pos { get; set; } | |||
[PlcComm("DB3.DBD22", "工站1_4号桶的位置")] | |||
public int WorkStation1Barrel4Pos { get; set; } | |||
[PlcComm("DB3.DBD26", "工站2_1号桶的位置")] | |||
public int WorkStation2Barrel1Pos { get; set; } | |||
[PlcComm("DB3.DBD30", "工站2_2号桶的位置")] | |||
public int WorkStation2Barrel2Pos { get; set; } | |||
[PlcComm("DB3.DBD34", "工站2_3号桶的位置")] | |||
public int WorkStation2Barrel3Pos { get; set; } | |||
[PlcComm("DB3.DBD38", "工站2_4号桶的位置")] | |||
public int WorkStation2Barrel4Pos { get; set; } | |||
[PlcComm("DB3.DBD42", "备用")] | |||
public int StandBy42 { get; set; } | |||
[PlcComm("DB3.DBD46", "备用")] | |||
public int StandBy46 { get; set; } | |||
[PlcComm("DB3.DBX50.0", "工站1_1号桶允许配料")] | |||
public bool WorkStation1Barrel1AllowDosing { get; set; } | |||
[PlcComm("DB3.DB50.1", "工站1_2号桶允许配料")] | |||
public bool WorkStation1Barrel2AllowDosing { get; set; } | |||
[PlcComm("DB3.DB50.2", "工站1_3号桶允许配料")] | |||
public bool WorkStation1Barrel3AllowDosing { get; set; } | |||
[PlcComm("DB3.DB50.3", "工站1_4号桶允许配料")] | |||
public bool WorkStation1Barrel4AllowDosing { get; set; } | |||
[PlcComm("DB3.DB50.4", "工站2_1号桶允许配料")] | |||
public bool WorkStation2Barrel1AllowDosing { get; set; } | |||
[PlcComm("DB3.DB50.5", "工站2_2号桶允许配料")] | |||
public bool WorkStation2Barrel2AllowDosing { get; set; } | |||
[PlcComm("DB3.DB50.6", "工站2_3号桶允许配料")] | |||
public bool WorkStation2Barrel3AllowDosing { get; set; } | |||
[PlcComm("DB3.DB50.7", "工站2_4号桶允许配料")] | |||
public bool WorkStation2Barrel4AllowDosing { get; set; } | |||
[PlcComm("DB3.DBD52", "备用")] | |||
public int Standby15 { get; set; } | |||
[PlcComm("DB3.DBD56", "备用")] | |||
public int Standby16 { get; set; } | |||
[PlcComm("DB3.DBD60", "备用")] | |||
public int Standby17 { get; set; } | |||
[PlcComm("DB3.DBD64", "备用")] | |||
public int Standby18 { get; set; } | |||
[PlcComm("DB3.DBD68", "备用")] | |||
public int Standby19 { get; set; } | |||
[PlcComm("DB3.DBD72", "备用")] | |||
public int Standby20 { get; set; } | |||
[PlcComm("DB3.DBD76", "备用")] | |||
public int Standby21 { get; set; } | |||
[PlcComm("DB3.DBD80", "备用")] | |||
public int Standby22 { get; set; } | |||
[PlcComm("DB3.DBD84", "备用")] | |||
public int Standby23 { get; set; } | |||
[PlcComm("DB3.DBD88", "备用")] | |||
public int Standby24 { get; set; } | |||
[PlcComm("DB3.DBD92", "备用")] | |||
public int Standby25 { get; set; } | |||
[PlcComm("DB3.DBD96", "备用")] | |||
public int Standby26 { get; set; } | |||
[PlcComm("DB3.DBX100.0", "机器人运行模式")] | |||
public bool RobotRunMode { get; set; } | |||
[PlcComm("DB3.DBX100.1", "机器人自动运行")] | |||
public bool RobotAutoRun { get; set; } | |||
[PlcComm("DB3.DBX100.2", "机器人停止")] | |||
public bool RobotStop { get; set; } | |||
[PlcComm("DB3.DBX100.3", "机器人运行")] | |||
public bool RobotRun { get; set; } | |||
[PlcComm("DB3.DBX100.4", "机器人运行报警")] | |||
public bool RobotRunAlarm { get; set; } | |||
[PlcComm("DB3.DBX100.5", "机器人在原点")] | |||
public bool RobotInHomed { get; set; } | |||
[PlcComm("DB3.DBX100.6", "机器人备用")] | |||
public bool Standby30 { get; set; } | |||
[PlcComm("DB3.DBX100.7", "机器人取空桶完成")] | |||
public bool RobotGetEmptyBarrelComplete { get; set; } | |||
[PlcComm("DB3.DBX101.0", "机器人放空桶完成")] | |||
public bool RobotPutEmptyBarrelComplete { get; set; } | |||
[PlcComm("DB3.DBX101.1", "机器人取满桶完成")] | |||
public bool RobotGetFullBarrelComplete { get; set; } | |||
[PlcComm("DB3.DBX101.2", "机器人放满桶完成")] | |||
public bool RobotPutFullBarrelComplete { get; set; } | |||
[PlcComm("DB3.DBX101.3", "备用")] | |||
public bool Standby31 { get; set; } | |||
[PlcComm("DB3.DBX101.4", "备用")] | |||
public bool Standby32 { get; set; } | |||
[PlcComm("DB3.DBX101.5", "备用")] | |||
public bool Standby33 { get; set; } | |||
[PlcComm("DB3.DBX101.6", "备用")] | |||
public bool Standby34 { get; set; } | |||
[PlcComm("DB3.DBX101.7", "备用")] | |||
public bool Standby35 { get; set; } | |||
[PlcComm("DB3.DBB102", "机器人运行的程序号")] | |||
public byte RobotProgramNum { get; set; } | |||
[PlcComm("DB3.DBB103", "备用")] | |||
public byte Standby36 { get; set; } | |||
[PlcComm("DB3.DBB104", "备用")] | |||
public byte Standby37 { get; set; } | |||
[PlcComm("DB3.DBB105", "备用")] | |||
public byte Standby38 { get; set; } | |||
} | |||
} |
@@ -177,7 +177,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
private void _myPing_PingCompleted(object sender, PingCompletedEventArgs e) | |||
{ | |||
if (e.Reply.Status == IPStatus.Success) | |||
if (e.Reply != null && e.Reply.Status == IPStatus.Success) | |||
{ | |||
string ip = e.Reply.Address.ToString(); | |||
if (!DeviceLists.ContainsKey(ip)) | |||
@@ -280,7 +280,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
else IPQueues.Enqueue(e.Reply.Address.ToString()); | |||
} | |||
else IPQueues.Enqueue(e.Reply.Address.ToString()); | |||
else | |||
{ | |||
if (e.Reply != null) | |||
IPQueues.Enqueue(e.Reply.Address.ToString()); | |||
} | |||
} | |||
} | |||
@@ -64,6 +64,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
public int StirringSpeed { get { return _mStirringSpeed; } set { _mStirringSpeed = value; OnPropertyChanged(); } } | |||
private int _mStirringSpeed; | |||
public float ErrorRange { get { return _mErrorRange; } set { _mErrorRange = value; OnPropertyChanged(); } } | |||
private float _mErrorRange; | |||
/// <summary> | |||
/// 是否重复 | |||
/// </summary> | |||
@@ -38,5 +38,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// </summary> | |||
public ObservableCollection<WindSendRawMaterial> WindSend { get; set; } = new ObservableCollection<WindSendRawMaterial>(); | |||
} | |||
} |
@@ -10,5 +10,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||
public class RemoteRecipeDataColl | |||
{ | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
public int RecipesStatus { get; set; } | |||
} | |||
} |
@@ -29,35 +29,52 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||
//var DataColl = this.Siemens_PLC_S7.ReadClass<XL_DataColl_DB>(2291); | |||
if (Start != null && Start is XL_Start_DB st) | |||
{ | |||
if (GVL_SmallStation.IsAllowSiemensSendRecipe && GVL_SmallStation.SiemensSendRecipeStatus == 0) | |||
switch (GVL_SmallStation.SiemensSendRecipeStatus) | |||
{ | |||
GVL_SmallStation.SiemensSendRecipeStatus = 1; | |||
this.Siemens_PLC_S7.Write("DB2201.DBX450.0", true); | |||
case 0: | |||
if (GVL_SmallStation.IsAllowSiemensSendRecipe) | |||
{ | |||
this.Siemens_PLC_S7.Write("DB2201.DBX450.0", true); | |||
GVL_SmallStation.SiemensSendRecipeStatus = 1; | |||
} | |||
break; | |||
case 1: | |||
if (Start.Order_Request_ACK) | |||
{ | |||
if (!string.IsNullOrEmpty(st.RecipeCode)) | |||
{ | |||
GVL_SmallStation.SiemensSendRecipeStatus = 2; | |||
ActionManage.GetInstance.Send("SiemensRecipeRecive", st); | |||
this.Siemens_PLC_S7.Write("DB2201.DBX450.0", false); | |||
} | |||
} | |||
break; | |||
case 2: | |||
if (Start.Order_Request_ACK == false) | |||
{ | |||
GVL_SmallStation.IsAllowSiemensSendRecipe = false; | |||
GVL_SmallStation.SiemensSendRecipeStatus = 3; | |||
} | |||
break; | |||
} | |||
if (Start.Order_Request_ACK && GVL_SmallStation.SiemensSendRecipeStatus == 1) | |||
if (RTrig.GetInstance("Order_Cancel").Start(st.Order_Cancel)) //订单取消 | |||
{ | |||
if (!string.IsNullOrEmpty(st.RecipeCode)) | |||
if (GVL_SmallStation.Order_Cancel == false) | |||
{ | |||
GVL_SmallStation.SiemensSendRecipeStatus = 2; | |||
ActionManage.GetInstance.Send("SiemensRecipeRecive", st); | |||
this.Siemens_PLC_S7.Write("DB2201.DBX450.0", false); | |||
GVL_SmallStation.Order_Cancel = true; | |||
GVL_SmallStation.Order_CancelRecipeCode = st.RecipeCode; | |||
GVL_SmallStation.OrderCancelStep = 0; | |||
MessageNotify.GetInstance.ShowRunLog($"西门子下发取消工单指令:{st.RecipeName}"); | |||
} | |||
else | |||
{ | |||
MessageNotify.GetInstance.ShowRunLog($"订单正在取消,请等待订单{ GVL_SmallStation.Order_CancelRecipeCode}取消完成,再取消订单:{st.RecipeName}"); | |||
} | |||
} | |||
if (Start.Order_Request_ACK == false && GVL_SmallStation.SiemensSendRecipeStatus == 2) | |||
{ | |||
GVL_SmallStation.IsAllowSiemensSendRecipe = false; | |||
GVL_SmallStation.SiemensSendRecipeStatus = 3; | |||
} | |||
if (RTrig.GetInstance("Order_Cancel").Start(st.Order_Cancel)) //订单取消 | |||
{ | |||
GVL_SmallStation.Order_Cancel = true; | |||
GVL_SmallStation.Order_CancelRecipeCode = st.RecipeCode; | |||
MessageNotify.GetInstance.ShowRunLog($"西门子下发取消工单指令:{st.RecipeName}"); | |||
} | |||
} | |||
if (Finish != null && Finish is XL_Finish_DB FinishData) | |||
{ | |||
if (FinishData.Ask_For_Finish_PLC && GVL_SmallStation.SiemensSendRecipeStatus == 7) | |||
if (FinishData.Ask_For_Finish_PLC) | |||
{ | |||
FinishData.Order_No = ""; | |||
FinishData.Product_Code = ""; | |||
@@ -70,7 +87,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||
{ | |||
FinishData.Powder[i] = new UDT2(); | |||
} | |||
GVL_SmallStation.SiemensSendRecipeStatus = 0; | |||
FinishData.Ask_For_Finish = false; | |||
FinishData.DosingTime = 0; | |||
this.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(FinishData, 2261); | |||
@@ -166,6 +166,7 @@ | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
@@ -227,15 +228,21 @@ | |||
Text="搅拌速度" /> | |||
<Grid Grid.Column="9"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="精度误差阈值(±g)" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Grid Grid.Column="10"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="功能操作" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Border | |||
Grid.ColumnSpan="10" | |||
Grid.ColumnSpan="11" | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" /> | |||
@@ -259,6 +266,7 @@ | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<TextBox | |||
@@ -334,22 +342,27 @@ | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding StirringSpeed}" /> | |||
<Grid Grid.Column="9"> | |||
<Button | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding MaterialName}" | |||
Content="删除" | |||
FontSize="16" | |||
Style="{StaticResource ControlButtonStyle}" /> | |||
<TextBox | |||
Foreground="Red" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding ErrorRange}" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Button Grid.Column="10" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding MaterialName}" | |||
Content="删除" | |||
FontSize="16" | |||
Style="{StaticResource ControlButtonStyle}" /> | |||
<Border | |||
Grid.ColumnSpan="10" | |||
Grid.ColumnSpan="11" | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,1" /> | |||
@@ -132,8 +132,10 @@ | |||
<TextBlock Text="{Binding Heartbeat}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel Grid.Row="1"> | |||
<TextBlock Text="当前系统状态:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="当前下发配方状态:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding OrderStatus}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
<TextBlock Text="当前配料状态:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding OrderDosingStatus}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel Grid.Row="2"> | |||
<TextBlock Text="柔性味魔方配料完成,延迟复位时间:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
@@ -0,0 +1,99 @@ | |||
<UserControl x:Class="BPASmartClient.JXJFoodSmallStation.View.PlcVarMonitorView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel" | |||
mc:Ignorable="d" | |||
d:DesignHeight="1080" d:DesignWidth="1920"> | |||
<UserControl.DataContext> | |||
<vm:PlcVarMonitorViewModel /> | |||
</UserControl.DataContext> | |||
<Border BorderThickness="0" BorderBrush="{StaticResource bordColor}"> | |||
<Grid Margin="0,10"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="60"></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
</Grid.RowDefinitions> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="3*"></ColumnDefinition> | |||
<ColumnDefinition Width="8*"></ColumnDefinition> | |||
<ColumnDefinition Width="4*"></ColumnDefinition> | |||
<ColumnDefinition Width="4*"></ColumnDefinition> | |||
<ColumnDefinition Width="10*"></ColumnDefinition> | |||
<ColumnDefinition Width="3*"></ColumnDefinition> | |||
<ColumnDefinition Width="17"></ColumnDefinition> | |||
</Grid.ColumnDefinitions> | |||
<Grid> | |||
<TextBlock Text="序号" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1,1,0,0" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="1"> | |||
<TextBlock Text="名称" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1,1,0,0" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="2"> | |||
<TextBlock Text="地址" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1,1,0,0" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="3"> | |||
<TextBlock Text="类型" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1,1,0,0" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="4"> | |||
<TextBlock Text="描述" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1,1,0,0" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="5"> | |||
<TextBlock Text="当前值" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1,1,0,0" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
</Grid> | |||
<Grid Grid.Row="1"> | |||
<ScrollViewer> | |||
<ItemsControl ItemsSource="{Binding plcInfos}" Foreground="Aqua"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="3*"></ColumnDefinition> | |||
<ColumnDefinition Width="8*"></ColumnDefinition> | |||
<ColumnDefinition Width="4*"></ColumnDefinition> | |||
<ColumnDefinition Width="4*"></ColumnDefinition> | |||
<ColumnDefinition Width="10*"></ColumnDefinition> | |||
<ColumnDefinition Width="3*"></ColumnDefinition> | |||
</Grid.ColumnDefinitions> | |||
<Grid> | |||
<TextBlock Text="{Binding Count}" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="1"> | |||
<TextBlock Text="{Binding Name}" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="2"> | |||
<TextBlock Text="{Binding Address}" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="3"> | |||
<TextBlock Text="{Binding Type}" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="4"> | |||
<TextBlock Text="{Binding Describe}" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
<Grid Grid.Column="5"> | |||
<TextBlock Text="{Binding Value}" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"></TextBlock> | |||
<Border BorderThickness="1" Cursor="SizeWE" BorderBrush="{StaticResource bordColor}"></Border> | |||
</Grid> | |||
</Grid> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
</ItemsControl> | |||
</ScrollViewer> | |||
</Grid> | |||
</Grid> | |||
</Border> | |||
</UserControl> |
@@ -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.JXJFoodSmallStation.View | |||
{ | |||
/// <summary> | |||
/// PlcVarMonitor.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class PlcVarMonitorView : UserControl | |||
{ | |||
public PlcVarMonitorView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -50,110 +50,56 @@ | |||
<Grid Margin="10"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="7*"/> | |||
<ColumnDefinition Width="3*"/> | |||
<ColumnDefinition Width="4*"/> | |||
<ColumnDefinition Width="4*"/> | |||
<ColumnDefinition Width="4*"/> | |||
</Grid.ColumnDefinitions> | |||
<!--#region 表格标题栏设置--> | |||
<!--<Grid> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="left" VerticalAlignment="Center"> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding Test1Command}" | |||
Content="AGV送托盘完成" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding Test2Command}" | |||
Content="粉料仓配料完成" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding Test3Command}" | |||
Content="AGV取托盘完成" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding Test4Command}" | |||
Content="气缸收紧错位复位" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding Test5Command}" | |||
Content="粉料仓提升到位" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding Test6Command}" | |||
Content="AGV放货架流程完成" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="50,0,50,0" | |||
Command="{Binding BPAResetCommand}" | |||
Content="上位机初始化" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
</StackPanel> | |||
</Grid> | |||
<Grid Grid.Row="1"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="left" VerticalAlignment="Center"> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding SystemReset}" | |||
Content="系统复位" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Button | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding CLearRecipeInfo}" | |||
Content="配方清零" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Grid> | |||
<StackPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人自动运行模式:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAutoMode}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人正在自动运行:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAutoRun}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人停止状态:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsStop}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行正常:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsRun}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行故障:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAlarm}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人在Home点:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsHomed}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓空桶完成:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetEmptyBarrelComplete}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放空桶完成:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutEmptyBarrelComplete}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓满桶完成:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetFullBarrelComplete}"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放满桶完成:"></TextBlock> | |||
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutFullBarrelComplete}"></TextBlock> | |||
</WrapPanel> | |||
</StackPanel> | |||
</Grid> | |||
<Grid Grid.Row="2"> | |||
<WrapPanel> | |||
<TextBlock Text="心跳:" Foreground="#FF2AB2E7" FontSize="25" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBlock Text="{Binding Heartbeat}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="10"></TextBlock> | |||
</WrapPanel> | |||
</Grid>--> | |||
<Grid> | |||
<Grid Grid.Column="1"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="1*"></RowDefinition> | |||
<RowDefinition Height="7*"></RowDefinition> | |||
@@ -180,21 +126,15 @@ | |||
Background="OrangeRed"></Button> | |||
<Button | |||
Grid.Column="2" | |||
Grid.ColumnSpan="2" | |||
Margin="20,15" | |||
Command="{Binding AlarmReset}" | |||
Content="故障复位" | |||
FontSize="40" | |||
Background="LightYellow"></Button> | |||
<Button | |||
Grid.Column="3" | |||
Margin="20,15" | |||
Command="{Binding SystemReset}" | |||
Content="设备复位" | |||
Command="{Binding EStopReset}" | |||
Content="急停复位" | |||
FontSize="40" | |||
Background="DodgerBlue"></Button> | |||
</Grid> | |||
</Grid> | |||
<Grid Grid.Column="1"> | |||
<Grid Grid.Column="2"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
@@ -226,16 +166,17 @@ | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Grid Grid.Row="1" Grid.ColumnSpan="2"> | |||
<WrapPanel Orientation="Vertical"> | |||
<StackPanel Orientation="Vertical"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<TextBlock Text="机器人正在运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock> | |||
<TextBlock Text="{Binding IsRunProgramNum}" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBlock> | |||
</WrapPanel> | |||
<WrapPanel Orientation="Horizontal" VerticalAlignment="Center"> | |||
<TextBlock Text="机器人需要运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock> | |||
<TextBox Text="{Binding SetProgramNum}" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBox> | |||
<TextBox Text="{Binding SetProgramNum}" Width="50" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBox> | |||
<Button FontSize="20" Height="40" Command="{Binding SetProgramNumCommand}" Content="设置" Style="{StaticResource ImageButtonStyle}"></Button> | |||
</WrapPanel> | |||
</WrapPanel> | |||
</StackPanel> | |||
</Grid> | |||
<Button | |||
Grid.Row="2" | |||
@@ -322,7 +263,7 @@ | |||
</DataTemplate> | |||
</ListView.ItemTemplate> | |||
</ListView>--> | |||
<Grid Grid.Row="1"> | |||
<Grid Grid.Row="1" Visibility="Hidden"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
@@ -330,17 +271,33 @@ | |||
<Grid.RowDefinitions> | |||
<RowDefinition></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
</Grid.RowDefinitions> | |||
<Grid Grid.ColumnSpan="2"> | |||
<TextBlock Text="托盘气缸控制" Foreground="#FF2AB2E7" FontSize="25" Margin="20,15" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock> | |||
<Grid Grid.Row="0"> | |||
<Button | |||
Margin="20,5" | |||
Command="{Binding RobotGetEmptyBarrel}" | |||
Content="允许机器人抓空桶" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
</Grid> | |||
<Grid Grid.Column="1"> | |||
<Button | |||
Margin="20,5" | |||
Command="{Binding RobotPutEmptyBarrel}" | |||
Content="允许机器人放空桶" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
</Grid> | |||
<Grid Grid.Row="1"> | |||
<Button | |||
Margin="20,5" | |||
Command="{Binding Tray1Cylinder}" | |||
Content="1#托盘气缸" | |||
FontSize="32" | |||
Command="{Binding RobotGetFullBarrel}" | |||
Content="允许机器人抓满桶" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
</Grid> | |||
<Grid Grid.Row="1" Grid.Column="1"> | |||
<Button | |||
Margin="20,5" | |||
Command="{Binding RobotPutFullBarrel}" | |||
Content="允许机器人放满桶" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
</Grid> | |||
</Grid> | |||
@@ -76,33 +76,44 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
switch (GVL_SmallStation.SiemensSendRecipeStatus) | |||
{ | |||
case 0: | |||
OrderStatus = "初始状态"; | |||
OrderStatus = IssueRecipeCondition.等待小料站PLC允许下配方.ToString(); | |||
break; | |||
case 1: | |||
OrderStatus = "向西门子请求配方"; | |||
OrderStatus = IssueRecipeCondition.等待西门子下发配方.ToString(); | |||
break; | |||
case 2: | |||
OrderStatus = "上位机接收到配方"; | |||
OrderStatus = IssueRecipeCondition.等待西门子下发配方信号复位.ToString(); | |||
break; | |||
case 3: | |||
OrderStatus = "西门子确认上位机接收到配方"; | |||
OrderStatus = IssueRecipeCondition.等待上位机请求配料.ToString(); | |||
break; | |||
case 4: | |||
OrderStatus = "上位机向西门子请求配料"; | |||
OrderStatus = IssueRecipeCondition.等待西门子确认配料.ToString(); | |||
break; | |||
case 5: | |||
OrderStatus = "西门子确认配料"; | |||
OrderStatus = IssueRecipeCondition.等待西门子确认配料信号复位.ToString(); | |||
break; | |||
case 6: | |||
OrderStatus = "上位机将配方进行配料"; | |||
break; | |||
case 7: | |||
OrderStatus = "配料完成"; | |||
OrderStatus = "上位机将配方添加到队列中"; | |||
break; | |||
default: | |||
OrderStatus = "无意义"; | |||
break; | |||
} | |||
switch (GVL_SmallStation.GetInstance.RecipeStatusIDTray1) | |||
{ | |||
case 0: | |||
OrderDosingStatus = ProcessCondition.等待AGV到位.ToString(); | |||
break; | |||
case 1: | |||
OrderDosingStatus = ProcessCondition.等待小料站PLC接受配方完成.ToString(); | |||
break; | |||
case 2: | |||
OrderDosingStatus = ProcessCondition.等待配方配料完成.ToString(); | |||
break; | |||
default: | |||
break; | |||
} | |||
Thread.Sleep(100); | |||
}), "流程手动设备状态读取",true); | |||
TimeSet = new RelayCommand(() => | |||
@@ -126,7 +137,8 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
private int _mtime; | |||
public static string OrderStatus { get { return _mOrderStatus; } set { _mOrderStatus = value; OnStaticPropertyChanged(); } } | |||
private static string _mOrderStatus = "无意义"; | |||
public static string OrderDosingStatus { get { return _mOrderDosingStatus; } set { _mOrderDosingStatus = value; OnStaticPropertyChanged(); } } | |||
private static string _mOrderDosingStatus = "无意义"; | |||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged; | |||
public static void OnStaticPropertyChanged([CallerMemberName] string PropName = "") | |||
{ | |||
@@ -0,0 +1,23 @@ | |||
using BPASmartClient.JXJFoodSmallStation.Model; | |||
using BPASmartClient.JXJFoodSmallStation.Model.GVL; | |||
using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Reflection; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
public class PlcVarMonitorViewModel : ObservableObject | |||
{ | |||
public PlcVarMonitorViewModel() | |||
{ | |||
} | |||
public ObservableCollection<PlcInfos> plcInfos => ProcessControl.GetInstance.CommData; | |||
} | |||
} |
@@ -23,19 +23,100 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
public RobotViewModel() | |||
{ | |||
ThreadManage.GetInstance().StartLong(() => | |||
{ | |||
IsRunProgramNum = GVL_SmallStation.RobotProgramNum; | |||
RobotIsAutoMode = GVL_SmallStation.RobotStatus.GetBitValue(1); | |||
RobotIsAutoRun = GVL_SmallStation.RobotStatus.GetBitValue(2); | |||
RobotIsStop = GVL_SmallStation.RobotStatus.GetBitValue(3); | |||
RobotIsRun = GVL_SmallStation.RobotStatus.GetBitValue(4); | |||
RobotIsAlarm = GVL_SmallStation.RobotStatus.GetBitValue(5); | |||
RobotIsHomed = GVL_SmallStation.RobotStatus.GetBitValue(6); | |||
RobotGetEmptyBarrelComplete = GVL_SmallStation.RobotStatus.GetBitValue(8); | |||
RobotPutEmptyBarrelComplete = GVL_SmallStation.RobotStatus.GetBitValue(9); | |||
RobotGetFullBarrelComplete = GVL_SmallStation.RobotStatus.GetBitValue(10); | |||
RobotPutFullBarrelComplete = GVL_SmallStation.RobotStatus.GetBitValue(11); | |||
},"机器人状态",true); | |||
SystemStart = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.0"); | |||
}); | |||
SystemStop = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.1"); | |||
}); | |||
EStopReset = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.2"); | |||
}); | |||
TestRobotRun = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.4"); | |||
}); | |||
AutoMode = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendFalseCommand", "DB4.DBX100.3"); | |||
}); | |||
TestMode = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.3"); | |||
}); | |||
RobotGetEmptyBarrel = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.7"); | |||
}); | |||
RobotPutEmptyBarrel = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX101.0"); | |||
}); | |||
RobotGetFullBarrel = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX101.1"); | |||
}); | |||
RobotPutFullBarrel = new RelayCommand(() => { | |||
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX101.2"); | |||
}); | |||
SetProgramNumCommand = new RelayCommand(() =>{ | |||
ActionManage.GetInstance.Send("RobotSetProgramNum", SetProgramNum); | |||
}); | |||
} | |||
public RelayCommand SystemStart { get; set; } | |||
public RelayCommand SystemStop { get; set; } | |||
public RelayCommand SystemReset { get; set; } | |||
public RelayCommand AlarmReset { get; set; } | |||
public RelayCommand EStopReset { get; set; } | |||
public RelayCommand TestRobotRun { get; set; } | |||
public RelayCommand Tray1Cylinder { get; set; } | |||
public RelayCommand AutoMode { get; set; } | |||
public RelayCommand TestMode { get; set; } | |||
public RelayCommand RobotGetEmptyBarrel { get; set; } | |||
public RelayCommand RobotPutEmptyBarrel { get; set; } | |||
public RelayCommand RobotGetFullBarrel { get; set; } | |||
public RelayCommand RobotPutFullBarrel { get; set; } | |||
public RelayCommand SetProgramNumCommand { get; set; } | |||
public short IsRunProgramNum { get { return _runProgramNum; } set { _runProgramNum = value;OnPropertyChanged(); } } | |||
private short _runProgramNum; | |||
public short SetProgramNum { get { return _SetProgramNum; } set { _SetProgramNum = value; OnPropertyChanged(); } } | |||
private short _SetProgramNum; | |||
public bool RobotIsAutoMode { get { return _RobotIsAutoMode; } set { _RobotIsAutoMode = value; OnPropertyChanged(); } } | |||
private bool _RobotIsAutoMode; | |||
public bool RobotIsAutoRun { get { return _RobotIsAutoRun; } set { _RobotIsAutoRun = value; OnPropertyChanged(); } } | |||
private bool _RobotIsAutoRun; | |||
public bool RobotIsStop { get { return _RobotIsStop; } set { _RobotIsStop = value; OnPropertyChanged(); } } | |||
private bool _RobotIsStop; | |||
public bool RobotIsRun { get { return _RobotIsRun; } set { _RobotIsRun = value; OnPropertyChanged(); } } | |||
private bool _RobotIsRun; | |||
public bool RobotIsAlarm { get { return _RobotIsAlarm; } set { _RobotIsAlarm = value; OnPropertyChanged(); } } | |||
private bool _RobotIsAlarm; | |||
public bool RobotIsHomed { get { return _RobotIsHomed; } set { _RobotIsHomed = value; OnPropertyChanged(); } } | |||
private bool _RobotIsHomed; | |||
public bool RobotGetEmptyBarrelComplete { get { return _RobotGetEmptyBarrelComplete; } set { _RobotGetEmptyBarrelComplete = value; OnPropertyChanged(); } } | |||
private bool _RobotGetEmptyBarrelComplete; | |||
public bool RobotPutEmptyBarrelComplete { get { return _RobotPutEmptyBarrelComplete; } set { _RobotPutEmptyBarrelComplete = value; OnPropertyChanged(); } } | |||
private bool _RobotPutEmptyBarrelComplete; | |||
public bool RobotGetFullBarrelComplete { get { return _RobotGetFullBarrelComplete; } set { _RobotGetFullBarrelComplete = value; OnPropertyChanged(); } } | |||
private bool _RobotGetFullBarrelComplete; | |||
public bool RobotPutFullBarrelComplete { get { return _RobotPutFullBarrelComplete; } set { _RobotPutFullBarrelComplete = value; OnPropertyChanged(); } } | |||
private bool _RobotPutFullBarrelComplete; | |||
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged; | |||
public static void OnStaticPropertyChanged([CallerMemberName] string PropName = "") | |||
{ | |||
@@ -34,7 +34,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
SaveRawMaterialPara = new RelayCommand(() => | |||
{ | |||
Json<DevicePar>.Save(); | |||
ProcessControl.GetInstance.testData(); | |||
ProcessControl.GetInstance.StockBinNameWithPos(); | |||
foreach (var item in Json<DevicePar>.Data.rawMaterialStockBin) | |||
{ | |||
MessageNotify.GetInstance.ShowUserLog($"料仓位置:"+ item.RawMaterialLocation+ ",物料编码:" + item.RawMaterialName); | |||
@@ -86,7 +86,6 @@ namespace BPASmartClient.JakaRobot | |||
{ | |||
jakaAPI.create_handler(ip.ToCharArray(), ref rshd); | |||
login = true; | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -98,7 +97,7 @@ namespace BPASmartClient.JakaRobot | |||
} | |||
Thread.Sleep(3000); | |||
} | |||
} | |||
} | |||
if (login && IsDeviceFirstInit==false) | |||
{ | |||
try | |||
@@ -663,10 +663,10 @@ namespace BPASmartClient.MorkS | |||
} | |||
//加汤 | |||
if (Delay.GetInstance("加汤延时判断").Start(mORKS.TakeMealDetect && mORKS.CookCompleteFlatBit, 1)) | |||
/*if (Delay.GetInstance("加汤延时判断").Start(mORKS.TakeMealDetect && mORKS.CookCompleteFlatBit, 1)) | |||
{ | |||
AddSoup(); | |||
} | |||
}*/ | |||
//取餐完成逻辑处理 | |||
if (Delay.GetInstance("CompleteChange1").Start(!mORKS.TakeMealDetect, 1) && mORKS.CookCompleteFlatBit == true) | |||
@@ -149,8 +149,30 @@ | |||
Margin="10 0 0 0" | |||
Style="{StaticResource TextBlockStyle}" | |||
Text="(秒)" /> | |||
<TextBlock | |||
FontSize="21" | |||
Margin="40 0 0 0" | |||
Style="{StaticResource TextBlockStyle}" | |||
Text="清洗加汤管道时间:" /> | |||
<TextBox | |||
Width="100" | |||
Margin="10,0,0,0" | |||
VerticalAlignment="Center" | |||
Background="Transparent" | |||
BorderBrush="#FF23CACA" | |||
CaretBrush="Aqua" | |||
FontFamily="楷体" | |||
FontSize="21" | |||
Foreground="#ff34f7f7" | |||
Text="{Binding DelayTime}" /> | |||
<TextBlock | |||
FontSize="21" | |||
Margin="10 0 0 0" | |||
Style="{StaticResource TextBlockStyle}" | |||
Text="(秒)" /> | |||
<Button Content="启动" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5" Foreground="Aqua" | |||
Style="{StaticResource ButtonStyle}" Command="{Binding CommandStart}" /> | |||
</StackPanel> | |||
</Grid> | |||
</Grid> | |||
@@ -19,10 +19,16 @@ namespace BPASmartClient.MorkS.ViewModel | |||
SaveInfoCommand = new RelayCommand(SaveSettingData); | |||
ActionManage.GetInstance.Register(SaveSettingData, "初始化设定煮面时间"); | |||
CommandStart = new RelayCommand(async ()=> | |||
{ | |||
ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M0.6", Value = true }); | |||
await Task.Delay((int)DelayTime * 1000); | |||
ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M0.6", Value = false }); | |||
}); | |||
} | |||
public RelayCommand SaveInfoCommand { get; set; } | |||
public RelayCommand CommandStart { get; set; } | |||
public ObservableCollection<ParSet> parSets { get; set; } = Json<MorksPar>.Data.parSets; | |||
@@ -30,7 +36,8 @@ namespace BPASmartClient.MorkS.ViewModel | |||
/// 加汤时间设置 | |||
/// </summary> | |||
public float AddSoup { get { return Json<MorksPar>.Data.AddSoupTime; } set { Json<MorksPar>.Data.AddSoupTime = value; OnPropertyChanged(); } } | |||
public float DelayTime { get { return _DelayTime; } set { _DelayTime = value; OnPropertyChanged(); } } | |||
private float _DelayTime; | |||
private void SaveSettingData() | |||
{ | |||
@@ -48,6 +55,8 @@ namespace BPASmartClient.MorkS.ViewModel | |||
bools.Add(Json<MorksPar>.Data.parSets[i].IsShield); | |||
ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = $"VW{116 + (i * 6)}", Value = values.ToArray() }); | |||
} | |||
ushort times = Convert.ToUInt16(Json<MorksPar>.Data.AddSoupTime * 10); | |||
ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = "VW2282", Value = times }); | |||
ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M260.0", Value = bools.ToArray() }); | |||
Json<MorksPar>.Save(); | |||
} | |||
@@ -27,7 +27,7 @@ namespace BPASmartClient.S7Net | |||
numBytes += 0.125; | |||
break; | |||
case "Byte": | |||
IncrementToEven(ref numBytes); | |||
//IncrementToEven(ref numBytes); | |||
numBytes += 1.0; | |||
break; | |||
case "Int16": | |||
@@ -574,7 +574,7 @@ namespace BPASmartClient.DosingSystem.ViewModel | |||
else | |||
{ | |||
int a1 = Array.FindIndex(DeviceInquire.GetInstance.devices.ToArray(), p => p.DeviceNum == cnt); | |||
Location1 = Array.FindIndex(Recipes.ElementAt(i).RawMaterials.ToArray(), p => p.RawMaterialName == DeviceInquire.GetInstance.devices.ElementAt(a1).DeviceName && p.Loc == barrel); | |||
Location1 = Array.FindIndex(Recipes.ElementAt(i).RawMaterials.ToArray(), p => p.RawMaterialName == DeviceInquire.GetInstance.devices.ElementAt(a1).DeviceName && p.Loc == barrel); | |||
} | |||
if (Location1 >= 0) | |||
{ | |||
@@ -204,13 +204,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "设备监控", "设备监 | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MaxWokControl", "BPASmartClient.MaxWokControl\BPASmartClient.MaxWokControl.csproj", "{888382C0-6750-4E81-BED3-0F38775DCCCB}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkSUpgradedVer", "BPASmartClient.MorkSUpgradedVer\BPASmartClient.MorkSUpgradedVer.csproj", "{C467ACE0-1BB4-44F0-9B5E-AFFFB58846D3}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkSUpgradedVer", "BPASmartClient.MorkSUpgradedVer\BPASmartClient.MorkSUpgradedVer.csproj", "{C467ACE0-1BB4-44F0-9B5E-AFFFB58846D3}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkS3", "BPASmartClient.MorkS3\BPASmartClient.MorkS3.csproj", "{B38F72AE-3C15-4C4E-A47E-DB2B9B318F02}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.RobotGripper", "BPASmartClient.RobotGripper\BPASmartClient.RobotGripper.csproj", "{5EBC34EB-4EE8-4C70-BAAA-C7F637D5E10F}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MilkTeaCube", "BPASmartClient.MilkTeaCube\BPASmartClient.MilkTeaCube.csproj", "{915F0718-B7AC-428D-ACD5-7DAACC28539F}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MilkTeaCube", "BPASmartClient.MilkTeaCube\BPASmartClient.MilkTeaCube.csproj", "{915F0718-B7AC-428D-ACD5-7DAACC28539F}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
@@ -0,0 +1,10 @@ | |||
using System.Windows; | |||
[assembly: ThemeInfo( | |||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | |||
//(used if a resource is not found in the page, | |||
// or application resource dictionaries) | |||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | |||
//(used if a resource is not found in the page, | |||
// app, or any theme specific resource dictionaries) | |||
)] |
@@ -0,0 +1,12 @@ | |||
<UserControl x:Class="WpfControlLibrary1.UserControl1" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:WpfControlLibrary1" | |||
mc:Ignorable="d" | |||
d:DesignHeight="450" d:DesignWidth="800"> | |||
<Grid> | |||
</Grid> | |||
</UserControl> |
@@ -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 WpfControlLibrary1 | |||
{ | |||
/// <summary> | |||
/// Interaction logic for UserControl1.xaml | |||
/// </summary> | |||
public partial class UserControl1 : UserControl | |||
{ | |||
public UserControl1() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0-windows</TargetFramework> | |||
<Nullable>enable</Nullable> | |||
<UseWPF>true</UseWPF> | |||
</PropertyGroup> | |||
</Project> |