public RemoveDeviceForm(MainForm parent) { InitializeComponent(); this.parent = parent; string[] devices = DroneList.GetAllDeviceName(parent); foreach (string deviceName in devices) { this.deviceComboBox.Items.Add(deviceName); } }
private void removeBtn_Click(object sender, EventArgs e) { if (deviceComboBox.SelectedIndex == -1) { this.parent.ShowMessageBox("삭제할 디바이스를 선택해주세요."); return; } else { DroneList.RemoveDroneInfo(this.parent, (string)deviceComboBox.SelectedItem); this.Close(); return; } }
private void showDeviceBtn_Click(object sender, EventArgs e) { string[] deviceNames = DroneList.GetAllDeviceName(parent); if (deviceNames == null) { return; } int index = 0; foreach (string name in deviceNames) { parent.UpdateLog("Device" + (index++).ToString() + " Name is " + name + ", AP is " + DroneList.GetDroneInfo(parent, name).GetAPName()); } }
public void ExecuteAWarehouseRequest(WarehouseRequest warehouseRequest) { WarehouseRequest currentWarehouseRequest = warehouseRequest; List <Drone> dronesWithEnoughCarrySpace = DroneList.FindAll(c => c.CurrentCarryWeight > currentWarehouseRequest.Package.Weight); if (dronesWithEnoughCarrySpace.Count <= 0) { WarehouseRequests.Enqueue(WarehouseRequests.Dequeue()); } else { Drone drone = FindTheNearestDroneToTheWarehouseFromADroneList(warehouseRequest.Warehouse, dronesWithEnoughCarrySpace); drone.AddAnOrderToTheQueue(new Order()); } }
public ConnectForm() { InitializeComponent(); droneList = new DroneList(new Config()); droneList.OnListChanged += DroneList_OnListChanged; searchTimer.Interval = 500; // Millisekunden searchTimer.Tick += (object sender, EventArgs args) => { droneList.SendHello(); }; searchTimer.Start(); droneList.TimeoutSeconds = 2; // Sekunden droneList.SendHello(); }
private void addBtn_Click(object sender, EventArgs e) { String deviceName = deviceNameTextBox.Text; String apName = apNameTextBox.Text; int tagId = -1; try { tagId = int.Parse(tagIdTextBox.Text); } catch (FormatException ex) { parent.ShowMessageBox("Please type only number in the tag textbox."); this.Close(); } DroneInfo dInfo = new DroneInfo(apName, tagId); DroneList.AddDroneInfo(parent, deviceName, dInfo); this.Close(); }
public override void Notify_PawnAdded(Pawn pawn) { if (pawn.def.race.FleshType == XenomorphRacesDefOf.RRY_Xenomorph) { if (!XenoList.Contains(pawn)) { XenoList.Add(pawn); } } if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_FaceHugger) { /* * if (!hiveGrid.Dronelist.Contains(pawn)) * { * hiveGrid.Dronelist.Add(pawn); * } */ } else if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_Runner) { if (!RunnerList.Contains(pawn)) { RunnerList.Add(pawn); } if (!ScoutList.Contains(pawn) && ScoutList.Count < Math.Max(1, RunnerList.Count / 3)) { } } else if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_Drone) { if (!DroneList.Contains(pawn)) { DroneList.Add(pawn); } } else if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_Warrior) { if (!WarriorList.Contains(pawn)) { WarriorList.Add(pawn); } } /* * else if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_Preatorian) * { * if (!PreatorianList.Contains(pawn)) * { * PreatorianList.Add(pawn); * } * } */ else if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_Predalien) { if (!PredalienList.Contains(pawn)) { PredalienList.Add(pawn); } } else if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_Queen) { if (!QueenList.Contains(pawn)) { QueenList.Add(pawn); } } else if (pawn.def == XenomorphRacesDefOf.RRY_Xenomorph_Thrumbomorph) { if (!ThrumbomorphList.Contains(pawn)) { ThrumbomorphList.Add(pawn); } } base.Notify_PawnAdded(pawn); }
private void selectAll() { DroneList.SelectAll(); }