|
|
@@ -99,33 +99,48 @@ namespace HBLConsole.Business |
|
|
|
new DevSXBase { SXMC="设备软件",SXLX="上位机",SXStatus=true } |
|
|
|
} |
|
|
|
}); |
|
|
|
bool IsAllowRun = GetTypeValue<bool>("AllowRun"); |
|
|
|
bool TemperatureReached = GetTypeValue<bool>("TemperatureReached"); |
|
|
|
bool MissingBowl = GetTypeValue<bool>("MissingBowl"); |
|
|
|
bool MissingBowlSignal2 = GetTypeValue<bool>("MissingBowlSignal2"); |
|
|
|
bool IsNoodles = GetTypeValue<bool>("IsNoodles");//转台 |
|
|
|
bool AllowFallNoodle = GetTypeValue<bool>("AllowFallNoodle");//是否允许到面 |
|
|
|
bool[] CookNoodlesComplete = GetTypeValue<bool[]>("CookNoodlesComplete");//煮面完成上升信号 |
|
|
|
bool isCookNoodles = CookNoodlesComplete.ToList().Find(o => o); |
|
|
|
//设置扩展属性与状态,连接上机器人后才会处罚 |
|
|
|
if (IsAllowRun) |
|
|
|
switch (GeneralConfig.DeviceType) |
|
|
|
{ |
|
|
|
kzsx = Tools.JsonConvertTools<DevSX>(new DevSX |
|
|
|
{ |
|
|
|
data = new List<DevSXBase> |
|
|
|
case BPA.Message.Enum.DeviceClientType.MORKD: |
|
|
|
break; |
|
|
|
case BPA.Message.Enum.DeviceClientType.MORKS: |
|
|
|
bool IsAllowRun = GetTypeValue<bool>("AllowRun"); |
|
|
|
bool TemperatureReached = GetTypeValue<bool>("TemperatureReached"); |
|
|
|
bool MissingBowl = GetTypeValue<bool>("MissingBowl"); |
|
|
|
bool MissingBowlSignal2 = GetTypeValue<bool>("MissingBowlSignal2"); |
|
|
|
bool IsNoodles = GetTypeValue<bool>("IsNoodles");//转台 |
|
|
|
bool AllowFallNoodle = GetTypeValue<bool>("AllowFallNoodle");//是否允许到面 |
|
|
|
bool[] CookNoodlesComplete = GetTypeValue<bool[]>("CookNoodlesComplete");//煮面完成上升信号 |
|
|
|
bool isCookNoodles = CookNoodlesComplete.ToList().Find(o => o); |
|
|
|
//设置扩展属性与状态,连接上机器人后才会处罚 |
|
|
|
if (IsAllowRun) |
|
|
|
{ |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="煮面炉",SXStatus= !TemperatureReached , |
|
|
|
SXYCMS=!TemperatureReached?"":DateTime.Now+" 异常,煮面炉温度不够,疑似正在加热或者未工作...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="装小碗结构",SXStatus=MissingBowl , |
|
|
|
SXYCMS=MissingBowl?"":DateTime.Now+" 异常,缺小碗...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="装大碗结构",SXStatus=MissingBowlSignal2 , |
|
|
|
SXYCMS=MissingBowlSignal2?"":DateTime.Now+" 异常,缺大碗...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="取面转台",SXStatus=IsNoodles , |
|
|
|
SXYCMS=IsNoodles?"":DateTime.Now+" 异常,转台位置缺少物料...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="配料机",SXStatus=!(!AllowFallNoodle && isCookNoodles) , |
|
|
|
SXYCMS=!((!AllowFallNoodle && isCookNoodles))?"":DateTime.Now+" 异常,配料机未配完料,疑似碗未到配料机下方或者配料机未工作...."} |
|
|
|
kzsx = Tools.JsonConvertTools<DevSX>(new DevSX |
|
|
|
{ |
|
|
|
data = new List<DevSXBase> |
|
|
|
{ |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="煮面炉",SXStatus= !TemperatureReached , |
|
|
|
SXYCMS=!TemperatureReached?"":DateTime.Now+" 异常,煮面炉温度不够,疑似正在加热或者未工作...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="装小碗结构",SXStatus=MissingBowl , |
|
|
|
SXYCMS=MissingBowl?"":DateTime.Now+" 异常,缺小碗...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="装大碗结构",SXStatus=MissingBowlSignal2 , |
|
|
|
SXYCMS=MissingBowlSignal2?"":DateTime.Now+" 异常,缺大碗...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="取面转台",SXStatus=IsNoodles , |
|
|
|
SXYCMS=IsNoodles?"":DateTime.Now+" 异常,转台位置缺少物料...."}, |
|
|
|
new DevSXBase { SXMC="设备硬件",SXLX="配料机",SXStatus=!(!AllowFallNoodle && isCookNoodles) , |
|
|
|
SXYCMS=!((!AllowFallNoodle && isCookNoodles))?"":DateTime.Now+" 异常,配料机未配完料,疑似碗未到配料机下方或者配料机未工作...."} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
break; |
|
|
|
case BPA.Message.Enum.DeviceClientType.MORKI: |
|
|
|
break; |
|
|
|
case BPA.Message.Enum.DeviceClientType.MORKC: |
|
|
|
break; |
|
|
|
case BPA.Message.Enum.DeviceClientType.MORKIC: |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
string jsonstr = Tools.JsonConvertTools<IotModel<TargetIOT>>(new IotModel<TargetIOT> { @params = new TargetIOT { JBSX = jbsx,KZSX = kzsx } }); |
|
|
|
IOTDevServer.GetInstance().IOT_Publish(IOTDevServer.PubTopic,jsonstr); |
|
|
@@ -185,7 +200,7 @@ namespace HBLConsole.Business |
|
|
|
/// </summary> |
|
|
|
private T GetTypeValue<T>(string str) |
|
|
|
{ |
|
|
|
return (T)SimpleFactory.GetInstance.GVL?.GetType().GetProperty(str).GetValue(SimpleFactory.GetInstance.GVL,null); |
|
|
|
return (T)SimpleFactory.GetInstance.GVL?.GetType().GetProperty(str)?.GetValue(SimpleFactory.GetInstance.GVL,null); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|