Commit 7dd17650 LN

新增项目

1 个父辈 4bc7bbd9
正在显示 103 个修改的文件 包含 4776 行增加49 行删除
...@@ -123,32 +123,9 @@ ...@@ -123,32 +123,9 @@
<Compile Include="DeviceLibrary\IOManager.cs" /> <Compile Include="DeviceLibrary\IOManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="theMachine\SoundsController.cs" /> <Compile Include="theMachine\SoundsController.cs" />
<Compile Include="userControl\AxisMoveControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="userControl\AxisMoveControl.Designer.cs">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</Compile>
<Compile Include="userControl\AxisTipControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="userControl\AxisTipControl.Designer.cs">
<DependentUpon>AxisTipControl.cs</DependentUpon>
</Compile>
<Compile Include="userControl\ToucDownBtn.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="WindowManager.cs" /> <Compile Include="WindowManager.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="userControl\AxisMoveControl.resx">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="userControl\AxisTipControl.resx">
<DependentUpon>AxisTipControl.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj"> <ProjectReference Include="..\Common\Common.csproj">
<Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project> <Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project>
<Name>Common</Name> <Name>Common</Name>
......
...@@ -10,7 +10,7 @@ using System.Threading; ...@@ -10,7 +10,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace TheMachine namespace DeviceLibrary
{ {
public class WindowManager public class WindowManager
{ {
......
...@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImgCheckReel", "ImgCheckRee ...@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImgCheckReel", "ImgCheckRee
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeConfigKey", "ChangeConfigKey\ChangeConfigKey.csproj", "{595AEE30-1B33-4C17-BA74-4AA13AC0DF55}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeConfigKey", "ChangeConfigKey\ChangeConfigKey.csproj", "{595AEE30-1B33-4C17-BA74-4AA13AC0DF55}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheMachineNView", "TheMachineNView\TheMachineNView.csproj", "{9C690CB5-09AD-434E-A8EB-D5FA0A72B7C7}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -45,6 +47,10 @@ Global ...@@ -45,6 +47,10 @@ Global
{595AEE30-1B33-4C17-BA74-4AA13AC0DF55}.Debug|Any CPU.Build.0 = Debug|Any CPU {595AEE30-1B33-4C17-BA74-4AA13AC0DF55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{595AEE30-1B33-4C17-BA74-4AA13AC0DF55}.Release|Any CPU.ActiveCfg = Release|Any CPU {595AEE30-1B33-4C17-BA74-4AA13AC0DF55}.Release|Any CPU.ActiveCfg = Release|Any CPU
{595AEE30-1B33-4C17-BA74-4AA13AC0DF55}.Release|Any CPU.Build.0 = Release|Any CPU {595AEE30-1B33-4C17-BA74-4AA13AC0DF55}.Release|Any CPU.Build.0 = Release|Any CPU
{9C690CB5-09AD-434E-A8EB-D5FA0A72B7C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C690CB5-09AD-434E-A8EB-D5FA0A72B7C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C690CB5-09AD-434E-A8EB-D5FA0A72B7C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C690CB5-09AD-434E-A8EB-D5FA0A72B7C7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -40,8 +40,8 @@ namespace TheMachine ...@@ -40,8 +40,8 @@ namespace TheMachine
this.lblSensor = new System.Windows.Forms.Label(); this.lblSensor = new System.Windows.Forms.Label();
this.btnAxisRStop = new System.Windows.Forms.Button(); this.btnAxisRStop = new System.Windows.Forms.Button();
this.btnAxisRTest = new System.Windows.Forms.Button(); this.btnAxisRTest = new System.Windows.Forms.Button();
this.axisMoveControl1 = new DeviceLibrary.AxisMoveControl(); this.axisMoveControl1 = new AxisMoveControl();
this.configControl1 = new TheMachine.ConfigControl(); this.configControl1 = new ConfigControl();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.colorDialog1 = new System.Windows.Forms.ColorDialog(); this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
...@@ -193,7 +193,7 @@ namespace TheMachine ...@@ -193,7 +193,7 @@ namespace TheMachine
#endregion #endregion
private DeviceLibrary.AxisMoveControl axisMoveControl1; private AxisMoveControl axisMoveControl1;
private ConfigControl configControl1; private ConfigControl configControl1;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnAxisRStop; private System.Windows.Forms.Button btnAxisRStop;
......
 
namespace TheMachine namespace TheMachine
{ {
partial class Form1 partial class FrmMain
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
...@@ -29,7 +29,7 @@ namespace TheMachine ...@@ -29,7 +29,7 @@ namespace TheMachine
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.设备操作ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.设备操作ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
......
...@@ -19,9 +19,9 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel; ...@@ -19,9 +19,9 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
namespace TheMachine namespace TheMachine
{ {
public partial class Form1 : Form public partial class FrmMain : Form
{ {
public Form1() public FrmMain()
{ {
CheckForIllegalCrossThreadCalls = false; CheckForIllegalCrossThreadCalls = false;
crc.OpenResourceLog = true; crc.OpenResourceLog = true;
......
...@@ -32,12 +32,12 @@ namespace TheMachine ...@@ -32,12 +32,12 @@ namespace TheMachine
this.btn_linerun = new System.Windows.Forms.Button(); this.btn_linerun = new System.Windows.Forms.Button();
this.btn_linerev = new System.Windows.Forms.Button(); this.btn_linerev = new System.Windows.Forms.Button();
this.btn_linestop = new System.Windows.Forms.Button(); this.btn_linestop = new System.Windows.Forms.Button();
this.cylinderButton5 = new TheMachine.CylinderButton(); this.cylinderButton5 = new CylinderButton();
this.cylinderButton4 = new TheMachine.CylinderButton(); this.cylinderButton4 = new CylinderButton();
this.cylinderButton2 = new TheMachine.CylinderButton(); this.cylinderButton2 = new CylinderButton();
this.cylinderButton7 = new TheMachine.CylinderButton(); this.cylinderButton7 = new CylinderButton();
this.cylinderButton6 = new TheMachine.CylinderButton(); this.cylinderButton6 = new CylinderButton();
this.ioControl1 = new TheMachine.IOControl(); this.ioControl1 = new IOControl();
this.btn_flipopen = new System.Windows.Forms.Button(); this.btn_flipopen = new System.Windows.Forms.Button();
this.btn_flipclose = new System.Windows.Forms.Button(); this.btn_flipclose = new System.Windows.Forms.Button();
this.btn_stringdooropen = new System.Windows.Forms.Button(); this.btn_stringdooropen = new System.Windows.Forms.Button();
......
...@@ -49,7 +49,7 @@ namespace TheMachine ...@@ -49,7 +49,7 @@ namespace TheMachine
Config.LoadMyConfig(new Setting_Init().GetType()); Config.LoadMyConfig(new Setting_Init().GetType());
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new FrmMain());
} }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
......
...@@ -37,8 +37,8 @@ namespace TheMachine ...@@ -37,8 +37,8 @@ namespace TheMachine
this.tp = new System.Windows.Forms.TableLayoutPanel(); this.tp = new System.Windows.Forms.TableLayoutPanel();
this.cb_usefixpos = new System.Windows.Forms.CheckBox(); this.cb_usefixpos = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.uC_LedConfig1 = new TheMachine.UC_LedConfig(); this.uC_LedConfig1 = new UC_LedConfig();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword(); this.uC_SetUserPassword1 = new UC_SetUserPassword();
this.tp.SuspendLayout(); this.tp.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using ConfigHelper; using ConfigHelper;
using DeviceLibrary; using DeviceLibrary;
using OnlineStore; using OnlineStore;
using OnlineStore.ACSingleStore;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
......
...@@ -67,6 +67,10 @@ ...@@ -67,6 +67,10 @@
<Reference Include="halcondotnet"> <Reference Include="halcondotnet">
<HintPath>..\DLL\halcondotnet.dll</HintPath> <HintPath>..\DLL\halcondotnet.dll</HintPath>
</Reference> </Reference>
<Reference Include="HuichuanLibrary, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DLL\HuichuanLibrary.dll</HintPath>
</Reference>
<Reference Include="log4net"> <Reference Include="log4net">
<HintPath>..\DLL\log4net.dll</HintPath> <HintPath>..\DLL\log4net.dll</HintPath>
</Reference> </Reference>
...@@ -100,11 +104,11 @@ ...@@ -100,11 +104,11 @@
<Compile Include="AxisControl.Designer.cs"> <Compile Include="AxisControl.Designer.cs">
<DependentUpon>AxisControl.cs</DependentUpon> <DependentUpon>AxisControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Form1.cs"> <Compile Include="FrmMain.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="FrmMain.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="IOControls.cs"> <Compile Include="IOControls.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
...@@ -183,6 +187,21 @@ ...@@ -183,6 +187,21 @@
<Compile Include="UC\UC_SetUserPassword.designer.cs"> <Compile Include="UC\UC_SetUserPassword.designer.cs">
<DependentUpon>UC_SetUserPassword.cs</DependentUpon> <DependentUpon>UC_SetUserPassword.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="userControl\AxisMoveControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="userControl\AxisMoveControl.Designer.cs">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</Compile>
<Compile Include="userControl\AxisTipControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="userControl\AxisTipControl.Designer.cs">
<DependentUpon>AxisTipControl.cs</DependentUpon>
</Compile>
<Compile Include="userControl\ToucDownBtn.cs">
<SubType>Component</SubType>
</Compile>
<EmbeddedResource Include="AboutBox1.resx"> <EmbeddedResource Include="AboutBox1.resx">
<DependentUpon>AboutBox1.cs</DependentUpon> <DependentUpon>AboutBox1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -190,8 +209,8 @@ ...@@ -190,8 +209,8 @@
<DependentUpon>AxisControl.cs</DependentUpon> <DependentUpon>AxisControl.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="FrmMain.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="IOControls.resx"> <EmbeddedResource Include="IOControls.resx">
<DependentUpon>IOControls.cs</DependentUpon> <DependentUpon>IOControls.cs</DependentUpon>
...@@ -239,6 +258,12 @@ ...@@ -239,6 +258,12 @@
<EmbeddedResource Include="UC\UC_SetUserPassword.resx"> <EmbeddedResource Include="UC\UC_SetUserPassword.resx">
<DependentUpon>UC_SetUserPassword.cs</DependentUpon> <DependentUpon>UC_SetUserPassword.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="userControl\AxisMoveControl.resx">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="userControl\AxisTipControl.resx">
<DependentUpon>AxisTipControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest" /> <None Include="app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
......
...@@ -43,7 +43,7 @@ namespace TheMachine ...@@ -43,7 +43,7 @@ namespace TheMachine
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.label_verify = new System.Windows.Forms.Label(); this.label_verify = new System.Windows.Forms.Label();
this.cb_fixpos = new System.Windows.Forms.ComboBox(); this.cb_fixpos = new System.Windows.Forms.ComboBox();
this.storePosControl1 = new TheMachine.StorePosControl(); this.storePosControl1 = new StorePosControl();
this.groupInout.SuspendLayout(); this.groupInout.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
......
此文件类型无法预览
此文件类型无法预览
namespace OnlineStore.ACSingleStore namespace TheMachine
{ {
partial class FrmPositionTool partial class FrmPositionTool
{ {
......
...@@ -16,7 +16,7 @@ using System.Threading; ...@@ -16,7 +16,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace OnlineStore.ACSingleStore namespace TheMachine
{ {
public partial class FrmPositionTool : Form public partial class FrmPositionTool : Form
{ {
......
<?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="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file
namespace TheMachine
{
partial class AxisTipControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.comjSpeed = new System.Windows.Forms.ComboBox();
this.btnDelMove = new System.Windows.Forms.Button();
this.btnAddMove = new System.Windows.Forms.Button();
this.label_speed = new System.Windows.Forms.Label();
this.textBox_pos = new System.Windows.Forms.TextBox();
this.label_position = new System.Windows.Forms.Label();
this.btn_ok = new System.Windows.Forms.Button();
this.btn_cancel = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// comjSpeed
//
this.comjSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.comjSpeed.FormattingEnabled = true;
this.comjSpeed.Location = new System.Drawing.Point(133, 1);
this.comjSpeed.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.comjSpeed.Name = "comjSpeed";
this.comjSpeed.Size = new System.Drawing.Size(100, 28);
this.comjSpeed.TabIndex = 339;
this.comjSpeed.Tag = "not";
this.comjSpeed.SelectedIndexChanged += new System.EventHandler(this.comjSpeed_SelectedIndexChanged);
//
// btnDelMove
//
this.btnDelMove.BackColor = System.Drawing.Color.White;
this.btnDelMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelMove.Location = new System.Drawing.Point(133, 30);
this.btnDelMove.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnDelMove.Name = "btnDelMove";
this.btnDelMove.Size = new System.Drawing.Size(99, 31);
this.btnDelMove.TabIndex = 338;
this.btnDelMove.Text = "点动-";
this.btnDelMove.UseVisualStyleBackColor = false;
this.btnDelMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnDelMove_MouseDown);
this.btnDelMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnDelMove_MouseUp);
//
// btnAddMove
//
this.btnAddMove.BackColor = System.Drawing.Color.White;
this.btnAddMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddMove.Location = new System.Drawing.Point(12, 30);
this.btnAddMove.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAddMove.Name = "btnAddMove";
this.btnAddMove.Size = new System.Drawing.Size(99, 31);
this.btnAddMove.TabIndex = 337;
this.btnAddMove.Text = "点动+";
this.btnAddMove.UseVisualStyleBackColor = false;
this.btnAddMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnAddMove_MouseDown);
this.btnAddMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnAddMove_MouseUp);
//
// label_speed
//
this.label_speed.Location = new System.Drawing.Point(33, 8);
this.label_speed.Name = "label_speed";
this.label_speed.Size = new System.Drawing.Size(95, 13);
this.label_speed.TabIndex = 336;
this.label_speed.Text = "点动速度:";
this.label_speed.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// textBox_pos
//
this.textBox_pos.Location = new System.Drawing.Point(133, 161);
this.textBox_pos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBox_pos.Name = "textBox_pos";
this.textBox_pos.Size = new System.Drawing.Size(100, 21);
this.textBox_pos.TabIndex = 340;
this.textBox_pos.Tag = "not";
//
// label_position
//
this.label_position.Location = new System.Drawing.Point(33, 161);
this.label_position.Name = "label_position";
this.label_position.Size = new System.Drawing.Size(95, 14);
this.label_position.TabIndex = 336;
this.label_position.Text = "当前位置:";
this.label_position.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btn_ok
//
this.btn_ok.Location = new System.Drawing.Point(155, 182);
this.btn_ok.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btn_ok.Name = "btn_ok";
this.btn_ok.Size = new System.Drawing.Size(77, 23);
this.btn_ok.TabIndex = 341;
this.btn_ok.Text = "确定";
this.btn_ok.UseVisualStyleBackColor = true;
this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
//
// btn_cancel
//
this.btn_cancel.Location = new System.Drawing.Point(14, 182);
this.btn_cancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btn_cancel.Name = "btn_cancel";
this.btn_cancel.Size = new System.Drawing.Size(77, 23);
this.btn_cancel.TabIndex = 341;
this.btn_cancel.Text = "取消";
this.btn_cancel.UseVisualStyleBackColor = true;
this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 16);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(230, 74);
this.flowLayoutPanel1.TabIndex = 342;
this.flowLayoutPanel1.Tag = "not";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.flowLayoutPanel1);
this.groupBox1.Location = new System.Drawing.Point(11, 65);
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox1.Size = new System.Drawing.Size(236, 92);
this.groupBox1.TabIndex = 343;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "相对运动";
//
// AxisTipControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(257, 219);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btn_cancel);
this.Controls.Add(this.btn_ok);
this.Controls.Add(this.textBox_pos);
this.Controls.Add(this.comjSpeed);
this.Controls.Add(this.btnDelMove);
this.Controls.Add(this.btnAddMove);
this.Controls.Add(this.label_position);
this.Controls.Add(this.label_speed);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AxisTipControl";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Load += new System.EventHandler(this.AxisTipControl_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox comjSpeed;
private System.Windows.Forms.Button btnDelMove;
private System.Windows.Forms.Button btnAddMove;
private System.Windows.Forms.Label label_speed;
private System.Windows.Forms.TextBox textBox_pos;
private System.Windows.Forms.Label label_position;
private System.Windows.Forms.Button btn_ok;
private System.Windows.Forms.Button btn_cancel;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.GroupBox groupBox1;
}
}
\ No newline at end of file \ No newline at end of file
using DeviceLibrary;
using HuichuanLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
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 TheMachine
{
//using AxisManager = OnlineStore.DeviceLibrary.AxisManager;
public partial class AxisTipControl : Form
{
//static AxisManager AxisManager = AxisManager;
public AxisTipControl()
{
InitializeComponent();
this.Deactivate += AxisTipControl_Deactivate;
this.LostFocus += AxisTipControl_LostFocus;
this.TopMost = true;
crc.OpenResourceLog = true;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
crc.LanguageProcess(this);
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
crc.LanguageProcess(this);
}
private void AxisTipControl_LostFocus(object sender, EventArgs e)
{
//this.Close();
}
private void AxisTipControl_Deactivate(object sender, EventArgs e)
{
this.Close();
}
short SlvAddr;
string PortName;
int targetSpeed;
static Control c;
public void ShowTips(Control _c, string title, short axisid, int _targetSpeed)
{
if (_c.Tag == null)
return;
if (c != null && c.Name == _c.Name)
return;
Text = title;
/*var cp = c.PointToScreen(new Point(0, 0));
var cc = this.Parent.PointToClient(cp);
cc.Y += c.Height;
this.Location = cc;
*/
c = _c;
SlvAddr = axisid;
PortName = c.Name;
targetSpeed = _targetSpeed;
comjSpeed.Items.Clear();
for (int i = 1; i <= 10; i++)
{
comjSpeed.Items.Add(targetSpeed * i / 10);
}
comjSpeed.SelectedIndex = 4;
comjSpeed.KeyUp += ComjSpeed_KeyUp;
SetRelList((int)comjSpeed.SelectedItem);
//【2】读取轴状态,如果读取出错将关闭此定时器
AxisSts sts = HCBoardManager.GetAxisSts(SlvAddr);
if (sts.ServoOn < 0)
{
showToolTip(crc.GetString("Res0015", "伺服尚未使能"), c);
return;
}
if (sts.ALM != 0 || sts.WARN != 0 || sts.EMG != 0)
{
showToolTip(crc.GetString("Res0016", "伺服警报状态中"), c);
return;
}
readPosition();
this.Show();
//LanguageProcess();
}
private void ComjSpeed_KeyUp(object sender, KeyEventArgs e)
{
if (!int.TryParse(comjSpeed.Text, out _))
{
//e.Handled = false;
return;
}
SetRelList(int.Parse(comjSpeed.Text));
}
private void ComjSpeed_KeyPress(object sender, KeyPressEventArgs e)
{
}
void SetRelList(int speed)
{
flowLayoutPanel1.Controls.Clear();
int[] zoom = new int[] { 1, 3, 5, 7, 9, 11 };
for (int i = 0; i < zoom.Length; i++)
{
Button b = new Button();
b.Size = new Size(60, 30);
var bs = (int)Math.Floor(speed / (decimal)zoom[i]);
b.Text = "+" + bs.ToString();
b.Tag = bs;
b.Click += B_Click;
flowLayoutPanel1.Controls.Add(b);
}
for (int i = 0; i < zoom.Length; i++)
{
Button b = new Button();
b.Size = new Size(60, 30);
var bs = (int)Math.Floor(speed / (decimal)zoom[zoom.Length - i - 1]) * -1;
b.Text = bs.ToString();
b.Tag = bs;
b.Click += B_Click;
flowLayoutPanel1.Controls.Add(b);
}
}
private void B_Click(object sender, EventArgs e)
{
var b = sender as Button;
int pos = (int)b.Tag;
LogUtil.info("【" + PortName + "_" + SlvAddr + "】相对运动: 点位:" + pos);
AxisManager.RelMove(PortName, SlvAddr, pos, targetSpeed, targetSpeed * 3, targetSpeed * 3);
}
void showToolTip(string txt, Control control)
{
var m_ToolTip = new ToolTip();
m_ToolTip.ToolTipIcon = ToolTipIcon.Warning;
m_ToolTip.ToolTipTitle = crc.GetString("Res0017", "无法操作");
m_ToolTip.AutoPopDelay = 0;
m_ToolTip.AutomaticDelay = 0;
m_ToolTip.InitialDelay = 0;
m_ToolTip.ShowAlways = true;
m_ToolTip.Show(txt, control);
Task.Run(() =>
{
Task.Delay(5000).Wait();
m_ToolTip.Dispose();
});
}
private void AxisMove(int speed)
{
LogUtil.info("【" + PortName + "_" + SlvAddr + "】点动: 速度:" + speed);
AxisManager.SpeedMove(PortName, SlvAddr, speed, speed * 4, speed * 4);
}
private void btnAddMove_MouseDown(object sender, MouseEventArgs e)
{
if (!CanMove(sender))
{
return;
}
if (btnAddMove.BackColor.Equals(Color.White))
{
int speed = Convert.ToInt32(comjSpeed.Text);
if (speed <= 0)
{
MessageBox.Show(crc.GetString("title", "提示"), crc.GetString("Res0013", "请先输入正确的速度"));
return;
}
btnAddMove.BackColor = Color.Green;
AxisMove(speed);
}
}
private void btnAddMove_MouseUp(object sender, MouseEventArgs e)
{
if (btnAddMove.BackColor == Color.Green)
{
btnAddMove.BackColor = Color.White;
AxisManager.SuddenStop(PortName, SlvAddr);
readPosition();
}
}
void readPosition()
{
textBox_pos.Text = AxisManager.GetActualtPosition(PortName, SlvAddr).ToString();
}
private void btnDelMove_MouseDown(object sender, MouseEventArgs e)
{
if (!CanMove(sender))
{
return;
}
if (btnDelMove.BackColor.Equals(Color.White))
{
int speed = Convert.ToInt32(comjSpeed.Text);
if (speed <= 0)
{
MessageBox.Show(crc.GetString("title", "提示"), crc.GetString("Res0013", "请先输入正确的速度"));
return;
}
btnDelMove.BackColor = Color.Green;
AxisMove(-speed);
}
}
private void btnDelMove_MouseUp(object sender, MouseEventArgs e)
{
if (btnDelMove.BackColor == Color.Green)
{
btnDelMove.BackColor = Color.White;
AxisManager.SuddenStop(PortName, SlvAddr);
readPosition();
}
}
bool CanMove(object sender)
{
AxisSts sts = HCBoardManager.GetAxisSts(SlvAddr);
if (sts.ServoOn < 0)
{
showToolTip(crc.GetString("Res0015", "伺服尚未使能"), (Control)sender);
return false;
}
if (sts.ALM != 0 || sts.WARN != 0 || sts.EMG != 0)
{
showToolTip(crc.GetString("Res0016", "伺服警报状态中"), (Control)sender);
return false;
}
return true;
}
private void btn_cancel_Click(object sender, EventArgs e)
{
this.Close();
//c.Select();
//c.Focus();
}
private void btn_ok_Click(object sender, EventArgs e)
{
c.Text = textBox_pos.Text;
this.Close();
}
private void AxisTipControl_Load(object sender, EventArgs e)
{
}
private void comjSpeed_SelectedIndexChanged(object sender, EventArgs e)
{
SetRelList((int)comjSpeed.SelectedItem);
}
}
}
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Permissions;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine
{
class ToucDownBtn : System.Windows.Forms.Button
{
public const int WM_POINTERDOWN = 0x246;
public const int WM_POINTERUP = 0x247;
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_POINTERDOWN:
{
MouseEventArgs args = new MouseEventArgs(MouseButtons.Left, 1, 1, 1, 0);
OnMouseDown(args);
//Console.WriteLine("WM_POINTERDOWN");
break;
}
case WM_POINTERUP:
{
MouseEventArgs args = new MouseEventArgs(MouseButtons.Left, 1, 1, 1, 0);
OnMouseUp(args);
//Console.WriteLine("WM_POINTERUP");
break;
}
}
base.WndProc(ref m);
}
}
}

namespace TheMachineNView
{
partial class AboutBox1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.labelProductName = new System.Windows.Forms.Label();
this.labelVersion = new System.Windows.Forms.Label();
this.labelCopyright = new System.Windows.Forms.Label();
this.labelCompanyName = new System.Windows.Forms.Label();
this.textBoxDescription = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.tableLayoutPanel.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel
//
this.tableLayoutPanel.ColumnCount = 2;
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.98701F));
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 87.01299F));
this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0);
this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1);
this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2);
this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3);
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(9, 8);
this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 6;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(417, 245);
this.tableLayoutPanel.TabIndex = 0;
//
// labelProductName
//
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(60, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelProductName.Name = "labelProductName";
this.labelProductName.Size = new System.Drawing.Size(354, 16);
this.labelProductName.TabIndex = 19;
this.labelProductName.Tag = "not";
this.labelProductName.Text = "产品名称";
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelVersion
//
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(60, 24);
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 16);
this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(354, 16);
this.labelVersion.TabIndex = 0;
this.labelVersion.Tag = "not";
this.labelVersion.Text = "版本";
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.labelVersion.Click += new System.EventHandler(this.labelVersion_Click);
//
// labelCopyright
//
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(60, 48);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCopyright.Name = "labelCopyright";
this.labelCopyright.Size = new System.Drawing.Size(354, 16);
this.labelCopyright.TabIndex = 21;
this.labelCopyright.Tag = "not";
this.labelCopyright.Text = "版权";
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelCompanyName
//
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(60, 72);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCompanyName.Name = "labelCompanyName";
this.labelCompanyName.Size = new System.Drawing.Size(354, 16);
this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "公司名称";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBoxDescription
//
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(60, 99);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.textBoxDescription.Multiline = true;
this.textBoxDescription.Name = "textBoxDescription";
this.textBoxDescription.ReadOnly = true;
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxDescription.Size = new System.Drawing.Size(354, 116);
this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false;
this.textBoxDescription.Tag = "not";
this.textBoxDescription.Text = "说明";
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(339, 222);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 20);
this.okButton.TabIndex = 24;
this.okButton.Text = "确定";
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// AboutBox1
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(435, 261);
this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutBox1";
this.Padding = new System.Windows.Forms.Padding(9, 8, 9, 8);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "AboutBox1";
this.tableLayoutPanel.ResumeLayout(false);
this.tableLayoutPanel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
private System.Windows.Forms.Label labelProductName;
private System.Windows.Forms.Label labelVersion;
private System.Windows.Forms.Label labelCopyright;
private System.Windows.Forms.Label labelCompanyName;
private System.Windows.Forms.TextBox textBoxDescription;
private System.Windows.Forms.Button okButton;
}
}
using OnlineStore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachineNView
{
partial class AboutBox1 : Form
{
public AboutBox1()
{
InitializeComponent();
this.Text = String.Format("{0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Ver {0}", AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
this.Shown += AboutBox1_Shown;
}
private void AboutBox1_Shown(object sender, EventArgs e)
{
crc.LanguageProcess(this);
}
#region 程序集特性访问器
public string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
string updatetime = "";
var version = AssemblyVersion;
string[] strArray = version.Split('.');
if (strArray.Length.Equals(4))
{
int days = Convert.ToInt32(strArray[2]);
int seconds = Convert.ToInt32(strArray[3]);
DateTime d1 = DateTime.Parse("2000-01-01");
var newData = d1.AddDays(days);
newData = newData.AddSeconds(seconds * 2);
updatetime = "LastUpdate: "+newData.ToString("yyyy-MM-dd HH:mm:ss");
}
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description + updatetime;
}
}
public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
public string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion
private void okButton_Click(object sender, EventArgs e)
{
}
private void labelVersion_Click(object sender, EventArgs e)
{
ConfigHelper.AdvanceConfigForm.ShowEditDialog(this);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<appSettings>
<add key="CodeType" value="QR Code#Data Matrix ECC 200#barcode" />
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="Conifg\" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/MIMO_G2.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="HCBOARD" type="log4net.Appender.RollingFileAppender">
<file value="logs/HCBOARD.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="LngResource" type="log4net.Appender.RollingFileAppender">
<file value="logs/LngResource.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%m%n" />
</layout>
</appender>
<logger name="RollingLogFileAppender">
<level value="ALL" />
<appender-ref ref="RollingLogFileAppender" />
</logger>
<logger name="HCBOARD" additivity="false">
<level value="ALL" />
<appender-ref ref="HCBOARD" />
</logger>
<logger name="LngResource" additivity="false">
<level value="ALL" />
<appender-ref ref="LngResource" />
</logger>
<!--<root>
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</root>-->
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
\ No newline at end of file \ No newline at end of file

namespace TheMachineNView
{
partial class AxisControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.btnChangeColor = new System.Windows.Forms.Button();
this.btnGree = new System.Windows.Forms.Button();
this.btnYellow = new System.Windows.Forms.Button();
this.lblLed = new System.Windows.Forms.Label();
this.lblOkValue = new System.Windows.Forms.Label();
this.lblSensor = new System.Windows.Forms.Label();
this.btnAxisRStop = new System.Windows.Forms.Button();
this.btnAxisRTest = new System.Windows.Forms.Button();
this.axisMoveControl1 = new AxisMoveControl();
this.configControl1 = new TheMachineNView.ConfigControl();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.btnChangeColor);
this.panel1.Controls.Add(this.btnGree);
this.panel1.Controls.Add(this.btnYellow);
this.panel1.Controls.Add(this.lblLed);
this.panel1.Controls.Add(this.lblOkValue);
this.panel1.Controls.Add(this.lblSensor);
this.panel1.Controls.Add(this.btnAxisRStop);
this.panel1.Controls.Add(this.btnAxisRTest);
this.panel1.Controls.Add(this.axisMoveControl1);
this.panel1.Controls.Add(this.configControl1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1234, 924);
this.panel1.TabIndex = 2;
//
// button1
//
this.button1.Location = new System.Drawing.Point(211, 578);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(155, 31);
this.button1.TabIndex = 20;
this.button1.Text = "停止";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// btnChangeColor
//
this.btnChangeColor.Location = new System.Drawing.Point(211, 541);
this.btnChangeColor.Name = "btnChangeColor";
this.btnChangeColor.Size = new System.Drawing.Size(155, 31);
this.btnChangeColor.TabIndex = 19;
this.btnChangeColor.Text = "切换颜色";
this.btnChangeColor.UseVisualStyleBackColor = true;
this.btnChangeColor.Click += new System.EventHandler(this.btnChangeColor_Click);
//
// btnGree
//
this.btnGree.Location = new System.Drawing.Point(25, 578);
this.btnGree.Name = "btnGree";
this.btnGree.Size = new System.Drawing.Size(155, 31);
this.btnGree.TabIndex = 18;
this.btnGree.Text = "流动绿";
this.btnGree.UseVisualStyleBackColor = true;
this.btnGree.Click += new System.EventHandler(this.btnGree_Click);
//
// btnYellow
//
this.btnYellow.Location = new System.Drawing.Point(25, 541);
this.btnYellow.Name = "btnYellow";
this.btnYellow.Size = new System.Drawing.Size(155, 31);
this.btnYellow.TabIndex = 17;
this.btnYellow.Text = "流动黄";
this.btnYellow.UseVisualStyleBackColor = true;
this.btnYellow.Click += new System.EventHandler(this.btnYellow_Click);
//
// lblLed
//
this.lblLed.AutoSize = true;
this.lblLed.Location = new System.Drawing.Point(23, 508);
this.lblLed.Name = "lblLed";
this.lblLed.Size = new System.Drawing.Size(41, 12);
this.lblLed.TabIndex = 16;
this.lblLed.Text = "氛围灯";
//
// lblOkValue
//
this.lblOkValue.AutoSize = true;
this.lblOkValue.Location = new System.Drawing.Point(23, 482);
this.lblOkValue.Name = "lblOkValue";
this.lblOkValue.Size = new System.Drawing.Size(65, 12);
this.lblOkValue.TabIndex = 15;
this.lblOkValue.Text = "压力传感器";
//
// lblSensor
//
this.lblSensor.AutoSize = true;
this.lblSensor.Location = new System.Drawing.Point(23, 456);
this.lblSensor.Name = "lblSensor";
this.lblSensor.Size = new System.Drawing.Size(65, 12);
this.lblSensor.TabIndex = 14;
this.lblSensor.Text = "声波传感器";
//
// btnAxisRStop
//
this.btnAxisRStop.Location = new System.Drawing.Point(397, 495);
this.btnAxisRStop.Name = "btnAxisRStop";
this.btnAxisRStop.Size = new System.Drawing.Size(155, 31);
this.btnAxisRStop.TabIndex = 13;
this.btnAxisRStop.Text = "旋转轴停止";
this.btnAxisRStop.UseVisualStyleBackColor = true;
this.btnAxisRStop.Click += new System.EventHandler(this.button3_Click);
//
// btnAxisRTest
//
this.btnAxisRTest.Location = new System.Drawing.Point(397, 453);
this.btnAxisRTest.Name = "btnAxisRTest";
this.btnAxisRTest.Size = new System.Drawing.Size(155, 31);
this.btnAxisRTest.TabIndex = 12;
this.btnAxisRTest.Text = "旋转轴循环";
this.btnAxisRTest.UseVisualStyleBackColor = true;
this.btnAxisRTest.Click += new System.EventHandler(this.button2_Click);
//
// axisMoveControl1
//
this.axisMoveControl1.Location = new System.Drawing.Point(3, 3);
this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(559, 444);
this.axisMoveControl1.TabIndex = 0;
this.axisMoveControl1.Tag = "not";
//
// configControl1
//
this.configControl1.Config = null;
this.configControl1.Location = new System.Drawing.Point(568, 3);
this.configControl1.Name = "configControl1";
this.configControl1.Size = new System.Drawing.Size(647, 688);
this.configControl1.TabIndex = 1;
this.configControl1.Tag = "not";
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// AxisControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("新宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "AxisControl";
this.Size = new System.Drawing.Size(1234, 924);
this.Load += new System.EventHandler(this.AxisControl_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private AxisMoveControl axisMoveControl1;
private ConfigControl configControl1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnAxisRStop;
private System.Windows.Forms.Button btnAxisRTest;
private System.Windows.Forms.Label lblSensor;
private System.Windows.Forms.Label lblLed;
private System.Windows.Forms.Label lblOkValue;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Button btnChangeColor;
private System.Windows.Forms.Button btnGree;
private System.Windows.Forms.Button btnYellow;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Button button1;
}
}
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachineNView
{
public partial class AxisControl : UserControl
{
public AxisControl()
{
InitializeComponent();
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
if (DesignMode)
return;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
lblLed.Text = "";
lblOkValue.Text = "";
lblSensor.Text = "";
bool showC = false;
if (Setting_Init.Device_LedLight_PortName != "")
{
showC = true;
}
if (Setting_Init.Enable_HideColorTestBtn)
{
showC = false;
}
btnYellow.Visible = showC;
btnGree.Visible = showC;
btnChangeColor.Visible = showC;
button1.Visible = showC;
if (Setting_Init.Enable_HideAxisTestBtn)
{
btnAxisRTest.Visible = false;
btnAxisRStop.Visible = false;
}
else
{
btnAxisRTest.Visible = true;
btnAxisRStop.Visible = true;
}
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
RobotManage_LoadFinishEvent(true, "");
}
private void RobotManage_LoadFinishEvent(bool state, string msg)
{
if (this.InvokeRequired)
{
this.Invoke((EventHandler)delegate
{
RobotManage_LoadFinishEvent(state, msg);
});
return;
}
if (!state)
return;
axisMoveControl1.LoadData(AxisBean.List);
configControl1.Config = RobotManage.Config;
LogUtil.info("伺服面板加载完成.");
timer1.Start();
}
private void AxisControl_Load(object sender, EventArgs e)
{
}
volatile bool roateloop = false;
private void button2_Click(object sender, EventArgs e)
{
//Task.Run(() => {
// var p1 = RobotManage.mainMachine.Config.UpDown_P1;
// var p1_speed = RobotManage.mainMachine.Config.UpDown_P1_speed;
// var axis = RobotManage.mainMachine.UpDown_Axis;
// roateloop = true;
// while (roateloop)
// {
// axis.AbsMove(null, p1, p1_speed);
// Task.Delay(200).Wait();
// while (axis.IsBusy)
// {
// Task.Delay(100).Wait();
// }
// if (!roateloop)
// break;
// Task.Delay(500).Wait();
// axis.AbsMove(null, 1, p1_speed);
// Task.Delay(200).Wait();
// while (axis.IsBusy)
// {
// Task.Delay(100).Wait();
// }
// Task.Delay(500).Wait();
// }
//});
Task.Run(() => {
var p1 = RobotManage.mainMachine.Config.Middle_P1;
var p1_speed = RobotManage.mainMachine.Config.Middle_P1_speed;
var axis = RobotManage.mainMachine.Middle_Axis;
roateloop = true;
while (roateloop)
{
axis.AbsMove(null, p1, p1_speed);
Task.Delay(200).Wait();
while (axis.IsBusy)
{
Task.Delay(100).Wait();
}
if (!roateloop)
break;
Task.Delay(500).Wait();
axis.AbsMove(null, 1, p1_speed);
Task.Delay(200).Wait();
while (axis.IsBusy)
{
Task.Delay(100).Wait();
}
Task.Delay(500).Wait();
}
});
}
private void button3_Click(object sender, EventArgs e)
{
roateloop = false;
}
private bool isPro = false;
private void timer1_Tick(object sender, EventArgs e)
{
if (!this.Visible|| RobotManage.mainMachine == null)
{
return;
}
if (isPro)
{
return;
}
isPro = true;
Task.Run(() =>
{
try
{
if (Setting_Init.Device_LedLight_PortName != "")
{
lblLed.Text = "LED" + Setting_Init.Device_LedLight_PortName +","+RobotManage.mainMachine.lastS+ ":" + RobotManage.mainMachine.lastColor.ToString();
}
else
{
lblLed.Text = "";
}
if (Setting_Init.Device_DauxiKS107_PortName != "")
{
RobotManage.dauxiKS107Controller.Quary(out int currValue, out string msg);
lblSensor.Text = $"{crc.GetString("shengbosensor", "声波传感器")}{Setting_Init.Device_DauxiKS107_PortName}:" + currValue + ", /" + Setting_Init.Device_DauxiKS107_BaseValue + "/" + Setting_Init.Device_DauxiKS107_ErrorValue;
}
else
{
lblSensor.Text = "";
}
if (Setting_Init.Device_WeightSensor_PortName != "")
{
lblOkValue.Text = $"{crc.GetString("yalisensor", "压力传感器")}{Setting_Init.Device_WeightSensor_PortName}: {Setting_Init.Device_WeightSensor_MaxValue}";
}
else
{
lblOkValue.Text = "";
}
}
catch (Exception ex)
{
LogUtil.error("出错:" + ex.ToString());
}
finally
{
isPro = false;
}
});
}
private void btnYellow_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.ShowYellowLight("test");
}
private void btnGree_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.ShowGreenLight("test");
}
private void btnChangeColor_Click(object sender, EventArgs e)
{
DialogResult result = colorDialog1.ShowDialog();
if (result.Equals(DialogResult.OK))
{
Color color = colorDialog1.Color;
btnChangeColor.BackColor = color;
RobotManage.mainMachine.ShowColor(color,color.Name);
}
}
private void button1_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.CloseColor();
}
}
}
<?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="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>109, 17</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
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 TheMachineNView
{
public partial class IOControls : UserControl
{
Robot_Config _Config;
public Robot_Config Config
{
get { return _Config; }
set
{
_Config = value;
ioControl1.Config = value;
}
}
public IOControls()
{
InitializeComponent();
}
private void btn_linerun_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.Line.LineRun("n",false, 999);
}
private void btn_linerev_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.Line.LineRun("n",true, 999);
}
private void btn_linestop_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.Line.LineStop("n");
}
private void btn_flipopen_Click(object sender, EventArgs e)
{
LogUtil.info("手动控制:翻板门打开");
RobotManage.mainMachine.OpenFlipDoor(null);
}
private void btn_flipclose_Click(object sender, EventArgs e)
{
LogUtil.info("手动控制:翻板门关闭");
RobotManage.mainMachine.CloseFlipDoor(null);
}
private void ioControl1_Load(object sender, EventArgs e)
{
}
private void btn_stringdooropen_Click(object sender, EventArgs e)
{
LogUtil.info("手动控制:折叠门门打开");
RobotManage.mainMachine.StringDoorOpen(null);
}
private void btn_stringdoorclose_Click(object sender, EventArgs e)
{
LogUtil.info("手动控制:折叠门门关闭");
RobotManage.mainMachine.StringDoorClose(null);
}
private void btn_ngdooropen_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.OpenSingleDoor(null);
}
private void btn_ngdoorclose_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.CloseSingleDoor(null);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file

