刘仕广原始项目代码上传

This commit is contained in:
2026-04-17 22:21:06 +08:00
parent 6e510a4170
commit 760ff50baf
41 changed files with 10282 additions and 38 deletions

152
.gitignore vendored
View File

@@ -1,4 +1,3 @@
# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
## ##
@@ -10,6 +9,7 @@
*.user *.user
*.userosscache *.userosscache
*.sln.docstates *.sln.docstates
*.env
# User-specific files (MonoDevelop/Xamarin Studio) # User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs *.userprefs
@@ -22,17 +22,37 @@ mono_crash.*
[Dd]ebugPublic/ [Dd]ebugPublic/
[Rr]elease/ [Rr]elease/
[Rr]eleases/ [Rr]eleases/
x64/
x86/ [Dd]ebug/x64/
[Dd]ebugPublic/x64/
[Rr]elease/x64/
[Rr]eleases/x64/
bin/x64/
obj/x64/
[Dd]ebug/x86/
[Dd]ebugPublic/x86/
[Rr]elease/x86/
[Rr]eleases/x86/
bin/x86/
obj/x86/
[Ww][Ii][Nn]32/ [Ww][Ii][Nn]32/
[Aa][Rr][Mm]/ [Aa][Rr][Mm]/
[Aa][Rr][Mm]64/ [Aa][Rr][Mm]64/
[Aa][Rr][Mm]64[Ee][Cc]/
bld/ bld/
[Bb]in/
[Oo]bj/ [Oo]bj/
[Oo]ut/
[Ll]og/ [Ll]og/
[Ll]ogs/ [Ll]ogs/
# Build results on 'Bin' directories
**/[Bb]in/*
# Uncomment if you have tasks that rely on *.refresh files to move binaries
# (https://github.com/github/gitignore/pull/3736)
#!**/[Bb]in/*.refresh
# Visual Studio 2015/2017 cache/options directory # Visual Studio 2015/2017 cache/options directory
.vs/ .vs/
# Uncomment if you have tasks that create the project's static files in wwwroot # Uncomment if you have tasks that create the project's static files in wwwroot
@@ -44,12 +64,16 @@ Generated\ Files/
# MSTest test Results # MSTest test Results
[Tt]est[Rr]esult*/ [Tt]est[Rr]esult*/
[Bb]uild[Ll]og.* [Bb]uild[Ll]og.*
*.trx
# NUnit # NUnit
*.VisualState.xml *.VisualState.xml
TestResult.xml TestResult.xml
nunit-*.xml nunit-*.xml
# Approval Tests result files
*.received.*
# Build Results of an ATL Project # Build Results of an ATL Project
[Dd]ebugPS/ [Dd]ebugPS/
[Rr]eleasePS/ [Rr]eleasePS/
@@ -76,6 +100,7 @@ StyleCopReport.xml
*.ilk *.ilk
*.meta *.meta
*.obj *.obj
*.idb
*.iobj *.iobj
*.pch *.pch
*.pdb *.pdb
@@ -156,6 +181,7 @@ coverage*.info
# NCrunch # NCrunch
_NCrunch_* _NCrunch_*
.NCrunch_*
.*crunch*.local.xml .*crunch*.local.xml
nCrunchTemp_* nCrunchTemp_*
@@ -297,9 +323,6 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw *.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project) # Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw *.dsw
*.dsp *.dsp
@@ -317,17 +340,17 @@ node_modules/
_Pvt_Extensions _Pvt_Extensions
# Paket dependency manager # Paket dependency manager
.paket/paket.exe **/.paket/paket.exe
paket-files/ paket-files/
# FAKE - F# Make # FAKE - F# Make
.fake/ **/.fake/
# CodeRush personal settings # CodeRush personal settings
.cr/personal **/.cr/personal
# Python Tools for Visual Studio (PTVS) # Python Tools for Visual Studio (PTVS)
__pycache__/ **/__pycache__/
*.pyc *.pyc
# Cake - Uncomment if you are using it # Cake - Uncomment if you are using it
@@ -354,15 +377,19 @@ ASALocalRun/
# MSBuild Binary and Structured Log # MSBuild Binary and Structured Log
*.binlog *.binlog
MSBuild_Logs/
# AWS SAM Build and Temporary Artifacts folder
.aws-sam
# NVidia Nsight GPU debugger configuration file # NVidia Nsight GPU debugger configuration file
*.nvuser *.nvuser
# MFractors (Xamarin productivity tool) working folder # MFractors (Xamarin productivity tool) working folder
.mfractor/ **/.mfractor/
# Local History for Visual Studio # Local History for Visual Studio
.localhistory/ **/.localhistory/
# Visual Studio History (VSHistory) files # Visual Studio History (VSHistory) files
.vshistory/ .vshistory/
@@ -374,7 +401,7 @@ healthchecksdb
MigrationBackup/ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder # Ionide (cross platform F# VS Code tools) working folder
.ionide/ **/.ionide/
# Fody - auto-generated XML schema # Fody - auto-generated XML schema
FodyWeavers.xsd FodyWeavers.xsd
@@ -385,27 +412,6 @@ FodyWeavers.xsd
!.vscode/tasks.json !.vscode/tasks.json
!.vscode/launch.json !.vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets !.vscode/*.code-snippets
# Local History for Visual Studio Code # Local History for Visual Studio Code
@@ -414,6 +420,7 @@ FodyWeavers.xsd
# Built Visual Studio Code Extensions # Built Visual Studio Code Extensions
*.vsix *.vsix
# =============== 操作系统文件 ===============[WQ]
# ---> Windows # ---> Windows
# Windows thumbnail cache files # Windows thumbnail cache files
Thumbs.db Thumbs.db
@@ -430,7 +437,7 @@ ehthumbs_vista.db
# Recycle Bin used on file shares # Recycle Bin used on file shares
$RECYCLE.BIN/ $RECYCLE.BIN/
# Windows Installer files # Windows Installer files from build outputs
*.cab *.cab
*.msi *.msi
*.msix *.msix
@@ -440,3 +447,76 @@ $RECYCLE.BIN/
# Windows shortcuts # Windows shortcuts
*.lnk *.lnk
# ---> macOS
.DS_Store
# =============== VisionPro ===============[WQ]
*.vpp
*.idb
*.cdb
# =============== Others ===============[Zhao]
#Backup file
*.bak
**/.vs
*.dylib
*.so
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
*.7z
*.zip
*.rar
**/thirdparty
**/external
**/build
**/Debug
**/debug
**/Release
**/release
**/.vscode
**/venv
**/gen
**/__pycache__
*.cmd
*.dist
*.pth
*.pt
*.csv
*.jpg
*.jpeg
*.png
*.bmp

View File

@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36109.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "精工涂胶检测项目", "精工涂胶检测项目\精工涂胶检测项目.csproj", "{10C424D2-36A1-4D94-A034-A6801A1B17B5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Debug|Any CPU.ActiveCfg = Debug|x64
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Debug|Any CPU.Build.0 = Debug|x64
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Debug|x64.ActiveCfg = Debug|x64
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Debug|x64.Build.0 = Debug|x64
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Debug|x86.ActiveCfg = Debug|x86
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Debug|x86.Build.0 = Debug|x86
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Release|Any CPU.Build.0 = Release|Any CPU
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Release|x64.ActiveCfg = Release|x64
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Release|x64.Build.0 = Release|x64
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Release|x86.ActiveCfg = Release|x86
{10C424D2-36A1-4D94-A034-A6801A1B17B5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EF7CB683-60A7-4F75-891E-C6B539D5298C}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="精工涂胶检测项目.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" />
</startup>
<userSettings>
<精工涂胶检测项目.Properties.Settings>
<setting name="TcpIP" serializeAs="String">
<value />
</setting>
<setting name="TcpProt" serializeAs="String">
<value />
</setting>
<setting name="PlcIP" serializeAs="String">
<value />
</setting>
<setting name="PlcRack" serializeAs="String">
<value />
</setting>
<setting name="PlcType" serializeAs="String">
<value />
</setting>
<setting name="TcpStatus" serializeAs="String">
<value />
</setting>
<setting name="ModbusIP" serializeAs="String">
<value>192.168.1.30</value>
</setting>
<setting name="ModbusPort" serializeAs="String">
<value>502</value>
</setting>
<setting name="PlcSlot" serializeAs="String">
<value>
</value>
</setting>
</精工涂胶检测项目.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace
{
public static class AppConstants
{
public const int ModbusDefaultPort = 502;
public const int TcpDefaultPort = 8080;
public const int MaxConnectionRetries = 3;
}
}

View File

