public Details0079(int id) { InitializeComponent(); Current.Storages.ForEach(o => { var storageUC = new Controls.Machine.StorageControl(o.Id); this.grid.Children.Add(storageUC); SetRowCol(storageUC); }); this.scaner_signal.Children.Add(new ScanerSignalControl()); this.jaw.Children.Add(new JawControl()); this.bind_mach.Children.Add(new BindMachControl()); this.unbind_mach.Children.Add(new UnbindMachControl()); this.current_task.Children.Add(new CurrentTaskControl()); this.sort_pack.Children.Add(new SortPackControl()); this.Timer = new System.Threading.Timer(new TimerCallback(this.CheckStorageStatus), null, 2000, 1000); }
private void SetRowCol(Controls.Machine.StorageControl storageControl) { var row = 0; var col = 0; if (storageControl.Col < Common.STOR_COL_COUNT / 2 + 1) { row = storageControl.Floor; col = 1 + storageControl.Col; } else { row = 5 + storageControl.Floor; col = storageControl.Col - 14; } Grid.SetRow(storageControl, row); Grid.SetColumn(storageControl, col); }