private PalletRequest GeneratePalleteRequest(string PalletRequestData, List <SKUSupply> SKUSupplyList) { PalletRequest newPalletRequest = null; var prData = PalletRequestData.Split(','); string itemCode = prData[1]; int requiredLayerCount = int.Parse(prData[4]); newPalletRequest = new PalletRequest(SKUSupplyList, itemCode, requiredLayerCount); return(newPalletRequest); }
//protected override void KeyDown(KeyEventArgs e) //{ // if (Core.Environment.InvokeRequired) // { // Core.Environment.Invoke(() => KeyDown(e)); // return; // } // base.KeyDown(e); // Random rnd = new Random(); // switch (e.KeyCode) // { // case Keys.NumPad1: // case Keys.NumPad2: // InFeedMethod(e, rnd); // break; // case Keys.NumPad3: // foreach (var item in aisle1Locations) // { // if (!item.Value && item.Key.ActiveLoad == null) // { // Experior.Core.Loads.Load.CreateEuroPallet().Switch(item.Key); // } // } // break; // case Keys.NumPad4: // foreach (var item in aisle2Locations) // { // if (!item.Value && item.Key.ActiveLoad == null) // { // Experior.Core.Loads.Load.CreateEuroPallet().Switch(item.Key); // } // } // break; // case Keys.NumPad5: // foreach (var item in aisle1Locations) // { // if (item.Key.ActiveLoad != null && item.Key.ActiveLoad is EuroPallet) // { // transferCarController1.PickupAndDrop(item.Key, ActionPoint.Get("PLA1EPL1")); // break; // } // } // break; // case Keys.NumPad6: // if (ActionPoint.Get("PLA2EPL1").ActiveLoad != null) // { // break; // } // foreach (var item in aisle2Locations) // { // if (item.Key.ActiveLoad != null && item.Key.ActiveLoad is EuroPallet) // { // transferCarController2.PickupAndDrop(item.Key, ActionPoint.Get("PLA2EPL1")); // break; // } // } // break; // case Keys.NumPad7: // if (ActionPoint.Get("PLA1EPL1").ActiveLoad != null) // { // transferCarController1.PickupAndDrop(ActionPoint.Get("PLA1EPL1"), ActionPoint.Get("TCar1-OutFeed")); // } // break; // case Keys.NumPad8: // if (ActionPoint.Get("PLA2EPL1").ActiveLoad != null) // { // transferCarController2.PickupAndDrop(ActionPoint.Get("PLA2EPL1"), ActionPoint.Get("TCar2-OutFeed")); // } // break; // case Keys.Z: // ActionPoint tempAPA1 = null; // foreach (var item in aisle1Locations) // { // if (item.Value) // { // if (ActionPoint.Get("PLA1SPL11").UserData == null) // { // ActionPoint.Get("PLA1SPL11").UserData = item.Key.ActiveLoad; // transferCarController1.PickupAndDrop(item.Key, ActionPoint.Get("PLA1SPL11")); // tempAPA1 = item.Key; // break; // } // if (ActionPoint.Get("PLA1SPL21").UserData == null) // { // ActionPoint.Get("PLA1SPL21").UserData = item.Key.ActiveLoad; // transferCarController1.PickupAndDrop(item.Key, ActionPoint.Get("PLA1SPL21")); // tempAPA1 = item.Key; // break; // } // break; // } // } // if (tempAPA1 != null) // { // aisle1Locations[tempAPA1] = false; // } // break; // case Keys.X: // ActionPoint tempAPA2 = null; // foreach (var item in aisle2Locations) // { // if (item.Value) // { // if (ActionPoint.Get("PLA2SPL11").UserData == null) // { // ActionPoint.Get("PLA2SPL11").UserData = item.Key.ActiveLoad; // transferCarController2.PickupAndDrop(item.Key, ActionPoint.Get("PLA2SPL11")); // tempAPA2 = item.Key; // break; // } // if (ActionPoint.Get("PLA2SPL21").UserData == null) // { // ActionPoint.Get("PLA2SPL21").UserData = item.Key.ActiveLoad; // transferCarController2.PickupAndDrop(item.Key, ActionPoint.Get("PLA2SPL21")); // tempAPA2 = item.Key; // break; // } // break; // } // } // if (tempAPA2 != null) // { // aisle2Locations[tempAPA2] = false; // } // break; // case Keys.C: // ((Load)ActionPoint.Get("PLA1SPL11").UserData)?.Release(); // ((Load)ActionPoint.Get("PLA1SPL21").UserData)?.Release(); // ((Load)ActionPoint.Get("PLA2SPL11").UserData)?.Release(); // ((Load)ActionPoint.Get("PLA2SPL21").UserData)?.Release(); // break; // default: // break; // } //} //private void InFeedMethod(KeyEventArgs e, Random rnd) //{ // float pHeightVar = (byte)(rnd).Next(1, 5); // float pHeight = 1 + 0.25f * pHeightVar; // Load tempPallet = Experior.Core.Loads.Load.CreateBox(1, pHeight, 1.2f, System.Drawing.Color.FromArgb((byte)(rnd).Next(1, 255), (byte)(rnd).Next(1, 255), (byte)(rnd).Next(1, 255))); // //tempPallet.Yaw += (float)(Math.PI / 2); // PalletUserData tempPalletStorage = null; // var layer = (byte)(rnd).Next(4, 7); // while (true) // { // var aisle = (byte)(rnd).Next(1, 3); // var location = (byte)(rnd).Next(1, 28); // tempPalletStorage = new PalletUserData(aisle, location, layer); // if (aisle == 1) // { // if (aisle1Locations[ActionPoint.Get(GetPalletStorageName(tempPalletStorage))] == true) // { // continue; // } // else // { // aisle1Locations[ActionPoint.Get(GetPalletStorageName(tempPalletStorage))] = true; // break; // } // } // if (aisle == 2) // { // if (aisle2Locations[ActionPoint.Get(GetPalletStorageName(tempPalletStorage))] == true) // { // continue; // } // else // { // aisle2Locations[ActionPoint.Get(GetPalletStorageName(tempPalletStorage))] = true; // break; // } // } // } // tempPallet.UserData = tempPalletStorage; // if (e.KeyData == Keys.NumPad1) // { // ActionPoint.Get("InFeed1").Parent.Add(tempPallet); // return; // } // else if (e.KeyData == Keys.NumPad2) // { // ActionPoint.Get("InFeed2").Parent.Add(tempPallet); // return; // } //} private void InFeedMethod(PalletRequest request) { if (request.Status == PalletRequestStatus.Requested) { return; } float LoadHeight = .25f; foreach (var item in request.RequestPallet()) { Experior.Core.Loads.Load load = Experior.Core.Loads.Load.CreateBox(1f, item.LayerCount * LoadHeight, 1.2f, Color.Azure); load.UserData = item; int i = rndFeed.Next(1, 3); if (i == 1) { load.Switch(ActionPoint.Get("InFeed1").Parent); } else { load.Switch(ActionPoint.Get("InFeed2").Parent); } } }