This commit is contained in:
backuppc
2025-12-05 17:31:56 +09:00
parent 8459230053
commit 98d638cd9a
27 changed files with 819 additions and 987 deletions

View File

@@ -47,7 +47,7 @@
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(131, 20);
this.comboBox1.TabIndex = 0;
this.comboBox1.Text = "com15";
this.comboBox1.Text = "com6";
//
// button1
//

View File

@@ -18,22 +18,15 @@ namespace Test_BMS
InitializeComponent();
bms = new arDev.BMS();
bms.BMSDataReceive += Bms_BMSDataReceive;
bms.BMSCellDataReceive += Bms_BMSCellDataReceive;
bms.Message += Bms_Message;
this.Text = $"{Application.ProductName} ver{Application.ProductVersion}";
}
private void Bms_Message(object sender, arRS232.MessageEventArgs e)
private void Bms_BMSCellDataReceive(object sender, arDev.BMSCelvoltageEventArgs e)
{
var sb = new System.Text.StringBuilder();
if (e.Data != null)
{
foreach (var b in e.Data)
sb.Append(" " + b.ToString("X2"));
}
else sb.Append(e.Message);
if (e.MsgType == arRS232.MessageType.Error)
addmsg(e.Message);
else
addmsg($"{e.MsgType}:{sb}");
var valuestr = string.Join(" ", e.voltage.Select(t => t.ToString()));
addmsg($"voltage:{valuestr}");
}
private void Bms_BMSDataReceive(object sender, EventArgs e)
@@ -43,7 +36,32 @@ namespace Test_BMS
addmsg("Recv:" + msg);
}
private void Bms_Message(object sender, arDev.arRS232.MessageEventArgs e)
{
var sb = new System.Text.StringBuilder();
if (e.Data != null)
{
foreach (var b in e.Data)
sb.Append(" " + b.ToString("X2"));
}
else sb.Append(e.Message);
if (e.MsgType == arDev.arRS232.MessageType.Error)
addmsg(e.Message);
else if(e.MsgType == arDev.arRS232.MessageType.Send)
{
addmsg($"Tx:{sb}");
}
else if(e.MsgType == arDev.arRS232.MessageType.Recv)
{
addmsg($"Rx:{sb}");
}
else
addmsg($"{e.MsgType}:{sb}");
}
void addmsg(string m)
{
if (logTextBox1.InvokeRequired)

View File

@@ -18,7 +18,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\..\..\Amkor\AGV4\Test\</OutputPath>
<OutputPath>..\..\..\..\..\..\Amkor\AGV4\Test\BMS\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -50,6 +50,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Project\Device\BMS.cs">
<Link>BMS.cs</Link>
</Compile>
<Compile Include="..\..\Project\Device\BMSInformationEventArgs.cs">
<Link>BMSInformationEventArgs.cs</Link>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>