@@ -171,10 +171,6 @@ | |||||
<None Remove="Image\黑菠萝科技.png" /> | <None Remove="Image\黑菠萝科技.png" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | |||||
<Page Remove="Properties\App.xaml" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | <ItemGroup> | ||||
<Resource Include="Image\btn_close.png" /> | <Resource Include="Image\btn_close.png" /> | ||||
<Resource Include="Image\ComboBoxPopSelect.png" /> | <Resource Include="Image\ComboBoxPopSelect.png" /> | ||||
@@ -148,6 +148,7 @@ namespace BPASmartClient.DRCoffee | |||||
lastRefreshTime = DateTime.Now; | lastRefreshTime = DateTime.Now; | ||||
IsConnected = OnLine; | IsConnected = OnLine; | ||||
status["CoffeConnected"] = OnLine; | |||||
new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId }.Publish(); | new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId }.Publish(); | ||||
} | } | ||||
else status["Status"] = package.Status; | else status["Status"] = package.Status; | ||||
@@ -88,12 +88,6 @@ namespace BPASmartClient.GSIceCream | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | ThreadManage.GetInstance().StartLong(new Action(() => | ||||
{ | { | ||||
status["test"] = 0; | |||||
for (int i = 0; i < 1000; i++) | |||||
{ | |||||
status["test"] = (int)status["test"] + 1; | |||||
Thread.Sleep(1000); | |||||
} | |||||
ResolveMsg(); | ResolveMsg(); | ||||
}), "冰淇淋解析线程"); | }), "冰淇淋解析线程"); | ||||
} | } | ||||
@@ -183,6 +177,7 @@ namespace BPASmartClient.GSIceCream | |||||
private void ProcessHeart(ICMSG_Heart_UP heartUpMsg) | private void ProcessHeart(ICMSG_Heart_UP heartUpMsg) | ||||
{ | { | ||||
IsConnected = OnLine; | IsConnected = OnLine; | ||||
status["IceCreamIsConnected"] = OnLine; | |||||
status["CurrentMode"] = heartUpMsg.MS; | status["CurrentMode"] = heartUpMsg.MS; | ||||
status["YLWD"] = BitConverter.ToInt16(new byte[] { heartUpMsg.YLWD_L,heartUpMsg.YLWD_H },0); | status["YLWD"] = BitConverter.ToInt16(new byte[] { heartUpMsg.YLWD_L,heartUpMsg.YLWD_H },0); | ||||
status["HQWD"] = BitConverter.ToInt16(new byte[] { heartUpMsg.HQWD_L,heartUpMsg.HQWD_H },0); | status["HQWD"] = BitConverter.ToInt16(new byte[] { heartUpMsg.HQWD_L,heartUpMsg.HQWD_H },0); | ||||
@@ -35,14 +35,24 @@ namespace BPASmartClient.IoT | |||||
public DataVClient() | public DataVClient() | ||||
{ | { | ||||
DataVApiAddress = InternetInfo.DataVApiAddress; | DataVApiAddress = InternetInfo.DataVApiAddress; | ||||
//DataVApiAddress = System.Configuration.ConfigurationManager.AppSettings["DataVServiceUri"].ToString(); | |||||
ClientId = System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); | ClientId = System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); | ||||
DeviceName = System.Configuration.ConfigurationManager.AppSettings["DeviceName"].ToString(); | DeviceName = System.Configuration.ConfigurationManager.AppSettings["DeviceName"].ToString(); | ||||
ProductKey = System.Configuration.ConfigurationManager.AppSettings["ProductKey"].ToString(); | ProductKey = System.Configuration.ConfigurationManager.AppSettings["ProductKey"].ToString(); | ||||
DeviceSecret = System.Configuration.ConfigurationManager.AppSettings["DeviceSecret"].ToString(); | DeviceSecret = System.Configuration.ConfigurationManager.AppSettings["DeviceSecret"].ToString(); | ||||
StartupMode = System.Configuration.ConfigurationManager.AppSettings["StartupMode"].ToString(); | StartupMode = System.Configuration.ConfigurationManager.AppSettings["StartupMode"].ToString(); | ||||
BroadcastPubTopic = InternetInfo.BroadcastPubTopic; | BroadcastPubTopic = InternetInfo.BroadcastPubTopic; | ||||
//BroadcastPubTopic = System.Configuration.ConfigurationManager.AppSettings["BroadcastPubTopic"].ToString(); | |||||
//MaintainTable maintainTable = new MaintainTable(); | |||||
//maintainTable.Id = Guid.NewGuid().ToString(); | |||||
//maintainTable.MaintainTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | |||||
//maintainTable.MaintainType = "一般"; | |||||
//maintainTable.MaintainVla = "MorkS"; | |||||
//maintainTable.MaintainMessage = "xxxxx故障需要维修"; | |||||
//maintainTable.DeviceId = ""; | |||||
//maintainTable.ClientId = ClientId; | |||||
//maintainTable.devicename = DeviceDataV.deviceTable.devicename; | |||||
//maintainTables.Add(maintainTable); | |||||
} | } | ||||
#endregion | #endregion | ||||
@@ -72,6 +82,10 @@ namespace BPASmartClient.IoT | |||||
/// key值 | /// key值 | ||||
/// </summary> | /// </summary> | ||||
public Dictionary<string, string> keyValues = new Dictionary<string, string>(); | public Dictionary<string, string> keyValues = new Dictionary<string, string>(); | ||||
/// <summary> | |||||
/// 维保通知 | |||||
/// </summary> | |||||
public List<MaintainTable> maintainTables = new List<MaintainTable>(); | |||||
#endregion | #endregion | ||||
#region API调用 | #region API调用 | ||||
@@ -97,6 +111,34 @@ namespace BPASmartClient.IoT | |||||
} | } | ||||
return alarmTable.KeyID; | return alarmTable.KeyID; | ||||
} | } | ||||
/// <summary> | |||||
/// 增加维保信息 | |||||
/// </summary> | |||||
/// <param name="maintainTable"></param> | |||||
/// <returns></returns> | |||||
public string HttpAddMaintain(MaintainTable maintainTable) | |||||
{ | |||||
try | |||||
{ | |||||
if (DeviceDataV != null && DeviceDataV.GetIsConnected() && DeviceDataV.deviceTable != null) | |||||
{ | |||||
maintainTable.Id=Guid.NewGuid().ToString(); | |||||
//maintainTable.MaintainTime = DateTime.Now.ToString(); | |||||
//maintainTable.MaintainType = "一般"; | |||||
//maintainTable.MaintainVla = "MorkS"; | |||||
//maintainTable.MaintainMessage = "xxxxx故障需要维修"; | |||||
//maintainTable.DeviceId = ""; | |||||
maintainTable.ClientId = ClientId; | |||||
maintainTable.devicename = DeviceDataV.deviceTable.devicename; | |||||
maintainTables.Add(maintainTable); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
MessageLog.GetInstance.Show(ex.Message); | |||||
} | |||||
return maintainTable.KeyID; | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 增加日志信息 | /// 增加日志信息 | ||||
@@ -159,6 +201,7 @@ namespace BPASmartClient.IoT | |||||
if (DeviceDataV.InitializeNo(ProductKey, DeviceName, DeviceSecret, ref message)) | if (DeviceDataV.InitializeNo(ProductKey, DeviceName, DeviceSecret, ref message)) | ||||
{ | { | ||||
MessageLog.GetInstance.Show($"客户端:【{ClientId}】,设备名称{DeviceName}阿里云连接成功"); | MessageLog.GetInstance.Show($"客户端:【{ClientId}】,设备名称{DeviceName}阿里云连接成功"); | ||||
DeviceDataV.DataVMessageAction += DevIOTActionHandler; | |||||
UpDataFile(); | UpDataFile(); | ||||
} | } | ||||
else | else | ||||
@@ -207,6 +250,10 @@ namespace BPASmartClient.IoT | |||||
}); | }); | ||||
if (dataVNode.Count > 0) | if (dataVNode.Count > 0) | ||||
{ | { | ||||
if (maintainTables.Count > 0) | |||||
{ | |||||
iOTDevSXModel.Maintain = Tools.JsonConvertTools(maintainTables); | |||||
} | |||||
iOTDevSXModel.NodeStatus = Tools.JsonConvertTools(new { data = dataVNode }); | iOTDevSXModel.NodeStatus = Tools.JsonConvertTools(new { data = dataVNode }); | ||||
DeviceDataV.IOT_Publish(DeviceDataV.PubTopic, iOTDevSXModel.Tojson()); | DeviceDataV.IOT_Publish(DeviceDataV.PubTopic, iOTDevSXModel.Tojson()); | ||||
} | } | ||||
@@ -253,7 +300,6 @@ namespace BPASmartClient.IoT | |||||
}); | }); | ||||
keyValues[GetPropertyValue(obj, "Time").ToString() + GetPropertyValue(obj, "Type").ToString() + GetPropertyValue(obj, "Text").ToString()] = id; | keyValues[GetPropertyValue(obj, "Time").ToString() + GetPropertyValue(obj, "Type").ToString() + GetPropertyValue(obj, "Text").ToString()] = id; | ||||
//MessageLog.GetInstance.AddDeviceAlarmLogShow(GetPropertyValue(obj, "Time").ToString() + GetPropertyValue(obj, "Type").ToString() + GetPropertyValue(obj, "Text").ToString(),id); | //MessageLog.GetInstance.AddDeviceAlarmLogShow(GetPropertyValue(obj, "Time").ToString() + GetPropertyValue(obj, "Type").ToString() + GetPropertyValue(obj, "Text").ToString(),id); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -276,7 +322,6 @@ namespace BPASmartClient.IoT | |||||
State = "n" | State = "n" | ||||
}); | }); | ||||
//MessageLog.GetInstance.DeleteDeviceAlarmLogShow(message, keyValues[message]); | //MessageLog.GetInstance.DeleteDeviceAlarmLogShow(message, keyValues[message]); | ||||
} | } | ||||
} | } | ||||
@@ -75,6 +75,9 @@ namespace BPASmartDatavDeviceClient.IoT | |||||
return false; | return false; | ||||
} | } | ||||
IOT_Subscribe(BroadcastTopic);//订阅广播主题 | IOT_Subscribe(BroadcastTopic);//订阅广播主题 | ||||
IOT_Subscribe(FileUpLoadReplyTopic); | |||||
IOT_Subscribe(FileUpLoadSendReplyTopic); | |||||
IOT_Subscribe(CancelFileUpLoadSendTopic); | |||||
if (!DatavDeviceClient.IsConnected) message += $"客户端:【】,设备名称{deviceTable.devicename}阿里云连接失败.不能上报业务信息"; | if (!DatavDeviceClient.IsConnected) message += $"客户端:【】,设备名称{deviceTable.devicename}阿里云连接失败.不能上报业务信息"; | ||||
return DatavDeviceClient.IsConnected; | return DatavDeviceClient.IsConnected; | ||||
} | } | ||||
@@ -82,10 +82,10 @@ namespace DataVAPI.Tool.IOT | |||||
/// 节点状态 | /// 节点状态 | ||||
/// </summary> | /// </summary> | ||||
public string NodeStatus { get; set; } | public string NodeStatus { get; set; } | ||||
///// <summary> | |||||
///// 运行日志 | |||||
///// </summary> | |||||
//public string SZXX { get; set; } | |||||
/// <summary> | |||||
/// 维修保护 | |||||
/// </summary> | |||||
public string Maintain { get; set; } | |||||
///// <summary> | ///// <summary> | ||||
///// 运行告警 | ///// 运行告警 | ||||
///// </summary> | ///// </summary> | ||||
@@ -0,0 +1,43 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.IoT.Model | |||||
{ | |||||
/// <summary> | |||||
/// 维保 | |||||
/// </summary> | |||||
public class MaintainTable : BaseEntity | |||||
{ | |||||
/// <summary> | |||||
/// 维修时间 | |||||
/// </summary> | |||||
public string MaintainTime { get; set; } | |||||
/// <summary> | |||||
/// 维修类型:1 轻微 2:一般 3 严重 | |||||
/// </summary> | |||||
public string MaintainType { get; set; } | |||||
/// <summary> | |||||
/// 维修消息 | |||||
/// </summary> | |||||
public string MaintainMessage { get; set; } | |||||
/// <summary> | |||||
/// 维修值 | |||||
/// </summary> | |||||
public string MaintainVla { get; set; } | |||||
/// <summary> | |||||
/// IP 地址 | |||||
/// </summary> | |||||
public string IP { get; set; } | |||||
/// <summary> | |||||
/// 状态描述 | |||||
/// </summary> | |||||
public string StatusMS { get; set; } | |||||
/// <summary> | |||||
/// 状态颜色 | |||||
/// </summary> | |||||
public object StatusColor { get; set; } | |||||
} | |||||
} |
@@ -45,6 +45,7 @@ namespace BPASmartClient.Lebai | |||||
ThreadManage.GetInstance().StartLong(() => | ThreadManage.GetInstance().StartLong(() => | ||||
{ | { | ||||
IsConnected = LebaiHelper.GetInstance().IsConnected; | IsConnected = LebaiHelper.GetInstance().IsConnected; | ||||
status["RobotIsConnected"] = LebaiHelper.GetInstance().IsConnected; | |||||
status["OK"] = LebaiHelper.GetInstance().GetValueAsync().Ok; | status["OK"] = LebaiHelper.GetInstance().GetValueAsync().Ok; | ||||
status["Value"] = LebaiHelper.GetInstance().GetValueAsync().Value; | status["Value"] = LebaiHelper.GetInstance().GetValueAsync().Value; | ||||
if (LebaiHelper.GetInstance().robotData != null) status["RobotMode"] = LebaiHelper.GetInstance().robotData.RobotMode.Mode; | if (LebaiHelper.GetInstance().robotData != null) status["RobotMode"] = LebaiHelper.GetInstance().robotData.RobotMode.Mode; | ||||
@@ -40,11 +40,7 @@ namespace BPASmartClient.MorkT | |||||
morkT.MakeCoffeeOrder.OrderStatus = 1; | morkT.MakeCoffeeOrder.OrderStatus = 1; | ||||
}); | }); | ||||
int i = 0; | int i = 0; | ||||
////ThreadManage.GetInstance().StartLong(new Action(() => | |||||
////{ | |||||
//// i = (int)Status.status["GSIceCream.IceCreamMachine.test"]; | |||||
////}),"test"); | |||||
MessageLog.GetInstance.Show("MORKT 设备初始化完成"); | MessageLog.GetInstance.Show("MORKT 设备初始化完成"); | ||||
@@ -71,16 +67,6 @@ namespace BPASmartClient.MorkT | |||||
public override void MainTask() | public override void MainTask() | ||||
{ | { | ||||
GetStatus("RobotMode", new Action<object>((o) => | |||||
{ | |||||
})); | |||||
MakeCoffeeProcess(); | MakeCoffeeProcess(); | ||||
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 },(o)=> | EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 },(o)=> | ||||
{ | { | ||||
@@ -98,7 +84,10 @@ namespace BPASmartClient.MorkT | |||||
public override void ReadData() | public override void ReadData() | ||||
{ | { | ||||
GetStatus("IsConnected", new Action<object>((o) => | |||||
{ | |||||
})); | |||||
} | } | ||||
@@ -223,7 +212,7 @@ namespace BPASmartClient.MorkT | |||||
private void Wait(int value = 101) | private void Wait(int value = 101) | ||||
{ | { | ||||
while (!((bool)Status.status["Lebai.LebaiRobot.OK"] && (int)Status.status["Lebai.LebaiRobot.Value"] == value)) | |||||
while (!((bool)peripheralStatus["OK"] && (int)peripheralStatus["Value"] == value)) | |||||
{ | { | ||||
Thread.Sleep(5); | Thread.Sleep(5); | ||||
} | } | ||||
@@ -364,14 +353,14 @@ namespace BPASmartClient.MorkT | |||||
{ | { | ||||
if (IceCreamCanMake()) | if (IceCreamCanMake()) | ||||
{ | { | ||||
if(Status.status.ContainsKey("GSIceCream.IceCreamMachine.CurrentMode")) | |||||
if(peripheralStatus.ContainsKey("CurrentMode")) | |||||
{ | { | ||||
if ((MORKI_MODE)Status.status["GSIceCream.IceCreamMachine.CurrentMode"] != MORKI_MODE.制冷模式) new GSIceCream_ModeSetEvent() { Mode = MORKI_MODE.制冷模式 }.Publish(); | |||||
if ((MORKI_MODE)peripheralStatus["CurrentMode"] != MORKI_MODE.制冷模式) new GSIceCream_ModeSetEvent() { Mode = MORKI_MODE.制冷模式 }.Publish(); | |||||
} | } | ||||
if(Status.status.ContainsKey("GSIceCream.IceCreamMachine.CBX")) | |||||
if(peripheralStatus.ContainsKey(".CBX")) | |||||
{ | { | ||||
if ((short)Status.status["GSIceCream.IceCreamMachine.CBX"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作 | |||||
if ((short)peripheralStatus["CBX"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作 | |||||
{ | { | ||||
bool result = true; | bool result = true; | ||||
EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => | EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => | ||||
@@ -491,7 +480,7 @@ namespace BPASmartClient.MorkT | |||||
{ | { | ||||
int count_1 = 0; | int count_1 = 0; | ||||
while ((short)Status.status["GSIceCream.IceCreamMachine.CBX"] <= 86) | |||||
while ((short)peripheralStatus["CBX"] <= 86) | |||||
{ | { | ||||
Thread.Sleep(5); | Thread.Sleep(5); | ||||
count_1++; | count_1++; | ||||
@@ -1,4 +1,8 @@ | |||||
using BPASmartClient.Device; | using BPASmartClient.Device; | ||||
using BPASmartClient.DRCoffee; | |||||
using BPASmartClient.GSIceCream; | |||||
using BPASmartClient.LebaiRobot; | |||||
using BPASmartClient.Model.冰淇淋.Enum; | |||||
using Robotc; | using Robotc; | ||||
using System; | using System; | ||||
using System.Collections.Concurrent; | using System.Collections.Concurrent; | ||||
@@ -40,5 +44,60 @@ namespace BPASmartClient.MorkT | |||||
/// 冰淇淋机器出料口传感器检测 | /// 冰淇淋机器出料口传感器检测 | ||||
/// </summary> | /// </summary> | ||||
public bool IceIsOK = true; | public bool IceIsOK = true; | ||||
#region | |||||
[VariableMonitor("机器人连接状态")] | |||||
public bool RobotIsConnected; | |||||
[VariableMonitor("机器人状态")] | |||||
public ELebaiRModel RobotMode; | |||||
[VariableMonitor("冰淇淋连接状态")] | |||||
public bool IceCreamIsConnected; | |||||
[VariableMonitor("冰淇淋机器预冷温度")] | |||||
public short YLWD; | |||||
[VariableMonitor("冰淇淋机器回气温度")] | |||||
public short HQWD; | |||||
[VariableMonitor("冰淇淋机器环境温度")] | |||||
public short HJWD; | |||||
[VariableMonitor("冰淇淋机器电流")] | |||||
public short DL; | |||||
[VariableMonitor("冰淇淋机器电压")] | |||||
public bool DY; | |||||
[VariableMonitor("冰淇淋机器成型比")] | |||||
public byte CBX; | |||||
[VariableMonitor("冰淇淋机器模式")] | |||||
public MORKI_MODE IceCreamMode; | |||||
[VariableMonitor("冰淇淋机器故障")] | |||||
public MORKI_FAULT IceCreamFault; | |||||
[VariableMonitor("冰淇淋机器打料是否完成")] | |||||
public bool DLCompleted; | |||||
[VariableMonitor("咖啡机连接状态")] | |||||
public bool CoffeeIsConnected; | |||||
[VariableMonitor("咖啡机状态")] | |||||
public DrCoffeeStatus DrCoffeeStatus; | |||||
[VariableMonitor("咖啡机应用状态")] | |||||
public DrCoffeeAppStatus CoffeeAppStatus; | |||||
[VariableMonitor("咖啡机告警")] | |||||
public DrCoffeeWarning CoffeeWarning; | |||||
[VariableMonitor("咖啡机故障")] | |||||
public DrCoffeeFault CaffeeFault; | |||||
#endregion | |||||
} | } | ||||
} | } |
@@ -22,8 +22,8 @@ | |||||
<!--LOCAL:直接使用下方本地“设备连接信息”--> | <!--LOCAL:直接使用下方本地“设备连接信息”--> | ||||
<add key="StartupMode" value="API"/> | <add key="StartupMode" value="API"/> | ||||
<add key="ProductKey" value="grgpECHSL7q"/> | <add key="ProductKey" value="grgpECHSL7q"/> | ||||
<add key="DeviceName" value="qsqd"/> | |||||
<add key="DeviceSecret" value="3c0f2390943bff4fece523af22655196"/> | |||||
<add key="DeviceName" value="qsqdzklb"/> | |||||
<add key="DeviceSecret" value="e2b300892c3e21469c8dc6c7c5c4430d"/> | |||||
<add key="PasswordBox" value="6WrKhYmTIhLV7g24jIH/lg=="/> | <add key="PasswordBox" value="6WrKhYmTIhLV7g24jIH/lg=="/> | ||||