NXX 2 years ago
parent
commit
c8815b792b
36 changed files with 1285 additions and 342 deletions
  1. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/MenuManage.cs
  2. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
  3. +53
    -14
      BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
  4. +55
    -54
      BPASmartClient.MorkBF/GVL_MorkBF.cs
  5. +3
    -0
      BPASmartClient.ScreenALL/App.config
  6. +328
    -0
      BPASmartClient.ScreenLib/Helper/HttpRequestHelper.cs
  7. +53
    -0
      BPASmartClient.ScreenLib/Helper/Main.cs
  8. +81
    -0
      BPASmartClient.ScreenLib/Model/OrderMakeModel.cs
  9. +4
    -4
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml
  10. +49
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml.cs
  11. +16
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs
  12. +189
    -188
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml
  13. +49
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml.cs
  14. +16
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2ViewModel.cs
  15. +4
    -4
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml
  16. +48
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml.cs
  17. +15
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs
  18. +4
    -4
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml
  19. +48
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml.cs
  20. +16
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs
  21. +6
    -6
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml
  22. +48
    -0
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml.cs
  23. +1
    -0
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControlViewModel.cs
  24. +3
    -0
      BPASmartClient.ScreenMaxWok/App.config
  25. +3
    -0
      BPASmartClient.ScreenMinWok/App.config
  26. +4
    -1
      BPASmartClient.ScreenMorks/App.config
  27. +3
    -1
      BPASmartClient.ScreenSplitMeals/App.config
  28. +105
    -12
      BPASmartClient.SmallBatchingSystem/Services/Control.cs
  29. +20
    -20
      BPASmartClient.SmallBatchingSystem/Services/PlcServer.cs
  30. +8
    -2
      BPASmartClient.SmallBatchingSystem/ViewModels/GrindArenaceousViewModel.cs
  31. +6
    -2
      BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs
  32. +8
    -5
      BPASmartClient.SmallBatchingSystem/ViewModels/RecipeControlViewModel.cs
  33. +7
    -3
      BPASmartClient.SmallBatchingSystem/ViewModels/RecipeViewModel.cs
  34. +7
    -3
      BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs
  35. +1
    -1
      BPASmartClient.SmallBatchingSystem/Views/RecipeControlView.xaml
  36. +21
    -15
      DosingSystem/App.xaml.cs

+ 2
- 2
BPASmartClient.CustomResource/Pages/Model/MenuManage.cs View File

@@ -75,7 +75,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// 主菜单的显示隐藏设置
/// </summary>
public Visibility MainMenuVisibility { get { return _mMainMenuVisibility; } set { _mMainMenuVisibility = value; OnPropertyChanged(); } }
private Visibility _mMainMenuVisibility;
private Visibility _mMainMenuVisibility = Visibility.Visible;

/// <summary>
/// 子菜单集合
@@ -114,7 +114,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// 子菜单的显示隐藏设置
/// </summary>
public Visibility SubMenuVisibility { get { return _mSubMenuVisibility; } set { _mSubMenuVisibility = value; OnPropertyChanged(); } }
private Visibility _mSubMenuVisibility = Visibility.Collapsed;
private Visibility _mSubMenuVisibility = Visibility.Visible;





+ 1
- 1
BPASmartClient.CustomResource/Pages/Model/UserInfo.cs View File

@@ -22,7 +22,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
private Permission _perimission;

public string UserName { get { return _userName; } set { _userName = value; OnPropertyChanged(); } }
private string _userName ;
private string _userName;

public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } }
private string _password;


+ 53
- 14
BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs View File

@@ -85,25 +85,52 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
Global.userInfo.LastLogInTime = DateTime.Now.ToString();
res.LastLogInTime = DateTime.Now.ToString();
Config.GetInstance.SaveUser();

//permission权限
for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++)
if (res.userTreeViewModels != null)
{
if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission))
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible;
else
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null)
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++)
VisibilityState(Visibility.Collapsed);
for (int i = 0; i < res.userTreeViewModels?.Count; i++)
{
if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission))
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible;
else
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed;
var menName = res.userTreeViewModels.ElementAt(i).Name;//获取子菜单的名称

var res1 = MenuManage.GetInstance.menuModels.FirstOrDefault(p => p.subMenumodels.FirstOrDefault(s => s.SubMenuName.Equals(menName)) != null);//通过子菜单获取主菜单的信息
if (res1 != null)
{
res1.MainMenuVisibility = Visibility.Visible;
var res2 = res1.subMenumodels.FirstOrDefault(p => p.SubMenuName.Equals(menName));
if (res2 != null) res2.SubMenuVisibility = Visibility.Visible;
}
}
}
else
{
VisibilityState(Visibility.Visible);
}





//permission权限
//for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++)
//{
// if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission))
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible;
// else
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

// if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null)
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

// for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++)
// {
// if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission))
// MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible;
// else
// MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed;
// }
//}

////分配后的权限
//if (res.permission == Enums.Permission.管理员)
@@ -149,6 +176,18 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}

private void VisibilityState(Visibility tempVisibility)
{
for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++)
{
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = tempVisibility;
for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++)
{
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = tempVisibility;
}
}
}

public RelayCommand LoginCommand { get; set; }

public RelayCommand ExitCommand { get; set; }


+ 55
- 54
BPASmartClient.MorkBF/GVL_MorkBF.cs View File