@@ -0,0 +1,120 @@
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualBasic;
using System;
namespace
{
public class EditableListView : ListView
{
public EditableListView()
{
View = View.Details;
FullRowSelect = true;
GridLines = true;
LabelEdit = false;
Scrollable = true;
Columns.Add("地址", 120);
Columns.Add("数据类型", 120);
DoubleClick -= EditableListView_DoubleClick;
DoubleClick += EditableListView_DoubleClick;
}
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
const int WM_LBUTTONDBLCLK = 0x0203;
if (m.Msg == WM_LBUTTONDBLCLK)
{
OnDoubleClick(EventArgs.Empty);
}
base.WndProc(ref m);
}
// 添加数据的公共方法
public void AddData(string address, string dataType)
{
ListViewItem item = new ListViewItem(address);
item.SubItems.Add(dataType);
Items.Add(item);
}
private void EditableListView_DoubleClick(object sender, EventArgs e)
{
var mousePos = this.PointToClient(Cursor.Position);
var hitInfo = this.HitTest(mousePos);
bool isRealBlankArea =
hitInfo.Item == null &&
hitInfo.SubItem == null &&
(hitInfo.Location == ListViewHitTestLocations.None ||
hitInfo.Location == ListViewHitTestLocations.AboveClientArea);
if (isRealBlankArea)
{
AddNewItem();
}
else if (hitInfo.Item != null)
{
int colIndex = GetColumnIndex(mousePos.X);
if (colIndex >= 0 && colIndex < Columns.Count)
{
EditItem(hitInfo.Item, colIndex);
}
}
}
private int GetColumnIndex(int x)
{
int accumulatedWidth = 0;
for (int i = 0; i < Columns.Count; i++)
{
accumulatedWidth += Columns[i].Width;
if (x < accumulatedWidth)
return i;
}
return Columns.Count - 1;
}
private void EditItem(ListViewItem item, int columnIndex)
{
string originalValue = columnIndex == 0 ? item.Text : item.SubItems[columnIndex].Text;
string newValue = Interaction.InputBox(
"请输入新值:",
"编辑单元格",
originalValue
);
if (!string.IsNullOrEmpty(newValue))
{
if (columnIndex == 0)
{
item.Text = newValue;
}
else
{
if (item.SubItems.Count > columnIndex)
{
item.SubItems[columnIndex].Text = newValue;
}
else
{
item.SubItems.Add(newValue);
}
}
}
}
private void AddNewItem()
{
string address = Interaction.InputBox("请输入地址:", "添加新条目", "");
if (!string.IsNullOrEmpty(address))
{
string dataType = Interaction.InputBox("请输入数据类型:", "添加新条目", "");
AddData(address, dataType);
}
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SlandDs
{
[Serializable]
public class Student
{
public string CSV1max { get; set; }
public string CSV1mix { get; set; }
public string CSA1max { get; set; }
public string CSA1mix { get; set; }
public string CSV2max { get; set; }
public string CSV2mix { get; set; }
public string CSA2max { get; set; }
public string CSA2mix { get; set; }
public string CSV3max { get; set; }
public string CSV3mix { get; set; }
public string CSA3max { get; set; }
public string CSA3mix { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace .Form
{
internal class FileName
{
}
}

View File

@@ -0,0 +1,421 @@
namespace
{
partial class FormCommunication
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.btn_TCPConfirm = new System.Windows.Forms.Button();
this.txb_Port = new System.Windows.Forms.TextBox();
this.txb_IP = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.btn_PLCConfirm = new System.Windows.Forms.Button();
this.cmb_PLCType = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txb_PLCSlot = new System.Windows.Forms.TextBox();
this.txb_PLCRack = new System.Windows.Forms.TextBox();
this.txb_PLCIP = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.btn_ModbusTCPConfirm = new System.Windows.Forms.Button();
this.txb_ModbusTcpPort = new System.Windows.Forms.TextBox();
this.txb_ModbusTcpIP = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.btn_OK = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.tabControl1.ItemSize = new System.Drawing.Size(80, 30);
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1067, 500);
this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.btn_TCPConfirm);
this.tabPage1.Controls.Add(this.txb_Port);
this.tabPage1.Controls.Add(this.txb_IP);
this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Location = new System.Drawing.Point(4, 34);
this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage1.Size = new System.Drawing.Size(1059, 462);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "TCP";
this.tabPage1.UseVisualStyleBackColor = true;
//
// btn_TCPConfirm
//
this.btn_TCPConfirm.Font = new System.Drawing.Font("宋体", 12F);
this.btn_TCPConfirm.Location = new System.Drawing.Point(16, 104);
this.btn_TCPConfirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btn_TCPConfirm.Name = "btn_TCPConfirm";
this.btn_TCPConfirm.Size = new System.Drawing.Size(139, 41);
this.btn_TCPConfirm.TabIndex = 5;
this.btn_TCPConfirm.Text = "连接";
this.btn_TCPConfirm.UseVisualStyleBackColor = true;
this.btn_TCPConfirm.Click += new System.EventHandler(this.btn_TCPConfirm_Click);
//
// txb_Port
//
this.txb_Port.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::.Properties.Settings.Default, "TcpProt", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.txb_Port.Location = new System.Drawing.Point(105, 70);
this.txb_Port.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txb_Port.Name = "txb_Port";
this.txb_Port.Size = new System.Drawing.Size(132, 25);
this.txb_Port.TabIndex = 3;
this.txb_Port.Text = global::.Properties.Settings.Default.TcpProt;
//
// txb_IP
//
this.txb_IP.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::.Properties.Settings.Default, "TcpIP", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.txb_IP.Location = new System.Drawing.Point(105, 16);
this.txb_IP.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txb_IP.Name = "txb_IP";
this.txb_IP.Size = new System.Drawing.Size(132, 25);
this.txb_IP.TabIndex = 2;
this.txb_IP.Text = global::.Properties.Settings.Default.TcpIP;
this.txb_IP.TextChanged += new System.EventHandler(this.txb_IP_TextChanged);
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 15F);
this.label2.Location = new System.Drawing.Point(11, 65);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(87, 35);
this.label2.TabIndex = 1;
this.label2.Text = "端口:";
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 15F);
this.label1.Location = new System.Drawing.Point(11, 16);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(87, 35);
this.label1.TabIndex = 0;
this.label1.Text = "IP:";
//
// tabPage2
//
this.tabPage2.Controls.Add(this.btn_PLCConfirm);
this.tabPage2.Controls.Add(this.cmb_PLCType);
this.tabPage2.Controls.Add(this.label6);
this.tabPage2.Controls.Add(this.label5);
this.tabPage2.Controls.Add(this.label4);
this.tabPage2.Controls.Add(this.label3);
this.tabPage2.Controls.Add(this.txb_PLCSlot);
this.tabPage2.Controls.Add(this.txb_PLCRack);
this.tabPage2.Controls.Add(this.txb_PLCIP);
this.tabPage2.Location = new System.Drawing.Point(4, 34);
this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tabPage2.Size = new System.Drawing.Size(1059, 462);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Profinet";
this.tabPage2.UseVisualStyleBackColor = true;
//
// btn_PLCConfirm
//
this.btn_PLCConfirm.Font = new System.Drawing.Font("宋体", 12F);
this.btn_PLCConfirm.Location = new System.Drawing.Point(4, 358);
this.btn_PLCConfirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btn_PLCConfirm.Name = "btn_PLCConfirm";
this.btn_PLCConfirm.Size = new System.Drawing.Size(139, 41);
this.btn_PLCConfirm.TabIndex = 11;
this.btn_PLCConfirm.Text = "连接";
this.btn_PLCConfirm.UseVisualStyleBackColor = true;
this.btn_PLCConfirm.Click += new System.EventHandler(this.btn_PLCConfirm_Click);
//
// cmb_PLCType
//
this.cmb_PLCType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb_PLCType.FormattingEnabled = true;
this.cmb_PLCType.Items.AddRange(new object[] {
"Logo0BA8",
"S71200",
"S71500",
"S7200",
"S7200Smart",
"S7300",
"S7400"});
this.cmb_PLCType.Location = new System.Drawing.Point(867, 20);
this.cmb_PLCType.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cmb_PLCType.Name = "cmb_PLCType";
this.cmb_PLCType.Size = new System.Drawing.Size(160, 23);
this.cmb_PLCType.TabIndex = 10;
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 15F);
this.label6.Location = new System.Drawing.Point(772, 15);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(87, 35);
this.label6.TabIndex = 9;
this.label6.Text = "型号:";
//
// label5
//
this.label5.Font = new System.Drawing.Font("宋体", 15F);
this.label5.Location = new System.Drawing.Point(512, 19);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(87, 35);
this.label5.TabIndex = 7;
this.label5.Text = "Slot:";
//
// label4
//
this.label4.Font = new System.Drawing.Font("宋体", 15F);
this.label4.Location = new System.Drawing.Point(259, 19);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(87, 35);
this.label4.TabIndex = 5;
this.label4.Text = "Rack:";
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 15F);
this.label3.Location = new System.Drawing.Point(16, 19);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(87, 35);
this.label3.TabIndex = 3;
this.label3.Text = "IP:";
//
// txb_PLCSlot
//
this.txb_PLCSlot.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::.Properties.Settings.Default, "PlcSlot", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.txb_PLCSlot.Location = new System.Drawing.Point(607, 19);
this.txb_PLCSlot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txb_PLCSlot.Name = "txb_PLCSlot";
this.txb_PLCSlot.Size = new System.Drawing.Size(132, 25);
this.txb_PLCSlot.TabIndex = 8;
this.txb_PLCSlot.Text = global::.Properties.Settings.Default.PlcSlot;
//
// txb_PLCRack
//
this.txb_PLCRack.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::.Properties.Settings.Default, "PlcRack", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.txb_PLCRack.Location = new System.Drawing.Point(353, 19);
this.txb_PLCRack.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txb_PLCRack.Name = "txb_PLCRack";
this.txb_PLCRack.Size = new System.Drawing.Size(132, 25);
this.txb_PLCRack.TabIndex = 6;
this.txb_PLCRack.Text = global::.Properties.Settings.Default.PlcRack;
//
// txb_PLCIP
//
this.txb_PLCIP.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::.Properties.Settings.Default, "PlcIP", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.txb_PLCIP.Location = new System.Drawing.Point(111, 19);
this.txb_PLCIP.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txb_PLCIP.Name = "txb_PLCIP";
this.txb_PLCIP.Size = new System.Drawing.Size(132, 25);
this.txb_PLCIP.TabIndex = 4;
this.txb_PLCIP.Text = global::.Properties.Settings.Default.PlcIP;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.btn_ModbusTCPConfirm);
this.tabPage3.Controls.Add(this.txb_ModbusTcpPort);
this.tabPage3.Controls.Add(this.txb_ModbusTcpIP);
this.tabPage3.Controls.Add(this.label7);
this.tabPage3.Controls.Add(this.label8);
this.tabPage3.Location = new System.Drawing.Point(4, 34);
this.tabPage3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage3.Size = new System.Drawing.Size(1059, 462);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "ModbusTcp";
this.tabPage3.UseVisualStyleBackColor = true;
//
// btn_ModbusTCPConfirm
//
this.btn_ModbusTCPConfirm.Font = new System.Drawing.Font("宋体", 12F);
this.btn_ModbusTCPConfirm.Location = new System.Drawing.Point(19, 119);
this.btn_ModbusTCPConfirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btn_ModbusTCPConfirm.Name = "btn_ModbusTCPConfirm";
this.btn_ModbusTCPConfirm.Size = new System.Drawing.Size(139, 41);
this.btn_ModbusTCPConfirm.TabIndex = 8;
this.btn_ModbusTCPConfirm.Text = "连接";
this.btn_ModbusTCPConfirm.UseVisualStyleBackColor = true;
this.btn_ModbusTCPConfirm.Click += new System.EventHandler(this.btn_ModbusTCPConfirm_Click);
//
// txb_ModbusTcpPort
//
this.txb_ModbusTcpPort.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::.Properties.Settings.Default, "ModbusPort", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.txb_ModbusTcpPort.Location = new System.Drawing.Point(108, 74);
this.txb_ModbusTcpPort.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txb_ModbusTcpPort.Name = "txb_ModbusTcpPort";
this.txb_ModbusTcpPort.Size = new System.Drawing.Size(132, 25);
this.txb_ModbusTcpPort.TabIndex = 7;
this.txb_ModbusTcpPort.Text = global::.Properties.Settings.Default.ModbusPort;
//
// txb_ModbusTcpIP
//
this.txb_ModbusTcpIP.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::.Properties.Settings.Default, "ModbusIP", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.txb_ModbusTcpIP.Location = new System.Drawing.Point(108, 20);
this.txb_ModbusTcpIP.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txb_ModbusTcpIP.Name = "txb_ModbusTcpIP";
this.txb_ModbusTcpIP.Size = new System.Drawing.Size(132, 25);
this.txb_ModbusTcpIP.TabIndex = 6;
this.txb_ModbusTcpIP.Text = global::.Properties.Settings.Default.ModbusIP;
//
// label7
//
this.label7.Font = new System.Drawing.Font("宋体", 15F);
this.label7.Location = new System.Drawing.Point(13, 69);
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(87, 35);
this.label7.TabIndex = 5;
this.label7.Text = "端口:";
//
// label8
//
this.label8.Font = new System.Drawing.Font("宋体", 15F);
this.label8.Location = new System.Drawing.Point(13, 20);
this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(87, 35);
this.label8.TabIndex = 4;
this.label8.Text = "IP:";
//
// contextMenuStrip1
//
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(109, 28);
//
// 删除ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "删除ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(108, 24);
this.ToolStripMenuItem.Text = "删除";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// btn_OK
//
this.btn_OK.Font = new System.Drawing.Font("宋体", 12F);
this.btn_OK.Location = new System.Drawing.Point(912, 508);
this.btn_OK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btn_OK.Name = "btn_OK";
this.btn_OK.Size = new System.Drawing.Size(139, 41);
this.btn_OK.TabIndex = 9;
this.btn_OK.Text = "确定";
this.btn_OK.UseVisualStyleBackColor = true;
this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
//
// FormCommunication
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1067, 562);
this.Controls.Add(this.btn_OK);
this.Controls.Add(this.tabControl1);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "FormCommunication";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "通讯设置";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormCommunication_FormClosed);
this.Load += new System.EventHandler(this.FormCommunication_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TextBox txb_IP;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txb_Port;
private System.Windows.Forms.Button btn_TCPConfirm;
private System.Windows.Forms.TextBox txb_PLCSlot;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txb_PLCRack;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txb_PLCIP;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox cmb_PLCType;
private System.Windows.Forms.Button btn_PLCConfirm;
private EditableListView editableListView1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Button btn_ModbusTCPConfirm;
private System.Windows.Forms.TextBox txb_ModbusTcpPort;
private System.Windows.Forms.TextBox txb_ModbusTcpIP;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button btn_OK;
}
}

