private void OutputStackerLeft_OriginalPointReached(object sender, EventArgs e) { if (!outputStackerLeft.IsEmpty) { if (outputStackerLeft.Rearranging && middleStacker.ReadyForCollecting) { middleStacker.GrabBag(outputStackerLeft.ReleaseBag()); middleStacker.TargetPoint = new Point(station.Location.X, station.Location.Y + station.Size.Height + 10); middleStacker.ReadyForCollecting = false; outputStackerLeft.Rearranging = false; } else { leftConveyor.Push(outputStackerLeft.ReleaseBag()); } } }
private void Station_CanCollect(object sender, BaggageEventArgs e) { int z; if (algo.FlightAtShelf.Keys.Contains(e.Baggage.Flight)) { z = algo.FlightAtShelf[e.Baggage.Flight]; } else { if (mistery) { z = 0; } else { z = 1; } mistery = !mistery; } if (inputStackerLeft.ReadyForCollecting && z == 0) { int x, y; x = shelf1.Location.X; y = shelf1.Location.Y; LogicLocation logic = algo.Push(e.Baggage.Flight, z); if (logic == null) { return; } inputStackerLeft.GrabBag(station.ReleaseBag()); inputStackerLeft.ReadyForCollecting = false; inputStackerLeft.TargetPoint = new Point(x + (logic.Column) * 43 + 20, y + (logic.Row) * 43 + 20); inputStackerLeft.TargetLocation = logic; shelf1.SetFrameHighlight(logic.Column, logic.Row, Color.Black); } else if (inputStackerRight.ReadyForCollecting && z == 1) { int x, y; x = shelf2.Location.X; y = shelf2.Location.Y; LogicLocation logic = algo.Push(e.Baggage.Flight, z); if (logic == null) { return; } inputStackerRight.GrabBag(station.ReleaseBag()); inputStackerRight.ReadyForCollecting = false; inputStackerRight.TargetPoint = new Point(x + (logic.Column) * 43 + 20, y + (logic.Row) * 43 + 20); inputStackerRight.TargetLocation = logic; shelf2.SetFrameHighlight(logic.Column, logic.Row, Color.Black); } }
private void Shelf2_BaggageDequeued(object sender, BaggageEventArgs e) { outputStackerRight.GrabBag(e.Baggage); outputStackerRight.TargetPoint = Point.Empty; }