public void Connect(string IP) { if (IP.Contains(" ")) { tub = new Tube(IP.Split(' ')[0], IP.Split(' ')[1]); // UTC and Spellman control } else { tub = new Tube(IP); // UTC control only } tub.updateControls += UpdateControls; Thread.Sleep(500); if (tub.connected) { ledStatus.Caption = Name; tub.log = new Log($@"{ Settings.Default.SaveFolder }\{ Name }.txt", 10); tub.Log_AddHeaders(); tmrUpdate.Start(); } else { Dispose(); } }
private void chkLog_CheckedChanged(object sender, EventArgs e) { tmrLog.Enabled = numLog.Enabled = chkLog.Checked; lnkLog.Enabled = !chkLog.Checked; if (chkLog.Checked && lnkLog.Text.Length > 0) { tub.log = new Log(lnkLog.Text, 30); tub.Log_AddHeaders(); tub.log.Write($"Testbox { testbox }"); tub.log.Write($"SN { tub.serialNum }"); tub.log.Write(tub.tubNum); tub.log.Write(tub.psType); } else if (!chkLog.Checked) { tub.log.Dispose(); } }