@@ -35,7 +35,7 @@ namespace BPASmartClient.MorkBF
/// <summary>
/// 炒锅1当前流程
/// </summary>
public List<FryPotProcess> FryPot1_CurrentProcess;
public List<FryPotProcess> FryPot1_CurrentProcess;
/// <summary>
/// 炒锅2当前流程
/// </summary>
@@ -46,7 +46,7 @@ namespace BPASmartClient.MorkBF
/// <summary>
/// 炒锅1锅低温度
/// </summary>
[VariableMonitor("炒锅1锅低温度", "VW120","160")]
[VariableMonitor("炒锅1锅低温度", "VW120", "160")]
public int FirePot1_Temperature { get; set; }
/// <summary>
/// 炒锅1脉冲值
@@ -68,87 +68,87 @@ namespace BPASmartClient.MorkBF
/// 炒锅1急停
/// </summary>
[VariableMonitor("炒锅1急停", "M20.2", "482")]
public bool FirePot1_Emergencystop{ get; set; }
public bool FirePot1_Emergencystop { get; set; }
/// <summary>
/// 1#炒锅荤菜盆有无检测
/// </summary>
[VariableMonitor("1#炒锅1锅低温度", "M20.3", "483")]
public bool FirePot1_MealTubExist{ get; set; }
public bool FirePot1_MealTubExist { get; set; }
/// <summary>
/// 1#炒锅素菜盆1有无检测
/// </summary>
[VariableMonitor("炒锅素菜盆1有无检测", "M20.4", "484")]
public bool FirePot1_VegetablesTub1Exist{ get; set; }
public bool FirePot1_VegetablesTub1Exist { get; set; }
/// <summary>
/// 1#炒锅素菜盆2有无检测
/// </summary>
[VariableMonitor("1#炒锅素菜盆2有无检测", "M20.5", "485")]
public bool FirePot1_VegetablesTub2Exist{ get; set; }
public bool FirePot1_VegetablesTub2Exist { get; set; }
/// <summary>
/// 1#炒锅调料盆1有无检测
/// </summary>
[VariableMonitor("1#炒锅调料盆1有无检测", "M20.6", "486")]
public bool FirePot1_Seasoning1Exist{ get; set; }
public bool FirePot1_Seasoning1Exist { get; set; }
/// <summary>
/// 1#炒锅调料盆2有无检测
/// </summary>
[VariableMonitor("1#炒锅调料盆2有无检测", "M20.7", "487")]
public bool FirePot1_Seasoning2Exist{ get; set; }
public bool FirePot1_Seasoning2Exist { get; set; }
/// <summary>
/// 1#炒锅辅料盆1有无检测
/// </summary>
[VariableMonitor("1#炒锅辅料盆1有无检测", "M21.0", "488")]
public bool FirePot1_Accessories1Exist{ get; set; }
public bool FirePot1_Accessories1Exist { get; set; }
/// <summary>
/// 1#炒锅辅料盆2有无检测
/// </summary>
[VariableMonitor("1#炒锅辅料盆2有无检测", "M21.1", "489")]
public bool FirePot1_Accessories2Exist{ get; set; }
public bool FirePot1_Accessories2Exist { get; set; }
/// <summary>
/// 1#炒锅出餐空盆有无检测
/// </summary>
[VariableMonitor("1#炒锅出餐空盆有无检测", "M21.2", "490")]
public bool FirePot1_OutFoodTubExist{ get; set; }
public bool FirePot1_OutFoodTubExist { get; set; }
/// <summary>
/// 1#炒锅在原点反馈
/// </summary>
[VariableMonitor("1#炒锅在原点反馈", "M21.3", "491")]
public bool FirePot1_OnOrigin{ get; set; }
public bool FirePot1_OnOrigin { get; set; }
/// <summary>
/// 1#炒制位置1反馈
/// </summary>
[VariableMonitor("1#炒制位置1反馈", "M21.4", "492")]
public bool FirePot1_FirePosition1{ get; set; }
public bool FirePot1_FirePosition1 { get; set; }
/// <summary>
/// 1#炒制位置2反馈
/// </summary>
[VariableMonitor("1#炒制位置2反馈", "M21.5", "493")]
public bool FirePot1_FirePosition2{ get; set; }
public bool FirePot1_FirePosition2 { get; set; }
/// <summary>
/// 1#炒制位置3反馈
/// </summary>
[VariableMonitor("1#炒制位置3反馈", "M21.6", "494")]
public bool FirePot1_FirePosition3{ get; set; }
public bool FirePot1_FirePosition3 { get; set; }
/// <summary>
/// 1#炒制位置4反馈
/// </summary>
[VariableMonitor("1#炒制位置4反馈", "M21.7", "495")]
public bool FirePot1_FirePosition4{ get; set; }
public bool FirePot1_FirePosition4 { get; set; }
/// <summary>
/// 1#炒锅在出餐倒料位置反馈
/// </summary>
[VariableMonitor("1#炒锅在出餐倒料位置反馈", "M22.0", "496")]
public bool FirePot1_PotOnOutFoodPosition{ get; set; }
public bool FirePot1_PotOnOutFoodPosition { get; set; }
/// <summary>
/// 1#炒锅在投料位置反馈、
/// </summary>
[VariableMonitor("1#炒锅在投料位置反馈", "M22.1", "497")]
public bool FirePot1_PotOnIntoFoodPosition{ get; set; }
public bool FirePot1_PotOnIntoFoodPosition { get; set; }
/// <summary>
/// 1#炒锅在洗锅位置反馈
/// </summary>
[VariableMonitor("1#炒锅在洗锅位置反馈", "M22.2", "498")]
public bool FirePot1_PotOnCleanPosition{ get; set; }
public bool FirePot1_PotOnCleanPosition { get; set; }

public int FirePot1_FireGear { get; set; } = 0;
public int FirePot1_StirGear { get; set; } = 0;
@@ -161,12 +161,12 @@ namespace BPASmartClient.MorkBF
/// 炒锅2锅低温度
/// </summary>
[VariableMonitor("炒锅2锅低温度", "VW150", "175")]
public int FirePot2_Temperature{ get; set; }
public int FirePot2_Temperature { get; set; }
/// <summary>
/// 炒锅2脉冲值
/// </summary>
[VariableMonitor("炒锅2脉冲值", "VW152", "176")]
public int FirePot2_Pulse{ get; set; }
public int FirePot2_Pulse { get; set; }
/// <summary>
/// 炒锅2初始化完成
/// </summary>
@@ -177,97 +177,98 @@ namespace BPASmartClient.MorkBF
/// 炒锅2手动自动模式
/// </summary>
[VariableMonitor("炒锅2手动自动模式", "M25.1", "521")]
public bool FirePot2_IsAuto{ get; set; }
public bool FirePot2_IsAuto { get; set; }
/// <summary>
/// 炒锅2急停
/// </summary>
[VariableMonitor("炒锅2急停", "M25.2", "522")]
public bool FirePot2_Emergencystop{ get; set; }
public bool FirePot2_Emergencystop { get; set; }
/// <summary>
/// 2#炒锅荤菜盆有无检测
/// </summary>
[VariableMonitor("2#炒锅荤菜盆有无检测", "M25.3", "523")]
public bool FirePot2_MealTubExist{ get; set; }
public bool FirePot2_MealTubExist { get; set; }
/// <summary>
/// 2#炒锅素菜盆1有无检测
/// </summary>
[VariableMonitor("2#炒锅素菜盆1有无检测", "M25.4", "524")]
public bool FirePot2_VegetablesTub1Exist{ get; set; }
public bool FirePot2_VegetablesTub1Exist { get; set; }
/// <summary>
/// 2#炒锅素菜盆2有无检测
/// </summary>
[VariableMonitor("2#炒锅素菜盆2有无检测", "M25.5", "525")]
public bool FirePot2_VegetablesTub2Exist{ get; set; }
public bool FirePot2_VegetablesTub2Exist { get; set; }
/// <summary>
/// 2#炒锅调料盆1有无检测
/// </summary>
[VariableMonitor("2#炒锅调料盆1有无检测", "M25.6", "526")]
public bool FirePot2_Seasoning1Exist{ get; set; }
public bool FirePot2_Seasoning1Exist { get; set; }
/// <summary>
/// 2#炒锅调料盆2有无检测
/// </summary>
[VariableMonitor("2#炒锅调料盆2有无检测", "M25.7", "527")]
public bool FirePot2_Seasoning2Exist{ get; set; }
public bool FirePot2_Seasoning2Exist { get; set; }
/// <summary>
/// 2#炒锅辅料盆1有无检测
/// </summary>
[VariableMonitor("2#炒锅1锅低温度", "M26.0", "528")]
public bool FirePot2_Accessories1Exist{ get; set; }
public bool FirePot2_Accessories1Exist { get; set; }
/// <summary>
/// 2#炒锅辅料盆2有无检测
/// </summary>
[VariableMonitor("2#炒锅辅料盆2有无检测", "M26.1", "529")]
public bool FirePot2_Accessories2Exist{ get; set; }
public bool FirePot2_Accessories2Exist { get; set; }
/// <summary>
/// 2#炒锅出餐空盆有无检测
/// </summary>
[VariableMonitor("2#炒锅出餐空盆有无检测", "M26.2", "530")]
public bool FirePot2_OutFoodTubExist{ get; set; }
public bool FirePot2_OutFoodTubExist { get; set; }
/// <summary>
/// 2#炒锅在原点反馈
/// </summary>
[VariableMonitor("2#炒锅在原点反馈", "M26.3", "531")]
public bool FirePot2_OnOrigin{ get; set; }
public bool FirePot2_OnOrigin { get; set; }
/// <summary>
/// 2#炒制位置1反馈
/// </summary>
[VariableMonitor("2#炒制位置1反馈", "M26.4", "532")]
public bool FirePot2_FirePosition1{ get; set; }
public bool FirePot2_FirePosition1 { get; set; }
/// <summary>
/// 2#炒制位置2反馈
/// </summary>
[VariableMonitor("2#炒制位置2反馈", "M26.5", "533")]
public bool FirePot2_FirePosition2{ get; set; }
public bool FirePot2_FirePosition2 { get; set; }
/// <summary>
/// 2#炒制位置3反馈
/// </summary>
[VariableMonitor("2#炒制位置3反馈", "M26.6", "534")]
public bool FirePot2_FirePosition3{ get; set; }
public bool FirePot2_FirePosition3 { get; set; }
/// <summary>
/// 2#炒制位置4反馈
/// </summary>
[VariableMonitor("2#炒制位置4反馈", "M26.7", "535")]
public bool FirePot2_FirePosition4{ get; set; }
public bool FirePot2_FirePosition4 { get; set; }
/// <summary>
/// 2#炒锅在出餐倒料位置反馈
/// </summary>
[VariableMonitor("2#炒锅在出餐倒料位置反馈", "M27.0", "536")]
public bool FirePot2_PotOnOutFoodPosition{ get; set; }
public bool FirePot2_PotOnOutFoodPosition { get; set; }
/// <summary>
/// 2#炒锅在投料位置反馈、
/// </summary>
[VariableMonitor("2#炒锅在投料位置反馈", "M27.1", "537")]
public bool FirePot2_PotOnIntoFoodPosition{ get; set; }
public bool FirePot2_PotOnIntoFoodPosition { get; set; }
/// <summary>
/// 2#炒锅在洗锅位置反馈
/// </summary>
[VariableMonitor("2#炒锅在洗锅位置反馈", "M27.2", "538")]
public bool FirePot2_PotOnCleanPosition{ get; set; }
public bool FirePot2_PotOnCleanPosition { get; set; }

