@@ -228,6 +228,7 @@ namespace BPASmartClient.DRCoffee | |||
MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); | |||
} | |||
}); | |||
InitStatus(); | |||
} | |||
} | |||
@@ -60,6 +60,7 @@ namespace BPASmartClient.Device | |||
{ | |||
p.DeviceId = this.DeviceId; | |||
p.Init(); | |||
}); | |||
this.peripherals = peripherals; | |||
} | |||
@@ -70,9 +71,13 @@ namespace BPASmartClient.Device | |||
{ | |||
foreach (var peripheral in peripherals) | |||
{ | |||
string TypeName = peripheral.GetType().FullName.Replace("BPASmartClient.",""); | |||
Status.Update($"{TypeName}.IsConnected", peripheral.IsConnected); | |||
Status.Update($"{TypeName}.IsWork", peripheral.IsWork); | |||
foreach (var key in peripheral.GetAllStatus().Keys) | |||
{ | |||
peripheralStatus[key] = peripheral.GetAllStatus()[key]; | |||
Status.Update($"{TypeName}.{key}", peripheral.GetAllStatus()[key]); | |||
} | |||
} | |||
Thread.Sleep(100); | |||
@@ -329,6 +329,7 @@ namespace BPASmartClient.GSIceCream | |||
MessageLog.GetInstance.ShowEx($"BPASmartClient.GSIceCream 中引发错误,IceCreamMachine 类,描述:[{ex.Message}]"); | |||
} | |||
}); | |||
InitStatus(); | |||
} | |||
} | |||
@@ -45,6 +45,10 @@ namespace BPASmartClient.IoT | |||
/// 大屏上报Model | |||
/// </summary> | |||
public DataVAPI.Tool.IOT.IOTDevSXModel iOTDevSXModel = new DataVAPI.Tool.IOT.IOTDevSXModel() { }; | |||
/// <summary> | |||
/// 广播 | |||
/// </summary> | |||
public string PubTopic = "/broadcast/" + "grgpECHSL7q" + "/" + "Transit_SetDevice"; | |||
#endregion | |||
#region API调用 | |||
@@ -60,15 +64,9 @@ namespace BPASmartClient.IoT | |||
{ | |||
if (DeviceDataV != null && DeviceDataV.GetIsConnected()) | |||
{ | |||
string url = DataVApiAddress + "/api/Alarm/Create"; | |||
alarmTable.ClientId = ClientId; | |||
alarmTable.devicename = DeviceDataV.deviceTable.devicename; | |||
string redata = HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(alarmTable)); | |||
if (!string.IsNullOrEmpty(redata)) | |||
{ | |||
JsonMsg<AlarmTable> msg = Tools.JsonToObjectTools<JsonMsg<AlarmTable>>(redata); | |||
id = msg?.obj?.data?.Id; | |||
} | |||
DeviceDataV.IOT_Publish(PubTopic, Tools.JsonConvertTools(alarmTable)); | |||
} | |||
} | |||
catch (Exception ex) | |||
@@ -78,24 +76,6 @@ namespace BPASmartClient.IoT | |||
return id; | |||
} | |||
/// <summary> | |||
/// 根据ID删除告警信息 | |||
/// </summary> | |||
/// <param name="alarm"></param> | |||
public void HttpDeleteAlarm(string id) | |||
{ | |||
try | |||
{ | |||
if (string.IsNullOrEmpty(id)) { MessageLog.GetInstance.Show("API调用删除告警信息,ID不能为空!"); return; } | |||
string url = DataVApiAddress + "/api/Alarm/Delete?id=" + id; | |||
HttpRequestHelper.HttpGetRequest(url); | |||
} | |||
catch (Exception ex) | |||
{ | |||
MessageLog.GetInstance.Show(ex.Message); | |||
} | |||
} | |||
/// <summary> | |||
/// 增加日志信息 | |||
/// </summary> | |||
@@ -108,15 +88,9 @@ namespace BPASmartClient.IoT | |||
{ | |||
if (DeviceDataV != null && DeviceDataV.GetIsConnected()) | |||
{ | |||
string url = DataVApiAddress + "/api/Log/Create"; | |||
logTable.ClientId = ClientId; | |||
logTable.devicename = DeviceDataV.deviceTable.devicename; | |||
string redata = HttpRequestHelper.HttpPostRequest(url, Tools.JsonConvertTools(logTable)); | |||
if (!string.IsNullOrEmpty(redata)) | |||
{ | |||
JsonMsg<LogTable> msg = Tools.JsonToObjectTools<JsonMsg<LogTable>>(redata); | |||
id = msg?.obj?.data?.Id; | |||
} | |||
DeviceDataV.IOT_Publish(PubTopic, Tools.JsonConvertTools(logTable)); | |||
} | |||
} | |||
catch (Exception ex) | |||
@@ -147,7 +121,10 @@ namespace BPASmartClient.IoT | |||
DeviceDataV.DataVMessageAction += DevIOTActionHandler; | |||
MessageLog.GetInstance.Show($"客户端:【{ClientId}】,设备名称{DeviceDataV.deviceTable.devicename}阿里云连接成功"); | |||
} | |||
else MessageLog.GetInstance.ShowEx(message); | |||
else | |||
{ | |||
MessageLog.GetInstance.ShowEx(message); | |||
} | |||
} | |||
/// <summary> | |||
@@ -159,11 +136,10 @@ namespace BPASmartClient.IoT | |||
{ | |||
if (DeviceDataV != null && DeviceDataV.GetIsConnected()) | |||
{ | |||
DataVNodeStatus dataVNode = new DataVNodeStatus(); | |||
dataVNode.data = new List<object>(); | |||
List<object> dataVNode = new List<object>(); | |||
Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.ForEach(device => | |||
{ | |||
var obj=new | |||
var obj =new | |||
{ | |||
DeviceId=device.DeviceId, | |||
Name=device.Name, | |||
@@ -174,13 +150,11 @@ namespace BPASmartClient.IoT | |||
IsHealthColor = !device.IsHealth ? new ALYColor { r = 255, g = 0, b = 0, a = 1 } : new ALYColor { r = 51, g = 232, b = 34, a = 1 }, | |||
Status = device.Status.GetStatus(), | |||
}; | |||
dataVNode.data.Add(obj); | |||
dataVNode.Add(obj); | |||
}); | |||
if (dataVNode.data.Count > 0) | |||
if (dataVNode.Count > 0) | |||
{ | |||
iOTDevSXModel.KZSX = Tools.JsonConvertTools<DevSX>(new DevSX { data = new List<DevSXBase> { new DevSXBase { SXMC = "", SXLX = "" } } }); | |||
iOTDevSXModel.JBSX = Tools.JsonConvertTools<DevSX>(new DevSX { data = new List<DevSXBase> { new DevSXBase { SXMC = "", SXLX = "" } } }); | |||
iOTDevSXModel.NodeStatus = Tools.JsonConvertTools<DataVNodeStatus>(dataVNode); | |||
iOTDevSXModel.NodeStatus = Tools.JsonConvertTools(new { data = dataVNode }); | |||
DeviceDataV.IOT_Publish(DeviceDataV.PubTopic, iOTDevSXModel.Tojson()); | |||
} | |||
} | |||
@@ -237,10 +211,4 @@ namespace BPASmartClient.IoT | |||
set; | |||
} | |||
} | |||
public class DataVNodeStatus | |||
{ | |||
public List<object> data { get; set; } | |||
} | |||
} |
@@ -36,6 +36,43 @@ namespace BPASmartDatavDeviceClient.IoT | |||
return DatavDeviceClient.IsConnected; | |||
} | |||
/// <summary> | |||
/// 初始化IOT连接 | |||
/// </summary> | |||
public bool InitializeNo(string _productkey, string _devicename, string _devicesecret, ref string message) | |||
{ | |||
try | |||
{ | |||
deviceTable.devicename = _devicename; | |||
SetValue(_productkey, _devicename, _devicesecret); | |||
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName()); | |||
string _clientIp = host.AddressList.FirstOrDefault( | |||
ip => ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).ToString(); | |||
string t = Convert.ToString(DateTimeOffset.Now.ToUnixTimeMilliseconds()); | |||
string signmethod = "hmacmd5"; | |||
Dictionary<string, string> dict = new Dictionary<string, string>(); | |||
dict.Add("productKey", ProductKey); | |||
dict.Add("deviceName", DeviceName); | |||
dict.Add("clientId", _clientIp); | |||
dict.Add("timestamp", t); | |||
mqttUserName = DeviceName + "&" + ProductKey; | |||
mqttPassword = IotSignUtils.sign(dict, DeviceSecret, signmethod); | |||
mqttClientId = _clientIp + "|securemode=3,signmethod=" + signmethod + ",timestamp=" + t + "|"; | |||
targetServer = ProductKey + ".iot-as-mqtt." + RegionId + ".aliyuncs.com"; | |||
ConnectMqtt(targetServer, mqttClientId, mqttUserName, mqttPassword); | |||
} | |||
catch (Exception ex) | |||
{ | |||
message += $"阿里云{_devicename}连接失败,{ex.Message}"; | |||
return false; | |||
} | |||
IOT_Subscribe(BroadcastTopic);//订阅广播主题 | |||
if (!DatavDeviceClient.IsConnected) message += $"客户端:【】,设备名称{deviceTable.devicename}阿里云连接失败.不能上报业务信息"; | |||
return DatavDeviceClient.IsConnected; | |||
} | |||
/// <summary> | |||
/// 获取连接状态 | |||
/// </summary> | |||
@@ -283,6 +283,7 @@ namespace BPASmartClient.KLMCoffee | |||
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); | |||
} | |||
}); | |||
InitStatus(); | |||
} | |||
@@ -238,6 +238,7 @@ namespace BPASmartClient.Lebai | |||
public override void Start() | |||
{ | |||
Connect(IpAddress); | |||
} | |||
public override void Stop() | |||
@@ -250,6 +251,7 @@ namespace BPASmartClient.Lebai | |||
{ | |||
}); | |||
InitStatus(); | |||
} | |||
} | |||
} |
@@ -26,8 +26,11 @@ namespace BPASmartClient.PLC | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
while (modbusTcp.Connected) | |||
IsConnected = modbusTcp.Connected; | |||
if (!IsConnected) IsWork = false; | |||
while (IsConnected) | |||
{ | |||
IsWork = true; | |||
foreach (var par in plcReadParameters) | |||
{ | |||
ushort address = (ushort)modbusTcp.GetAddress(par?.Address); | |||
@@ -43,6 +46,7 @@ namespace BPASmartClient.PLC | |||
} | |||
status[par.Address] = readData; | |||
} | |||
Thread.Sleep(500); | |||
} | |||
Thread.Sleep(1000); | |||
@@ -0,0 +1,14 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
<Nullable>enable</Nullable> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmartClient.Device\BPASmartClient.Device.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,649 @@ | |||
using BPA.Message; | |||
using BPA.Message.Enum; | |||
using BPASmartClient.Device; | |||
using BPASmartClient.EventBus; | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.Message; | |||
using BPASmartClient.Model; | |||
using BPASmartClient.Model.PLC; | |||
using static BPASmartClient.EventBus.EventBus; | |||
namespace BPASmartClient.MorkF | |||
{ | |||
public class Control_MorkF : BaseDevice | |||
{ | |||
public override DeviceClientType DeviceType => throw new NotImplementedException(); | |||
GVL_MorkF morkF = new GVL_MorkF();//全局对象声明 | |||
private OrderMaterialDelivery orderMaterialDelivery { get; set; } = new OrderMaterialDelivery(); | |||
private RecipeBoms recipeBoms { get; set; } = new RecipeBoms(); | |||
int OrderCount; | |||
/// <summary> | |||
/// 入口 | |||
/// </summary> | |||
public override void DoMain() | |||
{ | |||
ReadData(); //plc状态量读取 | |||
DataParse();//数据解析 | |||
Main(); | |||
ResetProgram(); | |||
MessageLog.GetInstance.Show("MORKF 设备初始化完成"); | |||
} | |||
/// <summary> | |||
/// PLC数据读取 | |||
/// </summary> | |||
public void ReadData() | |||
{ | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
GetStatus("M0.1", new Action<bool[]>((bools) => { | |||
morkF.InitialComplete = bools[0]; | |||
})); | |||
GetStatus("M1.0", new Action<bool[]>((bools) => { | |||
morkF.ProvidePlateModule = bools[0]; | |||
morkF.ProvidePlateComplete = bools[2]; | |||
morkF.CleanModule = bools[3]; | |||
morkF.CleanComplete = bools[5]; | |||
})); | |||
GetStatus("M2.0", new Action<bool[]>((bools) => { | |||
morkF.KitchenOneStatus = bools[1]; | |||
morkF.FallOilComplete = bools[8]; | |||
})); | |||
GetStatus("M8.0", new Action<bool[]>((bools) => { | |||
morkF.TurnMachineUpComplete = bools[1]; | |||
morkF.TurnMachineDownComplete = bools[3]; | |||
})); | |||
GetStatus("M13.5", new Action<bool[]>((bools) => { | |||
morkF.MaterialArriveComplete = bools[0]; | |||
})); | |||
GetStatus("M16.0", new Action<bool[]>((bools) => { | |||
morkF.PutPotToKitchenComlete = bools[1]; | |||
morkF.TakeMaterialComplete = bools[2]; | |||
morkF.PlaceRinseTableComplete = bools[5]; | |||
morkF.RoobotIdle = bools[6]; | |||
})); | |||
Thread.Sleep(500); | |||
}), "ReadPLCData"); | |||
} | |||
private void ServerInit() | |||
{ | |||
//物料信息 | |||
EventBus.EventBus.GetInstance().Subscribe<MaterialDeliveryEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | |||
{ | |||
if (@event == null) return; | |||
if (@event is MaterialDeliveryEvent material) | |||
{ | |||
orderMaterialDelivery = material.orderMaterialDelivery; | |||
} | |||
}); | |||
//配方数据信息 | |||
EventBus.EventBus.GetInstance().Subscribe<RecipeBomEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | |||
{ | |||
if (@event == null) return; | |||
if (@event is RecipeBomEvent recipe) | |||
{ | |||
recipeBoms = recipe.recipeBoms; | |||
WriteRecipeBoms(); | |||
} | |||
}); | |||
} | |||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Id = DeviceId, Status = oRDER_STATUS, SubOrderId = subid }); | |||
} | |||
/// <summary> | |||
/// 写入配方数据到 PLC | |||
/// </summary> | |||
private void WriteRecipeBoms() | |||
{ | |||
//List<ushort> recipeBoms = new List<ushort>(); | |||
//if (this.recipeBoms == null) return; | |||
//foreach (var item in this.recipeBoms.RecipeIds) | |||
//{ | |||
// foreach (var rec in item.Recipes) | |||
// { | |||
// recipeBoms.Add((ushort)rec); | |||
// } | |||
//} | |||
//if (recipeBoms.Count > 0) | |||
//{ | |||
// //配方数据地址范围:VW2000 - VW2278 | |||
// WriteData("VW2000", recipeBoms.ToArray()); | |||
//} | |||
//else { MessageLog.GetInstance.Show("配方数据为空"); } | |||
} | |||
/// <summary> | |||
/// 数据解析 | |||
/// </summary> | |||
private void DataParse() | |||
{ | |||
EventBus.EventBus.GetInstance().Subscribe<DoOrderEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle) | |||
{ | |||
if (@event == null) return; | |||
if (@event is DoOrderEvent order) | |||
{ | |||
if (order.MorkOrder.GoodBatchings == null) return; | |||
OrderCount++; | |||
MessageLog.GetInstance.Show($"接收到{OrderCount}次订单"); | |||
foreach (var item in order.MorkOrder.GoodBatchings) | |||
{ | |||
var res = orderMaterialDelivery?.BatchingInfo?.FirstOrDefault(p => p.BatchingId == item.BatchingId); | |||
if (res != null) | |||
{ | |||
if (ushort.TryParse(res.BatchingLoc, out ushort loc)) | |||
{ | |||
if (loc >= 1 && loc <= 5) | |||
{ | |||
if (morkF.TakeMaterialQueue.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null) | |||
morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { Loc = ushort.Parse(res.BatchingLoc), SuborderId = order.MorkOrder.SuborderId, BatchingId = res.BatchingId }); | |||
} | |||
else if (loc >= 10 && loc <= 11) | |||
{ | |||
int index = 0; | |||
if (recipeBoms != null) | |||
{ | |||
index = Array.FindIndex(recipeBoms.RecipeIds?.ToArray(), p => p.RecipeId == order.MorkOrder.RecipeId); | |||
index++; | |||
} | |||
if (morkF.TakePlateQueue.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null) | |||
morkF.TakePlateQueue.Enqueue(new OrderLocInfo() | |||
{ | |||
Loc = ushort.Parse(res.BatchingLoc), | |||
SuborderId = order.MorkOrder.SuborderId, | |||
RecipeNumber = (index >= 1 && index <= 10) ? (ushort)index : (ushort)0 | |||
}); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
} | |||
/// <summary> | |||
/// 流程控制 | |||
/// </summary> | |||
public void Main() | |||
{ | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
IsHealth = true; //心跳 | |||
TakePlatelTask(); | |||
TakePotTask(); | |||
TakeVegBurdenATask(); | |||
TakeMeatBurdenATask(); | |||
TakeVegBurdenBTask(); | |||
TakeBurdenCTask(); | |||
StartCookingTask(); | |||
OutDishTask(); | |||
CleanPotTask(); | |||
TurntableControl(); | |||
SingleProcess(); | |||
}), "MainTask"); | |||
} | |||
/// <summary> | |||
/// 信号处理 | |||
/// </summary> | |||
private void SingleProcess() | |||
{ | |||
//转台互锁解除 | |||
if (morkF.TakeMaterialComplete && morkF.TurnTableLock) | |||
{ | |||
morkF.TurnTableLock = false; | |||
} | |||
//待定 | |||
if (morkF.TakeVegALock && morkF.TakeMeatALock && morkF.TakeVegBLock) | |||
{ | |||
morkF.TakeAllBurdenComplete = true; | |||
} | |||
//出餐完成,相应变量复位 | |||
if (morkF.OutMealComplete) | |||
{ | |||
morkF.TakePlateLock = false; | |||
morkF.TakePotLock = false; | |||
morkF.TakeVegALock = false; | |||
morkF.TakeMeatALock = false; | |||
morkF.TakeVegBLock = false; | |||
morkF.TakeBurdenCLcok = false; | |||
} | |||
} | |||
/// <summary> | |||
/// 转台控制 | |||
/// </summary> | |||
private void TurntableControl() | |||
{ | |||
//正常轮询 | |||
if (morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0 && !morkF.TurnTableLock) | |||
{ | |||
var result = orderMaterialDelivery.BatchingInfo.Where(p => p.BatchingId == morkF.TakeMaterialQueue.ElementAt(0).BatchingId).ToList(); | |||
if (result != null) | |||
{ | |||
if (ushort.TryParse(result[0].BatchingLoc, out ushort loc)) | |||
{ | |||
TurnMaterialStore(loc); | |||
MessageLog.GetInstance.Show($"转台转到【{loc}】位置"); | |||
morkF.TurnTableLock = true; //取料完成后置false | |||
} | |||
} | |||
else MessageLog.GetInstance.Show("未找到可用的物料信息"); | |||
} | |||
} | |||
/// <summary> | |||
/// 供盘 | |||
/// </summary> | |||
/// <exception cref="NotImplementedException"></exception> | |||
private void TakePlatelTask() | |||
{ | |||
if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakePlateQueue.Count > 0 && !morkF.ProvidePlateModule && !morkF.TakePlateLock) | |||
{ | |||
if (morkF.TakePlateQueue.TryDequeue(out OrderLocInfo order)) | |||
{ | |||
StartTakePlate(); | |||
morkF.CurrentOrderId = order.SuborderId; | |||
morkF.TakePlateLock = true; //订单完成后置false | |||
MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取碗控制,位置:[{order.Loc}]"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 取锅到灶台 | |||
/// </summary> | |||
/// <exception cref="NotImplementedException"></exception> | |||
private void TakePotTask() | |||
{ | |||
if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakePlateQueue.Count > 0 && !morkF.CleanModule && morkF.CleanComplete && !morkF.KitchenOneStatus && !morkF.TakePotLock) | |||
{ | |||
TakePotToKitchen(); | |||
morkF.TakePotLock = true; //订单完成后置false | |||
MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取锅到灶台控制"); | |||
} | |||
} | |||
/// <summary> | |||
/// 取素菜A料 | |||
/// </summary> | |||
private void TakeVegBurdenATask() | |||
{ | |||
if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && !morkF.TakeVegALock && morkF.AllowTakeMaterial) | |||
{ | |||
if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) | |||
{ | |||
int loc = order.Loc; | |||
TakeBurden(loc); | |||
morkF.TakeVegALock = true;//订单完成置false | |||
morkF.AllowTakeMaterial = false; | |||
MessageLog.GetInstance.Show($"订单【{ order.SuborderId},翻转机上升完成,执行取素菜A控制"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 取荤菜A料 | |||
/// </summary> | |||
private void TakeMeatBurdenATask() | |||
{ | |||
if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && morkF.TakeVegALock && !morkF.TakeMeatALock && morkF.AllowTakeMaterial) | |||
{ | |||
if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) | |||
{ | |||
int loc = order.Loc; | |||
TakeBurden(loc); | |||
morkF.TakeMeatALock = true;//订单完成置false | |||
morkF.AllowTakeMaterial = false; | |||
MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取荤菜A控制"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 取素菜B料 | |||
/// </summary> | |||
private void TakeVegBurdenBTask() | |||
{ | |||
if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && morkF.TakeMeatALock && !morkF.TakeVegBLock && morkF.AllowTakeMaterial) | |||
{ | |||
if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) | |||
{ | |||
int loc = order.Loc; | |||
TakeBurden(loc); | |||
morkF.TakeVegBLock = true;//订单完成置false | |||
morkF.AllowTakeMaterial = false; | |||
MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取素菜B控制"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 取调味品C料 | |||
/// </summary> | |||
/// <exception cref="NotImplementedException"></exception> | |||
private void TakeBurdenCTask() | |||
{ | |||
if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && morkF.TakeAllBurdenComplete && !morkF.TakeBurdenCLcok && morkF.AllowTakeMaterial) | |||
{ | |||
if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order)) | |||
{ | |||
int loc = order.Loc; | |||
TakeBurden(loc); | |||
morkF.TakeBurdenCLcok = true;//订单完成置false | |||
morkF.AllowTakeMaterial = false; | |||
morkF.TakeAllBurdenComplete = false; | |||
MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取调味品C料控制"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 开始烹饪 | |||
/// </summary> | |||
/// <exception cref="NotImplementedException"></exception> | |||
private void StartCookingTask() | |||
{ | |||
if (morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0 && morkF.PutPotToKitchenComlete && !morkF.CookingLock) | |||
{ | |||
MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】开始烹饪"); | |||
morkF.CookingLock = true; | |||
morkF.PotInPlace = morkF.PutPotToKitchenComlete;//锅到位 | |||
Task.Run(new Action(() => | |||
{ | |||
KitchenAdjustGears(3); | |||
Task.Delay(1000); //大火加热1s | |||
AddOil();//注油 | |||
KitchenAdjustGears(2); | |||
Task.Delay(2000); //中火2s | |||
TurnDownStatusDetect();//翻转机下降及检测 | |||
KitchenAdjustGears(1);//灶台1挡 | |||
TurnMachineGearsControl(1);//翻炒机1挡 | |||
Task.Delay(2000); | |||
TurnMachineGearsControl(0);//关闭翻炒机 | |||
TurnUpStatusDetect();//翻转机上升及检测 | |||
TurnDownStatusDetect();//翻转机下降及检测 | |||
KitchenAdjustGears(3);//灶台3挡 | |||
TurnMachineGearsControl(3);//翻炒机3挡 | |||
Task.Delay(2000);//葱姜蒜断生 | |||
KitchenAdjustGears(1);//灶台1挡 | |||
TurnMachineGearsControl(0);//关闭翻炒机 | |||
TurnUpStatusDetect();//翻转机上升及检测 | |||
TurnDownStatusDetect();//翻转机下降及检测 | |||
KitchenAdjustGears(3);//灶台3挡 | |||
TurnMachineGearsControl(3);//翻炒机3挡 | |||
Task.Delay(2000);//B料断生 | |||
KitchenAdjustGears(1);//灶台1挡 | |||
TurnMachineGearsControl(0);//关闭翻炒机 | |||
TurnUpStatusDetect();//翻转机上升及检测 | |||
TurnDownStatusDetect();//翻转机下降及检测 | |||
KitchenAdjustGears(2);//灶台3挡 | |||
TurnMachineGearsControl(3);//翻炒机3挡 | |||
Task.Delay(2000);//煸炒入味 | |||
KitchenAdjustGears(0);//灶台0挡 | |||
TurnMachineGearsControl(0);//关闭翻炒机 | |||
TurnMachineOrientControl("Top");//翻转机上升 | |||
while (!morkF.TurnMachineUpComplete) | |||
{ | |||
Task.Delay(5); | |||
} | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false }); | |||
morkF.CookingComplete = true; //烹饪完成 | |||
MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】烹饪完成"); | |||
})); | |||
} | |||
} | |||
/// <summary> | |||
/// 出餐 | |||
/// </summary> | |||
private void OutDishTask() | |||
{ | |||
if (!morkF.RoobotIdle && morkF.CookingComplete && morkF.ProvidePlateComplete && !morkF.CleanModule) | |||
{ | |||
RobotOutMeal(); | |||
MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】正在出餐"); | |||
} | |||
} | |||
/// <summary> | |||
/// 洗锅放锅 | |||
/// </summary> | |||
private void CleanPotTask() | |||
{ | |||
if (morkF.PlaceRinseTableComplete && !morkF.CleanModule) | |||
{ | |||
CleanModuleControl("Start"); | |||
Task.Delay(5000); | |||
CleanModuleControl("Stop"); | |||
} | |||
} | |||
/// <summary> | |||
/// 任务复位重启 | |||
/// </summary> | |||
private void ResetProgram() | |||
{ | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
if (RTrig.GetInstance("ResetProgram").Start(morkF.DevicDataInite)) | |||
{ | |||
ThreadManage.GetInstance().StopTask("MainTask", new Action(() => | |||
{ | |||
ThreadManage.GetInstance().StopTask("ReadPLCData", new Action(() => | |||
{ | |||
morkF = null; | |||
morkF = new GVL_MorkF(); | |||
ActionManage.GetInstance.Send("ResetProgram"); | |||
ActionManage.GetInstance.Send("ClearOrders"); | |||
ReadData(); | |||
Main(); | |||
})); | |||
})); | |||
} | |||
Thread.Sleep(10); | |||
}), "ResetProgram"); | |||
} | |||
/// <summary> | |||
/// 翻转机下降及状态检测 | |||
/// </summary> | |||
public void TurnDownStatusDetect() | |||
{ | |||
TurnMachineOrientControl("Down"); | |||
while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成 | |||
{ | |||
Task.Delay(5); | |||
} | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.3", Value = false });//复位 | |||
MessageLog.GetInstance.Show($"翻转机下降执行完成"); | |||
} | |||
/// <summary> | |||
/// 翻转机上升及状态检测 | |||
/// </summary> | |||
public void TurnUpStatusDetect() | |||
{ | |||
TurnMachineOrientControl("Top");//翻转机上升 | |||
morkF.AllowTakeMaterial = true; | |||
while (!morkF.TurnMachineUpComplete || !morkF.TakeMaterialComplete)//等待翻转机上升完成以及取料完成 | |||
{ | |||
Task.Delay(5); | |||
} | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false }); | |||
MessageLog.GetInstance.Show("翻转机上升执行完成"); | |||
} | |||
private void GetStatus(string key, Action<bool[]> action) | |||
{ | |||
if (peripheralStatus.ContainsKey(key)) | |||
{ | |||
action((bool[])peripheralStatus[key]);//获取PLC指定地址的状态值 | |||
} | |||
} | |||
/// <summary> | |||
/// 写数据 | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="value"></param> | |||
private void WriteData(string address, object value) | |||
{ | |||
EventBus.EventBus.GetInstance().Publish(new WriteModel() { Id = DeviceId, Address = address, Value = value }); | |||
} | |||
/// <summary> | |||
/// 灶台档位调节 | |||
/// </summary> | |||
public void KitchenAdjustGears(int number) | |||
{ | |||
switch (number) | |||
{ | |||
case 0: | |||
WriteData("352", new bool[] { false, false, false, false, false, false, false, false });//0000 0000 | |||
break; | |||
case 1: | |||
WriteData("352", new bool[] { true, false, false, false, false, false, false, false });//0000 0001 | |||
break; | |||
case 2: | |||
WriteData("352", new bool[] { false, true, false, false, false, false, false, false });//0000 0010 | |||
break; | |||
case 3: | |||
WriteData("352", new bool[] { true, true, false, false, false, false, false, false });//0000 0011 | |||
break; | |||
case 4: | |||
WriteData("352", new bool[] { false, false, true, false, false, false, false, false });//0000 0100 | |||
break; | |||
case 5: | |||
WriteData("352", new bool[] { true, false, true, false, false, false, false, false });//0000 0101 | |||
break; | |||
case 6: | |||
WriteData("352", new bool[] { false, true, true, false, false, false, false, false });//0000 0110 | |||
break; | |||
case 7: | |||
WriteData("352", new bool[] { true, true, true, false, false, false, false, false });//0000 0111 | |||
break; | |||
case 8: | |||
WriteData("355", new bool[] { false, false, false, true, false, false, false, false });//0000 1000 | |||
break; | |||
case 9: | |||
WriteData("352", new bool[] { true, false, false, true, false, false, false, false });//0000 1001 | |||
break; | |||
} | |||
MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】,加热档位调至{number}挡"); | |||
} | |||
public void TurnMaterialStore(int loc) | |||
{ | |||
switch (loc) | |||
{ | |||
case 1: | |||
WriteData("M13.0", true); | |||
break; | |||
case 2: | |||
WriteData("M13.1", true); | |||
break; | |||
case 3: | |||
WriteData("M13.2", true); | |||
break; | |||
case 4: | |||
WriteData("M13.3", true); | |||
break; | |||
case 5: | |||
WriteData("M13.4", true); | |||
break; | |||
} | |||
} | |||
/// <summary> | |||
/// 供盘启动 | |||
/// </summary> | |||
public void StartTakePlate() | |||
{ | |||
WriteData("M1.1", true); | |||
} | |||
/// <summary> | |||
/// 取锅到灶台 | |||
/// </summary> | |||
public void TakePotToKitchen() | |||
{ | |||
WriteData("M14.0", true); | |||
} | |||
/// <summary> | |||
/// 机器人出餐并将锅放置清洗台位置 | |||
/// </summary> | |||
public void RobotOutMeal() | |||
{ | |||
WriteData("M14.2", true); | |||
} | |||
/// <summary> | |||
/// 注油 | |||
/// </summary> | |||
public void AddOil() | |||
{ | |||
WriteData("M2.7", true); | |||
MessageLog.GetInstance.Show("开始注油"); | |||
while (!morkF.FallOilComplete) | |||
{ | |||
Task.Delay(5); | |||
} | |||
MessageLog.GetInstance.Show("注油完成"); | |||
} | |||
/// <summary> | |||
/// 翻转机方向控制 | |||
/// </summary> | |||
/// <param name="orientation"></param> | |||
public void TurnMachineOrientControl(string orientation) | |||
{ | |||
switch (orientation) | |||
{ | |||
case "Top": WriteData("M8.0", true); break; | |||
// case "Middle": WriteData("", 1); break; | |||
case "Down": WriteData("M8.2", true); break; | |||
} | |||
MessageLog.GetInstance.Show($"翻转机执行{orientation}操作"); | |||
} | |||
/// <summary> | |||
/// 翻转机档位控制 | |||
/// </summary> | |||
public void TurnMachineGearsControl(int gear) | |||
{ | |||
switch (gear) | |||
{ | |||
case 0: WriteData("M7.0", true); break;//关闭翻炒机 | |||
case 1: WriteData("M7.1", true); break;//翻炒机1挡 | |||
case 2: WriteData("M7.2", true); break;//翻炒机2挡 | |||
case 3: WriteData("M7.3", true); break;//翻炒机3挡 | |||
} | |||
MessageLog.GetInstance.Show($"翻转机档位调至{gear}挡"); | |||
} | |||
/// <summary> | |||
/// 取A,B,C料 | |||
/// </summary> | |||
public void TakeBurden(int loc) | |||
{ | |||
WriteData("M14.1", true);//机器人取料 | |||
} | |||
/// <summary> | |||
/// 清洗模组1启停控制 | |||
/// </summary> | |||
public void CleanModuleControl(string status) | |||
{ | |||
if (status == "Start") | |||
{ | |||
WriteData("M1.4", true); | |||
} | |||
if (status == "Stop") | |||
{ | |||
WriteData("M1.4", false); | |||
} | |||
MessageLog.GetInstance.Show($"清洗模组执行【{status}】操作"); | |||
} | |||
public override void Stop() | |||
{ | |||
} | |||
} | |||
} |
@@ -0,0 +1,165 @@ | |||
using System; | |||
using System.Collections.Concurrent; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.MorkF | |||
{ | |||
internal class GVL_MorkF | |||
{ | |||
/// <summary> | |||
/// 初始化完成状态 | |||
/// </summary> | |||
public bool InitialComplete { get; set; } | |||
/// <summary> | |||
/// 供盘 模组状态 忙碌1 空闲0 | |||
/// </summary> | |||
public bool ProvidePlateModule { get; set; } | |||
/// <summary> | |||
/// 供盘完成状态 | |||
/// </summary> | |||
public bool ProvidePlateComplete { get; set; } | |||
/// <summary> | |||
/// 清洗模组1状态 忙碌1 空闲0 | |||
/// </summary> | |||
public bool CleanModule { get; set; } | |||
/// <summary> | |||
/// 清洗模组1完成状态 | |||
/// </summary> | |||
public bool CleanComplete { get; set; } | |||
/// <summary> | |||
/// 锅灶1状态 忙碌1 空闲0 | |||
/// </summary> | |||
public bool KitchenOneStatus { get; set; } | |||
/// <summary> | |||
/// 注油完成状态 | |||
/// </summary> | |||
public bool FallOilComplete { get; set; } | |||
/// <summary> | |||
/// 翻转机上升完成状态 | |||
/// </summary> | |||
public bool TurnMachineUpComplete { get; set; } | |||
/// <summary> | |||
/// 翻转机下降完成状态 | |||
/// </summary> | |||
public bool TurnMachineDownComplete { get; set; } | |||
/// <summary> | |||
/// 料仓旋转到位状态 | |||
/// </summary> | |||
public bool MaterialArriveComplete { get; set; } | |||
/// <summary> | |||
/// 机器人空闲状态 | |||
/// </summary> | |||
public bool RoobotIdle { get; set; } | |||
/// <summary> | |||
/// 放锅至灶台完成状态 | |||
/// </summary> | |||
public bool PutPotToKitchenComlete { get; set; } | |||
/// <summary> | |||
/// 机器人取料完成状态 | |||
/// </summary> | |||
public bool TakeMaterialComplete { get; set; } | |||
/// <summary> | |||
/// 机器人放锅至清洗台完成状态 | |||
/// </summary> | |||
public bool PlaceRinseTableComplete { get; set; } | |||
/// <summary> | |||
/// 订单取配料队列 | |||
/// </summary> | |||
public ConcurrentQueue<OrderLocInfo> TakeMaterialQueue = new ConcurrentQueue<OrderLocInfo>(); | |||
/// <summary> | |||
/// 订单供盘队列 | |||
/// </summary> | |||
public ConcurrentQueue<OrderLocInfo> TakePlateQueue = new ConcurrentQueue<OrderLocInfo>(); | |||
/// <summary> | |||
/// 存放当前订单唯一ID | |||
/// </summary> | |||
public string CurrentOrderId { get; set; } | |||
/// <summary> | |||
/// PLC上升沿初始化触发信号 | |||
/// </summary> | |||
public bool DevicDataInite { set; get; } | |||
/// <summary> | |||
/// 取素菜A料完成 | |||
/// </summary> | |||
public bool TakeVegBurdenAComplete { get; set; } | |||
/// <summary> | |||
/// 取荤菜A料完成 | |||
/// </summary> | |||
public bool TakeMeatBurdenAComplete { get; set; } | |||
/// <summary> | |||
/// 所有A料下锅完成 | |||
/// </summary> | |||
public bool TakeAllBurdenAComplete { get; set; } | |||
/// <summary> | |||
/// 取素菜B料完成 | |||
/// </summary> | |||
public bool TakeVegBurdenBComplete { get; set; } | |||
/// <summary> | |||
/// 所有B料下锅完成 | |||
/// </summary> | |||
public bool TakeAllBurdenBComplete { get; set; } | |||
/// <summary> | |||
/// 取C料完成 | |||
/// </summary> | |||
public bool TakeBurdenCComplete { get; set; } | |||
/// <summary> | |||
/// 除C料外,所有配料下锅标志 | |||
/// </summary> | |||
public bool TakeAllBurdenComplete { get; set; } | |||
/// <summary> | |||
/// 锅到位 true:到位 false:未到位 | |||
/// </summary> | |||
public bool PotInPlace { get; set; } | |||
/// <summary> | |||
/// true:烹饪完成 | |||
/// </summary> | |||
public bool CookingComplete { get; set; } | |||
/// <summary> | |||
/// 供盘互锁 | |||
/// </summary> | |||
public bool TakePlateLock { get; set; } | |||
/// <summary> | |||
/// 取锅互锁 | |||
/// </summary> | |||
public bool TakePotLock { get; set; } | |||
/// <summary> | |||
/// 取素菜A料互锁 | |||
/// </summary> | |||
public bool TakeVegALock { get; set; } | |||
/// <summary> | |||
/// 取荤菜A料互锁 | |||
/// </summary> | |||
public bool TakeMeatALock { get; set; } | |||
/// <summary> | |||
/// 取素菜B料互锁 | |||
/// </summary> | |||
public bool TakeVegBLock { get; set; } | |||
/// <summary> | |||
/// 取C料互锁 | |||
/// </summary> | |||
public bool TakeBurdenCLcok { get; set; } | |||
/// <summary> | |||
/// 烹饪任务互锁 | |||
/// </summary> | |||
public bool CookingLock { get; set; } | |||
/// <summary> | |||
/// 转台互锁 | |||
/// </summary> | |||
public bool TurnTableLock { get; set; } | |||
/// <summary> | |||
/// 开始取料标志 | |||
/// </summary> | |||
public bool AllowTakeMaterial { get; set; } | |||
/// <summary> | |||
/// 当前订单完成标志 | |||
/// </summary> | |||
public bool OutMealComplete { get; set; } | |||
} | |||
} | |||
@@ -0,0 +1,16 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.MorkF | |||
{ | |||
internal class OrderLocInfo | |||
{ | |||
public string SuborderId { get; set; } | |||
public ushort Loc { get; set; } | |||
public ushort RecipeNumber { get; set; } | |||
public int BatchingId { get; set; } | |||
} | |||
} |
@@ -14,6 +14,7 @@ namespace BPASmartClient.MorkT | |||
public override void DoMain() | |||
{ | |||
} | |||
public override void Stop() | |||
@@ -15,11 +15,11 @@ namespace BPASmartClient.Peripheral | |||
/// <summary> | |||
/// 是否已连接 | |||
/// </summary> | |||
public bool IsConnected { get; protected set; } | |||
public bool IsConnected { get; set; } | |||
/// <summary> | |||
/// 是否工作正常 | |||
/// </summary> | |||
public bool IsWork { get; protected set; } | |||
public bool IsWork { get; set; } | |||
/// <summary> | |||
/// 归属设备Id | |||
/// </summary> | |||
@@ -12,6 +12,14 @@ namespace BPASmartClient.Peripheral | |||
/// </summary> | |||
public interface IPeripheral | |||
{ | |||
/// <summary> | |||
/// 是否已连接 | |||
/// </summary> | |||
bool IsConnected { get; set; } | |||
/// <summary> | |||
/// 是否工作正常 | |||
/// </summary> | |||
bool IsWork { get; set; } | |||
/// <summary> | |||
/// 设备ID | |||
/// </summary> | |||
@@ -377,7 +377,7 @@ namespace BPASmartClient.SCChip | |||
MessageLog.GetInstance.ShowEx($"BPASmartClient.SCChip 中引发错误,ICChipMachine 类,描述:[{ex.Message}]"); | |||
} | |||
}); | |||
InitStatus(); | |||
} | |||
} | |||
@@ -22,7 +22,7 @@ namespace BPASmartClient.ViewModel | |||
/// </summary> | |||
public class LogViewModel :ObservableObject | |||
{ | |||
public DispatcherTimer dispatcherTimer; | |||
//public DispatcherTimer dispatcherTimer; | |||
public string ClientId= System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); | |||
private ObservableCollection<LogModel> _LogModels; | |||
public ObservableCollection<LogModel> LogDataGrid | |||
@@ -60,10 +60,10 @@ namespace BPASmartClient.ViewModel | |||
DataVClient.GetInstance().HttpAddLog(new LogTable | |||
{ | |||
ClientId = ClientId, | |||
LogTime = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss"), | |||
LogTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), | |||
LogType = "严重", | |||
LogMessage = s, | |||
LogVla = "错误日志", | |||
LogVla = "错误日志" | |||
}); | |||
})); | |||
}); | |||
@@ -71,16 +71,6 @@ namespace BPASmartClient.ViewModel | |||
{ | |||
ExcellOrder(); | |||
}); | |||
//dispatcherTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };//1秒一流转 | |||
//dispatcherTimer.Tick += delegate | |||
//{ | |||
// if (TimedClear) | |||
// { | |||
// } | |||
//}; | |||
//dispatcherTimer.Start(); | |||
} | |||
/// <summary> | |||
@@ -129,6 +119,7 @@ namespace BPASmartClient.ViewModel | |||
System.Windows.MessageBox.Show("无数据!"); | |||
} | |||
/// <summary> | |||
/// 打开指定路径下文件,比如:Word、Excel、Dll、图片等都可以(前提是你已经安装打开程序的对应软件) | |||
/// </summary> | |||
@@ -21,7 +21,6 @@ | |||
<add key="OrderServiceUri" value="https://bpa.black-pa.com:21527/order/"/> | |||
<add key="StockServiceUri" value="https://bpa.black-pa.com:21527/stock/"/> | |||
<add key="DataVServiceUri" value="https://bpa.black-pa.com:21527/datav"/> | |||
@@ -2,13 +2,13 @@ | |||
<BPADevices> | |||
<!--<Device Name="MorkT" Module="BPASmartClient.MorkT.Device_MorkT" DeviceId="1"> | |||
<Peripherals> | |||
<Peripheral Module="BPASmartClient.Lebai.LebaiRobot"> | |||
--><!--<Peripheral Module="BPASmartClient.Lebai.LebaiRobot"> | |||
<Parameters> | |||
<IpAddress>127.0.0.1</IpAddress> | |||
<HandSensor>1</HandSensor> | |||
<OutputSingalValue>0</OutputSingalValue> | |||
</Parameters> | |||
</Peripheral> | |||
</Peripheral>--><!-- | |||
<Peripheral Module="BPASmartClient.SCChip.ICChipMachine"> | |||
<Parameters> | |||
@@ -19,37 +19,37 @@ | |||
</Peripherals> | |||
</Device>--> | |||
<Device Name="MorkS" Module="BPASmartClient.MorkS.Control" DeviceId="2"> | |||
<!--<Parameters> | |||
<Device Name="MorkF" Module="BPASmartClient.MorkF.Control_MorkF" DeviceId="2"> | |||
<!--<Parameters> | |||
<IpAddress>127.0.10.1</IpAddress> | |||
<Port>11</Port> | |||
</Parameters>--> | |||
<Peripherals> | |||
<Peripheral Module="BPASmartClient.PLC.MorksMachine"> | |||
<Parameters> | |||
<!--<IpAddress>192.168.1.11</IpAddress>--> | |||
<IpAddress>127.0.0.1</IpAddress> | |||
<Port>502</Port> | |||
<PLCReadAddress>M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress> | |||
</Parameters> | |||
</Peripheral> | |||
<Peripherals> | |||
<Peripheral Module="BPASmartClient.PLC.MorksMachine"> | |||
<Parameters> | |||
<IpAddress>192.168.1.11</IpAddress> | |||
<Port>508</Port> | |||
<!--<PLCReadAddress>M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress>--> | |||
<PLCReadAddress>M,M0.1,1;M,M1.0,8;M,M2.0,9;M,M8.0,4;M,M13.5,1;M,M16.0,7;</PLCReadAddress> | |||
</Parameters> | |||
</Peripheral> | |||
<!--<Peripheral Module="BPASmartClient.MORKSM.BK.PLC.MorksMachine"> | |||
<!--<Peripheral Module="BPASmartClient.MORKSM.BK.PLC.MorksMachine"> | |||
<Parameters> | |||
<IpAddress>127.0.10.1</IpAddress> | |||
<Port>11</Port> | |||
</Parameters> | |||
</Peripheral>--> | |||
<!--<Peripheral Module="BPASmartClient.KLMCoffee.CoffeeMachine"> | |||
<!--<Peripheral Module="BPASmartClient.KLMCoffee.CoffeeMachine"> | |||
<Parameters> | |||
<PortName>COM8</PortName> | |||
<BaudRate>38400</BaudRate> | |||
</Parameters> | |||
</Peripheral>--> | |||
</Peripherals> | |||
</Device> | |||
</Peripherals> | |||
</Device> | |||
@@ -74,6 +74,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lebai.SDK", "Lebai.SDK\Leba | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.PLC", "BPASmartClient.MORKSM.BK.PLC\BPASmartClient.PLC.csproj", "{7F04A788-38B5-42CB-B601-70C657C953B8}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkF", "BPASmartClient.MorkF\BPASmartClient.MorkF.csproj", "{15FD3FF1-80F1-4274-945A-BA5EBA35999E}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
Debug|Any CPU = Debug|Any CPU | |||
@@ -188,6 +190,10 @@ Global | |||
{7F04A788-38B5-42CB-B601-70C657C953B8}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{7F04A788-38B5-42CB-B601-70C657C953B8}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{7F04A788-38B5-42CB-B601-70C657C953B8}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{15FD3FF1-80F1-4274-945A-BA5EBA35999E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{15FD3FF1-80F1-4274-945A-BA5EBA35999E}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{15FD3FF1-80F1-4274-945A-BA5EBA35999E}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{15FD3FF1-80F1-4274-945A-BA5EBA35999E}.Release|Any CPU.Build.0 = Release|Any CPU | |||
EndGlobalSection | |||
GlobalSection(SolutionProperties) = preSolution | |||
HideSolutionNode = FALSE | |||
@@ -220,6 +226,7 @@ Global | |||
{CB1BC55F-D267-4724-89BE-96E3A5E432A6} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||
{3A55F68A-D526-4CFC-A5A6-B69FB76716C2} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} | |||
{7F04A788-38B5-42CB-B601-70C657C953B8} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} | |||
{15FD3FF1-80F1-4274-945A-BA5EBA35999E} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | |||
EndGlobalSection | |||
GlobalSection(ExtensibilityGlobals) = postSolution | |||
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | |||