move bms
This commit is contained in:
28
Cs_HMI/TestProject/Test_BMS/Form1.Designer.cs
generated
28
Cs_HMI/TestProject/Test_BMS/Form1.Designer.cs
generated
@@ -36,6 +36,8 @@
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.logTextBox1 = new arCtl.LogTextBox();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.button5 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// comboBox1
|
||||
@@ -123,17 +125,39 @@
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(301, 61);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(220, 20);
|
||||
this.button3.Size = new System.Drawing.Size(140, 20);
|
||||
this.button3.TabIndex = 5;
|
||||
this.button3.Text = "send query";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(447, 60);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(140, 20);
|
||||
this.button4.TabIndex = 6;
|
||||
this.button4.Text = "send query";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||
//
|
||||
// button5
|
||||
//
|
||||
this.button5.Location = new System.Drawing.Point(155, 61);
|
||||
this.button5.Name = "button5";
|
||||
this.button5.Size = new System.Drawing.Size(140, 20);
|
||||
this.button5.TabIndex = 7;
|
||||
this.button5.Text = "send query";
|
||||
this.button5.UseVisualStyleBackColor = true;
|
||||
this.button5.Click += new System.EventHandler(this.button5_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(574, 450);
|
||||
this.Controls.Add(this.button5);
|
||||
this.Controls.Add(this.button4);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.logTextBox1);
|
||||
this.Controls.Add(this.label2);
|
||||
@@ -161,6 +185,8 @@
|
||||
private System.Windows.Forms.Label label2;
|
||||
private arCtl.LogTextBox logTextBox1;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.Button button5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -17,10 +18,10 @@ namespace Test_BMS
|
||||
InitializeComponent();
|
||||
bms = new arDev.BMS();
|
||||
bms.BMSDataReceive += Bms_BMSDataReceive;
|
||||
//bms.Message += Bms_Message;
|
||||
bms.Message += Bms_Message;
|
||||
}
|
||||
|
||||
private void Bms_Message(object sender, arDev.arRS232.MessageEventArgs e)
|
||||
private void Bms_Message(object sender, arRS232.MessageEventArgs e)
|
||||
{
|
||||
var sb = new System.Text.StringBuilder();
|
||||
if (e.Data != null)
|
||||
@@ -29,7 +30,10 @@ namespace Test_BMS
|
||||
sb.Append(" " + b.ToString("X2"));
|
||||
}
|
||||
else sb.Append(e.Message);
|
||||
addmsg($"{e.MsgType}:{sb}");
|
||||
if (e.MsgType == arRS232.MessageType.Error)
|
||||
addmsg(e.Message);
|
||||
else
|
||||
addmsg($"{e.MsgType}:{sb}");
|
||||
}
|
||||
|
||||
private void Bms_BMSDataReceive(object sender, EventArgs e)
|
||||
@@ -54,10 +58,6 @@ namespace Test_BMS
|
||||
}
|
||||
}
|
||||
|
||||
private void Bms_RxData(object sender, arDev.BMS.ReceiveDataEventArgs e)
|
||||
{
|
||||
addmsg("Rx:" + e.StrValue);
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -81,12 +81,22 @@ namespace Test_BMS
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
bms.SendQuery();
|
||||
bms.SendQuery_ReadStatue();
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
comboBox1.Text = "COM41";
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
bms.SendQuery_ReadCellvoltage();
|
||||
}
|
||||
|
||||
private void button5_Click(object sender, EventArgs e)
|
||||
{
|
||||
bms.SendQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,10 +83,6 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\SubProject\BMS\BMS.csproj">
|
||||
<Project>{7a94c30c-6772-4f71-bf9c-0df071a1bc70}</Project>
|
||||
<Name>BMS</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SubProject\CommData\CommData.csproj">
|
||||
<Project>{14e8c9a5-013e-49ba-b435-efefc77dd623}</Project>
|
||||
<Name>CommData</Name>
|
||||
|
||||
Reference in New Issue
Block a user