Quellcode durchsuchen

西门子协议修改

master
pry vor 2 Jahren
Ursprung
Commit
06a4efb0d9
3 geänderte Dateien mit 14 neuen und 8 gelöschten Zeilen
  1. +7
    -6
      BPASmartClient.MorkS/Control_Morks.cs
  2. +6
    -2
      BPASmartClient.MorkS/DataServer.cs
  3. +1
    -0
      BPASmartClient.S7Net/EntityClassResolution.cs

+ 7
- 6
BPASmartClient.MorkS/Control_Morks.cs Datei anzeigen

@@ -34,13 +34,11 @@ namespace BPASmartClient.MorkS

public override void DoMain()
{


MonitorViewModel.DeviceId = DeviceId;
ServerInit();
DataParse();

Json<MorksPar>.Read();
Json<OrderStatistics>.Read();
if (Json<MorksPar>.Data.parSets == null) Json<MorksPar>.Data.parSets = new ObservableCollection<ParSet>();
if (Json<MorksPar>.Data.parSets.Count < 6)
{
@@ -273,8 +271,11 @@ namespace BPASmartClient.MorkS
if (order.MorkOrder.GoodBatchings == null) return;
if (mORKS.HistorySuborderId.Contains(order.MorkOrder.SuborderId)) return;
OrderCount++;
Json<OrderStatistics>.Data.StatisticsTime=DateTime.Now;
if (DateTime.Now.Subtract(Json<OrderStatistics>.Data.StatisticsTime).Days != 0)
Json<OrderStatistics>.Data.Count = 0;
Json<OrderStatistics>.Data.StatisticsTime = DateTime.Now;
Json<OrderStatistics>.Data.Count++;
Json<OrderStatistics>.Save();
OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT);
DeviceProcessLogShow($"接收到{OrderCount}次订单,订单ID:{order.MorkOrder.SuborderId}");
mORKS.HistorySuborderId.Add(order.MorkOrder.SuborderId);
@@ -600,7 +601,7 @@ namespace BPASmartClient.MorkS
}

//取餐完成逻辑处理
if (Delay.GetInstance("CompleteChange1").Start( !mORKS.TakeMealDetect, 1)&&mORKS.CookCompleteFlatBit == true)
if (Delay.GetInstance("CompleteChange1").Start(!mORKS.TakeMealDetect, 1) && mORKS.CookCompleteFlatBit == true)
{
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
@@ -814,7 +815,7 @@ namespace BPASmartClient.MorkS
mORKS.TakeBowlTask.Enqueue(new OrderLocInfo() { Loc = (ushort)msm.Bowloc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加订单:碗位置【{(ushort)msm.Bowloc}】");
}
}
});
}


+ 6
- 2
BPASmartClient.MorkS/DataServer.cs Datei anzeigen

@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using BPA.Helper;
using BPASmartClient.MQTT;
using BPA.Message;
using BPASmartClient.Model;

namespace BPASmartClient.MorkS
{
@@ -17,15 +18,18 @@ namespace BPASmartClient.MorkS
public static DataServer GetInstance => _Instance ?? (_Instance = new DataServer());
private DataServer() { }

public ScreenModelMorkS morkS { get; set; } = new ScreenModelMorkS();

public void Init()
{
MQTTProxy mQTTProxy = new MQTTProxy();
mQTTProxy.Connected = new Action(() =>
{
mQTTProxy.Subscrib("");
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机));
ThreadManage.GetInstance().StartLong(new Action(() =>
{
mQTTProxy.Publish("", "");
morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count;
mQTTProxy.Publish(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机), morkS.ToJSON());
Thread.Sleep(100);
}), "海科食堂大屏监听");
});


+ 1
- 0
BPASmartClient.S7Net/EntityClassResolution.cs Datei anzeigen

@@ -57,6 +57,7 @@ namespace BPASmartClient.S7Net
default:
numBytes = GetClassSize(Activator.CreateInstance(type), numBytes, isInnerProperty: true);
if (type.IsClass) IncrementToEven(ref numBytes);
else if (!type.IsPrimitive && !type.IsEnum && type.IsValueType) IncrementToEven(ref numBytes);
break;
}



Laden…
Abbrechen
Speichern