public static eHardware GetFromSettings() { eHardware ret = eHardware.None; ret = GetFromInstance(Settings.Get <ICameraProxy>(), Settings.Get <ITurnTableProxy>(), Settings.Get <ILaserProxy>()); return(ret); }
void AlignInterface() { this.Hardware = eHardwareExt.GetFromSettings(); this.CameraButton.On = this.Hardware.IsSet(eHardware.Camera); this.TableButton.On = this.Hardware.IsSet(eHardware.Table); this.LaserButton.On = this.Hardware.IsSet(eHardware.Laser); }
public static eHardware GetFromInstance(ICameraProxy cam, ITurnTableProxy table, ILaserProxy laser) { eHardware ret = eHardware.None; ret = GetModified(ret, eHardware.Camera, cam != null); ret = GetModified(ret, eHardware.Table, table != null); ret = GetModified(ret, eHardware.Laser, laser != null); return(ret); }
public static eHardware GetModified(eHardware val, eHardware flag, bool set) { eHardware ret = val; if (set) { ret |= flag; } else { ret &= ~flag; } return(ret); }
private void OnIdle(object sender, EventArgs e) { try { bool ignore = false; if (!ignore && Visible) { eHardware hardware = eHardware.None; HardwareStatusControl ctrl = Settings.Get <HardwareStatusControl>(); if (ctrl != null) { hardware = ctrl.Hardware; } //TODO enableDisable.... } } catch { } }
public static bool IsSet(this eHardware val, eHardware set) { return((val & set) == set); }