private void SearchDevices() { long deviceNum = 0L; Cursor = Cursors.WaitCursor; try { deviceNum = K8055DLLWrapper.SearchDevices(); checkBoxDev0.Checked = (deviceNum & 1L) != 0L; checkBoxDev1.Checked = (deviceNum & 2L) != 0L; checkBoxDev2.Checked = (deviceNum & 4L) != 0L; checkBoxDev3.Checked = (deviceNum & 8L) != 0L; } finally { Cursor = Cursors.Default; } if ((deviceNum & 15L) == 0L) { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Exclamation; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("No devices were found.", "Vixen", false, false); messageBox.ShowDialog(); } }
public override void UpdateState(int chainIndex, ICommand[] outputStates) { for (int i = 0; i < 4; i++) { if (_Data.Modules[i].Enabled) { _commandHandler.Reset(); int start = _Data.Modules[i].StartChannel - _Offset; int end = Math.Min(start + 8, outputStates.Length); byte data = 0; ICommand command = outputStates[start++]; if (command != null) { while (start < end) { data >>= 1; if (_commandHandler.Value > 0) { data |= (byte)0x80; } else { data |= (byte)0; } } } else { data >>= 1; data |= (byte)0; } K8055DLLWrapper.Write(i, (long)data); } } }
public override void Stop() { for (int i = 0; i < 4; i++) { if (_Data.Modules[i].Enabled) { K8055DLLWrapper.Close(i); } } base.Stop(); }
public override void Start() { long numdevices = K8055DLLWrapper.SearchDevices(); for (int i = 0; i < 4; i++) { _Data.Modules[i].Enabled = (numdevices & (((int)1) << i)) != 0L; if (_Data.Modules[i].Enabled) { K8055DLLWrapper.Open(i); } } base.Start(); }
private void SearchDevices() { long deviceNum = 0L; Cursor = Cursors.WaitCursor; try { deviceNum = K8055DLLWrapper.SearchDevices(); checkBoxDev0.Checked = (deviceNum & 1L) != 0L; checkBoxDev1.Checked = (deviceNum & 2L) != 0L; checkBoxDev2.Checked = (deviceNum & 4L) != 0L; checkBoxDev3.Checked = (deviceNum & 8L) != 0L; } finally { Cursor = Cursors.Default; } if ((deviceNum & 15L) == 0L) { MessageBox.Show("No devices were found.", "Vixen", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void driverVersionButton_Click(object sender, EventArgs e) { K8055DLLWrapper.Version(); }