终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

47 rader
1.7 KiB

  1. using BPASmartClient.Helper;
  2. using BPASmartClient.JXJFoodBigStation.Model;
  3. using Microsoft.Toolkit.Mvvm.ComponentModel;
  4. using Microsoft.Toolkit.Mvvm.Input;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace BPASmartClient.JXJFoodBigStation.ViewModel
  12. {
  13. internal class RecipeSendDownViewModel:ObservableObject
  14. {
  15. public ObservableCollection<RecipeData> Recipes { get; set; } = Json<LocalRecipe>.Data.Recipes;
  16. /// <summary>
  17. /// 当前正在制作的配方
  18. /// </summary>
  19. public static ObservableCollection<RawMaterial> recipeProcesses { get; set; } = new ObservableCollection<RawMaterial>();
  20. /// <summary>
  21. /// 等待制作的配方
  22. /// </summary>
  23. public static ObservableCollection<RecipeData> UserTreeWait { get; set; } = new ObservableCollection<RecipeData>();
  24. /// <summary>
  25. /// 已完成的配方
  26. /// </summary>
  27. public static ObservableCollection<RecipeData> UserTreeCompelete { get; set; } = new ObservableCollection<RecipeData>();
  28. public RelayCommand<string> StartCommand { get; set; }
  29. public RecipeSendDownViewModel()
  30. {
  31. StartCommand = new RelayCommand<string>((recipeName) => {
  32. if (recipeName != null)
  33. {
  34. //配方下发逻辑
  35. var res = Recipes.FirstOrDefault(p => p.RecipeName == recipeName);
  36. if (res != null)
  37. ActionManage.GetInstance.Send("手动下发本地配方", res);
  38. }
  39. });
  40. }
  41. }
  42. }