Browse Source

当前更新

煮面机(新)
lyw 4 months ago
parent
commit
472d6f13f7
5 changed files with 70 additions and 13 deletions
  1. +3
    -3
      BPASmartClient.Device/BaseDevice.cs
  2. +56
    -2
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  3. +7
    -7
      BPASmartClient.ViewModel/FoodMenuViewModel.cs
  4. +1
    -1
      BPASmartClient/Control/TimeUi.xaml
  5. +3
    -0
      BPASmartClient/LoginOrderView.xaml.cs

+ 3
- 3
BPASmartClient.Device/BaseDevice.cs View File

@@ -22,7 +22,7 @@ namespace BPASmartClient.Device
/// </summary>
public abstract class BaseDevice : IDevice
{
public Action<bool>? stateAction;
public Action<bool> stateAction;
public BaseDevice()
{
}
@@ -183,12 +183,12 @@ namespace BPASmartClient.Device
TaskManage.GetInstance.StartLong(() =>
{
var res = this.peripherals.FindAll(o => o.IsConnected == true);
if (res.Count > 0&&IsConnected)
if (res.Count > 0&&!IsConnected)
{
IsConnected = true;
stateAction?.Invoke(true);
}
else if (res.Count<=0&&!IsConnected)
else if (res.Count<=0&&IsConnected)
{
IsConnected= false;
stateAction?.Invoke(false);


+ 56
- 2
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs View File

@@ -17,6 +17,7 @@ namespace BPASmartClient.MorkSUpgradedVer
private Alarm alarm = new Alarm();
public override void DoMain()
{
base.IsConnected = false;
base.stateAction = o =>
{
if (o)
@@ -231,7 +232,7 @@ namespace BPASmartClient.MorkSUpgradedVer

private void TempOrderChange(string subid, ORDER_STATUS oRDER_STATUS, Action complete)
{
if (mORKS.doOrderEvents!=null&&mORKS.doOrderEvents.Count>0)
if (mORKS.doOrderEvents!=null&&mORKS.doOrderEvents.Count>0&&!string.IsNullOrEmpty(subid))
{
var res = mORKS.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid);
string goodName = string.Empty;
@@ -605,6 +606,8 @@ namespace BPASmartClient.MorkSUpgradedVer
/// <summary>数据解析</summary>
private void DataParse()
{

EventBus.GetInstance().Subscribe<DoOrderEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle)
{
if (@event == null)
@@ -671,6 +674,57 @@ namespace BPASmartClient.MorkSUpgradedVer
}
}
});
#region 添加网络订单至本地展示
//ActionManage.GetInstance.Register(new Action<object[]>((o) =>
//{
// if (o is object[] obj)
// {
// if (o.Length == 2)
// {
// if (o[0] is MorkOrderPush morkOrderpush && o[1] is IDevice device)
// {
// ObservableCollection<MorkOrder> observableCollection = new ObservableCollection<MorkOrder>();
// MorkOrder morkOrder = new MorkOrder()
// {
// OrderPush = morkOrderpush,
// OrderStatus = ORDER_STATUS.WAIT,
// StartDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
// FoodMenuModel = new FoodMenuModel() { }
// };
// FoodMenuViewModel.orderStatusLists.Add(morkOrder);
// observableCollection.Add(morkOrder);
// Application.Current?.Dispatcher.BeginInvoke((Action)delegate
// {
// int index = Array.FindIndex(Json<KeepDataBase>.Data.orderLists.ToArray(), p => p.DeviceId == device.DeviceId.ToString());
// if (index < 0)
// {
// Json<KeepDataBase>.Data.orderLists.Add(new OrderData()
// {
// DeviceId = device.DeviceId.ToString(),
// IsAllSelect = true,
// morkOrderPushes = observableCollection,

// });
// }
// else
// {
// Json<KeepDataBase>.Data.orderLists.ElementAt(index).morkOrderPushes.Add(morkOrder);
// }

// orderStatusLists.Add(new MorkOrder()
// {
// OrderPush = morkOrderpush,
// OrderStatus = ORDER_STATUS.WAIT,
// StartDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
// });
// });

// }
// }
// }

//}), "AddOrder");
#endregion
}

public override void MainTask()
@@ -679,7 +733,7 @@ namespace BPASmartClient.MorkSUpgradedVer
{
NoodOrderCtrl.GetInstance.StateShow("设备正常运行");
}
if (!mORKS.InitComplete&& NoodOrderCtrl.GetInstance.stateInfo == "设备正常运行")
if (!mORKS.InitComplete)
{
NoodOrderCtrl.GetInstance.StateShow("设备未初始化");
}


+ 7
- 7
BPASmartClient.ViewModel/FoodMenuViewModel.cs View File

@@ -101,7 +101,7 @@ namespace BPASmartClient.ViewModel
{
OrderPush = morkOrderpush,
OrderStatus = ORDER_STATUS.WAIT,
StartDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
StartDate = DateTime.Now.ToString("HH:mm:ss"),
};
observableCollection.Add(morkOrder);
Application.Current?.Dispatcher.BeginInvoke((Action)delegate
@@ -122,17 +122,17 @@ namespace BPASmartClient.ViewModel
Json<KeepDataBase>.Data.orderLists.ElementAt(index).morkOrderPushes.Add(morkOrder);
}

orderStatusLists.Add(new MorkOrder()
orderStatusLists.Insert(0,new MorkOrder()
{
OrderPush = morkOrderpush,
OrderStatus = ORDER_STATUS.WAIT,
StartDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
StartDate = DateTime.Now.ToString("HH:mm:ss"),
});
});
if (orderStatusLists.Count > 0)
{
orderStatusLists[0].OrderStatus = ORDER_STATUS.COOKING;
}
//if (orderStatusLists.Count > 0)
//{
// orderStatusLists[0].OrderStatus = ORDER_STATUS.COOKING;
//}

}
}


+ 1
- 1
BPASmartClient/Control/TimeUi.xaml View File

@@ -72,7 +72,7 @@
</ScrollViewer>
</Border>
<Border Grid.Column="1" Margin="0,0,10,10" BorderBrush="{Binding ElementName=timeText,Path=Foreground}" BorderThickness="0,1,1,1">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" PanningMode="VerticalOnly" IsManipulationEnabled="True" VerticalScrollBarVisibility="Hidden" >
<ItemsControl x:Name="secCtrl">
<ItemsControl.ItemTemplate>
<DataTemplate>


+ 3
- 0
BPASmartClient/LoginOrderView.xaml.cs View File

@@ -57,6 +57,9 @@ namespace BPASmartClient
case "设备未连接":
errorText.Foreground = new SolidColorBrush(Colors.Red);
break;
case "设备未初始化":
errorText.Foreground = new SolidColorBrush(Colors.Purple);
break;
}
});
};


Loading…
Cancel
Save