public static void ReloadSystemConfig() { bool wasRunning = Execution.IsOpen; Execution.CloseExecution(); // purge all existing elements, nodes, and controllers (to try and clean up a bit). // might not actually matter, since we're going to make new Managers for them all // in a tick, but better safe than sorry. foreach (ElementNode cn in Nodes.ToArray()) { Nodes.RemoveNode(cn, null, true); } foreach (OutputController oc in OutputControllers.ToArray()) { OutputControllers.Remove(oc); } foreach (SmartOutputController smartOutputController in SmartOutputControllers.ToArray()) { SmartOutputControllers.Remove(smartOutputController); } foreach (OutputPreview outputPreview in Previews.ToArray()) { Previews.Remove(outputPreview); } LoadSystemConfig(); if (wasRunning) { Execution.OpenExecution(); } }
/// <summary> /// Finishes the cabinet /// </summary> public void Finish() { Log.Write("Finishing cabinet"); Toys.Finish(); OutputControllers.Finish(); Log.Write("Cabinet finished"); }
/// <summary> /// Initializes the cabinet. /// <param name="CabinetOwner">The ICabinetOwner object for the cabinet instance.</param> /// </summary> public void Init(ICabinetOwner CabinetOwner) { Log.Write("Initializing cabinet"); this.Owner = CabinetOwner; OutputControllers.Init(this); Toys.Init(this); Log.Write("Cabinet initialized"); }
/// <summary> /// Calls the update method for toys and output controllers in the cabinet /// </summary> public void Update() { //Log.Write("Cabinet.Update... "); Toys.UpdateOutputs(); OutputControllers.Update(); }