public WayneKerr4300Emulator(string name) : base(name) { #if DEBUG Debug = new StreamWriter(@"D:\Steve\Projects\Microfab\C-V\C_V_App\wkDebug.dat"); #else var memStream = new MemoryStream(100); Debug = new StreamWriter(memStream); #endif _commandResponses = new Dictionary <string, CommandResponse>() { { "*IDN?", DeviceName }, { ":READ?", DataPoint }, { ":TRIG", DataPoint }, { ":MEAS:LEV?", ReturnLevel }, { ":MEAS:FREQ?", ReturnFreq }, { ":MEAS:FUNC1?", ReturnFunc1 }, { ":MEAS:FUNC2?", ReturnFunc2 } }; _readLineResponse = null; _state = SerialPortStates.Closed; _openDelegates = new VoidZero[] { AlreadyOpen, Closed2Open }; _closeDelegates = new VoidZero[] { Open2Closed, NotOpen }; _nullActionDelegates = new VoidZero[] { NullAction, NotOpen }; _writeLineDelegates = new VoidString[] { WriteLineDelegate, NotOpen }; _readLineDelegates = new StringZero[] { OpenReadLine, NotOpenReadLine }; }
public Keithley2400Emulator(string name) : base(name) { _commandResponses = new Dictionary <string, CommandResponse>() { { "*IDN?", DeviceName }, { "READ?", DataPoint }, { "SYSTem:RSENse?", Sensors }, { ":FORM:ELEM?", Headers } }; #if DEBUG Debug = new StreamWriter(@"D:\Steve\Projects\Microfab\C-V\C_V_App\kt_DEBUG.dat"); #else var memStream = new MemoryStream(100); Debug = new StreamWriter(memStream); #endif _readLineResponse = null; _state = SerialPortStates.Closed; _openDelegates = new VoidZero[] { AlreadyOpen, Closed2Open }; _closeDelegates = new VoidZero[] { Open2Closed, NotOpen }; _nullActionDelegates = new VoidZero[] { NullAction, NotOpen }; _writeLineDelegates = new VoidString[] { WriteLineDelegate, NotOpen }; _readLineDelegates = new StringZero[] { OpenReadLine, NotOpenReadLine }; }
private void SetVirtualPortDialog_Load(object sender, EventArgs e) { portDialog = new SetVirtualPortNameDialog(); setOffBtnStatus = new VoidString(SetOffBtnStatus); MainUnit mainform = this.Owner as MainUnit; if (mainform.VirtualPort.ComPort != 0) { portNameLbl.Text = String.Format("COM{0}", mainform.VirtualPort.ComPort); } onBtn.Enabled = !mainform.VirtualPort.Created; if (mainform.DummyTimerEnabled || mainform.WorkingTimerEnabled) { } else { offBtn.Enabled = !onBtn.Enabled; } selectNewPortBtn.Enabled = onBtn.Enabled; onOpenedHandler = new SerialNET.OnOpened(VirtualPort_OnOpened); onClosedHandler = new SerialNET.OnClosed(VirtualPort_OnClosed); mainform.VirtualPort.OnOpened += onOpenedHandler; mainform.VirtualPort.OnClosed += onClosedHandler; //if (mainform.DummyTimer.Enabled) // offBtn.Enabled = false; }
public void UserListRemoveItem(string str) { if (this.listBoxUsers.InvokeRequired) { VoidString listRemoveItem = UserListRemoveItem; this.textLog.Invoke(listRemoveItem, str); } else { this.listBoxUsers.Items.Remove(str); } }
public void Println(string str) { if (this.textLog.InvokeRequired) { VoidString println = Println; this.textLog.Invoke(println, str); } else { this.textLog.AppendText(str + Environment.NewLine); } }
/// <summary> /// update the keyword (replacing with '*') *******->*****a* /// </summary> /// <param name="s"></param> public void modifyKeyword(string s) { if (this.txbKeyword.InvokeRequired) { VoidString println = modifyKeyword; this.txbKeyword.Invoke(println, s); } else { this.txbKeyword.Text = s; } }
public void ComboBoxRemoveItem(string s) { if (this.comboBoxAllClients.InvokeRequired) { VoidString cbRmItem = ComboBoxRemoveItem; this.textBoxMsg.Invoke(cbRmItem, s); } else { this.comboBoxAllClients.Items.Remove(s); } }
public void loadAQuestion(string keyword, string hint) { if (this.txbKeyword.InvokeRequired && this.txbHint.InvokeRequired) { VoidString println = Println; this.txbKeyword.Text = keyword; this.txbHint.Text = hint; } else { this.txbKeyword.Text = keyword; this.txbHint.Text = hint; } }
private void MainUnit_Load(object sender, EventArgs e) { //SetPortParams(); addTab = this.AddTab; setProgress = SetProgress; getSelectedGrid = this.GetSelectedGrid; //addGrid = tabControl1.SelectedTab.Controls.Add; pagecount = 0; records = new List <FlashRecord>(); SerialNET.License license = new SerialNET.License(); license.LicenseKey = "SZ7336762100000043NYj4iaj4qdBSAaFA79"; virtualport = new SerialNET.VPort(); virtualport.OnOpened += new SerialNET.OnOpened(virtualport_OnOpened); virtualport.OnClosed += new SerialNET.OnClosed(virtualport_OnClosed); dummyTimer.AutoReset = true; dummyTimer.Elapsed += new System.Timers.ElapsedEventHandler(dummyTimer_Elapsed); workingTimer.AutoReset = true; workingTimer.Elapsed += new System.Timers.ElapsedEventHandler(workingTimer_Elapsed); setPlayBtnStatus = new VoidString(SetPlayBtnStatus); setStopBtnStatus = new VoidString(SetStopBtnStatus); try { if (System.IO.File.Exists(Application.StartupPath + @"\port.cfg")) { System.IO.Stream fstream = System.IO.File.OpenRead(Application.StartupPath + @"\port.cfg"); System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); string portname = (string)bf.Deserialize(fstream); SetupComPort(portname); fstream.Close(); } } #pragma warning disable 168 catch (Exception except) { } #pragma warning restore 168 }
private void AddUserForm_Load(object sender, EventArgs e) { setCardId = new VoidString(this.SetCardIdBox); listener = (this.Owner as GsmRingerProConfig).Listener; listener.CardIdReceived += new DeviceDataReceivedEventHandler(listener_CardIdReceived); }