View File

@@ -0,0 +1,160 @@
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;
using S7.Net;
using System.Net;
namespace
{
public partial class FormCommunication : Form
{
private TextBox editBox = new TextBox();
public FormCommunication()
{
InitializeComponent();
}
private async void btn_TCPConfirm_Click(object sender, EventArgs e)
{
try
{
// 获取主窗体的 TCP 实例
var mainForm = Application.OpenForms.OfType<Form1>().FirstOrDefault();
if (mainForm == null) return;
TCPClass tcp = mainForm.myTcp; // ✅ 使用同一实例
if (txb_IP.Text == "")
{
await tcp.StartServerAsync(int.Parse(txb_Port.Text));
mainForm._autoTcpReconnect = true;
}
else
{
await tcp.ConnectAsync(txb_IP.Text,int.Parse(txb_Port.Text));
mainForm._autoTcpReconnect = true;
}
}
catch(Exception s)
{
MessageBox.Show(s.ToString());
}
}
private async void btn_PLCConfirm_Click(object sender, EventArgs e)
{
var mainForm = Application.OpenForms.OfType<Form1>().FirstOrDefault();
if (mainForm == null)
{
MessageBox.Show("无法找到主窗体");
return;
}
try
{
string ip = txb_PLCIP.Text;
short rack = short.Parse(txb_PLCRack.Text);
short slot = short.Parse(txb_PLCSlot.Text);
CpuType cpuType = (CpuType)Enum.Parse(typeof(CpuType), cmb_PLCType.Text);
mainForm.ConnectPLC(ip, cpuType, rack, slot);
if (mainForm.plc.IsConnected)
{
MessageBox.Show("PLC连接成功");
}
}
catch (Exception ex)
{
mainForm.AddLog($"PLC连接失败: {ex.Message}", 2);
MessageBox.Show($"PLC连接失败: {ex.Message}");
}
}
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
if(editableListView1.SelectedItems.Count != 0)
{
ListViewItem item = editableListView1.SelectedItems[0];
editableListView1.Items.Remove(item);
}
}
private void FormCommunication_FormClosed(object sender, FormClosedEventArgs e)
{
// 获取主窗体的 TCP 实例
var mainForm = Application.OpenForms.OfType<Form1>().FirstOrDefault();
if (mainForm == null) return;
TCPClass tcp = mainForm.myTcp; // ✅ 使用同一实例
Properties.Settings.Default.TcpIP = txb_IP.Text;
Properties.Settings.Default.TcpProt = txb_Port.Text;
Properties.Settings.Default.PlcIP = txb_PLCIP.Text;
Properties.Settings.Default.PlcRack = txb_PLCRack.Text;
Properties.Settings.Default.PlcSlot = txb_PLCSlot.Text;
Properties.Settings.Default.TcpStatus = tcp.TcpStatus;
Properties.Settings.Default.ModbusIP = txb_ModbusTcpIP.Text;
Properties.Settings.Default.ModbusPort = txb_ModbusTcpPort.Text;
if (cmb_PLCType.SelectedValue != null)
Properties.Settings.Default.PlcType = cmb_PLCType.SelectedValue.ToString();
Properties.Settings.Default.Save();
}
private async void btn_ModbusTCPConfirm_Click(object sender, EventArgs e)
{
if (!IPAddress.TryParse(txb_ModbusTcpIP.Text, out _))
{
MessageBox.Show("IP地址格式错误");
return;
}
if (!int.TryParse(txb_ModbusTcpPort.Text, out int port) || port < 1 || port > 65535)
{
MessageBox.Show("端口号无效");
return;
}
// 获取主窗体实例并更新配置
var mainForm = Application.OpenForms.OfType<Form1>().FirstOrDefault();
if (mainForm != null)
{
mainForm.modbusClient = new ModbusTcpClient(txb_ModbusTcpIP.Text, port);
mainForm.Modbus事件注册();
await mainForm.modbusClient.ConnectAsync();
}
}
private void btn_OK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void FormCommunication_Load(object sender, EventArgs e)
{
txb_ModbusTcpIP.Text = Properties.Settings.Default.ModbusIP;
txb_ModbusTcpPort.Text = Properties.Settings.Default.ModbusPort;
}
private void txb_IP_TextChanged(object sender, EventArgs e)
{
}
}
}

View File

@@ -0,0 +1,123 @@
<?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>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,101 @@
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
{
public partial class FormLogin : Form
{
public int Status = 0;
public string account;
private Form1 formMain;
public FormLogin(Form1 formMain1)
{
InitializeComponent();
formMain = formMain1;
txb_Pwd.Text = "";
txb_Pwd.PasswordChar = '*';
}
private void btn_Login_Click(object sender, EventArgs e)
{
switch (comboBox1.SelectedIndex)
{
case 0:
try
{
txb_Account.Text = "Operator";
if (txb_Account.Text == "Operator" && txb_Pwd.Text == "123")
{
MessageBox.Show("Operator 登录成功");
this.Status = 1;
this.account = "Operator";
formMain.SetMainEnabled(Status, account);
}
else
{
MessageBox.Show("用户名或密码输入有误");
}
}
catch
{
MessageBox.Show("登录异常");
}
break;
case 1:
try
{
txb_Account.Text = "Debugger";
if (txb_Account.Text == "Debugger" && txb_Pwd.Text == "000")
{
MessageBox.Show("Debugger 登录成功");
this.Status = 2;
this.account = "Debugger";
formMain.SetMainEnabled(Status, account);
}
else
{
MessageBox.Show("用户名或密码输入有误");
}
}
catch
{
MessageBox.Show("登录异常");
}
break;
case 2:
try
{
txb_Account.Text = "admin";
if (txb_Account.Text == "admin" && txb_Pwd.Text == "cve666")
{
MessageBox.Show("admin 登录成功");
this.Status = 3;
this.account = "admin";
formMain.SetMainEnabled(Status, account);
}
else
{
MessageBox.Show("用户名或密码输入有误");
}
}
catch
{
MessageBox.Show("登录异常");
}
break;
}
}
}
}

View File

@@ -0,0 +1,152 @@
namespace
{
partial class FormLogin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.btn_Exit = new System.Windows.Forms.Button();
this.btn_Login = new System.Windows.Forms.Button();
this.txb_Pwd = new System.Windows.Forms.TextBox();
this.txb_Account = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Items.AddRange(new object[] {
"操作员",
"调试员",
"管理员"});
this.comboBox1.Location = new System.Drawing.Point(339, 118);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(192, 28);
this.comboBox1.TabIndex = 17;
//
// btn_Exit
//
this.btn_Exit.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_Exit.Location = new System.Drawing.Point(425, 309);
this.btn_Exit.Name = "btn_Exit";
this.btn_Exit.Size = new System.Drawing.Size(86, 28);
this.btn_Exit.TabIndex = 15;
this.btn_Exit.Text = "退出";
this.btn_Exit.UseVisualStyleBackColor = true;
//
// btn_Login
//
this.btn_Login.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_Login.Location = new System.Drawing.Point(293, 309);
this.btn_Login.Name = "btn_Login";
this.btn_Login.Size = new System.Drawing.Size(86, 28);
this.btn_Login.TabIndex = 16;
this.btn_Login.Text = "登录";
this.btn_Login.UseVisualStyleBackColor = true;
this.btn_Login.Click += new System.EventHandler(this.btn_Login_Click);
//
// txb_Pwd
//
this.txb_Pwd.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txb_Pwd.Location = new System.Drawing.Point(339, 221);
this.txb_Pwd.Name = "txb_Pwd";
this.txb_Pwd.Size = new System.Drawing.Size(192, 30);
this.txb_Pwd.TabIndex = 14;
//
// txb_Account
//
this.txb_Account.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txb_Account.Location = new System.Drawing.Point(339, 167);
this.txb_Account.Name = "txb_Account";
this.txb_Account.Size = new System.Drawing.Size(192, 30);
this.txb_Account.TabIndex = 13;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(269, 114);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(49, 20);
this.label3.TabIndex = 11;
this.label3.Text = "用户";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(269, 221);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(49, 20);
this.label2.TabIndex = 12;
this.label2.Text = "密码";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(269, 167);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(49, 20);
this.label1.TabIndex = 10;
this.label1.Text = "账号";
//
// FormLogin
//
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.comboBox1);
this.Controls.Add(this.btn_Exit);
this.Controls.Add(this.btn_Login);
this.Controls.Add(this.txb_Pwd);
this.Controls.Add(this.txb_Account);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "FormLogin";
this.Text = "FormLogin";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button btn_Exit;
private System.Windows.Forms.Button btn_Login;
private System.Windows.Forms.TextBox txb_Pwd;
private System.Windows.Forms.TextBox txb_Account;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,120 @@
<?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>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,199 @@
<?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>
<metadata name="btn_LoadImage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btn_ManulTrigger.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>252, 17</value>
</metadata>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>137, 17</value>
</metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAw
CQAAAk1TRnQBSQFMAgEBAwEAAUABAgFAAQIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wkAAfQcAAdGGQAH1AUA
DzIDAAtGFQAB/wnUBAACMgteATIBUwIADUYUAAvUBAABMgteATIDAA1GEwAG1AHbBtQDAAIyBF4BTQRe
ATIBmgIABEYBAAVGAQAERhIABtQB/wbUBAABMgleATIDAARGARoBAANGAQAFRhEAAfMG1AH/BtQEAAGa
ATIDXgEyA14BMgH2AwAFRgGTAQABRgEABkYRAAHbBtQB/wbUAfQEAAEyA14BMgNeATIDAAdGAZMBAAdG
EQAB8w3UBgABMgJeATICXgEyBAAB/wZGAQABkwEABkYSAAbUAf8G1AYAATICXgFTAl4BMgUABUYBAAJG
AZMBAAVGEgAG1AH/BtQHAAEyA14BMgYABEYBAARGAZMBAARGEwAL1AgAATIBegFeAVkBMgYAAfINRhQA
ARkJ1AH/CQABMgFeATIIAA1GFgAH1AsAAzIJAAtGGQAB8wHbAfMOAAEyCwAB8gdGAf86AAH0AUYB/xYA
AUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8BAAH/AX8C/wH4AQ8CAAH4AQ8BgAEA
AeABAwIAAeABBwGAAQABwAEBAgAB4AEDAcABAQHAAQECAAHAAQEBwAEBAYQBEAIAAcABAQHgAQMBggEg
AgABgAEBAeABAwGBAUACAAGAAQAB8AEHAQABgAIAAYABAQH4AQ8BAQFAAgABwAEBAfgBDwGCASACAAHA
AQEB/AEfAYQBEAIAAeABAwH8AR8BgAEBAgAB4AEDAf4BPwHAAQECAAH4AQ8B/gE/AeABAwIAAf4BPwH/
AX8B8AEHAgAE/wH+AT8CAAs=
</value>
</data>
<metadata name="btn_Auto.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="cogRecordDisplay1.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAtwAAAAIB
AAAAAQAAAAAAAAAAAAAAAKIAAAAAAQAAiRIAAH4bAAATAAAAAAALAP//CwD//wsA//8DAAAAAAADAAEA
AAAFAAAAAAAAAAAABQAAAAAAAAAAAAUAAAAAAAAA8D8TAAAA/wALAP//CwD//xMAAIAAAAMAAwAAAAsA
//8LAAAAAAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8BAAAAAQAAAAsA//8LAAAACwAAAAsA
//8L
</value>
</data>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root>