public int FirePot2_FireGear { get; set; } = 0;
public int FirePot2_StirGear { get; set; } = 0;

public int FirePot2_FlipSpeed { get; set; } = 0;
#endregion

#region 机器人数据读取
public bool Robot_IsBusy;
@@ -283,37 +284,37 @@ namespace BPASmartClient.MorkBF
/// 1号锅倒荤菜完成
/// </summary>
[VariableMonitor("机器人#1号锅倒荤菜完成", "GM500", "4596")]
public bool Robot_FirePot1OutMeal{ get; set; }
public bool Robot_FirePot1OutMeal { get; set; }
/// <summary>
/// 1号炒锅倒素菜1完成
/// </summary>
[VariableMonitor("机器人#1号炒锅倒素菜1完成", "GM501", "4597")]
public bool Robot_FirePot1OutVegetables1{ get; set; }
public bool Robot_FirePot1OutVegetables1 { get; set; }
/// <summary>
/// 1号炒锅倒素菜2完成
/// </summary>
[VariableMonitor("机器人#1号炒锅倒素菜2完成", "GM502", "4598")]
public bool Robot_FirePot1OutVegetables2{ get; set; }
public bool Robot_FirePot1OutVegetables2 { get; set; }
/// <summary>
/// 1号炒锅倒调料完成
/// </summary>
[VariableMonitor("机器人#1号炒锅倒调料完成", "GM503", "4599")]
public bool Robot_FirePot1OutSeasoning{ get; set; }
public bool Robot_FirePot1OutSeasoning { get; set; }
/// <summary>
/// 1号炒锅倒辅料完成
/// </summary>
[VariableMonitor("机器人#1号炒锅倒辅料完成", "GM504", "4600")]
public bool Robot_FirePot1OutAccessories{ get; set; }
public bool Robot_FirePot1OutAccessories { get; set; }
/// <summary>
/// 机器人到位,请求1#炒锅倒菜
/// </summary>
[VariableMonitor("机器人到位,请求1#炒锅倒菜", "GM505", "4601")]
public bool Robot_ArriveFirePot1{ get; set; }
public bool Robot_ArriveFirePot1 { get; set; }
/// <summary>
/// 1号炒锅出餐完成
/// </summary>
[VariableMonitor("机器人#1号炒锅出餐完成", "GM506", "4602")]
public bool Robot_FirePot1OutFoodComplete{ get; set; }
public bool Robot_FirePot1OutFoodComplete { get; set; }



@@ -328,37 +329,37 @@ namespace BPASmartClient.MorkBF
/// 2号炒锅倒素菜1完成
/// </summary>
[VariableMonitor("机器人#2号炒锅倒素菜1完成", "GM511", "4607")]
public bool Robot_FirePot2OutVegetables1{ get; set; }
public bool Robot_FirePot2OutVegetables1 { get; set; }
/// <summary>
/// 2号炒锅倒素菜2完成
/// </summary>
[VariableMonitor("2号炒锅倒素菜2完成", "GM512", "4608")]
public bool Robot_FirePot2OutVegetables2{ get; set; }
public bool Robot_FirePot2OutVegetables2 { get; set; }
/// <summary>
/// 2号炒锅倒调料完成
/// </summary>
[VariableMonitor("机器人#2号炒锅倒调料完成", "GM513", "4609")]
public bool Robot_FirePot2OutSeasoning{ get; set; }
public bool Robot_FirePot2OutSeasoning { get; set; }
/// <summary>
/// 2号炒锅倒辅料完成
/// </summary>
[VariableMonitor("机器人#2号炒锅倒辅料完成", "GM514", "4610")]
public bool Robot_FirePot2OutAccessories{ get; set; }
public bool Robot_FirePot2OutAccessories { get; set; }
/// <summary>
/// 机器人到位,请求1#炒锅倒菜
/// </summary>
[VariableMonitor("机器人#机器人到位,请求1#炒锅倒菜", "GM515", "4611")]
public bool Robot_ArriveFirePot2{ get; set; }
public bool Robot_ArriveFirePot2 { get; set; }
/// <summary>
/// 2号炒锅出餐完成
/// </summary>
[VariableMonitor("机器人#2号炒锅出餐完成", "GM516", "4612")]
public bool Robot_FirePot2OutFoodComplete{ get; set; }
public bool Robot_FirePot2OutFoodComplete { get; set; }
/// <summary>
/// 机器人动作反馈
/// </summary>
[VariableMonitor("机器人动作反馈", "GI5", "5")]
public int Robot_ActionCallback{ get; set; }
public int Robot_ActionCallback { get; set; }

#endregion

