/// <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 PacLed64 outputs. /// </summary> /// <param name="Output">The output.</param> /// <exception cref="System.Exception"> /// The OutputValueChanged event handler for PacLed64 unit {0} (Id: {2:0}) has been called by a sender which is not a OutputNumbered.<br/> /// or<br/> /// PacLed64 output numbers must be in the range of 1-64. The supplied output number {0} is out of range. /// </exception> protected override void OnOutputValueChanged(IOutput Output) { IOutput ON = Output; if (!ON.Number.IsBetween(1, 64)) { throw new Exception("PacLed64 output numbers must be in the range of 1-64. The supplied output number {0} is out of range.".Build(ON.Number)); } PacLed64Unit S = PacLed64Units[this.Id]; S.UpdateValue(ON); }
/// <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 PacLed64 outputs. /// </summary> /// <param name="Output">The output.</param> /// <exception cref="System.Exception"> /// The OutputValueChanged event handler for PacLed64 unit {0} (Id: {2:0}) has been called by a sender which is not a OutputNumbered.<br/> /// or<br/> /// PacLed64 output numbers must be in the range of 1-64. The supplied output number {0} is out of range. /// </exception> public override void OnOutputValueChanged(IOutput Output) { if (!(Output is OutputNumbered)) { throw new Exception("The OutputValueChanged event handler for PacLed64 unit {0} (Id: {2:0}) has been called by a sender which is not a OutputNumbered.".Build(Name, Id)); } OutputNumbered ON = (OutputNumbered)Output; if (!ON.Number.IsBetween(1, 64)) { throw new Exception("PacLed64 output numbers must be in the range of 1-64. The supplied output number {0} is out of range.".Build(ON.Number)); } PacLed64Unit S = PacLed64Units[this.Id]; S.UpdateValue(ON); }
/// <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 PacLed64 outputs. /// </summary> /// <param name="Output">The output.</param> /// <exception cref="System.Exception"> /// The OutputValueChanged event handler for PacLed64 unit {0} (Id: {2:0}) has been called by a sender which is not a OutputNumbered.<br/> /// or<br/> /// PacLed64 output numbers must be in the range of 1-64. The supplied output number {0} is out of range. /// </exception> protected override void OnOutputValueChanged(IOutput Output) { IOutput ON = Output; if (!ON.Number.IsBetween(1, 64)) { throw new Exception("PacLed64 output numbers must be in the range of 1-64. The supplied output number {0} is out of range.".Build(ON.Number)); } PacLed64Unit S = PacLed64Units[this.Id]; //check for table overrides ON = TableOverrideSettings.Instance.getnewrecalculatedOutput(ON, 20, Id - 1); //note, compensate for id not being zero-based [20-23] S.UpdateValue(ScheduledSettings.Instance.getnewrecalculatedOutput(ON, 20, Id - 1)); }