public ShuttleEventArgs(int zone, ShuttleDirection direction, DeviceType device, DeviceNo deviceNo) { Zone = zone; Direction = direction; Device = device; DeviceNumber = deviceNo; }
private void button2_Click(object sender, EventArgs e) { //Unregister devices... DeviceType _deviceType = (DeviceType)(comboBox1.SelectedIndex + 1); DeviceNo _deviceNo = DeviceNo.SHUTTLEPRIMARY; if (radioButton1.Checked) { _deviceNo = DeviceNo.SHUTTLEPRIMARY; } else { _deviceNo = DeviceNo.SHUTTLEPRIMARY; } //Try to unregister the selected device... ErrorCode result = (ErrorCode)_shuttle.UnregisterCallBack(_deviceType, _deviceNo); //Reset status texts... textBox1.Text = "-"; textBox2.Text = "-"; textBox3.Text = "-"; //Report the error (status) code to user... MessageBox.Show(Convert.ToString("Unregister device result code is: " + result)); }
/// <summary> /// Registers the device to recieve event notifications from the Shuttle driver /// </summary> /// <param name="Device">ShuttleNET.DeviceType enumeration describing the device to be registered globally</param> /// <param name="DeviceNumber">ShuttleNET.DeviceType enumeration describing the device position (number) to be registered globally</param> /// <returns>An integer value of type ShuttleNet.ErrorCode which denotes the result of the function call</returns> public int RegisterCallBackGlobal(DeviceType Device, DeviceNo DeviceNumber) { callback = new ShuttleCallback(Shuttle_Callback); int result = (int)_Shuttle_RegisterCallback_Global_Msg(callback, (ushort)Device, (ushort)DeviceNumber); return(result); }
private void button1_Click(object sender, EventArgs e) { //****Register callback locally (only recieves events when THIS APP has focus)**** DeviceType _deviceType = (DeviceType)(comboBox1.SelectedIndex + 1); DeviceNo _deviceNo = DeviceNo.SHUTTLEPRIMARY; if (radioButton1.Checked) { _deviceNo = DeviceNo.SHUTTLEPRIMARY; } else { _deviceNo = DeviceNo.SHUTTLEPRIMARY; } //Try to register the selected device... ErrorCode result = (ErrorCode)_shuttle.RegisterCallBack(_deviceType, _deviceNo); //USE THIS: _shuttle.RegisterCallbackGlobal(_deviceType, _deviceNo); to register for global events...l //Report the error status code to user... MessageBox.Show(Convert.ToString("Register device result code is: " + result)); }
public ButtonClickEventArgs(int Button, DeviceType device, DeviceNo deviceNo) { ButtonNumber = Button; Device = device; DeviceNumber = deviceNo; }
public JogEventArgs(JogDirection direction, DeviceType device, DeviceNo deviceNo) { Direction = direction; Device = device; DeviceNumber = deviceNo; }
/// <summary> /// Unegisters the device from receiving event notifications from the Shuttle driver /// </summary> /// <param name="Device">ShuttleNET.DeviceType enumeration describing the device to be unregistered</param> /// <param name="DeviceNumber">ShuttleNET.DeviceType enumeration describing the device position (number) to be unregistered</param> /// <returns>An integer value of type ShuttleNet.ErrorCode which denotes the result of the function call</returns> public int UnregisterCallBack(DeviceType Device, DeviceNo DeviceNumber) { int result = (int)_Shuttle_UnregisterCallback_Msg((ushort)Device, (ushort)DeviceNumber); return(result); }