namespace TheMachineNView
{
partial class LogControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.logBox = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// logBox
//
this.logBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.logBox.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(0, 0);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(746, 495);
this.logBox.TabIndex = 0;
this.logBox.Text = "";
//
// LogControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.logBox);
this.Name = "LogControl";
this.Size = new System.Drawing.Size(746, 495);
this.Tag = "not";
this.Load += new System.EventHandler(this.LogControl_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.RichTextBox logBox;
}
}
using OnlineStore.Common;
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 TheMachineNView
{
public partial class LogControl : UserControl
{
public LogControl()
{
InitializeComponent();
showLogProDelegate = new ShowLogProDelegate(ShowLogPro);
//LogUtil.ShowLog += LogUtil_ShowLog;
}
delegate void ShowLogProDelegate(string msg, Color color);
ShowLogProDelegate showLogProDelegate;
private void LogUtil_ShowLog(string msg, Color color)
{
if (ParentForm==null)
return;
if (this.InvokeRequired)
this.Invoke(showLogProDelegate, msg, color);
else
ShowLogPro(msg, color);
}
private List<string> logList = new List<string>();
public int showCount = 30;
private void ShowLogPro(string msg, Color color)
{
try
{
if (logList.Count >= showCount)
{
logList.RemoveAt(0);
}
DateTime now = DateTime.Now;
logList.Add(now.ToLongTimeString() + " " + msg + Environment.NewLine);
logBox.Text= string.Join("", logList);
logBox.Select(logBox.Text.Length, 0);
logBox.ScrollToCaret();
}
catch (Exception ex)
{
LogUtil.error("出错:" + ex.ToString());
}
}
private void LogControl_Load(object sender, EventArgs e)
{
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using ConfigHelper;
using DeviceLibrary;
using log4net.Config;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachineNView
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Config.LoadMyConfig(new Setting_Init().GetType());
//ConfigHelper.Config.Set("CamTestReel_debug", true);
//CodeManager.TestHasReel("", out string a, out string b);
//return;
if (Setting_Init.Enable_CheckReelLocInFix)
DeviceLibrary.VisionHelper.CheckAndRunServer();
_ = new Mutex(true, Application.ProductName, out bool ret);
if (!ret)
{
IntPtr formhwnd = FindWindow(null, Setting_Init.App_Title);
ShowWindow(formhwnd, SW_RESTORE);
SwitchToThisWindow(formhwnd, true);
//MessageBox.Show("该程序已经启动", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
Application.ThreadException += Application_ThreadException;
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Environment.CurrentDirectory = Application.StartupPath;
XmlConfigurator.Configure();
Config.LoadMyConfig(new Setting_Init().GetType());
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain());
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
LogUtil.error($"CurrentDomain_UnhandledException:" + e.ToString());
}
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
LogUtil.error($"Application_ThreadException:" + e.ToString());
}
#region Win32函数的声明
/// <summary>
/// 找到某个窗口与给出的类别名和窗口名相同窗口
/// </summary>
/// <param name="lpClassName">类别名</param>
/// <param name="lpWindowName">窗口名</param>
/// <returns>成功找到返回窗口句柄,否则返回null</returns>
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
/// <summary>
/// 切换到窗口并把窗口设入前台,类似 SetForegroundWindow方法的功能
/// </summary>
/// <param name="hWnd">窗口句柄</param>
/// <param name="fAltTab">True代表窗口正在通过Alt/Ctrl +Tab被切换</param>
[DllImport("user32.dll ", SetLastError = true)]
static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab);
/// <summary>
/// 设置窗口的显示状态
/// </summary>
/// <param name="hWnd">窗口句柄</param>
/// <param name="cmdShow">指示窗口如何被显示</param>
/// <returns>如果窗体之前是可见,返回值为非零;如果窗体之前被隐藏,返回值为零</returns>
[DllImport("user32.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)]
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
public const int SW_RESTORE = 9;
#endregion
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SMD BOX MIMO G2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("上海挚锦科技有限公司")]
[assembly: AssemblyProduct("SMD BOX MIMO G2")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("61fdff14-8bb7-439a-85a0-592e3011f4c4")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
[assembly: AssemblyVersion("2.3.*")]
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace TheMachineNView.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TheMachineNView.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace TheMachineNView.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

namespace TheMachineNView
{
partial class SettingControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.button_positiontool = new System.Windows.Forms.Button();
this.lbl_hmdstate = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tp = new System.Windows.Forms.TableLayoutPanel();
this.cb_usefixpos = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.uC_LedConfig1 = new TheMachineNView.UC_LedConfig();
this.uC_SetUserPassword1 = new TheMachineNView.UC_SetUserPassword();
this.tp.SuspendLayout();
this.SuspendLayout();
//
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
this.tp.SetColumnSpan(this.chbAutoRun, 2);
this.chbAutoRun.Location = new System.Drawing.Point(10, 134);
this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(84, 16);
this.chbAutoRun.TabIndex = 1;
this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true;
//
// button_positiontool
//
this.tp.SetColumnSpan(this.button_positiontool, 2);
this.button_positiontool.Location = new System.Drawing.Point(10, 42);
this.button_positiontool.Margin = new System.Windows.Forms.Padding(10);
this.button_positiontool.Name = "button_positiontool";
this.button_positiontool.Size = new System.Drawing.Size(181, 36);
this.button_positiontool.TabIndex = 4;
this.button_positiontool.Text = "库位定位辅助工具";
this.button_positiontool.UseVisualStyleBackColor = true;
this.button_positiontool.Click += new System.EventHandler(this.button_positiontool_Click);
//
// lbl_hmdstate
//
this.lbl_hmdstate.AutoSize = true;
this.tp.SetColumnSpan(this.lbl_hmdstate, 2);
this.lbl_hmdstate.Location = new System.Drawing.Point(10, 10);
this.lbl_hmdstate.Margin = new System.Windows.Forms.Padding(10);
this.lbl_hmdstate.Name = "lbl_hmdstate";
this.lbl_hmdstate.Size = new System.Drawing.Size(53, 12);
this.lbl_hmdstate.TabIndex = 5;
this.lbl_hmdstate.Tag = "not";
this.lbl_hmdstate.Text = "当前状态";
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// tp
//
this.tp.AutoSize = true;
this.tp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tp.ColumnCount = 2;
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.Controls.Add(this.button_positiontool, 0, 5);
this.tp.Controls.Add(this.lbl_hmdstate, 0, 4);
this.tp.Controls.Add(this.cb_usefixpos, 0, 6);
this.tp.Controls.Add(this.chbAutoRun, 0, 7);
this.tp.Location = new System.Drawing.Point(3, 3);
this.tp.Name = "tp";
this.tp.RowCount = 9;
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.Size = new System.Drawing.Size(286, 160);
this.tp.TabIndex = 6;
//
// cb_usefixpos
//
this.cb_usefixpos.AutoSize = true;
this.tp.SetColumnSpan(this.cb_usefixpos, 2);
this.cb_usefixpos.Location = new System.Drawing.Point(10, 98);
this.cb_usefixpos.Margin = new System.Windows.Forms.Padding(10);
this.cb_usefixpos.Name = "cb_usefixpos";
this.cb_usefixpos.Size = new System.Drawing.Size(96, 16);
this.cb_usefixpos.TabIndex = 6;
this.cb_usefixpos.Text = "启用校准库位";
this.cb_usefixpos.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.Location = new System.Drawing.Point(903, 101);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(102, 48);
this.button1.TabIndex = 7;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// uC_LedConfig1
//
this.uC_LedConfig1.AutoScroll = true;
this.uC_LedConfig1.Config = null;
this.uC_LedConfig1.Location = new System.Drawing.Point(4, 263);
this.uC_LedConfig1.Name = "uC_LedConfig1";
this.uC_LedConfig1.Size = new System.Drawing.Size(859, 440);
this.uC_LedConfig1.TabIndex = 9;
this.uC_LedConfig1.Tag = "not";
//
// uC_SetUserPassword1
//
this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uC_SetUserPassword1.Location = new System.Drawing.Point(481, 1);
this.uC_SetUserPassword1.Margin = new System.Windows.Forms.Padding(5);
this.uC_SetUserPassword1.Name = "uC_SetUserPassword1";
this.uC_SetUserPassword1.Size = new System.Drawing.Size(393, 237);
this.uC_SetUserPassword1.TabIndex = 8;
this.uC_SetUserPassword1.Tag = "not";
//
// SettingControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScroll = true;
this.Controls.Add(this.uC_LedConfig1);
this.Controls.Add(this.uC_SetUserPassword1);
this.Controls.Add(this.button1);
this.Controls.Add(this.tp);
this.Name = "SettingControl";
this.Size = new System.Drawing.Size(1024, 740);
this.Load += new System.EventHandler(this.SettingControl_Load);
this.tp.ResumeLayout(false);
this.tp.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox chbAutoRun;
private System.Windows.Forms.Button button_positiontool;
private System.Windows.Forms.Label lbl_hmdstate;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TableLayoutPanel tp;
private System.Windows.Forms.CheckBox cb_usefixpos;
private System.Windows.Forms.Button button1;
private UC_SetUserPassword uC_SetUserPassword1;
private UC_LedConfig uC_LedConfig1;
}
}
using CodeLibrary;
using ConfigHelper;
using DeviceLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachineNView
{
public partial class SettingControl : UserControl
{
public SettingControl()
{
InitializeComponent();
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
//chbAutoRun.Enabled = false;
chbAutoRun.Checked = Convert.ToBoolean(Setting_Init.App_AutoRun == 1);
this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged);
}
private void RobotManage_LoadFinishEvent(bool state, string msg)
{
if (!state)
return;
uC_LedConfig1.Config = RobotManage.Config;
if (!RobotManage.haveFixpos)
cb_usefixpos.Visible = false;
}
private void SettingControl_Load(object sender, EventArgs e)
{
//Config.PropertyBind("Device_Humiture_Port", cb_tempsensorport, "SelectedItem", "SelectedIndexChanged");
Config.PropertyBind("Device_Use_Fixpos", cb_usefixpos, "Checked", "CheckedChanged");
}
public static void AutoRun(string strName, bool value)
{
try
{
//创建启动对象
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
//设置运行文件
startInfo.FileName = System.Windows.Forms.Application.StartupPath + "\\AuToRunManager.exe";
//设置启动参数
startInfo.Arguments = String.Join(" ", new string[2] { strName, value.ToString() });
//设置启动动作,确保以管理员身份运行
startInfo.Verb = "runas";
//如果不是管理员,则启动UAC
System.Diagnostics.Process.Start(startInfo);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void chbAutoRun_CheckedChanged(object sender, EventArgs e)
{
if (chbAutoRun.Checked)
{
Setting_Init.App_AutoRun = 1;
AutoRun(Application.ExecutablePath, true);
}
else
{
Setting_Init.App_AutoRun = 0;
AutoRun(Application.ExecutablePath, false);
}
}
private void button_positiontool_Click(object sender, EventArgs e)
{
if (RobotManage.isRunning)
{
MessageBox.Show(crc.GetString(L.before_FrmPositionTool_stopmuchine, "运行库位校准程序前,需要先停止料仓的运行"));
}
else
{
FrmPositionTool frmPositionTool = new FrmPositionTool(RobotManage.mainMachine.UpDown_Axis, IO_Type.TrayCheck_Fixture);
frmPositionTool.ShowDialog();
}
}
private void button1_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.ScanCode();
}
private void cb_tempsensorport_SelectedIndexChanged(object sender, EventArgs e)
{
HumitureController.Init(Setting_Init.App_Humiture_Port);
}
private void timer1_Tick(object sender, EventArgs e)
{
if (!Visible)
return;
//label1.Text = ServerCommunication.ServerCommStr;
lbl_hmdstate.Text = crc.GetString(L.current_status, "当前状态:");
if (!HumitureController.IsRun)
{
lbl_hmdstate.Text += crc.GetString(L.connect_fail, "未成功连接");
return;
}
var t = HumitureController.LastData;
lbl_hmdstate.Text += $"{crc.GetString(L.temp, "温度")}:{t.Temperate}℃, {crc.GetString(L.humidity, "湿度")}:{t.Humidity}%";
}
private void button1_Click_1(object sender, EventArgs e)
{
Task.Run(() => CodeManager.TestHasReel(CodeManager.hikNameList[0], out _, out _));
}
//private void button2_Click(object sender, EventArgs e)
//{
// DeviceLibrary.IPCameraHelper.StartRecord("manual");
//}
//private void button3_Click(object sender, EventArgs e)
//{
// DeviceLibrary.IPCameraHelper.StopRecord();
//}
}
}
<?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="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file

namespace TheMachineNView
{
partial class ConfigControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnSavePos = new System.Windows.Forms.Button();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(3, 3);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(628, 461);
this.groupBox3.TabIndex = 108;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "点位列表";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 6;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 14);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(616, 441);
this.tableLayoutPanel1.TabIndex = 102;
this.tableLayoutPanel1.Tag = "not";
//
// btnSavePos
//
this.btnSavePos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSavePos.Location = new System.Drawing.Point(3, 470);
this.btnSavePos.Name = "btnSavePos";
this.btnSavePos.Size = new System.Drawing.Size(133, 31);
this.btnSavePos.TabIndex = 109;
this.btnSavePos.Text = "全部保存";
this.btnSavePos.UseVisualStyleBackColor = true;
this.btnSavePos.Click += new System.EventHandler(this.btnSavePos_Click);
//
// ConfigControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnSavePos);
this.Controls.Add(this.groupBox3);
this.Name = "ConfigControl";
this.Size = new System.Drawing.Size(1096, 504);
this.Load += new System.EventHandler(this.ConfigControl_Load);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button btnSavePos;
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using DeviceLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
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 TheMachineNView
{
using crc = OnlineStore.CodeResourceControl;
public class CylinderButton : Button
{
Timer timer;
public CylinderButton()
{
this.FlatStyle = FlatStyle.Flat;
this.BackColor = Color.White;
this.Tag = "not";
//RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
this.Click += CylinderButton_Click;
timer = new Timer();
timer.Interval = 1000;
timer.Tick += Timer_Tick;
GC.KeepAlive(timer);
this.HandleCreated += CylinderButton_HandleCreated;
}
private void CylinderButton_HandleCreated(object sender, EventArgs e)
{
if (!DesignMode)
DataUpdate();
}
private void Timer_Tick(object sender, EventArgs e)
{
if(Visible)
StateUpdate();
}
private void RobotManage_LoadFinishEvent(bool state, string msg)
{
if (state)
{
DataUpdate();
//this.Invoke((EventHandler)delegate { DataUpdate(); });
}
}
string io_high;
string io_low;
ConfigIO configio_high;
ConfigIO configio_low;
IO_VALUE io_state = IO_VALUE.LOW;
[Category("数据"), Description("IO名称"), Browsable(true)]
public string IO_HIGH
{
get
{
return io_high;
}
set
{
io_high = value;
this.Text = io_high;
}
}
[Category("数据"), Description("IO名称"), Browsable(true)]
public string IO_LOW
{
get
{
return io_low;
}
set
{
io_low = value;
}
}
void DataUpdate() {
if (string.IsNullOrEmpty(io_high) && !DeviceConfig.AllDOlist.ContainsKey(io_high))
this.Text = $"IO {io_high} Not Find";
else
{
if (DeviceConfig.AllDOEleclist.ContainsKey(io_high))
configio_high = DeviceConfig.AllDOEleclist[io_high];
else
configio_high = DeviceConfig.AllDOlist[io_high];
}
if (!string.IsNullOrEmpty(io_low))
{
if (!DeviceConfig.AllDOlist.ContainsKey(io_low))
this.Text = $"IO {io_low} Not Find";
else
{
if (DeviceConfig.AllDOEleclist.ContainsKey(io_low))
configio_low = DeviceConfig.AllDOEleclist[io_low];
else
configio_low = DeviceConfig.AllDOlist[io_low];
}
}
//this.Text = DeviceConfig.AllDOlist[io_high].Explain;
StateUpdate();
timer.Start();
}
void StateUpdate()
{
io_state = IOManager.GetDOValue(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr());
if (configio_low != null)
{
if (io_state.Equals(IO_VALUE.LOW))
{
this.Text = configio_high.ElectricalDefinition+" "+crc.GetString(configio_high.ProName,configio_high.Explain);
this.BackColor = Color.White;
}
else
{
this.Text = configio_low.ElectricalDefinition + " "+ crc.GetString(configio_low.ProName,configio_low.Explain);
this.BackColor = Color.LightGreen;
}
}
else
{
if (io_state.Equals(IO_VALUE.LOW))
{
this.Text = "(ON) " + configio_high.ElectricalDefinition + " " + crc.GetString(configio_high.ProName, configio_high.Explain);
this.BackColor = Color.White;
}
else if (configio_low == null)
{
this.Text = "(OFF) " + configio_high.ElectricalDefinition + " " + crc.GetString(configio_high.ProName, configio_high.Explain);
this.BackColor = Color.LightGreen;
}
}
}
private void CylinderButton_Click(object sender, EventArgs e)
{
if (io_state.Equals(IO_VALUE.LOW))
{
LogUtil.info($"手动点击: Set {configio_high.ElectricalDefinition}{configio_high.Explain}=HIGH");
IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.HIGH);
if (configio_low != null)
IOManager.WriteSingleDO(configio_low.DeviceName, configio_low.SlaveID, configio_low.GetIOAddr(), IO_VALUE.LOW);
}
else if (configio_low != null)
{
LogUtil.info($"手动点击: Set {configio_high.ElectricalDefinition}{configio_high.Explain}=LOW");
IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.LOW);
IOManager.WriteSingleDO(configio_low.DeviceName, configio_low.SlaveID, configio_low.GetIOAddr(), IO_VALUE.HIGH);
}
else {
LogUtil.info($"手动点击: Set {configio_high.ElectricalDefinition}{configio_high.Explain}=LOW");
IOManager.WriteSingleDO(configio_high.DeviceName, configio_high.SlaveID, configio_high.GetIOAddr(), IO_VALUE.LOW);
}
}
}
}
using OnlineStore;
using OnlineStore.Common;
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 TheMachineNView
{
public partial class FrmPassCheck : Form
{
public FrmPassCheck()
{
InitializeComponent();
}
public static bool CheckPassword() {
if (!Setting_Init.User_Enable)
return true;
FrmPassCheck frmPassCheck = new FrmPassCheck();
var result = frmPassCheck.ShowDialog();
return (result == DialogResult.OK);
}
private void btn_cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
this.Close();
}
private void btn_ok_Click(object sender, EventArgs e)
{
if (textBox1.Text.Trim() == Setting_Init.User_AdminPassword.Val.Trim())
{
DialogResult = DialogResult.OK;
this.Close();
}
else
MessageBox.Show(crc.GetString("Res0057","密码不正确请重新输入!"));
}
}
}
\ No newline at end of file \ No newline at end of file

