protected override void ApplyThreshold(IThreshold threshold) { if (threshold as ComponentDirectiveThreshold == null) { MessageBox.Show( "тип переданного порогового значения не соответстует типу порогового значения данного ЭУ", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } ComponentDirectiveThreshold detDirThresh = threshold as ComponentDirectiveThreshold; lifelengthViewer_FirstPerformance.Lifelength = detDirThresh.FirstPerformanceSinceNew; lifelengthViewer_FirstNotify.Lifelength = detDirThresh.FirstNotification; lifelengthViewerRptInterval.Lifelength = detDirThresh.RepeatInterval; lifelengthViewerRptNotify.Lifelength = detDirThresh.RepeatNotification; lifelengthViewerWarranty.Lifelength = detDirThresh.Warranty; lifelengthViewerWarrantyNotify.Lifelength = detDirThresh.WarrantyNotification; if (detDirThresh.FirstPerformanceConditionType == ThresholdConditionType.WhicheverFirst) { radio_WhicheverFirst.Checked = true; } else { radio_WhicheverLater.Checked = true; } }
protected override void ApplyThreshold(IThreshold threshold) { if (threshold as DirectiveThreshold == null) { MessageBox.Show( "тип переданного порогового значения не соответстует типу порогового значения данного ЭУ", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DirectiveThreshold dirThresh = threshold as DirectiveThreshold; // First Performance radio_FirstWhicheverLast.Checked = dirThresh.FirstPerformanceConditionType == ThresholdConditionType.WhicheverFirst ? false : true; if (dirThresh.FirstPerformanceSinceNew != null) { lifelengthViewer_SinceNew.Lifelength = dirThresh.FirstPerformanceSinceNew; } if (dirThresh.FirstPerformanceSinceEffectiveDate != null) { lifelengthViewer_SinceEffDate.Lifelength = dirThresh.FirstPerformanceSinceEffectiveDate; } if (dirThresh.FirstNotification != null) { lifelengthViewer_FirstNotify.Lifelength = dirThresh.FirstNotification; } // Repeat Interval radio_RepeatWhicheverLast.Checked = dirThresh.RepeatPerformanceConditionType == ThresholdConditionType.WhicheverFirst ? false : true; // Выбираем способ повторения директивы if (threshold.PerformRepeatedly) { checkBoxRepeat.Checked = true; } else { checkBoxRepeat.Checked = false; } radio_RepeatWhicheverFirst.Enabled = radio_RepeatWhicheverLast.Enabled = lifelengthViewer_Repeat.Enabled = lifelengthViewer_RepeatNotify.Enabled = checkBoxRepeat.Checked; if (dirThresh.RepeatInterval != null) { lifelengthViewer_Repeat.Lifelength = dirThresh.RepeatInterval; } if (dirThresh.RepeatNotification != null) { lifelengthViewer_RepeatNotify.Lifelength = dirThresh.RepeatNotification; } }
public void AddThressHolds(IThreshold thresshold) { lstIThreshold.Add(thresshold); }
public Engine(ILerp lerp, IThreshold threshold) { Lerp = lerp; Threshold = threshold; }
/// <summary> /// Заполняет все контролы в связи с заданным Threshold /// </summary> protected virtual void ApplyThreshold(IThreshold threshold) { }
public AlertMonitor(IHandleMessage <Message> handler, IThreshold threshold, IAppBus bus) { _bus = bus; _threshold = threshold; _handler = handler; }