示例#1
0
        /// <summary>
        /// This method is called whenever the value of a output in the Outputs property changes its value.<br />
        /// It updates the internal array holding the states of the PacDrive outputs.
        /// </summary>
        /// <param name="Output">The output.</param>
        /// <exception cref="System.Exception">
        /// The OutputValueChanged event handler for the PacDrive uni has been called by a sender which is not a OutputNumbered.
        /// or
        /// PacDrive output numbers must be in the range of 1-16. The supplied output number {0} is out of range..Build(ON.Number)
        /// </exception>
        protected override void OnOutputValueChanged(IOutput Output)
        {
            if (!(Output is IOutput))
            {
                throw new Exception("The OutputValueChanged event handler for the PacDrive uni has been called by a sender which is not a OutputNumbered.");
            }
            IOutput ON = Output;

            if (!ON.Number.IsBetween(1, 64))
            {
                throw new Exception("PacDrive output numbers must be in the range of 1-16. The supplied output number {0} is out of range.".Build(ON.Number));
            }

            PacDriveInstance.UpdateValue(ON);
        }
示例#2
0
        /// <summary>
        /// This method is called whenever the value of a output in the Outputs property changes its value.<br />
        /// It updates the internal array holding the states of the PacDrive outputs.
        /// </summary>
        /// <param name="Output">The output.</param>
        /// <exception cref="System.Exception">
        /// The OutputValueChanged event handler for the PacDrive uni has been called by a sender which is not a OutputNumbered.
        /// or
        /// PacDrive output numbers must be in the range of 1-16. The supplied output number {0} is out of range..Build(ON.Number)
        /// </exception>
        protected override void OnOutputValueChanged(IOutput Output)
        {
            if (!(Output is IOutput))
            {
                throw new Exception("The OutputValueChanged event handler for the PacDrive uni has been called by a sender which is not a OutputNumbered.");
            }
            IOutput ON = Output;


            if (!ON.Number.IsBetween(1, 64))
            {
                throw new Exception("PacDrive output numbers must be in the range of 1-16. The supplied output number {0} is out of range.".Build(ON.Number));
            }

            //check for table overrides
            ON = TableOverrideSettings.Instance.getnewrecalculatedOutput(ON, 19, 0);

            //check for scheduled setting, note there seems to only be support for a single [19] pacdrive?
            PacDriveInstance.UpdateValue(ScheduledSettings.Instance.getnewrecalculatedOutput(ON, 19, 0));
        }
示例#3
0
 /// <summary>
 /// Finishes the PacDrive object.<br/>
 /// Finish does also terminate the workerthread.
 /// </summary>
 public override void Finish()
 {
     PacDriveInstance.Finish();
     PacDriveInstance.ShutdownLighting();
     Log.Write("PacDrive finished and updater thread stopped.");
 }
示例#4
0
 /// <summary>
 /// Initializes the PacDrive object.<br />
 /// This method does also start the workerthread which does the actual update work when Update() is called.<br />
 /// This method should only be called once. Subsequent calls have no effect.
 /// </summary>
 /// <param name="Cabinet">The cabinet object which is using the output controller instance.</param>
 public override void Init(Cabinet Cabinet)
 {
     AddOutputs();
     PacDriveInstance.Init(Cabinet);
     Log.Write("PacDrive initialized and updater thread started.");
 }
示例#5
0
 /// <summary>
 /// Signals the workerthread that all pending updates for the PacDrive should be sent to the PacDrive.
 /// </summary>
 public override void Update()
 {
     PacDriveInstance.TriggerPacDriveUpdaterThread();
 }