private void timer1_Tick(object sender, EventArgs e) { if (logicTask != null) { TaskCounter logic = (TaskCounter)FindPrivateProperty(logicTask, "LG"); //label1.Text = "任务状态:" + logic.Execute.ToString(); label2.Text = "步骤ID:" + logic.Step.ToString(); label3.Text = "任务结果:" + logic.Done.ToString(); label5.Text = "耗时:" + logicTask.Time.ToString(); } label4.Text = "状态机:" + Manager.FSM.Status.ID.ToString(); toolStripStatusLabel1.Text = "扫描时间:" + Manager.ScanfTime.ScanfAverageTime.ToString("0.00") + "ms"; toolStripStatusLabel2.Text = "最大扫描:" + Manager.ScanfTime.MaxScanfTime.ToString("0.00") + "ms"; }
/// <summary> /// 任务中数据重置 /// </summary> public virtual void Reset() { LG = new TaskCounter(this); }
public LogicTask(string name) { Name = name; LG = new TaskCounter(this); }