@@ -8,7 +8,7 @@ | |||
<ItemGroup> | |||
<PackageReference Include="BPA.ApolloClient" Version="1.0.12" /> | |||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||
<PackageReference Include="BPA.Communication" Version="1.0.116" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | |||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | |||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" /> | |||
@@ -33,7 +33,7 @@ namespace BPASmartClient.Business | |||
{ | |||
MqttPushs.Name = DeviceType; | |||
LocDeviceType = DeviceType; | |||
mQTTProxy.ConnectOk = new Action(() => | |||
mQTTProxy.Connected = new Action(() => | |||
{ | |||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType)); | |||
@@ -44,7 +44,7 @@ namespace BPASmartClient.Business | |||
//主题初始化 | |||
TopicDefine.GetInstance().Initialize(Plugin.GetInstance().GetPlugin<DeviceMgr>().GetDevices()); | |||
mqttProxy.ConnectOk = () => | |||
mqttProxy.Connected = () => | |||
{ | |||
mqttProxy.Subscrib(TopicDefine.GetInstance().SubscribTopics.ToArray()); | |||
}; | |||
@@ -55,7 +55,11 @@ namespace BPASmartClient.Business | |||
var MqttServerConfig = Plugin.GetInstance().GetPlugin<ConfigMgr>().MQTT_Config; | |||
var MqttServerAccount = Plugin.GetInstance().GetPlugin<ConfigMgr>().Mqtt_Account; | |||
var deviceConfig = Plugin.GetInstance().GetPlugin<ConfigMgr>().deviceConfigModelJsons; | |||
string deviceId = deviceConfig[0].deviceModels[0].DeviceId; | |||
string deviceId = ""; | |||
if (deviceConfig.Count > 0 && deviceConfig[0].deviceModels.Count > 0) | |||
{ | |||
deviceId = deviceConfig[0].deviceModels[0].DeviceId; | |||
} | |||
clientId = Plugin.GetInstance().GetPlugin<ConfigMgr>().ClientId; | |||
//MQTT 初始化 | |||
mqttProxy.Connect(new BPA.Communication.Base.ConfigurationOptions() | |||
@@ -463,7 +463,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | |||
<PackageReference Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" /> | |||
</ItemGroup> | |||
@@ -106,9 +106,16 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
Value = value.ToString(), | |||
Time = DateTime.Now.ToString("HH:mm:ss"), | |||
}; | |||
try | |||
{ | |||
var res = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Base.Add(tempAlarm); | |||
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save(); | |||
} | |||
catch (Exception) | |||
{ | |||
} | |||
var res = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Base.Add(tempAlarm); | |||
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save(); | |||
if (Alarms.FirstOrDefault(p => p.Info == AlarmInfo) == null) | |||
{ | |||
@@ -41,10 +41,18 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
public void LogSave() | |||
{ | |||
Sqlite<UserLog>.GetInstance.Save(); | |||
Sqlite<RunLog>.GetInstance.Save(); | |||
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save(); | |||
Sqlite<RecipeCompleteLog>.GetInstance.Save(); | |||
try | |||
{ | |||
Sqlite<UserLog>.GetInstance.Save(); | |||
Sqlite<RunLog>.GetInstance.Save(); | |||
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save(); | |||
Sqlite<RecipeCompleteLog>.GetInstance.Save(); | |||
} | |||
catch (Exception) | |||
{ | |||
// throw; | |||
} | |||
} | |||
public void ShowRecipeLog(string info) | |||
@@ -57,19 +57,27 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||
BPA.Helper.MessageLog.GetInstance.NotifyShow = new Action<string>((o) => | |||
{ | |||
Application.Current?.Dispatcher?.Invoke(() => | |||
try | |||
{ | |||
//ff20aefe | |||
var temp = new MessageModel() | |||
{ | |||
LogInfo = o, | |||
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254)) | |||
}; | |||
if (DebugLogViewModel.MessageModels.Count > 0) | |||
DebugLogViewModel.MessageModels.Insert(0, temp); | |||
else | |||
DebugLogViewModel.MessageModels.Add(temp); | |||
}); | |||
Application.Current?.Dispatcher?.Invoke(() => | |||
{ | |||
//ff20aefe | |||
var temp = new MessageModel() | |||
{ | |||
LogInfo = o, | |||
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254)) | |||
}; | |||
if (DebugLogViewModel.MessageModels.Count > 0) | |||
DebugLogViewModel.MessageModels.Insert(0, temp); | |||
else | |||
DebugLogViewModel.MessageModels.Add(temp); | |||
}); | |||
} | |||
catch (Exception) | |||
{ | |||
//throw; | |||
} | |||
}); | |||
BPA.Helper.MessageLog.GetInstance.NotifyShowEx = new Action<string>((o) => | |||
{ | |||
@@ -162,7 +162,7 @@ namespace BPASmartClient.Device | |||
/// <param name="info"></param> | |||
public void DeviceProcessLogShow(string info) | |||
{ | |||
Log.Insert(0, new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Type = "流程", Text = info }); | |||
Log.Insert(0, new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"), Type = "流程", Text = info }); | |||
MessageLog.GetInstance.DeviceProcessLogShow(DeviceId.ToString(), info); | |||
if (Log.Count > 100) { Log.RemoveAt(Log.Count - 1); } | |||
} | |||
@@ -28,7 +28,12 @@ namespace BPASmartClient.Device | |||
if (address.Length > 0) | |||
{ | |||
address = address.Trim(); | |||
if (address.ToUpper().Contains("M") && address.Length >= 4) | |||
if (address.ToUpper().Contains("GM") && address.Length >= 3) | |||
{ | |||
var res = address.Remove(0, 2); | |||
if (res != null && res.Length > 0) return (int.Parse(res) + 4096).ToString(); | |||
} | |||
else if (address.ToUpper().Contains("M") && address.Length >= 4) | |||
{ | |||
var res = address.Substring(1).Split('.'); | |||
if (res != null && res.Length == 2) | |||
@@ -42,6 +47,19 @@ namespace BPASmartClient.Device | |||
} | |||
} | |||
} | |||
else if (address.ToUpper().Contains("GI") && address.Length >= 3) | |||
{ | |||
var res = address.Remove(0, 2); | |||
if (res != null && res.Length > 0) return res; | |||
} | |||
else if (address.ToUpper().Contains("LB") && address.Length >= 3) | |||
{ | |||
var res = address.Substring(2); | |||
if (res != null && res.Length > 0) | |||
{ | |||
if (int.TryParse(res, out int firstAddress)) return firstAddress.ToString(); | |||
} | |||
} | |||
else if ((address.ToUpper().Contains("VW") || address.ToUpper().Contains("VD")) && address.Length >= 3) | |||
{ | |||
var res = address.Substring(2); | |||
@@ -50,8 +68,44 @@ namespace BPASmartClient.Device | |||
return ((tempAddress / 2) + 100).ToString(); | |||
} | |||
} | |||
else if (address.ToUpper().Contains("LW") && address.Length >= 3) | |||
{ | |||
var res = address.Substring(2); | |||
if (res != null && int.TryParse(res, out int LwAddress)) | |||
{ | |||
return LwAddress.ToString(); | |||
} | |||
} | |||
} | |||
return ""; | |||
//if (address == null) return ""; | |||
//if (address.Length > 0) | |||
//{ | |||
// address = address.Trim(); | |||
// if (address.ToUpper().Contains("M") && address.Length >= 4) | |||
// { | |||
// var res = address.Substring(1).Split('.'); | |||
// if (res != null && res.Length == 2) | |||
// { | |||
// if (int.TryParse(res[0], out int firstAddress) && int.TryParse(res[1], out int ExitAddress)) | |||
// { | |||
// if (ExitAddress >= 0 && ExitAddress <= 7) | |||
// { | |||
// return ((firstAddress * 8) + 320 + ExitAddress).ToString(); | |||
// } | |||
// } | |||
// } | |||
// } | |||
// else if ((address.ToUpper().Contains("VW") || address.ToUpper().Contains("VD")) && address.Length >= 3) | |||
// { | |||
// var res = address.Substring(2); | |||
// if (res != null && int.TryParse(res, out int tempAddress)) | |||
// { | |||
// return ((tempAddress / 2) + 100).ToString(); | |||
// } | |||
// } | |||
//} | |||
//return ""; | |||
} | |||
/// <summary> | |||
@@ -16,7 +16,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.73" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | |||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | |||
</ItemGroup> | |||
@@ -16,7 +16,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||
<PackageReference Include="BPA.Communication" Version="1.0.116" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -185,7 +185,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||
DeviceStatus DS = new DeviceStatus(); | |||
DS.modbusTcp.IsReconnect = false; | |||
DS.modbusTcp.ConnectOk = new Action(() => | |||
DS.modbusTcp.Connected = new Action(() => | |||
{ | |||
string DeviceName = DS.modbusTcp.Read<string>(DeviceAddress.DeviceName, 20).Content.Trim()?.Replace(" ", "");//读取设备名称 | |||
if (DeviceName.Length > 0) | |||
@@ -199,7 +199,7 @@ namespace BPASmartDatavDeviceClient.IoT | |||
//json = APIHelper.GetInstance.GetRequest($"{url}/api/Device/Query?clientId={clientId}&deviceId={deviceId}"); | |||
json = APIHelper.GetInstance.GetRequest($"{url}/api/Device/Query?clientId={clientId}&deviceId={deviceId}"); | |||
JsonMsg<List<DeviceTable>> jsonMsg = Tools.JsonToObjectTools<JsonMsg<List<DeviceTable>>>(json); | |||
if (jsonMsg.obj != null && jsonMsg.obj.data != null) | |||
if (jsonMsg != null && jsonMsg.obj != null && jsonMsg.obj.data != null) | |||
{ | |||
device = jsonMsg.obj.data.FirstOrDefault(); | |||
if (device == null) return false; | |||
@@ -2,8 +2,12 @@ | |||
<configuration> | |||
<appSettings> | |||
<add key="HKPlc_IP" value="107.107.2.17"/> | |||
<add key="Siemens_IP" value="107.107.2.200"/> | |||
<add key="HKPlc_Connect" value="false"/> | |||
<add key="Siemens_IP" value="107.107.2.200"/> | |||
<add key="MQTT_USERNAME" value="107.107.2.200"/> | |||
<add key="MQTT_PASSWORD" value="107.107.2.200"/> | |||
<add key="MQTT_IPADDRESS" value="107.107.2.200"/> | |||
<add key="MQTT_PORT" value="107.107.2.200"/> | |||
<add key="HKPlc_Connect" value="false"/> | |||
<add key="Siemens_Connect" value="false"/> | |||
</appSettings> | |||
</configuration> |
@@ -181,6 +181,13 @@ namespace BPASmartClient.JXJFoodBigStation | |||
ToggleWindowPath = "View.HKPlcCommMonitorView" | |||
}); | |||
DeviceMonitor.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "全局变量", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.JXJFoodBigStation", | |||
ToggleWindowPath = "View.GlobalVarMonitorView" | |||
}); | |||
DeviceMonitor.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "手动流程", | |||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||
@@ -17,8 +17,8 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Communication" Version="1.0.109" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Communication" Version="1.0.116" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -15,58 +15,76 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// <summary> | |||
/// plc心跳上传 | |||
/// </summary> | |||
[PlcComm("plc心跳上传")] | |||
public static bool HeartBeatFromPlc { get; set; } | |||
/// <summary> | |||
/// 订单取消的状态位 | |||
/// </summary> | |||
[PlcComm("订单取消的状态位")] | |||
public static bool Order_Cancel { get; set; } | |||
/// <summary> | |||
/// 订单取消的配方号 | |||
/// </summary> | |||
[PlcComm("订单取消的配方号")] | |||
public static string Order_CancelRecipeCode { get; set; } = ""; | |||
/// <summary> | |||
/// 订单取消的状态步 | |||
/// </summary> | |||
[PlcComm("订单取消的状态步")] | |||
public static int Order_CancelStep { get; set; } | |||
/// <summary> | |||
/// 第一个配方的配料时间 | |||
/// </summary> | |||
[PlcComm("第一个配方的配料时间")] | |||
public static DateTime DosingRecipe1Time { get; set; } | |||
/// <summary> | |||
/// 第二个配方的配料时间 | |||
/// </summary> | |||
[PlcComm("第二个配方的配料时间")] | |||
public static DateTime DosingRecipe2Time { get; set; } | |||
/// <summary> | |||
/// 第三个配方的配料时间 | |||
/// </summary> | |||
[PlcComm("第三个配方的配料时间")] | |||
public static DateTime DosingRecipe3Time { get; set; } | |||
/// <summary> | |||
/// 第四个配方的配料时间 | |||
/// </summary> | |||
[PlcComm("第四个配方的配料时间")] | |||
public static DateTime DosingRecipe4Time { get; set; } | |||
/// <summary> | |||
/// plc心跳下发 | |||
/// </summary> | |||
[PlcComm("plc心跳下发")] | |||
public static bool HeartBeatToPlc { get; set; } | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 | |||
/// </summary> | |||
[PlcComm("配方1下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方")] | |||
public static int Recipe1DosingStatus { get; set; } | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 | |||
/// </summary> | |||
[PlcComm("配方2下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方")] | |||
public static int Recipe2DosingStatus { get; set; } | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 | |||
/// </summary> | |||
[PlcComm("配方3下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方")] | |||
public static int Recipe3DosingStatus { get; set; } | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 | |||
/// </summary> | |||
[PlcComm("配方4下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方")] | |||
public static int Recipe4DosingStatus { get; set; } | |||
public static int[] RecipeDosingStatus { get; set; } = new int[4] { 0, 0, 0, 0 }; | |||
public static bool[] AllowIssueRecipe { get; set; } = new bool[4] { false, false, false, false }; | |||
public static bool[] ReceviceFinishRecipe { get; set; } = new bool[4] { false, false, false, false }; | |||
public static bool[] DosingFinishRecipe { get; set; } = new bool[4] { false, false, false, false }; | |||
public static bool[] IsTrayArrive { get; set; } = new bool[5] { false, false, false, false,false }; | |||
@@ -75,19 +93,23 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// <summary> | |||
/// 是否处于手动下发配方 | |||
/// </summary> | |||
[PlcComm("是否处于手动下发配方")] | |||
public static bool IsUseLocalRecipe { get; set; } = false; | |||
/// <summary> | |||
/// 洗桶的标识符 | |||
/// </summary> | |||
[PlcComm("洗桶的标识符")] | |||
public static bool BarrelWasherSign { get; set; } | |||
/// <summary> | |||
/// 订单请求 | |||
/// </summary> | |||
[PlcComm("订单请求")] | |||
public static bool Order_Request { get; set; } = false; | |||
/// <summary> | |||
/// 下发配方的状态位 | |||
/// </summary> | |||
[PlcComm("下发配方的状态位")] | |||
public static int SiemensSendRecipeStatus { get; set; } = 0; | |||
/// <summary> | |||
@@ -101,10 +123,14 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// </summary> | |||
public static Dictionary<string, string> RawMaterialsNameCode { get; set; } = new Dictionary<string, string>(); | |||
[PlcComm("AGV送托盘")] | |||
public static ushort AGVPutTray { get; set; } | |||
[PlcComm("AGV取托盘")] | |||
public static ushort AGVGetTray { get; set; } | |||
[PlcComm("托盘传感器信号")] | |||
public static ushort TraySensor { get; set; } | |||
[PlcComm("托盘气缸信号")] | |||
public static ushort TrayCylinder { get; set; } | |||
public static DB_Read HKPlc_Read = new DB_Read(); | |||
@@ -112,33 +138,41 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// <summary> | |||
/// 是否连接海科PLC | |||
/// </summary> | |||
[PlcComm("是否连接海科PLC")] | |||
public static bool IsAllowHKPlcConnect { get; set; } | |||
/// <summary> | |||
/// 是否连接西门子PLC | |||
/// </summary> | |||
[PlcComm("是否连接西门子PLC")] | |||
public static bool IsAllowSiemensConnect { get; set; } | |||
/// <summary> | |||
/// 配方1配料完成 | |||
/// </summary> | |||
[PlcComm("配方1配料完成")] | |||
public static bool Recipe1DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 配方2配料完成 | |||
/// </summary> | |||
[PlcComm("配方2配料完成")] | |||
public static bool Recipe2DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 配方3配料完成 | |||
/// </summary> | |||
[PlcComm("配方3配料完成")] | |||
public static bool Recipe3DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 配方4配料完成 | |||
/// </summary> | |||
[PlcComm("配方4配料完成")] | |||
public static bool Recipe4DosingFinish { get; set; } = false; | |||
/// <summary> | |||
/// 订单是否是洗桶 | |||
/// </summary> | |||
[PlcComm("订单是否是洗桶")] | |||
public static bool Order_IsWashingBarrel { get; set; } = false; | |||
[PlcComm("TrayEnable")] | |||
public static int TrayEnable { get; set; } = 15; | |||
} | |||
} |
@@ -7,6 +7,9 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
{ | |||
/// <summary> | |||
/// 上位机只写的DB99。 | |||
/// </summary> | |||
public class DB_Write | |||
{ | |||
/// <summary> | |||
@@ -78,7 +78,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
{ | |||
int index = Array.FindIndex(recipe.RawMaterial.ToArray(), p => p.RawMaterialBarrelNum == barrel && p.RawMaterialLocation == loc); | |||
#region 新版本 | |||
int x = 0; | |||
if (barrel < 3) x = (barrel - 1) * 56 + 6; | |||
else if (barrel > 3) x = (barrel - 2) * 56 + 6; | |||
@@ -93,64 +92,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
HK_PLC_S7.Write(address, recipe.RawMaterial.ElementAt(index).RawMaterialWeight); | |||
MessageNotify.GetInstance.ShowRunLog($"配方编号:{recipe.RecipeCode},托盘编号:{recipe.TrayCode},桶号:{barrel},位置:{loc},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}"); | |||
} | |||
#endregion | |||
#region 旧版本 | |||
//if (index == -1) | |||
//{ | |||
// switch (barrel) | |||
// { | |||
// case 1: | |||
// string address = "DB99.DBD" + (6 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address, 0); | |||
// break; | |||
// case 2: | |||
// string address1 = "DB99.DBD" + (62 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address1, 0); | |||
// break; | |||
// case 4: | |||
// string address2 = "DB99.DBD" + (118 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address2, 0); | |||
// break; | |||
// case 5: | |||
// string address3 = "DB99.DBD" + (174 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address3, 0); | |||
// break; | |||
// default: | |||
// break; | |||
// } | |||
//} | |||
//else | |||
//{ | |||
// switch (barrel) | |||
// { | |||
// case 1: | |||
// string address = "DB99.DBD" + (6 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address, recipe.RawMaterial.ElementAt(index).RawMaterialWeight); | |||
// MessageNotify.GetInstance.ShowRunLog($"配方编号:{recipe.RecipeCode},托盘编号:{recipe.TrayCode},桶号:{barrel},位置:{loc},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}"); | |||
// break; | |||
// case 2: | |||
// string address1 = "DB99.DBD" + (62 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address1, recipe.RawMaterial.ElementAt(index).RawMaterialWeight); | |||
// MessageNotify.GetInstance.ShowRunLog($"配方编号:{recipe.RecipeCode},托盘编号:{recipe.TrayCode},桶号:{barrel},位置:{loc},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}"); | |||
// break; | |||
// case 4: | |||
// string address2 = "DB99.DBD" + (118 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address2, recipe.RawMaterial.ElementAt(index).RawMaterialWeight); | |||
// MessageNotify.GetInstance.ShowRunLog($"配方编号:{recipe.RecipeCode},托盘编号:{recipe.TrayCode},桶号:{barrel},位置:{loc},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}"); | |||
// break; | |||
// case 5: | |||
// string address3 = "DB99.DBD" + (174 + 4 * (loc - 1)); | |||
// HK_PLC_S7.Write(address3, recipe.RawMaterial.ElementAt(index).RawMaterialWeight); | |||
// MessageNotify.GetInstance.ShowRunLog($"配方编号:{recipe.RecipeCode},托盘编号:{recipe.TrayCode},桶号:{barrel},位置:{loc},重量:{recipe.RawMaterial.ElementAt(index).RawMaterialWeight}"); | |||
// break; | |||
// default: | |||
// break; | |||
// } | |||
//} | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -1,13 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
{ | |||
public class HKPlcCommAddress | |||
{ | |||
} | |||
} |
@@ -1,19 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
{ | |||
public class PlcReceviceRecipe | |||
{ | |||
public short TrayNum { get; set; } | |||
public short RecipeNum { get; set; } | |||
public float[] Barrel1Weight { get; set; } = new float[14]; | |||
public float[] Barrel2Weight { get; set; } = new float[14]; | |||
public float[] Barrel4Weight { get; set; } = new float[14]; | |||
public float[] Barrel5Weight { get; set; } = new float[14]; | |||
} | |||
} |
@@ -7,7 +7,7 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||
{ | |||
public class DL_DataColl_DB | |||
public class DL_DataColl_DB | |||
{ | |||
[Siemens(16)] | |||
public string RecipeCode { get; set; } = ""; | |||
@@ -1,4 +1,5 @@ | |||
using BPASmartClient.S7Net; | |||
using BPASmartClient.JXJFoodBigStation.Model.MQTT.Message; | |||
using BPASmartClient.S7Net; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
@@ -1,14 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||
{ | |||
public class SiemensCommAddress | |||
{ | |||
} | |||
} |
@@ -12,7 +12,7 @@ namespace BPASmartClient.JXJFoodBigStation.Properties { | |||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] | |||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] | |||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { | |||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); | |||
@@ -383,10 +383,11 @@ | |||
<ListView.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<!--<WrapPanel Orientation="Horizontal" IsItemsHost="True"/>--> | |||
<UniformGrid FlowDirection="RightToLeft" | |||
<UniformGrid | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Columns="7" | |||
FlowDirection="RightToLeft" | |||
Rows="1" /> | |||
</ItemsPanelTemplate> | |||
</ListView.ItemsPanel> | |||
@@ -562,10 +563,12 @@ | |||
</Grid> | |||
<!--#region 底部料仓--> | |||
<Grid Grid.Row="2"> | |||
<Grid Grid.Row="2" x:Name="bottomGrid"> | |||
<ListView | |||
x:Name="buttonListView" | |||
VerticalAlignment="Top" | |||
Height="{Binding ElementName=bottomGrid, Path=ActualHeight}" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding BottomDeviceCurrentStatuses}" | |||
@@ -576,6 +579,7 @@ | |||
<UniformGrid | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
FlowDirection="LeftToRight" | |||
Columns="7" | |||
Rows="1" /> | |||
</ItemsPanelTemplate> | |||
@@ -716,6 +720,7 @@ | |||
</DataTemplate> | |||
</ListView.ItemTemplate> | |||
</ListView> | |||
</Grid> | |||
<!--#endregion--> | |||
@@ -322,7 +322,11 @@ | |||
Text="{Binding TrayCode}" /> | |||
</StackPanel> | |||
</StackPanel> | |||
<StackPanel Margin="0,8" Orientation="Horizontal"> | |||
<!--#region 后续修改不需要进行分类筛选了--> | |||
<StackPanel | |||
Margin="0,8" | |||
Orientation="Horizontal" | |||
Visibility="Hidden"> | |||
<TextBlock | |||
Margin="10,0,5,0" | |||
VerticalAlignment="Center" | |||
@@ -343,6 +347,7 @@ | |||
ItemsSource="{Binding Categorys}" | |||
Text="{Binding RecipeCategory}" /> | |||
</StackPanel> | |||
<!--#endregion--> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
@@ -160,8 +160,10 @@ | |||
x:Name="IsUseLocalRecipe" | |||
Margin="0,0,10,0" | |||
VerticalAlignment="Center" | |||
VerticalContentAlignment="Center" | |||
Content="使用本地配方配料" | |||
FontFamily="楷体" | |||
FontSize="20" | |||
Foreground="Aqua" | |||
IsChecked="{Binding IsUseLocalRecipe}" /> | |||
@@ -293,7 +295,7 @@ | |||
FontSize="12" | |||
Foreground="#FF2AB2E7" | |||
Text="{Binding RecipeName}" /> | |||
<TextBlock | |||
<!--<TextBlock | |||
Grid.Row="5" | |||
Grid.Column="0" | |||
Margin="2,5,0,0" | |||
@@ -301,7 +303,7 @@ | |||
VerticalAlignment="Center" | |||
FontSize="12" | |||
Foreground="#FF2AB2E7" | |||
Text="配方类别:" /> | |||
Text="配方类别:" />--> | |||
@@ -62,6 +62,34 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
return; | |||
} | |||
if (string.IsNullOrWhiteSpace(RecipeName) ) | |||
{ | |||
MessageNotify.GetInstance.ShowDialog("配方名称不可为空,请修改后再试。",DialogType.Error); | |||
return; | |||
} | |||
if (TrayCode is <=0 or >5) | |||
{ | |||
MessageNotify.GetInstance.ShowDialog("请输入正确的托盘编号,请修改后再试。", DialogType.Error); | |||
return; | |||
} | |||
foreach (RawMaterial item in RawMaterialsInfo) | |||
{ | |||
if (item.RawMaterialLocation ==0) | |||
{ | |||
MessageNotify.GetInstance.ShowDialog("请输入正确的原料位置,请修改后再试。", DialogType.Error); | |||
return; | |||
} | |||
if (item.RawMaterialBarrelNum is <=0 or >4) | |||
{ | |||
MessageNotify.GetInstance.ShowDialog("请输入正确的托盘桶号,请修改后再试。", DialogType.Error); | |||
return; | |||
} | |||
if (item.RawMaterialWeight <=0) | |||
{ | |||
MessageNotify.GetInstance.ShowDialog("请输入正确的原料重量,请修改后再试。", DialogType.Error); | |||
return; | |||
} | |||
} | |||
var bom= Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == RecipeCode); | |||
if (bom == null)//新配方 | |||
{ | |||
@@ -113,8 +113,8 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
} | |||
Json<LocalRecipe>.Data.Recipes.Clear(); | |||
Json<LocalRecipe>.Save(); | |||
Json<LocalRecipe>.Data.SelectedRecipes.Clear(); | |||
Json<LocalRecipe>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"本地配方已全部删除!"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。"); | |||
}); | |||
@@ -126,6 +126,11 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
return; | |||
} | |||
var res = Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode); | |||
var res1 = Json<LocalRecipe>.Data.SelectedRecipes.FirstOrDefault(p => p.RecipeCode == recipeCode); | |||
if (res1 is not null) | |||
{ | |||
Json<LocalRecipe>.Data.SelectedRecipes.Remove(res1); | |||
} | |||
if (res != null) | |||
{ | |||
Recipes.Remove(res); | |||
@@ -17,6 +17,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
public SelectRecipesViewModel() | |||
{ | |||
AllRecipes = new(); | |||
SelectRecipes.Clear(); | |||
foreach (var item in Json<LocalRecipe>.Data.SelectedRecipes) | |||
{ | |||
SelectRecipes.Add(item); | |||
@@ -1,16 +0,0 @@ | |||
using BPA.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.Bom | |||
{ | |||
public class BomMaterialData | |||
{ | |||
public ObservableCollection<BomMaterial> Materials { get; set; } = new ObservableCollection<BomMaterial>(); | |||
} | |||
} |
@@ -1,12 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
public class GVL | |||
{ | |||
} | |||
} |
@@ -1,117 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
public class ReadSmallMaterial | |||
{ | |||
/// <summary> | |||
/// PLC到上位机心跳 | |||
/// </summary> | |||
public bool Heart { get; set; } | |||
public bool Agv1 { get; set; } | |||
public bool Agv2 { get; set; } | |||
public bool Agv3 { get; set; } | |||
public bool Agv4 { get; set; } | |||
public bool Agv5 { get; set; } | |||
public bool Agv6 { get; set; } | |||
/// <summary> | |||
/// 1#托盘工位占用 | |||
/// </summary> | |||
public bool Tray1BeOccupied { get; set; } | |||
/// <summary> | |||
/// 2#托盘工位占用 | |||
/// </summary> | |||
public bool Tray2BeOccupied { get; set; } | |||
/// <summary> | |||
/// 1#托盘工位配料完成 | |||
/// </summary> | |||
public bool Tray1MaterialFinish { get; set; } | |||
/// <summary> | |||
/// 2#托盘工位配料完成 | |||
/// </summary> | |||
public bool Tray2MaterialFinish { get; set; } | |||
/// <summary> | |||
/// 接收托盘1配方数据完成 | |||
/// </summary> | |||
public bool Tray1ReceiveFinish { get; set; } | |||
/// <summary> | |||
/// 接收托盘2配方数据完成 | |||
/// </summary> | |||
public bool Tray2ReceiveFinish { get; set; } | |||
public int Reserve1 { get; set; } | |||
public int Receive2 { get; set; } | |||
/// <summary> | |||
/// 托盘1_1#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel1Location { get; set; } | |||
/// <summary> | |||
/// 托盘1_2#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel2Location { get; set; } | |||
/// <summary> | |||
/// 托盘1_3#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel3Location { get; set; } | |||
/// <summary> | |||
/// 托盘1_4#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel4Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_1#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel1Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_2#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel2Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_3#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel3Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_4#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel4Location { get; set; } | |||
public int Reserve3 { get; set; } | |||
public int Receive4 { get; set; } | |||
/// <summary> | |||
/// 托盘1_1#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel1AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘1_2#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel2AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘1_3#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel3AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘1_4#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel4AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_1#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel1AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_2#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel2AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_3#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel3AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_4#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel4AllowDosing { get; set; } | |||
} | |||
} |
@@ -1,185 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
public class WriteSmallMaterial | |||
{ | |||
/// <summary> | |||
/// PLC到上位机心跳 | |||
/// </summary> | |||
public bool Heart { get; set; } | |||
public bool Agv1 { get; set; } | |||
public bool Agv2 { get; set; } | |||
public bool Agv3 { get; set; } | |||
public bool Agv4{ get; set; } | |||
public bool Agv5 { get; set; } | |||
public bool Agv6 { get; set; } | |||
public bool Agv7 { get; set; } | |||
public bool Agv8 { get; set; } | |||
public bool Agv9 { get; set; } | |||
public bool Agv10 { get; set; } | |||
/// <summary> | |||
/// 下发配方到托盘1 | |||
/// </summary> | |||
public bool Tray1IssueRecipe { get; set; } | |||
/// <summary> | |||
/// 下发配方到托盘2 | |||
/// </summary> | |||
public bool Tray2IssueRecipe { get; set; } | |||
public int Reserve1 { get; set; } | |||
public int Receive2 { get; set; } | |||
public bool Tray1Barrel1IsDosing1; | |||
public bool Tray1Barrel1IsDosing2; | |||
public bool Tray1Barrel1IsDosing3; | |||
public bool Tray1Barrel1IsDosing4; | |||
public bool Tray1Barrel1IsDosing5; | |||
public bool Tray1Barrel1IsDosing6; | |||
public bool Tray1Barrel1IsDosing7; | |||
public bool Tray1Barrel1IsDosing8; | |||
public bool Tray1Barrel1IsDosing9; | |||
public bool Tray1Barrel1IsDosing10; | |||
public bool Tray1Barrel1IsDosing11; | |||
public bool Tray1Barrel1IsDosing12; | |||
public bool Tray1Barrel1IsDosing13; | |||
public bool Tray1Barrel1IsDosing14; | |||
public bool Tray1Barrel1IsDosing15; | |||
public bool Receive3; | |||
public bool Tray1Barrel2IsDosing1; | |||
public bool Tray1Barrel2IsDosing2; | |||
public bool Tray1Barrel2IsDosing3; | |||
public bool Tray1Barrel2IsDosing4; | |||
public bool Tray1Barrel2IsDosing5; | |||
public bool Tray1Barrel2IsDosing6; | |||
public bool Tray1Barrel2IsDosing7; | |||
public bool Tray1Barrel2IsDosing8; | |||
public bool Tray1Barrel2IsDosing9; | |||
public bool Tray1Barrel2IsDosing10; | |||
public bool Tray1Barrel2IsDosing11; | |||
public bool Tray1Barrel2IsDosing12; | |||
public bool Tray1Barrel2IsDosing13; | |||
public bool Tray1Barrel2IsDosing14; | |||
public bool Tray1Barrel2IsDosing15; | |||
public bool Receive4; | |||
public bool Tray1Barrel3IsDosing1; | |||
public bool Tray1Barrel3IsDosing2; | |||
public bool Tray1Barrel3IsDosing3; | |||
public bool Tray1Barrel3IsDosing4; | |||
public bool Tray1Barrel3IsDosing5; | |||
public bool Tray1Barrel3IsDosing6; | |||
public bool Tray1Barrel3IsDosing7; | |||
public bool Tray1Barrel3IsDosing8; | |||
public bool Tray1Barrel3IsDosing9; | |||
public bool Tray1Barrel3IsDosing10; | |||
public bool Tray1Barrel3IsDosing11; | |||
public bool Tray1Barrel3IsDosing12; | |||
public bool Tray1Barrel3IsDosing13; | |||
public bool Tray1Barrel3IsDosing14; | |||
public bool Tray1Barrel3IsDosing15; | |||
public bool Receive5; | |||
public bool Tray1Barrel4IsDosing1; | |||
public bool Tray1Barrel4IsDosing2; | |||
public bool Tray1Barrel4IsDosing3; | |||
public bool Tray1Barrel4IsDosing4; | |||
public bool Tray1Barrel4IsDosing5; | |||
public bool Tray1Barrel4IsDosing6; | |||
public bool Tray1Barrel4IsDosing7; | |||
public bool Tray1Barrel4IsDosing8; | |||
public bool Tray1Barrel4IsDosing9; | |||
public bool Tray1Barrel4IsDosing10; | |||
public bool Tray1Barrel4IsDosing11; | |||
public bool Tray1Barrel4IsDosing12; | |||
public bool Tray1Barrel4IsDosing13; | |||
public bool Tray1Barrel4IsDosing14; | |||
public bool Tray1Barrel4IsDosing15; | |||
public bool Receive6; | |||
public bool Tray2Barrel1IsDosing1; | |||
public bool Tray2Barrel1IsDosing2; | |||
public bool Tray2Barrel1IsDosing3; | |||
public bool Tray2Barrel1IsDosing4; | |||
public bool Tray2Barrel1IsDosing5; | |||
public bool Tray2Barrel1IsDosing6; | |||
public bool Tray2Barrel1IsDosing7; | |||
public bool Tray2Barrel1IsDosing8; | |||
public bool Tray2Barrel1IsDosing9; | |||
public bool Tray2Barrel1IsDosing10; | |||
public bool Tray2Barrel1IsDosing11; | |||
public bool Tray2Barrel1IsDosing12; | |||
public bool Tray2Barrel1IsDosing13; | |||
public bool Tray2Barrel1IsDosing14; | |||
public bool Tray2Barrel1IsDosing15; | |||
public bool Receive7; | |||
public bool Tray2Barrel2IsDosing1; | |||
public bool Tray2Barrel2IsDosing2; | |||
public bool Tray2Barrel2IsDosing3; | |||
public bool Tray2Barrel2IsDosing4; | |||
public bool Tray2Barrel2IsDosing5; | |||
public bool Tray2Barrel2IsDosing6; | |||
public bool Tray2Barrel2IsDosing7; | |||
public bool Tray2Barrel2IsDosing8; | |||
public bool Tray2Barrel2IsDosing9; | |||
public bool Tray2Barrel2IsDosing10; | |||
public bool Tray2Barrel2IsDosing11; | |||
public bool Tray2Barrel2IsDosing12; | |||
public bool Tray2Barrel2IsDosing13; | |||
public bool Tray2Barrel2IsDosing14; | |||
public bool Tray2Barrel2IsDosing15; | |||
public bool Receive8; | |||
public bool Tray2Barrel3IsDosing1; | |||
public bool Tray2Barrel3IsDosing2; | |||
public bool Tray2Barrel3IsDosing3; | |||
public bool Tray2Barrel3IsDosing4; | |||
public bool Tray2Barrel3IsDosing5; | |||
public bool Tray2Barrel3IsDosing6; | |||
public bool Tray2Barrel3IsDosing7; | |||
public bool Tray2Barrel3IsDosing8; | |||
public bool Tray2Barrel3IsDosing9; | |||
public bool Tray2Barrel3IsDosing10; | |||
public bool Tray2Barrel3IsDosing11; | |||
public bool Tray2Barrel3IsDosing12; | |||
public bool Tray2Barrel3IsDosing13; | |||
public bool Tray2Barrel3IsDosing14; | |||
public bool Tray2Barrel3IsDosing15; | |||
public bool Receive9; | |||
public bool Tray2Barrel4IsDosing1; | |||
public bool Tray2Barrel4IsDosing2; | |||
public bool Tray2Barrel4IsDosing3; | |||
public bool Tray2Barrel4IsDosing4; | |||
public bool Tray2Barrel4IsDosing5; | |||
public bool Tray2Barrel4IsDosing6; | |||
public bool Tray2Barrel4IsDosing7; | |||
public bool Tray2Barrel4IsDosing8; | |||
public bool Tray2Barrel4IsDosing9; | |||
public bool Tray2Barrel4IsDosing10; | |||
public bool Tray2Barrel4IsDosing11; | |||
public bool Tray2Barrel4IsDosing12; | |||
public bool Tray2Barrel4IsDosing13; | |||
public bool Tray2Barrel4IsDosing14; | |||
public bool Tray2Barrel4IsDosing15; | |||
public bool Receive10; | |||
public int Receive11; | |||
public bool StockIn1DosingFinish; | |||
public bool StockIn2DosingFinish; | |||
public bool StockIn3DosingFinish; | |||
public bool StockIn4DosingFinish; | |||
public bool StockIn5DosingFinish; | |||
public bool StockIn6DosingFinish; | |||
public bool StockIn7DosingFinish; | |||
public bool StockIn8DosingFinish; | |||
public bool StockIn9DosingFinish; | |||
public bool StockIn10DosingFinish; | |||
public bool StockIn11DosingFinish; | |||
public bool StockIn12DosingFinish; | |||
public bool StockIn13DosingFinish; | |||
public bool StockIn14DosingFinish; | |||
public bool StockIn15DosingFinish; | |||
public bool Receive12; | |||
} | |||
} |
@@ -57,15 +57,15 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// </summary> | |||
public ushort StockBinCylinderStatus { get; set; } | |||
[VarComm("Global", "柔性配料料仓配料下发情况")] | |||
/// <summary> | |||
/// 料仓配料情况 | |||
/// </summary> | |||
public ushort[] StockBinDosingIssue { get; set; } = new ushort[5] { 0, 0, 0, 0, 0 }; | |||
[VarComm("Global", "柔性配料料仓配料下发情况")] | |||
public ushort[] StockBinDosingIssue { get; set; } = new ushort[5] { 0, 0, 0, 0, 0 }; | |||
/// <summary> | |||
/// 料仓配料情况 | |||
/// </summary> | |||
[VarComm("Global", "柔性配料料仓配料下发情况")] | |||
public ushort[] RecipeStockBinDosing { get; set; } = new ushort[5] { 0, 0, 0, 0, 0 }; | |||
[VarComm("Global", "柔性配料料仓配料情况")] | |||
@@ -92,163 +92,161 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// </summary> | |||
public int Tray2LogicFinish { get; set; } = 0; | |||
[VarComm("Global", "托盘1有货架")] | |||
/// <summary> | |||
/// 托盘1有货架 | |||
/// </summary> | |||
[VarComm("Global", "托盘1有货架")] | |||
public bool Station1HaveTray { get; set; } | |||
[VarComm("Global", "托盘2有货架")] | |||
/// <summary> | |||
/// 托盘2有货架 | |||
/// </summary> | |||
[VarComm("Global", "托盘2有货架")] | |||
public bool Station2HaveTray { get; set; } | |||
[VarComm("Global", "托盘1传感器信号")] | |||
/// <summary> | |||
/// 托盘1传感器信号 | |||
/// </summary> | |||
[VarComm("Global", "托盘1传感器信号")] | |||
public bool Station1Sensor { get; set; } | |||
[VarComm("Global", "托盘2传感器信号")] | |||
/// <summary> | |||
/// 托盘2传感器信号 | |||
/// </summary> | |||
[VarComm("Global", "托盘2传感器信号")] | |||
public bool Station2Sensor { get; set; } | |||
[VarComm("Global", "托盘1气缸信号")] | |||
/// <summary> | |||
/// 托盘1气缸信号 | |||
/// </summary> | |||
[VarComm("Global", "托盘1气缸信号")] | |||
public bool Station1Cylinder { get; set; } | |||
[VarComm("Global", "托盘2气缸信号")] | |||
/// <summary> | |||
/// 托盘2气缸信号 | |||
/// </summary> | |||
[VarComm("Global", "托盘2气缸信号")] | |||
public bool Station2Cylinder { get; set; } | |||
[VarComm("Global", "AGV放托盘1完成")] | |||
/// <summary> | |||
/// AGV放托盘1完成 | |||
/// </summary> | |||
[VarComm("Global", "AGV放托盘1完成")] | |||
public bool AGV_PutTray1Finish { get; set; } | |||
[VarComm("Global", "AGV取托盘1完成")] | |||
/// <summary> | |||
/// AGV取托盘1完成 | |||
/// </summary> | |||
[VarComm("Global", "AGV取托盘1完成")] | |||
public bool AGV_GetTray1Finish { get; set; } | |||
[VarComm("Global", "AGV放托盘2完成")] | |||
/// <summary> | |||
/// AGV放托盘1完成 | |||
/// </summary> | |||
[VarComm("Global", "AGV放托盘2完成")] | |||
public bool AGV_PutTray2Finish { get; set; } | |||
[VarComm("Global", "AGV取托盘2完成")] | |||
/// <summary> | |||
/// AGV取托盘2完成 | |||
/// </summary> | |||
[VarComm("Global", "AGV取托盘2完成")] | |||
public bool AGV_GetTray2Finish { get; set; } | |||
[VarComm("Global", "托盘1气缸复位")] | |||
/// <summary> | |||
/// 托盘1气缸复位 | |||
/// </summary> | |||
[VarComm("Global", "托盘1气缸复位")] | |||
public bool CylinderReset { get; set; } | |||
[VarComm("Global", "发送给plc的心跳")] | |||
/// <summary> | |||
/// 发送给plc的心跳 | |||
/// </summary> | |||
[VarComm("Global", "发送给plc的心跳")] | |||
public bool HeartBeatToPlc { get; set; } = false; | |||
[VarComm("Global", "屏蔽小料站料仓不足15个报警")] | |||
public bool DisEnableStockAlarm { get; set; } = false; | |||
[VarComm("Global", "配方制作完成数量")] | |||
/// <summary> | |||
/// 配方制作完成数量 | |||
/// </summary> | |||
[VarComm("Global", "配方制作完成数量")] | |||
public int RecipeDosingCompleNum { get; set; } = 0; | |||
[VarComm("Global", "来自plc的心跳")] | |||
/// <summary> | |||
/// 来自plc的心跳 | |||
/// </summary> | |||
[VarComm("Global", "来自plc的心跳")] | |||
public bool HeartBeatFromPlc { get; set; } = false; | |||
[VarComm("Global", "是否允许西门子下发配方")] | |||
/// <summary> | |||
/// 是否允许西门子下发配方 | |||
/// </summary> | |||
[VarComm("Global", "是否允许西门子下发配方")] | |||
public bool IsAllowSiemensSendRecipe { get; set; } = false; | |||
[VarComm("Global", "西门子下发配方状态0=等待下发配方 1=请求下发配方 2=接收配方 3=配方接收配方完成 4=请求配料 5=西门子确认开始配料 6=西门子确认开始配料信号复位")] | |||
/// <summary> | |||
/// 西门子下发配方状态 0:等待下发配方 1:请求下发配方 2:上位机接收配方 3:配方接收配方完成 4:上位机向西门子请求配料 5:西门子确认开始配料 6:西门子确认开始配料 信号复位 | |||
/// </summary> | |||
[VarComm("Global", "西门子下发配方状态0=等待下发配方 1=请求下发配方 2=接收配方 3=配方接收配方完成 4=请求配料 5=西门子确认开始配料 6=西门子确认开始配料信号复位")] | |||
public int SiemensSendRecipeStatus { get; set; } = 0; | |||
[VarComm("Global", "配方1下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料 | |||
/// </summary> | |||
[VarComm("Global", "配方1下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
public int RecipeStatusIDTray1 { get; set; } = 0; | |||
[VarComm("Global", "配方1下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料 | |||
/// </summary> | |||
[VarComm("Global", "配方1下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
public int[] RecipeProcessStatus { get; set; } = new int[5] { 0, 0, 0, 0, 0 }; | |||
[VarComm("Global", "配方1下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料 | |||
/// </summary> | |||
[VarComm("Global", "配方1下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
public bool AGVIsGetTray { get; set; } = false; | |||
[VarComm("Global", "配方2下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
/// <summary> | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料 | |||
/// </summary> | |||
[VarComm("Global", "配方2下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方,正在配料")] | |||
public int RecipeStatusIDTray2 { get; set; } = 0; | |||
[VarComm("Global", "当前配方正在配料位置")] | |||
/// <summary> | |||
/// 当前料仓的位置 | |||
/// </summary> | |||
[VarComm("Global", "当前配方正在配料位置")] | |||
public int StockInIsWork { get; set; } = 0; | |||
[VarComm("Global", "设置料仓配料完成")] | |||
/// <summary> | |||
/// 当前料仓的位置 | |||
/// </summary> | |||
[VarComm("Global", "设置料仓配料完成")] | |||
public bool[] StockInDosingComple { get; set; } = new bool[15]; | |||
[VarComm("Global", "是否使用粉仓配料")] | |||
/// <summary> | |||
/// 是否使用粉仓配料 | |||
/// </summary> | |||
[VarComm("Global", "是否使用粉仓配料")] | |||
public bool IsUseWindSend { get; set; } = false; | |||
[VarComm("Global", "粉仓正在配料")] | |||
/// <summary> | |||
/// 粉仓正在配料 | |||
/// </summary> | |||
[VarComm("Global", "粉仓正在配料")] | |||
public bool WindSendDosing { get; set; } = false; | |||
@@ -259,16 +257,17 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
#region 本地模拟配方 | |||
[VarComm("Global", "是否使用本地模拟配方")] | |||
/// <summary> | |||
/// 是否使用本地模拟配方 | |||
/// </summary> | |||
[VarComm("Global", "是否使用本地模拟配方")] | |||
public bool IsUseLocalRecipe { get; set; } | |||
[VarComm("Global", "是否使用本地模拟配方")] | |||
/// <summary> | |||
/// 是否使用本地模拟配方 | |||
/// 不使用小料站配料 | |||
/// </summary> | |||
[VarComm("Global", "是否使用本地模拟配方")] | |||
public bool NotUseSmallStation { get; set; } | |||
/// <summary> | |||
@@ -299,16 +298,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
public bool WindSendDosingComple { get; set; } = false; | |||
[VarComm("Global", "粉料仓配料状态")] | |||
/// <summary> | |||
/// 粉料仓配料状态(0:无意义,1:粉料仓下配方,2:plc接收配方完成,3:粉料仓配料完成,4:粉料仓配料完成信号复位,5:排料完成) | |||
/// </summary> | |||
[VarComm("Global", "粉料仓配料状态")] | |||
public int WindSendDosingStatus { get; set; } = 0; | |||
[VarComm("Global", "PLC的系统模式 DB44.DBX0.1")] | |||
/// <summary> | |||
/// PLC的系统模式 DB44.DBX0.1 | |||
/// </summary> | |||
[VarComm("Global", "PLC的系统模式 DB44.DBX0.1")] | |||
public bool PlcSystemMode { get; set; } = false; | |||
[VarComm("Global", "PLC的系统模式 DB44.DBX0.1")] | |||
@@ -1,16 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC | |||
{ | |||
public class HKDeviceRead | |||
{ | |||
public bool HeartBeat { get; set; } | |||
public bool SystemMode { get; set; } | |||
public bool SystemStart { get; set; } | |||
public bool SystemPause { get; set; } | |||
} | |||
} |
@@ -1,140 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC | |||
{ | |||
public class HKPlcCommAddress | |||
{ | |||
#region 海科PLC ==> 上位机 | |||
/// <summary> | |||
/// 是否允许配料 | |||
/// </summary> | |||
public static string IsAllowDosing { get; set; } = ""; | |||
/// <summary> | |||
/// 当前料仓位置 | |||
/// </summary> | |||
public static string StockBinLocation { get; set; } = ""; | |||
/// <summary> | |||
/// 当前料仓的状态(0:无意义,1:到达接料位置) | |||
/// </summary> | |||
public static string StockState { get; set; } = ""; | |||
#endregion | |||
#region 上位机 ==> 海科PLC | |||
/// <summary> | |||
/// 料仓位置(配置该配方,所需要多个原料桶,每个原料桶有多个料仓位置) | |||
/// </summary> | |||
public static string StockBinLocationToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 对应桶号 | |||
/// </summary> | |||
public static string BarrelNumToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 当前配料机配料完成 | |||
/// </summary> | |||
public static string SingleDosingFinishToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 当前配料料仓的位置 | |||
/// </summary> | |||
public static string SingleStockBinLocationToPLC { get; set; } = ""; | |||
public static string RecipeDosingFinish { get; set; } = ""; | |||
#endregion | |||
#region AGV进出站1 | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string DeliveryAGVApply { get; set; } = "DB3.DBX0.1"; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string DeliveryAGVIsApply { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 | |||
/// </summary> | |||
public static string DeliveryAGVApplyJack { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 | |||
/// </summary> | |||
public static string DeliveryAGVIsApplyJack { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 送货完成 | |||
/// </summary> | |||
public static string DeliveryAGVFinsih { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 工位上有货架 | |||
/// </summary> | |||
public static string StationHaveCargo { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string PickAGVApply { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string PickAGVIsApply { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 取货架完成 | |||
/// </summary> | |||
public static string PickCargoAGVFinish { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 取料完成 | |||
/// </summary> | |||
public static string PickAGVFinish { get; set; } = ""; | |||
/// <summary> | |||
/// 工位上是否有小车 | |||
/// </summary> | |||
public static string StationIsExistTray { get; set; } = ""; | |||
#endregion | |||
#region AGV进出站2 | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string DeliveryAGVApplyStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string DeliveryAGVIsApplyStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 | |||
/// </summary> | |||
public static string DeliveryAGVApplyJackStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 | |||
/// </summary> | |||
public static string DeliveryAGVIsApplyJackStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 送货完成 | |||
/// </summary> | |||
public static string DeliveryAGVFinsihStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 工位上有货架 | |||
/// </summary> | |||
public static string StationHaveCargoStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string PickAGVApplyStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string PickAGVIsApplyStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 取货架完成 | |||
/// </summary> | |||
public static string PickCargoAGVFinishStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 取料完成 | |||
/// </summary> | |||
public static string PickAGVFinishStation2 { get; set; } = ""; | |||
/// <summary> | |||
/// 工位上是否有货架 | |||
/// </summary> | |||
public static string StationIsExistTrayStation2 { get; set; } = ""; | |||
#endregion | |||
} | |||
} |
@@ -28,7 +28,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// <summary> | |||
/// 配方数据 | |||
/// </summary> | |||
public ObservableCollection<RemoteRecipeData> RemoteRecipes = new ObservableCollection<RemoteRecipeData>(); | |||
public ObservableCollection<RecipeData> RemoteRecipes = new ObservableCollection<RecipeData>(); | |||
/// <summary> | |||
/// 原料的名称和料仓的位置对应 | |||
/// </summary> | |||
@@ -41,29 +41,26 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// <summary> | |||
/// 物料集合 | |||
/// 物料集合(工位配方集合,五个键分别对应五个工位) | |||
/// </summary> | |||
public Dictionary<int, ConcurrentQueue<string>> RecipeQueueTray { get; set; } = new Dictionary<int, ConcurrentQueue<string>>(); | |||
public ConcurrentQueue<string> RecipeQueueTray2 = new ConcurrentQueue<string>(); | |||
public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus(); | |||
//XL_Finish_DB RecipeFinishInfo = new XL_Finish_DB(); | |||
//public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus(); | |||
public HKDeviceStatus HKDevice = new HKDeviceStatus(); | |||
public WindSendDeviceStatus WindSendDevice = new WindSendDeviceStatus(); | |||
public ObservableCollection<PlcInfos> CommData { get; set; } = new ObservableCollection<PlcInfos>(); | |||
public ObservableCollection<PlcInfos> ProcessVar { get; set; } = new ObservableCollection<PlcInfos>(); | |||
XL_Finish_DB RecipeFinishInfo = new XL_Finish_DB(); | |||
/// <summary> | |||
/// 风送PLC的DB块 | |||
/// </summary> | |||
WindSend_Write WindSendData = new WindSend_Write(); | |||
/// <summary> | |||
/// 接收原料数据 | |||
/// </summary> | |||
public RecipeRawMaterial RawMaterial; | |||
public DateTime StockBinAlarmTime = DateTime.Now; | |||
public string? HK_PLC_IP = ConfigurationManager.AppSettings["HKPlc_IP"]; | |||
@@ -72,17 +69,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
public void Init() | |||
{ | |||
RecipeQueueTray.TryAdd(0, new ConcurrentQueue<string>()); | |||
RecipeQueueTray.TryAdd(1, new ConcurrentQueue<string>()); | |||
RecipeQueueTray.TryAdd(2, new ConcurrentQueue<string>()); | |||
RecipeQueueTray.TryAdd(3, new ConcurrentQueue<string>()); | |||
RecipeQueueTray.TryAdd(4, new ConcurrentQueue<string>()); | |||
for (int i = 0; i < 5; i++) | |||
{ | |||
RecipeQueueTray.TryAdd(i, new()); | |||
} | |||
PlcVarMonitor(); | |||
StockBinNameWithPos(); | |||
RawMaterialNameWithCode(); | |||
RegisterInit(); | |||
DeviceConnect(); | |||
//Json<RemoteRecipeDataColl>.Data.Recipes = TestData.GetInstance.Recipes;//添加测试数据 | |||
//Json<RemoteRecipeDataColl>.Data.RemoteRecipes = TestData.GetInstance.RemoteRecipes;//添加测试数据 | |||
TaskManage.GetInstance.StartLong(new Action(() => | |||
{ | |||
GVL_SmallStation.GetInstance.DisEnableStockAlarm = Json<DevicePar>.Data.deviceConnectPar.ShieldStockbinAlarm; | |||
@@ -91,7 +87,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
GVL_SmallStation.GetInstance.HeartBeatToPlc = !GVL_SmallStation.GetInstance.HeartBeatToPlc; | |||
HKDevice.HK_PLC_S7.Write("DB4.DBX0.0", GVL_SmallStation.GetInstance.HeartBeatToPlc); | |||
GVL_SmallStation.GetInstance.HeartBeatFromPlc = HKDevice.HK_PLC_S7.Read<bool>("DB45.DBX0.0"); | |||
if (DeviceInquire.GetInstance.devices.Count < 15 && HKDevice.IsConnected && Json<RemoteRecipeDataColl>.Data.Recipes.Count > 0 && GVL_SmallStation.GetInstance.DisEnableStockBinAlarm == false && DateTime.Now.Subtract(StockBinAlarmTime).TotalSeconds >= 60 & !GVL_SmallStation.GetInstance.DisEnableStockAlarm) | |||
if (DeviceInquire.GetInstance.devices.Count < 15 && HKDevice.IsConnected && Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Count > 0 && GVL_SmallStation.GetInstance.DisEnableStockBinAlarm == false && DateTime.Now.Subtract(StockBinAlarmTime).TotalSeconds >= 60 & !GVL_SmallStation.GetInstance.DisEnableStockAlarm) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB44.DBX3.0", true); | |||
App.Current.Dispatcher.Invoke(() => | |||
@@ -168,6 +164,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// </summary> | |||
private void HKPlcRead() | |||
{ | |||
//读取配料PLC的DB3的值 | |||
if (HKDevice.IsConnected) | |||
{ | |||
foreach (PropertyInfo item in typeof(PlcReadAddressDB3).GetProperties()) | |||
@@ -322,7 +319,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
//GVL_SmallStation.GetInstance.Station2Cylinder = HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX2.4"); | |||
//GVL_SmallStation.GetInstance.RobotStatus = HKDevice.HK_PLC_S7.Read<ushort>("DB3.DBW100"); | |||
//GVL_SmallStation.GetInstance.RobotProgramNum = HKDevice.HK_PLC_S7.Read<byte>("DB3.DBB102"); | |||
if (Json<RemoteRecipeDataColl>.Data.Recipes.Count <= 3) | |||
if (Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Count <= 3) | |||
{ | |||
GVL_SmallStation.GetInstance.IsAllowSiemensSendRecipe = true; | |||
} | |||
@@ -333,8 +330,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
GVL_SmallStation.GetInstance.RobotStatus = HKDevice.HK_PLC_S7.Read<byte>("DB3.DBB0"); | |||
GVL_SmallStation.GetInstance.RobotProgramNum = HKDevice.HK_PLC_S7.Read<byte>("DB3.DBB1"); | |||
} | |||
if (SiemensDevice.IsConnected) | |||
{ | |||
//if (SiemensDevice.IsConnected) | |||
//{ | |||
ushort TrayCylinder = 0; | |||
ushort TraySensor = 0; | |||
if (GVL_SmallStation.GetInstance.Station1Sensor) | |||
@@ -353,10 +350,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
TrayCylinder = TrayCylinder.SetBitValue(0, false); | |||
} | |||
this.SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2231.DBX28.4", GVL_SmallStation.GetInstance.WindSendAllowAGVPutGet); | |||
this.SiemensDevice.Siemens_PLC_S7.Write<ushort>("DB2231.DBW190", TraySensor);//添加工位传感器的信号 | |||
this.SiemensDevice.Siemens_PLC_S7.Write<ushort>("DB2231.DBW192", TrayCylinder);//添加工位气缸的信号 | |||
ushort AGV_Put = (ushort)SiemensDevice.XL_Status.AgvFinishPut; | |||
//this.SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2231.DBX28.4", GVL_SmallStation.GetInstance.WindSendAllowAGVPutGet); | |||
//this.SiemensDevice.Siemens_PLC_S7.Write<ushort>("DB2231.DBW190", TraySensor);//添加工位传感器的信号 | |||
//this.SiemensDevice.Siemens_PLC_S7.Write<ushort>("DB2231.DBW192", TrayCylinder);//添加工位气缸的信号 | |||
ushort AGV_Put =0 /*(ushort)SiemensDevice.XL_Status.AgvFinishPut*/; | |||
if (AGV_Put.GetBitValue(1)) | |||
{ | |||
GVL_SmallStation.GetInstance.AGV_PutTray1Finish = true; | |||
@@ -365,7 +362,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
GVL_SmallStation.GetInstance.AGV_PutTray1Finish = false; | |||
} | |||
ushort AGV_Get = (ushort)SiemensDevice.XL_Status.AgvFinishGet; | |||
ushort AGV_Get =0/* (ushort)SiemensDevice.XL_Status.AgvFinishGet*/; | |||
if (AGV_Get.GetBitValue(1)) | |||
{ | |||
GVL_SmallStation.GetInstance.AGV_GetTray1Finish = true; | |||
@@ -374,7 +371,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
GVL_SmallStation.GetInstance.AGV_GetTray1Finish = false; | |||
} | |||
} | |||
//} | |||
} | |||
public void CancelOrder() | |||
@@ -384,7 +381,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
if (!string.IsNullOrEmpty(GVL_SmallStation.GetInstance.Order_CancelRecipeCode)) | |||
{ | |||
string code = GVL_SmallStation.GetInstance.Order_CancelRecipeCode; | |||
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == code); | |||
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.RemoteRecipes.ToArray(), p => p.RecipeCode == code); | |||
int[] cnt = new int[5] { -1, -1, -1, -1, -1 }; | |||
int index1 = -1; | |||
for (int i = 0; i < 5; i++) | |||
@@ -442,21 +439,21 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
break; | |||
case 3: | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", true); | |||
//SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", true); | |||
GVL_SmallStation.GetInstance.OrderCancelStep = 4; | |||
break; | |||
case 4: | |||
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2201.DBX440.1") == false) | |||
{ | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); | |||
//if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2201.DBX440.1") == false) | |||
//{ | |||
// SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); | |||
GVL_SmallStation.GetInstance.OrderCancelStep = 9; | |||
MessageNotify.GetInstance.ShowRunLog($"队列1,西门子取消订单完成,订单号:{code}"); | |||
} | |||
//} | |||
break; | |||
case 9: | |||
App.Current.Dispatcher.Invoke(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.RemoveAt(index); | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.RemoveAt(index); | |||
}); | |||
RecipeQueueTray1.TryDequeue(out code); | |||
GVL_SmallStation.GetInstance.RecipeProcessStatus[index] = 0; | |||
@@ -465,21 +462,21 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
GVL_SmallStation.GetInstance.OrderCancelStep = 0; | |||
break; | |||
case 20: | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", true); | |||
//SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", true); | |||
GVL_SmallStation.GetInstance.OrderCancelStep = 21; | |||
break; | |||
case 21: | |||
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2201.DBX440.1") == false) | |||
{ | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); | |||
//if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2201.DBX440.1") == false) | |||
//{ | |||
// SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); | |||
GVL_SmallStation.GetInstance.OrderCancelStep = 29; | |||
MessageNotify.GetInstance.ShowRunLog($"队列1,西门子取消订单完成,订单号:{code}"); | |||
} | |||
//} | |||
break; | |||
case 29: | |||
App.Current.Dispatcher.Invoke(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.RemoveAt(index); | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.RemoveAt(index); | |||
}); | |||
GVL_SmallStation.GetInstance.Order_Cancel = false; | |||
GVL_SmallStation.GetInstance.Order_CancelRecipeCode = ""; | |||
@@ -489,16 +486,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
//30-39为订单还未下发至上位机 | |||
case 30: | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", true); | |||
//SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", true); | |||
GVL_SmallStation.GetInstance.OrderCancelStep = 31; | |||
break; | |||
case 31: | |||
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2201.DBX440.1") == false) | |||
{ | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); | |||
//if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2201.DBX440.1") == false) | |||
//{ | |||
// SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); | |||
GVL_SmallStation.GetInstance.OrderCancelStep = 39; | |||
MessageNotify.GetInstance.ShowRunLog($"西门子取消订单完成,订单号:{code}"); | |||
} | |||
//} | |||
break; | |||
case 39: | |||
GVL_SmallStation.GetInstance.Order_Cancel = false; | |||
@@ -516,38 +513,38 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
if (!GVL_SmallStation.GetInstance.IsUseLocalRecipe) | |||
{ | |||
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.Recipes; | |||
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.RemoteRecipes; | |||
if (RemoteRecipes.Count > 0) | |||
{ | |||
foreach (var data in RemoteRecipes) | |||
{ | |||
if (data.TrayCode == 1) | |||
{ | |||
if (SiemensDevice.XL_Status is XL_Status_DB status) | |||
{ | |||
//if (data.TrayCode == 1) | |||
//{ | |||
//if (SiemensDevice.XL_Status is XL_Status_DB status) | |||
//{ | |||
switch (GVL_SmallStation.GetInstance.SiemensSendRecipeStatus) | |||
{ | |||
case 3: | |||
SiemensDevice.Siemens_PLC_S7.WriteString(2231, data.RecipeCode, 10); | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2231.DBX28.0", true); | |||
// SiemensDevice.Siemens_PLC_S7.WriteString(2231, data.RecipeCode, 10); | |||
//SiemensDevice.Siemens_PLC_S7.Write("DB2231.DBX28.0", true); | |||
GVL_SmallStation.GetInstance.SiemensSendRecipeStatus = 4; | |||
MessageNotify.GetInstance.ShowRunLog($"配方{data.RecipeCode},请求配料"); | |||
break; | |||
case 4: | |||
if (SiemensDevice.XL_Status.Dosing_Confirm) | |||
{ | |||
SiemensDevice.Siemens_PLC_S7.WriteString(2231, "", 10);//复位字符串 | |||
SiemensDevice.Siemens_PLC_S7.Write("DB2231.DBX28.0", false); | |||
//if (SiemensDevice.XL_Status.Dosing_Confirm) | |||
//{ | |||
// SiemensDevice.Siemens_PLC_S7.WriteString(2231, "", 10);//复位字符串 | |||
// SiemensDevice.Siemens_PLC_S7.Write("DB2231.DBX28.0", false); | |||
GVL_SmallStation.GetInstance.SiemensSendRecipeStatus = 5; | |||
MessageNotify.GetInstance.ShowRunLog($"配方{data.RecipeCode},西门子确认配料"); | |||
} | |||
// } | |||
break; | |||
case 5: | |||
if (SiemensDevice.XL_Status.Dosing_Confirm == false) | |||
{ | |||
//if (SiemensDevice.XL_Status.Dosing_Confirm == false) | |||
//{ | |||
GVL_SmallStation.GetInstance.SiemensSendRecipeStatus = 6; | |||
MessageNotify.GetInstance.ShowRunLog($"配方{data.RecipeCode},西门子确认配料信号复位完成"); | |||
} | |||
//} | |||
break; | |||
case 6: | |||
for (int i = 0; i < 5; i++) | |||
@@ -574,10 +571,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
break; | |||
default: | |||
break; | |||
} | |||
//} | |||
} | |||
} | |||
//} | |||
} | |||
} | |||
else | |||
@@ -593,13 +590,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
else | |||
{ | |||
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.Recipes; | |||
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.RemoteRecipes; | |||
if (RemoteRecipes.Count > 0) | |||
{ | |||
foreach (var data in RemoteRecipes) | |||
{ | |||
if (data.TrayCode == 1) | |||
{ | |||
//if (data.TrayCode == 1) | |||
//{ | |||
for (int i = 0; i < 5; i++) | |||
{ | |||
if (GVL_SmallStation.GetInstance.NotUseSmallStation) | |||
@@ -619,7 +616,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
} | |||
} | |||
//} | |||
} | |||
} | |||
else | |||
@@ -639,6 +636,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// </summary> | |||
private void RecipeInfoToHKPLC() | |||
{ | |||
//五个工位AGV控制请求流程。 | |||
if (!GVL_SmallStation.GetInstance.NotUseSmallStation) | |||
{ | |||
for (int i = 0; i < 5; i++) | |||
@@ -657,7 +655,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
break; | |||
case 1: | |||
if (GVL_SmallStation.GetInstance.Station1HaveTray) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB4.DBX8." + i, false); | |||
GVL_SmallStation.GetInstance.Tray_AGVLogic[i] = 2; | |||
@@ -688,11 +685,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
} | |||
//工位配料流程 | |||
foreach (var recipe in RecipeQueueTray) | |||
{ | |||
//recipeNum就是托盘号,也就是工位号。 | |||
int recipeNum = recipe.Key; | |||
//判断工位是否有配方。 | |||
if (RecipeQueueTray[recipeNum].Count > 0) | |||
{ | |||
//从配方列表里根据配方号查找配方 | |||
int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == RecipeQueueTray[recipeNum].ElementAt(0)); | |||
if (index >= 0 && index < RemoteRecipes.Count) | |||
{ | |||
@@ -700,51 +702,53 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
int trayCode = RemoteRecipes.ElementAt(index).TrayCode; | |||
string recipeName = RemoteRecipes.ElementAt(index).RecipeName; | |||
string windSend = RemoteRecipes.ElementAt(index).ToString(); | |||
//当前只配托盘号为1 ,即工位1 的配方。 | |||
if (trayCode == 1) | |||
{ | |||
//如果不使用小料站配料,目前没有这种工作情况。 | |||
if (GVL_SmallStation.GetInstance.NotUseSmallStation) | |||
{ | |||
if (GVL_SmallStation.GetInstance.AGV_PutTray1Finish) | |||
{ | |||
Thread.Sleep(5000); | |||
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code); | |||
if (SiemensDevice.IsConnected && !GVL_SmallStation.GetInstance.IsUseLocalRecipe) | |||
{ | |||
RecipeFinishInfo.Order_No = RemoteRecipes.ElementAt(index).RecipeCode; | |||
RecipeFinishInfo.Product_Code = RemoteRecipes.ElementAt(index).RecipeName; | |||
RecipeFinishInfo.Job_No = (short)trayCode; | |||
for (int i = 0; i < 20; i++) | |||
{ | |||
RecipeFinishInfo.Material[i] = new UDT1(); | |||
} | |||
for (int i = 0; i < 10; i++) | |||
{ | |||
RecipeFinishInfo.Powder[i] = new UDT2(); | |||
} | |||
for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++) | |||
{ | |||
RecipeFinishInfo.Material[i].Material_Name = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialName; | |||
RecipeFinishInfo.Material[i].Material_BarrelNum = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum; | |||
RecipeFinishInfo.Material[i].Material_Laying_Off_Weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).Laying_Off_Weight * (float)0.001; | |||
} | |||
for (int i = 0; i < RemoteRecipes.ElementAt(index).WindSend.Count; i++) | |||
{ | |||
RecipeFinishInfo.Powder[i].Powder_Weight = RemoteRecipes.ElementAt(index).WindSend.ElementAt(i).DosingCompleWeight; | |||
} | |||
RecipeFinishInfo.Ask_For_Finish = true; | |||
RecipeFinishInfo.DosingTime = Convert.ToInt16(0); | |||
SiemensDevice.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(RecipeFinishInfo, 2261); | |||
var res = Json<RemoteRecipeDataColl>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipeCode == code); | |||
//if (SiemensDevice.IsConnected && !GVL_SmallStation.GetInstance.IsUseLocalRecipe) | |||
//{ | |||
// RecipeFinishInfo.Order_No = RemoteRecipes.ElementAt(index).RecipeCode; | |||
// RecipeFinishInfo.Product_Code = RemoteRecipes.ElementAt(index).RecipeName; | |||
// RecipeFinishInfo.Job_No = (short)trayCode; | |||
// for (int i = 0; i < 20; i++) | |||
// { | |||
// RecipeFinishInfo.Material[i] = new UDT1(); | |||
// } | |||
// for (int i = 0; i < 10; i++) | |||
// { | |||
// RecipeFinishInfo.Powder[i] = new UDT2(); | |||
// } | |||
// for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++) | |||
// { | |||
// RecipeFinishInfo.Material[i].Material_Name = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialName; | |||
// RecipeFinishInfo.Material[i].Material_BarrelNum = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum; | |||
// RecipeFinishInfo.Material[i].Material_Laying_Off_Weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).Laying_Off_Weight * (float)0.001; | |||
// } | |||
// for (int i = 0; i < RemoteRecipes.ElementAt(index).WindSend.Count; i++) | |||
// { | |||
// RecipeFinishInfo.Powder[i].Powder_Weight = RemoteRecipes.ElementAt(index).WindSend.ElementAt(i).DosingCompleWeight; | |||
// } | |||
// RecipeFinishInfo.Ask_For_Finish = true; | |||
// RecipeFinishInfo.DosingTime = Convert.ToInt16(0); | |||
// SiemensDevice.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(RecipeFinishInfo, 2261); | |||
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成,数据反馈给西门子"); | |||
} | |||
else | |||
// MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成,数据反馈给西门子"); | |||
//} | |||
//else | |||
{ | |||
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成,数据无法反馈给西门子,西门子设备未连接或处于本地配方"); | |||
} | |||
GVL_SmallStation.GetInstance.WindSendDosing = false; | |||
App.Current.Dispatcher.Invoke(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Remove(res); | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Remove(res); | |||
}); | |||
RecipeQueueTray[recipeNum].TryDequeue(out code); | |||
GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum] = 0; | |||
@@ -760,9 +764,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
if (GVL_SmallStation.GetInstance.WindSendDosingStatus == 1) | |||
{ | |||
//清空风送配料数据 | |||
WindSend_Write WindSendData111 = new WindSend_Write(); | |||
WindSendDevice.Siemens_PLC_S7.WriteClass<WindSend_Write>(WindSendData111, 95); | |||
Thread.Sleep(200); | |||
//设置DB95数据并下发。 | |||
WindSendData111.TargetRecipeCode = code; | |||
WindSendData111.IsAllowDosing = true; | |||
foreach (var item in RemoteRecipes.ElementAt(index).WindSend) | |||
@@ -795,6 +801,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
GVL_SmallStation.GetInstance.WindSendDosing = true; | |||
GVL_SmallStation.GetInstance.WindSendDosingStatus = 2; | |||
//下发配料数据 | |||
WindSendDevice.Siemens_PLC_S7.WriteClass<WindSend_Write>(WindSendData111, 95); | |||
} | |||
} | |||
@@ -807,30 +814,39 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
} | |||
//如果小料仓配方下发状态为0(未下发),则下发配方。并清除该工位配方的配料情况信号。 | |||
if (GVL_SmallStation.GetInstance.RecipeProcessStatus[recipeNum] == 0) | |||
{ | |||
GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum] = 0; | |||
//下发工单,并置位工单下发确认。 | |||
HKDevice.IssueRecipeToPlc(RemoteRecipes.ElementAt(index).RawMaterial, recipeNum); | |||
HKDevice.HK_PLC_S7.Write("DB4.DBX2." + recipeNum, true); | |||
//下发完成,等待开始制作。 | |||
GVL_SmallStation.GetInstance.DosingTime[recipeNum] = DateTime.Now; | |||
GVL_SmallStation.GetInstance.RecipeProcessStatus[recipeNum] = 1; | |||
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方编号{code},配方号{recipeNum + 1},下发完成"); | |||
} | |||
//确认是否收到工单 | |||
bool recipeReceviceFinish = HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX4." + recipeNum); | |||
if (recipeReceviceFinish && GVL_SmallStation.GetInstance.RecipeProcessStatus[recipeNum] == 1) | |||
{ | |||
//确认PLC收到工单后,复位下发确认信号。 | |||
HKDevice.HK_PLC_S7.Write("DB4.DBX2." + recipeNum, false); | |||
GVL_SmallStation.GetInstance.RecipeProcessStatus[recipeNum] = 2; | |||
GVL_SmallStation.GetInstance.StockBinDosingIssue[recipeNum] = 0; | |||
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方编号{code},配方号{recipeNum + 1},配方接收完成"); | |||
} | |||
//粉料仓完毕,开始控制小料仓味魔方配料。 | |||
if (GVL_SmallStation.GetInstance.RecipeProcessStatus[recipeNum] == 2) | |||
{ | |||
//味魔方配料。 | |||
for (byte i = 1; i < 16; i++) | |||
{ | |||
//indexArr是各配方位置反馈。 | |||
int indexArr = -1; | |||
if (GVL_SmallStation.GetInstance.plcReadDataDB3.StockBinAllowIssue[i - 1]) | |||
{ | |||
//根据配方号查找各配方的三个桶的位置反馈。位置反馈用的是ushort转16位2进制表示。 | |||
switch (recipeNum) | |||
{ | |||
case 0: | |||
@@ -849,10 +865,12 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
indexArr = Array.FindIndex(GVL_SmallStation.GetInstance.plcReadDataDB3.Recipe5BarrelPosReserve.ToArray(), p => p == i); | |||
break; | |||
} | |||
//如果料桶已经到位但没有配料完成信号。 | |||
if (indexArr >= 0 && GVL_SmallStation.GetInstance.StockBinDosingIssue[recipeNum].GetBitValue((byte)i) == false) | |||
{ | |||
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i); | |||
float weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight * 1000;//单位g转换kg | |||
//如果重量为0,即不需要配料。则直接设为配料完成。 | |||
if (weight <= 0) | |||
{ | |||
if (i >= 1 && i <= 8) | |||
@@ -870,6 +888,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
else | |||
{ | |||
//下发小料仓味魔方配料指令。 | |||
if (loc_index >= 0) | |||
{ | |||
DeviceInquire.GetInstance.GetDevice((int)i)?.Start(weight);//根据料仓编号 启动并写入每个原料重量 | |||
@@ -886,6 +905,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
//MessageNotify.GetInstance.ShowRunLog($"错误,有允许配料信号,但没有相应的位置 和桶号"); | |||
} | |||
//味魔方配料完成后处理。 | |||
if ((DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3) && indexArr >= 0 && GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum].GetBitValue((byte)i)) | |||
{ | |||
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i); | |||
@@ -895,10 +915,15 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
else | |||
{ | |||
//配料完成后,先延时一段时间再复位。 | |||
Thread.Sleep(GVL_SmallStation.GetInstance.Time); | |||
//获取实际下料重量后复位配料完成状态。 | |||
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.NowWeightFeedback; | |||
bool info = DeviceInquire.GetInstance.GetDevice(i).StatusReset(); | |||
MessageNotify.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成,下料完成重量:{RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight}"); | |||
//计算误差范围是否在允许范围内,如果超出范围,则报警。 | |||
float AlarmRange = Math.Abs(RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight - RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).RawMaterialWeight * 1000); | |||
int iIndex = Array.FindIndex(Json<DevicePar>.Data.deviceParModels.ToArray(), p => p.MaterialName == DeviceInquire.GetInstance.GetDevice(i).DeviceName); | |||
if (iIndex >= 0) | |||
@@ -913,6 +938,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
}); | |||
} | |||
} | |||
//置位味魔方配料完成信号。 | |||
if (i >= 1 && i <= 8) | |||
{ | |||
string commInfo = HKDevice.HK_PLC_S7.Write("DB4.DBX12." + (i - 1), true); | |||
@@ -929,6 +955,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
} | |||
//接收到工单配料完成上升沿后。 | |||
bool DosingComple = HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX6." + recipeNum); | |||
if ((RTrig.GetInstance("配方配料完成").Start(DosingComple)) || (GVL_SmallStation.GetInstance.StockBinDosingIssue[recipeNum] > 0 && DosingComple)) | |||
{ | |||
@@ -937,50 +965,52 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
if (GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum] > 0) | |||
{ | |||
for (int i = 1; i < 17; i++) | |||
{ | |||
{//看不懂 | |||
if (GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum].GetBitValue((byte)i)) | |||
{ | |||
MessageNotify.GetInstance.ShowRunLog($"料仓配料完成,但存在料仓未配料:{i}号仓"); | |||
} | |||
} | |||
} | |||
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code); | |||
var res = Json<RemoteRecipeDataColl>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipeCode == code); | |||
double a = DateTime.Now.Subtract(GVL_SmallStation.GetInstance.DosingTime[recipeNum]).TotalSeconds; | |||
foreach (var item in RemoteRecipes.ElementAt(index).RawMaterial) | |||
{ | |||
MessageNotify.GetInstance.ShowRunLog($"{item.RawMaterialName},下料重量:{item.Laying_Off_Weight}g"); | |||
} | |||
if (SiemensDevice.IsConnected && !GVL_SmallStation.GetInstance.IsUseLocalRecipe) | |||
{ | |||
RecipeFinishInfo.Order_No = RemoteRecipes.ElementAt(index).RecipeCode; | |||
RecipeFinishInfo.Product_Code = RemoteRecipes.ElementAt(index).RecipeName; | |||
RecipeFinishInfo.Job_No = (short)trayCode; | |||
for (int i = 0; i < 20; i++) | |||
{ | |||
RecipeFinishInfo.Material[i] = new UDT1(); | |||
} | |||
for (int i = 0; i < 10; i++) | |||
{ | |||
RecipeFinishInfo.Powder[i] = new UDT2(); | |||
} | |||
for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++) | |||
{ | |||
RecipeFinishInfo.Material[i].Material_Name = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialName; | |||
RecipeFinishInfo.Material[i].Material_BarrelNum = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum; | |||
RecipeFinishInfo.Material[i].Material_Laying_Off_Weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).Laying_Off_Weight * (float)0.001; | |||
} | |||
for (int i = 0; i < RemoteRecipes.ElementAt(index).WindSend.Count; i++) | |||
{ | |||
RecipeFinishInfo.Powder[i].Powder_Weight = RemoteRecipes.ElementAt(index).WindSend.ElementAt(i).DosingCompleWeight; | |||
} | |||
RecipeFinishInfo.Ask_For_Finish = true; | |||
RecipeFinishInfo.DosingTime = Convert.ToInt16(a); | |||
SiemensDevice.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(RecipeFinishInfo, 2261); | |||
//if (SiemensDevice.IsConnected && !GVL_SmallStation.GetInstance.IsUseLocalRecipe) | |||
//{ | |||
// RecipeFinishInfo.Order_No = RemoteRecipes.ElementAt(index).RecipeCode; | |||
// RecipeFinishInfo.Product_Code = RemoteRecipes.ElementAt(index).RecipeName; | |||
// RecipeFinishInfo.Job_No = (short)trayCode; | |||
// for (int i = 0; i < 20; i++) | |||
// { | |||
// RecipeFinishInfo.Material[i] = new UDT1(); | |||
// } | |||
// for (int i = 0; i < 10; i++) | |||
// { | |||
// RecipeFinishInfo.Powder[i] = new UDT2(); | |||
// } | |||
// for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++) | |||
// { | |||
// RecipeFinishInfo.Material[i].Material_Name = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialName; | |||
// RecipeFinishInfo.Material[i].Material_BarrelNum = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum; | |||
// RecipeFinishInfo.Material[i].Material_Laying_Off_Weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).Laying_Off_Weight * (float)0.001; | |||
// } | |||
// for (int i = 0; i < RemoteRecipes.ElementAt(index).WindSend.Count; i++) | |||
// { | |||
// RecipeFinishInfo.Powder[i].Powder_Weight = RemoteRecipes.ElementAt(index).WindSend.ElementAt(i).DosingCompleWeight; | |||
// } | |||
// RecipeFinishInfo.Ask_For_Finish = true; | |||
// RecipeFinishInfo.DosingTime = Convert.ToInt16(a); | |||
// SiemensDevice.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(RecipeFinishInfo, 2261); | |||
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成,数据反馈给西门子"); | |||
MessageNotify.GetInstance.ShowRecipeLog(res.RecipeName); | |||
} | |||
else | |||
// MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成,数据反馈给西门子"); | |||
// MessageNotify.GetInstance.ShowRecipeLog(res.RecipeName); | |||
//} | |||
//else | |||
//TODO:发送配方制作完成反馈到服务系统。 | |||
{ | |||
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方{res.RecipeName},配料完成,数据无法反馈给西门子,西门子设备未连接或处于本地配方"); | |||
MessageNotify.GetInstance.ShowRecipeLog(res.RecipeName); | |||
@@ -988,7 +1018,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
GVL_SmallStation.GetInstance.WindSendDosing = false; | |||
App.Current.Dispatcher.Invoke(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Remove(res); | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Remove(res); | |||
}); | |||
RecipeQueueTray[recipeNum].TryDequeue(out code); | |||
GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum] = 0; | |||
@@ -1001,6 +1031,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 复位料仓状态。 | |||
/// </summary> | |||
private void StockBinInit() | |||
{ | |||
for (int i = 1; i < 16; i++) | |||
@@ -1029,10 +1062,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
/// <summary> | |||
/// PLC的DB3变量列表 | |||
/// PLC的变量列表 | |||
/// </summary> | |||
public void PlcVarMonitor() | |||
{ | |||
//海科的DB3 | |||
foreach (PropertyInfo item in typeof(PlcReadAddressDB3).GetProperties()) | |||
{ | |||
if (Attribute.IsDefined(item, typeof(VarCommAttribute))) | |||
@@ -1049,7 +1083,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
}); | |||
} | |||
} | |||
//风送PLC的DB94状态反馈 | |||
foreach (PropertyInfo item in typeof(WindSend_Read).GetProperties()) | |||
{ | |||
if (Attribute.IsDefined(item, typeof(VarCommAttribute))) | |||
@@ -1101,6 +1135,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 操作委托注册。 | |||
/// </summary> | |||
public void RegisterInit() | |||
{ | |||
//手动控制气缸 DB5.DBX0.0~DB5.DBX4.5 | |||
@@ -1285,8 +1322,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
ObservableCollection<RemoteRecipeRawMaterial> RawMaterials = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
ObservableCollection<WindSendRawMaterial> WindSendData = new ObservableCollection<WindSendRawMaterial>(); | |||
if (SiemensDevice.IsConnected) | |||
{ | |||
//if (SiemensDevice.IsConnected) | |||
//{ | |||
if (res != null && res is XL_Start_DB recipe) | |||
{ | |||
if (!string.IsNullOrEmpty(recipe.RecipeCode)) | |||
@@ -1333,7 +1370,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
App.Current.Dispatcher.Invoke(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Add(new RecipeData() | |||
{ | |||
RecipeName = recipe.RecipeName, | |||
RecipeCode = recipe.RecipeCode, | |||
@@ -1344,16 +1381,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
}); | |||
} | |||
} | |||
} | |||
//} | |||
}), "SiemensRecipeRecive", true); | |||
//将本地配方发送到西门子配方里,执行配料 | |||
ActionManage.GetInstance.Register(new Action<Object>((res) => | |||
{ | |||
if (res != null && res is RemoteRecipeData rm) | |||
if (res != null && res is RecipeData rm) | |||
{ | |||
//Json<RemoteRecipeDataColl>.Data.Recipes.Add(rm); | |||
var newRecipe = new RemoteRecipeData(); | |||
//Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Add(rm); | |||
var newRecipe = new RecipeData(); | |||
newRecipe.RecipeName = rm.RecipeName; | |||
newRecipe.RecipeCode = rm.RecipeCode; | |||
newRecipe.TrayCode = rm.TrayCode; | |||
@@ -1387,7 +1424,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
RawMaterialType = item.RawMaterialType, | |||
}); | |||
} | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Add(newRecipe); | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Add(newRecipe); | |||
} | |||
}), "LocalSimulationRecipeIssue", true); | |||
@@ -1403,7 +1440,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.4", true); }), "CLearRecipeInfo", true); | |||
ActionManage.GetInstance.Register(new Action(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Clear(); | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Clear(); | |||
GVL_SmallStation.GetInstance.SiemensSendRecipeStatus = 0; | |||
GVL_SmallStation.GetInstance.WindSendDosingStatus = 0; | |||
@@ -1522,6 +1559,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
}), "RobotSetProgramNum", true); | |||
} | |||
/// <summary> | |||
/// 设备连接并开启重连线程。 | |||
/// </summary> | |||
public void DeviceConnect() | |||
{ | |||
try | |||
@@ -1541,12 +1581,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
HKDevice.Init(); | |||
MessageNotify.GetInstance.ShowRunLog("海科plc初始化完成"); | |||
} | |||
//TODO:连接服务系统。 | |||
try | |||
{ | |||
if (Json<DevicePar>.Data.deviceConnectPar.SiemensConnect) | |||
{ | |||
SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); | |||
if (SiemensDevice.IsConnected) MessageNotify.GetInstance.ShowRunLog("西门子plc连接成功"); | |||
//SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); | |||
//if (SiemensDevice.IsConnected) MessageNotify.GetInstance.ShowRunLog("西门子plc连接成功"); | |||
} | |||
} | |||
catch (Exception ex) | |||
@@ -1555,9 +1596,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
finally | |||
{ | |||
SiemensDevice.Init(); | |||
// SiemensDevice.Init(); | |||
MessageNotify.GetInstance.ShowRunLog("西门子plc初始化完成"); | |||
} | |||
//连接风送设备 | |||
try | |||
{ | |||
if (Json<DevicePar>.Data.deviceConnectPar.WindSendConnect) | |||
@@ -1575,8 +1617,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
WindSendDevice.Init(); | |||
MessageNotify.GetInstance.ShowRunLog("风送粉料plc初始化完成"); | |||
} | |||
//一直判断是否断开了连接, 断开就重连。 | |||
TaskManage.GetInstance.StartLong(new Action(() => | |||
{ | |||
//重连海科配料PLC | |||
try | |||
{ | |||
if (!HKDevice.IsConnected && Json<DevicePar>.Data.deviceConnectPar.HKPlcConnect) | |||
@@ -1588,17 +1633,20 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
catch (Exception ex) | |||
{ | |||
} | |||
//TODO:重连服务系统 | |||
try | |||
{ | |||
if (!SiemensDevice.IsConnected && Json<DevicePar>.Data.deviceConnectPar.SiemensConnect) | |||
{ | |||
SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); | |||
if (SiemensDevice.IsConnected) MessageNotify.GetInstance.ShowRunLog("西门子PLC重新连接成功"); | |||
} | |||
//if (!SiemensDevice.IsConnected && Json<DevicePar>.Data.deviceConnectPar.SiemensConnect) | |||
//{ | |||
// SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); | |||
// if (SiemensDevice.IsConnected) MessageNotify.GetInstance.ShowRunLog("西门子PLC重新连接成功"); | |||
//} | |||
} | |||
catch (Exception ex) | |||
{ | |||
} | |||
//重连风送 | |||
try | |||
{ | |||
if (!WindSendDevice.IsConnected && Json<DevicePar>.Data.deviceConnectPar.WindSendConnect) | |||
@@ -1632,6 +1680,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 风送变量复位原料设定重量及配方制作完成接收。 | |||
/// </summary> | |||
private void WindSendReset() | |||
{ | |||
float weight = (float)0.0; | |||
@@ -1,28 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public class ActionMenu : NotifyBase | |||
{ | |||
public string CommandParameter { get { return _mCommandParameter; } set { _mCommandParameter = value; OnPropertyChanged(); } } | |||
private string _mCommandParameter; | |||
//public Permission[] permission { get { return _mpermission; } set { _mpermission = value; OnPropertyChanged(); } } | |||
//private Permission[] _mpermission; | |||
public string MenuName { get { return _mMenuName; } set { _mMenuName = value; OnPropertyChanged(); } } | |||
private string _mMenuName; | |||
//public string NameSpace { get { return _mNameSpace; } set { _mNameSpace = value; OnPropertyChanged(); } } | |||
//private string _mNameSpace; | |||
} | |||
} |
@@ -1,17 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public class ConveyorServer | |||
{ | |||
public ConveyorServer() | |||
{ | |||
} | |||
} | |||
} |
@@ -1,27 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public class CylinderStatusModel : NotifyBase | |||
{ | |||
/// <summary> | |||
/// 气缸原点信号 | |||
/// </summary> | |||
public bool HomeStatus { get { return _mHomeStatus; } set { _mHomeStatus = value; OnPropertyChanged(); } } | |||
private bool _mHomeStatus; | |||
/// <summary> | |||
/// 气缸到位信号 | |||
/// </summary> | |||
public bool InPlace { get { return _mInPlace; } set { _mInPlace = value; OnPropertyChanged(); } } | |||
private bool _mInPlace; | |||
} | |||
} |
@@ -214,13 +214,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
BottomDeviceCurrentStatuses.Add(new DeviceCurrentStatus() { DeviceName = DeviceName }); | |||
for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++) | |||
for (int i = 0; i < Json<LocaPar>.Data.RemoteRecipes.Count; i++) | |||
{ | |||
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++) | |||
for (int m = 0; m < Json<LocaPar>.Data.RemoteRecipes.ElementAt(i).RawMaterials.Count; m++) | |||
{ | |||
if (Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip) | |||
if (Json<LocaPar>.Data.RemoteRecipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip) | |||
{ | |||
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; | |||
Json<LocaPar>.Data.RemoteRecipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; | |||
} | |||
} | |||
} | |||
@@ -1,15 +0,0 @@ | |||
using BPASmartClient.Model; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public class GlobalData | |||
{ | |||
} | |||
} |
@@ -11,7 +11,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public class LocaPar | |||
{ | |||
public ObservableCollection<RecipeModel> Recipes { get; set; } = new ObservableCollection<RecipeModel>(); | |||
public ObservableCollection<RecipeModel> RemoteRecipes { get; set; } = new ObservableCollection<RecipeModel>(); | |||
/// <summary> | |||
/// 配方完成数目。 | |||
/// </summary> | |||
@@ -1,20 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public class RecipeProcess : NotifyBase | |||
{ | |||
public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } | |||
private string _mRawMaterialName; | |||
public int RawMaterialStatus { get { return _mRawMaterialStatus; } set { _mRawMaterialStatus = value; OnPropertyChanged(); } } | |||
private int _mRawMaterialStatus; | |||
} | |||
} |
@@ -9,10 +9,13 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||
{ | |||
internal class LocalRecipeDataColl | |||
{ | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
/// <summary> | |||
/// 本地自定义配方集合。 | |||
/// </summary> | |||
public ObservableCollection<RecipeData> RemoteRecipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
/// <summary> | |||
/// 筛选后的配方显示集合。 | |||
/// </summary> | |||
public ObservableCollection<RemoteRecipeData> SelectedRecipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
public ObservableCollection<RecipeData> SelectedRecipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
} | |||
} |
@@ -1,74 +0,0 @@ | |||
//using BPA.Helper; | |||
//using BPA.Helper; | |||
//using System; | |||
//using System.Collections.Generic; | |||
//using System.Linq; | |||
//using System.Text; | |||
//using System.Threading.Tasks; | |||
//namespace BPASmartClient.JXJFoodSmallStation.Model | |||
//{ | |||
// public class NewRemoteRecipeModel : NotifyBase | |||
// { | |||
// /// <summary> | |||
// /// 原料名称 | |||
// /// </summary> | |||
// public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } | |||
// private string _mRawMaterialName; | |||
// /// <summary> | |||
// /// 原料对应的桶号 | |||
// /// </summary> | |||
// public short RawMaterialBarrelNum { get { return _mRawMaterialBarrelNum; } set { _mRawMaterialBarrelNum = value; OnPropertyChanged(); } } | |||
// private short _mRawMaterialBarrelNum; | |||
// /// <summary> | |||
// /// 原料类型 | |||
// /// </summary> | |||
// public string RawMaterialType { get { return _mRawMaterialType; } set { _mRawMaterialType = value; OnPropertyChanged(); } } | |||
// private string _mRawMaterialType; | |||
// /// <summary> | |||
// /// 需要原料重量 | |||
// /// </summary> | |||
// public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } | |||
// private float _mRawMaterialWeight; | |||
// /// <summary> | |||
// /// 原料对应料仓的位置 | |||
// /// </summary> | |||
// public int RawMaterialLocation | |||
// { | |||
// get { return _mRawMaterialLocation; } | |||
// set | |||
// { | |||
// _mRawMaterialLocation = value; | |||
// //if (RawMaterialType == "小料") | |||
// //{ | |||
// // var res = Json<DevicePar>.Data.rawMaterialStockBin.FirstOrDefault(p => p.RawMaterialLocation == value); | |||
// // if (res != null && !string.IsNullOrEmpty(res.RawMaterialName)) | |||
// // { | |||
// // var temp = Json<DevicePar>.Data.BomMaterial.FirstOrDefault(p => p.MaterialCode == res.RawMaterialName); | |||
// // if (temp != null && !string.IsNullOrEmpty(temp.MaterialName)) | |||
// // { | |||
// // RawMaterialName = temp.MaterialName; | |||
// // } | |||
// // } | |||
// //} | |||
// //else if (RawMaterialType == "粉料") | |||
// //{ | |||
// // var res = Json<DevicePar>.Data.windSendRawMaterial.FirstOrDefault(p => p.Location == value); | |||
// // if (res != null) | |||
// // { | |||
// // RawMaterialName = res.RawMaterialName; | |||
// // } | |||
// //} | |||
// ActionManage.GetInstance.Send("ChangeNotify", this); | |||
// OnPropertyChanged(); | |||
// } | |||
// } | |||
// private int _mRawMaterialLocation; | |||
// } | |||
//} |
@@ -8,7 +8,7 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public class RemoteRecipeData:NotifyBase | |||
public class RecipeData:NotifyBase | |||
{ | |||
/// <summary> | |||
/// 配方名称 | |||
@@ -9,8 +9,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||
{ | |||
public class RemoteRecipeDataColl | |||
{ | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
public int RecipesStatus { get; set; } | |||
public ObservableCollection<RecipeData> RemoteRecipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
} | |||
} |
@@ -1,111 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||
{ | |||
public class SiemensCommAddress | |||
{ | |||
#region 配方地址 | |||
/// <summary> | |||
/// 配方状态 | |||
/// </summary> | |||
public static string RecipeState { get; set; } = ""; | |||
/// <summary> | |||
/// 配方名称 | |||
/// </summary> | |||
public static string RecipeName { get; set; } = ""; | |||
/// <summary> | |||
/// 配方ID | |||
/// </summary> | |||
public static string RecipeID { get; set; } = ""; | |||
/// <summary> | |||
/// 原料信息 | |||
/// </summary> | |||
public static string RawMaterial { get; set; } = ""; | |||
#endregion | |||
#region AGV到位(与西门子PLC交互)西门子PLC ==> 上位机 | |||
/// <summary> | |||
/// 托盘的位置编号 | |||
/// </summary> | |||
public static string TrayLocationNum { get; set; } = ""; | |||
/// <summary> | |||
/// 配方ID | |||
/// </summary> | |||
public static string TrayRecipeID { get; set; } = ""; | |||
/// <summary> | |||
/// 状态信号 | |||
/// </summary> | |||
public static string StateSign { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 从西门子读取 | |||
/// </summary> | |||
public static string DeliveryAGVApply { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 写给西门子 | |||
/// </summary> | |||
public static string DeliveryAGVIsApply { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 从西门子读取 | |||
/// </summary> | |||
public static string DeliveryAGVApplyJack { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 写给西门子 | |||
/// </summary> | |||
public static string DeliveryAGVIsApplyJack { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 送货完成 从西门子读取 | |||
/// </summary> | |||
public static string DeliveryAGVFinsih { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 工位上有货架 写给西门子 | |||
/// </summary> | |||
public static string StationHaveCargo { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 从西门子读取 | |||
/// </summary> | |||
public static string PickAGVApply { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 进站申请 写给西门子 | |||
/// </summary> | |||
public static string PickAGVIsApply { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 取货架完成 从西门子读取 | |||
/// </summary> | |||
public static string PickCargoAGVFinish { get; set; } = ""; | |||
/// <summary> | |||
/// Agv送货 取料完成 写给西门子 | |||
/// </summary> | |||
public static string PickAGVFinish { get; set; } = ""; | |||
/// <summary> | |||
/// 工位上是否有小车 | |||
/// </summary> | |||
public static string StationIsExistCar { get; set; } = ""; | |||
#endregion | |||
#region Tray配料完成(与西门子PLC交互)上位机 ==> 西门子PLC | |||
public static string TrayLocationNumToSiemens { get; set; } = ""; | |||
public static string TrayRecipeIDToSiemens { get; set; } = ""; | |||
public static string TrayStateToSiemens { get; set; } = ""; | |||
#endregion | |||
} | |||
public class RecipeRawMaterial | |||
{ | |||
/// <summary> | |||
/// 原料对应的桶号 | |||
/// </summary> | |||
public int[] RawMaterialBarrelNum = new int[15]; | |||
/// <summary> | |||
/// 需要原料重量 | |||
/// </summary> | |||
public double[] RawMaterialWeight = new double[15]; | |||
/// <summary> | |||
/// 原料对应料仓的位置 | |||
/// </summary> | |||
public int[] RawMaterialLocation = new int[15]; | |||
} | |||
} |
@@ -13,7 +13,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
public volatile static TestData Instance; | |||
public static TestData GetInstance => Instance ?? (Instance = new TestData()); | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
public ObservableCollection<RecipeData> RemoteRecipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
public TestData() | |||
{ | |||
@@ -54,7 +54,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
RawMaterialLocation = RawMaterialLocation2 | |||
}); | |||
Recipes.Add(new Model.RemoteRecipeData() | |||
RemoteRecipes.Add(new Model.RecipeData() | |||
{ | |||
RecipeName = recipeName, | |||
RecipeCode = recipeCode, | |||
@@ -100,7 +100,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
RawMaterialLocation = RawMaterialLocation2_2 | |||
}); | |||
Recipes.Add(new Model.RemoteRecipeData() | |||
RemoteRecipes.Add(new Model.RecipeData() | |||
{ | |||
RecipeName = recipeName_2, | |||
RecipeCode = recipeCode_2, | |||
@@ -73,7 +73,7 @@ | |||
<TextBlock | |||
FontSize="20" | |||
Foreground="#FF0084FF" | |||
Text=" kg" /> | |||
Text=" Kg" /> | |||
</StackPanel> | |||
<StackPanel | |||
@@ -334,7 +334,7 @@ | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding Recipes}" | |||
ItemsSource="{Binding RemoteRecipes}" | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||
<ListBox.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -97,7 +97,7 @@ | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding Recipes}" | |||
ItemsSource="{Binding RemoteRecipes}" | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||
<ListBox.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -68,7 +68,7 @@ | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding Recipes}" | |||
ItemsSource="{Binding RemoteRecipes}" | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||
<ListView.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -41,11 +41,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
res.RawMaterialName = DeviceName; | |||
DeviceInquire.GetInstance.devices.ElementAt(index).DeviceName = DeviceName; | |||
DeviceInquire.GetInstance.GetDevice(IpAddress).SetDeviceName(DeviceName);//设置PLC名称 | |||
for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++) | |||
for (int i = 0; i < Json<LocaPar>.Data.RemoteRecipes.Count; i++) | |||
{ | |||
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++) | |||
for (int m = 0; m < Json<LocaPar>.Data.RemoteRecipes.ElementAt(i).RawMaterials.Count; m++) | |||
{ | |||
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; | |||
Json<LocaPar>.Data.RemoteRecipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; | |||
} | |||
} | |||
MessageNotify.GetInstance.ShowUserLog($"修改设备名称为【{DeviceName}】"); | |||
@@ -7,7 +7,6 @@ using BPA.Helper; | |||
using System.Collections.Concurrent; | |||
using System.Collections.ObjectModel; | |||
using System.Windows; | |||
using BPA.Helper; | |||
using BPASmartClient.JXJFoodSmallStation.Model; | |||
@@ -161,9 +161,9 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
string cancelRecipeCode = CancelRecipeCode.Trim(); | |||
if (!String.IsNullOrEmpty(cancelRecipeCode) && MessageNotify.GetInstance.ShowDialog($"请确认,是否进行删除订单【{cancelRecipeCode}】操作?")) | |||
{ | |||
if (Json<RemoteRecipeDataColl>.Data.Recipes != null) | |||
if (Json<RemoteRecipeDataColl>.Data.RemoteRecipes != null) | |||
{ | |||
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == cancelRecipeCode); | |||
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.RemoteRecipes.ToArray(), p => p.RecipeCode == cancelRecipeCode); | |||
if (index >= 0) | |||
{ | |||
GVL_SmallStation.GetInstance.Order_Cancel = true; | |||
@@ -301,7 +301,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
MessageNotify.GetInstance.ShowUserLog($"设置柔性味魔方复位时间:{time}s"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{time.ToString()}:设置成功!"); | |||
}); | |||
SiemensIsConnect = ProcessControl.GetInstance.SiemensDevice.IsConnected; | |||
//SiemensIsConnect = ProcessControl.GetInstance.SiemensDevice.IsConnected; | |||
HKPlcIsConnect = ProcessControl.GetInstance.HKDevice.IsConnected; | |||
WindSendIsConnect = ProcessControl.GetInstance.WindSendDevice.IsConnected; | |||
} | |||
@@ -26,7 +26,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is RemoteRecipeData rm) | |||
if (o != null && o is RecipeData rm) | |||
{ | |||
RecipeName = rm.RecipeName; | |||
RecipeCode = rm.RecipeCode; | |||
@@ -167,7 +167,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
return; | |||
} | |||
} | |||
int index = Array.FindIndex(Json<LocalRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == RecipeCode); | |||
int index = Array.FindIndex(Json<LocalRecipeDataColl>.Data.RemoteRecipes.ToArray(), p => p.RecipeCode == RecipeCode); | |||
if (index >= 0) | |||
{ | |||
foreach (var item in AllRawMaterial) | |||
@@ -195,11 +195,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
} | |||
} | |||
Json<LocalRecipeDataColl>.Data.Recipes.ElementAt(index).RecipeName = RecipeName; | |||
Json<LocalRecipeDataColl>.Data.Recipes.ElementAt(index).TrayCode = TrayNum; | |||
Json<LocalRecipeDataColl>.Data.Recipes.ElementAt(index).RecipeCode = RecipeCode; | |||
Json<LocalRecipeDataColl>.Data.Recipes.ElementAt(index).RawMaterial = RawMaterials; | |||
Json<LocalRecipeDataColl>.Data.Recipes.ElementAt(index).WindSend = WindSendRawMaterials; | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.ElementAt(index).RecipeName = RecipeName; | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.ElementAt(index).TrayCode = TrayNum; | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.ElementAt(index).RecipeCode = RecipeCode; | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.ElementAt(index).RawMaterial = RawMaterials; | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.ElementAt(index).WindSend = WindSendRawMaterials; | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"修改配方完成!"); | |||
MessageNotify.GetInstance.ShowUserLog($"修改配方名称:【{RecipeName}】,配方编号:【{RecipeCode}】。"); | |||
} | |||
@@ -230,7 +230,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
} | |||
} | |||
var newRemoteRecipeData = new RemoteRecipeData() | |||
var newRemoteRecipeData = new RecipeData() | |||
{ | |||
RecipeName = RecipeName, | |||
RecipeCode = RecipeCode, | |||
@@ -238,7 +238,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
RawMaterial = RawMaterials, | |||
WindSend = WindSendRawMaterials, | |||
}; | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(newRemoteRecipeData); | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.Add(newRemoteRecipeData); | |||
//新增一条配方应该默认显示出来。 | |||
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Add(newRemoteRecipeData); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"自定义配方添加完成!"); | |||
@@ -83,9 +83,9 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
if (RecipeCode.Length <= 0)//新建配方 | |||
{ | |||
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName); | |||
var res = Array.FindIndex(Json<LocaPar>.Data.RemoteRecipes.ToArray(), p => p.RecipeName == RecipeName); | |||
if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count) | |||
if (res >= 0 && res < Json<LocaPar>.Data.RemoteRecipes.Count) | |||
{ | |||
ErrorInfo = "该配方已存在,请重新输入"; | |||
} | |||
@@ -96,14 +96,14 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
} | |||
else//修改配方 | |||
{ | |||
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipCode == RecipeCode); | |||
if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count) | |||
var res = Array.FindIndex(Json<LocaPar>.Data.RemoteRecipes.ToArray(), p => p.RecipCode == RecipeCode); | |||
if (res >= 0 && res < Json<LocaPar>.Data.RemoteRecipes.Count) | |||
{ | |||
Json<LocaPar>.Data.Recipes.ElementAt(res).RecipeName = RecipeName; | |||
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Clear(); | |||
Json<LocaPar>.Data.RemoteRecipes.ElementAt(res).RecipeName = RecipeName; | |||
Json<LocaPar>.Data.RemoteRecipes.ElementAt(res).RawMaterials.Clear(); | |||
foreach (var item in RawMaterials) | |||
{ | |||
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Add(item); | |||
Json<LocaPar>.Data.RemoteRecipes.ElementAt(res).RawMaterials.Add(item); | |||
} | |||
MessageNotify.GetInstance.ShowUserLog($"修改了一条配方,配方编号:【{RecipeCode}】"); | |||
} | |||
@@ -161,9 +161,9 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
var dates = date.Split("-").ToList(); | |||
StringBuilder sb = new StringBuilder(); | |||
dates?.ForEach((item) => { sb.Append(item); }); | |||
Json<LocaPar>.Data.Recipes.Add(new RecipeModel() | |||
Json<LocaPar>.Data.RemoteRecipes.Add(new RecipeModel() | |||
{ | |||
SerialNum = Json<LocaPar>.Data.Recipes.Count + 1, | |||
SerialNum = Json<LocaPar>.Data.RemoteRecipes.Count + 1, | |||
RawMaterials = RawMaterials, | |||
RecipCode = sb.ToString(), | |||
RecipeName = RecipeName, | |||
@@ -29,13 +29,13 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
if (o != null && o is string deviceName) | |||
{ | |||
int index = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == deviceName); | |||
if (index >= 0 && index < Recipes.Count) | |||
int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeName == deviceName); | |||
if (index >= 0 && index < RemoteRecipes.Count) | |||
{ | |||
Recipes.ElementAt(index).IsEnable = false; | |||
RemoteRecipes.ElementAt(index).IsEnable = false; | |||
} | |||
MessageNotify.GetInstance.ShowUserLog($"下发工单 { Recipes.ElementAt(index).RecipeName}"); | |||
var res = Recipes.FirstOrDefault(p => p.RecipeName == deviceName); | |||
MessageNotify.GetInstance.ShowUserLog($"下发工单 { RemoteRecipes.ElementAt(index).RecipeName}"); | |||
var res = RemoteRecipes.FirstOrDefault(p => p.RecipeName == deviceName); | |||
App.Current.Dispatcher.Invoke(() => | |||
{ | |||
UserTreeWait.Add(new RecipeModel { RecipeName = deviceName, RawMaterials = res.RawMaterials }); | |||
@@ -54,18 +54,18 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
if (devices.Count > 0) | |||
{ | |||
int index = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == devices.ElementAt(0)); | |||
if (index >= 0 && index < Recipes.Count) | |||
int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeName == devices.ElementAt(0)); | |||
if (index >= 0 && index < RemoteRecipes.Count) | |||
{ | |||
Recipes.ElementAt(index).Are.Reset(); | |||
Recipes.ElementAt(index).IsEnable = false; | |||
RemoteRecipes.ElementAt(index).Are.Reset(); | |||
RemoteRecipes.ElementAt(index).IsEnable = false; | |||
App.Current.Dispatcher.Invoke(new Action(() => | |||
{ | |||
recipeProcesses.Clear(); | |||
UserTreeWait.RemoveAt(0); | |||
})); | |||
CurrentRecipeName = Recipes.ElementAt(index).RecipeName; | |||
foreach (var item in Recipes.ElementAt(index).RawMaterials) | |||
CurrentRecipeName = RemoteRecipes.ElementAt(index).RecipeName; | |||
foreach (var item in RemoteRecipes.ElementAt(index).RawMaterials) | |||
{ | |||
DeviceInquire.GetInstance.GetDevice(item.DeviceIp)?.Start(item.RawMaterialWeight);//启动并写入每个原料重量 | |||
@@ -80,11 +80,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
})); | |||
} | |||
Recipes.ElementAt(index).Are.WaitOne();//阻塞,直到当前配方完成 | |||
RemoteRecipes.ElementAt(index).Are.WaitOne();//阻塞,直到当前配方完成 | |||
devices.TryDequeue(out string deviceName); | |||
App.Current.Dispatcher.Invoke(new Action(() => | |||
{ | |||
UserTreeCompelete.Add(Recipes.ElementAt(index));//当前配方完成后添加到已完成的配方列表 | |||
UserTreeCompelete.Add(RemoteRecipes.ElementAt(index));//当前配方完成后添加到已完成的配方列表 | |||
})); | |||
App.Current.Dispatcher.Invoke(new Action(() => { | |||
recipeProcesses.Clear(); | |||
@@ -99,17 +99,17 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
TaskManage.GetInstance.StartLong(new Action(() => | |||
{ | |||
for (int i = 0; i < Recipes.Count; i++) | |||
for (int i = 0; i < RemoteRecipes.Count; i++) | |||
{ | |||
for (int m = 0; m < Recipes.ElementAt(i).RawMaterials.Count; m++) | |||
for (int m = 0; m < RemoteRecipes.ElementAt(i).RawMaterials.Count; m++) | |||
{ | |||
var RunStatus = DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).deviceStatus.RunStatus; | |||
var RunStatus = DeviceInquire.GetInstance.GetDevice(RemoteRecipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).deviceStatus.RunStatus; | |||
//设备状态显示 | |||
if (Recipes.ElementAt(i).RecipeName == CurrentRecipeName) | |||
if (RemoteRecipes.ElementAt(i).RecipeName == CurrentRecipeName) | |||
{ | |||
string deviceName = DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).DeviceName; | |||
int index = Array.FindIndex(Recipes.ElementAt(i).RawMaterials.ToArray(), p => p.RawMaterialName == deviceName); | |||
string deviceName = DeviceInquire.GetInstance.GetDevice(RemoteRecipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).DeviceName; | |||
int index = Array.FindIndex(RemoteRecipes.ElementAt(i).RawMaterials.ToArray(), p => p.RawMaterialName == deviceName); | |||
if (index >= 0 && index < recipeProcesses.Count) | |||
{ | |||
@@ -122,34 +122,34 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
var proc = recipeProcesses.Where(p=>p.RecipeStatus==3).ToList(); | |||
if (proc != null && proc.Count > 0 && proc.Count== recipeProcesses.Count) | |||
{ | |||
int recipIndex = Array.FindIndex(Recipes.ToArray(), p => p.RecipeName == CurrentRecipeName); | |||
if (recipIndex >= 0 && recipIndex < Recipes.Count) | |||
int recipIndex = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeName == CurrentRecipeName); | |||
if (recipIndex >= 0 && recipIndex < RemoteRecipes.Count) | |||
{ | |||
for (int n = 0; n < recipeProcesses.Count; n++) | |||
{ | |||
DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0 | |||
MessageNotify.GetInstance.ShowRunLog(Recipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp); | |||
DeviceInquire.GetInstance.GetDevice(RemoteRecipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0 | |||
MessageNotify.GetInstance.ShowRunLog(RemoteRecipes.ElementAt(recipIndex).RawMaterials.ElementAt(n).DeviceIp); | |||
} | |||
App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); })); | |||
Recipes.ElementAt(recipIndex).IsEnable = true; | |||
Recipes.ElementAt(recipIndex).Are.Set(); | |||
RemoteRecipes.ElementAt(recipIndex).IsEnable = true; | |||
RemoteRecipes.ElementAt(recipIndex).Are.Set(); | |||
} | |||
} | |||
//Recipes.ElementAt(i).RawMaterials.ElementAt(m).RecipeStatus = RunStatus; | |||
//var res = Recipes.ElementAt(i).RawMaterials.Where(p => p.RecipeStatus == 3).ToList(); | |||
//if (res != null && res.Count == Recipes.ElementAt(i).RawMaterials.Count)//配方所有配料完成下料 | |||
//RemoteRecipes.ElementAt(i).RawMaterials.ElementAt(m).RecipeStatus = RunStatus; | |||
//var res = RemoteRecipes.ElementAt(i).RawMaterials.Where(p => p.RecipeStatus == 3).ToList(); | |||
//if (res != null && res.Count == RemoteRecipes.ElementAt(i).RawMaterials.Count)//配方所有配料完成下料 | |||
//{ | |||
// for (int r = 0; r < Recipes.ElementAt(i).RawMaterials.Count; r++) | |||
// for (int r = 0; r < RemoteRecipes.ElementAt(i).RawMaterials.Count; r++) | |||
// { | |||
// DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(r).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0 | |||
// DeviceInquire.GetInstance.GetDevice(RemoteRecipes.ElementAt(i).RawMaterials.ElementAt(r).DeviceIp).StatusReset();//完成配料的设备运行状态地址写0 | |||
// App.Current.Dispatcher.Invoke(new Action(() => { recipeProcesses.Clear(); })); | |||
// } | |||
// Recipes.ElementAt(i).IsEnable = true; | |||
// Recipes.ElementAt(i).Are.Set(); | |||
// RemoteRecipes.ElementAt(i).IsEnable = true; | |||
// RemoteRecipes.ElementAt(i).Are.Set(); | |||
//} | |||
} | |||
} | |||
@@ -170,7 +170,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
public BPARelayCommand<object> ChangeRecipeStateCommand { get; set; } | |||
public static ObservableCollection<RecipeModel> Recipes { get; set; } = Json<LocaPar>.Data.Recipes; | |||
public static ObservableCollection<RecipeModel> RemoteRecipes { get; set; } = Json<LocaPar>.Data.RemoteRecipes; | |||
public string CurrentRecipeName { get { return _RecipeName; }set { _RecipeName = value; OnPropertyChanged(); } } | |||
private static string _RecipeName; | |||
@@ -20,7 +20,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
ActionManage.GetInstance.CancelRegister("RecipeInfo"); | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is RemoteRecipeData rm) | |||
if (o != null && o is RecipeData rm) | |||
{ | |||
RecipeName = rm.RecipeName; | |||
RecipeCode = rm.RecipeCode; | |||
@@ -31,7 +31,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
NotUseSmallDosing = GVL_SmallStation.GetInstance.NotUseSmallStation; | |||
IsUseLocalRecipe = GVL_SmallStation.GetInstance.IsUseLocalRecipe; | |||
IsUseWindSendDosing = GVL_SmallStation.GetInstance.IsUseWindSend; | |||
Recipes = Json<LocalRecipeDataColl>.Data.Recipes; | |||
RemoteRecipes = Json<LocalRecipeDataColl>.Data.RemoteRecipes; | |||
NewRecipe = new BPARelayCommand(() => | |||
{ | |||
@@ -44,10 +44,16 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
if (MessageNotify.GetInstance.ShowDialog($"请确认,是否删除订单【{cnt}】?")) | |||
{ | |||
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
var res = Json<LocalRecipeDataColl>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
var res1= Json<LocalRecipeDataColl>.Data.SelectedRecipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
if (res1 is not null) | |||
{ | |||
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Remove(res1); | |||
} | |||
if (res != null) | |||
{ | |||
Json<LocalRecipeDataColl>.Data.Recipes.Remove(res); | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.Remove(res); | |||
Json<LocalRecipeDataColl>.Save(); | |||
MessageNotify.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}"); | |||
} | |||
} | |||
@@ -61,7 +67,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
//ActionManage.GetInstance.Send("CloseNewRemoteRecipeView"); | |||
NewLocalRecipeView nrv = new NewLocalRecipeView(); | |||
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
var res = Json<LocalRecipeDataColl>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
if (res != null) | |||
{ | |||
ActionManage.GetInstance.Send("LocalRecipeEdit", res); | |||
@@ -82,8 +88,8 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
if (o != null && o is string cnt) | |||
{ | |||
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
var res1 = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
var res = Json<LocalRecipeDataColl>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
var res1 = Json<RemoteRecipeDataColl>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
if (MessageNotify.GetInstance.ShowDialog($"请确认,是否进行下发订单【{cnt}】操作?")) | |||
{ | |||
if (res1 != null) | |||
@@ -105,10 +111,10 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
NewSimulateRecipe = new BPARelayCommand(() => | |||
{ | |||
ObservableCollection<RemoteRecipeRawMaterial> RawMaterials = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
string recipeName = "配方" + (Json<LocalRecipeDataColl>.Data.Recipes.Count + 1) + ""; | |||
string recipeName = "配方" + (Json<LocalRecipeDataColl>.Data.RemoteRecipes.Count + 1) + ""; | |||
go: | |||
string recipeCode = new Random().Next(1000, 9999).ToString(); | |||
foreach (var item in Json<LocalRecipeDataColl>.Data.Recipes) | |||
foreach (var item in Json<LocalRecipeDataColl>.Data.RemoteRecipes) | |||
{ | |||
if (item.RecipeCode == recipeCode) | |||
{ | |||
@@ -141,17 +147,17 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
} | |||
} | |||
var res = Array.FindIndex(Json<LocalRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == recipeCode); | |||
var res = Array.FindIndex(Json<LocalRecipeDataColl>.Data.RemoteRecipes.ToArray(), p => p.RecipeCode == recipeCode); | |||
if (res < 0) | |||
{ | |||
var newRemoteRecipedata = new RemoteRecipeData() | |||
var newRemoteRecipedata = new RecipeData() | |||
{ | |||
RecipeName = recipeName, | |||
RecipeCode = recipeCode, | |||
TrayCode = trayCode, | |||
RawMaterial = RawMaterials, | |||
}; | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(newRemoteRecipedata); | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.Add(newRemoteRecipedata); | |||
//新增了配方之后应该默认显示出来。 | |||
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Add(newRemoteRecipedata); | |||
@@ -163,7 +169,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
if (MessageNotify.GetInstance.ShowDialog("请确认,是否清除所有本地配方?", DialogType.Warning)) | |||
{ | |||
Json<LocalRecipeDataColl>.Data.Recipes.Clear(); | |||
Json<LocalRecipeDataColl>.Data.RemoteRecipes.Clear(); | |||
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Clear(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"本地配方清空成功。"); | |||
MessageNotify.GetInstance.ShowUserLog("手动清除所有本地配方"); | |||
@@ -203,7 +209,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
/// <summary> | |||
/// 筛选后的配方列表。 | |||
/// </summary> | |||
public static ObservableCollection<RemoteRecipeData> SelectedRecipes { get; set; } | |||
public static ObservableCollection<RecipeData> SelectedRecipes { get; set; } | |||
public BPARelayCommand<object> DetailsCommand { get; set; } | |||
public BPARelayCommand<object> IssueRecipe { get; set; } | |||
@@ -212,6 +218,6 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
public BPARelayCommand ClearAllRecipe { get; set; } | |||
public BPARelayCommand NewRecipe { get; set; } | |||
public BPARelayCommand SelectRecipesCommand { get; set; } | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } | |||
public ObservableCollection<RecipeData> RemoteRecipes { get; set; } | |||
} | |||
} |
@@ -25,7 +25,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
public RecipeSettingsViewModel() | |||
{ | |||
Recipes = Json<LocaPar>.Data.Recipes; | |||
RemoteRecipes = Json<LocaPar>.Data.RemoteRecipes; | |||
NewMaterital = new BPARelayCommand(() => | |||
{ | |||
@@ -48,8 +48,8 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
if (o is string str) | |||
{ | |||
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str); | |||
if (res != null) Json<LocaPar>.Data.Recipes.Remove(res); | |||
var res = Json<LocaPar>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipCode == str); | |||
if (res != null) Json<LocaPar>.Data.RemoteRecipes.Remove(res); | |||
MessageNotify.GetInstance.ShowUserLog($"删除名称——{res.RecipeName}"); | |||
} | |||
}); | |||
@@ -60,7 +60,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
ActionManage.GetInstance.CancelRegister("Details"); | |||
NewRecipeView nrv = new NewRecipeView(); | |||
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str); | |||
var res = Json<LocaPar>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipCode == str); | |||
ActionManage.GetInstance.Send("Details", res); | |||
nrv.ShowDialog(); | |||
MessageNotify.GetInstance.ShowUserLog($"编辑配方名称——{res.RecipeName}"); | |||
@@ -81,6 +81,6 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
public BPARelayCommand<object> RemoveCommand { get; set; } | |||
public ObservableCollection<RecipeModel> Recipes { get; set; } | |||
public ObservableCollection<RecipeModel> RemoteRecipes { get; set; } | |||
} | |||
} |
@@ -18,14 +18,15 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
public SelectRecipesViewModel() | |||
{ | |||
AllRecipes = new(); | |||
SelectRecipes.Clear(); | |||
foreach (var item in Json<LocalRecipeDataColl>.Data.SelectedRecipes) | |||
{ | |||
SelectRecipes.Add(item); | |||
} | |||
if (Json<LocalRecipeDataColl>.Data.Recipes != null) | |||
if (Json<LocalRecipeDataColl>.Data.RemoteRecipes != null) | |||
{ | |||
foreach (var item in Json<LocalRecipeDataColl>.Data.Recipes) | |||
foreach (var item in Json<LocalRecipeDataColl>.Data.RemoteRecipes) | |||
{ | |||
AllRecipes.Add(new RecipeDataWithCheck() | |||
{ | |||
@@ -79,7 +80,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
public ObservableCollection<RecipeDataWithCheck> AllRecipes {get; set; } | |||
public static ObservableCollection<RemoteRecipeData> SelectRecipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
public static ObservableCollection<RecipeData> SelectRecipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
/// <summary> | |||
/// 取消筛选,即关闭本窗口。 | |||
@@ -101,7 +102,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
internal class RecipeDataWithCheck:NotifyBase | |||
{ | |||
public RemoteRecipeData Recipe { get; set; } | |||
public RecipeData Recipe { get; set; } | |||
private bool _IsSelected; | |||
public bool IsSelected | |||
@@ -27,7 +27,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
//ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
public SiemensRecipeReceiveViewModel() | |||
{ | |||
Recipes = Json<RemoteRecipeDataColl>.Data.Recipes; | |||
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.RemoteRecipes; | |||
DetailsCommand = new BPARelayCommand<object>((o) => | |||
{ | |||
if (o != null && o is string cnt) | |||
@@ -35,7 +35,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
ActionManage.GetInstance.Send("CloseRecipeInfosView"); | |||
RecipeInfosView nrv = new RecipeInfosView(); | |||
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
var res = Json<RemoteRecipeDataColl>.Data.RemoteRecipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
if (res != null) | |||
{ | |||
ActionManage.GetInstance.Send("RecipeInfo", res); | |||
@@ -48,13 +48,13 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
if (MessageNotify.GetInstance.ShowDialog($"请确认,是否删除所有配方订单?")) | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Clear(); | |||
Json<RemoteRecipeDataColl>.Data.RemoteRecipes.Clear(); | |||
MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。"); | |||
} | |||
}); | |||
} | |||
public BPARelayCommand<object> DetailsCommand { get; set; } | |||
public BPARelayCommand ClearAllRecipe { get; set; } | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } | |||
public ObservableCollection<RecipeData> RemoteRecipes { get; set; } | |||
} | |||
} |
@@ -7,7 +7,7 @@ | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
</ItemGroup> | |||
</Project> |
@@ -1,12 +1,13 @@ | |||
<Window x:Class="BPASmartClient.MaxWokControl.MainWindow" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:local="clr-namespace:BPASmartClient.MaxWokControl" | |||
mc:Ignorable="d" | |||
Title="MainWindow" Height="450" Width="800"> | |||
<Grid> | |||
</Grid> | |||
<Window | |||
x:Class="BPASmartClient.MaxWokControl.MainWindow" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.MaxWokControl" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
Title="MainWindow" | |||
Width="800" | |||
Height="450" | |||
mc:Ignorable="d"> | |||
<Grid /> | |||
</Window> |
@@ -5,7 +5,7 @@ | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
<PackageReference Include="NModbus" Version="3.0.72" /> | |||
<PackageReference Include="System.IO.Ports" Version="6.0.0" /> | |||
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> | |||
@@ -16,7 +16,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | |||
<PackageReference Include="log4net" Version="2.0.15" /> | |||
</ItemGroup> | |||
@@ -25,7 +25,7 @@ namespace BPASmartClient.Model | |||
public string DeviceIp { get; set; } | |||
/// <summary> | |||
/// 料筒位置 | |||
/// 桶号 | |||
/// </summary> | |||
public int Loc { get { return _mLoc; } set { _mLoc = value; OnPropertyChanged(); } } | |||
private int _mLoc; | |||
@@ -114,9 +114,9 @@ namespace BPASmartClient.Model | |||
set | |||
{ | |||
_mRecipeStatus = value; | |||
if (value == 1 && Status != Status.配料完成) Status = Status.等待配料; | |||
else if (value == 2) Status = Status.正在配料; | |||
else if (value == 3) Status = Status.配料完成; | |||
//if (value == 1 && Status != Status.配料完成) Status = Status.等待配料; | |||
//else if (value == 2) Status = Status.正在配料; | |||
//else if (value == 3) Status = Status.配料完成; | |||
OnPropertyChanged(); | |||
} | |||
} | |||
@@ -23,7 +23,7 @@ namespace BPASmartClient.MorkMV1 | |||
MqttHelper mQTTProxy = new MqttHelper(); | |||
public void Init() | |||
{ | |||
mQTTProxy.ConnectOk = new Action(() => | |||
mQTTProxy.Connected = new Action(() => | |||
{ | |||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | |||
TaskManage.GetInstance.StartLong(new Action(() => | |||
@@ -23,7 +23,7 @@ namespace BPASmartClient.MorkS | |||
MqttHelper mQTTProxy = new MqttHelper(); | |||
public void Init() | |||
{ | |||
mQTTProxy.ConnectOk = new Action(() => | |||
mQTTProxy.Connected = new Action(() => | |||
{ | |||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | |||
TaskManage.GetInstance.StartLong(new Action(() => | |||
@@ -23,7 +23,7 @@ namespace BPASmartClient.MorkS3 | |||
MqttHelper mQTTProxy = new MqttHelper(); | |||
public void Init() | |||
{ | |||
mQTTProxy.ConnectOk = new Action(() => | |||
mQTTProxy.Connected = new Action(() => | |||
{ | |||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | |||
TaskManage.GetInstance.StartLong(new Action(() => | |||
@@ -22,7 +22,7 @@ namespace BPASmartClient.MorkSUpgradedVer | |||
MqttHelper mQTTProxy = new MqttHelper(); | |||
public void Init() | |||
{ | |||
mQTTProxy.ConnectOk = new Action(() => | |||
mQTTProxy.Connected = new Action(() => | |||
{ | |||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | |||
TaskManage.GetInstance.StartLong(new Action(() => | |||
@@ -21,7 +21,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
</ItemGroup> | |||
</Project> |
@@ -7,7 +7,7 @@ | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | |||
<PackageReference Include="S7netplus" Version="0.14.0" /> | |||
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> | |||
@@ -1,8 +1,7 @@ | |||
<Application x:Class="BPASmartClient.ScreenALL.App" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:local="clr-namespace:BPASmartClient.ScreenALL"> | |||
<Application.Resources> | |||
</Application.Resources> | |||
<Application | |||
x:Class="BPASmartClient.ScreenALL.App" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:local="clr-namespace:BPASmartClient.ScreenALL"> | |||
<Application.Resources /> | |||
</Application> |
@@ -24,7 +24,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.CustomResource" Version="1.0.23" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1418.22" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -5,7 +5,7 @@ | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.67" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
<PackageReference Include="System.IO.Ports" Version="6.0.0" /> | |||
</ItemGroup> | |||
@@ -21,7 +21,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||
<PackageReference Include="BPA.Communication" Version="1.0.116" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -1,46 +0,0 @@ | |||
<Application | |||
x:Class="BPASmartClient.TourismCollege.App" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource" | |||
xmlns:local="clr-namespace:BPASmartClient.TourismCollege"> | |||
<Application.Resources> | |||
<ResourceDictionary> | |||
<ResourceDictionary.MergedDictionaries> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/TextBoxStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" /> | |||
<ResourceDictionary> | |||
<con:ColorConverter x:Key="ColorConverter" /> | |||
<con:TextConverter x:Key="TextConverter" /> | |||
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" /> | |||
<con:StatusConverter x:Key="StatusConverter" /> | |||
<con:StringToIconConverter x:Key="StringToIconConverter" /> | |||
<con:BoolToVisibilityConvert x:Key="BoolToVisibilityConvert" /> | |||
<con:CountIsVisiableConvert x:Key="CountIsVisiableConvert" /> | |||
<con:BoolToFillColorConverter x:Key="BoolToFillColorConverter" /> | |||
<con:RecipeStatusConvert x:Key="RecipeStatusConvert" /> | |||
</ResourceDictionary> | |||
<ResourceDictionary> | |||
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" /> | |||
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" /> | |||
</ResourceDictionary> | |||
</ResourceDictionary.MergedDictionaries> | |||
</ResourceDictionary> | |||
</Application.Resources> | |||
</Application> |
@@ -1,296 +0,0 @@ | |||
using BPASmartClient.CustomResource.Pages.ViewModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Configuration; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
namespace BPASmartClient.TourismCollege | |||
{ | |||
/// <summary> | |||
/// Interaction logic for App.xaml | |||
/// </summary> | |||
public partial class App : Application | |||
{ | |||
public static Window MainWindow; | |||
protected override void OnStartup(StartupEventArgs e) | |||
{ | |||
bool createNew; | |||
MessageLog.GetInstance.NotifyShow = new Action<string>(o => | |||
{ | |||
DebugLogViewModel.MessageModels.Add(new MessageModel() | |||
{ | |||
LogInfo = o, | |||
Forground = System.Windows.Media.Brushes.DeepSkyBlue | |||
}); | |||
}); | |||
MessageLog.GetInstance.NotifyShowEx = new Action<string>(o => | |||
{ | |||
DebugLogViewModel.MessageModels.Add(new MessageModel() | |||
{ | |||
LogInfo = o, | |||
Forground = System.Windows.Media.Brushes.Red | |||
}); | |||
}); | |||
new EventWaitHandle(false, EventResetMode.AutoReset, "BPASmartClient.TourismCollege", out createNew); | |||
if (!createNew) | |||
{ | |||
MessageBox.Show("程序已启动"); | |||
App.Current.Shutdown(); | |||
Environment.Exit(0); | |||
} | |||
base.OnStartup(e); | |||
SystemHelper.GetInstance.CreateDesktopShortcut(); | |||
MenuInit(); | |||
DataInit(); | |||
MainView mv = new MainView(); | |||
mv.TitleName = $"智能炒锅控制系统"; | |||
LoginView lv = new LoginView(); | |||
var res = lv.ShowDialog(); | |||
if (res != null && res == true) | |||
{ | |||
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowUserLog("用户登录"); | |||
mv.Show(); | |||
} | |||
else | |||
mv.Close(); | |||
MainWindow = mv; | |||
} | |||
protected override void OnExit(ExitEventArgs e) | |||
{ | |||
base.OnExit(e); | |||
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave(); | |||
TaskManage.GetInstance.Dispose(); | |||
} | |||
private void MenuInit() | |||
{ | |||
NfcServer.GetInstance.Init(); | |||
#region 配方管理菜单 | |||
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>(); | |||
RecipeManage.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "配方管理", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.RecipeSettingsView" | |||
}); | |||
RecipeManage.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "配方下发", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.RecipeControlView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
MainMenuName = "配方管理", | |||
Alias = "Recipe Management", | |||
subMenumodels = RecipeManage, | |||
}); | |||
#endregion | |||
#region 参数设置 | |||
ObservableCollection<SubMenumodel> ParSet = new ObservableCollection<SubMenumodel>(); | |||
ParSet.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "原料参数设置", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.DeviceMaterialParView" | |||
}); | |||
ParSet.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "设备参数设置", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.CommParSetView" | |||
}); | |||
//ParSet.Add(new SubMenumodel() | |||
//{ | |||
// SubMenuName = "出料口管理设置", | |||
// SubMenuPermission = new Permission[] { Permission.管理员 }, | |||
// AssemblyName = "BPASmartClient.DosingSystem", | |||
// ToggleWindowPath = "View.OutletManagementView" | |||
//}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
MainMenuName = "参数设置", | |||
Alias = "Parameter Set", | |||
subMenumodels = ParSet, | |||
}); | |||
#endregion | |||
#region 手动控制 | |||
ObservableCollection<SubMenumodel> ManualControl = new ObservableCollection<SubMenumodel>(); | |||
ManualControl.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "气缸手动控制", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.ManualControlView" | |||
}); | |||
ManualControl.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "输送带手动控制", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.ConveyerBeltManualView" | |||
}); | |||
ManualControl.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "配料输送带控制", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.TempManageControlView" | |||
}); | |||
//ManualControl.Add(new SubMenumodel() | |||
//{ | |||
// SubMenuName = "料仓控制", | |||
// SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||
// AssemblyName = "BPASmartClient.DosingSystem", | |||
// ToggleWindowPath = "View.StockControlView" | |||
//}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuName = "手动控制", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
Alias = "Parameter Set", | |||
subMenumodels = ManualControl, | |||
}); | |||
#endregion | |||
#region 消息日志 | |||
ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>(); | |||
InfoLog.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "操作日志", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.UserLogView" | |||
}); | |||
InfoLog.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "运行日志", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.RunLogView" | |||
}); | |||
InfoLog.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "报警记录", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.AlarmView" | |||
}); | |||
InfoLog.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "调试日志", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.DebugLogView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuName = "消息日志", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
Alias = "Message Log", | |||
subMenumodels = InfoLog, | |||
}); | |||
#endregion | |||
#region 硬件设备监控 | |||
ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>(); | |||
DeviceMonitor.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "原料设备列表", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.DeviceListView" | |||
}); | |||
DeviceMonitor.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "设备状态", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.DosingSystem", | |||
ToggleWindowPath = "View.HardwareStatusView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuName = "设备监控", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
Alias = "Device Monitor", | |||
subMenumodels = DeviceMonitor, | |||
}); | |||
#endregion | |||
#region 用户管理 | |||
ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>(); | |||
UserManager.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "用户登录", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.SubPagLoginView" | |||
}); | |||
UserManager.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "密码修改", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.PasswordChangeView" | |||
}); | |||
UserManager.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "用户管理", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.UserManagerView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuName = "用户管理", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||
Alias = "User Management", | |||
subMenumodels = UserManager, | |||
}); | |||
#endregion | |||
} | |||
private void DataInit() | |||
{ | |||
} | |||
} | |||
} |
@@ -1,10 +0,0 @@ | |||
using System.Windows; | |||
[assembly: ThemeInfo( | |||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | |||
//(used if a resource is not found in the page, | |||
// or application resource dictionaries) | |||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | |||
//(used if a resource is not found in the page, | |||
// app, or any theme specific resource dictionaries) | |||
)] |
@@ -1,31 +0,0 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<OutputType>WinExe</OutputType> | |||
<TargetFramework>net6.0-windows</TargetFramework> | |||
<Nullable>enable</Nullable> | |||
<UseWPF>true</UseWPF> | |||
<ApplicationIcon>hbl.ico</ApplicationIcon> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<Content Include="hbl.ico" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | |||
<Compile Remove="Views\View\**" /> | |||
<EmbeddedResource Remove="Views\View\**" /> | |||
<None Remove="Views\View\**" /> | |||
<Page Remove="Views\View\**" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||
</ItemGroup> | |||
</Project> |
@@ -1,21 +0,0 @@ | |||
global using System; | |||
global using System.Collections.Generic; | |||
global using System.Collections.ObjectModel; | |||
global using System.Configuration; | |||
global using System.Data; | |||
global using System.Linq; | |||
global using System.Threading; | |||
global using System.Threading.Tasks; | |||
global using System.Windows; | |||
global using System.Diagnostics; | |||
global using System.IO; | |||
global using System.Drawing; | |||
global using System.Windows.Media; | |||
global using BPA.Helper; | |||
global using BPA.Communication; | |||
global using BPASmartClient.CustomResource.Pages.Enums; | |||
global using BPASmartClient.CustomResource.Pages.Model; | |||
global using BPASmartClient.CustomResource.Pages.View; | |||
global using BPASmartClient.CustomResource.Pages.ViewModel; | |||
@@ -1,21 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.TourismCollege.Models | |||
{ | |||
/// <summary> | |||
/// 生料类,包括辅料,主料。 | |||
/// </summary> | |||
public class RawMaterial | |||
{ | |||
public int ID { get; set; } | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 是不是辅料。 | |||
/// </summary> | |||
public bool IsCondiments { get; set; } | |||
} | |||
} |
@@ -1,12 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.TourismCollege.Viewmodels | |||
{ | |||
internal class ItemStorageViewModel | |||
{ | |||
} | |||
} |
@@ -1,12 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.TourismCollege.ViewModels | |||
{ | |||
public class RecipeManageViewModel | |||
{ | |||
} | |||
} |
@@ -1,57 +0,0 @@ | |||
<UserControl x:Class="BPASmartClient.TourismCollege.Views.ItemStorageView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.TourismCollege.Views" | |||
mc:Ignorable="d" | |||
d:DesignHeight="450" d:DesignWidth="800"> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="200" /> | |||
<ColumnDefinition Width="1*" /> | |||
</Grid.ColumnDefinitions> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="0.3*" /> | |||
<RowDefinition Height="0.7*" /> | |||
</Grid.RowDefinitions> | |||
<!--#region 入库电子称状态 --> | |||
<StackPanel> | |||
<TextBlock Text="{Binding Weight,StringFormat=当前重量:{0}g}" Width="200"/> | |||
</StackPanel> | |||
<!--#endregion--> | |||
<!--#region 入库操作 --> | |||
<StackPanel Grid.Row="1" Margin="5"> | |||
<TextBlock Text="入库名称:"/> | |||
<ComboBox /> | |||
<Button Content="入库" Margin="0,10"/> | |||
</StackPanel> | |||
<!--#endregion--> | |||
<!--#region 辅料仓 --> | |||
<UniformGrid Columns="8" Grid.Column="1" Margin="3" Background="ForestGreen"> | |||
</UniformGrid> | |||
<!--#endregion--> | |||
<!--#region 原料仓 --> | |||
<ListView Grid.Row="1" Grid.Column="1" Margin="3" BorderThickness="1" > | |||
<ListView.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<UniformGrid Columns="4" Rows="3" HorizontalAlignment="Left" VerticalAlignment="Top"/> | |||
</ItemsPanelTemplate> | |||
</ListView.ItemsPanel> | |||
<ListView.ItemTemplate> | |||
<DataTemplate> | |||
<Border Background="Black"/> | |||
</DataTemplate> | |||
</ListView.ItemTemplate> | |||
</ListView> | |||
<!--#endregion--> | |||
</Grid> | |||
</UserControl> |
@@ -1,28 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
using System.Windows.Controls; | |||
using System.Windows.Data; | |||
using System.Windows.Documents; | |||
using System.Windows.Input; | |||
using System.Windows.Media; | |||
using System.Windows.Media.Imaging; | |||
using System.Windows.Navigation; | |||
using System.Windows.Shapes; | |||
namespace BPASmartClient.TourismCollege.Views | |||
{ | |||
/// <summary> | |||
/// ItemStorageView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class ItemStorageView : UserControl | |||
{ | |||
public ItemStorageView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -1,18 +0,0 @@ | |||
<UserControl x:Class="BPASmartClient.TourismCollege.Views.RecipeManageView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.TourismCollege.Views" | |||
mc:Ignorable="d" | |||
d:DesignHeight="450" d:DesignWidth="800"> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50" /> | |||
<RowDefinition Height="1*" /> | |||
</Grid.RowDefinitions> | |||
<!--#region 操作栏 --> | |||
<!--#endregion--> | |||
</Grid> | |||
</UserControl> |
@@ -1,29 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
using System.Windows.Controls; | |||
using System.Windows.Data; | |||
using System.Windows.Documents; | |||
using System.Windows.Input; | |||
using System.Windows.Media; | |||
using System.Windows.Media.Imaging; | |||
using System.Windows.Navigation; | |||
using System.Windows.Shapes; | |||
namespace BPASmartClient.TourismCollege.Views | |||
{ | |||
/// <summary> | |||
/// RecipeManageView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class RecipeManageView : UserControl | |||
{ | |||
public RecipeManageView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -8,7 +8,7 @@ | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="BPA.Helper" Version="1.0.71" /> | |||
<PackageReference Include="BPA.Helper" Version="1.0.77" /> | |||
</ItemGroup> | |||
</Project> |
@@ -45,6 +45,7 @@ | |||
<ProjectReference Include="..\BPASmartClient.MorkT_Container\BPASmartClient.MorkT_Container.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.MorkT_HQ\BPASmartClient.MorkTHQ.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.MorkCL\BPASmartClient.MorkCL.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj" /> | |||
</ItemGroup> | |||
@@ -208,7 +208,7 @@ | |||
Tag="Close" /> | |||
</MenuItem> | |||
</Menu> | |||
</Grid> | |||
<StackPanel | |||
@@ -296,7 +296,12 @@ | |||
Margin="5,0,5,0" | |||
Content="验证设备" | |||
IsChecked="{Binding IsVerty}" /> | |||
<Button Content="本地菜单" Margin="10,0" Cursor="Hand" Click= "MenuItem_Click" Tag="FoodMenuView"/> | |||
<Button | |||
Margin="10,0" | |||
Click="MenuItem_Click" | |||
Content="本地菜单" | |||
Cursor="Hand" | |||
Tag="FoodMenuView" /> | |||
<!--<Button | |||
Name="init" Margin="5,0,5,0" | |||
Grid.Row="0" | |||
@@ -324,7 +329,7 @@ | |||
</TextBlock> | |||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> | |||
<TextBlock FontSize="16" Text="当前订单量:" /> | |||
<TextBlock | |||
Margin="0,0,5,0" | |||
@@ -1,6 +1,63 @@ | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<configuration> | |||
<appSettings> | |||
<add key="IP" value="192.168.0.15"/> | |||
</appSettings> | |||
<configSections> | |||
<sectionGroup name="FlexBatchSystem"> | |||
<section name="ProductInfo" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="MqttInfo" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="ConveyerInfo" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="StockInfo1" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="StockInfo2" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="StockInfo3" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="StockInfo4" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="StockInfo5" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="StockInfo6" type="System.Configuration.NameValueSectionHandler"/> | |||
<section name="Services" type="System.Configuration.NameValueSectionHandler"/> | |||
</sectionGroup> | |||
</configSections> | |||
<FlexBatchSystem> | |||
<ProductInfo> | |||
<add key="ProductKey" value="j090GlJPJNv"/> | |||
<add key="ProductSecret" value="OVTPKMuGlBLZRBFt"/> | |||
<add key="Stock" value="StockModel"/> | |||
<add key="Conveyer" value="ConveyerModel"/> | |||
</ProductInfo> | |||
<MqttInfo> | |||
<add key="mqttHostUrl" value="iot-06z00carjduqaue.mqtt.iothub.aliyuncs.com"/> | |||
</MqttInfo> | |||
<ConveyerInfo> | |||
<add key="DeviceName" value="Conveyer"/> | |||
<add key="DeviceSecret" value="b3df8aaa82de59f478dffb172acf78cd"/> | |||
</ConveyerInfo> | |||
<StockInfo1> | |||
<add key="DeviceName" value="Stock1"/> | |||
<add key="DeviceSecret" value="b0928d8f6e36aabd94f0fce3f9b02536"/> | |||
</StockInfo1> | |||
<StockInfo2> | |||
<add key="DeviceName" value="Stock2"/> | |||
<add key="DeviceSecret" value="8373c57ddc6cd134b19cd89fad564157"/> | |||
</StockInfo2> | |||
<StockInfo3> | |||
<add key="DeviceName" value="Stock3"/> | |||
<add key="DeviceSecret" value="83f1457dbbb3c155d512c7a632d4c033"/> | |||
</StockInfo3> | |||
<StockInfo4> | |||
<add key="DeviceName" value="Stock4"/> | |||
<add key="DeviceSecret" value="9f9d37bebfc94900613890a294f1302d"/> | |||
</StockInfo4> | |||
<StockInfo5> | |||
<add key="DeviceName" value="Stock5"/> | |||
<add key="DeviceSecret" value="7ce871f33f86e9b71d30bdaa39899169"/> | |||
</StockInfo5> | |||
<StockInfo6> | |||
<add key="DeviceName" value="Stock6"/> | |||
<add key="DeviceSecret" value="f18b9d31180c7b7e32508b255c418d07"/> | |||
</StockInfo6> | |||
<Services> | |||
<add key="Service1" value="RunControlService"/> | |||
<add key="Service2" value="StockAirControlService"/> | |||
<add key="Service3" value="RecipeSendService"/> | |||
<add key="Service4" value="CancelRecipeService"/> | |||
</Services> | |||
</FlexBatchSystem> | |||
</configuration> |