Exemple #1
0
 /// <summary>
 /// Initializes a new <see cref="PickAndPlace.StackList"/>
 /// </summary>
 private StackList()
 {
     InitializeComponent();
     this.AutoScroll   = true;
     lblPhase.Location = new Point((this.Width - lblPhase.Width) / 2, 10);
     this.layer_       = ReelLayer.Both;
     this.phaseNumber_ = -1;
     this.Dock         = DockStyle.Fill;
 }
Exemple #2
0
 /// <summary>
 /// Add a new reel to the control, add the specific location
 /// <para>Returns true when the reel is added, else false</para>
 /// </summary>
 /// <param name="newReel">Reel to be added</param>
 /// <param name="lockedState">State of the stackControl after adding the reel</param>
 /// <param name="index">Index of the new reel</param>
 /// <returns>True when the reel is added, else false</returns>
 public bool AddReel(Reel newReel, bool lockedState, int index)
 {
     if ((index < 0) || (index > stackControls.Length))
     {
         return(false);
     }
     stackControls[index].SetReel(newReel, lockedState);
     if (this.layer_ == ReelLayer.Both)
     {
         this.layer_ = newReel.ReelLayer;
         UpdateTitle();
     }
     return(true);
 }
Exemple #3
0
        /// <summary>
        /// Add a new reel to the control and activate the update event
        /// <para>Returns true when the reel is added, else false</para>
        /// </summary>
        /// <param name="newReel">Reel to be aded</param>
        /// <returns>True when the reel is added, else false</returns>
        public bool AddReelWithUpdate(Reel newReel)
        {
            //find first index of stacks who can have the selected component
            int index = Array.FindIndex(stackControls, curStack => (curStack.Reel == null) &&
                                        (curStack.ManufacturerPartNumber == newReel.Footprint.ManufacturerPartNumber));

            if (index >= 0)
            {
                stackControls[index].SetReelWithUpdate(newReel);//Difference with the normal AddReel
                if (this.layer_ == ReelLayer.Both)
                {
                    this.layer_ = newReel.ReelLayer;
                    UpdateTitle();
                }
                return(true);
            }
            return(false);
        }