using BPASmartClient.Helper; using BPASmartClient.JXJFoodBigStation.Model.Siemens; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPASmartClient.JXJFoodBigStation.Model { public class TestData { public volatile static TestData Instance; public static TestData GetInstance => Instance ?? (Instance = new TestData()); public ObservableCollection Recipes { get; set; } = new ObservableCollection(); public ObservableCollection RawMaterials { get; set; } = new ObservableCollection(); public TestData() { string recipeName = "配方1"; long recipeCode = 10001; int Traycode = 1; double RawmaterialWeight = 10; int RawMaterialbarrelNum = 1; int RawMaterialLocation = 5; double RawmaterialWeight1 = 20; int RawMaterialbarrelNum1 = 2; int RawMaterialLocation1 = 7; double RawmaterialWeight2 = 30; int RawMaterialbarrelNum2 = 3; int RawMaterialLocation2 = 9; RawMaterials.Add(new RemoteRecipeRawMaterial() { DeviceIp = RawMaterials.Count + 1, RawMaterialWeight = RawmaterialWeight, RawMaterialBarrelNum = RawMaterialbarrelNum, RawMaterialLocation = RawMaterialLocation }); RawMaterials.Add(new RemoteRecipeRawMaterial() { DeviceIp = RawMaterials.Count + 1, RawMaterialWeight = RawmaterialWeight1, RawMaterialBarrelNum = RawMaterialbarrelNum1, RawMaterialLocation = RawMaterialLocation1 }); RawMaterials.Add(new RemoteRecipeRawMaterial() { DeviceIp = RawMaterials.Count + 1, RawMaterialWeight = RawmaterialWeight2, RawMaterialBarrelNum = RawMaterialbarrelNum2, RawMaterialLocation = RawMaterialLocation2 }); Recipes.Add(new Model.RemoteRecipeData() { RecipeName = recipeName, RecipeCode = recipeCode, TrayCode = Traycode, RawMaterial = RawMaterials }); RawMaterials.Clear(); string recipeName_2 = "配方2"; long recipeCode_2 = 20001; int Traycode_2 = 3; double RawmaterialWeight_2 = 10; int RawMaterialbarrelNum_2 = 1; int RawMaterialLocation_2 = 5; double RawmaterialWeight1_2 = 20; int RawMaterialbarrelNum1_2 = 2; int RawMaterialLocation1_2 = 7; double RawmaterialWeight2_2 = 30; int RawMaterialbarrelNum2_2 = 3; int RawMaterialLocation2_2 = 9; RawMaterials.Add(new RemoteRecipeRawMaterial() { DeviceIp = RawMaterials.Count + 1, RawMaterialWeight = RawmaterialWeight_2, RawMaterialBarrelNum = RawMaterialbarrelNum_2, RawMaterialLocation = RawMaterialLocation_2 }); RawMaterials.Add(new RemoteRecipeRawMaterial() { DeviceIp = RawMaterials.Count + 1, RawMaterialWeight = RawmaterialWeight1_2, RawMaterialBarrelNum = RawMaterialbarrelNum1_2, RawMaterialLocation = RawMaterialLocation1_2 }); RawMaterials.Add(new RemoteRecipeRawMaterial() { DeviceIp = RawMaterials.Count + 1, RawMaterialWeight = RawmaterialWeight2_2, RawMaterialBarrelNum = RawMaterialbarrelNum2_2, RawMaterialLocation = RawMaterialLocation2_2 }); Recipes.Add(new Model.RemoteRecipeData() { RecipeName = recipeName_2, RecipeCode = recipeCode_2, TrayCode = Traycode_2, RawMaterial = RawMaterials }); } } }