@@ -471,7 +471,7 @@ namespace BPASmartClient.AGV | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 5; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpJobData.unloadEquipmentId = 40; | |||
httpModel.jobData = httpJobData; | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
@@ -526,7 +526,7 @@ namespace BPASmartClient.AGV | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 6; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpJobData.unloadEquipmentId = 41; | |||
httpModel.jobData = httpJobData; | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
@@ -581,7 +581,7 @@ namespace BPASmartClient.AGV | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 7; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpJobData.unloadEquipmentId = 42; | |||
httpModel.jobData = httpJobData; | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
@@ -636,7 +636,7 @@ namespace BPASmartClient.AGV | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 8; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpJobData.unloadEquipmentId = 40; | |||
httpModel.jobData = httpJobData; | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
@@ -691,7 +691,7 @@ namespace BPASmartClient.AGV | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 9; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpJobData.unloadEquipmentId = 41; | |||
httpModel.jobData = httpJobData; | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
@@ -66,15 +66,23 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
{ | |||
lock (runLock) | |||
{ | |||
RunLog runLog = new RunLog() | |||
try | |||
{ | |||
Date = DateTime.Now.ToString("yyyy-MM-dd"), | |||
Time = DateTime.Now.ToString("HH:mm:ss"), | |||
RunLogInfo = info | |||
}; | |||
Sqlite<RunLog>.GetInstance.Base.Add(runLog); | |||
Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); | |||
RunLog?.Invoke(info); | |||
RunLog runLog = new RunLog() | |||
{ | |||
Date = DateTime.Now.ToString("yyyy-MM-dd"), | |||
Time = DateTime.Now.ToString("HH:mm:ss"), | |||
RunLogInfo = info | |||
}; | |||
Sqlite<RunLog>.GetInstance.Base.Add(runLog); | |||
Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); | |||
RunLog?.Invoke(info); | |||
} | |||
catch (Exception) | |||
{ | |||
// throw; | |||
} | |||
} | |||
} | |||
@@ -263,7 +263,8 @@ | |||
Margin="10,0,0,0" | |||
HorizontalAlignment="Left" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding RunLogInfo}" /> | |||
Text="{Binding RunLogInfo}" | |||
TextWrapping="Wrap"/> | |||
<Border | |||
Grid.ColumnSpan="6" | |||
@@ -417,7 +417,9 @@ | |||
Margin="10,0,0,0" | |||
HorizontalAlignment="Left" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding LogInfo}" /> | |||
Text="{Binding LogInfo}" | |||
TextWrapping="Wrap" | |||
/> | |||
<Border | |||
Grid.ColumnSpan="6" | |||
@@ -105,38 +105,38 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||
} | |||
} | |||
//分配后的权限 | |||
if (res.permission == Enums.Permission.管理员) | |||
{ | |||
foreach (var items in MenuManage.GetInstance.menuModels) | |||
{ | |||
items.MainMenuVisibility = Visibility.Visible; | |||
foreach (var item in items.subMenumodels) | |||
{ | |||
item.SubMenuVisibility = Visibility.Visible; | |||
} | |||
} | |||
} | |||
else | |||
{ | |||
if (res.userTreeViewModels != null) | |||
{ | |||
if (res.userTreeViewModels.Count > 0) | |||
{ | |||
foreach (var items in MenuManage.GetInstance.menuModels) | |||
{ | |||
foreach (var item in items.subMenumodels) | |||
{ | |||
items.MainMenuVisibility = Visibility.Visible; | |||
if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null) | |||
{ | |||
item.SubMenuVisibility = Visibility.Visible; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
////分配后的权限 | |||
//if (res.permission == Enums.Permission.管理员) | |||
//{ | |||
// foreach (var items in MenuManage.GetInstance.menuModels) | |||
// { | |||
// items.MainMenuVisibility = Visibility.Visible; | |||
// foreach (var item in items.subMenumodels) | |||
// { | |||
// item.SubMenuVisibility = Visibility.Visible; | |||
// } | |||
// } | |||
//} | |||
//else | |||
//{ | |||
// if (res.userTreeViewModels != null) | |||
// { | |||
// if (res.userTreeViewModels.Count > 0) | |||
// { | |||
// foreach (var items in MenuManage.GetInstance.menuModels) | |||
// { | |||
// foreach (var item in items.subMenumodels) | |||
// { | |||
// items.MainMenuVisibility = Visibility.Visible; | |||
// if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null) | |||
// { | |||
// item.SubMenuVisibility = Visibility.Visible; | |||
// } | |||
// } | |||
// } | |||
// } | |||
// } | |||
//} | |||
ActionManage.GetInstance.Send("PermissionChange"); | |||
@@ -22,6 +22,8 @@ namespace BPASmartClient.Helper | |||
public static T Data { get; set; } = new T(); | |||
/// <summary> | |||
/// 保存数据 | |||
/// </summary> | |||
@@ -36,12 +38,14 @@ namespace BPASmartClient.Helper | |||
/// </summary> | |||
public static void Read() | |||
{ | |||
if (File.Exists(path)) | |||
{ | |||
string JsonString = File.ReadAllText(path); | |||
var result = JsonConvert.DeserializeObject<T>(JsonString); | |||
if (result != null) { Data = result; } | |||
} | |||
if (File.Exists(path)) | |||
{ | |||
string JsonString = File.ReadAllText(path); | |||
var result = JsonConvert.DeserializeObject<T>(JsonString); | |||
if (result != null) { Data = result; } | |||
} | |||
} | |||
/// <summary> | |||
@@ -19,7 +19,6 @@ namespace BPASmartClient.HubHelper | |||
public void Connect(string ip, int port) | |||
{ | |||
hubConnection = new HubConnectionBuilder().WithAutomaticReconnect().WithUrl($"http://{ip}:{port}/personhub").Build();//连接 | |||
hubConnection.On<object>("Report", (s) => { Report?.Invoke(s); });//客户端注册方法 | |||
hubConnection.On<object>("Upstreamrequest", (s) => { Upstreamrequest?.Invoke(s); });//客户端注册方法 | |||
@@ -37,7 +37,7 @@ namespace BPASmartClient.Modbus | |||
public Action Disconnect { get; set; } | |||
public bool IsReconnect { get; set; } = true; //true=启用重连,false=禁用重连 | |||
public bool IsReconnect { get; set; } = false; //true=启用重连,false=禁用重连 | |||
/// <summary> | |||
/// 判断是否连接成功 | |||
@@ -344,7 +344,7 @@ namespace BPASmartClient.Modbus | |||
{ | |||
commandType = CommandType.Inputs; | |||
} | |||
Show?.Invoke($"成功,地址:{address},值:{value}"); | |||
//Show?.Invoke($"成功,地址:{address},值:{value}"); | |||
return true; | |||
} | |||
catch (Exception ex) | |||
@@ -51,7 +51,7 @@ namespace FryPot_DosingSystem | |||
//开启实时PLC数据读取 | |||
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 | |||
AlarmHelper<AlarmInfo>.Init();//报警实时监控 | |||
HubHelper.GetInstance.Connect("172.16.12.100", 8089); | |||
Task.Run(()=> { HubHelper.GetInstance.Connect("172.16.12.100", 8089); }); | |||
} | |||
else | |||
@@ -164,7 +164,7 @@ namespace FryPot_DosingSystem | |||
ParamSet.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "PLC变量配置", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||
SubMenuPermission = new Permission[] { Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.VariableConfigView" | |||
}); | |||
@@ -253,13 +253,13 @@ namespace FryPot_DosingSystem | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.UserManageView" | |||
}); | |||
UserManager.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "NFC登录设置", | |||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.NfcSetView" | |||
}); | |||
//UserManager.Add(new SubMenumodel() | |||
//{ | |||
// SubMenuName = "NFC登录设置", | |||
// SubMenuPermission = new Permission[] { Permission.管理员 }, | |||
// AssemblyName = "BPASmartClient.CustomResource", | |||
// ToggleWindowPath = "Pages.View.NfcSetView" | |||
//}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
@@ -269,11 +269,11 @@ namespace FryPot_DosingSystem | |||
subMenumodels = UserManager, | |||
}); | |||
#endregion | |||
#region 调试界面 | |||
#region 手动控制界面 | |||
ObservableCollection<SubMenumodel> DebugManage = new ObservableCollection<SubMenumodel>(); | |||
DebugManage.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "单一流程调试", | |||
SubMenuName = "手动控制", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||
AssemblyName = "FryPot_DosingSystem", | |||
ToggleWindowPath = "View.DebugView" | |||
@@ -282,7 +282,7 @@ namespace FryPot_DosingSystem | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuName = "调试界面", | |||
MainMenuName = "操作界面", | |||
Alias = "Debug Management", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||
subMenumodels = DebugManage, | |||
@@ -291,7 +291,7 @@ namespace FryPot_DosingSystem | |||
} | |||
private void LoginDataInite() | |||
{ | |||
//Config.GetInstance.Init();//用户数据初始化 | |||
Config.GetInstance.Init();//用户数据初始化 | |||
Json<RecipeManage>.Read(); | |||
} | |||
} | |||
@@ -140,21 +140,56 @@ namespace FryPot_DosingSystem.Control | |||
IsConfig = false; | |||
MessageNotify.GetInstance.ShowRunLog("PLC变量配置加载失败:文件无数据,请重新配置并重启软件"); | |||
} | |||
//Variables.Add(new PlcVariableModel() { Address = "D2001", Length = 8 });//1号线体滚筒工位号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2011", Length = 8 });//2号线体滚筒工位号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2021", Length = 8 });//3号线体滚筒工位号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2031", Length = 9 });//输送线出料状态 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2040", Length = 5 });//炒锅1-5进料滚筒运行 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2045", Length = 5 });//炒锅1-5进料到位信号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2050", Length = 5 });//炒锅1-5空桶到位信号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2055", Length = 5 });//炒锅1-5空桶呼叫AGV | |||
//Variables.Add(new PlcVariableModel() { Address = "D2060", Length = 5 });//炒锅1空桶洗桶呼叫AGV | |||
//Variables.Add(new PlcVariableModel() { Address = "D2065", Length = 5 });//炒锅1-5空桶滚筒运行 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2070", Length = 5 });//炒锅1-5滚筒故障信号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2075", Length = 1 });//洗桶进桶滚筒运行信号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2076", Length = 1 });//洗桶出桶呼叫AGV | |||
//Variables.Add(new PlcVariableModel() { Address = "D2077", Length = 1 });// 洗桶出桶滚筒运行信号 | |||
//Variables.Add(new PlcVariableModel() { Address = "D2078", Length = 3 });//1-3滚筒线体配方完成信号 | |||
//消息注册 | |||
modbus.ShowEx += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryOneModbus.ShowEx += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryTwoModbus.ShowEx += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryThreeModbus.ShowEx += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryFourModbus.ShowEx += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryFiveModbus.ShowEx += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
modbus.Show += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryOneModbus.Show += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryTwoModbus.Show += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryThreeModbus.Show += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryFourModbus.Show += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
fryFiveModbus.Show += new Action<string>((s) => | |||
{ | |||
if (s != null) MessageNotify.GetInstance.ShowRunLog(s); | |||
}); | |||
} | |||
public void Connect() | |||
{ | |||
@@ -176,17 +211,28 @@ namespace FryPot_DosingSystem.Control | |||
string DeviceName = devices.Devices[i].DeviceName; | |||
switch (DeviceName) | |||
{ | |||
case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("滚筒线PLC连接成功"); break; | |||
case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); break; | |||
case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); break; | |||
case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); break; | |||
case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC连接成功"); break; | |||
case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC连接成功"); break; | |||
case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break; | |||
case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break; | |||
case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break; | |||
case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break; | |||
case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break; | |||
case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); break; | |||
} | |||
} | |||
if (modbus.Connected) | |||
MessageNotify.GetInstance.ShowRunLog("滚筒线PLC连接成功"); | |||
if (fryOneModbus.Connected) | |||
MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); | |||
if (fryTwoModbus.Connected) | |||
MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); | |||
if (fryThreeModbus.Connected) | |||
MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); | |||
if (fryFourModbus.Connected) | |||
MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC连接成功"); | |||
if (fryFiveModbus.Connected) | |||
MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC连接成功"); | |||
} | |||
} | |||
} | |||
@@ -198,30 +244,39 @@ namespace FryPot_DosingSystem.Control | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
//滚筒线 | |||
Connected = modbus.Connected; | |||
if (Connected) | |||
try | |||
{ | |||
foreach (var item in Variables) | |||
Connected = modbus.Connected; | |||
if (Connected) | |||
{ | |||
var res = modbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (Data.ContainsKey(item.Address)) | |||
{ | |||
Data[item.Address] = res; | |||
} | |||
else | |||
foreach (var item in Variables) | |||
{ | |||
Data.TryAdd(item.Address, res); | |||
var res = modbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (Data.ContainsKey(item.Address)) | |||
{ | |||
Data[item.Address] = res; | |||
} | |||
else | |||
{ | |||
Data.TryAdd(item.Address, res); | |||
} | |||
} | |||
} | |||
} | |||
else | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "滚筒输送线"); | |||
if (res != null) | |||
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); | |||
Thread.Sleep(10000); | |||
} | |||
} | |||
else | |||
catch (Exception) | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "滚筒输送线"); | |||
if (res != null) | |||
modbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("滚筒线PLC重连成功"); | |||
// throw; | |||
} | |||
Thread.Sleep(10); | |||
}), $"滚筒线实时数据读取线程"); | |||
@@ -231,151 +286,195 @@ namespace FryPot_DosingSystem.Control | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
//炒锅1 | |||
FryOneConnected = fryOneModbus.Connected; | |||
if (FryOneConnected) | |||
try | |||
{ | |||
foreach (var item in FryOneVariables) | |||
//炒锅1 | |||
FryOneConnected = fryOneModbus.Connected; | |||
if (FryOneConnected) | |||
{ | |||
var res = fryOneModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryOneData.ContainsKey(item.Address)) | |||
foreach (var item in FryOneVariables) | |||
{ | |||
FryOneData[item.Address] = res; | |||
} | |||
else | |||
{ | |||
FryOneData.TryAdd(item.Address, res); | |||
var res = fryOneModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryOneData.ContainsKey(item.Address)) | |||
{ | |||
FryOneData[item.Address] = res; | |||
} | |||
else | |||
{ | |||
FryOneData.TryAdd(item.Address, res); | |||
} | |||
} | |||
//Thread.Sleep(50); | |||
} | |||
//Thread.Sleep(50); | |||
else | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅1"); | |||
if (res != null) | |||
fryOneModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); | |||
Thread.Sleep(10000); | |||
} | |||
} | |||
else | |||
catch (Exception) | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅1"); | |||
if (res != null) | |||
fryOneModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("1号炒锅PLC重连成功"); | |||
//throw; | |||
} | |||
Thread.Sleep(10); | |||
}), $"炒锅1实时数据读取线程"); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
//炒锅2 | |||
FryTwoConnected = fryTwoModbus.Connected; | |||
if (FryTwoConnected) | |||
try | |||
{ | |||
foreach (var item in FryTwoVariables) | |||
//炒锅2 | |||
FryTwoConnected = fryTwoModbus.Connected; | |||
if (FryTwoConnected) | |||
{ | |||
var res = fryTwoModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryTwoData.ContainsKey(item.Address)) | |||
foreach (var item in FryTwoVariables) | |||
{ | |||
FryTwoData[item.Address] = res; | |||
} | |||
else | |||
{ | |||
FryTwoData.TryAdd(item.Address, res); | |||
var res = fryTwoModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryTwoData.ContainsKey(item.Address)) | |||
{ | |||
FryTwoData[item.Address] = res; | |||
} | |||
else | |||
{ | |||
FryTwoData.TryAdd(item.Address, res); | |||
} | |||
} | |||
} | |||
else | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅2"); | |||
if (res != null) | |||
fryTwoModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); | |||
Thread.Sleep(10000); | |||
} | |||
} | |||
else | |||
catch (Exception) | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅2"); | |||
if (res != null) | |||
fryTwoModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("2号炒锅PLC重连成功"); | |||
//throw; | |||
} | |||
Thread.Sleep(10); | |||
}), $"炒锅2实时数据读取线程"); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
//炒锅3 | |||
FryThreeConnected = fryThreeModbus.Connected; | |||
if (FryThreeConnected) | |||
try | |||
{ | |||
foreach (var item in FryThreeVariables) | |||
FryThreeConnected = fryThreeModbus.Connected; | |||
if (FryThreeConnected) | |||
{ | |||
var res = fryThreeModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryThreeData.ContainsKey(item.Address)) | |||
{ | |||
FryThreeData[item.Address] = res; | |||
} | |||
else | |||
foreach (var item in FryThreeVariables) | |||
{ | |||
FryThreeData.TryAdd(item.Address, res); | |||
var res = fryThreeModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryThreeData.ContainsKey(item.Address)) | |||
{ | |||
FryThreeData[item.Address] = res; | |||
} | |||
else | |||
{ | |||
FryThreeData.TryAdd(item.Address, res); | |||
} | |||
} | |||
} | |||
//Thread.Sleep(50); | |||
//Thread.Sleep(50); | |||
} | |||
else | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅3"); | |||
if (res != null) | |||
fryThreeModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); | |||
Thread.Sleep(10000); | |||
} | |||
} | |||
else | |||
catch (Exception) | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅3"); | |||
if (res != null) | |||
fryThreeModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("3号炒锅PLC重连成功"); | |||
//throw; | |||
} | |||
Thread.Sleep(10); | |||
}), $"炒锅3实时数据读取线程"); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
//炒锅4 | |||
FryFourConnected = fryFourModbus.Connected; | |||
if (FryFourConnected) | |||
try | |||
{ | |||
foreach (var item in FryFourVariables) | |||
//炒锅4 | |||
FryFourConnected = fryFourModbus.Connected; | |||
if (FryFourConnected) | |||
{ | |||
var res = fryFourModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryFourData.ContainsKey(item.Address)) | |||
{ | |||
FryFourData[item.Address] = res; | |||
} | |||
else | |||
foreach (var item in FryFourVariables) | |||
{ | |||
FryFourData.TryAdd(item.Address, res); | |||
var res = fryFourModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryFourData.ContainsKey(item.Address)) | |||
{ | |||
FryFourData[item.Address] = res; | |||
} | |||
else | |||
{ | |||
FryFourData.TryAdd(item.Address, res); | |||
} | |||
} | |||
} | |||
//Thread.Sleep(50); | |||
//Thread.Sleep(50); | |||
} | |||
else | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅4"); | |||
if (res != null) | |||
fryFourModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); | |||
Thread.Sleep(10000); | |||
} | |||
} | |||
else | |||
catch (Exception) | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅4"); | |||
if (res != null) | |||
fryFourModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("4号炒锅PLC重连成功"); | |||
//throw; | |||
} | |||
Thread.Sleep(10); | |||
}), $"炒锅4实时数据读取线程"); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
//炒锅5 | |||
FryFiveConnected = fryFiveModbus.Connected; | |||
if (FryFiveConnected) | |||
try | |||
{ | |||
foreach (var item in FryFiveVariables) | |||
//炒锅5 | |||
FryFiveConnected = fryFiveModbus.Connected; | |||
if (FryFiveConnected) | |||
{ | |||
var res = fryFiveModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryFiveData.ContainsKey(item.Address)) | |||
{ | |||
FryFiveData[item.Address] = res; | |||
} | |||
else | |||
foreach (var item in FryFiveVariables) | |||
{ | |||
FryFiveData.TryAdd(item.Address, res); | |||
var res = fryFiveModbus.Read(item.Address, item.Length);//读取plc数据 | |||
if (FryFiveData.ContainsKey(item.Address)) | |||
{ | |||
FryFiveData[item.Address] = res; | |||
} | |||
else | |||
{ | |||
FryFiveData.TryAdd(item.Address, res); | |||
} | |||
} | |||
} | |||
// Thread.Sleep(50); | |||
// Thread.Sleep(50); | |||
} | |||
else | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅5"); | |||
if (res != null) | |||
fryFiveModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); | |||
Thread.Sleep(10000); | |||
} | |||
} | |||
else | |||
catch (Exception) | |||
{ | |||
DeviceManage devices = Json<DeviceManage>.Data; | |||
var res = devices.Devices.FirstOrDefault(p => p.DeviceName == "炒锅5"); | |||
if (res != null) | |||
fryFiveModbus.ModbusTcpConnect(res.Ip, Convert.ToInt32(res.Port)); MessageNotify.GetInstance.ShowRunLog("5号炒锅PLC重连成功"); | |||
// throw; | |||
} | |||
Thread.Sleep(10); | |||
}), $"炒锅5实时数据读取线程"); | |||
@@ -414,6 +513,16 @@ namespace FryPot_DosingSystem.Control | |||
{ | |||
fryOneModbus.Write(address,value); | |||
} | |||
/// <summary> | |||
/// 炒锅1工艺目标重量偏差 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="value"></param> | |||
public void WritePotOneRealPlcData(string address, float value) | |||
{ | |||
fryOneModbus.SetReal(address, value); | |||
} | |||
/// <summary> | |||
/// 炒锅2工艺数据 | |||
/// </summary> | |||
@@ -425,6 +534,15 @@ namespace FryPot_DosingSystem.Control | |||
} | |||
/// <summary> | |||
/// 炒锅2工艺目标重量偏差 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="value"></param> | |||
public void WritePotTwoRealPlcData(string address, float value) | |||
{ | |||
fryTwoModbus.SetReal(address, value); | |||
} | |||
/// <summary> | |||
/// 炒锅3工艺数据 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
@@ -435,6 +553,15 @@ namespace FryPot_DosingSystem.Control | |||
} | |||
/// <summary> | |||
/// 炒锅3工艺目标重量偏差 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="value"></param> | |||
public void WritePotThreeRealPlcData(string address, float value) | |||
{ | |||
fryThreeModbus.SetReal(address, value); | |||
} | |||
/// <summary> | |||
/// 炒锅4工艺数据 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
@@ -445,6 +572,15 @@ namespace FryPot_DosingSystem.Control | |||
fryFourModbus.Write(address,value); | |||
} | |||
/// <summary> | |||
/// 炒锅4工艺目标重量偏差 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="value"></param> | |||
public void WritePotFourRealPlcData(string address, float value) | |||
{ | |||
fryFourModbus.SetReal(address, value); | |||
} | |||
/// <summary> | |||
/// 炒锅5工艺数据 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
@@ -454,6 +590,15 @@ namespace FryPot_DosingSystem.Control | |||
fryFiveModbus.Write(address, value); | |||
} | |||
/// <summary> | |||
/// 炒锅5工艺目标重量偏差 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="value"></param> | |||
public void WritePotFiveRealPlcData(string address, float value) | |||
{ | |||
fryFiveModbus.SetReal(address, value); | |||
} | |||
public ConcurrentDictionary<string, object> GetAllData() | |||
{ | |||
return Data; | |||
@@ -131,6 +131,7 @@ namespace FryPot_DosingSystem.Control | |||
public bool LoadRoller { get; set; } | |||
public bool AgvToFryPot { get; set; } | |||
public bool PotOneInputMaterialArrive { get; set; } | |||
public bool PotOneOutputRollerArrive { get; set; } | |||
@@ -160,14 +161,19 @@ namespace FryPot_DosingSystem.Control | |||
public int LOneMaterialNum { get; set; } = 0; | |||
public int LOneFryPotSerial { get; set; } = 0; | |||
public int LOneCurrentCookingStep { get; set; } = 0; | |||
public int LFourCurrentCookingStep { get; set; } = 0; | |||
public bool agvArriveUpLoad { get; set; } | |||
public bool agvArriveUnLoad { get; set; } | |||
public bool agvFryPotEmptyRollerArrive { get; set; } | |||
public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成 | |||
public bool agvLineOneLoadCom { get; set; }//线体1上料完成 | |||
public bool agvLineOneLoadCom { get; set; }//线体1满料桶上料完成 | |||
//2022.11.1 新增 | |||
public int LTwoMaterialNum { get; set; } = 0; | |||
public int LTwoFryPotSerial { get; set; } =0; | |||
public int LFiveCurrentCookingStep { get; set; } = 0; | |||
public int LTwoCurrentCookingStep { get; set; } = 0; | |||
public bool agvArriveLTwoUpLoad { get; set; } | |||
public bool LTwoagvArriveUnLoad { get; set; } | |||
@@ -11,6 +11,8 @@ namespace FryPot_DosingSystem.Model | |||
internal class FlowProcessManage:ObservableObject | |||
{ | |||
public string RecipeName { get; set; } | |||
public float targetWeightOffset { get { return _targetWeightOffset; } set { _targetWeightOffset = value;OnPropertyChanged(); }} | |||
private float _targetWeightOffset; | |||
public ObservableCollection<FlowProcessModel> fpModels { get; set; } = new ObservableCollection<FlowProcessModel>(); | |||
} | |||
} |
@@ -30,11 +30,16 @@ namespace FryPot_DosingSystem.Model | |||
public double FrySpeed { get { return _frySpeed; }set { _frySpeed = value;OnPropertyChanged(); } } | |||
private double _frySpeed; | |||
/// <summary> | |||
/// 炒制重量 | |||
/// 添加重量 | |||
/// </summary> | |||
public double FryWeight { get { return _fryMaterialWeight; } set { _fryMaterialWeight = value; OnPropertyChanged(); } } | |||
private double _fryMaterialWeight; | |||
/// <summary> | |||
/// 目标重量 | |||
/// </summary> | |||
public ushort TargeWeight { get { return _targetWeight; }set { _targetWeight = value;OnPropertyChanged(); } } | |||
private ushort _targetWeight; | |||
/// <summary> | |||
/// 炒制温度 | |||
/// </summary> | |||
public double FryTemperature { get { return _fryTemperature; } set { _fryTemperature = value;OnPropertyChanged(); } } | |||
@@ -566,7 +566,7 @@ | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="停车位" BasedOn="{x:Null}" TargetType="{x:Type TextBox}"> | |||
<Setter Property="Foreground" Value="#FF1F4D69"/> | |||
@@ -1344,7 +1344,7 @@ | |||
<Grid> | |||
<!--#region 测试按钮--> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="100,0,100,80" Grid.Column="2"> | |||
<!--<Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="100,0,100,80" Grid.Column="2"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="0"/> | |||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,20,20,0" Orientation="Horizontal"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="AGV模拟测试" Margin="20,20,20,5" Width="35" FontSize="20" Foreground="#FFFCD5B5" /> | |||
@@ -1353,6 +1353,7 @@ | |||
<TextBox x:Name="tcz_text" Margin="5">1</TextBox> | |||
<Button Margin="5" Click="Button_Click" Tag="设置有车" Cursor="Hand">设置有车</Button> | |||
<Button Margin="5" Click="Button_Click" Tag="设置无车" Cursor="Hand">设置无车</Button> | |||
</StackPanel> | |||
<StackPanel> | |||
@@ -1395,7 +1396,7 @@ | |||
</StackPanel> | |||
</StackPanel> | |||
</Grid> | |||
</Grid>--> | |||
<!--#endregion--> | |||
@@ -1530,124 +1531,166 @@ | |||
<TextBox Style="{StaticResource 炒锅}" Text="{Binding wokModel_5.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" FontSize="16" Width="18" Margin="-10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">炒锅(5)号</TextBlock> | |||
</Grid> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="0"> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="0" Height="360"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="一号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="105"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="一号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
Text="{Binding wokModel_1.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
Tag="{Binding wokModel_1.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
ToolTip="{Binding wokModel_1.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<ListBox ItemsSource="{Binding wokModel_1.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</StackPanel> | |||
<Grid Grid.Row="1"> | |||
<ListBox x:Name="potOne" ItemsSource="{Binding wokModel_1.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="1"> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="1" Height="360"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="二号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="105"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="二号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
Text="{Binding wokModel_2.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
Tag="{Binding wokModel_2.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
ToolTip="{Binding wokModel_2.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<ListBox ItemsSource="{Binding wokModel_2.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</StackPanel> | |||
<Grid Grid.Row="1"> | |||
<ListBox x:Name="potTwo" ItemsSource="{Binding wokModel_2.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="2"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="三号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="2" Height="360"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10" /> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="105"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<StackPanel > | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="三号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
Text="{Binding wokModel_3.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
Tag="{Binding wokModel_3.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
ToolTip="{Binding wokModel_3.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<ListBox ItemsSource="{Binding wokModel_3.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</StackPanel> | |||
<Grid Grid.Row="1"> | |||
<ListBox x:Name="potThree" ItemsSource="{Binding wokModel_3.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible" > | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="3"> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="3" Height="360"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="四号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="105"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="四号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
Text="{Binding wokModel_4.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
Tag="{Binding wokModel_4.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
ToolTip="{Binding wokModel_4.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<ListBox ItemsSource="{Binding wokModel_4.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</StackPanel> | |||
<Grid Grid.Row="1"> | |||
<ListBox x:Name="potFour" ItemsSource="{Binding wokModel_4.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding xh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Foreground="#FF00FFB3" /> | |||
<Image Margin="20,0,0,0" Style="{DynamicResource image完成}" Visibility="{Binding visibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></Image> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="4"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10"/> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="五号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,0,-40,80" Grid.Column="4" Height="360"> | |||
<Rectangle Stroke="#FFFFA400" StrokeDashArray="5 5" Margin="10" /> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="105"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="五号炒锅制作流程" Margin="20,20,20,5" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<StackPanel Orientation="Horizontal" Margin="20,5,20,0"> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="菜品:" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" | |||
Text="{Binding wokModel_5.goodsName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
Tag="{Binding wokModel_5.id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
ToolTip="{Binding wokModel_5.orderID,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF00FFED" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
</StackPanel> | |||
<TextBlock Style="{DynamicResource 80号字体样式}" Text="步骤:" Margin="20,5,20,0" FontSize="20" Foreground="#FFFCD5B5" /> | |||
<ListBox ItemsSource="{Binding wokModel_5.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10"> | |||
<Grid Grid.Row="1"> | |||
<ListBox x:Name="potFive" ItemsSource="{Binding wokModel_5.workflows,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Margin="0,0,0,10" ScrollViewer.VerticalScrollBarVisibility="Visible"> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<StackPanel Orientation="Horizontal" Margin="15,5,15,5"> | |||
@@ -1657,8 +1700,9 @@ | |||
</StackPanel> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</StackPanel> | |||
</ListBox> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
@@ -1733,7 +1777,7 @@ | |||
<LinearGradientBrush> | |||
<GradientStop Offset="0.3" Color="Gray"/> | |||
<GradientStop Offset="0.7" Color="White"/> | |||
</LinearGradientBrush> | |||
</Path.Fill> | |||
<Path.Data> | |||
@@ -1,4 +1,6 @@ | |||
using FryPot_DosingSystem.AGV; | |||
| |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.AGV; | |||
using FryPot_DosingSystem.ViewModel; | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -23,177 +25,209 @@ namespace FryPot_DosingSystem.View | |||
/// </summary> | |||
public partial class AgvView : UserControl | |||
{ | |||
private static readonly object O_lock = new object(); | |||
public AgvView() | |||
{ | |||
InitializeComponent(); | |||
this.DataContext = AgvViewModel.GetInstance(); | |||
控制命令.ItemsSource = AgvViewModel.GetInstance().GetCommand(); | |||
} | |||
// 控制命令.ItemsSource = AgvViewModel.GetInstance().GetCommand(); | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
{ | |||
int id = 1; | |||
if (sender is Button) | |||
{ | |||
byte[] data; | |||
bool istrue = false; | |||
Button button = sender as Button; | |||
if (button.Tag != null) | |||
{ | |||
switch (button.Tag.ToString()) | |||
{ | |||
case "设置有车": | |||
try | |||
{ | |||
id=int.Parse(tcz_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-5 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set停车桩(id, IsBool.Yes); | |||
break; | |||
case "设置无车": | |||
try | |||
{ | |||
id = int.Parse(tcz_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-5 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set停车桩(id, IsBool.No); | |||
break; | |||
case "启动": | |||
try | |||
{ | |||
id = int.Parse(liaotong_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Start); | |||
break; | |||
case "停止": | |||
try | |||
{ | |||
id = int.Parse(liaotong_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Stop); | |||
break; | |||
case "设置物料": | |||
try | |||
{ | |||
id = int.Parse(liaotongwuliao_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-8 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set滚筒线上数量(id, liaotongwuliaoshuliang_text.Text); | |||
break; | |||
case "小车停止": | |||
try | |||
{ | |||
id = int.Parse(xiaoche_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set小车停止(id); | |||
break; | |||
case "运行小车": | |||
try | |||
{ | |||
id = int.Parse(xiaoche_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set小车运动(id, AgvViewModel.GetInstance().GetCommandValue(控制命令.Text)); | |||
break; | |||
case "有菜和碗": | |||
try | |||
{ | |||
id = int.Parse(xiaochewuping_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.Yes); | |||
break; | |||
case "只有碗": | |||
try | |||
{ | |||
id = int.Parse(xiaochewuping_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.OnllYes); | |||
break; | |||
case "无物品": | |||
try | |||
{ | |||
id = int.Parse(xiaochewuping_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.No); | |||
break; | |||
case "启动炒锅": | |||
try | |||
{ | |||
id = int.Parse(guntongchaoguo_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Start); | |||
break; | |||
case "停止炒锅": | |||
try | |||
{ | |||
id = int.Parse(guntongchaoguo_text.Text.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageBox.Show("只能输入 1-4 的数字!"); | |||
return; | |||
} | |||
AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Stop); | |||
break; | |||
case "清洗桶数": | |||
AgvViewModel.GetInstance().SetCleanRollerNum(2); | |||
break; | |||
} | |||
} | |||
} | |||
} | |||
//public void PotDisplay(object num) | |||
//{ | |||
// lock (O_lock) | |||
// { | |||
// switch (num) | |||
// { | |||
// case 1: | |||
// potOne.Items.MoveCurrentToLast(); | |||
// potOne.ScrollIntoView(potOne.Items.CurrentItem); break; | |||
// case 2: | |||
// potTwo.Items.MoveCurrentToLast(); | |||
// potTwo.ScrollIntoView(potTwo.Items.CurrentItem); break; | |||
// case 3: | |||
// potThree.Items.MoveCurrentToLast(); | |||
// potThree.ScrollIntoView(potThree.Items.CurrentItem); break; | |||
// case 4: | |||
// potFour.Items.MoveCurrentToLast(); | |||
// potFour.ScrollIntoView(potFour.Items.CurrentItem); break; | |||
// case 5: | |||
// potFive.Items.MoveCurrentToLast(); | |||
// potFive.ScrollIntoView(potFive.Items.CurrentItem); break; | |||
// } | |||
// } | |||
//} | |||
//private void Button_Click(object sender, RoutedEventArgs e) | |||
//{ | |||
// int id = 1; | |||
// if (sender is Button) | |||
// { | |||
// byte[] data; | |||
// bool istrue = false; | |||
// Button button = sender as Button; | |||
// if (button.Tag != null) | |||
// { | |||
// switch (button.Tag.ToString()) | |||
// { | |||
// case "设置有车": | |||
// try | |||
// { | |||
// id = int.Parse(tcz_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-5 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set停车桩(id, IsBool.Yes); | |||
// break; | |||
// case "设置无车": | |||
// try | |||
// { | |||
// id = int.Parse(tcz_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-5 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set停车桩(id, IsBool.No); | |||
// break; | |||
// case "启动": | |||
// try | |||
// { | |||
// id = int.Parse(liaotong_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Start); | |||
// break; | |||
// case "停止": | |||
// try | |||
// { | |||
// id = int.Parse(liaotong_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set滚筒线状态(id, IsRun.Stop); | |||
// break; | |||
// case "设置物料": | |||
// try | |||
// { | |||
// id = int.Parse(liaotongwuliao_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-8 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set滚筒线上数量(id, liaotongwuliaoshuliang_text.Text); | |||
// break; | |||
// case "小车停止": | |||
// try | |||
// { | |||
// id = int.Parse(xiaoche_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set小车停止(id); | |||
// break; | |||
// case "运行小车": | |||
// try | |||
// { | |||
// id = int.Parse(xiaoche_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set小车运动(id, AgvViewModel.GetInstance().GetCommandValue(控制命令.Text)); | |||
// break; | |||
// case "有菜和碗": | |||
// try | |||
// { | |||
// id = int.Parse(xiaochewuping_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.Yes); | |||
// break; | |||
// case "只有碗": | |||
// try | |||
// { | |||
// id = int.Parse(xiaochewuping_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.OnllYes); | |||
// break; | |||
// case "无物品": | |||
// try | |||
// { | |||
// id = int.Parse(xiaochewuping_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set小车是否承载物品(id, IsBool.No); | |||
// break; | |||
// case "启动炒锅": | |||
// try | |||
// { | |||
// id = int.Parse(guntongchaoguo_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Start); | |||
// break; | |||
// case "停止炒锅": | |||
// try | |||
// { | |||
// id = int.Parse(guntongchaoguo_text.Text.ToString()); | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// MessageBox.Show("只能输入 1-4 的数字!"); | |||
// return; | |||
// } | |||
// AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Stop); | |||
// break; | |||
// case "清洗桶数": | |||
// AgvViewModel.GetInstance().SetCleanRollerNum(2); | |||
// break; | |||
// } | |||
// } | |||
// } | |||
//} | |||
} | |||
} |
@@ -11,18 +11,24 @@ | |||
<vm:DebugViewModel/> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<Style x:Key="buttonStyle" TargetType="Button"> | |||
<Setter Property="Width" Value="100"></Setter> | |||
<Setter Property="Height" Value="30"/> | |||
<Setter Property="Background" Value="Transparent"></Setter> | |||
<Setter Property="BorderThickness" Value="2"/> | |||
<Setter Property="BorderBrush" Value="Orange"/> | |||
<Setter Property="HorizontalContentAlignment" Value="Center"/> | |||
<Setter Property="VerticalContentAlignment" Value="Center"/> | |||
<Setter Property="Margin" Value="3,3"/> | |||
<Setter Property="Foreground" Value="SkyBlue"/> | |||
<Setter Property="FontSize" Value="13"/> | |||
</Style> | |||
<ResourceDictionary> | |||
<ResourceDictionary.MergedDictionaries> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" /> | |||
</ResourceDictionary.MergedDictionaries> | |||
<!--<Style x:Key="buttonStyle" TargetType="Button"> | |||
<Setter Property="Width" Value="100"></Setter> | |||
<Setter Property="Height" Value="30"/> | |||
<Setter Property="Background" Value="Transparent"></Setter> | |||
<Setter Property="BorderThickness" Value="2"/> | |||
<Setter Property="BorderBrush" Value="Orange"/> | |||
<Setter Property="HorizontalContentAlignment" Value="Center"/> | |||
<Setter Property="VerticalContentAlignment" Value="Center"/> | |||
<Setter Property="Margin" Value="3,3"/> | |||
<Setter Property="Foreground" Value="SkyBlue"/> | |||
<Setter Property="FontSize" Value="13"/> | |||
</Style>--> | |||
</ResourceDictionary> | |||
</UserControl.Resources> | |||
<Grid> | |||
@@ -30,47 +36,54 @@ | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<UniformGrid Columns="2"> | |||
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink"> | |||
<GroupBox Grid.Column="1" Header="1号滚筒线" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineRunning}"></Button> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineRunning}"></Button> | |||
--> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<!-- | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding LineOneRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotEmptyRollerArrive}"/> | |||
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneRecipeComSignal}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<Button Content="线体1任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button> | |||
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EmptyRollerCleanTaskRestart}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>--> | |||
<Button Margin="3,3" Content="线体1任务重置" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button> | |||
<Button Margin="3,3" Content="空桶清洗任务重置" Width="140" VerticalAlignment="Top" Command="{Binding EmptyRollerCleanTaskRestart}"/> | |||
<Button Content="线体1出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_34" Width="145"/> | |||
<Button Content="线体1出桶复位" Width="140" Click="Button_Click_15" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV线体1上料就位" Margin="3,3" Width="120" Command="{Binding AGVLOneArrive}"/> | |||
<Button Content="AGV线体1空桶上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveLineOneEmptyRollerLoc}"/> | |||
<!--<WrapPanel Orientation="Horizontal"> | |||
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/> | |||
</WrapPanel> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<Button Content="线体1到炒锅1" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/> | |||
<Button Content="线体1到炒锅4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click"/> | |||
<Button Content="线体2到炒锅2" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_1"/> | |||
<Button Content="线体2到炒锅5" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_2"/> | |||
<Button Content="线体3到炒锅3" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_3"/> | |||
<Button Content="炒锅1到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_4"/> | |||
<Button Content="炒锅2到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_5"/> | |||
<Button Content="炒锅3到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_6"/> | |||
<Button Content="炒锅4到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_7"/> | |||
<Button Content="炒锅5到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_8"/> | |||
<Button Content="线体1到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_9"/> | |||
<Button Content="线体2到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_10"/> | |||
<Button Content="线体3到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_11"/> | |||
<Button Content="清洗到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_12"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体1上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLOneArrive}"/> | |||
<GroupBox Grid.Column="2" Header="2号滚筒线" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Margin="3,3" Content="线体2任务重置" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button> | |||
<Button Content="空桶清洗任务重置" Width="140" Margin="3,3" VerticalAlignment="Top" Command="{Binding LineTwoEmptyRollerCleanTaskRestart}"/> | |||
<Button Content="线体2出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_35" Width="145"/> | |||
<Button Content="线体2出桶复位" Width="140" Click="Button_Click_16" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV线体2上料就位" Margin="3,3" Width="120" Command="{Binding AGVLTwoArrive}"/> | |||
<Button Content="AGV线体2空桶上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveLineTwoEmptyRollerLoc}"/> | |||
<!-- | |||
<Button Content="AGV线体1上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineOneLoadCom}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotDownArrive}"> | |||
</Button> | |||
@@ -86,33 +99,41 @@ | |||
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/> | |||
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> | |||
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/> | |||
</WrapPanel> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
</UniformGrid> | |||
<UniformGrid Columns="2" Grid.Row="1"> | |||
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink"> | |||
<GroupBox Grid.Column="1" Header="3号滚筒线" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineTwoRunning}"></Button> | |||
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineTwoRunning}"></Button> | |||
--> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<!-- | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged_1" ItemsSource="{Binding LineTwoRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoEmptyRollerArrive}"/> | |||
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoRecipeComSignal}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<Button Content="线体2任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button> | |||
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoEmptyRollerCleanTaskRestart}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>--> | |||
<Button Content="线体3任务重置" Margin="3,3" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button> | |||
<Button Content="空桶清洗任务重置" Width="140" Margin="3,3" VerticalAlignment="Top" Command="{Binding LineThreeEmptyRollerCleanTaskRestart}"/> | |||
<Button Content="线体3出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_36" Width="145"/> | |||
<Button Content="线体3出桶复位" Width="140" Click="Button_Click_17" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV线体3上料就位" Margin="3,3" Width="120" Command="{Binding AGVLThreeArrive}"/> | |||
<Button Content="AGV线体3空桶上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/> | |||
<!--<WrapPanel Orientation="Horizontal"> | |||
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/> | |||
</WrapPanel> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua"> | |||
<GroupBox Grid.Column="2" Header="回桶线" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体2上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLTwoArrive}"/> | |||
<Button Content="回桶线进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_44" Width="145"/> | |||
<Button Content="回桶线信号复位" Width="140" Click="Button_Click_13" Margin="3,3" VerticalAlignment="Top" /> | |||
<!-- | |||
<Button Content="AGV线体2上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineTwoLoadCom}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotTwoDownArrive}"> | |||
</Button> | |||
@@ -128,31 +149,159 @@ | |||
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/> | |||
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> | |||
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/> | |||
</WrapPanel> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
<UniformGrid Columns="2" Grid.Row="2"> | |||
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink"> | |||
<GroupBox Grid.Column="1" Header="1号炒锅" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button> | |||
<Button Content="炒锅1料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_38" Width="145"/> | |||
<Button Content="炒锅1进桶复位" Width="140" Click="Button_Click_18" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅1空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_29" Width="145"/> | |||
<Button Content="炒锅1出桶复位" Width="140" Click="Button_Click_23" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅1配方复位" Width="140" Click="Button_Click_45" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV炒锅1下料就位" RenderTransformOrigin="0.5,0.5" Margin="3,3" Width="145" Command="{Binding AGVFryPotDownArrive}"/> | |||
<Button Content="AGV炒锅1空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotUpArrive}"/> | |||
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button> | |||
--> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<!-- | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/> | |||
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>--> | |||
<!--<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="2号炒锅" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="炒锅2料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_39" Width="145"/> | |||
<Button Content="炒锅2进桶复位" Width="140" Click="Button_Click_19" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅2空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_30" Width="145"/> | |||
<Button Content="炒锅2出桶复位" Width="140" Click="Button_Click_24" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅2配方复位" Width="140" Click="Button_Click_46" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV炒锅2下料就位" Margin="3,3" RenderTransformOrigin="0.5,0.5" Width="145" Command="{Binding AGVFryPotTwoDownArrive}"/> | |||
<Button Content="AGV炒锅2空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotTwoUpArrive}"/> | |||
<!--<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/> | |||
<Button Content="AGV线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}"> | |||
</Button> | |||
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotThreeUpArrive}"/> | |||
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotThreeGetEmptyRoller}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<Button Content="线体3任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button> | |||
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeEmptyRollerCleanTaskRestart}"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体3空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/> | |||
<Button Content="AGV线体3空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineThreeLoadEmptyCom}"/> | |||
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/> | |||
<Button Content="AGV空桶清洗下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocCom}"/> | |||
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/> | |||
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/> | |||
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> | |||
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
<UniformGrid Columns="2" Grid.Row="3"> | |||
<GroupBox Grid.Column="1" Header="3号炒锅" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="炒锅3料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_40" Width="145"/> | |||
<Button Content="炒锅3进桶复位" Width="140" Click="Button_Click_20" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅3空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_31" Width="145"/> | |||
<Button Content="炒锅3出桶复位" Width="140" Click="Button_Click_25" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅3配方复位" Width="140" Click="Button_Click_47" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV炒锅3下料就位" RenderTransformOrigin="0.5,0.5" Margin="3,3" Width="145" Command="{Binding AGVFryPotThreeDownArrive}"/> | |||
<Button Content="AGV炒锅3空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotThreeUpArrive}"/> | |||
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button> | |||
--> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<!-- | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/> | |||
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>--> | |||
<!--<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="4号炒锅" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="炒锅4料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_41" Width="145"/> | |||
<Button Content="炒锅4进桶复位" Width="140" Click="Button_Click_21" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅4空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_32" Width="145"/> | |||
<Button Content="炒锅4出桶复位" Width="140" Click="Button_Click_26" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅4配方复位" Width="140" Click="Button_Click_48" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV炒锅4下料就位" RenderTransformOrigin="0.5,0.5" Margin="3,3" Width="145" Command="{Binding AGVFryPotDownArrive}"/> | |||
<Button Content="AGV炒锅4空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotUpArrive}"/> | |||
<!--<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/> | |||
<Button Content="AGV线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}"> | |||
</Button> | |||
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotThreeUpArrive}"/> | |||
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotThreeGetEmptyRoller}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体3空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/> | |||
<Button Content="AGV线体3空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineThreeLoadEmptyCom}"/> | |||
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/> | |||
<Button Content="AGV空桶清洗下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocCom}"/> | |||
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/> | |||
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/> | |||
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> | |||
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
<UniformGrid Columns="2" Grid.Row="4"> | |||
<GroupBox Grid.Column="1" Header="5号炒锅" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="炒锅5料桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_42" Width="145"/> | |||
<Button Content="炒锅5进桶复位" Width="140" Click="Button_Click_22" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅5空桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_33" Width="145"/> | |||
<Button Content="炒锅5出桶复位" Width="140" Click="Button_Click_27" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="炒锅5配方复位" Width="140" Click="Button_Click_49" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV炒锅5下料就位" Margin="3,3" RenderTransformOrigin="0.5,0.5" Width="145" Command="{Binding AGVFryPotTwoDownArrive}"/> | |||
<Button Content="AGV炒锅5空桶上料就位" Margin="3,3" Width="145" Command="{Binding AGVFryPotTwoUpArrive}"/> | |||
<!--<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button> | |||
--> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<!-- | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/> | |||
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>--> | |||
<!--<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/> | |||
</WrapPanel> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua"> | |||
<GroupBox Grid.Column="2" Header="洗桶机" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/> | |||
<Button Content="洗桶进桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_43" Width="145"/> | |||
<Button Content="洗桶机进桶信号复位" Width="140" Click="Button_Click_14" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="洗桶出桶信号" Margin="3,3" VerticalAlignment="Center" Click="Button_Click_37" Width="145"/> | |||
<Button Content="洗桶机出桶信号复位" Width="140" Click="Button_Click_28" Margin="3,3" VerticalAlignment="Top" /> | |||
<Button Content="AGV空桶清洗上料就位" Margin="3,3" Width="145" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/> | |||
<!--<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/> | |||
<Button Content="AGV线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}"> | |||
</Button> | |||
@@ -168,10 +317,31 @@ | |||
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/> | |||
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> | |||
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/> | |||
</WrapPanel> | |||
</WrapPanel>--> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
<GroupBox Grid.Row="5" Header="AGV路径手动调度" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="线体1到炒锅1" Margin="5,3" VerticalAlignment="Top" Command="{Binding AgvDebug}"/> | |||
<Button Content="线体1到炒锅4" Margin="5,3" VerticalAlignment="Top" Click="Button_Click"/> | |||
<Button Content="线体2到炒锅2" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_1"/> | |||
<Button Content="线体2到炒锅5" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_2"/> | |||
<Button Content="线体3到炒锅3" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_3"/> | |||
<Line Stroke="Transparent" StrokeThickness="2" X1="0" X2="1720" Y1="0" Y2="0"/> | |||
<Button Content="炒锅1到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_4"/> | |||
<Button Content="炒锅2到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_5"/> | |||
<Button Content="炒锅3到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_6"/> | |||
<Button Content="炒锅4到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_7"/> | |||
<Button Content="炒锅5到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_8"/> | |||
<Line Stroke="Transparent" StrokeThickness="2" X1="0" X2="1720" Y1="0" Y2="0"/> | |||
<Button Content="线体1到洗桶机" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_9"/> | |||
<Button Content="线体2到洗桶机" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_10"/> | |||
<Button Content="线体3到洗桶机" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_11"/> | |||
<Button Content="洗桶机到回桶线" Margin="5,3" VerticalAlignment="Top" Click="Button_Click_12"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
</Grid> | |||
</UserControl> | |||
</UserControl> |
@@ -1,10 +1,12 @@ | |||
using BPASmartClient.AGV; | |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.Control; | |||
using FryPot_DosingSystem.ViewModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
using System.Windows.Controls; | |||
@@ -127,7 +129,343 @@ namespace FryPot_DosingSystem.View | |||
AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(Guid.NewGuid().ToString("D")); | |||
} | |||
/// <summary> | |||
/// 回桶线信号复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_13(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1067",0); | |||
} | |||
/// <summary> | |||
/// 空桶洗桶信号复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_14(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1065", 0); | |||
} | |||
/// <summary> | |||
/// 线体1AGV进料复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_15(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1052", 0); | |||
} | |||
/// <summary> | |||
/// 线体2AGV进料复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_16(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1053", 0); | |||
} | |||
/// <summary> | |||
/// 线体3AGV进料复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_17(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1054", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅1进桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_18(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1055", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅2进桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_19(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1056", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅3进桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_20(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1057", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅4进桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_21(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1058", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅5进桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_22(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1059", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅1出桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_23(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1060", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅2出桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_24(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1061", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅3出桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_25(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1062", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅4出桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_26(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1063", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅5出桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_27(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1064", 0); | |||
} | |||
/// <summary> | |||
/// 洗桶机出桶复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_28(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1066", 0); | |||
} | |||
/// <summary> | |||
/// 炒锅1空桶AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_29(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1060", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅2空桶AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_30(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1061", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅3空桶AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_31(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1062", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅4空桶AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_32(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1063", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅5空桶AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_33(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1064", 1); | |||
} | |||
/// <summary> | |||
/// 线体1AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_34(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1052", 1); | |||
} | |||
/// <summary> | |||
/// 线体2AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_35(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1053", 1); | |||
} | |||
/// <summary> | |||
/// 线体3AGV到位信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_36(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1054", 1); | |||
} | |||
/// <summary> | |||
/// 洗桶机出桶g | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_37(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1066", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅1进桶信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_38(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1055", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅2进桶信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_39(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1056", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅3进桶信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_40(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1057", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅4进桶信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_41(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1058", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅5进桶信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_42(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1059", 1); | |||
} | |||
/// <summary> | |||
/// 洗桶机进桶信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_43(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1065", 1); | |||
} | |||
/// <summary> | |||
/// 回桶线进桶信号 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_44(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePlcData("D1067", 1); | |||
} | |||
/// <summary> | |||
/// 炒锅1配方复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_45(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePotOnePlcData("D2999",1); | |||
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotOnePlcData("D2999", 0); })); | |||
} | |||
/// <summary> | |||
/// 炒锅2配方复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_46(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 1); | |||
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotTwoPlcData("D2999", 0); })); | |||
} | |||
/// <summary> | |||
/// 炒锅3配方复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_47(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePotThreePlcData("D2999", 1); | |||
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotThreePlcData("D2999", 0); })); | |||
} | |||
/// <summary> | |||
/// 炒锅4配方复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_48(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePotFourPlcData("D2999", 1); | |||
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotFourPlcData("D2999", 0); })); | |||
} | |||
/// <summary> | |||
/// 炒锅5配方复位 | |||
/// </summary> | |||
/// <param name="sender"></param> | |||
/// <param name="e"></param> | |||
private void Button_Click_49(object sender, RoutedEventArgs e) | |||
{ | |||
DeviceOperate.GetInstance.WritePotFivePlcData("D2999", 1); | |||
Task.Run(new Action(() => { Thread.Sleep(2000); DeviceOperate.GetInstance.WritePotFivePlcData("D2999", 0); })); | |||
} | |||
} | |||
} |
@@ -7,7 +7,7 @@ | |||
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" | |||
xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic" | |||
mc:Ignorable="d" | |||
Title="FlowProcessView" Height="650" Width="940" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True"> | |||
Title="FlowProcessView" Height="675" Width="1075" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True"> | |||
<Window.DataContext> | |||
<vm:FlowProcessSetViewModel/> | |||
</Window.DataContext> | |||
@@ -389,6 +389,7 @@ | |||
</Border.Background> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50"/> | |||
<RowDefinition Height="50"/> | |||
<RowDefinition Height="50"/> | |||
<RowDefinition Height="40"/> | |||
@@ -407,12 +408,13 @@ | |||
<Button Content="取消" Height="30" Width="100" Margin="0,0,10,0" Background="Transparent" FontSize="18" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Command="{Binding CloseWindowCommand}"></Button> | |||
</StackPanel> | |||
<Grid Grid.Row="2" Background="#FF2AB2E7" Margin="0,0,0,8"> | |||
<Grid Grid.Row="2" Background="#FF2AB2E7" Margin="0,0,0,5"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="87"/> | |||
<ColumnDefinition Width="120"/> | |||
<ColumnDefinition Width="92"/> | |||
<ColumnDefinition Width="92"/> | |||
<ColumnDefinition Width="112"/> | |||
<ColumnDefinition Width="112"/> | |||
<ColumnDefinition Width="92"/> | |||
<ColumnDefinition Width="92"/> | |||
<ColumnDefinition Width="92"/> | |||
@@ -425,23 +427,30 @@ | |||
<GridSplitter BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="1" Text="原料/桶号设定" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="1" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="2" Text="速度设定" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="2" Text="速度(Hz)" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="2" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="3" Text="重量设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18" ></TextBlock> | |||
<TextBlock Grid.Column="3" Text="添加重量(Kg)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18" ></TextBlock> | |||
<GridSplitter Grid.Column="3" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="4" Text="温度设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="4" Text="目标重量(Kg)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18" ></TextBlock> | |||
<GridSplitter Grid.Column="4" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="5" Text="时间设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="5" Text="温度(℃)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="5" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="6" Text="小火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="6" Text="时间(M)" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="6" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="7" Text="中火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="7" Text="小火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="7" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="8" Text="大火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="8" Text="中火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="8" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="9" Text="强火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="9" Text="大火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="9" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="10" Text="强火比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
</Grid> | |||
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden"> | |||
<StackPanel Grid.Row="3" VerticalAlignment="Center" Orientation="Horizontal" Margin="0,0,0,5"> | |||
<TextBlock Text="目标重量偏差设置:" FontSize="20" Foreground="#FF2AB2E7" VerticalAlignment="Center"/> | |||
<TextBox Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#e69519" Cursor="Hand" Text="{Binding targetWeightOffset}" FontSize="18" Width="200" TextChanged="TextBox_TextChanged_10" Height="35" VerticalContentAlignment="Center"/> | |||
<TextBlock Text="Kg" FontSize="20" Foreground="#FF2AB2E7" VerticalAlignment="Center"/> | |||
</StackPanel> | |||
<ScrollViewer Grid.Row="4" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl x:Name="itemcontrols" AlternationCount="{Binding flowProcessModels.Count}" ItemsSource="{Binding flowProcessModels}" Margin="0,1,0,-1"> | |||
<ItemsControl.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -455,7 +464,8 @@ | |||
RelativeSource TemplatedParent}}" Foreground="SkyBlue" Width="87" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Background="Transparent" BorderBrush="#FF2AB2E7" BorderThickness="1,1,0.5,1"/> | |||
<ComboBox ItemsSource="{Binding DataContext.FlowItems, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" Text="{Binding FryMaterialNum}" Style="{StaticResource BaseComboBoxStyle}" IsReadOnly="True" Width="120" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/> | |||
<TextBox Text="{Binding FrySpeed}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged"/> | |||
<TextBox Text="{Binding FryWeight}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_1"/> | |||
<TextBox Text="{Binding FryWeight}" Width="112" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_1"/> | |||
<TextBox Text="{Binding TargeWeight}" Width="112" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_8"/> | |||
<TextBox Text="{Binding FryTemperature}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1" TextChanged="TextBox_TextChanged_2"/> | |||
<TextBox Text="{Binding FryPeriodTime}" Width="92" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,1,1" TextChanged="TextBox_TextChanged_3"/> | |||
@@ -160,6 +160,34 @@ namespace FryPot_DosingSystem.View | |||
} | |||
} | |||
private void TextBox_TextChanged_8(object sender, TextChangedEventArgs e) | |||
{ | |||
if (sender is TextBox txt) | |||
{ | |||
txt.Text = TextLimit(txt.Text); | |||
} | |||
} | |||
private void TextBox_TextChanged_10(object sender, TextChangedEventArgs e) | |||
{ | |||
if (sender is TextBox txtbox) | |||
{ | |||
if (Regex.IsMatch(txtbox.Text, @"^[0-9]+(.[1-9]{0,1})?$"))//验证整数或1位小数 | |||
{ | |||
txtbox.Text = txtbox.Text.Trim(); | |||
} | |||
else | |||
{ | |||
// MessageBox.Show("原料重量非法输入", "警告", MessageBoxButton.OKCancel, MessageBoxImage.Warning); | |||
txtbox.Text = string.Empty; | |||
} | |||
} | |||
} | |||
//private void ComboBox_KeyUp(object sender, KeyEventArgs e) | |||
//{ | |||
// var res = sender as ComboBox; | |||
@@ -26,7 +26,7 @@ | |||
<RowDefinition Height="50"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button> | |||
<!--<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button>--> | |||
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl ItemsSource="{Binding Recipes}"> | |||
<ItemsControl.ItemsPanel> | |||
@@ -49,7 +49,7 @@ | |||
<RowDefinition Height="50"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button> | |||
<!--<Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="配方一键下发" Width="110" Height="30" Margin="0,0,10,0" Cursor="Hand" Command="{Binding AllRecipeSetDownCommand}"></Button>--> | |||
<ScrollViewer Name="sv" Grid.Row="1" PreviewMouseWheel="ScrollViewer_PreviewMouseWheel" VerticalScrollBarVisibility="Hidden" > | |||
<ListView | |||
VerticalAlignment="Top" | |||
@@ -3,6 +3,7 @@ using BPASmartClient.CustomResource.UserControls; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.Model; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -14,13 +15,17 @@ using System.Windows; | |||
namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
internal class FlowProcessSetViewModel | |||
internal class FlowProcessSetViewModel:ObservableObject | |||
{ | |||
public int Id { get; set; } = 0; | |||
public static int materialNum { get; set; } | |||
public ObservableCollection<FlowProcessModel> flowProcessModels { get; set; } = new ObservableCollection<FlowProcessModel>(); | |||
/// <summary> | |||
/// 目标重量偏差 | |||
/// </summary> | |||
public string targetWeightOffset { get { return _targetWeightOffset; } set { _targetWeightOffset = value;OnPropertyChanged(); } } | |||
private string _targetWeightOffset; | |||
public string currentRecipeName { get; set; } | |||
public static int currentItemId { get; set; } | |||
public RelayCommand CloseWindowCommand { get; set; } | |||
@@ -66,6 +71,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess?.RecipeName == recipeName?.ToString()); | |||
if (res != null && res is NewRecipeModel recipe) //编辑已有工艺 | |||
{ | |||
targetWeightOffset = recipe.FlowProcess.targetWeightOffset.ToString(); | |||
foreach (var item in recipe.materialCollection) | |||
{ | |||
if (!FlowItems.Contains(item.MaterialLoc.ToString())) | |||
@@ -73,7 +79,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
} | |||
foreach (var item in recipe.FlowProcess.fpModels) | |||
{ | |||
flowProcessModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent }); | |||
flowProcessModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, TargeWeight=item.TargeWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent }); | |||
} | |||
// ActionManage.GetInstance.Send("MaterialNum", recipe.materialCollection.Count); | |||
@@ -92,7 +98,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
FlowItems.Add(item.MaterialLoc.ToString());//下拉框 | |||
} | |||
ActionManage.GetInstance.Send("MaterialNum", name.materialCollection.Count); | |||
name.FlowProcess.fpModels = flowProcessModels; | |||
//name.FlowProcess.fpModels = flowProcessModels; | |||
} | |||
} | |||
@@ -110,6 +116,16 @@ namespace FryPot_DosingSystem.ViewModel | |||
if (name != null) | |||
{ | |||
name.FlowProcess.RecipeName = currentRecipeName.ToString(); | |||
if (float.TryParse(targetWeightOffset.Trim(), out float offset)) | |||
{ | |||
name.FlowProcess.targetWeightOffset = offset;//目标重量偏差 | |||
} | |||
else | |||
{ | |||
MessageBox.Show("非法目标重量偏差设置", "提示", MessageBoxButton.OK, MessageBoxImage.Error); | |||
name.FlowProcess.targetWeightOffset = 0.0F; | |||
return; | |||
} | |||
//工艺桶号重复性检测 | |||
foreach (var item in name.materialCollection) | |||
{ | |||
@@ -122,11 +138,21 @@ namespace FryPot_DosingSystem.ViewModel | |||
return; | |||
} | |||
} | |||
//工艺步骤中清洗工艺重复性检测 | |||
if (flowProcessModels.FirstOrDefault(p=>p.FryMaterialNum=="清洗")!=null) | |||
{ | |||
if (flowProcessModels.Where(p => p.FryMaterialNum == "清洗").Count() > 1||flowProcessModels.IndexOf(flowProcessModels.FirstOrDefault(p => p.FryMaterialNum == "清洗"))<flowProcessModels.Count-1) | |||
{ | |||
MessageNotify.GetInstance.ShowUserLog("保存失败,清洗工艺重复或非法配置"); | |||
MessageBox.Show("保存失败,清洗工艺重复或非法配置", "提示", MessageBoxButton.OK, MessageBoxImage.Error); | |||
return; | |||
} | |||
} | |||
// name.FlowProcess.fpModels = flowProcessModels; | |||
name.FlowProcess.fpModels.Clear(); | |||
foreach (var item in flowProcessModels) | |||
{ | |||
name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent }); | |||
name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight,TargeWeight=item.TargeWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime, SmallFirePercent = item.SmallFirePercent, MidFirePercent = item.MidFirePercent, BigFirePercent = item.BigFirePercent, StrongFirePercent = item.StrongFirePercent }); | |||
} | |||
//foreach (var item in name.materialCollection) | |||
@@ -43,7 +43,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
public RelayCommand SaveAs { get; set; } | |||
public NewRecipeViewModel() | |||
{ | |||
Json<RecipeManage>.Read(); | |||
Json<MaterialNames>.Read(); | |||
MaterialNames.GetInstance.Names = Json<MaterialNames>.Data.Names; | |||
materialNames = Json<MaterialNames>.Data.Names; | |||
@@ -51,6 +51,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
if (Id != null && Id is string strId) | |||
{ | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == strId); | |||
if (res != null && res is NewRecipeModel rom) | |||
{ | |||
@@ -102,24 +103,25 @@ namespace FryPot_DosingSystem.ViewModel | |||
if (materials.Count<=8&& materials.Count> 0) | |||
{ | |||
//int lineNum= materials.ElementAt(0).MaterialLoc / 100; | |||
// //桶号正确性验证 | |||
// for (int i = 0; i < materials.Count; i++) | |||
// { | |||
// if (materials.ElementAt(i).MaterialLoc / 100 != lineNum|| materials.ElementAt(i).MaterialLoc % 100!=i+1||lineNum<=0||lineNum>5) | |||
// { | |||
// MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】"); | |||
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效"); | |||
// ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
// return; | |||
// } | |||
// } | |||
int lineNum = materials.ElementAt(0).MaterialLoc / 100; | |||
//桶号正确性验证 | |||
for (int i = 0; i < materials.Count; i++) | |||
{ | |||
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) | |||
{ | |||
MessageNotify.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效:【配方中原料桶号异常】"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"新建配方【{RecipeName}】无效"); | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
return; | |||
} | |||
} | |||
prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改 | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID); | |||
if (res == null) | |||
{ | |||
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, FlowProcess=new FlowProcessManage(), materialCollection = materials,DataTime=DateTime.Now.ToShortDateString()});//配方添加 | |||
} | |||
else | |||
{ | |||
@@ -145,21 +147,23 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
if (materials.Count > 0 && materials.Count <= 8) | |||
{ | |||
//int lineNum = materials.ElementAt(0).MaterialLoc / 100; | |||
////桶号正确性验证 | |||
//for (int i = 0; i < materials.Count; i++) | |||
//{ | |||
// if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) | |||
// { | |||
// MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); | |||
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); | |||
// ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
// return; | |||
// } | |||
//} | |||
int lineNum = materials.ElementAt(0).MaterialLoc / 100; | |||
//桶号正确性验证 | |||
for (int i = 0; i < materials.Count; i++) | |||
{ | |||
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) | |||
{ | |||
MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
return; | |||
} | |||
} | |||
bom.materialCollection = materials; | |||
bom.RecipeName = RecipeName; | |||
bom.UpdateTime = DateTime.Now.ToShortDateString(); | |||
if (bom.FlowProcess != null) | |||
bom.FlowProcess.RecipeName = RecipeName; | |||
Json<RecipeManage>.Save(); | |||
MessageNotify.GetInstance.ShowUserLog($"配方【{RecipeName}】修改成功"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"修改配方【{RecipeName}】成功"); | |||
@@ -181,24 +185,25 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
if (materials.Count>0&& materials.Count<=8)//验证配方中原料桶数 | |||
{ | |||
//int lineNum = materials.ElementAt(0).MaterialLoc / 100; | |||
////桶号正确性验证 | |||
//for (int i = 0; i < materials.Count; i++) | |||
//{ | |||
// if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) | |||
// { | |||
// MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); | |||
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); | |||
// ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
// return; | |||
// } | |||
//} | |||
int lineNum = materials.ElementAt(0).MaterialLoc / 100; | |||
//桶号正确性验证 | |||
for (int i = 0; i < materials.Count; i++) | |||
{ | |||
if (materials.ElementAt(i).MaterialLoc / 100 != lineNum || materials.ElementAt(i).MaterialLoc % 100 != i + 1 || lineNum <= 0 || lineNum > 5) | |||
{ | |||
MessageNotify.GetInstance.ShowUserLog($"另存配方【{RecipeName}】无效:【配方中原料桶号异常】"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"另存配方【{RecipeName}】无效"); | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
return; | |||
} | |||
} | |||
prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改 | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID); | |||
if (res == null) | |||
{ | |||
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, materialCollection = materials });//配方添加 | |||
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, DataTime = DateTime.Now.ToShortDateString(), RecipeName = RecipeName, materialCollection = materials,FlowProcess=new FlowProcessManage()});//配方添加 | |||
//Json<RecipeManage>.Save(); | |||
} | |||
else | |||
{ | |||
@@ -30,7 +30,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
public ObservableCollection<NewRecipeModel> Recipes { get; set; } = new ObservableCollection<NewRecipeModel>(); | |||
public RecipeSetDownViewModel() | |||
{ | |||
Json<RecipeManage>.Read(); | |||
//Json<RecipeManage>.Read(); | |||
Recipes =Json<RecipeManage>.Data.Recipes; | |||
RecipeSetDownCommand = new RelayCommand<object>((Id) => | |||
{ | |||
@@ -42,7 +42,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
RecipeSetDown(new NewRecipeModel[] { res }); | |||
//res.RecipeSetInfo = "配方下发成功"; | |||
//Task.Run(() => { Thread.Sleep(1500); res.RecipeSetInfo = string.Empty; }); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方下发成功!"); | |||
} | |||
else | |||
{ | |||
@@ -49,7 +49,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
public RecipeSetViewModel() | |||
{ | |||
Json<RecipeManage>.Read(); | |||
// Json<RecipeManage>.Read(); | |||
recipeModels =Json<RecipeManage>.Data.Recipes; | |||
int count = recipeModels.Count; | |||
bool sign = false; | |||
@@ -70,6 +70,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
else | |||
{ | |||
sign = true; | |||
Json<RecipeManage>.Data.Recipes.RemoveAt(Json<RecipeManage>.Data.Recipes.Count - 1); | |||
} | |||
} | |||
} | |||
@@ -104,9 +105,10 @@ namespace FryPot_DosingSystem.ViewModel | |||
var res = recipeModels.FirstOrDefault(p => p.RecipeId == strId); | |||
if (res != null && res is NewRecipeModel nes) | |||
{ | |||
recipeModels.Remove(res);//删除配方 | |||
recipeModels.Remove(nes);//删除配方 | |||
Json<RecipeManage>.Save();//保存配方 | |||
count = recipeModels.Count; | |||
MessageNotify.GetInstance.ShowUserLog($"成功删除配方【{nes.RecipeName}】"); | |||
} | |||
} | |||
}); | |||