优化光源控制器控制软件

develop
lhiven 6 months ago
parent b339b29b67
commit 3219f81d38

@ -1,40 +0,0 @@
namespace LightControl
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LightControl
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

@ -41,21 +41,26 @@ namespace Rs.MotionPlat.SysConfig
sp.Read(readBuffer, 0, len);
reciveData.AddRange(readBuffer.Take(len));
string buf = Encoding.ASCII.GetString(readBuffer, 0, len);
LogHelper.Debug(" >>> " + buf);
if (buf == "+OK")
{
reciveMsg = Encoding.ASCII.GetString(reciveData.ToArray());
reciveData.Clear();
Invoke(new Action(() => {
txtRunResult.AppendText(reciveMsg + Environment.NewLine);
txtRunResult.AppendText(Encoding.ASCII.GetString(reciveData.ToArray()) + Environment.NewLine);
}));
LogHelper.Debug(Encoding.ASCII.GetString(reciveData.ToArray()));
reciveData.Clear();
}
else if (buf.IndexOf("#") > 0)
{
reciveMsg = Encoding.ASCII.GetString(reciveData.ToArray());
reciveData.Clear();
Invoke(new Action(() => {
txtRunResult.AppendText(reciveMsg+Environment.NewLine);
txtRunResult.AppendText(Encoding.ASCII.GetString(reciveData.ToArray()) + Environment.NewLine);
}));
LogHelper.Debug(Encoding.ASCII.GetString(reciveData.ToArray()));
reciveData.Clear();
}
}
}
@ -85,6 +90,7 @@ namespace Rs.MotionPlat.SysConfig
{
string msg = "$RD=9999#";
sp.Write(msg);
LogHelper.Debug(" <<< " + msg);
reciveMsg = "";
Dictionary<string, string> kv = new Dictionary<string, string>();
while (true)
@ -168,7 +174,7 @@ namespace Rs.MotionPlat.SysConfig
string msg = "$SA=1#";
byte[] datas = Encoding.ASCII.GetBytes(msg);
sp.Write(datas, 0, datas.Length);
LogHelper.Debug(" <<< " + msg);
}
}
@ -197,6 +203,7 @@ namespace Rs.MotionPlat.SysConfig
{
byte[] datas = Encoding.ASCII.GetBytes(msg);
sp.Write(datas, 0, datas.Length);
LogHelper.Debug(" <<< " + msg);
}
});
}

@ -50,12 +50,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="LightConfig.cs">
<SubType>Form</SubType>
</Compile>

Loading…
Cancel
Save