/// <summary> /// Initialises the drive priority element. /// /// The log domain is set to [AgentName].DP.[drive_name] /// </summary> /// <param name="agent">The element's agent.</param> /// <param name="driveName">The name of the associated drive.</param> /// <param name="elements">The drive elements of the priority element.</param> public DrivePriorityElement(Agent agent, string driveName, DriveElement [] elements) : base(string.Format("DP.{0}", driveName), agent) { name = driveName; this.elements = new List <DriveElement>(elements); timer = agent.getTimer(); this.agent = agent; log.Debug("Created"); }
/// <summary> /// Loads the plan and creates the drive collection tree. /// /// The method parses the plan file, and then uses the plan builder to /// build the drive collection tree. /// </summary> /// <param name="planFile">Filename of the plan file that is loaded.</param> /// <returns></returns> internal override void LoadPlan(string planName) { // if setTimer() is not called, then the first use of // the timer will fail. setTimer() is called when the drive // collection is built. timer = null; // read plan, parse it and build drive collection PlanBuilder builder = new LAPParser().Parse(AssemblyControl.GetControl().GetPlanFile(library, planName)); dc = builder.build(this); }
/// <summary> /// Sets the agent timer. /// The agent timer determines the timing behaviour of an agent. /// Is is usually set when loading a plan, as the drive collection /// specifies if a stepped timer (DC) or a real-time timer (RDC) is /// required. /// </summary> /// <param name="timer">The agent's timer.</param> public void setTimer(TimerBase timer) { this.timer = timer; }