@@ -370,7 +371,7 @@ namespace BPASmartClient.MorkBF
public GVL_MorkBF()
{
FirePot1_CompleteSingle = new Dictionary<int, bool>
{
{
{1,Robot_FirePot1OutMeal },
{2,Robot_FirePot1OutVegetables1 },
{3,Robot_FirePot1OutVegetables2 },


+ 3
- 0
BPASmartClient.ScreenALL/App.config View File

@@ -6,5 +6,8 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 328
- 0
BPASmartClient.ScreenLib/Helper/HttpRequestHelper.cs View File

@@ -0,0 +1,328 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.ScreenLib
{
/// <summary>
/// 该类实现客户端http 同步请求
/// 支持环境 -.net4.0/-.net4.5
/// 创建人:奉友福
/// </summary>
public class HttpRequestHelper
{
#region 私有变量
#endregion

#region 公用函数
/// <summary>
/// GET 同步请求
/// 创建人:奉友福
/// 创建时间:2020-11-19
/// </summary>
/// <param name="url">请求地址</param>
/// <returns>超时时间设置,默认5秒</returns>
public static string HttpGetRequest(string url, int _timeout = 2000)
{
string resultData = string.Empty;

try
{
WebClient wc = new WebClient();
byte[] bytes = wc.DownloadData(url);
string s = Encoding.UTF8.GetString(bytes);
return s;
}
catch (Exception e)
{
throw e;
}
return "";

try
{
var getrequest = HttpRequest.GetInstance().CreateHttpRequest(url, "GET", _timeout);
var getreponse = getrequest.GetResponse() as HttpWebResponse;
resultData = HttpRequest.GetInstance().GetHttpResponse(getreponse, "GET");
}
catch (Exception)
{
throw;
}
return resultData;
}
/// <summary>
/// POST 同步请求
/// 创建人:奉友福
/// 创建时间:2020-11-19
/// </summary>
/// <param name="url">请求地址</param>
/// <param name="PostJsonData">请求数据</param>
/// <returns></returns>
public static string HttpPostRequest(string url, string PostJsonData, int _timeout = 2000)
{
string resultData = string.Empty;
try
{
var postrequest = HttpRequest.GetInstance().CreateHttpRequest(url, "POST", _timeout, PostJsonData);
var postreponse = postrequest.GetResponse() as HttpWebResponse;
resultData = HttpRequest.GetInstance().GetHttpResponse(postreponse, "POST");
}
catch (Exception ex)
{
return ex.Message;
}
return resultData;
}

public static string HttpDeleteRequest(string url, string PostJsonData, int _timeout = 10000)
{
string resultData = string.Empty;
try
{
var deleteRequest = HttpRequest.CreateDeleteHttpRequest(url, PostJsonData, _timeout);
var deleteReponse = deleteRequest.GetResponse() as HttpWebResponse;
using (StreamReader reader = new StreamReader(deleteReponse.GetResponseStream(), Encoding.GetEncoding("UTF-8")))
{
resultData = reader.ReadToEnd();
}
}
catch (Exception ex)
{
}
return resultData;
}

/// <summary>
/// GET 同步请求
/// </summary>
/// <param name="url">地址</param>
/// <param name="head">头</param>
/// <param name="headInfo">内容</param>
/// <returns></returns>
public static string GetHttpGetResponseWithHead(string url, HttpRequestHeader head, string headInfo)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.ContentType = "application/json;charset=UTF-8";
request.Timeout = 6000;
request.Headers.Set(head, headInfo);
StreamReader sr = null;
HttpWebResponse response = null;
Stream stream = null;
try
{
response = (HttpWebResponse)request.GetResponse();
stream = response.GetResponseStream();
sr = new StreamReader(stream, Encoding.GetEncoding("utf-8"));
var resultData = sr.ReadToEnd();
return resultData;
}
catch (Exception ex)
{
Console.WriteLine(url + " 访问失败:" + ex.Message);
//return ex.Message;
}
finally
{
if (response != null)
{
response.Dispose();
}
if (stream != null)
{
stream.Dispose();
}
if (sr != null)
{
sr.Dispose();
}
}
return null;
}



/// <summary>
/// Post请求带Token
/// 2021-2-2 by dulf
/// </summary>
/// <param name="url"></param>
/// <param name="head"></param>
/// <param name="headInfo"></param>
/// <param name="postParam"></param>
/// <returns></returns>
public static string HttpPostResponseWithHead(string url, HttpRequestHeader head, string headInfo, string postParam, int Timeout = 6000)
{
string resultData = string.Empty;
try
{
var postrequest = WebRequest.Create(url) as HttpWebRequest;
postrequest.Timeout = Timeout;
postrequest.Method = "POST";
postrequest.ContentType = "application/json;charset=UTF-8";
postrequest.Headers.Set(head, headInfo);
byte[] data = Encoding.UTF8.GetBytes(postParam);
using (Stream reqStream = postrequest.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
var postreponse = postrequest.GetResponse() as HttpWebResponse;
resultData = HttpRequest.GetInstance().GetHttpResponse(postreponse, "POST");
reqStream.Close();
}
return resultData;
}
catch (Exception ex)
{
Console.Write("请求<HttpPostResponseWithHead>异常:" + ex.Message);
}
return "";
}
#endregion

}
/// <summary>
/// HTTP请求类
/// </summary>
public class HttpRequest
{
#region 私有变量
/// <summary>
/// http请求超时时间设置
/// 默认值:5秒
/// </summary>
private static int Timeout = 5000;
#endregion

#region 单例模式
private static HttpRequest _HttpRequest = null;
public static HttpRequest GetInstance()
{
if (_HttpRequest == null)
{
_HttpRequest = new HttpRequest();
}
return _HttpRequest;
}
private HttpRequest()
{

}
#endregion

#region 公用函数
/// <summary>
/// 函数名称:创建http请求
/// 创建人:奉友福
/// 创建时间:2020-11-19
/// 例如GET 请求: 地址 + "GET"
/// 例如POST请求: 地址 + "POST" + JSON
/// </summary>
/// <param name="url">http请求地址</param>
/// <param name="requestType">http请求方式:GET/POST</param>
/// <param name="strjson">http请求附带数据</param>
/// <returns></returns>
public HttpWebRequest CreateHttpRequest(string url, string requestType, int _timeout = 5000, params object[] strjson)
{
HttpWebRequest request = null;
const string get = "GET";
const string post = "POST";
Timeout = _timeout;
if (string.Equals(requestType, get, StringComparison.OrdinalIgnoreCase))
{
request = CreateGetHttpRequest(url);
}
if (string.Equals(requestType, post, StringComparison.OrdinalIgnoreCase))
{
request = CreatePostHttpRequest(url, strjson[0].ToString());
}
return request;
}
/// <summary>
/// http获取数据
/// </summary>
/// <param name="response"></param>
/// <param name="requestType"></param>
/// <returns></returns>
public string GetHttpResponse(HttpWebResponse response, string requestType)
{
var resultData = string.Empty;
const string post = "POST";
string encoding = "UTF-8";
if (string.Equals(requestType, post, StringComparison.OrdinalIgnoreCase))
{
encoding = response.ContentEncoding;
if (encoding == null || encoding.Length < 1)
encoding = "UTF-8";
}
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding)))
{
resultData = reader.ReadToEnd();
}
return resultData;
}
#endregion

#region 私有函数
/// <summary>
/// http+GET请求
/// </summary>
/// <param name="url">请求地址</param>
/// <returns>请求结果</returns>
private static HttpWebRequest CreateGetHttpRequest(string url)
{
var getrequest = WebRequest.Create(url) as HttpWebRequest;
getrequest.Method = "GET";
getrequest.Timeout = Timeout;
getrequest.ContentType = "application/json;charset=UTF-8";
getrequest.Proxy = null;
getrequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
return getrequest;
}
/// <summary>
/// http+POST请求
/// </summary>
/// <param name="url">请求地址</param>
/// <param name="postData"></param>
/// <returns>请求结果</returns>
private static HttpWebRequest CreatePostHttpRequest(string url, string postData)
{
var postrequest = WebRequest.Create(url) as HttpWebRequest;
//postrequest.KeepAlive = false;
postrequest.Timeout = Timeout;
postrequest.Method = "POST";
postrequest.ContentType = "application/json;charset=UTF-8";
//postrequest.ContentLength = postData.Length;
//postrequest.AllowWriteStreamBuffering = false;
//StreamWriter writer = new StreamWriter(postrequest.GetRequestStream(), Encoding.UTF8);
//writer.Write(postData);
//writer.Flush();
byte[] data = Encoding.UTF8.GetBytes(postData);
using (Stream reqStream = postrequest.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
return postrequest;
}

public static HttpWebRequest CreateDeleteHttpRequest(string url, string postJson, int _timeout = 5000)
{
var deleteRequest = WebRequest.Create(url) as HttpWebRequest;
deleteRequest.Timeout = _timeout;
deleteRequest.Method = "DELETE";
deleteRequest.ContentType = "application/json;charset=UTF-8";
byte[] data = Encoding.UTF8.GetBytes(postJson);
using (Stream reqStream = deleteRequest.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
return deleteRequest;
}
#endregion
}
}

+ 53
- 0
BPASmartClient.ScreenLib/Helper/Main.cs View File

@@ -1,6 +1,7 @@
using BPA.Communication;
using BPA.Helper;
using BPA.Message;
using Microsoft.Web.WebView2.Wpf;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
@@ -9,6 +10,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace BPASmartClient.ScreenLib
{
@@ -43,6 +45,10 @@ namespace BPASmartClient.ScreenLib

#region 自建变量
/// <summary>
/// 分餐机广告
/// </summary>
public List<AdDTO> SaasRouteReturn =new List<AdDTO> { };
/// <summary>
/// 是否运行
/// </summary>
public bool IsRunning { get; set; }
@@ -134,6 +140,7 @@ namespace BPASmartClient.ScreenLib
{
try
{
ReadSass();
//连接MQTT、Redis
Connection();
IsRunning = true;
@@ -184,6 +191,52 @@ namespace BPASmartClient.ScreenLib

#region 调用事件
/// <summary>
/// 调用Sass接口拿到广告
/// </summary>
public void ReadSass()
{
try
{
string SaasRoute = System.Configuration.ConfigurationManager.AppSettings["SaasRoute"].ToString();
string res = HttpRequestHelper.HttpGetRequest(SaasRoute);
if (!string.IsNullOrEmpty(res))
{
HttpReturn httpReturn= JsonConvert.DeserializeObject<HttpReturn>(res);
var Init =httpReturn?.data?.Devices?.Join(httpReturn?.data?.Stalls, t => t.GateId, x => x.Id, (t, x) => new AdDTO
{
Ad = x.Remaek,
Device = t.Name,
Stalls = x.Name,
Address = t.Address,
}).ToList();
SaasRouteReturn= Init;
}
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示地址
/// </summary>
/// <param name="input"></param>
/// <param name="view2"></param>
public async void InitView2(string input, WebView2 view2, GroupBox group)
{
var height = 540;
var width = 940;
input = input.Replace("style=\"width: 100%;\"", "");
StringBuilder sb = new StringBuilder();
sb.Append("<html><style>body {width: " + width + "px;height: " + height + "px;margin: 0;padding:0;}body p {width: " + width + "px;height: " + height + "px;}body p img {width: 100%;height: 100%;}</style><script>function Set(width, height) { var body = document.getElementsByTagName('body')[0]; body.style.width = width + 'px';body.style.height = height + 'px';var p = document.getElementsByTagName('p')[0]; p.style.width = width + 'px';p.style.height = height + 'px';}</script><body>" + input + "</body></html>");
var html = sb.ToString();
await view2.EnsureCoreWebView2Async(null);
view2.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false;
view2.CoreWebView2.Settings.AreDevToolsEnabled = false;
view2.CoreWebView2.NavigateToString(html);
}
/// <summary>
/// 读取配置
/// </summary>
public void ReadPZ()


+ 81
- 0
BPASmartClient.ScreenLib/Model/OrderMakeModel.cs View File

@@ -1,5 +1,6 @@
using BPA.Helper;
using BPA.Message.Enum;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -104,4 +105,84 @@ namespace BPASmartClient.ScreenLib
}
}

public class HttpReturn
{
public bool isSuccess { get; set; }

public StoreInfoResponse data { get; set; }
}

public class StoreInfoResponse
{
/// <summary>
/// 档口
/// </summary>
[JsonProperty("gateList")]
public List<StallModelResponse> Stalls { get; set; }
/// <summary>
/// 设备
/// </summary>
[JsonProperty("payCardList")]
public List<DeviceModelResponse> Devices { get; set; }
}
public class StallModelResponse
{

public string Id { get; set; }
/// <summary>
/// 档口名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 归属门店
/// </summary>
public string StoreId { get; set; }
/// <summary>
/// 收费方式(1,固定金额2,自由设定)
/// </summary>
public int Mode { get; set; }
/// <summary>
/// 收款金额
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 广告
/// </summary>
public string Remaek { get; set; }
/// <summary>
///状态0正常,1停用
/// </summary>
public int Status { get; set; }
}
public class DeviceModelResponse
{
public string Id { get; set; }
/// <summary>
/// 刷卡设备名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 档口id
/// </summary>
public string GateId { get; set; }
/// <summary>
/// 地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 刷卡间隔时间
/// </summary>
public int SleepTime { get; set; }
/// <summary>
/// 状态0正常,1停用
/// </summary>
public int Status { get; set; }
}
public class AdDTO
{
public string Device { get; set; }
public string Ad { get; set; }
public string Stalls { get; set; }
public string Address { get; set; }
}
}

+ 4
- 4
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml View File

@@ -86,13 +86,13 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>


+ 49
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml.cs View File

@@ -25,6 +25,55 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenSplitMealsControl1ViewModel();

if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "01");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 16
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs View File

@@ -37,6 +37,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.分餐机;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount = 0;
#endregion

public ScreenSplitMealsControl1ViewModel()
@@ -51,6 +65,8 @@ namespace BPASmartClient.ScreenLib
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;

OrderCount = modelMaxWok.SplitMeals_CreditCardCount_1 + modelMaxWok.SplitMeals_CreditCardCount_2;
}
}));
Thread.Sleep(1000);