View File

@@ -0,0 +1,416 @@
namespace
{
partial class FormSetParameter
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.txb_IP = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.textBox7 = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.textBox8 = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.textBox9 = new System.Windows.Forms.TextBox();
this.textBox10 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.textBox11 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.label13 = new System.Windows.Forms.Label();
this.textBox12 = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// txb_IP
//
this.txb_IP.Location = new System.Drawing.Point(541, 48);
this.txb_IP.Margin = new System.Windows.Forms.Padding(5);
this.txb_IP.Name = "txb_IP";
this.txb_IP.Size = new System.Drawing.Size(164, 30);
this.txb_IP.TabIndex = 4;
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 15F);
this.label1.Location = new System.Drawing.Point(20, 35);
this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(489, 47);
this.label1.TabIndex = 3;
this.label1.Text = "涂胶位置1体积上限:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(541, 119);
this.textBox1.Margin = new System.Windows.Forms.Padding(5);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(164, 30);
this.textBox1.TabIndex = 6;
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 15F);
this.label2.Location = new System.Drawing.Point(20, 119);
this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(489, 47);
this.label2.TabIndex = 5;
this.label2.Text = "涂胶位置1体积下限:";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(541, 192);
this.textBox2.Margin = new System.Windows.Forms.Padding(5);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(164, 30);
this.textBox2.TabIndex = 8;
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 15F);
this.label3.Location = new System.Drawing.Point(20, 205);
this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(480, 47);
this.label3.TabIndex = 7;
this.label3.Text = "涂胶位置2体积上限:";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(541, 276);
this.textBox3.Margin = new System.Windows.Forms.Padding(5);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(164, 30);
this.textBox3.TabIndex = 10;
//
// label4
//
this.label4.Font = new System.Drawing.Font("宋体", 15F);
this.label4.Location = new System.Drawing.Point(20, 283);
this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(489, 47);
this.label4.TabIndex = 9;
this.label4.Text = "涂胶位置2体积下限:";
//
// label5
//
this.label5.Font = new System.Drawing.Font("宋体", 15F);
this.label5.Location = new System.Drawing.Point(20, 349);
this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(489, 47);
this.label5.TabIndex = 11;
this.label5.Text = "涂胶位置3体积上限:";
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 15F);
this.label6.Location = new System.Drawing.Point(20, 416);
this.label6.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(489, 47);
this.label6.TabIndex = 12;
this.label6.Text = "涂胶位置3体积下限:";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(541, 349);
this.textBox4.Margin = new System.Windows.Forms.Padding(5);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(164, 30);
this.textBox4.TabIndex = 13;
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(541, 416);
this.textBox5.Margin = new System.Windows.Forms.Padding(5);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(164, 30);
this.textBox5.TabIndex = 14;
//
// label7
//
this.label7.Font = new System.Drawing.Font("宋体", 15F);
this.label7.Location = new System.Drawing.Point(895, 343);
this.label7.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(410, 47);
this.label7.TabIndex = 15;
this.label7.Text = "涂胶位置3面积上限:";
//
// label8
//
this.label8.Font = new System.Drawing.Font("宋体", 15F);
this.label8.Location = new System.Drawing.Point(895, 35);
this.label8.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(430, 47);
this.label8.TabIndex = 16;
this.label8.Text = "涂胶位置1面积上限:";
//
// label9
//
this.label9.Font = new System.Drawing.Font("宋体", 15F);
this.label9.Location = new System.Drawing.Point(895, 112);
this.label9.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(430, 47);
this.label9.TabIndex = 17;
this.label9.Text = "涂胶位置1面积下限:";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(1335, 48);
this.textBox6.Margin = new System.Windows.Forms.Padding(5);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(164, 30);
this.textBox6.TabIndex = 18;
//
// textBox7
//
this.textBox7.Location = new System.Drawing.Point(1335, 119);
this.textBox7.Margin = new System.Windows.Forms.Padding(5);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(164, 30);
this.textBox7.TabIndex = 19;
//
// label10
//
this.label10.Font = new System.Drawing.Font("宋体", 15F);
this.label10.Location = new System.Drawing.Point(895, 205);
this.label10.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(430, 47);
this.label10.TabIndex = 20;
this.label10.Text = "涂胶位置2面积上限:";
//
// textBox8
//
this.textBox8.Location = new System.Drawing.Point(1335, 205);
this.textBox8.Margin = new System.Windows.Forms.Padding(5);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(164, 30);
this.textBox8.TabIndex = 21;
//
// label11
//
this.label11.Font = new System.Drawing.Font("宋体", 15F);
this.label11.Location = new System.Drawing.Point(895, 276);
this.label11.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(410, 47);
this.label11.TabIndex = 22;
this.label11.Text = "涂胶位置2面积下限:";
//
// textBox9
//
this.textBox9.Location = new System.Drawing.Point(1335, 283);
this.textBox9.Margin = new System.Windows.Forms.Padding(5);
this.textBox9.Name = "textBox9";
this.textBox9.Size = new System.Drawing.Size(164, 30);
this.textBox9.TabIndex = 23;
//
// textBox10
//
this.textBox10.Location = new System.Drawing.Point(1335, 349);
this.textBox10.Margin = new System.Windows.Forms.Padding(5);
this.textBox10.Name = "textBox10";
this.textBox10.Size = new System.Drawing.Size(164, 30);
this.textBox10.TabIndex = 24;
//
// label12
//
this.label12.Font = new System.Drawing.Font("宋体", 15F);
this.label12.Location = new System.Drawing.Point(895, 416);
this.label12.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(430, 47);
this.label12.TabIndex = 25;
this.label12.Text = "涂胶位置3面积下限:";
//
// textBox11
//
this.textBox11.Location = new System.Drawing.Point(1335, 429);
this.textBox11.Margin = new System.Windows.Forms.Padding(5);
this.textBox11.Name = "textBox11";
this.textBox11.Size = new System.Drawing.Size(164, 30);
this.textBox11.TabIndex = 26;
//
// button1
//
this.button1.Location = new System.Drawing.Point(294, 615);
this.button1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(206, 69);
this.button1.TabIndex = 27;
this.button1.Text = "保存参数";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(864, 615);
this.button2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(191, 69);
this.button2.TabIndex = 28;
this.button2.Text = "读取参数";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label13.Location = new System.Drawing.Point(235, 540);
this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(187, 25);
this.label13.TabIndex = 29;
this.label13.Text = "标定参数范围:";
//
// textBox12
//
this.textBox12.Location = new System.Drawing.Point(659, 540);
this.textBox12.Margin = new System.Windows.Forms.Padding(4);
this.textBox12.Name = "textBox12";
this.textBox12.Size = new System.Drawing.Size(326, 30);
this.textBox12.TabIndex = 30;
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(1015, 544);
this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(19, 20);
this.label14.TabIndex = 31;
this.label14.Text = "%";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(30, 9);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(109, 20);
this.label15.TabIndex = 32;
this.label15.Text = "产品型号:";
//
// FormSetParameter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1580, 749);
this.Controls.Add(this.label15);
this.Controls.Add(this.label14);
this.Controls.Add(this.textBox12);
this.Controls.Add(this.label13);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox11);
this.Controls.Add(this.label12);
this.Controls.Add(this.textBox10);
this.Controls.Add(this.textBox9);
this.Controls.Add(this.label11);
this.Controls.Add(this.textBox8);
this.Controls.Add(this.label10);
this.Controls.Add(this.textBox7);
this.Controls.Add(this.textBox6);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.textBox5);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.label4);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label3);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label2);
this.Controls.Add(this.txb_IP);
this.Controls.Add(this.label1);
this.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(5);
this.Name = "FormSetParameter";
this.Text = "参数设置";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox txb_IP;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.TextBox textBox7;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox textBox8;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox textBox9;
private System.Windows.Forms.TextBox textBox10;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox textBox11;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox textBox12;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
}
}

View File

