/// <summary> /// This method is called whenever the value of a output in the Outputs property changes its value.<br /> /// Updates the internal arrays holding the states of the LedWiz outputs. /// </summary> /// <param name="Output">The output which has changed.</param> /// <exception cref="System.Exception"> /// The OutputValueChanged event handler for LedWiz {0:00} has been called by a sender which is not a LedWizOutput.<br/> /// or<br/> /// LedWiz output numbers must be in the range of 1-32. The supplied output number {0} is out of range. /// </exception> protected override void OnOutputValueChanged(IOutput Output) { if (!(Output is LedWizOutput)) { throw new Exception("The OutputValueChanged event handler for LedWiz {0:00} has been called by a sender which is not a LedWizOutput.".Build(Number)); } LedWizOutput LWO = (LedWizOutput)Output; if (!LWO.LedWizOutputNumber.IsBetween(1, 32)) { throw new Exception("LedWiz output numbers must be in the range of 1-32. The supplied output number {0} is out of range.".Build(LWO.LedWizOutputNumber)); } LedWizUnit S = LedWizUnits[this.Number]; S.UpdateValue(LWO); }
/// <summary> /// This method is called whenever the value of a output in the Outputs property changes its value.<br /> /// Updates the internal arrays holding the states of the LedWiz outputs. /// </summary> /// <param name="Output">The output which has changed.</param> /// <exception cref="System.Exception"> /// The OutputValueChanged event handler for LedWiz {0:00} has been called by a sender which is not a LedWizOutput.<br/> /// or<br/> /// LedWiz output numbers must be in the range of 1-32. The supplied output number {0} is out of range. /// </exception> protected override void OnOutputValueChanged(IOutput Output) { if (!(Output is LedWizOutput)) { throw new Exception("The OutputValueChanged event handler for LedWiz {0:00} has been called by a sender which is not a LedWizOutput.".Build(Number)); } LedWizOutput LWO = (LedWizOutput)Output; if (!LWO.LedWizOutputNumber.IsBetween(1, 32)) { throw new Exception("LedWiz output numbers must be in the range of 1-32. The supplied output number {0} is out of range.".Build(LWO.LedWizOutputNumber)); } LedWizUnit S = LedWizUnits[this.Number]; //S.UpdateValue(LWO); //uses ledwizoutput instead of standard output, need to mirror ledwizoutputnumber //note, compensate for id [1-16] not being zero-based IOutput recalculatedOutput = ScheduledSettings.Instance.getnewrecalculatedOutput(Output, 1, Number - 1); LWO.Value = recalculatedOutput.Value; S.UpdateValue(LWO); }