+ 189
- 188
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml View File

@@ -1,188 +1,189 @@
<UserControl x:Class="BPASmartClient.ScreenLib.ScreenSplitMealsControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.ScreenLib"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:con="clr-namespace:BPA.CustomResource.UserControls;assembly=BPA.CustomResource"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPA.CustomResource;component/Themes/ProlineStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<StackPanel Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="4 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</GroupBox>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="信息时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="详细描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="2" Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="3 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
</Grid>

</UserControl>
<UserControl x:Class="BPASmartClient.ScreenLib.ScreenSplitMealsControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.ScreenLib"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:con="clr-namespace:BPA.CustomResource.UserControls;assembly=BPA.CustomResource"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPA.CustomResource;component/Themes/ProlineStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="4 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="信息时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="详细描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="2" Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="3 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
</Grid>
</UserControl>

+ 49
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml.cs View File

@@ -24,6 +24,55 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenSplitMealsControl2ViewModel();

if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "02");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 16
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2ViewModel.cs View File

@@ -37,6 +37,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.分餐机;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount = 0;
#endregion

public ScreenSplitMealsControl2ViewModel()
@@ -51,6 +65,8 @@ namespace BPASmartClient.ScreenLib
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
OrderCount = modelMaxWok.SplitMeals_CreditCardCount_3 + modelMaxWok.SplitMeals_CreditCardCount_4;

}
}));
Thread.Sleep(1000);


