Commit d0bf436c 张东亮

与斯坦德AGV通讯功能添加

1 个父辈 c7fcfbca
正在显示 62 个修改的文件 包含 5441 行增加70 行删除
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="Conifg\" /> <add key="CodeParamPath" value="Conifg\" />
<add key="CodeCount" value="3" /> <add key="CodeCount" value="3" />
<!--斯坦德AGV配置-->
<add key="STD_IP" value="127.0.0.1" />
<add key="LStation" value="1" />
<add key="RStation" value="2" />
<add key="ShelfInAGV" value="3" />
<add key="ShelfOutAGV" value="4" />
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
...@@ -34,6 +40,16 @@ ...@@ -34,6 +40,16 @@
<conversionPattern value="%m%n" /> <conversionPattern value="%m%n" />
</layout> </layout>
</appender> </appender>
<appender name="standrobot" type="log4net.Appender.RollingFileAppender">
<file value="logs/standrobot/standrobot.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%m%n" />
</layout>
</appender>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="ALL" /> <level value="ALL" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
...@@ -46,6 +62,10 @@ ...@@ -46,6 +62,10 @@
<level value="ALL" /> <level value="ALL" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
</logger> </logger>
<logger name="standrobot">
<level value="info" />
<appender-ref ref="standrobot" />
</logger>
<!--<root> <!--<root>
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
......
...@@ -38,23 +38,21 @@ ...@@ -38,23 +38,21 @@
<ApplicationIcon>icon.ico</ApplicationIcon> <ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.PrintLabel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Asa.PrintLabel">
<SpecificVersion>False</SpecificVersion> <HintPath>..\dll\Asa.PrintLabel.dll</HintPath>
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference> </Reference>
<Reference Include="CodeLibrary, Version=1.0.7703.30209, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary">
<SpecificVersion>False</SpecificVersion> <HintPath>..\dll\CodeLibrary.dll</HintPath>
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper"> <Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath> <HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Neotel.Rmaxis"> <Reference Include="Neotel.Rmaxis">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath> <HintPath>..\dll\Neotel.Rmaxis.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
...@@ -188,6 +186,10 @@ ...@@ -188,6 +186,10 @@
<Project>{bb23296c-aa1d-45c6-9fa6-5a37b2abfe9b}</Project> <Project>{bb23296c-aa1d-45c6-9fa6-5a37b2abfe9b}</Project>
<Name>DeviceLibrary</Name> <Name>DeviceLibrary</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\DL.StandardRobots\DL.StandardRobots.csproj">
<Project>{F85A7412-B5B3-4291-A448-A10564602E1A}</Project>
<Name>DL.StandardRobots</Name>
</ProjectReference>
<ProjectReference Include="..\LoadCVSLibrary\LoadCSVLibrary.csproj"> <ProjectReference Include="..\LoadCVSLibrary\LoadCSVLibrary.csproj">
<Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project> <Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project>
<Name>LoadCSVLibrary</Name> <Name>LoadCSVLibrary</Name>
......
...@@ -29,6 +29,7 @@ namespace AutoScanAndLabel ...@@ -29,6 +29,7 @@ namespace AutoScanAndLabel
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.设备操作ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.设备操作ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
...@@ -36,6 +37,10 @@ namespace AutoScanAndLabel ...@@ -36,6 +37,10 @@ namespace AutoScanAndLabel
this.二维码识别调试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.二维码识别调试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.语言toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.简体中文ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.日本语ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.englishToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.关于ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.关于ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
...@@ -52,10 +57,6 @@ namespace AutoScanAndLabel ...@@ -52,10 +57,6 @@ namespace AutoScanAndLabel
this.listView1 = new System.Windows.Forms.ListView(); this.listView1 = new System.Windows.Forms.ListView();
this.btn_stop = new System.Windows.Forms.Button(); this.btn_stop = new System.Windows.Forms.Button();
this.btn_run = new System.Windows.Forms.Button(); this.btn_run = new System.Windows.Forms.Button();
this.语言toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.简体中文ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.日本语ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.englishToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
...@@ -120,6 +121,41 @@ namespace AutoScanAndLabel ...@@ -120,6 +121,41 @@ namespace AutoScanAndLabel
this.退出ToolStripMenuItem.Text = "退出"; this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click); this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
// //
// 语言toolStripMenuItem
//
this.语言toolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.简体中文ToolStripMenuItem,
this.日本语ToolStripMenuItem,
this.englishToolStripMenuItem});
this.语言toolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.语言toolStripMenuItem.Name = "语言toolStripMenuItem";
this.语言toolStripMenuItem.Size = new System.Drawing.Size(54, 25);
this.语言toolStripMenuItem.Text = "语言";
//
// 简体中文ToolStripMenuItem
//
this.简体中文ToolStripMenuItem.Name = "简体中文ToolStripMenuItem";
this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.简体中文ToolStripMenuItem.Tag = "not";
this.简体中文ToolStripMenuItem.Text = "简体中文";
this.简体中文ToolStripMenuItem.Click += new System.EventHandler(this.简体中文ToolStripMenuItem_Click);
//
// 日本语ToolStripMenuItem
//
this.日本语ToolStripMenuItem.Name = "日本语ToolStripMenuItem";
this.日本语ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.日本语ToolStripMenuItem.Tag = "not";
this.日本语ToolStripMenuItem.Text = "日本語";
this.日本语ToolStripMenuItem.Click += new System.EventHandler(this.日本语ToolStripMenuItem_Click);
//
// englishToolStripMenuItem
//
this.englishToolStripMenuItem.Name = "englishToolStripMenuItem";
this.englishToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.englishToolStripMenuItem.Tag = "not";
this.englishToolStripMenuItem.Text = "English";
this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click);
//
// 关于ToolStripMenuItem // 关于ToolStripMenuItem
// //
this.关于ToolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); this.关于ToolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
...@@ -307,41 +343,6 @@ namespace AutoScanAndLabel ...@@ -307,41 +343,6 @@ namespace AutoScanAndLabel
this.btn_run.UseVisualStyleBackColor = true; this.btn_run.UseVisualStyleBackColor = true;
this.btn_run.Click += new System.EventHandler(this.btn_run_Click); this.btn_run.Click += new System.EventHandler(this.btn_run_Click);
// //
// 语言toolStripMenuItem
//
this.语言toolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.简体中文ToolStripMenuItem,
this.日本语ToolStripMenuItem,
this.englishToolStripMenuItem});
this.语言toolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.语言toolStripMenuItem.Name = "语言toolStripMenuItem";
this.语言toolStripMenuItem.Size = new System.Drawing.Size(54, 25);
this.语言toolStripMenuItem.Text = "语言";
//
// 简体中文ToolStripMenuItem
//
this.简体中文ToolStripMenuItem.Name = "简体中文ToolStripMenuItem";
this.简体中文ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.简体中文ToolStripMenuItem.Tag = "not";
this.简体中文ToolStripMenuItem.Text = "简体中文";
this.简体中文ToolStripMenuItem.Click += new System.EventHandler(this.简体中文ToolStripMenuItem_Click);
//
// 日本语ToolStripMenuItem
//
this.日本语ToolStripMenuItem.Name = "日本语ToolStripMenuItem";
this.日本语ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.日本语ToolStripMenuItem.Tag = "not";
this.日本语ToolStripMenuItem.Text = "日本語";
this.日本语ToolStripMenuItem.Click += new System.EventHandler(this.日本语ToolStripMenuItem_Click);
//
// englishToolStripMenuItem
//
this.englishToolStripMenuItem.Name = "englishToolStripMenuItem";
this.englishToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.englishToolStripMenuItem.Tag = "not";
this.englishToolStripMenuItem.Text = "English";
this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
...@@ -354,6 +355,7 @@ namespace AutoScanAndLabel ...@@ -354,6 +355,7 @@ namespace AutoScanAndLabel
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1"; this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
......
...@@ -120,4 +120,292 @@ ...@@ -120,4 +120,292 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAA
AABZPT3QWT09/1g8PP9YPDz/WDw8/1g8Pf9YPD3/WDw9/1g8Pf9YPD3/WDw9/1g8Pf9YPD3/WDw9/1g8
Pf9YPD3/WDw9/1g8Pf9YPD3/WDw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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAH8AAAAAAA
AH/+AAAAAAAH//+AAAAAAH///+AAAAAH/////AAAAH//////AAAH///////gAH////////gH////////
/j////////////////////////////////////////////////8=
</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -35,8 +35,30 @@ namespace AutoScanAndLabel.UC ...@@ -35,8 +35,30 @@ namespace AutoScanAndLabel.UC
this.groupBox_left = new System.Windows.Forms.GroupBox(); this.groupBox_left = new System.Windows.Forms.GroupBox();
this.button_leftneedempty = new System.Windows.Forms.Button(); this.button_leftneedempty = new System.Windows.Forms.Button();
this.button_Leftleavefull = new System.Windows.Forms.Button(); this.button_Leftleavefull = new System.Windows.Forms.Button();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblCurMissionId = new System.Windows.Forms.Label();
this.lblMissionResult = new System.Windows.Forms.Label();
this.lblMissionRunstate = new System.Windows.Forms.Label();
this.lblCurRunMissionId = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.label7 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.txtMissionId = new System.Windows.Forms.TextBox();
this.txtLeaveId = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtEnterId = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.txtMoveRSTId = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtMoveLSTId = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.btnSave = new System.Windows.Forms.Button();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.groupBox_right.SuspendLayout(); this.groupBox_right.SuspendLayout();
this.groupBox_left.SuspendLayout(); this.groupBox_left.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBox_right // groupBox_right
...@@ -101,9 +123,193 @@ namespace AutoScanAndLabel.UC ...@@ -101,9 +123,193 @@ namespace AutoScanAndLabel.UC
this.button_Leftleavefull.UseVisualStyleBackColor = true; this.button_Leftleavefull.UseVisualStyleBackColor = true;
this.button_Leftleavefull.Click += new System.EventHandler(this.button_Leftleavefull_Click); this.button_Leftleavefull.Click += new System.EventHandler(this.button_Leftleavefull_Click);
// //
// groupBox2
//
this.groupBox2.Controls.Add(this.lblCurMissionId);
this.groupBox2.Controls.Add(this.lblMissionResult);
this.groupBox2.Controls.Add(this.lblMissionRunstate);
this.groupBox2.Controls.Add(this.lblCurRunMissionId);
this.groupBox2.Location = new System.Drawing.Point(555, 20);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(358, 226);
this.groupBox2.TabIndex = 4;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "AGV状态";
//
// lblCurMissionId
//
this.lblCurMissionId.AutoSize = true;
this.lblCurMissionId.Location = new System.Drawing.Point(7, 29);
this.lblCurMissionId.Name = "lblCurMissionId";
this.lblCurMissionId.Size = new System.Drawing.Size(119, 14);
this.lblCurMissionId.TabIndex = 3;
this.lblCurMissionId.Text = "当前的mission id";
//
// lblMissionResult
//
this.lblMissionResult.AutoSize = true;
this.lblMissionResult.Location = new System.Drawing.Point(7, 169);
this.lblMissionResult.Name = "lblMissionResult";
this.lblMissionResult.Size = new System.Drawing.Size(112, 14);
this.lblMissionResult.TabIndex = 2;
this.lblMissionResult.Text = "mission运行结果";
//
// lblMissionRunstate
//
this.lblMissionRunstate.AutoSize = true;
this.lblMissionRunstate.Location = new System.Drawing.Point(7, 130);
this.lblMissionRunstate.Name = "lblMissionRunstate";
this.lblMissionRunstate.Size = new System.Drawing.Size(112, 14);
this.lblMissionRunstate.TabIndex = 1;
this.lblMissionRunstate.Text = "mission运行状态";
//
// lblCurRunMissionId
//
this.lblCurRunMissionId.AutoSize = true;
this.lblCurRunMissionId.Location = new System.Drawing.Point(7, 97);
this.lblCurRunMissionId.Name = "lblCurRunMissionId";
this.lblCurRunMissionId.Size = new System.Drawing.Size(147, 14);
this.lblCurRunMissionId.TabIndex = 0;
this.lblCurRunMissionId.Text = "正在运行的mission id";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.label7);
this.groupBox3.Controls.Add(this.button1);
this.groupBox3.Controls.Add(this.txtMissionId);
this.groupBox3.Controls.Add(this.txtLeaveId);
this.groupBox3.Controls.Add(this.label5);
this.groupBox3.Controls.Add(this.txtEnterId);
this.groupBox3.Controls.Add(this.label6);
this.groupBox3.Controls.Add(this.txtMoveRSTId);
this.groupBox3.Controls.Add(this.label3);
this.groupBox3.Controls.Add(this.txtMoveLSTId);
this.groupBox3.Controls.Add(this.label4);
this.groupBox3.Location = new System.Drawing.Point(277, 266);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(636, 219);
this.groupBox3.TabIndex = 5;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "任务编号设置";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(4, 154);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(77, 14);
this.label7.TabIndex = 11;
this.label7.Text = "任务编号:";
//
// button1
//
this.button1.Location = new System.Drawing.Point(223, 136);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(122, 45);
this.button1.TabIndex = 10;
this.button1.Text = "手动任务测试";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// txtMissionId
//
this.txtMissionId.Location = new System.Drawing.Point(87, 150);
this.txtMissionId.Name = "txtMissionId";
this.txtMissionId.Size = new System.Drawing.Size(100, 23);
this.txtMissionId.TabIndex = 9;
//
// txtLeaveId
//
this.txtLeaveId.Location = new System.Drawing.Point(459, 81);
this.txtLeaveId.Name = "txtLeaveId";
this.txtLeaveId.Size = new System.Drawing.Size(100, 23);
this.txtLeaveId.TabIndex = 8;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(285, 78);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(168, 14);
this.label5.TabIndex = 7;
this.label5.Text = "料串流出AGV的任务编号:";
//
// txtEnterId
//
this.txtEnterId.Location = new System.Drawing.Point(459, 29);
this.txtEnterId.Name = "txtEnterId";
this.txtEnterId.Size = new System.Drawing.Size(100, 23);
this.txtEnterId.TabIndex = 6;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(285, 32);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(168, 14);
this.label6.TabIndex = 5;
this.label6.Text = "料串流入AGV的任务编号:";
//
// txtMoveRSTId
//
this.txtMoveRSTId.Location = new System.Drawing.Point(166, 81);
this.txtMoveRSTId.Name = "txtMoveRSTId";
this.txtMoveRSTId.Size = new System.Drawing.Size(100, 23);
this.txtMoveRSTId.TabIndex = 4;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(8, 81);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(161, 14);
this.label3.TabIndex = 3;
this.label3.Text = "移动到右侧的任务编号:";
//
// txtMoveLSTId
//
this.txtMoveLSTId.Location = new System.Drawing.Point(166, 32);
this.txtMoveLSTId.Name = "txtMoveLSTId";
this.txtMoveLSTId.Size = new System.Drawing.Size(100, 23);
this.txtMoveLSTId.TabIndex = 2;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(8, 35);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(161, 14);
this.label4.TabIndex = 1;
this.label4.Text = "移动到左侧的任务编号:";
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(22, 316);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(122, 45);
this.btnSave.TabIndex = 6;
this.btnSave.Text = "保存";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(22, 266);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(82, 18);
this.checkBox1.TabIndex = 7;
this.checkBox1.Text = "参数设置";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// AgvControl // AgvControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox_left); this.Controls.Add(this.groupBox_left);
this.Controls.Add(this.groupBox_right); this.Controls.Add(this.groupBox_right);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -111,7 +317,12 @@ namespace AutoScanAndLabel.UC ...@@ -111,7 +317,12 @@ namespace AutoScanAndLabel.UC
this.Size = new System.Drawing.Size(973, 521); this.Size = new System.Drawing.Size(973, 521);
this.groupBox_right.ResumeLayout(false); this.groupBox_right.ResumeLayout(false);
this.groupBox_left.ResumeLayout(false); this.groupBox_left.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
...@@ -123,5 +334,25 @@ namespace AutoScanAndLabel.UC ...@@ -123,5 +334,25 @@ namespace AutoScanAndLabel.UC
private System.Windows.Forms.Button button_rightneedempty; private System.Windows.Forms.Button button_rightneedempty;
private System.Windows.Forms.Button button_leftneedempty; private System.Windows.Forms.Button button_leftneedempty;
private System.Windows.Forms.Button button_Leftleavefull; private System.Windows.Forms.Button button_Leftleavefull;
private System.ComponentModel.BackgroundWorker backgroundWorker1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox txtMoveRSTId;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtMoveLSTId;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtLeaveId;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtEnterId;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Label lblMissionResult;
private System.Windows.Forms.Label lblMissionRunstate;
private System.Windows.Forms.Label lblCurRunMissionId;
private System.Windows.Forms.Label lblCurMissionId;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txtMissionId;
} }
} }
using DeviceLibrary; using DeviceLibrary;
using DL.StandardRobot;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
...@@ -15,12 +16,55 @@ namespace AutoScanAndLabel.UC ...@@ -15,12 +16,55 @@ namespace AutoScanAndLabel.UC
{ {
public partial class AgvControl : UserControl public partial class AgvControl : UserControl
{ {
public string serverIp = "";
public AgvControl() public AgvControl()
{ {
InitializeComponent(); InitializeComponent();
serverIp = ConfigAppSettings.GetValue(Setting_Init.STD_IP);
AGVManager.Connect(serverIp);
load();
groupBox2.Text = $"AGV状态[{serverIp}]";
AGVManager.Register(MissionStateChanged);
endit(false);
} }
~AgvControl()
{
AGVManager.UnRegister(MissionStateChanged);
AGVManager.Close();
}
private void load()
{
txtEnterId.Text=ConfigAppSettings.GetValue(Setting_Init.ShelfInAGV);
txtLeaveId.Text = ConfigAppSettings.GetValue(Setting_Init.ShelfOutAGV);
txtMoveLSTId.Text = ConfigAppSettings.GetValue(Setting_Init.LStation);
txtMoveRSTId.Text = ConfigAppSettings.GetValue(Setting_Init.RStation);
}
private void save()
{
ConfigAppSettings.SaveValue(Setting_Init.ShelfInAGV, txtEnterId.Text);
ConfigAppSettings.SaveValue(Setting_Init.ShelfOutAGV, txtLeaveId.Text);
ConfigAppSettings.SaveValue(Setting_Init.LStation, $"{txtMoveLSTId.Text}");
ConfigAppSettings.SaveValue(Setting_Init.RStation, $"{txtMoveRSTId.Text}");
}
private void MissionStateChanged(MissionState state)
{
if (!this.IsHandleCreated) return;
this.Invoke(new Action(() =>
{
try
{
lblCurMissionId.Text = $"当前任务编号:{state.MissionId}";
lblCurRunMissionId.Text = $"运行任务编号:{state.RunMissionId}";
lblMissionRunstate.Text = $"任务运行状态:{state.MissionRunState}";
lblMissionResult.Text = $"任务运行结果:{state.MissionResult}";
}
catch
{
}
}));
}
private void button_rightneedempty_Click(object sender, EventArgs e) private void button_rightneedempty_Click(object sender, EventArgs e)
{ {
if (!RobotManage.isRunning) if (!RobotManage.isRunning)
...@@ -122,5 +166,24 @@ namespace AutoScanAndLabel.UC ...@@ -122,5 +166,24 @@ namespace AutoScanAndLabel.UC
else else
MessageBox.Show("当前有料串不能请求进入料串"); MessageBox.Show("当前有料串不能请求进入料串");
} }
private void btnSave_Click(object sender, EventArgs e)
{
save();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
endit(checkBox1.Checked);
}
void endit(bool maul)
{
groupBox3.Enabled = maul;
}
private void button1_Click(object sender, EventArgs e)
{
int.TryParse(txtMissionId.Text,out int val);
AGVManager.AddMission(val);
}
} }
} }
...@@ -117,4 +117,7 @@ ...@@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -33,9 +33,8 @@ ...@@ -33,9 +33,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
...@@ -44,6 +43,7 @@ ...@@ -44,6 +43,7 @@
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
......
...@@ -53,5 +53,11 @@ namespace OnlineStore.Common ...@@ -53,5 +53,11 @@ namespace OnlineStore.Common
public static string CodeParamPath = "CodeParamPath"; public static string CodeParamPath = "CodeParamPath";
public static string QRCodeCount = "QRCodeCount"; public static string QRCodeCount = "QRCodeCount";
public static string STD_IP = "STD_IP";
public static string LStation = "LStation";
public static string RStation = "RStation";
public static string ShelfInAGV = "ShelfInAGV";
public static string ShelfOutAGV = "ShelfOutAGV";
} }
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="log4net" version="2.0.12" targetFramework="net461" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" /> <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />
</packages> </packages>
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace DL.Com
{
public class ComHelper
{
static UdpClient broadcastClient; //广播客户端
static IPEndPoint broadcastEndPoint; //广播远程节点
static byte[] broadcastBuffer; //远程返回数据
/// <summary>
/// 自动获取IP地址,未连接前使用,必须在同一网段
/// </summary>
/// <param name="localIP">本地IP地址</param>
/// <returns></returns>
public static bool AutoIP(string localIP,out string ip)
{
ip = "";
try
{
IPEndPoint local = new IPEndPoint(IPAddress.Parse(localIP), 55654);
broadcastClient = new UdpClient(local);
broadcastBuffer = null;
Thread tTemp = new Thread(new ThreadStart(GetIP));
tTemp.Start();
broadcastEndPoint = new IPEndPoint(IPAddress.Parse("255.255.255.255"), 1024);
byte[] dgram = new byte[] { 0x05, 0x00, 0x07, 0x00, 0x00, 0xC1, 0x59 };
broadcastClient.Send(dgram, dgram.Length, broadcastEndPoint);
Thread.Sleep(1000);
tTemp.Abort();
broadcastClient.Close();
//ErrInfo = "无法访问";
if (broadcastBuffer == null) return false;
if (broadcastBuffer[0] != 0x3B) return false;
byte[] buff = new byte[broadcastBuffer[7]];
Array.Copy(broadcastBuffer, 9, buff, 0, buff.Length);
ip = buff[buff.Length - 12] + "." + buff[buff.Length - 11] + "." + buff[buff.Length - 10] + "." + buff[buff.Length - 9];
//ErrInfo = "OK";
return true;
}
catch (Exception ex)
{
return false;
}
}
/// <summary>
/// 获取目标IP地址
/// </summary>
static void GetIP()
{
broadcastBuffer = broadcastClient.Receive(ref broadcastEndPoint);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F85A7412-B5B3-4291-A448-A10564602E1A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DL.StandardRobot</RootNamespace>
<AssemblyName>DL.StandardRobot</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Robots\StandardRobot.cs" />
<Compile Include="CommHelper.cs" />
<Compile Include="HttpHelper.cs" />
<Compile Include="JsonHelper.cs" />
<Compile Include="LogUtil.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Protocol\Modbus\CoilRegister.cs" />
<Compile Include="Protocol\Modbus\DataFrame.cs" />
<Compile Include="Protocol\Modbus\DiscreteInputRegister.cs" />
<Compile Include="Protocol\Modbus\HoldingRegister.cs" />
<Compile Include="Protocol\Modbus\InputRegister.cs" />
<Compile Include="Protocol\Modbus\Register.cs" />
<Compile Include="StringHelper.cs" />
<Compile Include="TCP\ModbusTCPMaster.cs" />
<Compile Include="TCP\TcpClient.cs" />
<Compile Include="TCP\TcpServer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Protocol\Modbus\_system~.ini" />
<None Include="Protocol\_system~.ini" />
<None Include="TCP\_system~.ini" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{43CDD09E-FCF3-4960-A01D-3BBFE9933122}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Utils
{
public class HttpHelper
{
/// <summary>
/// 检查IP是否合法
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public static bool CheckIP(string ip,string name="")
{
//IP合法
string pattern = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$";
bool rtn = System.Text.RegularExpressions.Regex.IsMatch(ip, pattern);
if (!rtn)
{
LogUtil.Error($"【{name}】非法的IP地址:" + ip);
return false;
}
return true;
}
/// <summary>
/// Ping指定IP
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public static bool PingIP(string ip)
{
//Ping服务端
try
{
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply result = ping.Send(ip, 2000);
ping.Dispose();
if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
{
return false;
}
return true;
}
catch (Exception ex)
{
LogUtil.Error($"PingIP{ip}:", ex);
return false;
}
}
}
}
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace DL.Utils
{
/// <summary>
/// Json帮助类
/// </summary>
public class JsonHelper
{
/// <summary>
/// 将对象序列化为JSON格式
/// </summary>
/// <param name="o">对象</param>
/// <returns>json字符串</returns>
public static string SerializeObject(object o)
{
string json = JsonConvert.SerializeObject(o);
return json;
}
/// <summary>
/// 解析JSON字符串生成对象实体
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json字符串(eg.{"ID":"112","Name":"石子儿"})</param>
/// <returns>对象实体</returns>
public static T DeserializeJsonToObject<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
T t = o as T;
return t;
}
/// <summary>
/// 解析JSON数组生成对象实体集合
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json数组字符串(eg.[{"ID":"112","Name":"石子儿"}])</param>
/// <returns>对象实体集合</returns>
public static List<T> DeserializeJsonToList<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
List<T> list = o as List<T>;
return list;
}
/// <summary>
/// 反序列化JSON到给定的匿名对象.
/// </summary>
/// <typeparam name="T">匿名对象类型</typeparam>
/// <param name="json">json字符串</param>
/// <param name="anonymousTypeObject">匿名对象</param>
/// <returns>匿名对象</returns>
public static T DeserializeAnonymousType<T>(string json, T anonymousTypeObject)
{
T t = JsonConvert.DeserializeAnonymousType(json, anonymousTypeObject);
return t;
}
}
///// <summary>
///// 与服务器通信用对象
///// </summary>
//public class Operation
//{
// private string _cid = "";
// public string cid
// {
// get { return _cid; }
// set { _cid = value; }
// }
// public int seq { get; set; }
// public int op { get; set; }
// public int status { get; set; }
// private string _error = "";
// public string error
// {
// get { return _error; }
// set { _error = value; }
// }
// private Dictionary<string, string> _data = new Dictionary<string,string>();
// public Dictionary<string, string> data {
// get { return _data; }
// set { _data = value; }
// }
//}
}
using log4net;
using System;
using System.Reflection;
using System.Drawing;
using log4net.Repository;
using log4net.Config;
using System.IO;
using System.Text;
using System.Collections.Generic;
namespace DL.Utils
{
public class LogUtil
{
static Dictionary<string, ILog> LogMap = new Dictionary<string, ILog>();
public delegate void ShowMsg(string msg);
public static event ShowMsg ShowDebug;
public static event ShowMsg ShowInfo;
public static event ShowMsg ShowWarn;
public static event ShowMsg ShowError;
static readonly ILog defaultLog = LogManager.GetLogger("standrobot");
public static void Init()
{
XmlConfigurator.Configure(new FileInfo("log4net.config"));
LogMap.Add("AIOBOX", defaultLog);
}
public static void AddLogMap(string key, ILog log)
{
LogMap.Add(key, log);
}
#region Main log
public static void Debug(string msg, ILog log = null)
{
ShowDebug?.Invoke(msg);
if (log == null)
defaultLog.Debug(msg);
else
log.Debug(msg);
}
public static void Info(string msg, ILog log = null)
{
ShowInfo?.Invoke(msg);
if (log == null)
defaultLog.Info(msg);
else
log.Info(msg);
}
public static void Info(string msg, string logName)
{
ShowInfo?.Invoke(msg);
if (string.IsNullOrEmpty(logName))
defaultLog.Info(msg);
else if (LogMap.ContainsKey(logName) && LogMap[logName] != null)
LogMap[logName].Info(msg);
}
public static void Warn(string msg, ILog log = null)
{
ShowWarn?.Invoke(msg);
if (log == null)
defaultLog.Warn(msg);
else
log.Warn(msg);
}
public static void Error(string msg, Exception exception, ILog log)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (log == null)
{
if (exception == null)
defaultLog.Error(msg);
else
{
defaultLog.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
else
{
if (exception == null)
log.Error(msg);
else
{
log.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg, ILog log, Exception exception)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (log == null)
{
if (exception == null)
defaultLog.Error(msg);
else
{
defaultLog.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
else
{
if (exception == null)
log.Error(msg);
else
{
log.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg, ILog log)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (log == null)
{
defaultLog.Error(msg);
}
else
{
log.Error(msg);
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg, Exception exception)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (exception == null)
defaultLog.Error(msg);
else
{
defaultLog.Error(msg, exception);
sb.Append(exception.StackTrace);
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg)
{
defaultLog.Error(msg);
ShowError?.Invoke(msg);
}
#endregion
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DL.StandardRobot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DL.StandardRobot")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f85a7412-b5b3-4291-a448-a10564602e1a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 线圈寄存器:可读可写。
/// 支持的功能码:
/// 0x01:读线圈
/// 0x05:写线圈
/// 0x0F:写多个线圈
/// </summary>
public class CoilRegister : Register
{
public CoilRegister() : base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x01);
FunctionCodes.Add(RegisterFunction.WriteSingle, 0x05);
FunctionCodes.Add(RegisterFunction.WriteMultiple, 0x0F);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"0{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
/// <summary>
/// 解析写单个线圈
/// </summary>
/// <returns>写入成功</returns>
protected override bool ParseWriteSingle(byte[] respoonse)
{
if (GetResponseResult(respoonse, out byte[] data))
{
//数据部分,发送与接收一致
byte[] senddata = FrameStruct.PDU.Data.ToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
/// <summary>
/// 解析写多个线圈
/// </summary>
/// <returns>写入成功/returns>
protected override bool ParseWriteMultiple(byte[] response)
{
if (GetResponseResult(response, out byte[] data))
{
byte[] senddata = FrameStruct.PDU.Data.AddrValueToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
protected override void SetParamPDU(CmdByte cmd)
{
if (cmd.Function.Equals(RegisterFunction.WriteSingle))
{
SetPDU(cmd.Function, cmd.StartAddr, cmd.Count.Equals(new Byte2 { ByteH = 0x00, ByteL = 0x00 }) ? cmd.Count : new Byte2 { ByteH = 0xFF, ByteL = 0x00 }, cmd.ByteLength, cmd.ValuesOfMultiple);
}
else if (cmd.Function.Equals(RegisterFunction.WriteMultiple))
{
SetPDU(cmd.Function, cmd.StartAddr, cmd.Count, cmd.ByteLength, cmd.ValuesOfMultiple);
}
else
{
SetPDU(RegisterFunction.Read, cmd.StartAddr, cmd.Count);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 数据帧:报文头+帧结构
/// </summary>
public class DataFrame
{
/// <summary>
/// 报文头
/// </summary>
public MBAP MBAP;
/// <summary>
/// 帧结构
/// </summary>
public PDU PDU;
public DataFrame()
{
MBAP = new MBAP();
PDU = new PDU();
}
/// <summary>
/// 设置帧数据
/// </summary>
/// <param name="functionCode">功能码</param>
/// <param name="addr">开始地址</param>
/// <param name="value">数量</param>
/// <param name="bytelenght">字节长度,写多个线圈/寄存器使用</param>
/// <param name="valueofmulti">写入的值,写多个线圈/寄存器使用</param>
public void SetPDU(byte functionCode, ushort addr, ushort value, byte bytelenght = 0, byte[] valueofmulti = null)
{
PDU.SetPDUFunctionCode(functionCode);
PDU.SetPDUData(addr, value, bytelenght, valueofmulti);
MBAP.SetDataLength(PDU.GetLength());
}
/// <summary>
/// 设置帧数据
/// </summary>
/// <param name="functionCode">功能码</param>
/// <param name="addr">开始地址</param>
/// <param name="value">数量</param>
/// <param name="bytelenght">字节长度,写多个线圈/寄存器使用</param>
/// <param name="valueofmulti">写入的值,写多个线圈/寄存器使用</param>
public void SetPDU(byte functionCode, Byte2 addr, Byte2 value, byte bytelenght = 0x00, byte[] valueofmulti = null)
{
PDU.SetPDUFunctionCode(functionCode);
PDU.SetPDUData(addr, value, bytelenght, valueofmulti);
MBAP.SetDataLength(PDU.GetLength());
}
/// <summary>
/// 设置报文头
/// </summary>
public void SetMBAP(ushort serialnum, byte equipAddr, ushort protocolid = 0)
{
MBAP.SetSerialNum(serialnum);
MBAP.SetEquipAddr(equipAddr);
MBAP.SetProtocolId(protocolid);
}
/// <summary>
/// 设置报文头
/// </summary>
public void SetMBAP(Byte2 serialnum, byte equipAddr, ushort protocolid = 0)
{
MBAP.SetSerialNum(serialnum);
MBAP.SetEquipAddr(equipAddr);
MBAP.SetProtocolId(protocolid);
}
/// <summary>
/// 数据帧字节数据
/// </summary>
/// <returns></returns>
public byte[] ToBytes()
{
List<byte> tmp = new List<byte>();
tmp.AddRange(MBAP.ToBytes());
tmp.AddRange(PDU.ToBytes());
return tmp.ToArray();
}
public byte[] ToMbapFuncCodeBytes()
{
List<byte> tmp = new List<byte>();
tmp.AddRange(MBAP.ToBytes());
tmp.Add(PDU.FuncCode);
return tmp.ToArray();
}
}
/// <summary>
/// 报文头
/// </summary>
public class MBAP
{
/// <summary>
/// 报文序列号,事务处理标识符
/// 长度:2字节
/// </summary>
public Byte2 SerialNum;
/// <summary>
/// 协议标识符
/// 0000标识ModbusTCP协议
/// 长度:2字节
/// </summary>
public Byte2 ProtocolId;
/// <summary>
/// 接下来的数据长度
/// 长度:2字节
/// </summary>
public Byte2 DataLength;
/// <summary>
/// 设备地址
/// 长度:1字节
/// </summary>
public byte EquipAddr;
public MBAP()
{
SerialNum = new Byte2();
ProtocolId = new Byte2();
DataLength = new Byte2();
}
public void SetData(byte[] data)
{
if (data.Length > 7)
{
SerialNum.Set(data[0], data[1]);
ProtocolId.Set(data[2], data[3]);
DataLength.Set(data[4], data[5]);
EquipAddr = data[6];
}
}
public void SetSerialNum(UInt16 serialnum)
{
SerialNum.SetByInt(serialnum);
}
public void SetSerialNum(byte Hi, byte Low)
{
SerialNum.Set(Hi, Low);
}
public void SetSerialNum(Byte2 stru2Byte)
{
SerialNum.Set(stru2Byte);
}
/// <summary>
/// 设置协议ID,默认TCP协议
/// </summary>
/// <param name="protocolid"></param>
public void SetProtocolId(UInt16 protocolid = 0)
{
ProtocolId.SetByInt(protocolid);
}
/// <summary>
/// 设置协议ID,默认TCP协议
/// </summary>
/// <param name="Hi"></param>
/// <param name="Low"></param>
public void SetProtocolId(byte Hi = 0x00, byte Low = 0x00)
{
ProtocolId.Set(Hi, Low);
}
public void SetProtocolId(Byte2 stru2Byte)
{
ProtocolId.Set(stru2Byte);
}
/// <summary>
/// 设置协议地址
/// </summary>
/// <param name="equipAddr"></param>
public void SetEquipAddr(byte equipAddr)
{
EquipAddr = equipAddr;
}
/// <summary>
/// 设置接下来的数据长度
/// </summary>
/// <param name="datalength">PDU里的数据长度</param>
public void SetDataLength(ushort datalength)
{
DataLength.SetByInt((ushort)(datalength+1));
}
/// <summary>
/// 设置接下来的数据长度
/// </summary>
/// <param name="Hi"></param>
/// <param name="Low"></param>
public void SetDataLength(byte Hi, byte Low)
{
DataLength.Set(Hi, Low);
}
public override bool Equals(object obj)
{
MBAP cMBAP = obj as MBAP;
if (cMBAP == null)
return false;
if (cMBAP.SerialNum.Equals(this.SerialNum) &&
cMBAP.ProtocolId.Equals(this.ProtocolId) &&
cMBAP.EquipAddr.Equals(this.EquipAddr))
return true;
else
return false;
}
/// <summary>
/// 报文头字节数据
/// </summary>
/// <returns></returns>
public byte[] ToBytes()
{
List<byte> tmp = new List<byte>();
tmp.AddRange(SerialNum.ToBytes());
tmp.AddRange(ProtocolId.ToBytes());
tmp.AddRange(DataLength.ToBytes());
tmp.Add(EquipAddr);
return tmp.ToArray();
}
}
/// <summary>
/// 数据帧
/// </summary>
public class PDU
{
/// <summary>
/// 功能码
/// </summary>
public byte FuncCode;
/// <summary>
/// 数据
/// </summary>
public DataInPDU Data;
public PDU()
{
Data = new DataInPDU();
}
/// <summary>
/// 设置帧结构功能码
/// </summary>
/// <param name="funcCode">功能码</param>
public void SetPDUFunctionCode(byte funcCode)
{
FuncCode = funcCode;
}
public void SetPDUData(ushort addr, ushort value, byte bytelenght = 0, byte[] valueofmulti = null)
{
Data.SetData(addr, value, bytelenght, valueofmulti);
}
public void SetPDUData(Byte2 addr, Byte2 value, byte bytelenght = 0x00, byte[] valueofmulti = null)
{
Data.SetData(addr, value, bytelenght, valueofmulti);
}
/// <summary>
/// 帧结构的数据长度
/// </summary>
/// <returns></returns>
public ushort GetLength()
{
return (ushort)(Data.Length() + 1);
}
public byte[] ToBytes()
{
List<byte> tmp = new List<byte>();
tmp.Add(FuncCode);
tmp.AddRange(Data.ToBytes());
return tmp.ToArray();
}
}
public class DataInPDU
{
/// <summary>
/// 起始地址/寄存器地址
/// </summary>
public Byte2 Addr;
/// <summary>
/// 数量/值
/// </summary>
public Byte2 Value;
/// <summary>
/// 字节长度,写多个线圈/保持寄存器时使用
/// </summary>
public byte ByteLength;
/// <summary>
/// 输出值/寄存器值,写多个线圈/保持寄存器时使用
/// </summary>
public List<byte> ValueOfMulti;
public DataInPDU()
{
Addr = new Byte2();
Value = new Byte2();
ValueOfMulti = new List<byte>();
}
public void SetData(ushort addr, ushort value, byte bytelenght = 0, byte[] valueofmulti = null)
{
Addr.SetByInt(addr);
Value.SetByInt(value);
ByteLength = bytelenght;
ValueOfMulti.Clear();
if (valueofmulti != null)
foreach (var item in valueofmulti)
{
ValueOfMulti.Add(item);
}
}
public void SetData(Byte2 addr, Byte2 value, byte bytelenght = 0x00, byte[] valueofmulti = null)
{
Addr.Set(addr);
Value.Set(value);
ByteLength = bytelenght;
ValueOfMulti.Clear();
if (valueofmulti != null)
foreach (var item in valueofmulti)
{
ValueOfMulti.Add(item);
}
}
public byte[] ToBytes()
{
List<byte> tmp = new List<byte>();
tmp.AddRange(Addr.ToBytes());
tmp.AddRange(Value.ToBytes());
if (ByteLength != 0)
{
tmp.Add(ByteLength);
foreach (var item in ValueOfMulti)
{
tmp.Add(item);
}
}
return tmp.ToArray();
}
public byte[] AddrValueToBytes()
{
List<byte> tmp = new List<byte>();
tmp.AddRange(Addr.ToBytes());
tmp.AddRange(Value.ToBytes());
return tmp.ToArray();
}
public int Length()
{
List<byte> tmp = new List<byte>();
tmp.AddRange(Addr.ToBytes());
tmp.AddRange(Value.ToBytes());
if (ByteLength != 0)
{
tmp.Add(ByteLength);
foreach (var item in ValueOfMulti)
{
tmp.Add(item);
}
}
return tmp.Count;
}
}
/// <summary>
/// 两字节组成的值
/// </summary>
public struct Byte2
{
public byte ByteH { get; set; }
public byte ByteL { get; set; }
public static Byte2 GetStru2Byte(ushort val)
{
return new Byte2
{
ByteH = (byte)((val >> 8) & 0xff),
ByteL = (byte)((val & 0xff))
};
}
public static ushort GetUInt16(byte H,byte L)
{
return (ushort)(((H & 0xff) << 8) | (L & 0xff));
}
public static short GetInt16(byte H, byte L)
{
return (short)((H << 8) | (L & 0xff));
}
public static int GetInt32(byte H, byte L)
{
return ((H << 8) | (L & 0xff));
}
public static uint GetUInt32(byte H, byte L)
{
return (uint)(((H & 0xff) << 8) | (L & 0xff));
}
public void SetByInt(ushort val)
{
ByteH = (byte)((val >> 8) & 0xff);
ByteL = (byte)((val & 0xff));
}
public void Set(byte High, byte Low)
{
ByteH = High;
ByteL = Low;
}
public void Set(Byte2 stru2Byte)
{
ByteH = stru2Byte.ByteH;
ByteL = stru2Byte.ByteL;
}
public ushort GetIntValue()
{
return (ushort)(((ByteH & 0xff) << 8) | (ByteL & 0xff));
}
public override string ToString()
{
return $"{ByteH.ToString("x2")} {ByteL.ToString("x2")}";
}
public override bool Equals(object obj)
{
Byte2 stru2Byte = (Byte2)obj;
return ByteH.Equals(stru2Byte.ByteH) && ByteL.Equals(stru2Byte.ByteL);
}
public byte[] ToBytes()
{
return new byte[] { ByteH, ByteL };
}
}
/// <summary>
/// 四字节组成的值
/// </summary>
public struct Byte4
{
public byte ByteH1 { get; set; }
public byte ByteH2 { get; set; }
public byte ByteL1 { get; set; }
public byte ByteL2 { get; set; }
public static Byte4 GetStru2Byte(int val)
{
return new Byte4
{
ByteH1 = (byte)((val >> 24) & 0xff),
ByteH2 = (byte)((val >> 16) & 0xff),
ByteL1 = (byte)((val >> 8) & 0xff),
ByteL2 = (byte)((val & 0xff))
};
}
public void SetByInt(uint val)
{
ByteH1 = (byte)((val >> 24) & 0xff);
ByteH2 = (byte)((val >> 16) & 0xff);
ByteL1 = (byte)((val >> 8) & 0xff);
ByteL2 = (byte)((val & 0xff));
}
public void Set(Byte4 stru4Byte)
{
ByteH1 = stru4Byte.ByteH1;
ByteH2 = stru4Byte.ByteH2;
ByteL1 = stru4Byte.ByteL1;
ByteL2 = stru4Byte.ByteL2;
}
public static uint GetUInt32(byte h1,byte h2,byte l1,byte l2)
{
return (uint)(((h1 & 0xff) << 24) | ((h2 & 0xff) << 16) | ((l1 & 0xff) << 8) | (l2 & 0xff));
}
public static int GetInt32(byte h1, byte h2, byte l1, byte l2)
{
return (int)((h1 << 24) | ((h2 & 0xff) << 16) | ((l1 & 0xff) << 8) | (l2 & 0xff));
}
/// <summary>
/// 大终端转float
/// </summary>
/// <param name="h1"></param>
/// <param name="h2"></param>
/// <param name="l1"></param>
/// <param name="l2"></param>
/// <returns></returns>
public static float GetFloat(byte h1, byte h2, byte l1, byte l2)
{
byte[] tmp = new byte[4] { h1,h2,l1,l2};
return (float)(GetInt32(h1, h2, l1, l2));
//float f = 0;
//byte[] x = tmp;
//byte i;
//unsafe
//{
// void* pf;
// fixed(byte* pb = x)
// {
// pf = &f;
// for (i = 0; i < tmp.Length; i++)
// {
// *((byte*)pf + i) = *(pb+i);
// }
// }
//}
//return f;
}
public uint GetIntValue()
{
return (uint)(((ByteH1 & 0xff) << 24) | ((ByteH2 & 0xff) << 16) | ((ByteL1 & 0xff) << 8) | (ByteL2 & 0xff));
}
public override string ToString()
{
return $"{ByteH1.ToString("x2")} {ByteH2.ToString("x2")} {ByteL1.ToString("x2")} {ByteL2.ToString("x2")}";
}
public override bool Equals(object obj)
{
Byte4 stru4Byte = (Byte4)obj;
return ByteH1.Equals(stru4Byte.ByteH1) && ByteH2.Equals(stru4Byte.ByteH2) && ByteL1.Equals(stru4Byte.ByteL1) && ByteL2.Equals(stru4Byte.ByteL2);
}
public byte[] ToBytes()
{
return new byte[] { ByteH1, ByteH2, ByteL1, ByteL2 };
}
}
public class ResponseData
{
public MBAP MBAP { get; set; }
public byte FuncCode { get; set; }
public byte[] OtherData { get; set; }
public ResponseData()
{
MBAP = new MBAP();
}
public void Set(byte[] data)
{
if (data == null)
return;
MBAP.SetData(data);
FuncCode = data[7];
OtherData = new byte[data.Length - 8];
Array.Copy(data, 8, OtherData, 0, data.Length - 8);
}
public byte[] ToBytes()
{
List<byte> vs = new List<byte>();
vs.AddRange(MBAP.ToBytes());
vs.Add(FuncCode);
vs.AddRange(OtherData);
return vs.ToArray();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 离散输入寄存器
/// 功能码0x02
/// </summary>
public class DiscreteInputRegister:Register
{
/// <summary>
/// 离散输入寄存器
/// 功能码0x02
/// </summary>
public DiscreteInputRegister() :base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x02);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"1{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
protected override bool ParseWriteMultiple(byte[] response)
{
throw new NotImplementedException();
}
protected override bool ParseWriteSingle(byte[] response)
{
throw new NotImplementedException();
}
protected override void SetParamPDU(CmdByte cmdByte)
{
SetPDU(RegisterFunction.Read, cmdByte.StartAddr, cmdByte.Count);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 保持寄存器
/// 0x03
/// </summary>
public class HoldingRegister : Register
{
public HoldingRegister() : base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x03);
FunctionCodes.Add(RegisterFunction.WriteSingle, 0x06);
FunctionCodes.Add(RegisterFunction.WriteMultiple, 0x10);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"4{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
public override byte[] GetRequestBytes(RegisterFunction func, ushort startAddr, ushort countOrValue,byte equipAddr=1, ushort[] ValuesOfMultiple = null)
{
CmdByte cmdByte = new CmdByte();
cmdByte.StartAddr = Byte2.GetStru2Byte(startAddr);
cmdByte.Function = func;
cmdByte.Count = Byte2.GetStru2Byte(countOrValue);
if (func.Equals(RegisterFunction.WriteMultiple))
{
if (ValuesOfMultiple == null)
return null;
List<byte> values = new List<byte>();
foreach (var item in ValuesOfMultiple)
{
values.AddRange(Byte2.GetStru2Byte(item).ToBytes());
}
cmdByte.ByteLength = (byte)(countOrValue * 2);
cmdByte.ValuesOfMultiple = values.ToArray();
}
SetMBAP(_serialnum, equipAddr);
SetParamPDU(cmdByte);
return DataFrame;
}
protected override void SetParamPDU(CmdByte cmdByte)
{
if (cmdByte.Function.Equals(RegisterFunction.WriteSingle))
{
SetPDU(cmdByte.Function, cmdByte.StartAddr, cmdByte.Count, cmdByte.ByteLength, cmdByte.ValuesOfMultiple);
}
else if (cmdByte.Function.Equals(RegisterFunction.WriteMultiple))
{
SetPDU(cmdByte.Function, cmdByte.StartAddr, cmdByte.Count, cmdByte.ByteLength, cmdByte.ValuesOfMultiple);
}
else
SetPDU(RegisterFunction.Read, cmdByte.StartAddr, cmdByte.Count);
}
protected override bool ParseWriteSingle(byte[] response)
{
if (GetResponseResult(response, out byte[] data))
{
//数据部分,发送与接收一致
byte[] senddata = FrameStruct.PDU.Data.ToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
protected override bool ParseWriteMultiple(byte[] response)
{
if (GetResponseResult(response, out byte[] data))
{
byte[] senddata = FrameStruct.PDU.Data.AddrValueToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 输入寄存器
/// 支持的功能码0x04
/// </summary>
public class InputRegister : Register
{
public InputRegister() : base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x04);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"3{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
protected override bool ParseWriteMultiple(byte[] response)
{
throw new NotImplementedException();
}
protected override bool ParseWriteSingle(byte[] response)
{
throw new NotImplementedException();
}
protected override void SetParamPDU(CmdByte cmdByte)
{
SetPDU(RegisterFunction.Read, cmdByte.StartAddr, cmdByte.Count);
}
}
}
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using DL.Com;
using DL.Utils;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 寄存器
/// </summary>
public abstract class Register
{
public delegate void StatusChangedEventHandler(StatusChangedEventArgs statusChangedEventArgs);
public event StatusChangedEventHandler StatusChanged;
protected static log4net.ILog log;
protected static ushort _serialnum = 0;
public Register(string logname = "logModbus")
{
log = log4net.LogManager.GetLogger(logname);
FunctionCodes = new Dictionary<RegisterFunction, byte>();
FrameStruct = new DataFrame();
}
/// <summary>
/// 功能码
/// </summary>
public Dictionary<RegisterFunction, byte> FunctionCodes { get; set; }
/// <summary>
/// 帧结构
/// </summary>
public DataFrame FrameStruct { get; protected set; }
/// <summary>
/// 数据帧--字节数据
/// </summary>
public byte[] DataFrame { get { return FrameStruct.ToBytes(); } }
/// <summary>
/// PLC地址
/// </summary>
public string PLCAddress { get; }
/// <summary>
/// 根据命令设置PDU参数
/// </summary>
/// <param name="cmdByte"></param>
/// <returns></returns>
protected abstract void SetParamPDU(CmdByte cmdByte);
/// <summary>
/// 设置MBAP报文头
/// </summary>
/// <param name="serialnum">事务处理标识,即报文序列号</param>
/// <param name="equipAddr">单元标识符,即设备地址</param>
protected void SetMBAP(ushort serialnum, byte equipAddr)
{
FrameStruct.SetMBAP(serialnum, equipAddr);
_serialnum++;
if (_serialnum >= ushort.MaxValue)
{
_serialnum = 0;
}
}
/// <summary>
/// 设置帧结构
/// </summary>
/// <param name="funcStr">功能</param>
/// <param name="addr">开始地址</param>
/// <param name="value">数量/值</param>
/// <param name="bytelenght">字节长度,写多个线圈/寄存器使用</param>
/// <param name="valueofmulti">写入的值,写多个线圈/寄存器使用</param>
protected void SetPDU(RegisterFunction func, Byte2 addr, Byte2 value, byte bytelenght = 0x00, byte[] valueofmulti = null)
{
FrameStruct.SetPDU(FunctionCodes[func], addr, value, bytelenght, valueofmulti);
}
/// <summary>
/// 检查响应的MBAP+功能码是否与请求一致
/// </summary>
/// <param name="data">响应的数据</param>
/// <returns>true:请求与返回对应</returns>
private bool CheckResponse(byte[] data, bool ignoreSerialNum = false)
{
if (data != null && data.Length > 8)
{
if (FrameStruct.MBAP.SerialNum.ByteH.Equals(data[0]) &&
FrameStruct.MBAP.SerialNum.ByteL.Equals(data[1]) &&
FrameStruct.MBAP.ProtocolId.ByteH.Equals(data[2]) &&
FrameStruct.MBAP.ProtocolId.ByteL.Equals(data[3]) &&
FrameStruct.MBAP.EquipAddr.Equals(data[6]) &&
FrameStruct.PDU.FuncCode.Equals(data[7])
)
{
return true;
}
if (ignoreSerialNum)
{
if (
FrameStruct.MBAP.ProtocolId.ByteH.Equals(data[2]) &&
FrameStruct.MBAP.ProtocolId.ByteL.Equals(data[3]) &&
FrameStruct.MBAP.EquipAddr.Equals(data[6]) &&
FrameStruct.PDU.FuncCode.Equals(data[7])
)
{
return true;
}
}
}
return false;
}
/// <summary>
/// 获取响应数据的结果,并返回响应的
/// </summary>
/// <param name="data">响应的数据</param>
/// <returns>true:响应成功</returns>
protected bool GetResponseResult(byte[] response, out byte[] data, bool ignoreSerial = false)
{
if (CheckResponse(response, ignoreSerial))
{
data = new byte[response.Length - 8];
Array.Copy(response, 8, data, 0, response.Length - 8);
return true;
}
if (response != null && response.Length >= 8)
{
data = new byte[] { response[7] };
if ((data[0] & 0x80) == 0x80)
{
LogUtil.Error($"从站异常响应[{StringHelper.ToHexString(data[0])}],响应数据为[{StringHelper.ToHexString(response)}]", log);
}
return false;
}
data = new byte[] { 0x00 };
return false;
}
/// <summary>
/// 解析读操作的响应数据
/// </summary>
/// <param name="response">响应的字节数据</param>
/// <param name="data"></param>
/// <param name="ignoreserial">忽略请求编号</param>
/// <returns>true:读取成功</returns>
protected virtual bool ParseRead(byte[] response, out byte[] data, bool ignoreserial = false)
{
data = null;
if (GetResponseResult(response, out byte[] data1, ignoreserial))
{
int len = data1[0];
data = new byte[len];
Array.Copy(data1, 1, data, 0, len);
return true;
}
return false;
}
/// <summary>
/// 解析写单个操作的响应数据
/// </summary>
/// <param name="response">响应的字节数据</param>
/// <returns>true:写入单个操作成功</returns>
protected abstract bool ParseWriteSingle(byte[] response);
/// <summary>
/// 解析写多个操作的响应数据
/// </summary>
/// <param name="response">响应的字节数据</param>
/// <returns>true:写多单个操作成功</returns>
protected abstract bool ParseWriteMultiple(byte[] response);
/// <summary>
/// 获取响应的结果
/// </summary>
/// <param name="function"></param>
/// <param name="response"></param>
/// <param name="data"></param>
/// <returns>解析</returns>
public bool GetResult(RegisterFunction function, byte[] response, out byte[] data)
{
bool rtn = false;
data = null;
switch (function)
{
case RegisterFunction.Read:
rtn = ParseRead(response, out data);
break;
case RegisterFunction.WriteSingle:
rtn = ParseWriteSingle(response);
break;
case RegisterFunction.WriteMultiple:
rtn = ParseWriteMultiple(response);
break;
default:
rtn = ParseRead(response, out data);
break;
}
return rtn;
}
public bool GetReadReault(byte[] response, out byte[] data)
{
bool rtn = ParseRead(response, out data, true);
return rtn;
}
/// <summary>
/// 分离多个反馈字节
/// </summary>
/// <param name="data"></param>
/// <returns>《功能码,响应的数据》</returns>
public static List<byte[]> SplitResponse(byte[] data)
{
List<byte[]> rtn = new List<byte[]>();
List<byte> tmpdata = new List<byte>();
tmpdata.AddRange(data);
while (tmpdata.Count >= 8)
{
if (ParseHeader(tmpdata.ToArray(), out byte func, out int len))
{
byte[] tmp = new byte[len + 6];
Array.Copy(tmpdata.ToArray(), 0, tmp, 0, len + 6);
rtn.Add(tmp);
tmpdata.RemoveRange(0, tmp.Length);
}
}
return rtn;
}
/// <summary>
/// 解析头
/// </summary>
/// <param name="header"></param>
/// <param name="func">功能码</param>
/// <param name="len">长度</param>
/// <returns>解析成功</returns>
public static bool ParseHeader(byte[] header, out byte func, out int len)
{
func = 0;
len = 0;
if (header != null && header.Length >= 8)
{
func = header[7];
len = Byte2.GetInt32(header[4], header[5]);
return true;
}
return false;
}
/// <summary>
/// 写入多个值时,将写入的值转换为发送的数组
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static int[] GetValuesWithMultiMode(int[] data)
{
int mod = data.Length % 8;
List<int> tmp = new List<int>();
int t = 0;
for (int i = 0; i < data.Length; i++)
{
if ((i + 1) % 8 == 0)
{
t += data[i] * (int)Math.Pow(2, data[i]);
tmp.Add(t);
t = 0;
}
else
{
t += data[i] * (int)Math.Pow(2, data[i]);
}
}
if (mod != 0)
tmp.Add(t);
return tmp.ToArray();
}
/// <summary>
/// 设置并获取请求字节数组
/// </summary>
/// <param name="func"></param>
/// <param name="startAddr"></param>
/// <param name="countOrValue"></param>
/// <param name="ValuesOfMultiple"></param>
/// <returns></returns>
public virtual byte[] GetRequestBytes(RegisterFunction func, ushort startAddr, ushort countOrValue, byte equipAddr = 1, ushort[] ValuesOfMultiple = null)
{
CmdByte cmdByte = new CmdByte();
cmdByte.StartAddr = Byte2.GetStru2Byte(startAddr);
cmdByte.Function = func;
cmdByte.Count = Byte2.GetStru2Byte(countOrValue);
if (func.Equals(RegisterFunction.WriteMultiple))
{
if (ValuesOfMultiple == null)
return null;
List<byte> values = new List<byte>();
foreach (var item in ValuesOfMultiple)
{
values.Add((byte)item);
}
cmdByte.ByteLength = (byte)(countOrValue % 8 == 0 ? countOrValue / 8 : countOrValue / 8 + 1);
cmdByte.ValuesOfMultiple = values.ToArray();
}
SetMBAP(_serialnum, equipAddr);
SetParamPDU(cmdByte);
return DataFrame;
}
}
public class StatusChangedEventArgs : EventArgs
{
public Dictionary<int, byte> ChangedIdxAndValue { get; set; }
public byte[] Data;
public bool Init { get; set; }
public StatusChangedEventArgs()
{
ChangedIdxAndValue = new Dictionary<int, byte>();
}
}
public class CmdByte
{
public RegisterFunction Function { get; set; }
public Byte2 StartAddr { get; set; }
public Byte2 Count { get; set; }
public byte ByteLength { get; set; }
public byte[] ValuesOfMultiple { get; set; }
string ToHexString(byte[] data)
{
if (data == null)
return "";
StringBuilder stringBuilder = new StringBuilder();
foreach (var item in data)
{
stringBuilder.Append(item.ToString("x2"));
stringBuilder.Append(" ");
}
return stringBuilder.ToString().Trim();
}
public override string ToString()
{
return $"[Function={Function.ToString()},StartAddr={StartAddr},Count/Value={Count},ByteLength={ByteLength},ValuesOfMultiple={ToHexString(ValuesOfMultiple)}]";
}
}
/// <summary>
/// 寄存器功能
/// </summary>
public enum RegisterFunction
{
/// <summary>
/// 读
/// </summary>
Read,
/// <summary>
/// 写单个
/// </summary>
WriteSingle,
/// <summary>
/// 写多个
/// </summary>
WriteMultiple,
}
/// <summary>
/// 寄存器类型
/// </summary>
public enum RegisterType
{
/// <summary>
/// 线圈,支持的功能码为 0x01,0x05,0x0f
/// </summary>
CoilSatus,
/// <summary>
/// 离散输入,支持的功能码为 0x02
/// </summary>
InputStatus,
/// <summary>
/// 输入寄存器,支持的功能码为 0x04
/// </summary>
InputRegister,
/// <summary>
/// 保持寄存器,支持的功能码为 0x03,0x06,0x10
/// </summary>
HoldingRegister,
}
}
using DL.Com.Protocol.Modbus;
using DL.Utils;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace DL.StandardRobot
{
/// <summary>
/// 斯坦德机器人类
/// </summary>
public class StandardRobot
{
public delegate void MissionStateChangedEventHandler(MissionState state);
/// <summary>
/// 任务态变化事件
/// </summary>
public event MissionStateChangedEventHandler MissionSateChanged;
/// <summary>
/// 设备地址
/// </summary>
private byte equipAddr = 1;
private Com.TCP.ModbusTCPMaster _client; //客户端
private bool _loop;
private MissionState missionState = new MissionState();
private const int SEND_SLEEP = 500; //每条命令发送的间隔
private const int PORT = 502; //端口
private Thread tSend; //发送命令处理
/// <summary>
/// 斯坦德机器人类
/// </summary>
/// <param name="logName"></param>
public StandardRobot()
{
_client = new Com.TCP.ModbusTCPMaster();
_client.ReceiveData += _client_ReceiveData;
}
MissionState preState = new MissionState();
/// <summary>
/// 收到的数据解析
/// </summary>
/// <param name="ip"></param>
/// <param name="port"></param>
/// <param name="requestInfo"></param>
/// <param name="data"></param>
private void _client_ReceiveData(string ip, int port, Com.TCP.RequestInfo requestInfo, byte[] data)
{
try
{
if (requestInfo.FunCode == 4)
{
if (data.Length >= 240)
{
preState.RunMissionId = GetUInt32(new byte[] { data[196], data[195], data[194], data[193] });
preState.MissionRunState = (MissionRunState)GetUInt16(data[198], data[197]);
preState.MissionResult = (MissionResult)GetUInt16(data[200], data[199]);
if (!missionState.Equals(preState))
{
missionState.RunMissionId = preState.RunMissionId;
missionState.MissionRunState = preState.MissionRunState;
missionState.MissionResult = preState.MissionResult;
MissionSateChanged?.Invoke(missionState);
}
}
}
}
catch (Exception ex)
{
LogUtil.Error($"ReceiveData:[{requestInfo}][{data}]", ex);
}
}
uint GetUInt32(byte[] data)
{
return (uint)(((data[0] & 0xff) << 24) | ((data[1] & 0xff) << 16) | ((data[2] & 0xff) << 8) | (data[3] & 0xff));
}
int GetInt32(byte[] data)
{
return (int)((data[0] << 24) | ((data[1] & 0xff) << 16) | ((data[2] & 0xff) << 8) | (data[3] & 0xff));
}
ushort GetUInt16(byte H, byte L)
{
return (ushort)(((H & 0xff) << 8) | (L & 0xff));
}
/// <summary>
/// IP地址
/// </summary>
public string IP { set; get; } = "192.168.1.100";
/// <summary>
/// 输入主动上传
/// </summary>
public bool Upload { set; get; } = false;
/// <summary>
/// 连接
/// </summary>
/// <returns></returns>
public bool Connect()
{
_loop = true;
bool rtn = Utils.HttpHelper.CheckIP(IP);
if (!rtn) return false;
_client.Connect(IP, PORT);
tSend = new Thread(new ThreadStart(Send)) { Name = "Send" };
tSend.IsBackground = true;
tSend.Start();
_client.AddRequest(GetInputRegister());
return true;
}
/// <summary>
/// 关闭连接
/// </summary>
public void Close()
{
_loop = false;
try
{
if (_client != null)
{
_client.Close();
}
}
finally
{
_client = null;
}
}
public MissionState GetMissionState()
{
return missionState;
}
/// <summary>
/// 创建任务,功能码16
/// </summary>
/// <returns></returns>
public bool AddMission(int id)
{
try
{
Com.TCP.RequestInfo request = new Com.TCP.RequestInfo();
request.StartAddr = 40097;//起始地址
request.FunCode = 16;//功能码
request.EquipAddr = equipAddr;
request.CountOrValue = 2; //个数
Byte4 byte4 = GetStru2Byte(id);
request.Values = new int[] {(int)GetUInt16(byte4.ByteH1, byte4.ByteH2), (int)GetUInt16(byte4.ByteL1, byte4.ByteL2) };
_client.AddRequest(request);
missionState.MissionId = (uint)id;
MissionSateChanged?.Invoke(missionState);
return true;
}
catch (Exception ex)
{
LogUtil.Error($"AddMission missionId:{id}", ex);
return false;
}
}
static Byte4 GetStru2Byte(int val)
{
return new Byte4
{
ByteH1 = (byte)((val >> 24) & 0xff),
ByteH2 = (byte)((val >> 16) & 0xff),
ByteL1 = (byte)((val >> 8) & 0xff),
ByteL2 = (byte)((val & 0xff))
};
}
/// <summary>
/// 发送命令线程
/// </summary>
private void Send()
{
while (_loop)
{
Com.TCP.RequestInfo request = GetInputRegister();
_client.AddRequest(request);
Thread.Sleep(SEND_SLEEP);
}
}
/// <summary>
/// 读取输入,功能码为04,读输入寄存器
/// </summary>
/// <returns></returns>
private Com.TCP.RequestInfo GetInputRegister()
{
Com.TCP.RequestInfo request = new Com.TCP.RequestInfo();
request.StartAddr = 30001;//起始地址
//功能码
request.FunCode = 4;
request.EquipAddr = equipAddr;
request.CountOrValue = 120; //个数
return request;
}
}
public class MissionState
{
public uint MissionId { get; set; }
public uint RunMissionId { get; set; }
public MissionResult MissionResult { get; set; }
public MissionRunState MissionRunState { get; set; }
public override bool Equals(object obj)
{
MissionState state = obj as MissionState;
if (state == null) return false;
if (this.RunMissionId.Equals(state.RunMissionId)
&& this.MissionResult.Equals(state.MissionResult) && this.MissionRunState.Equals(state.MissionRunState))
return true;
return false;
}
}
/// <summary>
/// Mission执行结果
/// </summary>
public enum MissionResult
{
无效状态,
任务执行成功,
任务取消,
任务执行出错
}
/// <summary>
/// 任务运行状态
/// </summary>
public enum MissionRunState
{
无效状态,
任务在队列中但没有启动 = 2,
正在执行,
暂停执行,
执行结束,
正在取消
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DL.Utils
{
public class StringHelper
{
/// <summary>
/// 字节转十六进制字符串
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
public static string ToHexString(byte[] buff)
{
StringBuilder sb = new StringBuilder("");
if (buff == null || buff.Length<1) return sb.ToString();
for (int i = 0; i < buff.Length; i++)
{
sb.Append(buff[i].ToString("X2"));
sb.Append(" ");
}
sb.Remove(sb.Length - 1, 1);
return sb.ToString();
}
public static string ToBinaryString(byte[] data)
{
StringBuilder stringBuilder = new StringBuilder("");
if (data == null || data.Length < 1) return stringBuilder.ToString();
stringBuilder.Append("【");
foreach (var item in data)
{
stringBuilder.Append(Convert.ToString(item, 2).PadLeft(8, '0'));
stringBuilder.Append(" ");
}
stringBuilder.Remove(stringBuilder.Length - 1, 1);
stringBuilder.Append("】");
return stringBuilder.ToString();
}
public static string ToHexString(byte data)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("【");
stringBuilder.Append(data.ToString("x2"));
stringBuilder.Append("】");
return stringBuilder.ToString();
}
public static byte[] StrToHexByte(string hexString)
{
hexString = hexString.Replace(" ", "");
if ((hexString.Length % 2) != 0)
hexString += " ";
byte[] returnBytes = new byte[hexString.Length / 2];
for (int i = 0; i < returnBytes.Length; i++)
{
returnBytes[i]=Convert.ToByte(hexString.Substring(i*2,2),16);
}
return returnBytes;
}
/// <summary>
/// 获取类的属性名及其值
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="t"></param>
/// <returns></returns>
public static string GetPropertiesStr<T>(T t)
{
StringBuilder sb = new StringBuilder("");
if (t == null)
{
return sb.ToString();
}
System.Reflection.PropertyInfo[] properties = t.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
if (properties.Length <= 0)
{
return sb.ToString();
}
sb.Append("{");
foreach (System.Reflection.PropertyInfo property in properties)
{
string name = property.Name;
object value = property.GetValue(t, null);
if (property.PropertyType.IsValueType || property.PropertyType.Name.StartsWith("String"))
{
sb.Append($"{name}:{value},");
}
else if(property.PropertyType.IsGenericType)
{
var listVal = property.GetValue(t, null) as IEnumerable<object>;
if (listVal == null) continue;
sb.Append("[");
foreach (var item1 in listVal)
{
sb.Append(GetPropertiesStr(item1));
}
sb.Append("]");
}
else if(property.PropertyType.IsArray)
{
var listVal = property.GetValue(t, null) as IEnumerable<object>;
if (listVal == null) continue;
sb.Append("[");
foreach (var item1 in listVal)
{
sb.Append(GetPropertiesStr(item1));
}
sb.Append("]");
}
else
{
sb.Append(GetPropertiesStr(value));
}
}
sb.Append("}");
return sb.ToString();
}
}
}
using DL.Com.Protocol.Modbus;
using DL.Utils;
using log4net;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Threading;
namespace DL.Com.TCP
{
public class ModbusTCPMaster
{
List<Register> registers = new List<Register>() {
new CoilRegister(),new DiscreteInputRegister(),new HoldingRegister(),
new InputRegister()
};
public static List<string> Functions = new List<string>() {
"01 Read Coils","02 Read Discrete Inputs","03 Read Holding Registers",
"04 Read Input Registers","05 WriteSingle Coil","06 Write Single Register",
"0F Write Multiple Coils","10 Write Multiple Registers"
};
TcpClient tcpClient = new TcpClient();
Thread thread;//System.Timers.Timer
public delegate void ConnectionChangedHandler(string ip, int port, bool onOff);
public delegate void ReceiveDataHandler(string ip, int port, RequestInfo requestInfo, byte[] data);
public event ConnectionChangedHandler ConnectionChanged;
public event ReceiveDataHandler ReceiveData;
public bool IsAutoReconnect = false;
public int TryTimes = 5;
public string IP { get; private set; }
public int Port { get; private set; }
bool online = false;
public bool Online
{
get { return online; }
private set
{
if (online != value)
{
online = value;
ConnectionChanged?.Invoke(IP, Port, value);
}
}
}
bool start = false;
public ModbusTCPMaster()
{
start = true;
thread = new Thread(sendQueueRequest);
thread.IsBackground = true;
//thread = new System.Timers.Timer();
//thread.Interval = 100;
//thread.Elapsed += Thread_Elapsed;
//thread.AutoReset = true;
//thread.Enabled = true;
thread.Start();
}
private void Thread_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
sendQueueRequest();
}
~ModbusTCPMaster()
{
start = false;
}
object locsend = new object();
private const int SEND_SLEEP = 50; //每条命令发送的间隔
void sendQueueRequest()
{
while (start)
{
if (Monitor.TryEnter(locsend))
{
try
{
Online = tcpClient.IsConnected();
if (!Online)
{
if (IsAutoReconnect)
{
bool rtn = tcpClient.Connect(IP, Port, ReceiveMessage);
Thread.Sleep(1000);
if(rtn)
{
RequestInfo requestInfo = GetPeek();
if (requestInfo != null && requestInfo.Requested)
{
requestInfo.SetRequestState(false);
LogUtil.Error($"Disconnect 重置请求状态{requestInfo}");
continue;
}
}
}
}
else
{
SendRequest();
}
}
catch (Exception ex)
{
LogUtil.Error($"sendQueueRequest出错", ex);
}
finally
{
Monitor.Exit(locsend);
}
}
Thread.Sleep(SEND_SLEEP);
}
}
/// <summary>
/// 请求队列
/// </summary>
ConcurrentQueue<RequestInfo> requestInfos = new ConcurrentQueue<RequestInfo>();
public void Connect(string ip, int port)
{
IP = ip;
Port = port;
//tcpClient.Connect(ip, port, ReceiveMessage);
//Thread.Sleep(1000);
IsAutoReconnect = true;
}
public void Close()
{
tcpClient.Close();
}
/// <summary>
/// 添加请求
/// </summary>
/// <param name="requestInfo">请求信息</param>
public void AddRequest(RequestInfo requestInfo)
{
EnRequestQueue(requestInfo);
}
/// <summary>
/// 添加请求
/// </summary>
/// <param name="funCode"></param>
/// <param name="startAddr"></param>
/// <param name="countOrValue"></param>
/// <param name="equpAddr"></param>
/// <param name="values"></param>
public void AddRequest(byte funCode, int startAddr, int countOrValue, byte equpAddr = 1, int[] values = null)
{
EnRequestQueue(new RequestInfo()
{
FunCode = funCode,
StartAddr = startAddr,
CountOrValue = countOrValue,
EquipAddr = equpAddr,
Values = values
});
}
/// <summary>
/// 收到数据
/// </summary>
/// <param name="msg"></param>
void ReceiveMessage(string msg, byte[] data)
{
LogUtil.Debug($"Receive Data {StringHelper.ToHexString(data)}");
List<byte[]> recvFun = Register.SplitResponse(data);
foreach (var item in recvFun)
{
LogUtil.Debug($"Process Data {StringHelper.ToHexString(item)}");
RequestInfo requestInfo = GetPeek();
if (requestInfo != null)
{
byte[] readData;
bool rtn = GetResponseResult(requestInfo.FunCode, item, out readData);
if (rtn)
{
RemovePeek(true);
if (readData != null)
{
ReceiveData?.Invoke(IP, Port, requestInfo, readData);
LogUtil.Debug($"{StringHelper.ToHexString(readData)}{requestInfo}");
}
}
else
{
rtn = GetResponseResult(requestInfo.FunCode, item, out readData, true);
if (rtn)
{
if (readData != null)
{
ReceiveData?.Invoke(IP, Port, requestInfo, readData);
LogUtil.Debug($"{StringHelper.ToHexString(readData)}{requestInfo}");
}
}
else
{
if (Register.ParseHeader(item, out byte func, out int len))
{
rtn = GetResponseResult(func, item, out readData, true);
if (rtn)
{
if (readData != null)
{
ReceiveData?.Invoke(IP, Port, new RequestInfo() { FunCode = func }, readData);
LogUtil.Debug($"{StringHelper.ToHexString(readData)}");
}
}
}
else
{
requestInfo.SetRequestState(false);
LogUtil.Error($"Request Fail {requestInfo}");
requestInfo.TryTimes++;
//if (requestInfo.TryTimes > TryTimes)//重试一定次数失败删除
//{
// RemovePeek(false);
//}
}
}
}
}
else//设备主动上传收到的信息
{
LogUtil.Debug($"Upload {StringHelper.ToHexString(item)}");
if (Register.ParseHeader(item, out byte func, out int len))
{
bool rtn = GetResponseResult(func, item, out byte[] readData, true);
if (rtn)
{
if (readData != null)
{
ReceiveData?.Invoke(IP, Port, new RequestInfo() { FunCode = func }, readData);
LogUtil.Debug($"{StringHelper.ToHexString(readData)}");
}
}
else
{
LogUtil.Error($"Upload GetResponseResult Fail {StringHelper.ToHexString(item)}");
}
}
else
{
LogUtil.Error($"Upload ParseHeader Fail {StringHelper.ToHexString(item)}");
}
}
}
}
RegisterFunction GetFunction(byte funCode)
{
Register register = GetRegister(funCode);
if (register == null)
{
LogUtil.Error($"不存在的功能码:{StringHelper.ToHexString(funCode)}");
return RegisterFunction.Read;
}
return GetFuncByByte(register, funCode);
}
/// <summary>
/// 获取请求字节数组
/// </summary>
/// <param name="funCode"></param>
/// <param name="startAddr"></param>
/// <param name="countOrValue"></param>
/// <param name="values"></param>
/// <returns></returns>
byte[] GetRequestBytes(byte funCode, int startAddr, int countOrValue, byte equipAddr, int[] values = null)
{
Register register = GetRegister(funCode);
if (register == null)
{
LogUtil.Error($"不存在的功能码:{StringHelper.ToHexString(funCode)}");
return new byte[] { 0x00 };
}
RegisterFunction registerFunction = GetFuncByByte(register, funCode);
if (values != null)
{
ushort[] tmpvalues = new ushort[values.Length];
for (int i = 0; i < values.Length; i++)
{
tmpvalues[i] = (ushort)values[i];
}
return register.GetRequestBytes(registerFunction, (ushort)startAddr, (ushort)countOrValue, equipAddr, tmpvalues);
}
return register.GetRequestBytes(registerFunction, (ushort)startAddr, (ushort)countOrValue, equipAddr, null);
}
/// <summary>
/// 获取响应结果
/// </summary>
/// <param name="funCode">功能码</param>
/// <param name="response">响应的字节数组</param>
/// <param name="data">只有读操作可以使用:读取到的数据</param>
/// <returns>true:操作成功</returns>
bool GetResponseResult(byte funCode, byte[] response, out byte[] data, bool ignoreSerial = false)
{
data = null;
Register register = GetRegister(funCode);
if (register == null)
{
LogUtil.Error($"不存在的功能码:{StringHelper.ToHexString(funCode)}");
return false;
}
RegisterFunction registerFunction = GetFuncByByte(register, funCode);
if (ignoreSerial)
return register.GetReadReault(response, out data);
else
return register.GetResult(registerFunction, response, out data);
}
RegisterFunction GetFuncByByte(Register register, byte funCode)
{
RegisterFunction registerFunction = RegisterFunction.Read;
foreach (RegisterFunction item in register.FunctionCodes.Keys)
{
if (register.FunctionCodes[item].Equals(funCode))
{
registerFunction = item;
break;
}
}
return registerFunction;
}
/// <summary>
/// 根据功能码定位置指定寄存器
/// </summary>
/// <param name="funCode"></param>
/// <returns></returns>
Register GetRegister(byte funCode)
{
return registers.Find(s => s.FunctionCodes.ContainsValue(funCode));
}
/// <summary>
/// 加入队列
/// </summary>
/// <param name="request"></param>
void EnRequestQueue(RequestInfo request)
{
requestInfos.Enqueue(request);
if (!GetFunction(request.FunCode).Equals(RegisterFunction.Read))
LogUtil.Info($"Enqueue Request {request}");
else
LogUtil.Debug($"Enqueue Request {request}");
}
/// <summary>
/// 获取队列第一个请求
/// </summary>
/// <returns></returns>
RequestInfo GetPeek()
{
requestInfos.TryPeek(out RequestInfo request);
return request;
}
/// <summary>
/// 移除队列第一个请求
/// </summary>
/// <returns></returns>
bool RemovePeek(bool success)
{
bool rtn = requestInfos.TryDequeue(out RequestInfo request);
if (success)
{
request.Result = true;
request.FinishTime = DateTime.Now;
if (!GetFunction(request.FunCode).Equals(RegisterFunction.Read))
LogUtil.Info($"Request Success {request}");
else
LogUtil.Debug($"Request Success {request}");
}
else
{
LogUtil.Error($"Try Request {TryTimes} Times Fail {request}");
}
return rtn;
}
void SendRequest()
{
RequestInfo requestInfo = GetPeek();
if (requestInfo != null && (!requestInfo.Requested || requestInfo.RequestTimeOut))
{
bool rtn = tcpClient.Send(GetRequestBytes(requestInfo.FunCode, requestInfo.StartAddr, requestInfo.CountOrValue, requestInfo.EquipAddr, requestInfo.Values));
requestInfo.SetRequestState(rtn);
if (!GetFunction(requestInfo.FunCode).Equals(RegisterFunction.Read))
LogUtil.Info($"Request {requestInfo}");
else
LogUtil.Debug($"Request {requestInfo}");
}
}
}
/// <summary>
/// Modbus请求信息
/// </summary>
public class RequestInfo
{
/// <summary>
/// 功能码
/// </summary>
public byte FunCode { get; set; }
/// <summary>
/// 开始地址
/// </summary>
public int StartAddr { get; set; }
/// <summary>
/// 数量/值
/// </summary>
public int CountOrValue { get; set; }
/// <summary>
/// 设备地址
/// </summary>
public byte EquipAddr { get; set; }
/// <summary>
/// 数组值,写多个值用到
/// </summary>
public int[] Values { get; set; }
/// <summary>
/// 等待一定秒数反转信号。大于0,反转
/// </summary>
public int Seconds { get; set; } = 0;
/// <summary>
/// 是否请求过
/// </summary>
public bool Requested { get; set; } = false;
public int TryTimes { get; set; } = 0;
/// <summary>
/// 请求时间
/// </summary>
public DateTime RequestTime { get; set; } = DateTime.Now;
public DateTime FinishTime { get; set; }
/// <summary>
/// 请求超时
/// </summary>
public bool RequestTimeOut { get { return (DateTime.Now - RequestTime).TotalSeconds > 5; } }
/// <summary>
/// 结果
/// </summary>
public bool Result { get; set; } = false;
/// <summary>
/// 请求
/// </summary>
public void SetRequestState(bool request)
{
Requested = request;
if (request)
RequestTime = DateTime.Now;
}
public override string ToString()
{
return JsonHelper.SerializeObject(this);
}
}
}
using DL.Utils;
using log4net;
using System;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
namespace DL.Com.TCP
{
public class TcpClient
{
public delegate void HandleMessage(string message, byte[] data);
private Socket m_clientSocket = null;
private byte[] m_receiveBuffer = new byte[1024];
private HandleMessage onReceived;
public int TimeOutTime = 2;
public string IP { get; set; }
public int Port { get; set; }
public TcpClient()
{
}
/// <summary>
/// 当前连接状态
/// </summary>
public bool IsConnected()
{
if (m_clientSocket == null)
{
return false;
}
return m_clientSocket.Connected;
//if (m_clientSocket.Connected)
//{
// return true;
//}
#region remarks
/********************************************************************************************
* 当Socket.Conneted为false时, 如果您需要确定连接的当前状态,请进行非阻塞、零字节的 Send 调用。
* 如果该调用成功返回或引发 WAEWOULDBLOCK 错误代码 (10035),则该套接字仍然处于连接状态;
* 否则,该套接字不再处于连接状态。
* Depending on http://msdn.microsoft.com/zh-cn/library/system.net.sockets.socket.connected.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2
********************************************************************************************/
#endregion
try
{
#region 过程
// This is how you can determine whether a socket is still connected.
bool connectState = true;
bool blockingState = m_clientSocket.Blocking;
try
{
byte[] tmp = new byte[1];
m_clientSocket.Blocking = false;
m_clientSocket.Send(tmp, 0, 0);
//Console.WriteLine("Connected!");
connectState = true; //若Send错误会跳去执行catch体,而不会执行其try体里其之后的代码
}
catch (SocketException e)
{
// 10035 == WSAEWOULDBLOCK
if (e.NativeErrorCode.Equals(10035))
{
connectState = true;
}
else
{
connectState = false;
}
}
finally
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Blocking = blockingState;
}
}
//Console.WriteLine("Connected: {0}", client.Connected);
return connectState;
#endregion
}
catch (Exception ex)
{
//Log.Error("IsConnected 出错", log, ex);
return false;
}
}
/// <summary>
/// 连接服务器
/// </summary>
public bool Connect(string serverIP, int serverPort, HandleMessage HandleMessage)
{
IP=serverIP;
Port=serverPort;
m_clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
if (TimeOutTime <= 0)
{
IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse(serverIP), serverPort);
m_clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
try
{
if (!m_clientSocket.Connected)
{
m_clientSocket.Connect(remoteEndPoint);
}
if (m_clientSocket.Connected)
{
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
onReceived = HandleMessage;
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " success!");
return true;
}
else
{
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " fail!");
}
}
catch (Exception ex)
{
LogUtil.Error("Connect to " + serverIP + ":" + serverPort + " fail!", ex);
//m_clientSocket = null;
}
}
else
{
m_clientSocket.ReceiveTimeout = TimeOutTime;
m_clientSocket.SendTimeout = TimeOutTime;
IAsyncResult connResult = m_clientSocket.BeginConnect(serverIP, serverPort, null, null);
connResult.AsyncWaitHandle.WaitOne(this.TimeOutTime, true); //等待2秒
if (!connResult.IsCompleted || (!m_clientSocket.Connected))
{
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " fail!");
m_clientSocket.Close();
//处理连接不成功的动作
return false;
}
else
{
//处理连接成功的动作
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
onReceived = HandleMessage;
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " success!");
return true;
}
}
return false;
}
/// <summary>
/// 断开连接
/// </summary>
public void Close()
{
try
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Shutdown(SocketShutdown.Both);
//Thread.Sleep(300);
//m_clientSocket.Disconnect(true);
//Thread.Sleep(300);
m_clientSocket.Close();
//m_clientSocket = null;
LogUtil.Info("Socket closed!");
}
else
{
LogUtil.Error("No socket is running!");
}
}
catch (Exception ex)
{
LogUtil.Error("close error", ex);
}
}
/// <summary>
/// 发送信息
/// </summary>
public void Send(string strSendData)
{
byte[] sendBuffer = new byte[1024];
sendBuffer = Encoding.UTF8.GetBytes(strSendData);
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Send(sendBuffer);
LogUtil.Debug("Send >> " + strSendData);
}
}
public bool Send(byte[] bytes)
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Send(bytes);
LogUtil.Debug("Send >> " + StringHelper.ToHexString(bytes));
return true;
}
return false;
}
private void ReceiveCallBack(IAsyncResult ar)
{
try
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
int REnd = m_clientSocket.EndReceive(ar);
string strReceiveData = Encoding.Default.GetString(m_receiveBuffer, 0, REnd);
byte[] tmp = new byte[REnd];
Array.Copy(m_receiveBuffer, tmp, REnd);
onReceived(strReceiveData, tmp);
Thread.Sleep(100);
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
}
}
catch (Exception ex)
{
LogUtil.Error("socket received error", ex);
}
}
}
}
using DL.Utils;
using log4net;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DL.Com.TCP
{
public class TcpServer
{
/// <summary>
/// 接受消息时的间隔
/// </summary>
public static int ReviceMsgMS = 10;
private Thread m_serverThread;
private Socket m_serverSocket;
public delegate void ReviceMsgEventHandler(TcpClientBean client, string Msg,byte[] data);
public delegate void ClientOffLineEventHandler(TcpClientBean client);
public delegate void AcceptClientEventHandler(TcpClientBean client);
public event ReviceMsgEventHandler ReviceMsgEvent;
public event AcceptClientEventHandler AcceptClientEvent;
public event ClientOffLineEventHandler ClientOfflineEvent;
private bool isRun = false;
private int serverPort = 0;
public TcpServer(int m_serverPort)
{
this.serverPort = m_serverPort;
}
private void logLocalIp()
{
string[] addresses = GetLocalAddresses();
string iplist = "本机IP:[";
if (addresses.Length > 0)
{
for (int i = 0; i < addresses.Length; i++)
{
if (addresses.Length != 0)
{
iplist = iplist + " " + addresses[i];
}
}
}
LogUtil.Info(iplist + "]");
}
public bool Connected { get { return m_serverSocket != null && m_serverSocket.Connected; } }
/// <summary>
/// 开始服务
/// </summary>
public bool Start()
{
try
{
isRun = true;
m_serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, serverPort);
m_serverSocket.Bind(localEndPoint);
m_serverSocket.Listen(10);
m_serverThread = new Thread(new ThreadStart(ReceiveAccept));
m_serverThread.Start();
LogUtil.Info(" Server start listen : " + serverPort);
logLocalIp();
return true;
//this.AddRunningInfo(">> " + DateTime.Now.ToString() + " Server started.");
}
catch (SocketException se)
{
LogUtil.Error("Tcpserver Start 报错",se);
}
catch (Exception ex)
{
LogUtil.Error("Tcpserver Start 报错", ex);
}
return false;
}
/// <summary>
/// 停止服务
/// </summary>
public bool Stop()
{
try
{
isRun = false;
m_serverThread.Interrupt(); // 线程终止
m_serverSocket.Close(); // Socket Close
return true;
}
catch (Exception ex)
{
LogUtil.Error("Tcpserver Stop报错", ex);
}
return false;
}
private void ReceiveAccept()
{
while (isRun)
{
TcpClientBean client = new TcpClientBean();
try
{
client.ClientSocket = m_serverSocket.Accept();
IPEndPoint clientipe = (IPEndPoint)client.ClientSocket.RemoteEndPoint;
client.IP = clientipe.Address.ToString();
client.Port = clientipe.Port;
LogUtil.Info("[" + serverPort + "]有新的客户端连接上:[" + client.AddStr + "]");
AcceptClientEvent?.Invoke(client);
Task.Factory.StartNew(delegate { ReceiveMessages(client); });
}
catch (Exception ex)
{
LogUtil.Error("ReceiveAccept方法,客户端【" + client.AddStr + "】", ex);
//throw new Exception(ex.Message);
}
}
}
// private StringBuilder sb = new StringBuilder(); //这个是用来保存:接收到了的,但是还没有结束的消息
private int receiveBufferSize = 1024;
public string terminateString = "\r\n";
public void ReceiveMessages(TcpClientBean client) //这个函数会被以线程方式运行
{
try
{
StringBuilder sb = new StringBuilder();
Socket socket = (Socket)client.ClientSocket;
while (true)
{
byte[] buffer = new byte[receiveBufferSize]; //buffer大小,此处为1024
if(socket.Poll(0,SelectMode.SelectRead))
{
int receivedSize = socket.Receive(buffer);
if (receivedSize > 0)
{
string rawMsg = Encoding.ASCII.GetString(buffer, 0, receivedSize);
byte[] data = new byte[receivedSize];
Array.Copy(buffer, 0, data, 0, receivedSize);
int rnFixLength = terminateString.Length; //这个是指消息结束符的长度,此处为\r\n
if (rnFixLength == 0)//无结束符
{
this.ReviceMsgEvent?.Invoke(client, rawMsg, data);//无消息结束符,直接触发消息接收完成事件
}
else
{
for (int i = 0; i < rawMsg.Length;) //遍历接收到的整个buffer文本
{
if (i <= rawMsg.Length - rnFixLength)
{
if (rawMsg.Substring(i, rnFixLength) != terminateString)//非消息结束符,则加入sb
{
sb.Append(rawMsg[i]);
i++;
}
else
{
this.ReviceMsgEvent?.Invoke(client, sb.ToString(), data);//找到了消息结束符,触发消息接收完成事件
sb = new StringBuilder();
i += rnFixLength;
}
}
else
{
sb.Append(rawMsg[i]);
i++;
}
}
}
}
else
{
ClientOfflineEvent?.Invoke(client);
LogUtil.Info($"客户端【{client.AddStr}】已断开");
break;
}
}
Thread.Sleep(ReviceMsgMS);
}
}
catch (SocketException e)
{
LogUtil.Error($"客户端【{client.AddStr}】:{e.StackTrace}", e);
ClientOfflineEvent?.Invoke(client);
}
catch (Exception ex)
{
LogUtil.Error($"客户端【{client.AddStr}】:{ex.StackTrace}", ex);
ClientOfflineEvent?.Invoke(client);
}
}
//private void ReceiveMessages(Client client)
//{
// try
// {
// while (true)
// {
// byte[] receiveBuffer = new byte[1024];
// //int size = ;
// int size = client.ClientSocket.Receive(receiveBuffer);
// string strReceiveData = Encoding.ASCII.GetString(receiveBuffer, 0, size);
// if (!string.IsNullOrEmpty(strReceiveData))
// {
// Log.info(LOGGER, "收到数据:" + strReceiveData);
// // this.AddRunningInfo(">> Receive data from [" + client.ClientSocket.RemoteEndPoint.ToString()+ "]:" + strReceiveData);
// string strSendData = "OK. The content is:" + strReceiveData;
// //Log.info(LOGGER, "OK. The content is:" + strReceiveData);
// int sendBufferSize = Encoding.Unicode.GetByteCount(strSendData);
// byte[] sendBuffer = new byte[sendBufferSize];
// sendBuffer = Encoding.Unicode.GetBytes(strSendData);
// client.ClientSocket.Send(sendBuffer);
// }
// }
// }
// catch (SocketException e)
// {
// Log.error(LOGGER, e.ToString());
// }
// catch (Exception ex)
// {
// LOGGER.Error(ex.ToString());
// }
//}
/// <summary>
/// 获取本机地址列表
/// </summary>
public static string[] GetLocalAddresses()
{
// 获取主机名
string strHostName = Dns.GetHostName();
// 根据主机名进行查找
IPHostEntry iphostentry = Dns.GetHostEntry(strHostName);
List<string> retval = new List<string>();
foreach (IPAddress ipaddress in iphostentry.AddressList)
{
if (ipaddress.AddressFamily != AddressFamily.InterNetworkV6)
{
retval.Add(ipaddress.ToString());
}
}
return retval.ToArray();
}
/// <summary>
/// 端口是否被占用
/// </summary>
/// <param name="port"></param>
/// <returns></returns>
public static bool PortInUse(int port)
{
bool result = false;
IPGlobalProperties iPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties();
IPEndPoint[] activeTcpListeners = iPGlobalProperties.GetActiveTcpListeners();
IPEndPoint[] array = activeTcpListeners;
for (int i = 0; i < array.Length; i++)
{
IPEndPoint iPEndPoint = array[i];
bool flag = iPEndPoint.Port == port;
if (flag)
{
string[] expr_36 = new string[5];
expr_36[0] = "IP【";
int arg_53_1 = 1;
IPAddress expr_47 = iPEndPoint.Address;
expr_36[arg_53_1] = ((expr_47 != null) ? expr_47.ToString() : null);
expr_36[2] = "】port【";
expr_36[3] = iPEndPoint.Port.ToString();
expr_36[4] = "】已使用";
LogUtil.Error(string.Concat(expr_36));
result = true;
break;
}
}
return result;
}
public bool IsOnline(string addr = "")
{
return isRun;
}
public string GetAddr()
{
return $"{string.Join(",", GetLocalAddresses())}:{serverPort}";
}
}
/// <summary>
/// 客户端会话信息类
/// </summary>
public class TcpClientBean
{
Socket m_clientSocket;
public string IP = "";
public string AddStr { get { return $"{IP}:{Port}"; } }
public int Port = 0;
public TcpClientBean() { }
public void Close()
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Shutdown(SocketShutdown.Both);
m_clientSocket.Close();
}
}
public Socket ClientSocket
{
get { return m_clientSocket; }
set { this.m_clientSocket = value; }
}
}
}

using DL.Utils;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DL.Com
{
public class UdpServer
{
static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod()?.DeclaringType);
private Thread m_serverThread;
private Socket udpServer;
public delegate void ReviceMsg(EndPoint address, string Msg);
/// <summary>
/// 接受到数据事件
/// </summary>
public event ReviceMsg ReviceMsgEvent;
private bool isRun = true;
private int serverPort;
private void logLocalIp()
{
string[] addresses = GetLocalAddresses();
string iplist = "本机IP:[";
if (addresses.Length > 0)
{
for (int i = 0; i < addresses.Length; i++)
{
if (addresses.Length != 0)
{
iplist = iplist + " " + addresses[i];
}
}
}
LogUtil.Info(iplist + "]",log);
}
public UdpServer(int m_serverPort)
{
serverPort = m_serverPort;
}
/// <summary>
/// 开始服务
/// </summary>
public bool Start()
{
try
{
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, serverPort);//定义一网络端点
udpServer = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);//定义一个Socket
udpServer.Bind(ipep);//Socket与本地的一个终结点相关联
m_serverThread = new Thread(new ThreadStart(ReceiveData));
m_serverThread.Start();
logLocalIp();
isRun = true;
return true;
}
catch (Exception ex)
{
LogUtil.Error("启动udpserver出错" ,log,ex);
}
return false;
}
/// <summary>
/// 停止服务
/// </summary>
public bool Stop()
{
try
{
isRun = false;
m_serverThread.Interrupt(); // 线程终止
udpServer.Close(); // Socket Close
return true;
}
catch (Exception ex)
{
LogUtil.Error("Stop Udpserver出错",log,ex);
}
return false;
}
private StringBuilder sb = new StringBuilder(); //这个是用来保存:接收到了的,但是还没有结束的消息
private int receiveBufferSize = 1024;
/// <summary>
/// 结束符
/// </summary>
public string terminateString = "\r";
private void ReceiveData()
{
try
{
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);//定义要发送的计算机的地址
EndPoint Remote = (EndPoint)(sender);//
while (true)
{
byte[] buffer = new byte[receiveBufferSize];
int receivedSize = udpServer.ReceiveFrom(buffer, ref Remote);
if (receivedSize > 0)
{
string rawMsg = Encoding.ASCII.GetString(buffer, 0, receivedSize);
int rnFixLength = terminateString.Length; //这个是指消息结束符的长度,此处为\r\n
for (int i = 0; i < rawMsg.Length;) //遍历接收到的整个buffer文本
{
if (i <= rawMsg.Length - rnFixLength)
{
if (rawMsg.Substring(i, rnFixLength) != terminateString)//非消息结束符,则加入sb
{
sb.Append(rawMsg[i]);
i++;
}
else
{
this.ReviceMsgEvent.Invoke(Remote, sb.ToString());//找到了消息结束符,触发消息接收完成事件
sb = new StringBuilder();
i += rnFixLength;
}
}
else
{
sb.Append(rawMsg[i]);
i++;
}
}
}
Thread.Sleep(500);
}
}
catch (Exception ex)
{
LogUtil.Error("启动udpserver出错:" ,log,ex);
}
}
/// <summary>
/// 获取本机地址列表
/// </summary>
public string[] GetLocalAddresses()
{
// 获取主机名
string strHostName = Dns.GetHostName();
// 根据主机名进行查找
IPHostEntry iphostentry = Dns.GetHostEntry(strHostName);
string[] retval = new string[iphostentry.AddressList.Length];
int i = 0;
foreach (IPAddress ipaddress in iphostentry.AddressList)
{
if (ipaddress.AddressFamily != AddressFamily.InterNetworkV6)
{
retval[i] = ipaddress.ToString();
i++;
}
}
return retval;
}
public bool IsOnline(string addr = "")
{
return isRun;
}
public string GetAddr()
{
return $"{string.Join(",",GetLocalAddresses())}:{serverPort}";
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DL.StandardRobot;
using static DL.StandardRobot.StandardRobot;
namespace DeviceLibrary
{
public class AGVManager
{
static StandardRobot robot = new StandardRobot();
public static void Connect(string ip)
{
robot.IP = ip;
robot.Connect();
}
public static void Close()
{
robot.Close();
}
public static MissionState GetMissionState()
{
return robot.GetMissionState();
}
public static void Register(MissionStateChangedEventHandler changedEventHandler)
{
robot.MissionSateChanged += changedEventHandler;
}
public static void UnRegister(MissionStateChangedEventHandler changedEventHandler)
{
robot.MissionSateChanged -= changedEventHandler;
}
public static void AddMission(int id)
{
robot.AddMission(id);
}
public static bool IsConnected()
{
return false;
}
}
}
...@@ -33,35 +33,37 @@ ...@@ -33,35 +33,37 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.PrintLabel"> <Reference Include="Asa.PrintLabel">
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath> <HintPath>..\dll\Asa.PrintLabel.dll</HintPath>
</Reference> </Reference>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary">
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath> <HintPath>..\dll\CodeLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigHelper"> <Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath> <HintPath>..\dll\ConfigHelper.dll</HintPath>
</Reference> </Reference>
<Reference Include="halcondotnet"> <Reference Include="halcondotnet">
<HintPath>..\..\RC1271-DUOStore\dll\halcondotnet.dll</HintPath> <HintPath>..\dll\halcondotnet.dll</HintPath>
</Reference> </Reference>
<Reference Include="HuichuanLibrary"> <Reference Include="HuichuanLibrary">
<HintPath>..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath> <HintPath>..\dll\HuichuanLibrary.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Neotel.Rmaxis"> <Reference Include="Neotel.Rmaxis">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath> <HintPath>..\dll\Neotel.Rmaxis.dll</HintPath>
</Reference> </Reference>
<Reference Include="SdkApi.Core"> <Reference Include="SdkApi.Core">
<HintPath>..\..\LinkOS-PC-Samples-ZSDK_DevDemos_.NET\Source\Sdk\SdkApi.Core.dll</HintPath> <HintPath>..\dll\SdkApi.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="SdkApi.Desktop"> <Reference Include="SdkApi.Desktop">
<HintPath>..\..\LinkOS-PC-Samples-ZSDK_DevDemos_.NET\Source\Sdk\SdkApi.Desktop.dll</HintPath> <HintPath>..\dll\SdkApi.Desktop.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
...@@ -90,7 +92,7 @@ ...@@ -90,7 +92,7 @@
<Compile Include="AutoScanAndLabel\RobotManage.cs" /> <Compile Include="AutoScanAndLabel\RobotManage.cs" />
<Compile Include="AutoScanAndLabel\IRobot.cs" /> <Compile Include="AutoScanAndLabel\IRobot.cs" />
<Compile Include="AutoScanAndLabel\MainMachine.cs" /> <Compile Include="AutoScanAndLabel\MainMachine.cs" />
<Compile Include="Class1.cs" /> <Compile Include="AGVManager.cs" />
<Compile Include="DeviceLibrary\ElectricGripper.cs" /> <Compile Include="DeviceLibrary\ElectricGripper.cs" />
<Compile Include="DeviceLibrary\IAxisManager.cs" /> <Compile Include="DeviceLibrary\IAxisManager.cs" />
<Compile Include="DeviceLibrary\AxisManager.cs" /> <Compile Include="DeviceLibrary\AxisManager.cs" />
...@@ -126,6 +128,10 @@ ...@@ -126,6 +128,10 @@
<Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project> <Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project>
<Name>Common</Name> <Name>Common</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\DL.StandardRobots\DL.StandardRobots.csproj">
<Project>{f85a7412-b5b3-4291-a448-a10564602e1a}</Project>
<Name>DL.StandardRobots</Name>
</ProjectReference>
<ProjectReference Include="..\LoadCVSLibrary\LoadCSVLibrary.csproj"> <ProjectReference Include="..\LoadCVSLibrary\LoadCSVLibrary.csproj">
<Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project> <Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project>
<Name>LoadCSVLibrary</Name> <Name>LoadCSVLibrary</Name>
......
...@@ -97,7 +97,7 @@ namespace DeviceLibrary ...@@ -97,7 +97,7 @@ namespace DeviceLibrary
LogUtil.error("加载HIK相机出错:" + ex.ToString()); LogUtil.error("加载HIK相机出错:" + ex.ToString());
} }
} }
string[] names = Camera._cam.Name; string[] names = Camera._cam?.Name;
if (names != null) if (names != null)
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="log4net" version="2.0.12" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" requireReinstallation="true" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net461" requireReinstallation="true" />
</packages> </packages>
\ No newline at end of file \ No newline at end of file
...@@ -33,12 +33,13 @@ ...@@ -33,12 +33,13 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
...@@ -64,6 +65,9 @@ ...@@ -64,6 +65,9 @@
<Name>Common</Name> <Name>Common</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net461" />
</packages>
\ No newline at end of file \ No newline at end of file
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.30907.101 VisualStudioVersion = 17.3.32811.315
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}"
EndProject EndProject
...@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoScanAndLabel", "AutoSca ...@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoScanAndLabel", "AutoSca
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "DeviceLibrary\DeviceLibrary.csproj", "{BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "DeviceLibrary\DeviceLibrary.csproj", "{BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DL.StandardRobots", "DL.StandardRobots\DL.StandardRobots.csproj", "{F85A7412-B5B3-4291-A448-A10564602E1A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -33,6 +35,10 @@ Global ...@@ -33,6 +35,10 @@ Global
{BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}.Debug|Any CPU.Build.0 = Debug|Any CPU {BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}.Release|Any CPU.ActiveCfg = Release|Any CPU {BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}.Release|Any CPU.Build.0 = Release|Any CPU {BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}.Release|Any CPU.Build.0 = Release|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
\ No newline at end of file \ No newline at end of file
namespace Test
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(113, 47);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(98, 41);
this.button1.TabIndex = 0;
this.button1.Text = "连接";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(113, 117);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(98, 41);
this.button2.TabIndex = 1;
this.button2.Text = "关闭";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(373, 47);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(345, 264);
this.textBox1.TabIndex = 2;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(84, 217);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 21);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "0";
//
// button3
//
this.button3.Location = new System.Drawing.Point(84, 255);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(98, 41);
this.button3.TabIndex = 4;
this.button3.Text = "发送";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 217);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 5;
this.label1.Text = "任务编号:";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.label1);
this.Controls.Add(this.button3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Label label1;
}
}
using DeviceLibrary;
using DL.StandardRobot;
using DL.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void MissionStateChanged(MissionState state)
{
textBox1.Invoke(new Action(() =>
{
{
textBox1.Text = JsonHelper.SerializeObject(state);
}
})) ;
}
private void button1_Click(object sender, EventArgs e)
{
AGVManager.Connect("127.0.0.1");
AGVManager.Register(MissionStateChanged);
}
private void button2_Click(object sender, EventArgs e)
{
AGVManager.UnRegister(MissionStateChanged);
AGVManager.Close();
}
private void button3_Click(object sender, EventArgs e)
{
int.TryParse(textBox2.Text,out int value);
AGVManager.AddMission(value);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary namespace Test
{ {
public class Class1 internal static class Program
{ {
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
} }
} }
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Test")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bac72c6b-699f-48bc-b212-916cfcc3ed13")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Test.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Test.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BAC72C6B-699F-48BC-B212-916CFCC3ED13}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Test</RootNamespace>
<AssemblyName>Test</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DeviceLibrary\DeviceLibrary.csproj">
<Project>{BB23296C-AA1D-45C6-9FA6-5A37B2ABFE9B}</Project>
<Name>DeviceLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\DL.StandardRobots\DL.StandardRobots.csproj">
<Project>{f85a7412-b5b3-4291-a448-a10564602e1a}</Project>
<Name>DL.StandardRobots</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
<?xml version="1.0"?>
<doc>
<assembly>
<name>ConfigHelper</name>
</assembly>
<members>
<member name="F:ConfigHelper.AdvanceConfigEdit.CustomEditor">
<summary>
自定义编辑器
</summary>
</member>
<member name="F:ConfigHelper.AdvanceConfigEdit.components">
<summary>
必需的设计器变量。
</summary>
</member>
<member name="M:ConfigHelper.AdvanceConfigEdit.Dispose(System.Boolean)">
<summary>
清理所有正在使用的资源。
</summary>
<param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
</member>
<member name="M:ConfigHelper.AdvanceConfigEdit.InitializeComponent">
<summary>
设计器支持所需的方法 - 不要修改
使用代码编辑器修改此方法的内容。
</summary>
</member>
<member name="M:ConfigHelper.AdvanceConfigForm.AddCustomEditor``1(System.String)">
<summary>
添加自定义编辑器
</summary>
<typeparam name="T"></typeparam>
<param name="name"></param>
</member>
<member name="M:ConfigHelper.AdvanceConfigForm.ShowEditDialog(System.Windows.Forms.IWin32Window,System.Boolean)">
<summary>
显示配置界面,2秒内调用约6次后显示
</summary>
<param name="owner"></param>
<param name="TopMost"></param>
</member>
<member name="F:ConfigHelper.AdvanceConfigForm.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:ConfigHelper.AdvanceConfigForm.Dispose(System.Boolean)">
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
</member>
<member name="M:ConfigHelper.AdvanceConfigForm.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
<member name="T:ConfigHelper.Config">
<summary>
自定义配置存取
</summary>
</member>
<member name="F:ConfigHelper.Config.hasChange">
<summary>
指示配置文件是否存在变化
</summary>
</member>
<member name="P:ConfigHelper.Config.SaveToAppdata">
<summary>
将设置保存至appdata目录
</summary>
</member>
<member name="M:ConfigHelper.Config.ReloadConfig">
<summary>
重载配置
</summary>
</member>
<member name="M:ConfigHelper.Config.SetComment(System.String,System.String)">
<summary>
设置备注
</summary>
<param name="key"></param>
<param name="Comment"></param>
</member>
<member name="M:ConfigHelper.Config.Get(System.String)">
<summary>
读取配置
</summary>
<param name="key"></param>
<returns></returns>
</member>
<member name="M:ConfigHelper.Config.Get(System.Object)">
<summary>
读取配置
</summary>
<param name="key">传入一个枚举值</param>
<returns></returns>
</member>
<member name="M:ConfigHelper.Config.Get``1(System.Object,``0)">
<summary>
读取配置
</summary>
<typeparam name="T">返回类型</typeparam>
<param name="key">传入一个枚举值</param>
<param name="defaultvalue">失败默认值</param>
<returns></returns>
</member>
<member name="M:ConfigHelper.Config.Get``1(System.String,``0)">
<summary>
读取配置
</summary>
<typeparam name="T">返回类型</typeparam>
<param name="key">key</param>
<param name="defaultvalue">失败默认值</param>
<returns></returns>
</member>
<member name="M:ConfigHelper.Config.Set(System.String,System.String)">
<summary>
设置配置
</summary>
<param name="key"></param>
<param name="value"></param>
</member>
<member name="M:ConfigHelper.Config.Set(System.Object,System.String)">
<summary>
设置配置
</summary>
<param name="key">配置枚举值</param>
<param name="value"></param>
</member>
<member name="M:ConfigHelper.Config.Set``1(System.Object,``0)">
<summary>
设置配置
</summary>
<param name="key">配置枚举值</param>
<param name="value"></param>
</member>
<member name="M:ConfigHelper.Config.Set``1(System.String,``0)">
<summary>
设置配置
</summary>
<typeparam name="T">值类型</typeparam>
<param name="key"></param>
<param name="value"></param>
</member>
<member name="M:ConfigHelper.Config.SaveChangeDebounce">
<summary>
保存设置
</summary>
</member>
<member name="M:ConfigHelper.Config.SaveChange">
<summary>
保存设置
</summary>
</member>
<member name="M:ConfigHelper.Config.PropertyBind(System.Object,System.Object,System.String,System.String,System.String)">
<summary>
绑定UI属性
</summary>
<param name="key">配置key</param>
<param name="uiobj">ui对象</param>
<param name="Property">绑定属性</param>
<param name="SaveEvent">绑定事件(object s, EventArgs x),可以为空</param>
<param name="defaultvalue">默认值</param>
</member>
<member name="M:ConfigHelper.Config.PropertyBind``1(System.Object,System.Object,System.String,System.String,``0)">
<summary>
绑定UI属性
</summary>
<param name="key">配置key</param>
<param name="uiobj">ui对象</param>
<param name="Property">绑定属性</param>
<param name="SaveEvent">绑定事件(object s, EventArgs x),可以为空</param>
<param name="defaultvalue">默认值</param>
</member>
<member name="M:ConfigHelper.Config.LoadMyConfig(System.Type)">
<summary>
转换自定义配置类
</summary>
<param name="ConfigClassType"></param>
<returns>加载到的配置Key数量</returns>
</member>
<member name="T:ConfigHelper.ICustEditor">
<summary>
自定义编辑器接口
</summary>
</member>
<member name="M:ConfigHelper.ICustEditor.ValueEdit(System.Object)">
<summary>
自己的编辑方法或界面
</summary>
<param name="value">传入的值</param>
<returns>传出的值</returns>
</member>
<member name="T:ConfigHelper.MyConfig`1">
<summary>
自动化我的配置
</summary>
</member>
<member name="F:ConfigHelper.MyConfig`1.Key">
<summary>
配置的Key
</summary>
</member>
<member name="P:ConfigHelper.MyConfig`1.Val">
<summary>
配置的值
</summary>
</member>
<member name="M:ConfigHelper.MyConfig`1.ToString">
<summary>
获取配置数据的文本
</summary>
<returns></returns>
</member>
<member name="M:ConfigHelper.MyConfig`1.op_Implicit(ConfigHelper.MyConfig{`0})~`0">
<summary>
隐式转换
</summary>
<param name="m1"></param>
</member>
<member name="M:ConfigHelper.MyConfig`1.op_Implicit(`0)~ConfigHelper.MyConfig{`0}">
<summary>
隐式转换
</summary>
<param name="v1"></param>
</member>
<member name="T:ConfigHelper.MyConfigComment">
<summary>
自定义配置描述
</summary>
</member>
<member name="M:ConfigHelper.MyConfigComment.#ctor(System.String)">
<summary>
配置的说明
</summary>
<param name="comment"></param>
</member>
</members>
</doc>
此文件类型无法预览
<?xml version="1.0"?>
<doc>
<assembly>
<name>HuichuanLibrary</name>
</assembly>
<members>
<member name="F:HuichuanLibrary.FrmHuiChuanTest.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:HuichuanLibrary.FrmHuiChuanTest.Dispose(System.Boolean)">
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
</member>
<member name="M:HuichuanLibrary.FrmHuiChuanTest.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.InitConfig(System.String,System.String,System.String)">
<summary>
初始化配置信息,初始化板卡之前,先初始化配置
</summary>
<param name="deviceConfigPath"></param>
<param name="systemConfigPath"></param>
<param name="logName"></param>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.OpenCard">
<summary>
初始化板卡
</summary>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.CloseCard">
<summary>
关闭板卡
</summary>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.CardInitOk(System.Boolean)">
<summary>
板卡是否已经初始化OK
</summary>
<param name="isShowLog"></param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAdVal(System.Int16)">
<summary>
模拟量IO值获取 获取EtherCAT 第 adNo号的ad值
</summary>
<param name="adNo">ad的通道:0~配置个数</param>
<returns>获取AD的输入值</returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.StartHomeMove(System.Int16,System.UInt32,System.UInt32,System.UInt32,System.Int16,System.Int32,System.UInt32,System.Int16)">
<summary>
开始回零
</summary>
<param name="axisNo">轴号</param>
<param name="highVel">回零高速</param>
<param name="lowVel">回零低速</param>
<param name="acc">回零加速度</param>
<param name="homeMethod">回零方法,默认28</param>
<param name="offset">回零偏移,默认0</param>
<param name="overtime">超时时间,默认120000</param>
<param name="posSrc">端子板信号源,默认0</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.HomeingIsEnd(System.Int16)">
<summary>
判断回零是否完成
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.IsInPosition(System.Int16,System.Double,System.Double)">
<summary>
判断轴是否在指定的位置
</summary>
<param name="axisNo">轴号</param>
<param name="targetPos">目标位置</param>
<param name="maxError">最大误差脉冲值</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.SetEcatSdo(System.UInt16,System.Int32,System.Int32)">
<summary>
设置齿轮比
</summary>
<param name="axisNo">轴号</param>
<param name="Motor_Revolution">电子齿轮分子:电机分辨率</param>
<param name="Shaft_Revolution">电子齿轮分母:一圈脉冲数</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.SetSdo(System.UInt16,System.UInt16,System.UInt16,System.Byte[])">
<summary>
写sdo
</summary>
<param name="axisNo">轴号</param>
<param name="index">0x6091</param>
<param name="subindex">0x02</param>
<param name="value">2000</param>
<param name="datasize">4</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisPrfMode(System.Int16)">
<summary>
获取轴规划模式
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisSts(System.Int16)">
<summary>
获取轴状态
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisPrfPos(System.Int16)">
<summary>
获取轴规划位置
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisPrfVel(System.Int16)">
<summary>
获取轴规划速度
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisCurrPos(System.Int16)">
<summary>
获取轴反馈位置
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisCurrVel(System.Int16)">
<summary>
获取轴反馈速度
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetAxisCurrAcc(System.Int16)">
<summary>
获取轴反馈加速度
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.ClearAxisSts(System.Int16)">
<summary>
清楚轴报警状态
</summary>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetEcatAxPosTorqLmt(System.Int16)">
<summary>
获取EtherCAT类型轴对应的正向力矩限制
</summary>
<param name="axisNo">轴号0-31</param>
<returns>正向力矩限制</returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.SetEcatAxPosTorqLmt(System.Int16,System.Int16)">
<summary>
设置EtherCAT类型轴对应的正向力矩限制
</summary>
<param name="axisNo">轴号0-31</param>
<param name="value">正向力矩限制</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetEcatAxNegTorqLmt(System.Int16)">
<summary>
获取EtherCAT类型轴对应的负向力矩限制
</summary>
<param name="axisNo">轴号0-31</param>
<returns>负向力矩限制</returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.SetEcatAxNegTorqLmt(System.Int16,System.Int16)">
<summary>
设置EtherCAT类型轴对应的负向力矩限制
</summary>
<param name="axisNo">轴号0-31</param>
<param name="value">负向力矩限制</param>
<returns></returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.GetEcatAxMaxTorqLmt(System.Int16)">
<summary>
获取EtherCAT类型轴对应的最大力矩限制
</summary>
<param name="axisNo">轴号0-31</param>
<returns>最大力矩限制</returns>
</member>
<member name="M:HuichuanLibrary.HCBoardManager.SetEcatAxMaxTorqLmt(System.Int16,System.Int16)">
<summary>
设置EtherCAT类型轴对应的最大力矩限制
</summary>
<param name="axisNo">轴号0-31</param>
<param name="value">最大力矩限制</param>
<returns></returns>
</member>
<member name="F:HuichuanLibrary.HCBoardManager.HomeSts_Moveing">
<summary>
回原点状态:0=正在回零中
</summary>
</member>
<member name="F:HuichuanLibrary.HCBoardManager.HomeSts_NotStart">
<summary>
回原点状态:1=回零中断或者没有开始启动
</summary>
</member>
<member name="F:HuichuanLibrary.HCBoardManager.HomeSts_OK">
<summary>
回原点状态:3=回零完成
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.ALM">
<summary>
轴报警信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.WARN">
<summary>
轴警告信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.EMG">
<summary>
轴急停信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.ServoOn">
<summary>
轴伺服使能信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.BUSY">
<summary>
轴忙碌状态
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.INP">
<summary>
轴到位信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.PEL">
<summary>
正限位信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.ORG">
<summary>
原点信号
</summary>
</member>
<member name="F:HuichuanLibrary.AxisSts.NEL">
<summary>
负限位信号
</summary>
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetCardsNum(System.Int32@)">
*==========================================================================*/
*---- FUNCTION DEFINE ---*/
*==========================================================================*/
*==========================================================================*/
*----1.1 板卡的操作以及资源的获取接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetEcatGrpDiInverse(System.UInt64,System.Int16,System.Int16)">
*==========================================================================*/
*----1.2.1 ECAT资源设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetBoardWorkSts(System.UInt64,System.Int16@)">
*==========================================================================*/
*----1.2.2 端子板资源设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetHwSysPara(System.UInt64,System.Int16@,System.Int16@)">
*==========================================================================*/
*----1.2.3 系统参数设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetAxActive(System.UInt64,System.Int16,System.Int16)">
*==========================================================================*/
*----1.2.4 轴参数设置接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetSlaveCurSts(System.UInt64,System.UInt16,System.UInt16,System.Int16[])">
*==========================================================================*/
*----2.1 ECAT硬件操作接口 ---*/
*==========================================================================*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.1.1ECAT总线 SDO操作以及状态查询 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetLocalDoBit(System.UInt64,System.Int16,System.Int16)">
*==========================================================================*/
*----2.2 端子板硬件操作接口 ---*/
*==========================================================================*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.2.1 DIO操作接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetLocalCntPos(System.UInt64,System.Int16,System.Int32[],System.Int16)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.2.2 编码器操作接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_CompareSrcConfig(System.UInt64,System.Int16,System.Int16,System.Int16[],System.Int16[])">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----2.2.4 位置比较输出操作接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_StartHoming(System.UInt64,System.Int16,HuichuanLibrary.ImcApi.THomingPara@)">
*==========================================================================*/
*----3 回零操作接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_GetAxPrfMode(System.UInt64,System.Int16,System.Int16[],System.Int16)">
*==========================================================================*/
*----4 状态管理接口 ---*/
*==========================================================================*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----4.2 轴状态管理接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetAxCaptMode(System.UInt64,System.Int16,System.Int16,System.Int16,System.Int16)">
*==========================================================================*/
*----5 数据采集接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_SetSingleAxMvPara(System.UInt64,System.Int16,System.Double,System.Double,System.Double)">
*==========================================================================*/
*----7 运动模式接口 ---*/
*==========================================================================*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_StartPtpMove(System.UInt64,System.Int16,System.Double,System.Int16)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----7.1 PTP点位模式接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_StartJogMove(System.UInt64,System.Int16,System.Double)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----7.2 Jog运动模式接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
<member name="M:HuichuanLibrary.ImcApi.IMC_EnterHandWheelMode(System.UInt64,System.Int16,System.Int16,System.Int16,System.Double,System.Double,System.Double)">
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
*----7.3 手轮跟随运动模式接口 ---*/
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
</member>
</members>
</doc>
此文件类型无法预览
<?xml version="1.0"?>
<doc>
<assembly>
<name>Neotel.Rmaxis</name>
</assembly>
<members>
<member name="T:Neotel.Rmaxis">
<summary>
增广智能电动夹爪(RM-C控制器)
</summary>
</member>
<member name="M:Neotel.Rmaxis.#ctor(System.String)">
<summary>
增广智能电动夹爪(RM-C控制器)
</summary>
<param name="logName">日志名</param>
</member>
<member name="P:Neotel.Rmaxis.IsPortOpen">
<summary>
串口是否连接
</summary>
</member>
<member name="P:Neotel.Rmaxis.IsMoving">
<summary>
轴是否在运动
</summary>
</member>
<member name="P:Neotel.Rmaxis.IsReached">
<summary>
轴是否到达运动目标
</summary>
</member>
<member name="P:Neotel.Rmaxis.IsPushEmpty">
<summary>
轴是否推空(可以在Push完成后检测是否推压/夹持为空)
</summary>
</member>
<member name="P:Neotel.Rmaxis.ErrorCode">
<summary>
错误代码
</summary>
</member>
<member name="M:Neotel.Rmaxis.OpenPort(System.String,System.UInt16)">
<summary>
打开串口
</summary>
<param name="portName">串口名</param>
<param name="axisNo">轴号</param>
<returns></returns>
</member>
<member name="M:Neotel.Rmaxis.ClosePort">
<summary>
关闭串口
</summary>
</member>
<member name="M:Neotel.Rmaxis.ResetError">
<summary>
重置控制器错误
</summary>
</member>
<member name="M:Neotel.Rmaxis.StopAxis">
<summary>
停止轴运动
</summary>
</member>
<member name="M:Neotel.Rmaxis.GetVersion">
<summary>
控制器版本号
</summary>
<returns></returns>
</member>
<member name="M:Neotel.Rmaxis.GetTorque">
<summary>
获取当前设置的出力值
</summary>
<returns>出力,%</returns>
</member>
<member name="M:Neotel.Rmaxis.GetVelocity">
<summary>
获取当前电机速度
</summary>
<returns>速度,mm/s</returns>
</member>
<member name="M:Neotel.Rmaxis.GetPosition">
<summary>
获取当前位置
</summary>
<returns>位置,mm</returns>
</member>
<member name="M:Neotel.Rmaxis.GoHome">
<summary>
回原点
</summary>
</member>
<member name="M:Neotel.Rmaxis.Push(System.Single,System.Single,System.Single)">
<summary>
推压运动
</summary>
<param name="force">出力,%</param>
<param name="distance">距离,mm</param>
<param name="velocity">速度,mm/s</param>
</member>
<member name="M:Neotel.Rmaxis.MoveAbsolute(System.Single,System.Single,System.Single,System.Single,System.Single)">
<summary>
绝对运动
</summary>
<param name="position">位置,mm</param>
<param name="velocity">速度,mm/s</param>
<param name="acceleration">加速度,mm/s^2</param>
<param name="deacceleration">减速度,mm/s^2</param>
<param name="band">定位范围,mm</param>
</member>
<member name="M:Neotel.Rmaxis.MoveTo(System.Single)">
<summary>
直接运动到指定位置
</summary>
<param name="position">位置,mm</param>
</member>
<member name="M:Neotel.Rmaxis.MoveConfig(System.Single,System.Single,System.Single)">
<summary>
直接运动的参数
</summary>
<param name="velocity">速度,mm/s</param>
<param name="acceleration">加速度,mm/s^2</param>
<param name="deacceleration">减速度,mm/s^2</param>
</member>
<member name="M:Neotel.Rmaxis.GoHomeWait(System.Int32)">
<summary>
回原点,并等到到位
</summary>
<param name="timeout">超时时间,ms</param>
<returns></returns>
</member>
<member name="M:Neotel.Rmaxis.PushWait(System.Single,System.Single,System.Single,System.Int32)">
<summary>
推压运动,并等到到位
</summary>
<param name="force">出力,%</param>
<param name="distance">距离,mm</param>
<param name="velocity">速度,mm/s</param>
<param name="timeout">超时时间,ms</param>
<returns></returns>
</member>
<member name="M:Neotel.Rmaxis.MoveAbsoluteWait(System.Single,System.Single,System.Single,System.Single,System.Single,System.Int32)">
<summary>
绝对运动,并等到到位
</summary>
<param name="position">位置,mm</param>
<param name="velocity">速度,mm/s</param>
<param name="acceleration">加速度,mm/s^2</param>
<param name="deacceleration">减速度,mm/s^2</param>
<param name="band">定位范围,mm</param>
<param name="timeout">超时时间,ms</param>
<returns></returns>
</member>
<member name="M:Neotel.Rmaxis.MoveToWait(System.Single,System.Int32)">
<summary>
直接运动到指定位置,并等到到位
</summary>
<param name="position">位置,mm</param>
<param name="timeout">超时时间,ms</param>
<returns></returns>
</member>
</members>
</doc>
此文件类型无法预览
此文件的差异太大,无法显示。
此文件类型无法预览
此文件太大,无法显示。
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!