private void DeviceSelectorControl_OnOnAddedDevice([CanBeNull] object sender, [CanBeNull] DeviceSelectorControl.DeviceAddedEventArgs e) { if (!CheckCombobox(AutoDevs.AssignableDevice, "Device")) { return; } if (!CheckCombobox(AutoDevs.TimeLimit, "Time Limit")) { return; } if (!CheckCombobox(AutoDevs.Location, "Location")) { return; } if (AutoDevs.SelectedDeviceType == AssignableDeviceType.Device || AutoDevs.SelectedDeviceType == AssignableDeviceType.DeviceCategory) { if (!CheckCombobox(AutoDevs.TimeBasedProfile, "TimeBasedProfile")) { return; } if (!CheckCombobox(AutoDevs.LoadType, "LoadType")) { return; } } var adev = AutoDevs.AssignableDevice; if (adev == null) { throw new LPGException("Bug: adev should never be null"); } var tp = AutoDevs.TimeBasedProfile; var timeStandardDeviation = AutoDevs.TimeDeviation; var vlt = AutoDevs.LoadType; var loc = (Location)AutoDevs.Location; var timeLimit = AutoDevs.TimeLimit; if (timeLimit == null) { Logger.Error("Time Limit was null, not adding"); return; } var variableValue = AutoDevs.VariableValue; var tc = AutoDevs.VariableCondition; var variable = AutoDevs.SelectedVariable; Presenter.AddAutoDev(adev, tp, timeStandardDeviation, vlt, timeLimit, loc, variableValue, tc, variable); }
private void MyStandby_OnOnAddedDevice([CanBeNull] object sender, [CanBeNull] DeviceSelectorControl.DeviceAddedEventArgs e) { if (MyStandbySelector.AssignableDevice == null) { Logger.Error("No Device selected."); return; } Presenter.ThisAffordance.AddStandby(MyStandbySelector.AssignableDevice); MyStandbySelector.ResizeColummns(); }
private void MyDeviceSelector_OnOnAddedDevice([CanBeNull] object sender, [CanBeNull] DeviceSelectorControl.DeviceAddedEventArgs e) { if (MyDeviceSelector.AssignableDevice == null) { Logger.Info("No device selected"); return; } Presenter.AddDeviceProfile(MyDeviceSelector.AssignableDevice, MyDeviceSelector.TimeBasedProfile, MyDeviceSelector.TimeOffset, MyDeviceSelector.LoadType, MyDeviceSelector.Probability / 100); MyDeviceSelector.ResizeColummns(); RefreshGraph(); }