+ 4
- 4
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml View File

@@ -194,13 +194,13 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">


+ 48
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml.cs View File

@@ -24,6 +24,54 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenMaxWokControlViewModel();
if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "05");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 15
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs View File

@@ -67,6 +67,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.大炒;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount =0;
#endregion

public ScreenMaxWokControlViewModel()
@@ -86,6 +100,7 @@ namespace BPASmartClient.ScreenLib
ProcessModel1?.ToList().ForEach(par => { if (par.Id+1 == ProcessModel1.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ProcessModel2?.ToList().ForEach(par => { if (par.Id+1 == ProcessModel2.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ViewData = modelMaxWok;
OrderCount = modelMaxWok.MaxWok_OrderCount_1 + modelMaxWok.MaxWok_OrderCount_2;
}
}));
Thread.Sleep(1000);


+ 4
- 4
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml View File

@@ -194,13 +194,13 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>


+ 48
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml.cs View File

@@ -24,6 +24,54 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenMinWokControlViewModel();
if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "06");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 16
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs View File

@@ -66,6 +66,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.小炒;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount = 0;
#endregion

public ScreenMinWokControlViewModel()
@@ -84,6 +98,8 @@ namespace BPASmartClient.ScreenLib
ProcessModel1?.ToList().ForEach(par => { if (par.Id + 1 == ProcessModel1.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ProcessModel2?.ToList().ForEach(par => { if (par.Id + 1 == ProcessModel2.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ViewData = modelMaxWok;
OrderCount = modelMaxWok.MinWok_OrderCount_1 + modelMaxWok.MinWok_OrderCount_2;

}
}));
Thread.Sleep(1000);


+ 6
- 6
BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml View File

@@ -116,15 +116,15 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding ViewData.MorkS_OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
@@ -220,7 +220,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData..Morks_NoodleUpOrDown[1]}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_NoodleUpOrDown[1]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>


+ 48
- 0
BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml.cs View File

@@ -24,6 +24,54 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenMorksControlViewModel();

if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}

/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility==Visibility.Collapsed? Visibility.Visible: Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str=string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >=6)
{
AdDTO dto= Main.GetInstance.SaasRouteReturn?.Find(par => par.Address =="04");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 1
- 0
BPASmartClient.ScreenLib/煮面机/ScreenMorksControlViewModel.cs View File

@@ -9,6 +9,7 @@ using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using BPA.Message;
using System.Windows;

namespace BPASmartClient.ScreenLib
{


+ 3
- 0
BPASmartClient.ScreenMaxWok/App.config View File

@@ -6,5 +6,8 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 3
- 0
BPASmartClient.ScreenMinWok/App.config View File

@@ -6,5 +6,8 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 4
- 1
BPASmartClient.ScreenMorks/App.config View File

@@ -5,6 +5,9 @@
<add key="MQTTConnection" value="10.2.1.254,1883,admin,public"/>
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://klxxcdn.oss-cn-hangzhou.aliyuncs.com/histudy/hrm/media/bg1.mp4"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 3
- 1
BPASmartClient.ScreenSplitMeals/App.config View File

@@ -6,7 +6,9 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>

<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
<add key="一号屏" value="0"/>
<add key="二号屏" value="1"/>
<add key="三号屏" value="0"/>


+ 105
- 12
BPASmartClient.SmallBatchingSystem/Services/Control.cs View File

@@ -1,4 +1,4 @@
#define test
//#define ModelSwitch

using BPA.Helper;
using BPASmartClient.SmallBatchingSystem;
@@ -38,8 +38,8 @@ namespace BPASmartClient.SmallBatchingSystem
{
if (MakeOrderQueue.TryDequeue(out RecipeInfo recipeInfo))
{
//ProcessOne(recipeInfo);
ProcessTwo(recipeInfo);
ProcessOne(recipeInfo);
//ProcessTwo(recipeInfo);
}
}
Thread.Sleep(10);
@@ -80,8 +80,8 @@ namespace BPASmartClient.SmallBatchingSystem
if (res != null)
{
StatusNotify(res.SiloName, Status.正在配料);
RunLog($"写重量地址:{GetWeightAdd(res.SiloLoc)},重量:{temp1.SiloWeight}");
PlcServer.GetInstance.WriteData(GetWeightAdd(res.SiloLoc), (ushort)temp1.SiloWeight);
RunLog($"写重量地址:{GetWeightAdd(res.SiloLoc)},重量:{temp1.SiloWeight * 10}");
PlcServer.GetInstance.WriteData(GetWeightAdd(res.SiloLoc), (ushort)(temp1.SiloWeight * 10));
RunLog($"写启动信号地址:{GetStartSingleAdd(res.SiloLoc)}");
PlcServer.GetInstance.WriteData(GetStartSingleAdd(res.SiloLoc), true);
while (!PlcDataModel.BatchingCompleted && !IsCancel) Thread.Sleep(1);//等待出料完成
@@ -109,6 +109,97 @@ namespace BPASmartClient.SmallBatchingSystem
RunLog($"【{recipeInfo.RecipeName}】配方执行完成");
ActionManage.GetInstance.Send("GrindArenaceousCancel");
}


// IsCancel = false;
// Dictionary<int, List<int>> DeviceSoilInfo = new Dictionary<int, List<int>>();
// List<int> OutletInfo = new List<int>();
// recipeInfo.SiloInfoModels.ToList()?.ForEach(item =>
// {
// var res = Json<ConfigInfoModel>.Data.OutletInfoModels.FirstOrDefault(p => p.SiloInfos.FirstOrDefault(s => s == item.SiloName) != null);
// if (res != null)
// {
// var soliInfo = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == item.SiloName);
// if (soliInfo != null)
// {
// if (!DeviceSoilInfo.ContainsKey(res.OutletLoc))
// {
// DeviceSoilInfo.Add(res.OutletLoc, new List<int>());
// DeviceSoilInfo[res.OutletLoc].Add(soliInfo.SiloLoc);
// }
// else
// {
// DeviceSoilInfo[res.OutletLoc].Add(soliInfo.SiloLoc);
// }
// }

// }
// });

// foreach (var temp in DeviceSoilInfo)
// {
// PlcServer.GetInstance.WriteData("VW302", (ushort)temp.Key);//设置出料口位置
//#if ModelSwitch
// PlcServer.GetInstance.WriteData("M10.4", true);//定位启动
//#else
// PlcServer.GetInstance.WriteData("M10.0", true);//定位启动
//#endif

// RunLog($"启动定位,出料口位置:{temp.Key}");
// int index = temp.Key - 1;
// if (index >= 0)
// {
// RunLog("等待定位完成");
// while (!PlcDataModel.TargetLocComplete && !IsCancel) Thread.Sleep(1);//等待定位反馈
// if (IsCancel) break;
// RunLog("定位完成");
// PlcServer.GetInstance.WriteData("M20.0", false);
// while (PlcDataModel.TargetLocComplete && !IsCancel) Thread.Sleep(1);
// if (IsCancel) break;
// RunLog("定位完成,复位成功");
// foreach (var temp1 in temp.Value)
// {
// //var rest = Json<ConfigInfoModel>.Data.OutletInfoModels.FirstOrDefault(p => p.SiloInfos.FirstOrDefault(s => s.Contains(temp1.SiloName)) != null);
// //if (rest != null && rest.OutletLoc == temp)
// //{

// var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloLoc == temp1);
// if (res != null)
// {
// var tempRecipe = recipeInfo.SiloInfoModels.FirstOrDefault(p => p.SiloName == res.SiloName);
// if (tempRecipe != null)
// {
// StatusNotify(res.SiloName, Status.正在配料);
// RunLog($"写重量地址:{GetWeightAdd(res.SiloLoc)},重量:{tempRecipe.SiloWeight}");
// PlcServer.GetInstance.WriteData(GetWeightAdd(res.SiloLoc), (ushort)(tempRecipe.SiloWeight * 10));
// RunLog($"写启动信号地址:{GetStartSingleAdd(res.SiloLoc)}");
// PlcServer.GetInstance.WriteData(GetStartSingleAdd(res.SiloLoc), true);
// while (!PlcDataModel.BatchingCompleted && !IsCancel) Thread.Sleep(1);//等待出料完成
// if (IsCancel) break;
// RunLog("出料完成,复位出料完成状态");
//#if ModelSwitch
// PlcServer.GetInstance.WriteData("M10.0", false);//复位出料完成信号
//#else
// PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号
//#endif
// while (PlcDataModel.BatchingCompleted && !IsCancel) Thread.Sleep(1);//等待出料完成信号复位成功
// if (IsCancel) break;
// RunLog("出料完成复位成功");
// StatusNotify(res.SiloName, Status.配料完成);
// }
// }
// //}
// }
// if (IsCancel) return;
// }
// }







}

/// <summary>
@@ -179,10 +270,10 @@ namespace BPASmartClient.SmallBatchingSystem
while (!PlcDataModel.BatchingCompleted && !IsCancel) Thread.Sleep(1);//等待出料完成
if (IsCancel) break;
RunLog("出料完成,复位出料完成状态");
#if test
#if ModelSwitch
PlcServer.GetInstance.WriteData("M10.0", false);//复位出料完成信号
#else
PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号
PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号
#endif

while (PlcDataModel.BatchingCompleted && !IsCancel) Thread.Sleep(1);//等待出料完成信号复位成功
@@ -275,7 +366,7 @@ PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号
/// <returns></returns>
private string GetWeightAdd(int num)
{
#if test
#if ModelSwitch
if (num > 0)
{
int add = 0;
@@ -287,10 +378,10 @@ PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号
}
return default;
#else
if (num > 0)
if (num > 0)
{
int add = 0;
if (num >= 1 && num <= 18)
if (num >= 1 && num <= 8)
{
add = 100 + (num - 1) * 2;
}
@@ -312,12 +403,14 @@ PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号

public void RunLog(string info)
{
BPA.Helper.MessageLog.GetInstance.Show(info);
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowRunLog(info);
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}");
}

public void OperationLog(string info)
{
BPA.Helper.MessageLog.GetInstance.Show(info);
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowUserLog(info);
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}");
}
@@ -342,7 +435,7 @@ PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号
/// <returns></returns>
private string GetStartSingleAdd(int num)
{
#if test
#if ModelSwitch
if (num > 0)
{
string Add = string.Empty;
@@ -359,7 +452,7 @@ PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号
}
return default;
#else
if (num > 0)
if (num > 0)
{
string Add = string.Empty;
var t = num / 8;


+ 20
- 20
BPASmartClient.SmallBatchingSystem/Services/PlcServer.cs View File

@@ -28,32 +28,13 @@ namespace BPASmartClient.SmallBatchingSystem
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//带称程序
//var res = ReadData("M20.0", 1);//到达目标位置信号
//if (res != null && res is bool[] bools && bools.Length == 1)
//{
// PlcDataModel.TargetLocComplete = bools[0];
//}

//var res1 = ReadData("M4.0", 1);//通道出料完成
//if (res1 != null && res1 is bool[] bools1 && bools1.Length == 1)
//{
// PlcDataModel.BatchingCompleted = bools1[0];
//}

//var res2 = ReadData("M13.3", 1);//配方配料完成,托盘在放碗或取碗位置
//if (res2 != null && res2 is bool[] bools2 && bools2.Length == 1)
//{
// PlcDataModel.RecipeBatchingComplete = bools2[0];
//}

//定时程序
var res = ReadData("M20.0", 1);//到达目标位置信号
if (res != null && res is bool[] bools && bools.Length == 1)
{
PlcDataModel.TargetLocComplete = bools[0];
}

var res1 = ReadData("M10.0", 1);//通道出料完成
var res1 = ReadData("M4.0", 1);//通道出料完成
if (res1 != null && res1 is bool[] bools1 && bools1.Length == 1)
{
PlcDataModel.BatchingCompleted = bools1[0];
@@ -65,6 +46,25 @@ namespace BPASmartClient.SmallBatchingSystem
PlcDataModel.RecipeBatchingComplete = bools2[0];
}

//定时程序
//var res = ReadData("M20.0", 1);//到达目标位置信号
//if (res != null && res is bool[] bools && bools.Length == 1)
//{
// PlcDataModel.TargetLocComplete = bools[0];
//}

//var res1 = ReadData("M10.0", 1);//通道出料完成
//if (res1 != null && res1 is bool[] bools1 && bools1.Length == 1)
//{
// PlcDataModel.BatchingCompleted = bools1[0];
//}

//var res2 = ReadData("M13.3", 1);//配方配料完成,托盘在放碗或取碗位置
//if (res2 != null && res2 is bool[] bools2 && bools2.Length == 1)
//{
// PlcDataModel.RecipeBatchingComplete = bools2[0];
//}

Thread.Sleep(10);
}), "PLC 数据监听");
});


