public Manager(string user_id, int iteration, int[] degreeList,string taskDesc, string labelLeftMost, string labelRightMost, ArduinoUno arduinouno,TaskDisplay tDisplay) { logPath = "log_" + user_id + ".csv"; this.user_id = user_id; arduino = arduinouno; Manager.tDisplay = tDisplay; tDisplay.buttonOK.Click += buttonOK_Click; taskQueue = new Queue<Task>(); curTask = null; List<Task> taskList = new List<Task>(); for (int i = 0; i < iteration; i++) { for (int j = 0; j < degreeList.Length; j++) { taskList.Add(new Task(degreeList[j],taskDesc,labelLeftMost,labelRightMost)); } } Shuffle(taskList); int id = 1; foreach (Task t in taskList) { t.Id = id; taskQueue.Enqueue(t); id++; } taskList.Clear(); taskList = null; }
public Form1() { InitializeComponent(); // Create a new connection if (!Task.debug) { arduino = new ArduinoUno("COM4"); arduino.SetPinMode(ArduinoUnoPins.D13, PinModes.Output); } this.FormClosed += Form1_FormClosed; tDisplay = new TaskDisplay(); }