@@ -0,0 +1,97 @@
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace
{
public partial class FormSetParameter : Form
{
int count = 3;
string CSPath="D:\\阈值参数.txt";
string CS;
public FormSetParameter()
{
InitializeComponent();
}
private string _receiveString;
public string ReceiveString
{
get => _receiveString;
set
{
_receiveString = value;
if (label15 != null)
{
label15.Text = _receiveString.ToString();
CS = label15.Text;
CSPath = Path.Combine(@"D:\", $"{CS}.txt");
}
}
}
private void button1_Click(object sender, EventArgs e)
{
StreamWriter sw = new StreamWriter(CSPath);
sw.WriteLine(txb_IP.Text);
sw.WriteLine(textBox1.Text );
sw.WriteLine(textBox6.Text );
sw.WriteLine(textBox7.Text );//1位置
sw.WriteLine(textBox2.Text);
sw.WriteLine(textBox3.Text );
sw.WriteLine(textBox8.Text );
sw.WriteLine(textBox9.Text );//2位置
sw.WriteLine(textBox4.Text);
sw.WriteLine(textBox5.Text );
sw.WriteLine(textBox10.Text );
sw.WriteLine(textBox11.Text );
sw.WriteLine(textBox12.Text);
sw.Flush(); //文件流
sw.Close(); //最后要关闭写入状态
}
private void button2_Click(object sender, EventArgs e)
{
try
{
if (File.Exists(CSPath))
{
string[] lines = File.ReadAllLines(CSPath); // 读取所有行[^1]
if (lines.Length >= 1) txb_IP.Text = lines[0]; // 第一行数据
if (lines.Length >= 2) textBox1.Text = lines[1]; // 第二行数据
if (lines.Length >= 3) textBox6.Text = lines[2]; // 第三行数据
if (lines.Length >= 4) textBox7.Text = lines[3]; //
if (lines.Length >= 5) textBox2.Text = lines[4]; //
if (lines.Length >= 6) textBox3.Text = lines[5]; //
if (lines.Length >= 7) textBox8.Text = lines[6]; //
if (lines.Length >= 8) textBox9.Text = lines[7]; //
if (lines.Length >= 9) textBox4.Text = lines[8];
if (lines.Length >= 10) textBox5.Text = lines[9];
if (lines.Length >= 11) textBox10.Text = lines[10];
if (lines.Length >= 12) textBox11.Text = lines[11];
if (lines.Length >= 13) textBox12.Text = lines[12];
}
else
{
MessageBox.Show("文件不存在!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
catch (Exception ex)
{
MessageBox.Show($"发生错误:{ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@@ -0,0 +1,123 @@
<?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>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -0,0 +1,6 @@
namespace
{
internal class StatusChecker
{
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace .Form
{
class yuzhicanshu
{
}
}

View File

@@ -0,0 +1,153 @@
namespace
{
partial class FormCheck
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(335, 257);
this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(371, 23);
this.comboBox1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(93, 256);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(156, 20);
this.label1.TabIndex = 1;
this.label1.Text = "目前已有配方:";
//
// button1
//
this.button1.Location = new System.Drawing.Point(335, 329);
this.button1.Margin = new System.Windows.Forms.Padding(4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(160, 47);
this.button1.TabIndex = 2;
this.button1.Text = "切换配方";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(93, 88);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(114, 20);
this.label2.TabIndex = 3;
this.label2.Text = "添加配方:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(335, 83);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(371, 25);
this.textBox1.TabIndex = 4;
//
// button2
//
this.button2.Location = new System.Drawing.Point(339, 144);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(156, 41);
this.button2.TabIndex = 5;
this.button2.Text = "确定添加";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(561, 329);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(145, 47);
this.button3.TabIndex = 6;
this.button3.Text = "保存配方";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(539, 144);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(156, 41);
this.button4.TabIndex = 7;
this.button4.Text = "生成参数文件";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// FormCheck
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1128, 459);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBox1);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FormCheck";
this.Text = "切换配方";
this.Load += new System.EventHandler(this.FormCheck_Load_1);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
}
}

View File

@@ -0,0 +1,124 @@
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;
using System.IO;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Data;
using System.Text;
using System.Collections.Generic;
using Cognex.VisionPro;
using Cognex.VisionPro.QuickBuild;
using System.Drawing;
using System.Net.Sockets;
using System.Linq;
using System.Net;
using System.Runtime;
using Cognex.VisionPro.ToolBlock;
using Cognex.VisionPro.ToolGroup;
using Cognex.VisionPro3D;
using Cognex.VisionPro.ImageFile;
using Cognex.VisionPro.PMAlign;
using Cognex.VisionPro.CalibFix;
using S7.Net;
using Cognex.VisionPro.ImageProcessing;
using Timer = System.Windows.Forms.Timer;
using Newtonsoft.Json;
namespace
{
public partial class FormCheck : Form
{
private string _dateFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ComboBoxData.json");
public Action<string> TextBoxValueChanged;
private FormSetParameter _formSetParameter;
public FormCheck()
{
InitializeComponent();
this.Load += FormCheck_Load;
//InitComponent();
}
//private void InitComponent()
//{
// throw new NotImplementedException();
//}
private void FormCheck_Load(object sender, EventArgs e)
{
if (File.Exists(_dateFilePath))
{
String jsonContent=File.ReadAllText(_dateFilePath);
var items = JsonConvert.DeserializeObject<List<string>>(jsonContent);
if (items != null)
{
comboBox1.Items.AddRange(items.ToArray());
}
}
}
private void button1_Click(object sender, EventArgs e)
{
TextBoxValueChanged?.Invoke(comboBox1.Text);
_formSetParameter = new FormSetParameter();
_formSetParameter.Show();
_formSetParameter.ReceiveString = comboBox1.Text;
MessageBox.Show("切换作业完成");
}
private void button2_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(textBox1.Text))
{
comboBox1.Items.Add(textBox1.Text);
}
}
private void button3_Click(object sender, EventArgs e)
{
var items=new List<string>();
foreach (var item in comboBox1.Items)
{
items.Add(item.ToString());
}
string json=JsonConvert.SerializeObject(items,Formatting.Indented);
File.WriteAllText(_dateFilePath, json);
}
private void button4_Click(object sender, EventArgs e)
{
string fileName=textBox1.Text;
if (string.IsNullOrEmpty(fileName))
{
MessageBox.Show("请先输入产品型号!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
return;
}
string filePath=Path.Combine(@"D:\",$"{fileName}.txt");
try
{
using (File.Create(filePath)) { }
MessageBox.Show("生成参数文件完成");
}
catch(Exception ex)
{
MessageBox.Show("未知错误!");
}
}
private void FormCheck_Load_1(object sender, EventArgs e)
{
}
}
}

View File

@@ -0,0 +1,120 @@
<?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>

View File

@@ -0,0 +1,62 @@
namespace
{
partial class FormVPP
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.cogJobManagerEdit1 = new Cognex.VisionPro.QuickBuild.CogJobManagerEdit();
this.SuspendLayout();
//
// cogJobManagerEdit1
//
this.cogJobManagerEdit1.Dock = System.Windows.Forms.DockStyle.Fill;
this.cogJobManagerEdit1.Location = new System.Drawing.Point(0, 0);
this.cogJobManagerEdit1.Name = "cogJobManagerEdit1";
this.cogJobManagerEdit1.ShowLocalizationTab = false;
this.cogJobManagerEdit1.Size = new System.Drawing.Size(882, 514);
this.cogJobManagerEdit1.Subject = null;
this.cogJobManagerEdit1.TabIndex = 0;
//
// FormVPP
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(882, 514);
this.Controls.Add(this.cogJobManagerEdit1);
this.Name = "FormVPP";
this.Text = "FormVPP";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormVPP_FormClosed);
this.Load += new System.EventHandler(this.FormVPP_Load);
this.ResumeLayout(false);
}
#endregion
private Cognex.VisionPro.QuickBuild.CogJobManagerEdit cogJobManagerEdit1;
}
}

View File

@@ -0,0 +1,34 @@
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
{
public partial class FormVPP : Form
{
public FormVPP()
{
InitializeComponent();
}
private void FormVPP_Load(object sender, EventArgs e)
{
var mainForm = Application.OpenForms.OfType<Form1>().FirstOrDefault();
if (mainForm == null) return;
cogJobManagerEdit1.Subject = mainForm.myJobManager;
}
private void FormVPP_FormClosed(object sender, FormClosedEventArgs e)
{
var mainForm = Application.OpenForms.OfType<Form1>().FirstOrDefault();
if (mainForm == null) return;
mainForm.myJobManager = cogJobManagerEdit1.Subject;
}
}
}

View File

@@ -0,0 +1,120 @@
<?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>

View File

@@ -0,0 +1,75 @@
namespace
{
partial class Form_LoadingImage
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_LoadingImage));
this.timer_Display = new System.Windows.Forms.Timer(this.components);
this.label = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// timer_Display
//
this.timer_Display.Tick += new System.EventHandler(this.timer_Display_Tick);
//
// label
//
this.label.AutoSize = true;
this.label.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label.ForeColor = System.Drawing.Color.Blue;
this.label.Location = new System.Drawing.Point(69, 237);
this.label.Name = "label";
this.label.Size = new System.Drawing.Size(75, 20);
this.label.TabIndex = 0;
this.label.Text = "label1";
this.label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Form_LoadingImage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(800, 450);
this.ControlBox = false;
this.Controls.Add(this.label);
this.Name = "Form_LoadingImage";
this.Text = "软件正在启动";
this.Load += new System.EventHandler(this.Form_LoadingImage_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Timer timer_Display;
private System.Windows.Forms.Label label;
}
}

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace
{
public partial class Form_LoadingImage : Form
{
private const string flash = "软件正在启动中,请耐心等待!!!!!!!!!!!!!!!";
private int stopCount=flash.Length+300;
private int count = 0;
private bool finish=false;
public Form_LoadingImage()
{
InitializeComponent();
timer_Display.Start();
label.Text = "";
}
private void Form_LoadingImage_Load(object sender, EventArgs e)
{
}
private void timer_Display_Tick(object sender, EventArgs e)
{
if (finish == false)
{
label.Text += flash.Substring(count, 1); //逐个显示文字
}
//累加计数
count++;
if (count == flash.Length)
{
CheckProgramProcess();
finish = true;//文字显示完成
}
else if (count >= stopCount)
{
timer_Display.Stop();
this.Close();//关闭窗口
}
}
private bool CheckProgramProcess()
{
Process[] myProcesses = Process.GetProcessesByName(Application.ProductName);
if (myProcesses.Length > 1) //如果可以获取到本进程名大于1个则说明在此之前已经启动过
{
timer_Display.Stop();
MessageBox.Show("检测到程序已经运行,请先关闭多余的程序或进程!\n");
Application.Exit();//关闭
}
return true;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,226 @@
// 警告:某些程序集引用无法自动解析。这可能会导致某些部分反编译错误,
// 例如属性 getter/setter 访问。要获得最佳反编译结果,请手动将缺少的引用添加到加载的程序集列表中。
// LinDeVisionTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// LinDeVisionTask.ResultsDisplay
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Forms.Integration;
using Cognex.VisionPro;
using Cognex.VisionPro3D;
using ConVX.VXControl;
public class ResultsDisplay : UserControl
{
private Cog3DDisplayV2 cog3DDisplayV21;
private IContainer components = null;
private VXCircleLEDLight led_CurrentState;
private VXCircleLabel vxCircleLabel8;
private VXCircleLabel lbl_Result;
private Panel panel1;
private TableLayoutPanel tableLayoutPanel1;
private VXCircleLEDLight led_CurrentError;
private VXGroupBox groupBox1;
private ElementHost elementHost1;
public ResultsDisplay()
{
InitializeComponent();
cog3DDisplayV21 = new Cog3DDisplayV2();
cog3DDisplayV21.BackColor = Color.FromArgb(95, 95, 95);
elementHost1.Child = (UIElement)(object)cog3DDisplayV21;
DisplayData(Color.Gray, Color.Gray, "失败");
}
public void DisplayData(Color connectColor, Color statColor, string result)
{
if (base.InvokeRequired)
{
BeginInvoke((Action)delegate
{
DisplayData(connectColor, statColor, result);
});
}
else
{
((Control)(object)lbl_Result).Text = result.ToString();
led_CurrentState.LedColor = connectColor;
led_CurrentError.LedColor = statColor;
}
}
public void Display3DImage(Cog3DBox box, CogImage16Range TrainImage, CogImage16Range image)
{
if (base.InvokeRequired)
{
BeginInvoke((Action)delegate
{
Display3DImage(box, TrainImage, image);
});
return;
}
cog3DDisplayV21.Clear();
Cog3DBoxGraphic cog3DBoxGraphic = new Cog3DBoxGraphic(box);
cog3DBoxGraphic.Opacity = 0.5;
cog3DBoxGraphic.Color = CogColorConstants.Cyan;
cog3DBoxGraphic.DisplayState = Cog3DGraphicDisplayStateConstants.SurfaceWithWireFrame;
Cog3DRangeImageGraphic cog3DRangeImageGraphic = new Cog3DRangeImageGraphic(TrainImage);
cog3DRangeImageGraphic.Color = CogColorConstants.Green;
Cog3DRangeImageGraphic item = new Cog3DRangeImageGraphic(image);
cog3DDisplayV21.Add(item);
cog3DDisplayV21.Add(cog3DRangeImageGraphic);
cog3DDisplayV21.Add(cog3DBoxGraphic, cog3DRangeImageGraphic);
cog3DDisplayV21.BackColor = Color.FromArgb(95, 95, 95);
cog3DDisplayV21.FitView();
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Expected O, but got Unknown
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Expected O, but got Unknown
this.components = new System.ComponentModel.Container();
this.led_CurrentState = new VXCircleLEDLight();
this.vxCircleLabel8 = new VXCircleLabel();
this.lbl_Result = new VXCircleLabel();
this.panel1 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox1 = new VXGroupBox(this.components);
this.elementHost1 = new System.Windows.Forms.Integration.ElementHost();
this.led_CurrentError = new VXCircleLEDLight();
this.panel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.Windows.Forms.Control)(object)this.groupBox1).SuspendLayout();
base.SuspendLayout();
((System.Windows.Forms.Control)(object)this.led_CurrentState).Anchor = System.Windows.Forms.AnchorStyles.None;
((System.Windows.Forms.Control)(object)this.led_CurrentState).BackColor = System.Drawing.Color.FromArgb(52, 52, 52);
this.led_CurrentState.BorderWidth = 3;
this.led_CurrentState.FillText = "连接状态";
((System.Windows.Forms.Control)(object)this.led_CurrentState).Font = new System.Drawing.Font("微软雅黑", 12f);
this.led_CurrentState.LedColor = System.Drawing.Color.Gray;
((System.Windows.Forms.Control)(object)this.led_CurrentState).Location = new System.Drawing.Point(15, 4);
((System.Windows.Forms.Control)(object)this.led_CurrentState).Name = "led_CurrentState";
((System.Windows.Forms.Control)(object)this.led_CurrentState).Size = new System.Drawing.Size(111, 30);
((System.Windows.Forms.Control)(object)this.led_CurrentState).TabIndex = 38;
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).BackColor = System.Drawing.Color.Transparent;
this.vxCircleLabel8.BgColor = System.Drawing.Color.FromArgb(52, 52, 52);
this.vxCircleLabel8.BorderColor = System.Drawing.Color.Gray;
this.vxCircleLabel8.BorderWidth = 0;
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).Dock = System.Windows.Forms.DockStyle.Left;
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).Font = new System.Drawing.Font("微软雅黑", 12f);
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).ForeColor = System.Drawing.Color.White;
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).Location = new System.Drawing.Point(3, 78);
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).Name = "vxCircleLabel8";
this.vxCircleLabel8.Radius = 5;
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).Size = new System.Drawing.Size(136, 39);
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).TabIndex = 41;
((System.Windows.Forms.Control)(object)this.vxCircleLabel8).Text = "检测结果:";
((System.Windows.Forms.Label)(object)this.vxCircleLabel8).TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
((System.Windows.Forms.Control)(object)this.lbl_Result).Anchor = System.Windows.Forms.AnchorStyles.Left;
((System.Windows.Forms.Control)(object)this.lbl_Result).BackColor = System.Drawing.Color.Transparent;
this.lbl_Result.BgColor = System.Drawing.Color.FromArgb(52, 52, 52);
this.lbl_Result.BorderColor = System.Drawing.Color.Gray;
this.lbl_Result.BorderWidth = 1;
((System.Windows.Forms.Control)(object)this.lbl_Result).Font = new System.Drawing.Font("微软雅黑", 12f);
((System.Windows.Forms.Control)(object)this.lbl_Result).ForeColor = System.Drawing.Color.White;
((System.Windows.Forms.Control)(object)this.lbl_Result).Location = new System.Drawing.Point(145, 83);
((System.Windows.Forms.Control)(object)this.lbl_Result).Name = "lbl_Result";
this.lbl_Result.Radius = 5;
((System.Windows.Forms.Control)(object)this.lbl_Result).Size = new System.Drawing.Size(106, 29);
((System.Windows.Forms.Control)(object)this.lbl_Result).TabIndex = 42;
((System.Windows.Forms.Label)(object)this.lbl_Result).TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.panel1.Controls.Add(this.tableLayoutPanel1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(3, 585);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(592, 196);
this.panel1.TabIndex = 7;
this.tableLayoutPanel1.ColumnCount = 4;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.90572f));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.92593f));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25f));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25f));
this.tableLayoutPanel1.Controls.Add((System.Windows.Forms.Control)(object)this.led_CurrentError, 1, 0);
this.tableLayoutPanel1.Controls.Add((System.Windows.Forms.Control)(object)this.led_CurrentState, 0, 0);
this.tableLayoutPanel1.Controls.Add((System.Windows.Forms.Control)(object)this.lbl_Result, 1, 2);
this.tableLayoutPanel1.Controls.Add((System.Windows.Forms.Control)(object)this.vxCircleLabel8, 0, 2);
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 5;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20f));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20f));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20f));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20f));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20f));
this.tableLayoutPanel1.Size = new System.Drawing.Size(594, 196);
this.tableLayoutPanel1.TabIndex = 43;
((System.Windows.Forms.Control)(object)this.groupBox1).BackColor = System.Drawing.Color.FromArgb(52, 52, 52);
this.groupBox1.BorderColor = System.Drawing.Color.FromArgb(64, 64, 64);
((System.Windows.Forms.Control)(object)this.groupBox1).Controls.Add(this.elementHost1);
((System.Windows.Forms.Control)(object)this.groupBox1).Controls.Add(this.panel1);
((System.Windows.Forms.Control)(object)this.groupBox1).Dock = System.Windows.Forms.DockStyle.Fill;
((System.Windows.Forms.GroupBox)(object)this.groupBox1).FlatStyle = System.Windows.Forms.FlatStyle.Flat;
((System.Windows.Forms.Control)(object)this.groupBox1).Font = new System.Drawing.Font("微软雅黑", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
((System.Windows.Forms.Control)(object)this.groupBox1).ForeColor = System.Drawing.Color.White;
((System.Windows.Forms.Control)(object)this.groupBox1).Location = new System.Drawing.Point(0, 0);
((System.Windows.Forms.Control)(object)this.groupBox1).Name = "groupBox1";
((System.Windows.Forms.Control)(object)this.groupBox1).Size = new System.Drawing.Size(598, 784);
((System.Windows.Forms.Control)(object)this.groupBox1).TabIndex = 6;
((System.Windows.Forms.GroupBox)(object)this.groupBox1).TabStop = false;
((System.Windows.Forms.Control)(object)this.groupBox1).Text = "3D型号区分";
this.elementHost1.Dock = System.Windows.Forms.DockStyle.Fill;
this.elementHost1.Location = new System.Drawing.Point(3, 35);
this.elementHost1.Name = "elementHost1";
this.elementHost1.Size = new System.Drawing.Size(592, 550);
this.elementHost1.TabIndex = 5;
this.elementHost1.Text = "elementHost1";
this.elementHost1.Child = null;
((System.Windows.Forms.Control)(object)this.led_CurrentError).Anchor = System.Windows.Forms.AnchorStyles.None;
((System.Windows.Forms.Control)(object)this.led_CurrentError).BackColor = System.Drawing.Color.FromArgb(52, 52, 52);
this.led_CurrentError.BorderWidth = 3;
this.led_CurrentError.FillText = "测量状态";
((System.Windows.Forms.Control)(object)this.led_CurrentError).Font = new System.Drawing.Font("微软雅黑", 12f);
this.led_CurrentError.LedColor = System.Drawing.Color.Gray;
((System.Windows.Forms.Control)(object)this.led_CurrentError).Location = new System.Drawing.Point(163, 4);
((System.Windows.Forms.Control)(object)this.led_CurrentError).Name = "led_CurrentError";
((System.Windows.Forms.Control)(object)this.led_CurrentError).Size = new System.Drawing.Size(111, 30);
((System.Windows.Forms.Control)(object)this.led_CurrentError).TabIndex = 39;
base.AutoScaleDimensions = new System.Drawing.SizeF(9f, 18f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.Controls.Add((System.Windows.Forms.Control)(object)this.groupBox1);
base.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
base.Name = "ResultsDisplay";
base.Size = new System.Drawing.Size(598, 784);
this.panel1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
((System.Windows.Forms.Control)(object)this.groupBox1).ResumeLayout(false);
base.ResumeLayout(false);
}
}