+ 8
- 2
BPASmartClient.SmallBatchingSystem/ViewModels/GrindArenaceousViewModel.cs View File

@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.SmallBatchingSystem.ViewModels
{
@@ -36,13 +37,18 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels
});
}
}), "OpenRecipeStatusMotion", true);
CancelCommand = new RelayCommand(() => { Control.GetInstance.IsCancel = true; ActionManage.GetInstance.Send("GrindArenaceousCancel"); });
CancelCommand = new RelayCommand(() =>
{
if (MessageNotify.GetInstance.ShowDialog($"是否取消配方制作,取消后设备将终止配料过程!", DialogType.Warning))
{
Control.GetInstance.IsCancel = true; ActionManage.GetInstance.Send("GrindArenaceousCancel");
}
});
}

public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
private string _mRecipeName;


public ObservableCollection<RecipeStatus> Recipes { get; set; } = new ObservableCollection<RecipeStatus>();
}
}

+ 6
- 2
BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs View File

@@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPA.Helper;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.SmallBatchingSystem.Views;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
@@ -29,8 +30,11 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels
var res = Json<ConfigInfoModel>.Data.OutletInfoModels.FirstOrDefault(p => p.OutletName == o.ToString());
if (res != null)
{
Json<ConfigInfoModel>.Data.OutletInfoModels.Remove(res);
Control.GetInstance.OperationLog($"{res.OutletName} 删除成功");
if (MessageNotify.GetInstance.ShowDialog($"是否删除【{res.OutletName}】出料口,删除后数据将永久丢失!无法找回", DialogType.Warning))
{
Json<ConfigInfoModel>.Data.OutletInfoModels.Remove(res);
Control.GetInstance.OperationLog($"{res.OutletName} 删除成功");
}
}
}
});


