@@ -137,19 +137,19 @@ namespace BPASmartClient.DRCoffee | |||||
/// <param name="package"></param> | /// <param name="package"></param> | ||||
public void ProcessPackage(DrCoffeePackage package) | public void ProcessPackage(DrCoffeePackage package) | ||||
{ | { | ||||
if (((DrCoffeeStatus)status["CoffeeStatus"]) == DrCoffeeStatus.Running && package.Status != DrCoffeeStatus.Running) | |||||
if (((DrCoffeeStatus)status["Status"]) == DrCoffeeStatus.Running && package.Status != DrCoffeeStatus.Running) | |||||
{ | { | ||||
status["CoffeeStatus"] = package.Status; | |||||
status["Status"] = package.Status; | |||||
lastRefreshTime = DateTime.Now; | lastRefreshTime = DateTime.Now; | ||||
new DRCoffee_CoffeEndCookEvent() { Id = DeviceId }.Publish(); | new DRCoffee_CoffeEndCookEvent() { Id = DeviceId }.Publish(); | ||||
} | } | ||||
else status["CoffeeStatus"] = package.Status; | |||||
else status["Status"] = package.Status; | |||||
status["AppStatus"] = package.ApplicationStatus; | status["AppStatus"] = package.ApplicationStatus; | ||||
status["Warning"] = package.Warning; | status["Warning"] = package.Warning; | ||||
status["Fault"] = package.Fault; | status["Fault"] = package.Fault; | ||||
if ((DrCoffeeStatus)status["CoffeeStatus"] == DrCoffeeStatus.Warning | |||||
|| (DrCoffeeStatus)status["CoffeeStatus"] == DrCoffeeStatus.Fault | |||||
if ((DrCoffeeStatus)status["Status"] == DrCoffeeStatus.Warning | |||||
|| (DrCoffeeStatus)status["Status"] == DrCoffeeStatus.Fault | |||||
|| (DrCoffeeWarning)status["Warning"] != DrCoffeeWarning.无警告 | || (DrCoffeeWarning)status["Warning"] != DrCoffeeWarning.无警告 | ||||
|| (DrCoffeeFault)status["Fault"] != DrCoffeeFault.无故障 | || (DrCoffeeFault)status["Fault"] != DrCoffeeFault.无故障 | ||||
) | ) | ||||
@@ -162,7 +162,7 @@ namespace BPASmartClient.DRCoffee | |||||
protected override void InitStatus() | protected override void InitStatus() | ||||
{ | { | ||||
status["CoffeeStatus"] = DrCoffeeStatus.Wait; | |||||
status["Status"] = DrCoffeeStatus.Wait; | |||||
status["AppStatus"] = DrCoffeeAppStatus.应用无状态; | status["AppStatus"] = DrCoffeeAppStatus.应用无状态; | ||||
status["Warning"] = DrCoffeeWarning.无警告; | status["Warning"] = DrCoffeeWarning.无警告; | ||||
status["Fault"] = DrCoffeeFault.无故障; | status["Fault"] = DrCoffeeFault.无故障; | ||||
@@ -144,7 +144,8 @@ namespace BPASmartClient.Device | |||||
foreach (var key in peripheral.GetAllStatus().Keys) | foreach (var key in peripheral.GetAllStatus().Keys) | ||||
{ | { | ||||
peripheralStatus[key] = peripheral.GetAllStatus()[key]; | peripheralStatus[key] = peripheral.GetAllStatus()[key]; | ||||
Status.Update($"{TypeName}.{key}", peripheral.GetAllStatus()[key]); | |||||
if(TypeName!= "PLC.MorksMachine") | |||||
Status.Update($"{TypeName}.{key}", peripheral.GetAllStatus()[key]); | |||||
} | } | ||||
} | } | ||||
Thread.Sleep(100); | Thread.Sleep(100); | ||||
@@ -31,10 +31,15 @@ namespace BPASmartClient.Device | |||||
{"False","异常" }, | {"False","异常" }, | ||||
{"True","正常" }, | {"True","正常" }, | ||||
{"CoffeeStatus","咖啡机状态" }, | |||||
{"AppStatus","咖啡机应用状态" }, | |||||
{"Warning","咖啡机告警" }, | |||||
{"Fault","咖啡机故障" } | |||||
{"Status","状态" }, | |||||
{"AppStatus","应用状态" }, | |||||
{"Warning","告警" }, | |||||
{"Fault","故障" }, | |||||
{"drinkType","饮品类型" }, | |||||
{"taskIndex","任务序号" }, | |||||
{"Keep","维修保护" }, | |||||
{"progress","工作进度" } | |||||
}; | }; | ||||
@@ -139,12 +139,12 @@ namespace BPASmartClient.KLMCoffee | |||||
SystemStatusModel systemStatus = new K95Command().StateResolution(data); | SystemStatusModel systemStatus = new K95Command().StateResolution(data); | ||||
if (systemStatus != null) | if (systemStatus != null) | ||||
{ | { | ||||
status["temStatus"] = systemStatus.temStatus; | |||||
status["Status"] = systemStatus.temStatus; | |||||
status["drinkType"] = systemStatus.drinkType; | status["drinkType"] = systemStatus.drinkType; | ||||
status["taskIndex"] = systemStatus.taskIndex; | |||||
status["AppStatus"] = systemStatus.taskIndex; | |||||
status["progress"] = systemStatus.progress; | status["progress"] = systemStatus.progress; | ||||
status["faultMessage"] = systemStatus.faultMessage; | |||||
status["upkeepMessage"] = systemStatus.upkeepMessage; | |||||
status["Warning"] = systemStatus.faultMessage.dataFault(); | |||||
status["Keep"] = systemStatus.upkeepMessage; | |||||
if (systemStatus.faultMessage.IsFault() || systemStatus.upkeepMessage.IsUpkeep()) | if (systemStatus.faultMessage.IsFault() || systemStatus.upkeepMessage.IsUpkeep()) | ||||
IsWork=false; | IsWork=false; | ||||
else | else | ||||
@@ -160,12 +160,12 @@ namespace BPASmartClient.KLMCoffee | |||||
protected override void InitStatus() | protected override void InitStatus() | ||||
{ | { | ||||
status["temStatus"] = K95SysTemStatus.空闲状态; | |||||
status["Status"] = K95SysTemStatus.空闲状态; | |||||
status["drinkType"] = DrinkType.意式; | status["drinkType"] = DrinkType.意式; | ||||
status["taskIndex"] = TaskIndex.无任务; | |||||
status["AppStatus"] = TaskIndex.无任务; | |||||
status["progress"] = 0; | status["progress"] = 0; | ||||
status["faultMessage"] = new FaultMessage(0x00,0x00); | |||||
status["upkeepMessage"] = new UpkeepMessage(0x00); | |||||
status["Warning"] = new FaultMessage(0x00,0x00).dataFault(); | |||||
status["Keep"] = new UpkeepMessage(0x00).dataFault(); | |||||
} | } | ||||
@@ -104,5 +104,18 @@ namespace BPASmartClient.KLMCoffee.Protocal | |||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
public string dataFault() | |||||
{ | |||||
string message = string.Empty; | |||||
foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties()) | |||||
{ | |||||
if ((bool)info.GetValue(this) == true) | |||||
{ | |||||
message= message +" "+ info.Name; | |||||
} | |||||
} | |||||
return string.IsNullOrEmpty(message)?"无": message; | |||||
} | |||||
} | } | ||||
} | } |
@@ -44,5 +44,18 @@ namespace BPASmartClient.KLMCoffee.Protocal | |||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
public string dataFault() | |||||
{ | |||||
string message = string.Empty; | |||||
foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties()) | |||||
{ | |||||
if ((bool)info.GetValue(this) == true) | |||||
{ | |||||
message = message + " " + info.Name; | |||||
} | |||||
} | |||||
return string.IsNullOrEmpty(message) ? "无" : message; | |||||
} | |||||
} | } | ||||
} | } |