commit e2dceb6bddb9d8e690594416615191a52deebe19 Author: XuJiacheng Date: Thu Dec 11 13:59:46 2025 +0800 初始值 diff --git a/.vs/NT-CAM_Controller/v16/.suo b/.vs/NT-CAM_Controller/v16/.suo new file mode 100644 index 0000000..f057618 Binary files /dev/null and b/.vs/NT-CAM_Controller/v16/.suo differ diff --git a/App.config b/App.config new file mode 100644 index 0000000..1c75772 --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CommunicationProtocol/CommunicationProtocol.vb b/CommunicationProtocol/CommunicationProtocol.vb new file mode 100644 index 0000000..2bddd87 --- /dev/null +++ b/CommunicationProtocol/CommunicationProtocol.vb @@ -0,0 +1,519 @@ +Imports System.IO.Ports +Imports System.Threading +Imports NT_CAM_Controller.SendNode + +Public Class CommunicationProtocol + '流程列表 + Public Property FlowList As List(Of (String, SendNode)) + Public IsFlowList As Boolean + '执行流程任务线程 + Public Property FlowThread As Task + Public IsFlowThread As Boolean + Public G_RichTextPrint As RichTextPrint + Public G_Transmitter As SerialPort + Public ControlDic As New Dictionary(Of Integer, Control) + + Sub New(RichTextPrint As RichTextPrint, gTransmitter As SerialPort) + + FlowList = New List(Of (String, SendNode)) + G_RichTextPrint = RichTextPrint + G_Transmitter = gTransmitter + '初始化FlowThread + IsFlowThread = True + FlowThread = New Task(AddressOf FlowThreadRun) + FlowThread.Start() + IsFlowList = False + ControlDic = New Dictionary(Of Integer, Control) + End Sub + + '添加控件列表 + Sub AddControlDic(ControlName As Integer, Control As Control) + If IsNothing(ControlDic) Then ControlDic = New Dictionary(Of Integer, Control) + If ControlDic.ContainsKey(ControlName) Then + ControlDic.Item(ControlName) = Control + Else + ControlDic.Add(ControlName, Control) + End If + + End Sub + + + '关闭 + Sub Close() + If FlowThread Is Nothing OrElse Not FlowThread.IsCompleted Then Return + FlowThread.Dispose() + End Sub + + '关闭线程 + Sub CloseThread() + If FlowThread Is Nothing OrElse Not FlowThread.IsCompleted Then Return + FlowThread.Dispose() + End Sub + '设置IsFlowThread + Sub SetIsFlowThread(mIsFlowThread As Boolean) + Me.IsFlowThread = mIsFlowThread + End Sub + Sub setIsFlowList(mIsFlowList As Boolean) + Me.IsFlowList = mIsFlowList + End Sub + + Public Function getIsFlowList() As Boolean + Return False + Return Me.IsFlowList + End Function + Public Function getIsFlowList1() As Boolean + + Return Me.IsFlowList + End Function + '执行流程任务 + Sub FlowThreadRun() + '流程节点执行状态 + Dim isnode As Boolean + Dim nli As New List(Of Integer) + While IsFlowThread + Thread.Sleep(1) + If IsNothing(FlowList) OrElse FlowList.Count = 0 Then + '延时100ms + Thread.Sleep(100) + Else + If IsFlowList Then + nli.Clear() + Dim FlowListCount As Integer = FlowList.Count + Console.WriteLine("FlowListCount:" & FlowListCount) + ' For Each node In FlowList + For i As Integer = 0 To FlowListCount - 1 + If Not IsFlowList Then + Exit For + End If + + Dim node As (String, SendNode) = FlowList(i) + + '判断本包是否超时接收 + If (node.Item2.SendCount >= node.Item2.MaxResendCount) OrElse node.Item2.RecvStatus = 1 Then + nli.Add(i) + Continue For + End If + + If IsFlowThread = False Then Exit For + While node.Item2.RecvStatus = SendNode.RecvStatusEnum.None + If Not node.Item2.IsRecvData Then + node.Item2.RecvRefresh(Nothing) + End If + If IsFlowThread = False Then Exit For + '判断是什么类型命令 + If node.Item2.CommandType = 0 Then + '系统命令 + isnode = SystemCommandSelector(node.Item1, node.Item2) + If isnode = False Then + 'MsgBox(node.Item2.TipInfo) + G_RichTextPrint.AddQueue(New RichTextNodeConfig(node.Item2.TipInfo, Color.Red), 1) + 'IsFlowList = False + Exit While + Else + Exit While + End If + + Else + '自定义命令 + isnode = CustomCommandSelector(node.Item1, node.Item2) + If isnode = False Then + nli.Add(i) + 'MsgBox(node.Item2.TipInfo) + 'G_RichTextPrint.AddQueue(New RichTextNodeConfig(node.Item2.TipInfo, Color.Red), 1) + 'IsFlowList = False + 'Else + Exit While + Else + 'Exit While + End If + End If + + + End While + Next + + + + '从大到小删除 + For Each i In nli.OrderByDescending(Function(x) x) + If Not IsFlowList Then + Exit For + End If + FlowList.RemoveAt(i) + Next + IsFlowList = False + Console.WriteLine($"流程节点数量:{FlowList.Count}") + End If + End If + End While + End Sub + '系统命令选择器 + Public Function SystemCommandSelector(nodename As String, ByRef mSendNode As SendNode) As Boolean + If mSendNode.SendData.Length > 0 Then + Select Case mSendNode.SendData(0) + Case 1 '系统延时 + If mSendNode.SendData.Length > 1 Then + mSendNode.ResendRefresh() + Thread.Sleep(mSendNode.SendData(1)) + mSendNode.RecvRefresh({mSendNode.SendData(1)}) + mSendNode.SetTipInfo("执行延时完成!") + Return True + Else + mSendNode.SetTipInfo($"{nodename}参数异常!") + Return False + End If + + End Select + Else + + mSendNode.SetTipInfo("系统命令参数异常!") + Return False + End If + End Function + + + '自定义命令选择器 + Public Function CustomCommandSelector(nodename As String, ByRef mSendNode As SendNode) As Boolean + Dim sendbuf As Byte() + If mSendNode.SendStatus = SendNode.SendStatusEnum.None Then + sendbuf = SendPortData1(nodename, mSendNode) + If IsNothing(sendbuf) OrElse sendbuf.Length = 0 Then + Return False + Else + Return SendPortData(nodename, mSendNode, sendbuf, G_Transmitter) + End If + + Else + '判断节点是否需要重新发送 + If mSendNode.NeedResend() Then + + sendbuf = SendPortData1(nodename, mSendNode) + If IsNothing(sendbuf) OrElse sendbuf.Length = 0 Then + Return False + Else + G_RichTextPrint.AddQueue(New RichTextNodeConfig($"第{mSendNode.SendCount}次重发数据", Color.Black), 1) + Return SendPortData(nodename, mSendNode, sendbuf, G_Transmitter) + End If + Else + If mSendNode.SendCount < mSendNode.MaxResendCount Then + + ElseIf mSendNode.SendCount = mSendNode.MaxResendCount Then + If mSendNode.SendTime.AddMilliseconds(mSendNode.SendTimeout) < Now Then + mSendNode.SendCount = mSendNode.SendCount + 1 + + Else + + End If + Else + mSendNode.RecvStatus = RecvStatusEnum.Timeout + mSendNode.SendStatus = SendStatusEnum.Timeout + ' IsRuningTest = False '退出流程 + 'RefreshCaptureText(Color.Red, $"节点:{node.Item1} :发送失败!") + + G_RichTextPrint.AddQueue(New RichTextNodeConfig($"发数据超时!", Color.Red), 1) + mSendNode.SetTipInfo($"发数据超时!") + Return False + End If + End If + Return True + End If + End Function + '获取发送数据 + Public Function SendPortData1(nodename As String, Mysenddata As SendNode) As Byte() + If IsNothing(Mysenddata) OrElse Mysenddata.SendData.Length = 0 Then Return Nothing + Return Mysenddata.SendData + End Function + '发送数据 + Public Function SendPortData(nodename As String, ByRef Mysenddata As SendNode, sendBytes As Byte(), mTransmitter As SerialPort) As Boolean + If IsNothing(G_Transmitter) OrElse G_Transmitter.IsOpen = False Then + G_RichTextPrint.AddQueue(New RichTextNodeConfig("发送器未打开!", Color.Red), 1) + Return False + End If + Try + '发送数据 + Mysenddata.SetSendData(sendBytes, Mysenddata.SendTimeout) + G_RichTextPrint.AddQueue(New RichTextNodeConfig("TX:", Color.Blue, New Font("宋体", 8), Mysenddata.SendData), 1) + G_Transmitter.Write(Mysenddata.SendData, 0, Mysenddata.SendData.Length) + '发送刷新对应数值 + Mysenddata.ResendRefresh() + Return True + Catch ex As Exception + G_RichTextPrint.AddQueue(New RichTextNodeConfig("发送器发送异常!", Color.Red), 1) + Return False + End Try + + End Function + Public Function SendPortData(sendBytes As Byte(), mTransmitter As SerialPort) As Boolean + If IsNothing(G_Transmitter) OrElse G_Transmitter.IsOpen = False Then + G_RichTextPrint.AddQueue(New RichTextNodeConfig("发送器未打开!", Color.Red), 1) + Return False + End If + Try + '发送数据 + + G_RichTextPrint.AddQueue(New RichTextNodeConfig("TX:", Color.Blue, New Font("宋体", 8), sendBytes), 1) + G_Transmitter.Write(sendBytes, 0, sendBytes.Length) + '发送刷新对应数值 + + Return True + Catch ex As Exception + G_RichTextPrint.AddQueue(New RichTextNodeConfig("发送器发送异常!", Color.Red), 1) + Return False + End Try + + End Function + + + '添加流程节点 + Public Function AddFlowNode(nodename As String, Mysenddata As SendNode) As Boolean + If FlowList Is Nothing Then Return False + FlowList.Add((nodename, Mysenddata)) + End Function + '清空流程节点 + Public Function ClearFlowNode(Optional isclear As Boolean = False) As Boolean + If FlowList Is Nothing Then Return False + If isclear Then + FlowList.Clear() + End If + 'FlowList.Clear() + End Function + + + '处理接收到的数据 + Public Function ProcessRecvData(RecvData() As Byte) As Boolean + If FlowList Is Nothing Then Return False + '判断数据包头是否合法 + If NT_CAM.IsDataValid(RecvData) Then + If RecvData(3) >= &HB0 Then + Dim sendbuf = NT_CAM.PackData(RecvData(3), {0}) + SendPortData(sendbuf, G_Transmitter) + ElseIf RecvData(3) >= &H10 AndAlso RecvData(3) < &HA0 Then + + + + Select Case RecvData(3) + Case &H18 + Dim sendbuf = NT_CAM.PackData(RecvData(3), {0}) + SendPortData(sendbuf, G_Transmitter) + Dim mControl As Control = ControlDic.Item(&H18) + If RecvData(6) = 0 Then + SharedFunction.SetFromUI(mControl, "未连接", Color.Black, Color.Red) + ElseIf RecvData(6) = 1 Then + SharedFunction.SetFromUI(mControl, "已连接", Color.Black, Color.Green) + Else + SharedFunction.SetFromUI(mControl, "连接异常", Color.Black, Color.Red) + End If + Return True + Case &H19 + Dim mControl As Control = ControlDic.Item(&H19) + Dim sendbuf = NT_CAM.PackData(RecvData(3), {0}) + SendPortData(sendbuf, G_Transmitter) + '获取数据长度 + Dim len As Integer = RecvData(5) * 256 + RecvData(4) + '判断数据长度是否合法 且长度能够取到 + If len > 0 AndAlso len <= RecvData.Length - 6 Then + '获取数据 + Dim data As Byte() = New Byte(len - 1) {} + Array.Copy(RecvData, 6, data, 0, len) + '将数组转换为字符串 + Dim str As String = SharedFunction.ByteToHexString(data) + SharedFunction.SetFromUI(mControl, str, Color.Black, Color.White) + End If + Return True + + + End Select + + + + + Dim node As SendNode + Dim nextNode As SendNode + For i = 0 To FlowList.Count - 1 + node = FlowList(i).Item2 + If node.SendStatus = SendNode.SendStatusEnum.Send Then + If node.RecvStatus = SendNode.RecvStatusEnum.None Then + If RecvData(3) = node.SendData(3) Then + node.RecvRefresh(RecvData) + End If + + End If + End If + Next + + + Else + Dim node As SendNode + Dim nextNode As SendNode + For i = 0 To FlowList.Count - 1 + node = FlowList(i).Item2 + If node.SendStatus = SendNode.SendStatusEnum.Send Then + If node.RecvStatus = SendNode.RecvStatusEnum.None Then + If RecvData(3) = node.SendData(3) Then + node.RecvRefresh(RecvData) + End If + + End If + End If + Next + End If + + End If + + End Function + + + + + +End Class + +Public Class SendNode + '命令类型 + Public Property CommandType As Integer '0:系统命令,1:自定义命令 + + '发送时间 + Public Property SendTime As DateTime + '发送数据 + Public Property SendData As Byte() + '重发次数 + Public Property SendCount As Integer + '重发间隔 + Public Property SendInterval As Integer + '超时时间 + Public Property SendTimeout As Integer + '发送状态 0:未发送 1:已发送 + Public Property SendStatus As Integer + '接收状态 + Public Property RecvStatus As Integer + '接收数据 + Public Property RecvDataLisr As List(Of Byte()) + + '提示信息 + Public Property TipInfo As String + + '最大重 发次数 + Public Property MaxResendCount As Integer + + '是否接收数据 + Public Property IsRecvData As Boolean + '控件对象 + Public Property Control As Control + + ''' + ''' 命令 + ''' + ''' + Sub New(mCommandType As Integer, Optional mMaxResendCoun As Integer = 3) + CommandType = mCommandType + RecvDataLisr = New List(Of Byte()) + MaxResendCount = mMaxResendCoun + IsRecvData = True + End Sub + + '设置控件 + Sub SetControl(mControl As Control) + Control = mControl + End Sub + + '发送状态枚举值 + Enum SendStatusEnum + '未发送 + None = 0 + '已发送 + Send = 1 + '发送超时 + Timeout = 2 + End Enum + + '接收状态枚举值 + Enum RecvStatusEnum + '未接收 + None = 0 + '已接收 + Recv = 1 + '接收超时 + Timeout = 2 + End Enum + + Sub New(Mysenddata() As Byte) + SendData = Mysenddata + SendInterval = 0 + SendTimeout = 1000 + RecvStatus = 0 + SendStatus = 0 + RecvDataLisr = New List(Of Byte()) + End Sub + '设置发送数据 + Sub SetSendData(Mysenddata() As Byte, Optional gSendTimeout As Integer = 1000) + SendData = Mysenddata + SendInterval = 0 + SendTimeout = gSendTimeout + RecvStatus = 0 + SendStatus = 0 + End Sub + + '接收数据并添加到接收列表 + Sub AddRecvData(RecvData() As Byte) + If RecvDataLisr Is Nothing Then + RecvDataLisr = New List(Of Byte()) + End If + RecvDataLisr.Add(RecvData) + End Sub + '判断需不需要重发 False 不需要重发 True 需要重发 + Function NeedResend() As Boolean + '如果接收状态为已加收, 则不需要重发 + If SendStatus = 1 AndAlso RecvStatus = 1 Then + Return False + Else + '如果发送状态为已发送,则判断是否超时,如果超时则返回True,否则返回False + If SendStatus = 1 Then + '判断是否到达最大重发次数 + If SendCount < MaxResendCount Then + + If SendTime.AddMilliseconds(SendTimeout) < Now Then + Return True + Else + Return False + End If + + Else + + 'RecvStatus = RecvStatusEnum.Timeout + 'SendStatus = SendStatusEnum.Timeout + Return False + End If + Else + Return True + End If + + End If + + End Function + + '重发刷新对应数值 + Sub ResendRefresh() + SendStatus = 1 + SendCount += 1 + SendTime = Now + End Sub + + '发送刷新对应数值 + Sub SendRefresh() + SendStatus = 1 + SendTime = Now + SendCount = 0 + End Sub + '接收刷新对应数值 + Sub RecvRefresh(Mysenddata() As Byte) + AddRecvData(Mysenddata) + RecvStatus = 1 + End Sub + + '设置提示信息 + Sub SetTipInfo(Mysenddata As String) + TipInfo = Mysenddata + End Sub + + +End Class diff --git a/CommunicationProtocol/NT_CAM.vb b/CommunicationProtocol/NT_CAM.vb new file mode 100644 index 0000000..d6b1cf1 --- /dev/null +++ b/CommunicationProtocol/NT_CAM.vb @@ -0,0 +1,28 @@ +Public Class NT_CAM + '包头 + Public Shared HeadData As Byte() = {&H55, &HAA} + '协议版本 + Public Shared protocolVersion As Byte = &H1 + + '数据组包 + Public Shared Function PackData(cmd As Byte, parbyf As Byte()) As Byte() + Dim li As List(Of Byte) = New List(Of Byte)() + li.AddRange(HeadData) '2 + li.Add(protocolVersion) '1 + li.Add(cmd) '1 + li.AddRange(SharedFunction.IntToByteLB(parbyf.Length)) '2 + li.AddRange(parbyf) + li.Add(SharedFunction.GetCheckSumMod2(li.ToArray)) + Return li.ToArray + End Function + + '判断数据是否合法 + Public Shared Function IsDataValid(data As Byte()) As Boolean + If data.Length < 7 Then Return False '数据长度小于7 + If data(0) <> HeadData(0) OrElse data(1) <> HeadData(1) Then Return False '包头不正确 + If data(data.Length - 1) <> SharedFunction.GetCheckSumMod(data) Then Return False '校验和不正确 + Return True + End Function + + +End Class diff --git a/Form1.Designer.vb b/Form1.Designer.vb new file mode 100644 index 0000000..06ffb4d --- /dev/null +++ b/Form1.Designer.vb @@ -0,0 +1,835 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 重写 Dispose,以清理组件列表。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Windows 窗体设计器所必需的 + Private components As System.ComponentModel.IContainer + + '注意: 以下过程是 Windows 窗体设计器所必需的 + '可以使用 Windows 窗体设计器修改它。 + '不要使用代码编辑器修改它。 + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) + Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() + Me.SplitContainer2 = New System.Windows.Forms.SplitContainer() + Me.TextBox8 = New System.Windows.Forms.TextBox() + Me.Label8 = New System.Windows.Forms.Label() + Me.TextBox7 = New System.Windows.Forms.TextBox() + Me.Label7 = New System.Windows.Forms.Label() + Me.CheckBox1 = New System.Windows.Forms.CheckBox() + Me.Btn_OpenPort = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Cbo_Baud = New System.Windows.Forms.ComboBox() + Me.Cbo_Port = New System.Windows.Forms.ComboBox() + Me.GroupBox8 = New System.Windows.Forms.GroupBox() + Me.Button16 = New System.Windows.Forms.Button() + Me.Label4 = New System.Windows.Forms.Label() + Me.Label3 = New System.Windows.Forms.Label() + Me.TextBox6 = New System.Windows.Forms.TextBox() + Me.Button15 = New System.Windows.Forms.Button() + Me.TextBox5 = New System.Windows.Forms.TextBox() + Me.GroupBox6 = New System.Windows.Forms.GroupBox() + Me.ComboBox2 = New System.Windows.Forms.ComboBox() + Me.Button11 = New System.Windows.Forms.Button() + Me.Button12 = New System.Windows.Forms.Button() + Me.GroupBox7 = New System.Windows.Forms.GroupBox() + Me.Button14 = New System.Windows.Forms.Button() + Me.TextBox4 = New System.Windows.Forms.TextBox() + Me.GroupBox5 = New System.Windows.Forms.GroupBox() + Me.Button13 = New System.Windows.Forms.Button() + Me.TextBox3 = New System.Windows.Forms.TextBox() + Me.GroupBox4 = New System.Windows.Forms.GroupBox() + Me.Button10 = New System.Windows.Forms.Button() + Me.TextBox2 = New System.Windows.Forms.TextBox() + Me.GroupBox3 = New System.Windows.Forms.GroupBox() + Me.ComboBox3 = New System.Windows.Forms.ComboBox() + Me.ComboBox1 = New System.Windows.Forms.ComboBox() + Me.Label6 = New System.Windows.Forms.Label() + Me.Label5 = New System.Windows.Forms.Label() + Me.Button8 = New System.Windows.Forms.Button() + Me.Button9 = New System.Windows.Forms.Button() + Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.Button7 = New System.Windows.Forms.Button() + Me.Button6 = New System.Windows.Forms.Button() + Me.Button4 = New System.Windows.Forms.Button() + Me.Button5 = New System.Windows.Forms.Button() + Me.Button3 = New System.Windows.Forms.Button() + Me.Button2 = New System.Windows.Forms.Button() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.TextBox9 = New System.Windows.Forms.TextBox() + Me.CheckBox2 = New System.Windows.Forms.CheckBox() + Me.Button1 = New System.Windows.Forms.Button() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.RichTextBox1 = New System.Windows.Forms.RichTextBox() + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() + Me.SerialPort1 = New System.IO.Ports.SerialPort(Me.components) + Me.Timer1 = New System.Windows.Forms.Timer(Me.components) + Me.Timer2 = New System.Windows.Forms.Timer(Me.components) + CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainer1.Panel1.SuspendLayout() + Me.SplitContainer1.Panel2.SuspendLayout() + Me.SplitContainer1.SuspendLayout() + CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainer2.Panel1.SuspendLayout() + Me.SplitContainer2.Panel2.SuspendLayout() + Me.SplitContainer2.SuspendLayout() + Me.GroupBox8.SuspendLayout() + Me.GroupBox6.SuspendLayout() + Me.GroupBox7.SuspendLayout() + Me.GroupBox5.SuspendLayout() + Me.GroupBox4.SuspendLayout() + Me.GroupBox3.SuspendLayout() + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.ToolStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'SplitContainer1 + ' + Me.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainer1.IsSplitterFixed = True + Me.SplitContainer1.Location = New System.Drawing.Point(0, 0) + Me.SplitContainer1.Name = "SplitContainer1" + ' + 'SplitContainer1.Panel1 + ' + Me.SplitContainer1.Panel1.Controls.Add(Me.SplitContainer2) + ' + 'SplitContainer1.Panel2 + ' + Me.SplitContainer1.Panel2.Controls.Add(Me.RichTextBox1) + Me.SplitContainer1.Panel2.Controls.Add(Me.ToolStrip1) + Me.SplitContainer1.Size = New System.Drawing.Size(1195, 788) + Me.SplitContainer1.SplitterDistance = 573 + Me.SplitContainer1.SplitterWidth = 1 + Me.SplitContainer1.TabIndex = 0 + ' + 'SplitContainer2 + ' + Me.SplitContainer2.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainer2.Location = New System.Drawing.Point(0, 0) + Me.SplitContainer2.Name = "SplitContainer2" + Me.SplitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal + ' + 'SplitContainer2.Panel1 + ' + Me.SplitContainer2.Panel1.Controls.Add(Me.TextBox8) + Me.SplitContainer2.Panel1.Controls.Add(Me.Label8) + Me.SplitContainer2.Panel1.Controls.Add(Me.TextBox7) + Me.SplitContainer2.Panel1.Controls.Add(Me.Label7) + Me.SplitContainer2.Panel1.Controls.Add(Me.CheckBox1) + Me.SplitContainer2.Panel1.Controls.Add(Me.Btn_OpenPort) + Me.SplitContainer2.Panel1.Controls.Add(Me.Label1) + Me.SplitContainer2.Panel1.Controls.Add(Me.Label2) + Me.SplitContainer2.Panel1.Controls.Add(Me.Cbo_Baud) + Me.SplitContainer2.Panel1.Controls.Add(Me.Cbo_Port) + ' + 'SplitContainer2.Panel2 + ' + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox8) + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox6) + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox7) + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox5) + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox4) + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox3) + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox2) + Me.SplitContainer2.Panel2.Controls.Add(Me.GroupBox1) + Me.SplitContainer2.Panel2.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.SplitContainer2.Size = New System.Drawing.Size(573, 788) + Me.SplitContainer2.SplitterDistance = 104 + Me.SplitContainer2.TabIndex = 2 + ' + 'TextBox8 + ' + Me.TextBox8.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox8.Location = New System.Drawing.Point(330, 67) + Me.TextBox8.MaxLength = 128 + Me.TextBox8.Name = "TextBox8" + Me.TextBox8.Size = New System.Drawing.Size(236, 29) + Me.TextBox8.TabIndex = 43 + Me.TextBox8.Text = "6B 65 65 70" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Label8.Location = New System.Drawing.Point(213, 72) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(114, 19) + Me.Label8.TabIndex = 42 + Me.Label8.Text = "保活包内容:" + ' + 'TextBox7 + ' + Me.TextBox7.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox7.Location = New System.Drawing.Point(142, 67) + Me.TextBox7.MaxLength = 128 + Me.TextBox7.Name = "TextBox7" + Me.TextBox7.Size = New System.Drawing.Size(68, 29) + Me.TextBox7.TabIndex = 41 + Me.TextBox7.Text = "30" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Label7.Location = New System.Drawing.Point(14, 72) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(125, 19) + Me.Label7.TabIndex = 40 + Me.Label7.Text = "时间间隔(S):" + ' + 'CheckBox1 + ' + Me.CheckBox1.AutoSize = True + Me.CheckBox1.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.CheckBox1.Location = New System.Drawing.Point(17, 40) + Me.CheckBox1.Name = "CheckBox1" + Me.CheckBox1.Size = New System.Drawing.Size(199, 23) + Me.CheckBox1.TabIndex = 39 + Me.CheckBox1.Text = "是否定期发送保活包" + Me.CheckBox1.UseVisualStyleBackColor = True + ' + 'Btn_OpenPort + ' + Me.Btn_OpenPort.Font = New System.Drawing.Font("宋体", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Btn_OpenPort.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Btn_OpenPort.Location = New System.Drawing.Point(419, 5) + Me.Btn_OpenPort.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Btn_OpenPort.Name = "Btn_OpenPort" + Me.Btn_OpenPort.Size = New System.Drawing.Size(148, 54) + Me.Btn_OpenPort.TabIndex = 38 + Me.Btn_OpenPort.Text = "打开" + Me.Btn_OpenPort.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.Font = New System.Drawing.Font("Consolas", 12.0!) + Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label1.Location = New System.Drawing.Point(6, 1) + Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(63, 30) + Me.Label1.TabIndex = 6 + Me.Label1.Text = "端口:" + Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'Label2 + ' + Me.Label2.Font = New System.Drawing.Font("Consolas", 12.0!) + Me.Label2.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.Label2.Location = New System.Drawing.Point(205, 1) + Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(78, 30) + Me.Label2.TabIndex = 8 + Me.Label2.Text = "波特率:" + Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight + ' + 'Cbo_Baud + ' + Me.Cbo_Baud.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.Cbo_Baud.Font = New System.Drawing.Font("Consolas", 9.75!) + Me.Cbo_Baud.FormattingEnabled = True + Me.Cbo_Baud.Items.AddRange(New Object() {"1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200", "256000", "512000", "9216000", "1000000"}) + Me.Cbo_Baud.Location = New System.Drawing.Point(288, 5) + Me.Cbo_Baud.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Cbo_Baud.Name = "Cbo_Baud" + Me.Cbo_Baud.Size = New System.Drawing.Size(126, 23) + Me.Cbo_Baud.TabIndex = 9 + ' + 'Cbo_Port + ' + Me.Cbo_Port.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.Cbo_Port.Font = New System.Drawing.Font("Consolas", 9.75!) + Me.Cbo_Port.FormattingEnabled = True + Me.Cbo_Port.Location = New System.Drawing.Point(74, 5) + Me.Cbo_Port.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.Cbo_Port.Name = "Cbo_Port" + Me.Cbo_Port.Size = New System.Drawing.Size(126, 23) + Me.Cbo_Port.TabIndex = 7 + ' + 'GroupBox8 + ' + Me.GroupBox8.Controls.Add(Me.Button16) + Me.GroupBox8.Controls.Add(Me.Label4) + Me.GroupBox8.Controls.Add(Me.Label3) + Me.GroupBox8.Controls.Add(Me.TextBox6) + Me.GroupBox8.Controls.Add(Me.Button15) + Me.GroupBox8.Controls.Add(Me.TextBox5) + Me.GroupBox8.Dock = System.Windows.Forms.DockStyle.Top + Me.GroupBox8.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox8.Location = New System.Drawing.Point(0, 367) + Me.GroupBox8.Name = "GroupBox8" + Me.GroupBox8.Size = New System.Drawing.Size(573, 171) + Me.GroupBox8.TabIndex = 10 + Me.GroupBox8.TabStop = False + Me.GroupBox8.Text = "TCP透传" + ' + 'Button16 + ' + Me.Button16.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button16.Location = New System.Drawing.Point(443, 59) + Me.Button16.Name = "Button16" + Me.Button16.Size = New System.Drawing.Size(131, 29) + Me.Button16.TabIndex = 13 + Me.Button16.Text = "查询网络状态" + Me.Button16.UseVisualStyleBackColor = True + ' + 'Label4 + ' + Me.Label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.Label4.Location = New System.Drawing.Point(3, 28) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(98, 140) + Me.Label4.TabIndex = 12 + Me.Label4.Text = "TCP连接状态" + Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'Label3 + ' + Me.Label3.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Label3.Location = New System.Drawing.Point(103, 60) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(114, 26) + Me.Label3.TabIndex = 11 + Me.Label3.Text = "下行接收:" + Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'TextBox6 + ' + Me.TextBox6.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox6.Location = New System.Drawing.Point(103, 89) + Me.TextBox6.MaxLength = 256 + Me.TextBox6.Multiline = True + Me.TextBox6.Name = "TextBox6" + Me.TextBox6.Size = New System.Drawing.Size(467, 82) + Me.TextBox6.TabIndex = 4 + ' + 'Button15 + ' + Me.Button15.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button15.Location = New System.Drawing.Point(473, 28) + Me.Button15.Name = "Button15" + Me.Button15.Size = New System.Drawing.Size(101, 29) + Me.Button15.TabIndex = 3 + Me.Button15.Text = "上行发送" + Me.Button15.UseVisualStyleBackColor = True + ' + 'TextBox5 + ' + Me.TextBox5.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox5.Location = New System.Drawing.Point(103, 28) + Me.TextBox5.MaxLength = 256 + Me.TextBox5.Name = "TextBox5" + Me.TextBox5.Size = New System.Drawing.Size(364, 29) + Me.TextBox5.TabIndex = 2 + ' + 'GroupBox6 + ' + Me.GroupBox6.Controls.Add(Me.ComboBox2) + Me.GroupBox6.Controls.Add(Me.Button11) + Me.GroupBox6.Controls.Add(Me.Button12) + Me.GroupBox6.Dock = System.Windows.Forms.DockStyle.Bottom + Me.GroupBox6.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox6.Location = New System.Drawing.Point(0, 568) + Me.GroupBox6.Name = "GroupBox6" + Me.GroupBox6.Size = New System.Drawing.Size(573, 54) + Me.GroupBox6.TabIndex = 9 + Me.GroupBox6.TabStop = False + Me.GroupBox6.Text = "IPC请求回复" + Me.GroupBox6.Visible = False + ' + 'ComboBox2 + ' + Me.ComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.ComboBox2.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.ComboBox2.FormattingEnabled = True + Me.ComboBox2.Items.AddRange(New Object() {"B0", "B1", "B2"}) + Me.ComboBox2.Location = New System.Drawing.Point(17, 25) + Me.ComboBox2.Name = "ComboBox2" + Me.ComboBox2.Size = New System.Drawing.Size(181, 27) + Me.ComboBox2.TabIndex = 12 + ' + 'Button11 + ' + Me.Button11.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button11.Location = New System.Drawing.Point(383, 23) + Me.Button11.Name = "Button11" + Me.Button11.Size = New System.Drawing.Size(181, 29) + Me.Button11.TabIndex = 11 + Me.Button11.Tag = "0" + Me.Button11.Text = "成功" + Me.Button11.UseVisualStyleBackColor = True + ' + 'Button12 + ' + Me.Button12.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button12.Location = New System.Drawing.Point(200, 23) + Me.Button12.Name = "Button12" + Me.Button12.Size = New System.Drawing.Size(181, 29) + Me.Button12.TabIndex = 10 + Me.Button12.Tag = "1" + Me.Button12.Text = "失败" + Me.Button12.UseVisualStyleBackColor = True + ' + 'GroupBox7 + ' + Me.GroupBox7.Controls.Add(Me.Button14) + Me.GroupBox7.Controls.Add(Me.TextBox4) + Me.GroupBox7.Dock = System.Windows.Forms.DockStyle.Top + Me.GroupBox7.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox7.Location = New System.Drawing.Point(0, 307) + Me.GroupBox7.Name = "GroupBox7" + Me.GroupBox7.Size = New System.Drawing.Size(573, 60) + Me.GroupBox7.TabIndex = 8 + Me.GroupBox7.TabStop = False + Me.GroupBox7.Text = "TCP域名端口上报" + ' + 'Button14 + ' + Me.Button14.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button14.Location = New System.Drawing.Point(489, 26) + Me.Button14.Name = "Button14" + Me.Button14.Size = New System.Drawing.Size(75, 29) + Me.Button14.TabIndex = 3 + Me.Button14.Text = "发送" + Me.Button14.UseVisualStyleBackColor = True + ' + 'TextBox4 + ' + Me.TextBox4.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox4.Location = New System.Drawing.Point(17, 26) + Me.TextBox4.MaxLength = 256 + Me.TextBox4.Name = "TextBox4" + Me.TextBox4.Size = New System.Drawing.Size(464, 29) + Me.TextBox4.TabIndex = 2 + ' + 'GroupBox5 + ' + Me.GroupBox5.Controls.Add(Me.Button13) + Me.GroupBox5.Controls.Add(Me.TextBox3) + Me.GroupBox5.Dock = System.Windows.Forms.DockStyle.Top + Me.GroupBox5.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox5.Location = New System.Drawing.Point(0, 249) + Me.GroupBox5.Name = "GroupBox5" + Me.GroupBox5.Size = New System.Drawing.Size(573, 58) + Me.GroupBox5.TabIndex = 6 + Me.GroupBox5.TabStop = False + Me.GroupBox5.Text = "查询 MCU 名称和 PID" + ' + 'Button13 + ' + Me.Button13.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button13.Location = New System.Drawing.Point(489, 26) + Me.Button13.Name = "Button13" + Me.Button13.Size = New System.Drawing.Size(75, 29) + Me.Button13.TabIndex = 3 + Me.Button13.Text = "发送" + Me.Button13.UseVisualStyleBackColor = True + ' + 'TextBox3 + ' + Me.TextBox3.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox3.Location = New System.Drawing.Point(17, 26) + Me.TextBox3.MaxLength = 256 + Me.TextBox3.Name = "TextBox3" + Me.TextBox3.Size = New System.Drawing.Size(464, 29) + Me.TextBox3.TabIndex = 2 + ' + 'GroupBox4 + ' + Me.GroupBox4.Controls.Add(Me.Button10) + Me.GroupBox4.Controls.Add(Me.TextBox2) + Me.GroupBox4.Dock = System.Windows.Forms.DockStyle.Bottom + Me.GroupBox4.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox4.Location = New System.Drawing.Point(0, 622) + Me.GroupBox4.Name = "GroupBox4" + Me.GroupBox4.Size = New System.Drawing.Size(573, 58) + Me.GroupBox4.TabIndex = 3 + Me.GroupBox4.TabStop = False + Me.GroupBox4.Text = "查询MCU名称和PID" + Me.GroupBox4.Visible = False + ' + 'Button10 + ' + Me.Button10.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button10.Location = New System.Drawing.Point(489, 26) + Me.Button10.Name = "Button10" + Me.Button10.Size = New System.Drawing.Size(75, 29) + Me.Button10.TabIndex = 3 + Me.Button10.Text = "发送" + Me.Button10.UseVisualStyleBackColor = True + ' + 'TextBox2 + ' + Me.TextBox2.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox2.Location = New System.Drawing.Point(17, 26) + Me.TextBox2.MaxLength = 256 + Me.TextBox2.Name = "TextBox2" + Me.TextBox2.Size = New System.Drawing.Size(464, 29) + Me.TextBox2.TabIndex = 2 + ' + 'GroupBox3 + ' + Me.GroupBox3.Controls.Add(Me.ComboBox3) + Me.GroupBox3.Controls.Add(Me.ComboBox1) + Me.GroupBox3.Controls.Add(Me.Label6) + Me.GroupBox3.Controls.Add(Me.Label5) + Me.GroupBox3.Controls.Add(Me.Button8) + Me.GroupBox3.Controls.Add(Me.Button9) + Me.GroupBox3.Dock = System.Windows.Forms.DockStyle.Top + Me.GroupBox3.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox3.Location = New System.Drawing.Point(0, 186) + Me.GroupBox3.Name = "GroupBox3" + Me.GroupBox3.Size = New System.Drawing.Size(573, 63) + Me.GroupBox3.TabIndex = 2 + Me.GroupBox3.TabStop = False + Me.GroupBox3.Text = "播放语音" + ' + 'ComboBox3 + ' + Me.ComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.ComboBox3.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.ComboBox3.FormattingEnabled = True + Me.ComboBox3.Location = New System.Drawing.Point(116, 26) + Me.ComboBox3.Name = "ComboBox3" + Me.ComboBox3.Size = New System.Drawing.Size(87, 27) + Me.ComboBox3.TabIndex = 10 + ' + 'ComboBox1 + ' + Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.ComboBox1.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.ComboBox1.FormattingEnabled = True + Me.ComboBox1.Location = New System.Drawing.Point(313, 26) + Me.ComboBox1.Name = "ComboBox1" + Me.ComboBox1.Size = New System.Drawing.Size(87, 27) + Me.ComboBox1.TabIndex = 0 + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(209, 29) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(110, 21) + Me.Label6.TabIndex = 12 + Me.Label6.Text = "音频序号:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 29) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(110, 21) + Me.Label5.TabIndex = 11 + Me.Label5.Text = "播放次数:" + ' + 'Button8 + ' + Me.Button8.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button8.Location = New System.Drawing.Point(406, 25) + Me.Button8.Name = "Button8" + Me.Button8.Size = New System.Drawing.Size(104, 29) + Me.Button8.TabIndex = 9 + Me.Button8.Tag = "1" + Me.Button8.Text = "播放语音" + Me.Button8.UseVisualStyleBackColor = True + ' + 'Button9 + ' + Me.Button9.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button9.Location = New System.Drawing.Point(516, 25) + Me.Button9.Name = "Button9" + Me.Button9.Size = New System.Drawing.Size(51, 29) + Me.Button9.TabIndex = 8 + Me.Button9.Tag = "0" + Me.Button9.Text = "停止播放" + Me.Button9.UseVisualStyleBackColor = True + Me.Button9.Visible = False + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.Button7) + Me.GroupBox2.Controls.Add(Me.Button6) + Me.GroupBox2.Controls.Add(Me.Button4) + Me.GroupBox2.Controls.Add(Me.Button5) + Me.GroupBox2.Controls.Add(Me.Button3) + Me.GroupBox2.Controls.Add(Me.Button2) + Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Top + Me.GroupBox2.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox2.Location = New System.Drawing.Point(0, 90) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(573, 96) + Me.GroupBox2.TabIndex = 1 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "设置报警状态" + ' + 'Button7 + ' + Me.Button7.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button7.Location = New System.Drawing.Point(383, 62) + Me.Button7.Name = "Button7" + Me.Button7.Size = New System.Drawing.Size(181, 29) + Me.Button7.TabIndex = 7 + Me.Button7.Tag = "6" + Me.Button7.Text = "动火离人事件结束" + Me.Button7.UseVisualStyleBackColor = True + ' + 'Button6 + ' + Me.Button6.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button6.Location = New System.Drawing.Point(200, 62) + Me.Button6.Name = "Button6" + Me.Button6.Size = New System.Drawing.Size(181, 29) + Me.Button6.TabIndex = 6 + Me.Button6.Tag = "5" + Me.Button6.Text = "动火离人事件产生" + Me.Button6.UseVisualStyleBackColor = True + ' + 'Button4 + ' + Me.Button4.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button4.Location = New System.Drawing.Point(17, 62) + Me.Button4.Name = "Button4" + Me.Button4.Size = New System.Drawing.Size(181, 29) + Me.Button4.TabIndex = 5 + Me.Button4.Tag = "2" + Me.Button4.Text = "燃气泄漏恢复正常" + Me.Button4.UseVisualStyleBackColor = True + ' + 'Button5 + ' + Me.Button5.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button5.Location = New System.Drawing.Point(17, 27) + Me.Button5.Name = "Button5" + Me.Button5.Size = New System.Drawing.Size(181, 29) + Me.Button5.TabIndex = 4 + Me.Button5.Tag = "1" + Me.Button5.Text = "燃气泄漏" + Me.Button5.UseVisualStyleBackColor = True + ' + 'Button3 + ' + Me.Button3.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button3.Location = New System.Drawing.Point(383, 27) + Me.Button3.Name = "Button3" + Me.Button3.Size = New System.Drawing.Size(181, 29) + Me.Button3.TabIndex = 3 + Me.Button3.Tag = "4" + Me.Button3.Text = "人员离开监控范围" + Me.Button3.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button2.Location = New System.Drawing.Point(200, 27) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(181, 29) + Me.Button2.TabIndex = 2 + Me.Button2.Tag = "3" + Me.Button2.Text = "人员进入监控范围" + Me.Button2.UseVisualStyleBackColor = True + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.TextBox9) + Me.GroupBox1.Controls.Add(Me.CheckBox2) + Me.GroupBox1.Controls.Add(Me.Button1) + Me.GroupBox1.Controls.Add(Me.TextBox1) + Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top + Me.GroupBox1.Font = New System.Drawing.Font("宋体", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.GroupBox1.Location = New System.Drawing.Point(0, 0) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(573, 90) + Me.GroupBox1.TabIndex = 0 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "设置 OSD 内容" + ' + 'TextBox9 + ' + Me.TextBox9.Location = New System.Drawing.Point(234, 21) + Me.TextBox9.Name = "TextBox9" + Me.TextBox9.Size = New System.Drawing.Size(165, 31) + Me.TextBox9.TabIndex = 3 + Me.TextBox9.Text = "500" + ' + 'CheckBox2 + ' + Me.CheckBox2.AutoSize = True + Me.CheckBox2.Location = New System.Drawing.Point(19, 24) + Me.CheckBox2.Name = "CheckBox2" + Me.CheckBox2.Size = New System.Drawing.Size(209, 25) + Me.CheckBox2.TabIndex = 2 + Me.CheckBox2.Text = "定时发送间隔(ms)" + Me.CheckBox2.UseVisualStyleBackColor = True + ' + 'Button1 + ' + Me.Button1.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.Button1.Location = New System.Drawing.Point(489, 55) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 29) + Me.Button1.TabIndex = 1 + Me.Button1.Text = "发送" + Me.Button1.UseVisualStyleBackColor = True + ' + 'TextBox1 + ' + Me.TextBox1.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.TextBox1.Location = New System.Drawing.Point(17, 55) + Me.TextBox1.MaxLength = 128 + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.Size = New System.Drawing.Size(464, 29) + Me.TextBox1.TabIndex = 0 + ' + 'RichTextBox1 + ' + Me.RichTextBox1.Dock = System.Windows.Forms.DockStyle.Fill + Me.RichTextBox1.Location = New System.Drawing.Point(0, 25) + Me.RichTextBox1.Name = "RichTextBox1" + Me.RichTextBox1.Size = New System.Drawing.Size(621, 763) + Me.RichTextBox1.TabIndex = 1 + Me.RichTextBox1.Text = "" + ' + 'ToolStrip1 + ' + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(621, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(60, 22) + Me.ToolStripButton1.Text = "清空数据" + ' + 'SerialPort1 + ' + ' + 'Timer1 + ' + Me.Timer1.Interval = 1000 + ' + 'Timer2 + ' + Me.Timer2.Interval = 1000 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(1195, 788) + Me.Controls.Add(Me.SplitContainer1) + Me.Name = "Form1" + Me.Text = "Form1" + Me.SplitContainer1.Panel1.ResumeLayout(False) + Me.SplitContainer1.Panel2.ResumeLayout(False) + Me.SplitContainer1.Panel2.PerformLayout() + CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainer1.ResumeLayout(False) + Me.SplitContainer2.Panel1.ResumeLayout(False) + Me.SplitContainer2.Panel1.PerformLayout() + Me.SplitContainer2.Panel2.ResumeLayout(False) + CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainer2.ResumeLayout(False) + Me.GroupBox8.ResumeLayout(False) + Me.GroupBox8.PerformLayout() + Me.GroupBox6.ResumeLayout(False) + Me.GroupBox7.ResumeLayout(False) + Me.GroupBox7.PerformLayout() + Me.GroupBox5.ResumeLayout(False) + Me.GroupBox5.PerformLayout() + Me.GroupBox4.ResumeLayout(False) + Me.GroupBox4.PerformLayout() + Me.GroupBox3.ResumeLayout(False) + Me.GroupBox3.PerformLayout() + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents SplitContainer1 As SplitContainer + Friend WithEvents SplitContainer2 As SplitContainer + Friend WithEvents Btn_OpenPort As Button + Friend WithEvents Label1 As Label + Friend WithEvents Label2 As Label + Friend WithEvents Cbo_Baud As ComboBox + Friend WithEvents Cbo_Port As ComboBox + Friend WithEvents RichTextBox1 As RichTextBox + Friend WithEvents ToolStrip1 As ToolStrip + Friend WithEvents SerialPort1 As IO.Ports.SerialPort + Friend WithEvents GroupBox4 As GroupBox + Friend WithEvents GroupBox3 As GroupBox + Friend WithEvents GroupBox2 As GroupBox + Friend WithEvents TextBox1 As TextBox + Friend WithEvents GroupBox1 As GroupBox + Friend WithEvents Button10 As Button + Friend WithEvents TextBox2 As TextBox + Friend WithEvents Button8 As Button + Friend WithEvents Button9 As Button + Friend WithEvents ComboBox1 As ComboBox + Friend WithEvents Button7 As Button + Friend WithEvents Button6 As Button + Friend WithEvents Button4 As Button + Friend WithEvents Button5 As Button + Friend WithEvents Button3 As Button + Friend WithEvents Button2 As Button + Friend WithEvents Button1 As Button + Friend WithEvents ToolStripButton1 As ToolStripButton + Friend WithEvents GroupBox5 As GroupBox + Friend WithEvents Button13 As Button + Friend WithEvents TextBox3 As TextBox + Friend WithEvents GroupBox7 As GroupBox + Friend WithEvents Button14 As Button + Friend WithEvents TextBox4 As TextBox + Friend WithEvents GroupBox8 As GroupBox + Friend WithEvents Button15 As Button + Friend WithEvents TextBox5 As TextBox + Friend WithEvents GroupBox6 As GroupBox + Friend WithEvents ComboBox2 As ComboBox + Friend WithEvents Button11 As Button + Friend WithEvents Button12 As Button + Friend WithEvents Label3 As Label + Friend WithEvents TextBox6 As TextBox + Friend WithEvents Label4 As Label + Friend WithEvents ComboBox3 As ComboBox + Friend WithEvents Label6 As Label + Friend WithEvents Label5 As Label + Friend WithEvents TextBox7 As TextBox + Friend WithEvents Label7 As Label + Friend WithEvents CheckBox1 As CheckBox + Friend WithEvents TextBox8 As TextBox + Friend WithEvents Label8 As Label + Friend WithEvents Timer1 As Timer + Friend WithEvents Button16 As Button + Friend WithEvents TextBox9 As TextBox + Friend WithEvents CheckBox2 As CheckBox + Friend WithEvents Timer2 As Timer +End Class diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..85e8a5b --- /dev/null +++ b/Form1.resx @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + 241, 17 + + + 357, 17 + + + 449, 17 + + + 59 + + \ No newline at end of file diff --git a/Form1.vb b/Form1.vb new file mode 100644 index 0000000..112f52e --- /dev/null +++ b/Form1.vb @@ -0,0 +1,590 @@ +Imports System.IO.Ports +Imports System.Text +Imports System.Threading +Imports SharedFunction +Public Class Form1 + +#Region "窗体加载" + + '富文本打印变量 + Public G_RichTextPrint As RichTextPrint + Public G_CommunicationProtocol As CommunicationProtocol + + Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Text = $"{Application.ProductName}_V{Application.ProductVersion}" + G_RichTextPrint = New RichTextPrint(RichTextBox1) + G_CommunicationProtocol = New CommunicationProtocol(G_RichTextPrint, SerialPort1) + G_CommunicationProtocol.AddControlDic(&H18, Label4) + G_CommunicationProtocol.AddControlDic(&H19, TextBox6) + + recvBufferli = New List(Of Byte)() + End Sub +#End Region + + +#Region "串口事务" + + Public isread As Boolean = False '串口关闭标志 + Public isListen As Boolean = False '串口等待关闭标志 + Private Sub Btn_OpenPort_Click(sender As Object, e As EventArgs) Handles Btn_OpenPort.Click + If Btn_OpenPort.Text = "关闭" Then + Btn_OpenPort.Text = "打开" + Btn_OpenPort.BackColor = Color.Transparent + Cbo_Port.Enabled = True + Cbo_Baud.Enabled = True + G_CommunicationProtocol.setIsFlowList(False) + G_CommunicationProtocol.ClearFlowNode(True) + SharedFunction.CloseSerial(SerialPort1, isread, isListen) + + + + Else + + Cbo_Port.Enabled = False + Cbo_Baud.Enabled = False + Btn_OpenPort.Text = "关闭" + Btn_OpenPort.BackColor = Color.OrangeRed + Dim vmbaud As Integer = 0 + '判断端口号是否合法 + If String.IsNullOrEmpty(Cbo_Port.Text) Then + MsgBox("请选择端口号!") + Btn_OpenPort_Click(Nothing, Nothing) + Return + End If + '判断波特率是否合法 + If String.IsNullOrEmpty(Cbo_Baud.Text) OrElse Not Integer.TryParse(Cbo_Baud.Text, vmbaud) Then + MsgBox("请选择波特率!") + Btn_OpenPort_Click(Nothing, Nothing) + Return + End If + + '打开串口 + If SharedFunction.OpenSerial(SerialPort1, Cbo_Port.Text, vmbaud) Then + Else + MsgBox("串口打开失败!") + Btn_OpenPort_Click(Nothing, Nothing) + Return + End If + + End If + + End Sub + + Private _recvBuffer(4095) As Byte + Public recvBufferli As List(Of Byte) + Public recvBufferliindex As Integer = 0 + Private Sub SerialPort1_DataReceived(sender As Object, e As IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived + If isread Then Return + + isListen = True + Static bytes As Integer = 0 + Dim sp As SerialPort = DirectCast(sender, SerialPort) + + Try + + + Do + bytes = sp.BytesToRead + If bytes <= 0 Then Exit Sub + + + Dim buf(bytes - 1) As Byte + sp.Read(buf, 0, bytes) + recvBufferli.AddRange(buf) + + + Thread.Sleep(5) + Loop While sp.BytesToRead > 0 + If recvBufferli.Count > 0 Then + Dim buf(recvBufferli.Count - 1) As Byte + Array.Copy(recvBufferli.ToArray, 0, buf, 0, buf.Length) + recvBufferli.Clear() + + G_RichTextPrint.AddQueue(RichTextBox1, New RichTextNodeConfig($"RX:", Color.Green, New Font("宋体", 8), buf), 1) + + G_CommunicationProtocol.ProcessRecvData(buf) + + + End If + + isListen = False + Catch ex As Exception + isListen = False + 'AppendTipText($"串口接收数据失败,原因:{ex.Message}", Color.Red) + G_RichTextPrint.AddQueue(RichTextBox1, New RichTextNodeConfig($"串口接收数据失败,原因:{ex.Message}", Color.Red), 1) + 'RichTextPrint.OutputLogsToTheControl(m_Control, New RuningLogConfig($"串口接收数据失败,原因:{ex.Message}", Color.Red), 1) + End Try + End Sub + + Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed + Timer1.Enabled = False + If Not IsNothing(G_RichTextPrint) Then + G_RichTextPrint.Close() + End If + If SerialPort1.IsOpen Then + SharedFunction.CloseSerial(SerialPort1, isread, isListen) + End If + End Sub + + Private Sub Cbo_Port_DropDown(sender As Object, e As EventArgs) Handles Cbo_Port.DropDown + Cbo_Port.Items.Clear() + Cbo_Port.Items.AddRange(SerialPort.GetPortNames()) + + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + Dim li As List(Of Byte) = New List(Of Byte)() + Dim OSDstr As String = TextBox1.Text + Dim OSDbuf As Byte() = Encoding.ASCII.GetBytes(OSDstr) + If IsNothing(OSDbuf) OrElse OSDbuf.Length = 0 Then + MsgBox("请输入正确的OSD内容!") + Return + End If + li.Add(OSDbuf.Length) + li.AddRange(OSDbuf) + + OSDbuf = NT_CAM.PackData(&HA0, li.ToArray) + Dim gSendNode As New SendNode(1) + + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.AddFlowNode("设置OSD内容", gSendNode) + End Sub + + Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button7.Click, Button6.Click, Button5.Click, Button4.Click, Button3.Click, Button2.Click + + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + '获取当前按钮 + Dim btn As Button = DirectCast(sender, Button) + '获取当前按钮的+Tag值 + Dim ntag As Integer = CInt(btn.Tag) + Dim OSDbuf As Byte() = {ntag} + + G_CommunicationProtocol.ClearFlowNode() + OSDbuf = NT_CAM.PackData(&HA1, OSDbuf) + Dim gSendNode As New SendNode(1) + G_CommunicationProtocol.setIsFlowList(True) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.AddFlowNode("设置报警状态", gSendNode) + End Sub + + + + Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click, Button8.Click + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + + '获取当前按钮 + Dim btn As Button = DirectCast(sender, Button) + '获取当前按钮的+Tag值 + Dim ntag As Integer = CInt(btn.Tag) + Dim nComb, mComb As Integer + '获取下拉框数值 + If Integer.TryParse(ComboBox1.Text.Trim, nComb) = False Then + MsgBox("请输入正确的音乐序号!") + Return + End If + + If Integer.TryParse(ComboBox3.Text.Trim, mComb) = False Then + MsgBox("请输入正确的音乐序号!") + Return + End If + + + Dim OSDbuf As Byte() = {mComb, nComb, 0, 1} '{ntag, nComb} + + G_CommunicationProtocol.ClearFlowNode() + OSDbuf = NT_CAM.PackData(&H21, OSDbuf) + Dim gSendNode As New SendNode(1) + G_CommunicationProtocol.setIsFlowList(True) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.AddFlowNode("播放语音", gSendNode) + End Sub + + Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click + '获取TextBox2文本 + Dim OSDstr As String = TextBox2.Text + '将文本转HEX 数据 + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + G_CommunicationProtocol.ClearFlowNode() + OSDstr = SharedFunction.StringToHexString(OSDstr) + If IsNothing(OSDstr) OrElse OSDstr.Length = 0 Then + MsgBox("请输入正确的透传数据!") + Return + End If + Dim OSDbuf As Byte() = SharedFunction.HexStringToByte(OSDstr) + OSDbuf = NT_CAM.PackData(&H17, OSDbuf) + Dim gSendNode As New SendNode(1) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.setIsFlowList(True) + G_CommunicationProtocol.AddFlowNode("透传命令", gSendNode) + 'Console.WriteLine(OSDstr) + End Sub + + + Private Sub TextBox2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox2.KeyPress, TextBox5.KeyPress + e.Handled = Not $"0123456789ABCDEFabcdef{vbBack} ".Contains(e.KeyChar) '如果要只允许输入数字, + End Sub + + Private Sub SplitContainer2_Panel2_Click(sender As Object, e As EventArgs) + Dim btn As Button = DirectCast(sender, Button) + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + '获取当前按钮的+Tag值 + Dim nComb As Byte() = SharedFunction.HexStringToByte(ComboBox1.Text.Trim) + If IsNothing(nComb) OrElse nComb.Length = 0 Then + MsgBox("请输入正确的命令!") + Return + End If + + Dim ntag As Integer = CInt(btn.Tag) + Dim OSDbuf As Byte() = {ntag} + + G_CommunicationProtocol.ClearFlowNode() + OSDbuf = NT_CAM.PackData(nComb(0), OSDbuf) + Dim gSendNode As New SendNode(1) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.setIsFlowList(True) + G_CommunicationProtocol.AddFlowNode("IPC请求回复", gSendNode) + End Sub + + Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click + '清空富文本 + RichTextBox1.Clear() + End Sub + + Private Sub ComboBox1_DropDown(sender As Object, e As EventArgs) Handles ComboBox1.DropDown, ComboBox3.DropDown + '将sender 转换为ComboBox + Dim mcomboBox As ComboBox = DirectCast(sender, ComboBox) + + mcomboBox.Items.Clear() + '添加1到255 + For i As Integer = 1 To 255 + mcomboBox.Items.Add(i) + Next + End Sub + + Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click + Dim OSDstr As String = TextBox3.Text + Dim OSDbuf As Byte() = Encoding.ASCII.GetBytes(OSDstr) + If IsNothing(OSDbuf) OrElse OSDbuf.Length = 0 Then + MsgBox("请输入正确的产品ID!") + Return + End If + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + + OSDbuf = NT_CAM.PackData(&H9, OSDbuf) + Dim gSendNode As New SendNode(1) + G_CommunicationProtocol.setIsFlowList(True) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.AddFlowNode("设置产品ID", gSendNode) + End Sub + + Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click + '获取TextBox2文本 + Dim OSDstr As String = TextBox5.Text + '将文本转HEX 数据 + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + G_CommunicationProtocol.ClearFlowNode() + OSDstr = SharedFunction.StringToHexString(OSDstr) + If IsNothing(OSDstr) OrElse OSDstr.Length = 0 Then + MsgBox("请输入正确的透传数据!") + Return + End If + Dim OSDbuf As Byte() = SharedFunction.HexStringToByte(OSDstr) + OSDbuf = NT_CAM.PackData(&H20, OSDbuf) + Dim gSendNode As New SendNode(1) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.setIsFlowList(True) + G_CommunicationProtocol.AddFlowNode("透传命令", gSendNode) + End Sub + + Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click + Dim OSDstr As String = TextBox4.Text + Dim OSDbuf As Byte() = Encoding.ASCII.GetBytes(OSDstr) + If IsNothing(OSDbuf) OrElse OSDbuf.Length = 0 Then + MsgBox("请输入正确的产品ID!") + Return + End If + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + + OSDbuf = NT_CAM.PackData(&H17, OSDbuf) + Dim gSendNode As New SendNode(1) + G_CommunicationProtocol.setIsFlowList(True) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.AddFlowNode("设置产品ID", gSendNode) + End Sub + + Private Sub TextBox7_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox7.KeyPress + e.Handled = Not $"0123456789{vbBack} ".Contains(e.KeyChar) '如果要只允许输入数字, + End Sub + Public SendingInterval As Integer = 0 + Public SendingInterval1 As Integer = 0 + Public SendingDate As String = "" + Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged + If CheckBox1.Checked Then + TextBox7.Enabled = False + TextBox8.Enabled = False + '获取TextBox7 代表的发生间隔 + SendingInterval = 30 + + Integer.TryParse(TextBox7.Text, SendingInterval) + SendingDate = TextBox8.Text + If SendingInterval < 1 AndAlso String.IsNullOrEmpty(SendingDate) Then + MsgBox("请输入正确的发送间隔和发送内容!") + CheckBox1.Checked = False + Return + End If + '开启定时任务 + + Timer1.Enabled = True + + Else + Timer1.Enabled = False + TextBox7.Enabled = True + TextBox8.Enabled = True + End If + End Sub + Public Timer1cnt As Integer = 0 + Public Timer2cnt As Integer = 0 + Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick + If Timer1cnt = SendingInterval Then + Timer1cnt = 1 + + Dim OSDstr As String = SendingDate + '将文本转HEX 数据 + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + G_CommunicationProtocol.ClearFlowNode() + OSDstr = SharedFunction.StringToHexString(OSDstr) + If IsNothing(OSDstr) OrElse OSDstr.Length = 0 Then + MsgBox("请输入正确的透传数据!") + Return + End If + Dim OSDbuf As Byte() = SharedFunction.HexStringToByte(OSDstr) + OSDbuf = NT_CAM.PackData(&H20, OSDbuf) + Dim gSendNode As New SendNode(1, 1) + gSendNode.SetSendData(OSDbuf) + gSendNode.IsRecvData = False + G_CommunicationProtocol.setIsFlowList(True) + G_CommunicationProtocol.AddFlowNode("透传命令", gSendNode) + + Else + Timer1cnt += 1 + End If + + + + End Sub + + Private Sub TextBox8_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox8.KeyPress + e.Handled = Not $"0123456789ABCDEFabcdef{vbBack} ".Contains(e.KeyChar) '如果要只允许输入数字, + End Sub + + Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click + '获取TextBox2文本 ‘55 AA 01 0B 00 00 0B + 'Dim OSDstr As String = TextBox5.Text + '将文本转HEX 数据 + If G_CommunicationProtocol.getIsFlowList Then + MsgBox("正在通信中!") + Return + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + G_CommunicationProtocol.ClearFlowNode() + 'OSDstr = SharedFunction.StringToHexString(OSDstr) + 'If IsNothing(OSDstr) OrElse OSDstr.Length = 0 Then + ' MsgBox("请输入正确的透传数据!") + ' Return + 'End If + Dim OSDbuf As Byte() '= SharedFunction.HexStringToByte(OSDstr) + OSDbuf = {&H55, &HAA, &H1, &HB, &H0, &H0, &HB} + Dim gSendNode As New SendNode(1) + gSendNode.SetSendData(OSDbuf) + G_CommunicationProtocol.setIsFlowList(True) + G_CommunicationProtocol.AddFlowNode("透传命令", gSendNode) + End Sub + + Private Sub TextBox9_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox9.KeyPress + e.Handled = Not $"0123456789ABCDEFabcdef{vbBack} ".Contains(e.KeyChar) '如果要只允许输入数字, + End Sub + Public OSDbufSN As Integer = 0 + Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged + + + + + If CheckBox2.Checked Then + + '判断串口是否打开 + + + + TextBox9.Enabled = False + + '获取TextBox7 代表的发生间隔 + SendingInterval1 = 500 + + Integer.TryParse(TextBox9.Text, SendingInterval1) + 'SendingDate = TextBox8.Text + If SendingInterval1 < 1 Then + MsgBox("请输入正确的发送间隔!") + CheckBox2.Checked = False + Return + End If + '开启定时任务 + OSDbufSN = 1 + Timer2.Interval = 10 + SendingInterval1 = SendingInterval1 / 10 + + Timer2.Start() + + Else + OSDbufSN = 1 + 'Timer2.Enabled = False + Timer2.Stop() + TextBox9.Enabled = True + + End If + End Sub + Public cntSendingInterval1 As Integer = 0 + Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick + ' If Timer2cnt = SendingInterval1 Then + ' Timer2cnt = 1 + If cntSendingInterval1 < SendingInterval1 Then + cntSendingInterval1 = cntSendingInterval1 + 1 + Else + If G_CommunicationProtocol.getIsFlowList1 Then + cntSendingInterval1 = SendingInterval1 + Return + 'MsgBox("正在通信中!") + Else + G_CommunicationProtocol.ClearFlowNode() + G_CommunicationProtocol.setIsFlowList(True) + End If + Dim li As List(Of Byte) = New List(Of Byte)() + Dim m_snsn As Integer = GetNewSNTimeDate(OSDbufSN) + Dim snbuf As String = GetSnString(m_snsn) + Dim OSDstr As String = $"R:{snbuf} B:{snbuf} D:{snbuf} TD:{snbuf} HD:{snbuf} S:{snbuf} HC:{snbuf} HR:{snbuf}" + Dim OSDbuf As Byte() = Encoding.ASCII.GetBytes(OSDstr) + + + + 'If IsNothing(OSDbuf) OrElse OSDbuf.Length = 0 Then + ' MsgBox("请输入正确的OSD内容!") + ' Return + 'End If + li.Add(OSDbuf.Length) + li.AddRange(OSDbuf) + + OSDbuf = NT_CAM.PackData(&HA0, li.ToArray) + + OSDbuf(6) = 14 + OSDbuf(21) = 11 + OSDbuf(33) = 16 + OSDbuf(OSDbuf.Length - 1) = 0 + OSDbuf(OSDbuf.Length - 1) = SharedFunction.GetCheckSumMod2(OSDbuf) + + Dim gSendNode As New SendNode(1) + + gSendNode.SetSendData(OSDbuf, 800) + G_CommunicationProtocol.ClearFlowNode() + 'G_CommunicationProtocol.setIsFlowList(True) + G_CommunicationProtocol.AddFlowNode("设置OSD内容", gSendNode) + Console.WriteLine("发送OSD内容") + 'Else + ' Timer2cnt += 1 + 'End If + cntSendingInterval1 = 0 + End If + + + + End Sub + + + + + Public Function GetNewSNTimeDate(ByRef sn As Integer) As Integer + Dim result As Integer = 1 + If sn > 9 Then + result = 1 + sn = 1 + Else + sn = sn + 1 + result = sn + End If + Return result + End Function + Public Function GetSnString(sn As Integer) As String + '如果sn只有个位数则前面补0 + Dim snbuf As String + '判断sn是否小于10 ,小于则前面补0 + If sn < 10 Then + snbuf = $"0{sn}" + Else + snbuf = sn.ToString + End If + Return snbuf + End Function + +#End Region + + + + + + +End Class diff --git a/My Project/Application.Designer.vb b/My Project/Application.Designer.vb new file mode 100644 index 0000000..418c6e6 --- /dev/null +++ b/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.NT_CAM_Controller.Form1 + End Sub + End Class +End Namespace diff --git a/My Project/Application.myapp b/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..b7ffd16 --- /dev/null +++ b/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 有关程序集的一般信息由以下 +' 控制。更改这些特性值可修改 +' 与程序集关联的信息。 + +'查看程序集特性的值 + + + + + + + + + + +'如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID + + +' 程序集的版本信息由下列四个值组成: +' +' 主版本 +' 次版本 +' 生成号 +' 修订号 +' +'可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +'通过使用 "*",如下所示: +' + + + diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb new file mode 100644 index 0000000..f563af7 --- /dev/null +++ b/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("NT_CAM_Controller.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/My Project/Resources.resx b/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb new file mode 100644 index 0000000..5e0207f --- /dev/null +++ b/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.NT_CAM_Controller.My.MySettings + Get + Return Global.NT_CAM_Controller.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/My Project/Settings.settings b/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/NT-CAM_Controller.sln b/NT-CAM_Controller.sln new file mode 100644 index 0000000..f00f550 --- /dev/null +++ b/NT-CAM_Controller.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32602.291 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "NT-CAM_Controller", "NT-CAM_Controller.vbproj", "{3D30DB30-5E4F-42E7-B098-0F04B64EDD54}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3D30DB30-5E4F-42E7-B098-0F04B64EDD54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D30DB30-5E4F-42E7-B098-0F04B64EDD54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D30DB30-5E4F-42E7-B098-0F04B64EDD54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D30DB30-5E4F-42E7-B098-0F04B64EDD54}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F130D632-CA65-40F5-A17A-B4F6AFE65DFA} + EndGlobalSection +EndGlobal diff --git a/NT-CAM_Controller.vbproj b/NT-CAM_Controller.vbproj new file mode 100644 index 0000000..92483da --- /dev/null +++ b/NT-CAM_Controller.vbproj @@ -0,0 +1,129 @@ + + + + + Debug + AnyCPU + {3D30DB30-5E4F-42E7-B098-0F04B64EDD54} + WinExe + NT_CAM_Controller.My.MyApplication + NT_CAM_Controller + NT-CAM_Controller + 512 + WindowsForms + v4.8 + true + true + + + AnyCPU + true + full + true + true + bin\Debug\ + NT-CAM_Controller.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + NT-CAM_Controller.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + \ No newline at end of file diff --git a/RichTextPrint/RichTextPrint.vb b/RichTextPrint/RichTextPrint.vb new file mode 100644 index 0000000..f235c02 --- /dev/null +++ b/RichTextPrint/RichTextPrint.vb @@ -0,0 +1,175 @@ +Imports System.Threading + +Public Class RichTextPrint + '输出线程 + Public OutputThread As Thread + '输出等级 + Public Shared level As Integer = 1 '日志级别 0:不输出日志 1:输出日志2:输出基础日志和错误信息 + + '接收器 + Public UpdateUIqueue As Queue(Of (Control, RichTextNodeConfig, lev As Integer)) + + '默认输出控件 + Public G_DefaultControl As Control + + + Sub New(DefaultControl As Control) + G_DefaultControl = DefaultControl + '初始化线程 + OutputThread = New Thread(AddressOf RunUpdateUI) + 'OutputThread.IsBackground = True + OutputThread.Start() + UpdateUIqueue = New Queue(Of (Control, RichTextNodeConfig, lev As Integer)) + End Sub + '关闭线程 + Sub Close() + OutputThread.Abort() + End Sub + + Public Sub AddQueue(c As Control, rl As RichTextNodeConfig, Optional lev As Integer = 0) + If IsNothing(UpdateUIqueue) OrElse IsNothing(c) OrElse IsNothing(rl) Then Return + UpdateUIqueue.Enqueue((c, rl, lev)) + End Sub + Public Sub AddQueue(rl As RichTextNodeConfig, Optional lev As Integer = 0) + If IsNothing(UpdateUIqueue) OrElse IsNothing(G_DefaultControl) OrElse IsNothing(rl) Then Return + UpdateUIqueue.Enqueue((G_DefaultControl, rl, lev)) + End Sub + + + Private Sub RunUpdateUI() + While True + + If IsNothing(UpdateUIqueue) OrElse UpdateUIqueue.Count = 0 Then + Thread.Sleep(1) + Continue While + End If + If UpdateUIqueue.Count > 0 Then + Dim str As (Control, RichTextNodeConfig, Integer) = UpdateUIqueue.Dequeue() + OutputLogsToTheControl(str.Item1, str.Item2, str.Item3) + End If + Thread.Sleep(1) + End While + End Sub + + + + + + + + + + Delegate Function Deleg_OutputLogsToTheControl(c As Control, config As RichTextNodeConfig, Controltype As Integer) As Boolean + '输出日志到控件 + ''' + ''' ''输出日志到控件 + ''' + ''' 控件 + ''' 日志 + ''' + Public Shared Function OutputLogsToTheControl(c As Control, config As RichTextNodeConfig, Controltype As Integer) As Boolean + Try + If c.InvokeRequired Then + Dim dev As New Deleg_OutputLogsToTheControl(AddressOf OutputLogsToTheControl) + c.Invoke(dev, New Object() {c, config, Controltype}) + Else + If Controltype >= level Then + Dim nc As RichTextBox = c + '获取富文本字符串末端位置 + Dim index As Integer = nc.TextLength + If (Not IsNothing(config.strdata)) AndAlso config.strdata.Length > 0 Then + config.logstr = config.logstr & SharedFunction.ByteToHexString(config.strdata) + End If + + Dim strtxt = config.logstr & vbCrLf + '设置光标位置 + nc.SelectionStart = index + '添加文本 + nc.AppendText(strtxt) + '设置选择区域 + nc.Select(index, strtxt.Length) + '设置选择区域颜色 + nc.SelectionColor = config.logstrColor + '设置选择区域字体 + nc.SelectionFont = config.logstrFont + '取消选中区域 + nc.DeselectAll() + + End If + + + End If + Catch ex As Exception + + End Try + + + End Function + + '字符串附加时间戳 + Public Shared Function AddTimeStamps(str As String) As String + Return Now.ToString("yyyy-MM-dd HH:mm:ss:fff") & " " & str + End Function + + + +End Class +Public Class RichTextNodeConfig + '日志信息 + Public logstr As String + '日志信息颜色 + Public logstrColor As Color + '日志信息字体 + Public logstrFont As Font + '日志信息字体大小 + 'Public logstrFontSize As Integer + ''日志信息字体粗细 + 'Public logstrFontBold As Boolean + ''日志信息字体斜体 + 'Public logstrFontItalic As Boolean + ''日志信息字体下划线 + 'Public logstrFontUnderline As Boolean + ''日志信息字体删除线 + 'Public logstrFontStrikeout As Boolean + ''日志信息字体对齐方式 + 'Public logstrFontAlign As StringAlignment + '日志信息字体背景色 + Public logstrFontBackColor As Color + Public strdata As Byte() + + ''' + ''' 文本、颜色、Font + ''' + ''' + Sub New(ParamArray args() As Object) + If args.Length > 0 Then + logstr = RichTextPrint.AddTimeStamps(args(0).ToString) + + If args.Length > 1 Then + + logstrColor = args(1) + If args.Length > 2 Then + logstrFont = args(2) + Else + logstrFont = New Font("宋体", 8) + + End If + + If args.Length > 3 Then + strdata = args(3) + Else + strdata = Nothing + End If + + Else + logstrColor = Color.Black + End If + Else + logstr = "输空文本" + logstrColor = Color.Black + logstrFont = New Font("宋体", 12) + End If + + End Sub + +End Class \ No newline at end of file diff --git a/SharedFunction/SharedFunction.vb b/SharedFunction/SharedFunction.vb new file mode 100644 index 0000000..16736bd --- /dev/null +++ b/SharedFunction/SharedFunction.vb @@ -0,0 +1,200 @@ +Imports System.IO.Ports + +Public Class SharedFunction +#Region "串口操作" + '打开串口 + ''' + ''' 打开串口 + ''' + ''' 串口 + ''' 串口号 + ''' 波特率 + ''' + Public Shared Function OpenSerial(m_Serial As SerialPort, portName As String, baudRate As Integer) As Boolean + If IsNothing(m_Serial) OrElse m_Serial.IsOpen Then Return False + Try + m_Serial.PortName = portName + m_Serial.BaudRate = baudRate + m_Serial.Parity = Parity.Even + m_Serial.Open() + Return True + Catch ex As Exception + Return False + End Try + + End Function + + + + '设置串口波特率 + ''' + ''' 设置串口波特率 + ''' + ''' 串口 + ''' 波特率 + ''' + Public Shared Function SetSerialBaudRate(m_Serial As SerialPort, baudRate As Integer) As Boolean + If IsNothing(m_Serial) OrElse Not m_Serial.IsOpen Then Return False + m_Serial.BaudRate = baudRate + Return True + End Function + + + + ''' + ''' 关闭串口 + ''' + ''' 串口 + ''' 串口关闭标志 + ''' 串口等待关闭标志 + Public Shared Sub CloseSerial(m_Serial As SerialPort, ByRef isread As Boolean, ByRef isListen As Boolean) + If IsNothing(m_Serial) OrElse Not m_Serial.IsOpen Then Return + isread = True + While isListen + Application.DoEvents() + Threading.Thread.Sleep(10) + End While + + Threading.Thread.Sleep(10) + m_Serial.Close() + isread = False + End Sub + + +#End Region + + +#Region "数据转换" + Public Shared Function ByteToHexString(databuff() As Byte) As String + Dim strData As String = String.Empty + For i = 0 To databuff.Length - 1 + strData &= $" {Hex(databuff(i)).PadLeft(2, "0"c)}" + Next + Return strData + End Function + Public Shared Function StringToHexString(hexstr As String) As String + '判断字符串是否为空或 者为空字符串 + If String.IsNullOrEmpty(hexstr) Then Return Nothing + '替换字符中的分隔符号 + hexstr = hexstr.Trim().Replace(" ", "").Replace("-", "").Replace(",", "").Replace(":", "").Replace(";", "").Replace(".", "") + '判断字符串的长度是否为偶数 + If hexstr.Length Mod 2 <> 0 Then + '不为偶数往最后一个字节前面补0 + hexstr = hexstr.Insert(hexstr.Length - 1, "0") + End If + '以2为步长,将字符串转换为字节数组 不足2位前面补0 + Dim databuff() As Byte = Enumerable.Range(0, hexstr.Length).Where(Function(x) x Mod 2 = 0).Select(Function(x) Convert.ToByte(hexstr.Substring(x, 2), 16)).ToArray() + Return ByteToHexString(databuff) + End Function + Public Shared Function HexStringToByte(hexstr As String) As Byte() + '判断字符串是否为空或 者为空字符串 + If String.IsNullOrEmpty(hexstr) Then Return Nothing + '替换字符中的分隔符号 + hexstr = hexstr.Trim().Replace(" ", "").Replace("-", "").Replace(",", "").Replace(":", "").Replace(";", "").Replace(".", "") + '判断字符串的长度是否为偶数 + If hexstr.Length Mod 2 <> 0 Then + '不为偶数往最后一个字节前面补0 + hexstr = hexstr.Insert(hexstr.Length - 1, "0") + End If + '以2为步长,将字符串转换为字节数组 不足2位前面补0 + Return Enumerable.Range(0, hexstr.Length).Where(Function(x) x Mod 2 = 0).Select(Function(x) Convert.ToByte(hexstr.Substring(x, 2), 16)).ToArray() + + End Function + + ''' + ''' Int转2个字节Byte + ''' 高字节在前,低字节在后 + ''' + ''' + ''' + Public Shared Function IntToByteHB(ByVal i As Integer) As Byte() + Dim btemp() As Byte = {0, 0} + Dim b() As Byte = BitConverter.GetBytes(i) + btemp(0) = b(0) + btemp(1) = b(1) + Return btemp + End Function + + ''' + ''' Int转2个字节Byte + ''' 高字节在前,低字节在后 + ''' + ''' + ''' + Public Shared Function IntToByteLB(ByVal i As Integer) As Byte() + Dim btemp() As Byte = {0, 0} + Dim b() As Byte = BitConverter.GetBytes(i) + btemp(0) = b(1) + btemp(1) = b(0) + Return btemp + End Function + +#End Region +#Region "数据校验" + '计算数据和 校验 + Public Shared Function GetCheckSum(ByVal data As Byte()) As Byte + + Dim sum As Integer = 0 + For i As Integer = 0 To data.Length - 1 + sum += data(i) + Next + Return sum + + End Function + Public Shared Function GetCheckSumMod(ByVal data As Byte()) As Byte + + Dim sum As Integer = 0 + For i As Integer = 0 To data.Length - 2 + sum += data(i) + Next + sum = sum And &HFF + Return sum + + End Function + + Public Shared Function GetCheckSumMod2(ByVal data As Byte()) As Byte + + Dim sum As Integer = 0 + For i As Integer = 0 To data.Length - 1 + sum += data(i) + Next + sum = sum And &HFF + Return sum + + End Function + + ''' + ''' 和校验取余数 + ''' 求Byte数组的和校验取余数 + ''' + ''' Byte数组 + ''' + Public Function GetSumCheckMod(dataPacket As Byte()) As Byte + Dim sum As Integer + For idx = 0 To dataPacket.Length - 1 + sum += dataPacket(idx) + sum = sum And &HFF + Next + Dim sumMod As Byte = &HFF - sum + Return sumMod + End Function +#End Region + +#Region "跨线程调用UI" + Delegate Sub delSetFromUI(control As Control, mText As String, textcolor As Color, cbolor As Color) + Public Shared Sub SetFromUI(ByVal control As Control, mText As String, textcolor As Color, cbolor As Color) + If IsNothing(control) Then Return + If control.InvokeRequired Then + control.Invoke(New delSetFromUI(AddressOf SetFromUI), control, mText, textcolor, cbolor) + Else + control.Text = mText + control.ForeColor = textcolor + control.BackColor = cbolor + End If + + End Sub +#End Region + + + +End Class diff --git a/Transmitter/Transmitter.vb b/Transmitter/Transmitter.vb new file mode 100644 index 0000000..41c4a20 --- /dev/null +++ b/Transmitter/Transmitter.vb @@ -0,0 +1,29 @@ +Imports _485_BurningTool.CommunicationFlow + +Public MustInherit Class Transmitter + Public mCommunicationFlow As RichTextPrint + + ' 发送数据方法 + Public MustOverride Sub SendData(data As SendNode) + Public MustOverride Sub SendData(data As Byte()) + '获取发送器接收数据 + Public MustOverride Function ReceiveData(g_comfig As SendNode) As SendNode + '判断发送器实体化没有 + Public MustOverride Function IsTransmitter() As Boolean + '打开发送器 + Public MustOverride Function OpenTransmitter() As Boolean + '关闭发送器 + Public MustOverride Sub CloseTransmitter() + '获取发送器状态 ' True:打开 False:关闭 + Public MustOverride Function GetTransmitterStatus() As Boolean + '设置发送器参数 + Public MustOverride Function SetTransmitterParameter(ParamArray params() As Object) As Boolean + ' 清楚发送数据 + Public MustOverride Sub ClearSendData() + + '创建发送器对象 + Public MustOverride Function CreateTransmitter() As Transmitter + + + +End Class diff --git a/bin/Debug - 副本/NT-CAM_Controller.exe b/bin/Debug - 副本/NT-CAM_Controller.exe new file mode 100644 index 0000000..3d77c5d Binary files /dev/null and b/bin/Debug - 副本/NT-CAM_Controller.exe differ diff --git a/bin/Debug - 副本/NT-CAM_Controller.exe.config b/bin/Debug - 副本/NT-CAM_Controller.exe.config new file mode 100644 index 0000000..1c75772 --- /dev/null +++ b/bin/Debug - 副本/NT-CAM_Controller.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bin/Debug - 副本/NT-CAM_Controller.pdb b/bin/Debug - 副本/NT-CAM_Controller.pdb new file mode 100644 index 0000000..f1eedaf Binary files /dev/null and b/bin/Debug - 副本/NT-CAM_Controller.pdb differ diff --git a/bin/Debug - 副本/NT-CAM_Controller.xml b/bin/Debug - 副本/NT-CAM_Controller.xml new file mode 100644 index 0000000..6a33c7f --- /dev/null +++ b/bin/Debug - 副本/NT-CAM_Controller.xml @@ -0,0 +1,95 @@ + + + + +NT-CAM_Controller + + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + 命令 + + + + + + ''输出日志到控件 + + 控件 + 日志 + + + + + 文本、颜色、Font + + + + + + 打开串口 + + 串口 + 串口号 + 波特率 + + + + + 设置串口波特率 + + 串口 + 波特率 + + + + + 关闭串口 + + 串口 + 串口关闭标志 + 串口等待关闭标志 + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + 和校验取余数 + 求Byte数组的和校验取余数 + + Byte数组 + + + + diff --git a/bin/Debug/NT-CAM_Controller.exe b/bin/Debug/NT-CAM_Controller.exe new file mode 100644 index 0000000..6e7c244 Binary files /dev/null and b/bin/Debug/NT-CAM_Controller.exe differ diff --git a/bin/Debug/NT-CAM_Controller.exe.config b/bin/Debug/NT-CAM_Controller.exe.config new file mode 100644 index 0000000..1c75772 --- /dev/null +++ b/bin/Debug/NT-CAM_Controller.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bin/Debug/NT-CAM_Controller.pdb b/bin/Debug/NT-CAM_Controller.pdb new file mode 100644 index 0000000..e68f21d Binary files /dev/null and b/bin/Debug/NT-CAM_Controller.pdb differ diff --git a/bin/Debug/NT-CAM_Controller.xml b/bin/Debug/NT-CAM_Controller.xml new file mode 100644 index 0000000..6a33c7f --- /dev/null +++ b/bin/Debug/NT-CAM_Controller.xml @@ -0,0 +1,95 @@ + + + + +NT-CAM_Controller + + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + 命令 + + + + + + ''输出日志到控件 + + 控件 + 日志 + + + + + 文本、颜色、Font + + + + + + 打开串口 + + 串口 + 串口号 + 波特率 + + + + + 设置串口波特率 + + 串口 + 波特率 + + + + + 关闭串口 + + 串口 + 串口关闭标志 + 串口等待关闭标志 + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + 和校验取余数 + 求Byte数组的和校验取余数 + + Byte数组 + + + + diff --git a/bin/NT-CAM_Controller_1.0.0.14.rar b/bin/NT-CAM_Controller_1.0.0.14.rar new file mode 100644 index 0000000..ba43ab4 Binary files /dev/null and b/bin/NT-CAM_Controller_1.0.0.14.rar differ diff --git a/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.exe b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.exe new file mode 100644 index 0000000..39381c7 Binary files /dev/null and b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.exe differ diff --git a/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.exe.config b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.exe.config new file mode 100644 index 0000000..1c75772 --- /dev/null +++ b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.pdb b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.pdb new file mode 100644 index 0000000..e0a60e7 Binary files /dev/null and b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.pdb differ diff --git a/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.xml b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.xml new file mode 100644 index 0000000..6a33c7f --- /dev/null +++ b/bin/NT-CAM_Controller_1.0.0.14/NT-CAM_Controller.xml @@ -0,0 +1,95 @@ + + + + +NT-CAM_Controller + + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + 命令 + + + + + + ''输出日志到控件 + + 控件 + 日志 + + + + + 文本、颜色、Font + + + + + + 打开串口 + + 串口 + 串口号 + 波特率 + + + + + 设置串口波特率 + + 串口 + 波特率 + + + + + 关闭串口 + + 串口 + 串口关闭标志 + 串口等待关闭标志 + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + 和校验取余数 + 求Byte数组的和校验取余数 + + Byte数组 + + + + diff --git a/bin/NT-CAM_Controller_1.0.0.15.rar b/bin/NT-CAM_Controller_1.0.0.15.rar new file mode 100644 index 0000000..a56d8dc Binary files /dev/null and b/bin/NT-CAM_Controller_1.0.0.15.rar differ diff --git a/bin/NT-CAM_Controller_1.0.0.16_偶校验版.rar b/bin/NT-CAM_Controller_1.0.0.16_偶校验版.rar new file mode 100644 index 0000000..0dffd58 Binary files /dev/null and b/bin/NT-CAM_Controller_1.0.0.16_偶校验版.rar differ diff --git a/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.exe b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.exe new file mode 100644 index 0000000..6e7c244 Binary files /dev/null and b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.exe differ diff --git a/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.exe.config b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.exe.config new file mode 100644 index 0000000..1c75772 --- /dev/null +++ b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.pdb b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.pdb new file mode 100644 index 0000000..e68f21d Binary files /dev/null and b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.pdb differ diff --git a/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.xml b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.xml new file mode 100644 index 0000000..6a33c7f --- /dev/null +++ b/bin/NT-CAM_Controller_1.0.0.16_偶校验版/NT-CAM_Controller.xml @@ -0,0 +1,95 @@ + + + + +NT-CAM_Controller + + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + 命令 + + + + + + ''输出日志到控件 + + 控件 + 日志 + + + + + 文本、颜色、Font + + + + + + 打开串口 + + 串口 + 串口号 + 波特率 + + + + + 设置串口波特率 + + 串口 + 波特率 + + + + + 关闭串口 + + 串口 + 串口关闭标志 + 串口等待关闭标志 + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + 和校验取余数 + 求Byte数组的和校验取余数 + + Byte数组 + + + + diff --git a/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.vb b/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.vb new file mode 100644 index 0000000..e7dcac5 --- /dev/null +++ b/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.vb @@ -0,0 +1,7 @@ +' + Option Strict Off + Option Explicit On + + Imports System + Imports System.Reflection + diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..142deab Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..79df7f6 Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/obj/Debug/NT-CAM_Controller.exe b/obj/Debug/NT-CAM_Controller.exe new file mode 100644 index 0000000..6e7c244 Binary files /dev/null and b/obj/Debug/NT-CAM_Controller.exe differ diff --git a/obj/Debug/NT-CAM_Controller.pdb b/obj/Debug/NT-CAM_Controller.pdb new file mode 100644 index 0000000..e68f21d Binary files /dev/null and b/obj/Debug/NT-CAM_Controller.pdb differ diff --git a/obj/Debug/NT-CAM_Controller.vbproj.AssemblyReference.cache b/obj/Debug/NT-CAM_Controller.vbproj.AssemblyReference.cache new file mode 100644 index 0000000..f5e894a Binary files /dev/null and b/obj/Debug/NT-CAM_Controller.vbproj.AssemblyReference.cache differ diff --git a/obj/Debug/NT-CAM_Controller.vbproj.CoreCompileInputs.cache b/obj/Debug/NT-CAM_Controller.vbproj.CoreCompileInputs.cache new file mode 100644 index 0000000..b375a3d --- /dev/null +++ b/obj/Debug/NT-CAM_Controller.vbproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +37fafdf6f75687b99c10dcae8fddbb80c938fc39 diff --git a/obj/Debug/NT-CAM_Controller.vbproj.FileListAbsolute.txt b/obj/Debug/NT-CAM_Controller.vbproj.FileListAbsolute.txt new file mode 100644 index 0000000..9c51b9f --- /dev/null +++ b/obj/Debug/NT-CAM_Controller.vbproj.FileListAbsolute.txt @@ -0,0 +1,12 @@ +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT-CAM_Controller.vbproj.AssemblyReference.cache +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT_CAM_Controller.Form1.resources +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT_CAM_Controller.Resources.resources +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT-CAM_Controller.vbproj.GenerateResource.cache +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT-CAM_Controller.vbproj.CoreCompileInputs.cache +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\bin\Debug\NT-CAM_Controller.exe.config +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\bin\Debug\NT-CAM_Controller.exe +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\bin\Debug\NT-CAM_Controller.pdb +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\bin\Debug\NT-CAM_Controller.xml +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT-CAM_Controller.exe +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT-CAM_Controller.xml +E:\Sync\NT-CAM_Controller\NT-CAM_Controller\obj\Debug\NT-CAM_Controller.pdb diff --git a/obj/Debug/NT-CAM_Controller.vbproj.GenerateResource.cache b/obj/Debug/NT-CAM_Controller.vbproj.GenerateResource.cache new file mode 100644 index 0000000..083a6a6 Binary files /dev/null and b/obj/Debug/NT-CAM_Controller.vbproj.GenerateResource.cache differ diff --git a/obj/Debug/NT-CAM_Controller.xml b/obj/Debug/NT-CAM_Controller.xml new file mode 100644 index 0000000..6a33c7f --- /dev/null +++ b/obj/Debug/NT-CAM_Controller.xml @@ -0,0 +1,95 @@ + + + + +NT-CAM_Controller + + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + 命令 + + + + + + ''输出日志到控件 + + 控件 + 日志 + + + + + 文本、颜色、Font + + + + + + 打开串口 + + 串口 + 串口号 + 波特率 + + + + + 设置串口波特率 + + 串口 + 波特率 + + + + + 关闭串口 + + 串口 + 串口关闭标志 + 串口等待关闭标志 + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + Int转2个字节Byte + 高字节在前,低字节在后 + + + + + + + 和校验取余数 + 求Byte数组的和校验取余数 + + Byte数组 + + + + diff --git a/obj/Debug/NT_CAM_Controller.Form1.resources b/obj/Debug/NT_CAM_Controller.Form1.resources new file mode 100644 index 0000000..afb1df4 Binary files /dev/null and b/obj/Debug/NT_CAM_Controller.Form1.resources differ diff --git a/obj/Debug/NT_CAM_Controller.Resources.resources b/obj/Debug/NT_CAM_Controller.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/obj/Debug/NT_CAM_Controller.Resources.resources differ diff --git a/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll b/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll new file mode 100644 index 0000000..15369d1 Binary files /dev/null and b/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll differ