private void Pid_getFeed(object sender, EventArgs e) { PidCalculator.FeedbackArg arg = (PidCalculator.FeedbackArg)e; System.Console.Out.WriteLine(arg.kind); System.Console.Out.WriteLine(arg.output); System.Console.Out.WriteLine(arg.targetIsUpdated); }
private void Pid_getFeed(object sender, PidCalculator.FeedbackArg e) { if (e.kind == PidCalculator.FeedbackArg.Kind.READOUTPUT) { module.outputTap(e.output > thresh ? e.output : thresh); this.Invoke(new UpdateLog(updateLog), e.output.ToString()); } else if (e.kind == PidCalculator.FeedbackArg.Kind.WRITETARGET) { if (e.targetIsUpdated) { this.Invoke(new UpdateLog(updateLog), "目标温度更新成功"); this.Invoke(new UpdateChart(updateTarget), target); } else { this.Invoke(new UpdateLog(updateLog), "目标温度更新失败"); } } }