namespace TheMachineNView
{
partial class FrmPassCheck
{
/// <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.textBox1 = new System.Windows.Forms.TextBox();
this.btn_ok = new System.Windows.Forms.Button();
this.btn_cancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(114, 88);
this.textBox1.Name = "textBox1";
this.textBox1.PasswordChar = '*';
this.textBox1.Size = new System.Drawing.Size(318, 29);
this.textBox1.TabIndex = 0;
//
// btn_ok
//
this.btn_ok.Location = new System.Drawing.Point(352, 189);
this.btn_ok.Name = "btn_ok";
this.btn_ok.Size = new System.Drawing.Size(129, 49);
this.btn_ok.TabIndex = 1;
this.btn_ok.Text = "确定";
this.btn_ok.UseVisualStyleBackColor = true;
this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
//
// btn_cancel
//
this.btn_cancel.Location = new System.Drawing.Point(40, 189);
this.btn_cancel.Name = "btn_cancel";
this.btn_cancel.Size = new System.Drawing.Size(129, 49);
this.btn_cancel.TabIndex = 1;
this.btn_cancel.Text = "取消";
this.btn_cancel.UseVisualStyleBackColor = true;
this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);
//
// FrmPassCheck
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(548, 275);
this.Controls.Add(this.btn_cancel);
this.Controls.Add(this.btn_ok);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmPassCheck";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "请输入密码";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button btn_ok;
private System.Windows.Forms.Button btn_cancel;
}
}
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using DeviceLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
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 UserFromControl;
namespace TheMachineNView
{
using crc = OnlineStore.CodeResourceControl;
public partial class IOControl : UserControl
{
private DeviceConfig _Config;
public DeviceConfig Config
{
get { return _Config; }
set
{
if (value == null)
return;
_Config = value;
try
{
LoadIOList();
}
catch (Exception ee)
{
MessageBox.Show("Config LoadIOList:" + ee.ToString());
}
}
}
readonly Timer t1 = new Timer();
Dictionary<string, IOTextControl> DIControlList;
Dictionary<string, IOTextControl> DOControlList;
public IOControl()
{
InitializeComponent();
this.Tag = "not";
if (DesignMode)
return;
DIControlList = new Dictionary<string, IOTextControl>();
DOControlList = new Dictionary<string, IOTextControl>();
t1.Stop();
t1.Interval = 500;
t1.Tick += T1_Tick;
GC.KeepAlive(t1);
//RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
}
private void IOControl_Load(object sender, EventArgs e)
{
OnlineStore.CodeResourceControl.LanguageChangeEvent += CodeResourceControl_LanguageChange;
CodeResourceControl_LanguageChange(null, null);
}
private void CodeResourceControl_LanguageChange(object sender, EventArgs e)
{
if (DesignMode)
return;
OnlineStore.CodeResourceControl.LanguageProcess(this);
this.Invoke((EventHandler)delegate
{
try
{
LoadIOList();
}
catch (Exception ee)
{
MessageBox.Show("CodeResourceControl_LanguageChange LoadIOList:" + ee.ToString());
}
});
}
private void T1_Tick(object sender, EventArgs e)
{
if (this.Visible)
{
ReadIOList();
}
}
private void LoadIOList()
{
t1.Stop();
this.SuspendLayout();
DIControlList.Clear();
DOControlList.Clear();
int roleindex = 0;
this.tableLayoutPanel1.Controls.Clear();
this.tableLayoutPanel1.RowStyles.Clear();
this.tableLayoutPanel1.RowCount = Config.DIList.Count;
foreach (ConfigIO ioValue in Config.DIList.Values)
{
//if (ioValue.SubType.Equals(0))
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + crc.GetString(ioValue.ProName, ioValue.Explain), ioValue.ProName);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
DIControlList.Add(ioValue.ProName, control);
}
}
this.tableLayoutPanel2.Controls.Clear();
this.tableLayoutPanel2.RowStyles.Clear();
this.tableLayoutPanel2.RowCount = Config.DOList.Count;
roleindex = 0;
foreach (ConfigIO ioValue in Config.DOList.Values)
{
//if (ioValue.SubType.Equals(0))
{
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + crc.GetString(ioValue.ProName, ioValue.Explain), ioValue.ProName);
control.Click += Control_Click;
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
roleindex++;
DOControlList.Add(ioValue.ProName, control);
}
}
cmbWriteIO.DataSource = new List<ConfigIO>(Config.DOList.Values);
cmbWriteIO.ValueMember = "ProName";
cmbWriteIO.DisplayMember = "DisplayStr";
this.ResumeLayout(false);
t1.Start();
}
private void Control_Click(object sender, EventArgs e)
{
IOTextControl control = (IOTextControl)sender;
string name = control.Name.Substring(3, control.Name.Length - 3);
List<string> keyList = new List<string>(DOControlList.Keys);
int index = keyList.IndexOf(name);
if (index >= 0)
{
cmbWriteIO.SelectedIndex = index;
}
}
private void ReadIOList()
{
foreach (string key in DIControlList.Keys)
{
IOTextControl control = DIControlList[key];
ConfigIO io = Config.DIList[key];
int iov = (int)IOManager.GetDIValue("", 0, io.GetIOAddr());
if (iov != control.IOValue)
{
control.IOValue = iov;
control.ShowData();
}
}
foreach (string key in this.DOControlList.Keys)
{
IOTextControl control = DOControlList[key];
ConfigIO io = Config.DOList[key];
int iov = (int)IOManager.GetDOValue("", 0, io.GetIOAddr());
if (iov != control.IOValue)
{
control.IOValue = iov;
control.ShowData();
}
}
}
IOTextControl selectControl = null;
private void cmbWriteIO_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbWriteIO.SelectedIndex >= 0)
{
ConfigIO io = GetSelectDO();
if (io != null)
{
// txtIp.Text = io.DeviceName;
txtDOIndex.Text = io.GetIOAddr().ToString();
IOTextControl newControl = DOControlList[io.ProName];
if (selectControl != null) { selectControl.BackColor = Color.White; }
newControl.BackColor = Color.SkyBlue;
selectControl = newControl;
}
}
}
private ConfigIO GetSelectDO()
{
string text = cmbWriteIO.SelectedValue.ToString();
if (Config.DOList.ContainsKey(text))
{
ConfigIO io = Config.DOList[text];
return io;
}
return null;
}
private void btnOpenDo_Click(object sender, EventArgs e)
{
WriteDO(IO_VALUE.HIGH);
}
private void btnCloseDO_Click(object sender, EventArgs e)
{
WriteDO(IO_VALUE.LOW);
}
private void WriteDO(IO_VALUE value)
{
int index = FormUtil.GetIntValue(txtDOIndex);
// IO_VALUE value = checkBox1.Checked ? IO_VALUE.HIGH : IO_VALUE.LOW;
int time = FormUtil.GetIntValue(txtWriteTime);
int slaveId = 0;
if (time > 0)
{
IOManager.WriteSingleDO("HC", (byte)slaveId, (ushort)index, (IO_VALUE)value, time);
}
else
{
IOManager.WriteSingleDO("HC", (byte)slaveId, (ushort)index, (IO_VALUE)value);
}
}
private void cmbWriteIO_DrawItem(object sender, DrawItemEventArgs e)
{
if (e.Index < 0)
{
return;
}
e.DrawBackground();
e.DrawFocusRectangle();
if (cmbWriteIO.Items.Count > e.Index)
{
ConfigIO io = (ConfigIO)cmbWriteIO.Items[e.Index];
//e.Graphics.DrawString(io.DisplayStr, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
e.Graphics.DrawString(io.ElectricalDefinition + "_" + crc.GetString(io.ProName, io.Explain), e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y + 3);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file

namespace TheMachineNView
{
partial class StorePosControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnSavePos = new System.Windows.Forms.Button();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(4, 4);
this.groupBox3.Margin = new System.Windows.Forms.Padding(4);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(4);
this.groupBox3.Size = new System.Drawing.Size(590, 299);
this.groupBox3.TabIndex = 108;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "点位列表";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 6;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 18);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(582, 277);
this.tableLayoutPanel1.TabIndex = 102;
this.tableLayoutPanel1.Tag = "not";
//
// btnSavePos
//
this.btnSavePos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSavePos.Location = new System.Drawing.Point(424, 311);
this.btnSavePos.Margin = new System.Windows.Forms.Padding(4);
this.btnSavePos.Name = "btnSavePos";
this.btnSavePos.Size = new System.Drawing.Size(170, 31);
this.btnSavePos.TabIndex = 109;
this.btnSavePos.Text = "保存";
this.btnSavePos.UseVisualStyleBackColor = true;
this.btnSavePos.Click += new System.EventHandler(this.btnSavePos_Click);
//
// StorePosControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnSavePos);
this.Controls.Add(this.groupBox3);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "StorePosControl";
this.Size = new System.Drawing.Size(598, 346);
this.Load += new System.EventHandler(this.ConfigControl_Load);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button btnSavePos;
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file

namespace TheMachineNView
{
partial class UC_LedConfig
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.button_reset = new System.Windows.Forms.Button();
this.button_save = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.AutoSize = true;
this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tableLayoutPanel1.ColumnCount = 4;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 200F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 33F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(537, 234);
this.tableLayoutPanel1.TabIndex = 0;
//
// button_reset
//
this.button_reset.Location = new System.Drawing.Point(601, 3);
this.button_reset.Name = "button_reset";
this.button_reset.Size = new System.Drawing.Size(162, 34);
this.button_reset.TabIndex = 1;
this.button_reset.Text = "重置为默认值";
this.button_reset.UseVisualStyleBackColor = true;
this.button_reset.Click += new System.EventHandler(this.button_reset_Click);
//
// button_save
//
this.button_save.Location = new System.Drawing.Point(601, 72);
this.button_save.Name = "button_save";
this.button_save.Size = new System.Drawing.Size(162, 34);
this.button_save.TabIndex = 1;
this.button_save.Text = "保存设定";
this.button_save.UseVisualStyleBackColor = true;
this.button_save.Click += new System.EventHandler(this.button_save_Click);
//
// UC_LedConfig
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.button_save);
this.Controls.Add(this.button_reset);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "UC_LedConfig";
this.Size = new System.Drawing.Size(859, 498);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button button_reset;
private System.Windows.Forms.Button button_save;
}
}
using OnlineStore;
using DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
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 OnlineStore.Common;
namespace TheMachineNView
{
using crc = OnlineStore.CodeResourceControl;
public partial class UC_LedConfig : UserControl
{
public UC_LedConfig()
{
InitializeComponent();
this.Tag = "not";
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
// crc.LanguageProcess(this);
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
if (Config == null)
return;
crc.LanguageProcess(this);
LoadLedList();
}
private DeviceConfig _Config;
public DeviceConfig Config
{
get { return _Config; }
set
{
if (value == null)
return;
_Config = value;
LoadLedList();
crc.LanguageProcess(this);
}
}
void LoadLedList()
{
//if (!this.Created)
// return;
if (this.InvokeRequired)
{
this.Invoke((EventHandler)delegate
{
try
{
LoadLedList();
}
catch (Exception ee)
{
MessageBox.Show("LoadLedList:" + ee.ToString());
}
});
return;
}
tableLayoutPanel1.SuspendLayout();
tableLayoutPanel1.Controls.Clear();
this.tableLayoutPanel1.RowStyles.Clear();
var statenames = Enum.GetNames(typeof(MachineLedStateE));
Label label_s = new Label()
{
Size = new Size(200, 34),
Text = crc.GetString("Res0220","状态,优先级从大到小"),
TextAlign = ContentAlignment.MiddleLeft
};
tableLayoutPanel1.Controls.Add(label_s, 0, 0);
Label label_g = new Label()
{
Size = new Size(120, 34),
Text = crc.GetString("Res0221","绿灯"),
TextAlign = ContentAlignment.MiddleCenter
};
tableLayoutPanel1.Controls.Add(label_g, 1, 0);
Label label_y = new Label()
{
Size = new Size(120, 34),
Text = crc.GetString("Res0222","黄灯"),
TextAlign = ContentAlignment.MiddleCenter
};
tableLayoutPanel1.Controls.Add(label_y, 2, 0);
Label label_r = new Label()
{
Size = new Size(120, 34),
Text = crc.GetString("Res0223","红灯"),
TextAlign = ContentAlignment.MiddleCenter
};
tableLayoutPanel1.Controls.Add(label_r, 3, 0);
int r = 1;
var ledkeys = RobotManage.mainMachine.MachineLedStateName.Keys;
foreach (var key in ledkeys)
{
//if (r == 3)
// return;
Label button = new Label();
button.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom);
button.Name = key.ToString();
button.Text = crc.GetString("ledstate_"+ key, RobotManage.mainMachine.MachineLedStateName[key]);
button.AutoSize = false;
button.Size = new System.Drawing.Size(200, 34);
button.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
tableLayoutPanel1.Controls.Add(button, 0, r);
int c = 1;
foreach (var led in Led.LedColors.Keys)
{
List<lightitem> lightitems = new List<lightitem>();
lightitems.Add(new lightitem(crc.GetString("Res0224","无动作"), LedState.none));
lightitems.Add(new lightitem(crc.GetString("Res0225","关"), LedState.off));
lightitems.Add(new lightitem(crc.GetString("Res0226","开"), LedState.on));
lightitems.Add(new lightitem(crc.GetString("flashing", "闪烁"), LedState.blink));
var selit = lightitems.FindIndex(x => x.value == RobotManage.mainMachine.MachineLedState[key][led]);
ComboBox comboBox = new ComboBox();
comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox.FormattingEnabled = true;
//comboBox.Items.AddRange(new object[] { "none", "on", "off", "blink" });
comboBox.Items.AddRange(lightitems.ToArray());
comboBox.Name = key.ToString();
comboBox.Tag = led;
//comboBox.SelectedItem = selit;
comboBox.SelectedIndex= selit;
tableLayoutPanel1.Controls.Add(comboBox, c, r);
c++;
}
r++;
}
tableLayoutPanel1.ResumeLayout(true);
}
class lightitem {
public string Text;
public LedState value;
public lightitem(string t, LedState v) {
Text = t;
value = v;
}
public override string ToString()
{
return Text;
}
}
private void button_reset_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.DefaultLedCfg();
LoadLedList();
}
private void button_save_Click(object sender, EventArgs e)
{
for (int i = 0; i < tableLayoutPanel1.Controls.Count; i++) {
var cc = tableLayoutPanel1.Controls[i];
if (!(cc is ComboBox))
continue;
Enum.TryParse<MachineLedStateE>(cc.Name, out MachineLedStateE key);
LedColor led = (LedColor)cc.Tag;
RobotManage.mainMachine.MachineLedState[key][led] = ((lightitem)(cc as ComboBox).SelectedItem).value;
}
if (RobotManage.mainMachine.SaveLedCfg())
MessageBox.Show(crc.GetString("save_success", "保存成功") + "!");
else
MessageBox.Show(crc.GetString("save_failed", "保存失败") + "!");
}
}
}
\ No newline at end of file \ No newline at end of file
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!