private void ProgrammeSelect_Load(object sender, EventArgs e) { programeSelectBox.Text = MainForm.clientConfig.program; comm = new ClientComm(MainForm.clientConfig.url); reflashPrograme(); programeSelectBox.Text = MainForm.clientConfig.program; }
private void _runner(object sender) { int index = (int)(sender); var comm = new ClientComm(clientConfig.url); var runFunc = new RunFunc(index); runFunc.SetUI(setRichText); runFunc.SetIO(comList[index]); comm.send("get", MainForm.clientConfig.program); string json = comm.recv(); Console.WriteLine(json); TaskConfig task = JsonConvert.DeserializeObject <TaskConfig>(json); initComPort(index); foreach (Logic logic in task.logic_list) { MethodInfo logicFunc = runFunc.GetType().GetMethod(logic.func); if (!(bool)(logicFunc.Invoke(runFunc, new object[] { logic }))) { break; } } }