Added ComPort

This commit is contained in:
2015-09-01 21:53:47 +02:00
parent 11b7e55cc9
commit 7bb15c63dd
5 changed files with 26 additions and 11 deletions
@@ -46,16 +46,16 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<Compile Include="MainWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="MainWindow.Designer.cs">
<DependentUpon>MainWindow.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<EmbeddedResource Include="MainWindow.resx">
<DependentUpon>MainWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@@ -1,6 +1,6 @@
namespace ErgometerSimulator
{
partial class Form1
partial class MainWindow
{
/// <summary>
/// Required designer variable.
@@ -30,12 +30,12 @@
{
this.SuspendLayout();
//
// Form1
// MainWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(370, 253);
this.Name = "Form1";
this.Name = "MainWindow";
this.Text = "Ergometer Simulator";
this.ResumeLayout(false);
@@ -10,9 +10,9 @@ using System.Windows.Forms;
namespace ErgometerSimulator
{
public partial class Form1 : Form
public partial class MainWindow : Form
{
public Form1()
public MainWindow()
{
InitializeComponent();
}
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
namespace ErgometerSimulator
{
@@ -16,7 +17,21 @@ namespace ErgometerSimulator
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new MainWindow());
startComportConnection();
}
private static void startComportConnection()
{
SerialPort comPort = new SerialPort();
comPort.PortName = "COM6";
comPort.DataBits = 8;
comPort.Parity = Parity.None;
comPort.StopBits = StopBits.One;
comPort.BaudRate = 9600;
}
}
}