public void Activate(ref MdacControl[] mdacControls, ref Button[] dacButtons) { if (mdacControls.Length != 4 || dacButtons.Length != 2) { throw new Exception("wrong number of components. mdacs: " + mdacControls.Length + " dacs: " + dacButtons.Length); } // Set initial button colors this.Update(() => this.adcButton.BackColor = Color.DimGray); _dacs = dacButtons; for (int i = 0; i < 4; i++) { mdacs[i].Activate(ref mdacControls[i]); } isActive = true; dac1 = 0; dac2 = 0; }
public void Activate(ref MdacControl mdac) { this._mdac = mdac; if (!this._mdac.CompareId(_id)) MessageBox.Show("mdac IDs don't match"); isActive = true; cal1 = 0; cal2 = 0; disable = 1; }
public void Deactivate() { this.isActive = false; this._mdac = null; }
public Mdac(uint id) { _mdac = null; _id = id; correction0 = (uint) 1 << (11 - (int) _id); // = 2^(11-_id) correction1 = (uint) 1 << (12 - (int) _id); }