/// <summary> /// The method for the click on the loading box /// trucks list moves the truck to the loading queue and listbox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listBoxLoading_Click(object sender, EventArgs e) { try { Trucks lastTruck = AQueue[1].Peek(); AQueue[1].Dequeue(); listBoxLoading.Items.Remove(lastTruck.gsTruckID + "\t" + lastTruck.gsTruckStatus); AQueue[2].Enqueue(lastTruck); lastTruck.truckSwitch(); listBoxTCrusher.Items.Add(lastTruck.gsTruckID + "\t" + lastTruck.gsTruckStatus); displayTrucks(); } catch { } }
/// <summary> /// The method for the click on the crusher box /// trucks list moves the truck to the transit to loading queue and listbox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listBoxCrusher_Click(object sender, EventArgs e) { try { Trucks lastTruck = AQueue[3].Peek(); AQueue[3].Dequeue(); listBoxCrusher.Items.Remove(lastTruck.gsTruckID + "\t" + lastTruck.gsTruckStatus); AQueue[0].Enqueue(lastTruck); lastTruck.truckSwitch(); listBoxTLoading.Items.Add(lastTruck.gsTruckID + "\t" + lastTruck.gsTruckStatus); lastTruck.gsTruckTotal = lastTruck.gsTruckTotal + lastTruck.gsTruckLoadCapacity; displayTrucks(); } catch { } }