+ 8
- 5
BPASmartClient.SmallBatchingSystem/ViewModels/RecipeControlViewModel.cs View File

@@ -10,6 +10,7 @@ using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.SmallBatchingSystem.Views;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.SmallBatchingSystem.ViewModels
{
@@ -44,16 +45,18 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels
}
else
{
App.Current.Dispatcher.Invoke(() =>
{
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "错误", "配方下发失败,硬件设备状态未装备就绪!");
});
//App.Current.Dispatcher.Invoke(() =>
//{
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "错误", "配方下发失败,硬件设备状态未装备就绪!");
//});
MessageNotify.GetInstance.ShowDialog($"配方下发失败,硬件设备状态未装备就绪!", DialogType.Error);

Control.GetInstance.RunLog("配方下发失败,硬件设备状态未装备就绪!");
}
});
});

DeviceInitCommand = new RelayCommand(() => { PlcServer.GetInstance.WriteData("M10.3", true); });
DeviceInitCommand = new RelayCommand(() => { PlcServer.GetInstance.WriteData("M10.4", true); });
}

public RelayCommand DeviceInitCommand { get; set; }


+ 7
- 3
BPASmartClient.SmallBatchingSystem/ViewModels/RecipeViewModel.cs View File

@@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPA.Helper;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.SmallBatchingSystem.Views;
@@ -31,9 +32,12 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels
var res = Json<ConfigInfoModel>.Data.Recipes.FirstOrDefault(p => p.RecipeName == o.ToString());
if (res != null)
{
Json<ConfigInfoModel>.Data.Recipes.Remove(res);
Control.GetInstance.NotifyPrompt($"{res.RecipeName} 删除成功");
Control.GetInstance.OperationLog($"{res.RecipeName} 删除成功");
if (MessageNotify.GetInstance.ShowDialog($"是否删除【{res.RecipeName}】配方,删除后数据将永久丢失!无法找回", DialogType.Warning))
{
Json<ConfigInfoModel>.Data.Recipes.Remove(res);
Control.GetInstance.NotifyPrompt($"{res.RecipeName} 删除成功");
Control.GetInstance.OperationLog($"{res.RecipeName} 删除成功");
}
}
}
});


+ 7
- 3
BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs View File

@@ -8,6 +8,7 @@ using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.SmallBatchingSystem.Views;
using System.Collections.ObjectModel;
using BPA.Helper;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.SmallBatchingSystem.ViewModels
{
@@ -29,9 +30,12 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels
var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == o.ToString());
if (res != null)
{
Json<ConfigInfoModel>.Data.SiloInfoModels.Remove(res);
Control.GetInstance.NotifyPrompt($"{res.SiloName} 删除成功");
Control.GetInstance.OperationLog($"{res.SiloName} 删除成功");
if (MessageNotify.GetInstance.ShowDialog($"是否删除【{res.SiloName}】原料,删除后数据将永久丢失!无法找回", DialogType.Warning))
{
Json<ConfigInfoModel>.Data.SiloInfoModels.Remove(res);
Control.GetInstance.NotifyPrompt($"{res.SiloName} 删除成功");
Control.GetInstance.OperationLog($"{res.SiloName} 删除成功");
}
}
}
});


+ 1
- 1
BPASmartClient.SmallBatchingSystem/Views/RecipeControlView.xaml View File

@@ -28,7 +28,7 @@
Height="30"
Margin="10,0,10,0"
HorizontalAlignment="Right"
Command="{Binding AddCommand}"
Command="{Binding DeviceInitCommand}"
Content="初始化"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />


+ 21
- 15
DosingSystem/App.xaml.cs View File

@@ -62,7 +62,7 @@ namespace BPASmartClient.DosingSystem
RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "配方管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.RecipeSettingsView"
});
@@ -70,7 +70,7 @@ namespace BPASmartClient.DosingSystem
RecipeManage.Add(new SubMenumodel()
{
SubMenuName = "配方下发",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.RecipeControlView"
});
@@ -78,6 +78,7 @@ namespace BPASmartClient.DosingSystem
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe683;",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
MainMenuName = "配方管理",
Alias = "Recipe Management",
subMenumodels = RecipeManage,
@@ -89,7 +90,7 @@ namespace BPASmartClient.DosingSystem
ParSet.Add(new SubMenumodel()
{
SubMenuName = "原料参数设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.DeviceMaterialParView"
});
@@ -97,7 +98,7 @@ namespace BPASmartClient.DosingSystem
ParSet.Add(new SubMenumodel()
{
SubMenuName = "设备参数设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.CommParSetView"
});
@@ -113,6 +114,7 @@ namespace BPASmartClient.DosingSystem
MenuManage.GetInstance.menuModels.Add(new MenuModel()
{
MainMenuIcon = "&#xe62d;",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
MainMenuName = "参数设置",
Alias = "Parameter Set",
subMenumodels = ParSet,
@@ -124,7 +126,7 @@ namespace BPASmartClient.DosingSystem
ManualControl.Add(new SubMenumodel()
{
SubMenuName = "气缸手动控制",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.ManualControlView"
});
@@ -132,7 +134,7 @@ namespace BPASmartClient.DosingSystem
ManualControl.Add(new SubMenumodel()
{
SubMenuName = "输送带手动控制",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.ConveyerBeltManualView"
});
@@ -147,6 +149,7 @@ namespace BPASmartClient.DosingSystem
{
MainMenuIcon = "&#xe622;",
MainMenuName = "手动控制",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "Parameter Set",
subMenumodels = ManualControl,
});
@@ -157,7 +160,7 @@ namespace BPASmartClient.DosingSystem
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "操作日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserLogView"
});
@@ -165,7 +168,7 @@ namespace BPASmartClient.DosingSystem
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "运行日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.RunLogView"
});
@@ -173,7 +176,7 @@ namespace BPASmartClient.DosingSystem
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "报警记录",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.AlarmView"
});
@@ -181,7 +184,7 @@ namespace BPASmartClient.DosingSystem
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "调试日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.DebugLogView"
});
@@ -198,6 +201,7 @@ namespace BPASmartClient.DosingSystem
{
MainMenuIcon = "&#xe668;",
MainMenuName = "消息日志",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "Message Log",
subMenumodels = InfoLog,
});
@@ -208,7 +212,7 @@ namespace BPASmartClient.DosingSystem
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "原料设备列表",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.DeviceListView"
});
@@ -216,7 +220,7 @@ namespace BPASmartClient.DosingSystem
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "设备状态",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.DosingSystem",
ToggleWindowPath = "View.HardwareStatusView"
});
@@ -225,6 +229,7 @@ namespace BPASmartClient.DosingSystem
{
MainMenuIcon = "&#xe603;",
MainMenuName = "设备监控",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "Device Monitor",
subMenumodels = DeviceMonitor,
});
@@ -235,7 +240,7 @@ namespace BPASmartClient.DosingSystem
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户登录",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.SubPagLoginView"
});
@@ -243,14 +248,14 @@ namespace BPASmartClient.DosingSystem
UserManager.Add(new SubMenumodel()
{
SubMenuName = "密码修改",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.PasswordChangeView"
});
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserManagerView"
});
@@ -267,6 +272,7 @@ namespace BPASmartClient.DosingSystem
{
MainMenuIcon = "&#xe66d;",
MainMenuName = "用户管理",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 },
Alias = "User Management",
subMenumodels = UserManager,
});


Loading…
Cancel
Save