public void UpdateFrameList(packetBase frame) { lstFrames.Invoke(new Action(() => { lstFrames.Items.Add(frame); if(scrollChk.Checked) lstFrames.SelectedIndex = lstFrames.Items.Count - 1; })); }
public DataEventArgs(packetBase frame) : base() { Frame = frame; }
private void SwitchToPacket(packetBase p) { frameNrInfoLbl.Text = ""+p.FrameNumber; lengthInfoLbl.Text = "" + p.Length; checksumInfoLbl.Text = "" + p.Checksum; typeInfoLbl.Text = "" + p.Type; recTimeInfoLbl.Text = ""+p.RecTime; hexTxtbox.Clear(); asciiTxtbox.Clear(); switch (p.Type) { case FrameType.ATCommand: break; case FrameType.ATCommandQPV: break; case FrameType.ATCommandResponse: break; case FrameType.InputLine16: InputLine16Control ctl = new InputLine16Control(); InputLine16 ip = (InputLine16)p; ctl.Dock = DockStyle.Fill; ctl.FillForm(ip, vref/resolution); frPanel.Controls.Add(ctl); ArrayList hex = ip.getHex(); foreach (byte b in hex) hexTxtbox.Text += "" + b.ToString("X").PadLeft(2, '0') + " "; foreach (byte b in hex) asciiTxtbox.Text += "" + System.Convert.ToChar(System.Convert.ToUInt32(""+b, 16)).ToString() + " "; break; case FrameType.InputLine64: break; case FrameType.ModemStatus: break; case FrameType.RemoteATCmdReq: break; case FrameType.RemoteCmdResp: break; case FrameType.RXPacket16: break; case FrameType.RXPacket64: break; case FrameType.TXReq16: break; case FrameType.TXReq64: break; case FrameType.TXStatus: break; case FrameType.Unknown: default: break; } while(frPanel.Controls.Count > 1) { Control c = frPanel.Controls[0]; frPanel.Controls.Remove(c); c.Dispose(); } }