View File

@@ -0,0 +1,346 @@
using HslCommunication;
using HslCommunication.ModBus;
using System;
using System.Linq;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
namespace
{
public class ModbusTcpClient : IDisposable
{
private readonly ModbusTcpNet modbus;
private readonly string ipAddress;
private readonly int port;
private bool _autoReconnect;
private int _reconnectInterval = 5000;
private CancellationTokenSource _reconnectToken;
private bool _isConnected; // 自定义连接状态字段
public event EventHandler<bool> ConnectionStatusChanged;
public event EventHandler<string> ErrorOccurred;
public event EventHandler<string> DataReceived;
public event EventHandler<string> DataSent;
public ModbusTcpClient(string ip, int port = 502)
{
if (string.IsNullOrEmpty(ip)) ip = "192.168.1.30";
if (port < 1 || port > 65535) port = 502;
this.ipAddress = ip;
this.port = port;
modbus = new ModbusTcpNet(ip, port, 1)
{
ConnectTimeOut = 3000,
ReceiveTimeOut = 5000
};
}
#region
public bool IsConnected => _isConnected;
public OperateResult Connect()
{
try
{
OperateResult result = modbus.ConnectServer();
_isConnected = result.IsSuccess; // 更新连接状态
ConnectionStatusChanged?.Invoke(this, _isConnected);
return result;
}
catch (Exception ex)
{
ErrorOccurred?.Invoke(this, $"连接失败: {ex.Message}");
_isConnected = false;
return new OperateResult(ex.Message);
}
}
public void Disconnect()
{
modbus.ConnectClose();
_isConnected = false;
ConnectionStatusChanged?.Invoke(this, false);
}
#endregion
#region
public OperateResult<short> ReadHoldingRegister(ushort address)
{
string modbusAddress = address.ToString();
Func<string, ushort, OperateResult<short>> readFunc =
(addr, _) => modbus.ReadInt16(addr); // 忽略长度参数
return Read<short>(modbusAddress, 1, readFunc);
}
public OperateResult<short[]> ReadHoldingRegisters(ushort address, ushort count)
{
string modbusAddress = address.ToString();
return Read<short[]>(modbusAddress, count, (addr, cnt) => modbus.ReadInt16(addr, cnt));
}
/// <summary>
/// 写入单个保持寄存器
/// </summary>
public OperateResult WriteSingleRegister(string address, short value)
{
if (!IsConnected) return new OperateResult("设备未连接");
try
{
OperateResult result = modbus.Write(address, value);
HandleWriteResult(result);
return result;
}
catch (Exception ex)
{
HandleWriteException(ex);
return new OperateResult(ex.Message);
}
}
public OperateResult WriteSingleRegisterString(string address, string value)
{
if (!IsConnected) return new OperateResult("设备未连接");
try
{
OperateResult result = modbus.Write(address, value);
HandleWriteResult(result);
return result;
}
catch (Exception ex)
{
HandleWriteException(ex);
return new OperateResult(ex.Message);
}
}
/// <summary>
/// 批量写入保持寄存器
/// </summary>
public OperateResult WriteMultipleRegisters(string address, short[] values)
{
if (!IsConnected) return new OperateResult("设备未连接");
try
{
OperateResult result = modbus.Write(address, values);
HandleWriteResult(result);
return result;
}
catch (Exception ex)
{
HandleWriteException(ex);
return new OperateResult(ex.Message);
}
}
/// <summary>
/// 写入32位浮点数占用两个寄存器
/// </summary>
public OperateResult WriteFloat(string address, float value)
{
try
{
byte[] bytes = BitConverter.GetBytes(value);
return WriteMultipleRegisters(address, new[] {
BitConverter.ToInt16(bytes, 0),
BitConverter.ToInt16(bytes, 2)
});
}
catch (Exception ex)
{
HandleWriteException(ex);
return new OperateResult(ex.Message);
}
}
public async Task<OperateResult<short[]>> ReadHoldingRegisterAsync(ushort address,ushort length)
{
return await Task.Run(() => ReadHoldingRegisters(address,length));
}
public async Task<OperateResult> WriteHoldingRegisterAsync(string address,short value)
{
return await Task.Run(() => WriteSingleRegister(address, value));
}
#region
private void HandleWriteResult(OperateResult result)
{
if (!result.IsSuccess)
{
ErrorOccurred?.Invoke(this, $"写入失败: {result.Message}");
_isConnected = false;
}
}
private void HandleWriteException(Exception ex)
{
_isConnected = false;
ErrorOccurred?.Invoke(this, $"写入操作异常: {ex.Message}");
}
#endregion
#endregion
#region
private OperateResult<T> Read<T>(string address, ushort count, Func<string, ushort, OperateResult<T>> readFunc)
{
if (!IsConnected) return new OperateResult<T>("设备未连接");
try
{
var result = readFunc(address, count);
if (!result.IsSuccess)
{
ErrorOccurred?.Invoke(this, $"读取失败: {result.Message}");
}
else
{
// 仅记录有效数据内容(无需序列化整个对象)
string dataString = GetDataString(result.Content);
DataReceived?.Invoke(this, $"地址:{address} 接收数据:{dataString}");
}
return result;
}
catch (Exception ex)
{
_isConnected = false;
ErrorOccurred?.Invoke(this, $"读取异常: {ex.Message}");
return new OperateResult<T>(ex.Message);
}
}
// 数据格式化辅助方法
private string GetDataString(object data)
{
if (data is short[] shortArray)
return string.Join(", ", shortArray.Select(s => s.ToString()));
if (data is short shortValue)
return shortValue.ToString();
if (data is byte[] bytes)
return BitConverter.ToString(bytes);
return data?.ToString() ?? "空数据";
}
private OperateResult Write<T>(string address, object value)
{
if (!IsConnected) return new OperateResult("设备未连接");
try
{
switch (value)
{
case short sVal:
DataSent?.Invoke(this, $"地址:{address} 发送数据:{value}");
return WriteSingleRegister(address, sVal);
case short[] arrVal:
DataSent?.Invoke(this, $"地址:{address} 发送数据:{value}");
return WriteMultipleRegisters(address, arrVal);
case float fVal:
DataSent?.Invoke(this, $"地址:{address} 发送数据:{value}");
return WriteFloat(address, fVal);
default:
ErrorOccurred?.Invoke(this, $"不支持的数据类型: {value.GetType()}");
return new OperateResult($"Unsupported type: {value.GetType()}");
}
}
catch (Exception ex)
{
_isConnected = false; // 发生异常时标记为断开
ErrorOccurred?.Invoke(this, $"写入异常: {ex.Message}");
return new OperateResult(ex.Message);
}
}
#endregion
#region
public bool AutoReconnect
{
get => _autoReconnect;
set
{
if (_autoReconnect == value) return;
_autoReconnect = value;
if (value) StartReconnectMonitor();
else StopReconnectMonitor();
}
}
private async void StartReconnectMonitor()
{
_reconnectToken = new CancellationTokenSource();
while (!_reconnectToken.IsCancellationRequested)
{
await Task.Delay(_reconnectInterval, _reconnectToken.Token);
// 通过心跳检测验证连接状态
if (!await CheckConnectionAsync())
{
ErrorOccurred?.Invoke(this, "尝试自动重连...");
await ConnectAsync();
}
}
}
private async Task<bool> CheckConnectionAsync()
{
try
{
// 通过读取一个寄存器验证连接
var result = await Task.Run(() => modbus.ReadInt16("1", 1));
_isConnected = result.IsSuccess;
return _isConnected;
}
catch
{
_isConnected = false;
return false;
}
}
private void StopReconnectMonitor()
{
_reconnectToken?.Cancel();
_reconnectToken?.Dispose();
_reconnectToken = null;
}
public async Task<OperateResult> ConnectAsync()
{
try
{
return await Task.Run(() => Connect());
}
catch (Exception ex)
{
return new OperateResult(ex.Message);
}
}
public int ReconnectInterval
{
get => _reconnectInterval;
set => _reconnectInterval = value;
}
#endregion
#region
public void Dispose()
{
AutoReconnect = false;
modbus?.ConnectClose();
modbus?.Dispose();
_reconnectToken?.Dispose();
GC.SuppressFinalize(this);
}
#endregion
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form_LoadingImage());
Application.Run(new Form1());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("精工涂胶检测项目")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("精工涂胶检测项目")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("10c424d2-36a1-4d94-a034-a6801a1b17b5")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace .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("精工涂胶检测项目.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;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?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>

View File

@@ -0,0 +1,145 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace .Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.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;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string TcpIP {
get {
return ((string)(this["TcpIP"]));
}
set {
this["TcpIP"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string TcpProt {
get {
return ((string)(this["TcpProt"]));
}
set {
this["TcpProt"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string PlcIP {
get {
return ((string)(this["PlcIP"]));
}
set {
this["PlcIP"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string PlcRack {
get {
return ((string)(this["PlcRack"]));
}
set {
this["PlcRack"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string PlcType {
get {
return ((string)(this["PlcType"]));
}
set {
this["PlcType"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string TcpStatus {
get {
return ((string)(this["TcpStatus"]));
}
set {
this["TcpStatus"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("192.168.1.30")]
public string ModbusIP {
get {
return ((string)(this["ModbusIP"]));
}
set {
this["ModbusIP"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("502")]
public string ModbusPort {
get {
return ((string)(this["ModbusPort"]));
}
set {
this["ModbusPort"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string PlcSlot {
get {
return ((string)(this["PlcSlot"]));
}
set {
this["PlcSlot"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Collections.Specialized.StringCollection ComboBoxItems {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["ComboBoxItems"]));
}
set {
this["ComboBoxItems"] = value;
}
}
}
}

View File

@@ -0,0 +1,37 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="精工涂胶检测项目.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="TcpIP" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="TcpProt" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="PlcIP" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="PlcRack" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="PlcType" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="TcpStatus" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="ModbusIP" Type="System.String" Scope="User">
<Value Profile="(Default)">192.168.1.30</Value>
</Setting>
<Setting Name="ModbusPort" Type="System.String" Scope="User">
<Value Profile="(Default)">502</Value>
</Setting>
<Setting Name="PlcSlot" Type="System.String" Scope="User">
<Value Profile="(Default)">
</Value>
</Setting>
<Setting Name="ComboBoxItems" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,275 @@
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Linq;
using System.Threading;
namespace
{
// 自定义事件参数类
public class ClientConnectedEventArgs : EventArgs
{
public string ClientId { get; }
public IPEndPoint RemoteEndPoint { get; }
public ClientConnectedEventArgs(TcpClient client)
{
ClientId = client.Client.RemoteEndPoint?.ToString();
RemoteEndPoint = (IPEndPoint)client.Client.RemoteEndPoint;
}
}
public class DataReceivedEventArgs : EventArgs
{
public string ClientId { get; }
public byte[] Data { get; }
public DataReceivedEventArgs(string clientId, byte[] data)
{
ClientId = clientId;
Data = data;
}
}
public class DataSendEventArgs : EventArgs
{
public DataSendEventArgs()
{
}
}
public class TCPClass:IDisposable
{
// 服务器端成员
private TcpListener _server;
private readonly object _clientsLock = new object();
private List<TcpClient> _connectedClients = new List<TcpClient>();
private string _tcpStatus;
// 客户端成员
private TcpClient _client;
private NetworkStream _clientStream;
//公共成员
public string TcpStatus
{
get
{
return _tcpStatus;
}
}
public bool IsConnected => _client?.Connected == true;
public event EventHandler<string> ServerStatusChanged;
// 公共事件
public event EventHandler<ClientConnectedEventArgs> ClientConnected;
public event EventHandler<string> ClientDisconnected;
public event EventHandler<DataReceivedEventArgs> DataReceived;
private CancellationTokenSource _serverCts;
private bool _disposed = false;
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
StopServer();
_clientStream?.Dispose();
_client?.Dispose();
_server?.Stop();
}
_disposed = true;
}
}
#region
public async Task StartServerAsync(int port)
{
_tcpStatus = "Server";
_server = new TcpListener(IPAddress.Any, port);
_server.Start();
OnServerStatusChanged($"服务器已启动,监听端口:{port}"); // 非阻塞通知
while (true)
{
var client = await _server.AcceptTcpClientAsync();
lock (_clientsLock)
{
_connectedClients.Add(client);
}
OnClientConnected(client);
_ = HandleClientAsync(client);
}
}
// 广播给所有客户端
public async Task BroadcastAsync(byte[] data)
{
List<TcpClient> clientsCopy;
lock (_clientsLock)
{
_connectedClients.RemoveAll(c => !c.Connected);
clientsCopy = new List<TcpClient>(_connectedClients);
}
foreach (var client in clientsCopy)
{
try
{
if (client.Connected)
{
await SendToClientAsync(client, data);
}
}
catch (Exception ex)
{
OnServerStatusChanged($"发送失败: {ex.Message}");
}
}
}
private async Task HandleClientAsync(TcpClient client)
{
var stream = client.GetStream();
var buffer = new byte[4096];
var clientId = client.Client.RemoteEndPoint?.ToString();
try
{
while (true)
{
int bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length);
if (bytesRead == 0) break;
var data = new byte[bytesRead];
Array.Copy(buffer, data, bytesRead);
OnDataReceived(clientId, data);
}
}
finally
{
lock (_clientsLock)
{
_connectedClients.Remove(client);
}
client.Dispose();
OnClientDisconnected(clientId);
}
}
public async Task SendToClientAsync(TcpClient client, byte[] data)
{
var stream = client.GetStream();
await stream.WriteAsync(data, 0, data.Length);
}
public void StopServer()
{
_server?.Stop();
lock (_clientsLock)
{
foreach (var client in _connectedClients)
{
client.Dispose();
}
_connectedClients.Clear();
}
}
#endregion
#region
public async Task ConnectAsync(string ip, int port)
{
var mainForm = Application.OpenForms.OfType<Form1>().FirstOrDefault();
if (mainForm == null) return;
_tcpStatus = "Client";
_client = new TcpClient();
await _client.ConnectAsync(ip, port);
mainForm.AddLog($"客户端已连接主机IP{ip},主机端口:{port}", 0);
_clientStream = _client.GetStream();
_ = ReceiveDataAsync();
}
private async Task ReceiveDataAsync()
{
var buffer = new byte[4096];
try
{
while (true)
{
int bytesRead = await _clientStream.ReadAsync(buffer, 0, buffer.Length);
if (bytesRead == 0) break;
var data = new byte[bytesRead];
Array.Copy(buffer, data, bytesRead);
OnDataReceived("Server", data);
}
}
catch
{
Disconnect();
}
}
public async Task SendAsync(byte[] data)
{
if (_client?.Connected == true)
{
await _clientStream.WriteAsync(data, 0, data.Length);
}
}
public void Disconnect()
{
try
{
_clientStream?.Close();
_client?.Close();
OnClientDisconnected("Client");
}
catch (Exception ex)
{
OnServerStatusChanged($"断开异常: {ex.Message}");
}
}
#endregion
#region
protected virtual void OnClientConnected(TcpClient client)
{
ClientConnected?.Invoke(this, new ClientConnectedEventArgs(client));
}
protected virtual void OnClientDisconnected(string clientId)
{
ClientDisconnected?.Invoke(this, clientId);
}
protected virtual void OnDataReceived(string clientId, byte[] data)
{
DataReceived?.Invoke(this, new DataReceivedEventArgs(clientId, data));
}
protected virtual void OnServerStatusChanged(string message)
{
ServerStatusChanged?.Invoke(this, message);
}
#endregion
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HslCommunication" version="12.3.1" targetFramework="net481" />
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1001" targetFramework="net481" />
<package id="Microsoft.VisualBasic" version="10.3.0" targetFramework="net481" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net481" />
<package id="S7netplus" version="0.20.0" targetFramework="net481" />
<package id="System.Buffers" version="4.6.1" targetFramework="net481" />
<package id="System.Memory" version="4.6.3" targetFramework="net481" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net481" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net481" />
</packages>

View File

@@ -0,0 +1,565 @@
<?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>{10C424D2-36A1-4D94-A034-A6801A1B17B5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>精工涂胶检测项目</RootNamespace>
<AssemblyName>精工涂胶检测项目</AssemblyName>
<TargetFrameworkVersion>v4.8.1</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cognex.Vision.Core.Net">
<HintPath>C:\Program Files\Cognex\VisionPro\bin\Cognex.Vision.Core.Net.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.AutoSelect, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.AutoSelect.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Blob, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Blob.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Blob.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Blob.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CAD, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CAD.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CalibFix, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CalibFix.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CalibFix.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CalibFix.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CalibFixPlus, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CalibFixPlus.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Caliper, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Caliper.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Caliper.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Caliper.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CNLSearch, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CNLSearch.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CNLSearch.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CNLSearch.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ColorExtractor, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ColorExtractor.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ColorExtractor.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ColorExtractor.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ColorMatch, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ColorMatch.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ColorMatch.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ColorMatch.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ColorSegmenter, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ColorSegmenter.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ColorSegmenter.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ColorSegmenter.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Comm, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Comm.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Comm.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Comm.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CompositeColorMatch, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CompositeColorMatch.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CompositeColorMatch.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CompositeColorMatch.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Core, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.CorePlus, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.CorePlus.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Database, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Database.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Dimensioning, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Dimensioning.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Dimensioning.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Dimensioning.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Display.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Display.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.EdgeInspect, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.EdgeInspect.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.EdgeInspect.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.EdgeInspect.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.FG1394DCAM, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.FG1394DCAM.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.FGGigE, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.FGGigE.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.GenTL, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.GenTL.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ID, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ID.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ID.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ID.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ImageFile, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ImageFile.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ImageFile.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ImageFile.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ImageProcessing, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ImageProcessing.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ImageProcessing.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ImageProcessing.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ImagingDevice, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ImagingDevice.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Inspection, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Inspection.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Inspection.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Inspection.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Interop.Core, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Interop.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.LineMax, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.LineMax.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.LineMax.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.LineMax.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.LinescanDistortionCorrection, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.LinescanDistortionCorrection.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.LinescanDistortionCorrection.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.LinescanDistortionCorrection.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.OC, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.OC.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.OCRMax, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.OCRMax.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.OCRMax.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.OCRMax.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.OCVMax, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.OCVMax.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.OCVMax.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.OCVMax.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PatInspect, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PatInspect.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PatInspect.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PatInspect.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PixelMap, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PixelMap.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PixelMap.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PixelMap.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PMAlign, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PMAlign.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PMAlign.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PMAlign.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PMRedLine, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PMRedLine.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PMRedLine.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.PMRedLine.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.QuickBuild.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.QuickBuild.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.QuickBuild.Core, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.QuickBuild.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.QuickBuild.IO, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.QuickBuild.IO.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ResultsAnalysis, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ResultsAnalysis.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ResultsAnalysis.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ResultsAnalysis.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.SearchMax, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.SearchMax.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.SearchMax.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.SearchMax.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.SurfaceFX, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.SurfaceFX.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.SurfaceFX.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.SurfaceFX.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ToolGroup, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ToolGroup.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ToolGroup.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.ToolGroup.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Trevista, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Trevista.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Trevista.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro.Trevista.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro3D, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro3D.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro3D.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro3D.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro3D.Core, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro3D.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro3D.Display.Controls, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro3D.Display.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro3D.Graphic, Version=89.0.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Cognex\VisionPro\ReferencedAssemblies\Cognex.VisionPro3D.Graphic.dll</HintPath>
</Reference>
<Reference Include="HslCommunication, Version=12.3.1.0, Culture=neutral, PublicKeyToken=3d72ad3b6b5ec0e3, processorArchitecture=MSIL">
<HintPath>..\packages\HslCommunication.12.3.1\lib\net451\HslCommunication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="S7.Net, Version=0.20.0.0, Culture=neutral, PublicKeyToken=d5812d469e84c693, processorArchitecture=MSIL">
<HintPath>..\packages\S7netplus.0.20.0\lib\net462\S7.Net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<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="AppConstants.cs" />
<Compile Include="EditableListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="FormCheck.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormCheck.Designer.cs">
<DependentUpon>FormCheck.cs</DependentUpon>
</Compile>
<Compile Include="FormVPP.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormVPP.Designer.cs">
<DependentUpon>FormVPP.cs</DependentUpon>
</Compile>
<Compile Include="Form\FormLogin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form\FormLogin.designer.cs">
<DependentUpon>FormLogin.cs</DependentUpon>
</Compile>
<Compile Include="Form\FormSetParameter.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form\FormSetParameter.Designer.cs">
<DependentUpon>FormSetParameter.cs</DependentUpon>
</Compile>
<Compile Include="Form\FormCommunication.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form\FormCommunication.Designer.cs">
<DependentUpon>FormCommunication.cs</DependentUpon>
</Compile>
<Compile Include="Form\FormMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form\FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon>
</Compile>
<Compile Include="Form\StatusChecker.cs" />
<Compile Include="Form_LoadingImage.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form_LoadingImage.Designer.cs">
<DependentUpon>Form_LoadingImage.cs</DependentUpon>
</Compile>
<Compile Include="ModbusTcpClass.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TCPClass.cs" />
<EmbeddedResource Include="FormCheck.resx">
<DependentUpon>FormCheck.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormVPP.resx">
<DependentUpon>FormVPP.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form\FormLogin.resx">
<DependentUpon>FormLogin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form\FormCommunication.resx">
<DependentUpon>FormCommunication.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form\FormMain.resx">
<DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form\FormSetParameter.resx">
<DependentUpon>FormSetParameter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form_LoadingImage.resx">
<DependentUpon>Form_LoadingImage.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="packages.config" />
<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>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<COMReference Include="ACTIVEXLib">
<Guid>{012F24C1-35B0-11D0-BF2D-0000E8D0D146}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="Microsoft.Office.Core">
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>8</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="Microsoft.Office.Interop.Access.Dao">
<Guid>{4AC9E1DA-5BAD-4AC7-86E3-24F4CDCECA28}</Guid>
<VersionMajor>12</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>