private void SwitchThread() { while (DriverConnected[Convert.ToByte(DeviceType.Switch)]) { Thread.Sleep(250); } buttonConnectFilterWheel.Text = "Connect"; TSwitch.Abort(); }
public void Test_TSwitch() { var tSwitch = new TSwitch(1, 1, 10, (t) => { Console.WriteLine($"changed, current:{t}"); }); Console.WriteLine($"init, current:{tSwitch.CurrentSwitch}"); var i = 0; while (i < 100) { var counter = tSwitch.IncreaseCounter(); Console.WriteLine($"{i}. counter:{counter}, current:{tSwitch.CurrentSwitch}"); i++; } }