/// <summary> /// Change the threshold for a specific hardware /// </summary> public void SetThreshold(HardwareSettings hws) { //Set new hardware limit this.InvokeTo <Sensor>(p => p.Hardware == hws.Hardware, hws.Threshold, "threshold"); //Tell all monitoring clients about the change this.InvokeToAll <Monitor>(hws.Threshold, "threshold" + hws.Hardware); }
static HardwareMapperInitialise() { Mapper.AddMap <HardwareSettings, HardwareSettingsDto>(x => { var settings = new HardwareSettingsDto(); settings.NetworkMonitoring.InjectFrom(x.NetworkMonitoring); settings.CpuMonitoring.InjectFrom(x.CpuMonitoring); settings.EmailAlertSettings.InjectFrom(x.EmailAlertSettings); settings.Drives = x.Drives .Select(c => new DriveSettingsDto().InjectFrom(c)).Cast <DriveSettingsDto>() .ToList(); return(settings); }); Mapper.AddMap <HardwareSettingsDto, HardwareSettings>(x => { var settings = new HardwareSettings(); settings.NetworkMonitoring.InjectFrom(x.NetworkMonitoring); settings.CpuMonitoring.InjectFrom(x.CpuMonitoring); settings.EmailAlertSettings.InjectFrom(x.EmailAlertSettings); settings.Drives = x.Drives .Select(c => new DriveSettings().InjectFrom(c)).Cast <DriveSettings>() .ToList(); return(settings); }); Mapper.AddMap <HardwareSettingsViewModel, HardwareSettingsDto>(x => { var settings = new HardwareSettingsDto(); settings.NetworkMonitoring.InjectFrom(x.NetworkMonitoring); settings.CpuMonitoring.InjectFrom(x.CpuMonitoring); settings.EmailAlertSettings.InjectFrom(x.EmailAlertSettings); settings.Drives = x.Drives .Select(c => new DriveSettingsDto().InjectFrom(c)).Cast <DriveSettingsDto>() .ToList(); return(settings); }); Mapper.AddMap <HardwareSettingsDto, HardwareSettingsViewModel>(x => { var settings = new HardwareSettingsViewModel(); settings.NetworkMonitoring.InjectFrom(x.NetworkMonitoring); settings.CpuMonitoring.InjectFrom(x.CpuMonitoring); settings.EmailAlertSettings.InjectFrom(x.EmailAlertSettings); settings.Drives = x.Drives .Select(c => new DriveSettingsViewModel().InjectFrom(c)).Cast <DriveSettingsViewModel>() .ToList(); return(settings); }); }
public ExperimentSettings() { HardwareSettings = new HardwareSettings(); CommonShift = HardwareSettings.CommonShift; }