Permalink
Browse files

Fix baudrate error: baudrate was not set when opening port. Reformat …

…window.
  • Loading branch information...
1 parent 6fcdb46 commit ada9586b7d5560561a3a1fcfd49638e22d02faff @NiceCircuits committed Nov 19, 2015
Showing with 135 additions and 17 deletions.
  1. BIN DualTerminal.suo
  2. +134 −17 DualTerminal/Form1.Designer.cs
  3. +1 −0 DualTerminal/Form1.cs
View
Binary file not shown.
@@ -30,7 +30,6 @@ private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
- this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.toolStripComboBoxPort1 = new System.Windows.Forms.ToolStripComboBox();
this.toolStripComboBoxPort2 = new System.Windows.Forms.ToolStripComboBox();
@@ -43,25 +42,30 @@ private void InitializeComponent()
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.serialPort2 = new System.IO.Ports.SerialPort(this.components);
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.richTextBox1 = new System.Windows.Forms.RichTextBox();
+ this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
+ this.splitContainer2.Panel1.SuspendLayout();
+ this.splitContainer2.Panel2.SuspendLayout();
+ this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// serialPort1
//
this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
//
- // richTextBox1
- //
- this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.richTextBox1.Location = new System.Drawing.Point(0, 27);
- this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.Size = new System.Drawing.Size(1095, 680);
- this.richTextBox1.TabIndex = 2;
- this.richTextBox1.Text = "";
- //
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -74,7 +78,7 @@ private void InitializeComponent()
this.clearToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
- this.menuStrip1.Size = new System.Drawing.Size(1095, 27);
+ this.menuStrip1.Size = new System.Drawing.Size(1082, 27);
this.menuStrip1.TabIndex = 3;
this.menuStrip1.Text = "menuStrip1";
//
@@ -147,7 +151,7 @@ private void InitializeComponent()
this.toolStripStatusLabel2});
this.statusStrip1.Location = new System.Drawing.Point(0, 710);
this.statusStrip1.Name = "statusStrip1";
- this.statusStrip1.Size = new System.Drawing.Size(1095, 22);
+ this.statusStrip1.Size = new System.Drawing.Size(1082, 22);
this.statusStrip1.TabIndex = 4;
this.statusStrip1.Text = "statusStrip1";
//
@@ -167,13 +171,109 @@ private void InitializeComponent()
//
this.serialPort2.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort2_DataReceived);
//
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 27);
+ this.splitContainer1.Name = "splitContainer1";
+ this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.richTextBox1);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
+ this.splitContainer1.Size = new System.Drawing.Size(1082, 683);
+ this.splitContainer1.SplitterDistance = 634;
+ this.splitContainer1.TabIndex = 7;
+ //
+ // richTextBox1
+ //
+ this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.richTextBox1.Location = new System.Drawing.Point(0, 0);
+ this.richTextBox1.Name = "richTextBox1";
+ this.richTextBox1.Size = new System.Drawing.Size(1082, 634);
+ this.richTextBox1.TabIndex = 3;
+ this.richTextBox1.Text = "";
+ //
+ // splitContainer2
+ //
+ this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer2.IsSplitterFixed = true;
+ this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer2.Name = "splitContainer2";
+ //
+ // splitContainer2.Panel1
+ //
+ this.splitContainer2.Panel1.Controls.Add(this.button1);
+ this.splitContainer2.Panel1.Controls.Add(this.label1);
+ this.splitContainer2.Panel1.Controls.Add(this.textBox1);
+ //
+ // splitContainer2.Panel2
+ //
+ this.splitContainer2.Panel2.Controls.Add(this.label2);
+ this.splitContainer2.Panel2.Controls.Add(this.textBox2);
+ this.splitContainer2.Size = new System.Drawing.Size(1082, 45);
+ this.splitContainer2.SplitterDistance = 541;
+ this.splitContainer2.TabIndex = 0;
+ //
+ // textBox1
+ //
+ this.textBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.textBox1.ForeColor = System.Drawing.Color.Red;
+ this.textBox1.Location = new System.Drawing.Point(0, 25);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(541, 20);
+ this.textBox1.TabIndex = 0;
+ //
+ // textBox2
+ //
+ this.textBox2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.textBox2.ForeColor = System.Drawing.Color.Blue;
+ this.textBox2.Location = new System.Drawing.Point(0, 25);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(537, 20);
+ this.textBox2.TabIndex = 1;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.ForeColor = System.Drawing.Color.Red;
+ this.label1.Location = new System.Drawing.Point(3, 3);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(71, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Send to port1";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.ForeColor = System.Drawing.Color.Blue;
+ this.label2.Location = new System.Drawing.Point(3, 3);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(71, 13);
+ this.label2.TabIndex = 1;
+ this.label2.Text = "Send to port2";
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(416, 2);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "button1";
+ this.button1.UseVisualStyleBackColor = true;
+ //
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1095, 732);
+ this.ClientSize = new System.Drawing.Size(1082, 732);
+ this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.statusStrip1);
- this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
@@ -183,6 +283,16 @@ private void InitializeComponent()
this.menuStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+ this.splitContainer1.ResumeLayout(false);
+ this.splitContainer2.Panel1.ResumeLayout(false);
+ this.splitContainer2.Panel1.PerformLayout();
+ this.splitContainer2.Panel2.ResumeLayout(false);
+ this.splitContainer2.Panel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
+ this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -191,7 +301,6 @@ private void InitializeComponent()
#endregion
private System.IO.Ports.SerialPort serialPort1;
- private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripMenuItem refreshToolStripMenuItem;
@@ -204,6 +313,14 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.RichTextBox richTextBox1;
+ private System.Windows.Forms.SplitContainer splitContainer2;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Button button1;
}
}
@@ -92,6 +92,7 @@ private void openToolStripMenuItem_Click(object sender=null, EventArgs e=null)
{
serialPort1.PortName = toolStripComboBoxPort1.SelectedItem.ToString();
serialPort2.PortName = toolStripComboBoxPort2.SelectedItem.ToString();
+ serialPort1.BaudRate = Int32.Parse(toolStripComboBoxBaud.SelectedItem.ToString());
serialPort1.Open();
serialPort2.Open();
openToolStripMenuItem.Enabled = false;

0 comments on commit ada9586

Please sign in to comment.