Commit 1f6775d2 顾剑亮

coding

1 个父辈 5c9b274e
正在显示 68 个修改的文件 包含 777 行增加213 行删除
此文件类型无法预览
...@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIOBOX_Debug_old", "AIOBOX_ ...@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIOBOX_Debug_old", "AIOBOX_
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{7F7C9D6D-D088-410E-8340-3FB5EEA78B37}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{7F7C9D6D-D088-410E-8340-3FB5EEA78B37}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIOBOX_Debug", "AIOBOX_Debug\AIOBOX_Debug.csproj", "{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -51,6 +53,14 @@ Global ...@@ -51,6 +53,14 @@ Global
{7F7C9D6D-D088-410E-8340-3FB5EEA78B37}.Release|Any CPU.Build.0 = Release|Any CPU {7F7C9D6D-D088-410E-8340-3FB5EEA78B37}.Release|Any CPU.Build.0 = Release|Any CPU
{7F7C9D6D-D088-410E-8340-3FB5EEA78B37}.Release|x86.ActiveCfg = Release|Any CPU {7F7C9D6D-D088-410E-8340-3FB5EEA78B37}.Release|x86.ActiveCfg = Release|Any CPU
{7F7C9D6D-D088-410E-8340-3FB5EEA78B37}.Release|x86.Build.0 = Release|Any CPU {7F7C9D6D-D088-410E-8340-3FB5EEA78B37}.Release|x86.Build.0 = Release|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Debug|x86.ActiveCfg = Debug|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Debug|x86.Build.0 = Debug|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Release|Any CPU.Build.0 = Release|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Release|x86.ActiveCfg = Release|Any CPU
{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; ...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.0.2")] [assembly: AssemblyVersion("2.4.0.3")]
[assembly: AssemblyFileVersion("2.4.0.2")] [assembly: AssemblyFileVersion("2.4.0.3")]
...@@ -26,14 +26,11 @@ ...@@ -26,14 +26,11 @@
自动读取DO事件触发 自动读取DO事件触发
</summary> </summary>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.#ctor(Asa.IOModule.Box_Type,System.Int32,Asa.IOModule.Box_Type,System.Int32)"> <member name="M:Asa.IOModule.AIOBOX.#ctor(System.String)">
<summary> <summary>
零点IO模块操作类 零点IO模块操作类
</summary> </summary>
<param name="input">输入类型</param> <param name="logName"></param>
<param name="inputCount">输入数量</param>
<param name="output">输出类型</param>
<param name="outputCount">输出数量</param>
</member> </member>
<member name="P:Asa.IOModule.AIOBOX.IP"> <member name="P:Asa.IOModule.AIOBOX.IP">
<summary> <summary>
...@@ -50,20 +47,30 @@ ...@@ -50,20 +47,30 @@
是否连接 是否连接
</summary> </summary>
</member> </member>
<member name="P:Asa.IOModule.AIOBOX.MonitorDI"> <member name="P:Asa.IOModule.AIOBOX.InputCount">
<summary> <summary>
监控DI输入,索引数组 DI总数
</summary> </summary>
</member> </member>
<member name="P:Asa.IOModule.AIOBOX.MonitorDO"> <member name="P:Asa.IOModule.AIOBOX.OutputCount">
<summary> <summary>
监控DO输出,索引数组 DO总数
</summary> </summary>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.SetType(Asa.IOModule.Box_Type,System.Int32,Asa.IOModule.Box_Type,System.Int32)">
<summary>
设置输入输出的类型
</summary>
<param name="input"></param>
<param name="inputCount"></param>
<param name="output"></param>
<param name="outputCount"></param>
</member>
<member name="M:Asa.IOModule.AIOBOX.Connect"> <member name="M:Asa.IOModule.AIOBOX.Connect">
<summary> <summary>
连接 连接
</summary> </summary>
<returns></returns>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.Close"> <member name="M:Asa.IOModule.AIOBOX.Close">
<summary> <summary>
...@@ -151,6 +158,12 @@ ...@@ -151,6 +158,12 @@
<param name="sta"></param> <param name="sta"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.GetLocalIP">
<summary>
获取本地IPv4地址
</summary>
<returns></returns>
</member>
<member name="M:Asa.IOModule.AIOBOX.Send"> <member name="M:Asa.IOModule.AIOBOX.Send">
<summary> <summary>
发送命令线程 发送命令线程
......
...@@ -6,4 +6,3 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\obj\Debug\Asa.IOM ...@@ -6,4 +6,3 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\obj\Debug\Asa.IOM
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\obj\Debug\Asa.IOModule.AIOBOX.pdb D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\obj\Debug\Asa.IOModule.AIOBOX.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\bin\Debug\log4net.dll D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\obj\Debug\AIOBOX.csproj.CopyComplete D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\obj\Debug\AIOBOX.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX\obj\Debug\AIOBOX.csprojAssemblyReference.cache
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E48F1646-79E1-43A3-93A1-6F8ECDCE7843}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AIOBOX_Debug</RootNamespace>
<AssemblyName>AIOBOX_Debug</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file \ No newline at end of file
namespace AIOBOX_Debug
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
}
}
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 AIOBOX_Debug
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_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 System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AIOBOX_Debug
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AIOBOX_Debug")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AIOBOX_Debug")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e48f1646-79e1-43a3-93a1-6f8ecdce7843")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace AIOBOX_Debug.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AIOBOX_Debug.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AIOBOX_Debug.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>AIOBOX_Debug</RootNamespace> <RootNamespace>AIOBOX_Debug</RootNamespace>
<AssemblyName>AIOBOX_Debug</AssemblyName> <AssemblyName>AIOBOX_Debug</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
...@@ -55,6 +56,10 @@ ...@@ -55,6 +56,10 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\DLL\log4net.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
...@@ -107,6 +112,7 @@ ...@@ -107,6 +112,7 @@
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
...@@ -122,9 +128,9 @@ ...@@ -122,9 +128,9 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\AIOBOX_old\AIOBOX_old.csproj"> <ProjectReference Include="..\AIOBOX\AIOBOX.csproj">
<Project>{64600160-a389-4b09-af59-a4c9aca039de}</Project> <Project>{e8d77b2a-a00d-4618-987d-c8a7ddd41b0b}</Project>
<Name>AIOBOX_old</Name> <Name>AIOBOX</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup> </startup>
<log4net>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file value="logs/AIOBOX.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>
<root>
<level value="Debug"/>
<appender-ref ref="AIOBOX"/>
</root>
</log4net>
</configuration> </configuration>
\ No newline at end of file \ No newline at end of file
...@@ -7,12 +7,7 @@ namespace Asa ...@@ -7,12 +7,7 @@ namespace Asa
public static IOModule.AIOBOX box; public static IOModule.AIOBOX box;
public static string[] localIP; public static string[] localIP;
public static int localIndex; public static int localIndex;
public static int inputCount;
public static int outputCount;
public static int inputSleep;
public static int outputSleep;
public static bool autoUpload;
public static bool autoRead;
public delegate void DO_Event(int index); public delegate void DO_Event(int index);
} }
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.checkBox1 = new System.Windows.Forms.CheckBox(); this.checkBox1 = new System.Windows.Forms.CheckBox();
this.label4 = new System.Windows.Forms.Label();
this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.BtnCancel = new System.Windows.Forms.Button(); this.BtnCancel = new System.Windows.Forms.Button();
this.BtnOK = new System.Windows.Forms.Button(); this.BtnOK = new System.Windows.Forms.Button();
...@@ -39,9 +36,6 @@ ...@@ -39,9 +36,6 @@
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.checkBox2 = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
...@@ -56,59 +50,6 @@ ...@@ -56,59 +50,6 @@
this.checkBox1.Text = "Auto Upload"; this.checkBox1.Text = "Auto Upload";
this.checkBox1.UseVisualStyleBackColor = true; this.checkBox1.UseVisualStyleBackColor = true;
// //
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(125, 11);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(77, 12);
this.label4.TabIndex = 25;
this.label4.Text = "AutoRead(ms)";
//
// numericUpDown3
//
this.numericUpDown3.Location = new System.Drawing.Point(123, 26);
this.numericUpDown3.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.numericUpDown3.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown3.Name = "numericUpDown3";
this.numericUpDown3.Size = new System.Drawing.Size(80, 21);
this.numericUpDown3.TabIndex = 24;
this.numericUpDown3.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// numericUpDown4
//
this.numericUpDown4.Location = new System.Drawing.Point(123, 53);
this.numericUpDown4.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.numericUpDown4.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown4.Name = "numericUpDown4";
this.numericUpDown4.Size = new System.Drawing.Size(80, 21);
this.numericUpDown4.TabIndex = 23;
this.numericUpDown4.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
...@@ -192,26 +133,12 @@ ...@@ -192,26 +133,12 @@
this.label1.TabIndex = 16; this.label1.TabIndex = 16;
this.label1.Text = "Input"; this.label1.Text = "Input";
// //
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(209, 56);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(78, 16);
this.checkBox2.TabIndex = 29;
this.checkBox2.Text = "Auto Read";
this.checkBox2.UseVisualStyleBackColor = true;
//
// FrmIO // FrmIO
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(313, 156); this.ClientSize = new System.Drawing.Size(313, 156);
this.Controls.Add(this.checkBox2);
this.Controls.Add(this.checkBox1); this.Controls.Add(this.checkBox1);
this.Controls.Add(this.label4);
this.Controls.Add(this.numericUpDown3);
this.Controls.Add(this.numericUpDown4);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.BtnCancel); this.Controls.Add(this.BtnCancel);
this.Controls.Add(this.BtnOK); this.Controls.Add(this.BtnOK);
...@@ -226,8 +153,6 @@ ...@@ -226,8 +153,6 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "FrmIO"; this.Text = "FrmIO";
this.Load += new System.EventHandler(this.FrmIO_Load); this.Load += new System.EventHandler(this.FrmIO_Load);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
...@@ -238,9 +163,6 @@ ...@@ -238,9 +163,6 @@
#endregion #endregion
private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown numericUpDown3;
private System.Windows.Forms.NumericUpDown numericUpDown4;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button BtnCancel; private System.Windows.Forms.Button BtnCancel;
private System.Windows.Forms.Button BtnOK; private System.Windows.Forms.Button BtnOK;
...@@ -248,6 +170,5 @@ ...@@ -248,6 +170,5 @@
private System.Windows.Forms.NumericUpDown numericUpDown1; private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBox2;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -19,39 +19,17 @@ namespace AIOBOX_Debug ...@@ -19,39 +19,17 @@ namespace AIOBOX_Debug
private void FrmIO_Load(object sender, EventArgs e) private void FrmIO_Load(object sender, EventArgs e)
{ {
numericUpDown1.Value = Asa.Common.inputCount; numericUpDown1.Value = Asa.Common.box.InputCount;
numericUpDown2.Value = Asa.Common.outputCount; numericUpDown2.Value = Asa.Common.box.OutputCount;
numericUpDown3.Value = Asa.Common.inputSleep; checkBox1.Checked = Asa.Common.box.Upload;
numericUpDown4.Value = Asa.Common.outputSleep;
checkBox1.Checked = Asa.Common.autoUpload;
checkBox2.Checked = Asa.Common.autoRead;
} }
private void BtnOK_Click(object sender, EventArgs e) private void BtnOK_Click(object sender, EventArgs e)
{ {
int n; int input = Convert.ToInt32(numericUpDown1.Value);
int output = Convert.ToInt32(numericUpDown2.Value);
n = Convert.ToInt32(numericUpDown1.Value); Asa.Common.box.SetType(Asa.IOModule.Box_Type.DI, input, Asa.IOModule.Box_Type.DO, output);
Asa.Common.box.SetInput(Asa.IOModule.Box_Type.DI, n); Asa.Common.box.Upload = checkBox1.Checked;
Asa.Common.inputCount = n;
n = Convert.ToInt32(numericUpDown2.Value);
Asa.Common.box.SetOutput(Asa.IOModule.Box_Type.DO, n);
Asa.Common.outputCount = n;
n = Convert.ToInt32(numericUpDown3.Value);
Asa.Common.inputSleep = n;
if (checkBox1.Checked)
Asa.Common.box.AutoReadInput(true);
else
Asa.Common.box.AutoReadInput(true, n);
n = Convert.ToInt32(numericUpDown4.Value);
Asa.Common.box.AutoReadOutput(checkBox2.Checked, n);
Asa.Common.outputSleep = n;
Asa.Common.autoUpload = checkBox1.Checked;
Asa.Common.autoRead = checkBox2.Checked;
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
......
...@@ -37,7 +37,7 @@ namespace AIOBOX_Debug ...@@ -37,7 +37,7 @@ namespace AIOBOX_Debug
else else
{ {
label3.ForeColor = Color.Red; label3.ForeColor = Color.Red;
label3.Text = Asa.Common.box.ErrInfo; //label3.Text = Asa.Common.box.ErrInfo;
} }
} }
...@@ -64,7 +64,7 @@ namespace AIOBOX_Debug ...@@ -64,7 +64,7 @@ namespace AIOBOX_Debug
else else
{ {
label3.ForeColor = Color.Red; label3.ForeColor = Color.Red;
label3.Text = Asa.Common.box.ErrInfo; //label3.Text = Asa.Common.box.ErrInfo;
} }
} }
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
this.BtnIO = new System.Windows.Forms.Button(); this.BtnIO = new System.Windows.Forms.Button();
this.BtnCon = new System.Windows.Forms.Button(); this.BtnCon = new System.Windows.Forms.Button();
this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.ChkLog = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
...@@ -88,22 +87,11 @@ ...@@ -88,22 +87,11 @@
this.pictureBox2.TabIndex = 4; this.pictureBox2.TabIndex = 4;
this.pictureBox2.TabStop = false; this.pictureBox2.TabStop = false;
// //
// ChkLog
//
this.ChkLog.AutoSize = true;
this.ChkLog.Location = new System.Drawing.Point(255, 16);
this.ChkLog.Name = "ChkLog";
this.ChkLog.Size = new System.Drawing.Size(84, 16);
this.ChkLog.TabIndex = 5;
this.ChkLog.Text = "Log output";
this.ChkLog.UseVisualStyleBackColor = true;
//
// FrmMain // FrmMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(531, 393); this.ClientSize = new System.Drawing.Size(531, 393);
this.Controls.Add(this.ChkLog);
this.Controls.Add(this.pictureBox2); this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.BtnCon); this.Controls.Add(this.BtnCon);
this.Controls.Add(this.BtnIO); this.Controls.Add(this.BtnIO);
...@@ -119,7 +107,6 @@ ...@@ -119,7 +107,6 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
...@@ -130,7 +117,6 @@ ...@@ -130,7 +117,6 @@
private System.Windows.Forms.Button BtnIO; private System.Windows.Forms.Button BtnIO;
private System.Windows.Forms.Button BtnCon; private System.Windows.Forms.Button BtnCon;
private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.CheckBox ChkLog;
} }
} }
...@@ -30,17 +30,12 @@ namespace AIOBOX_Debug ...@@ -30,17 +30,12 @@ namespace AIOBOX_Debug
output.DO_Click += Output_DO_Click; output.DO_Click += Output_DO_Click;
Common.box = new Asa.IOModule.AIOBOX(); Common.box = new Asa.IOModule.AIOBOX();
Common.box.SetType(Asa.IOModule.Box_Type.DI, 16, Asa.IOModule.Box_Type.DO, 16);
Common.box.DI_Changed_Event += DI_Changed; Common.box.DI_Changed_Event += DI_Changed;
Common.box.DO_Changed_Event += DO_Changed; Common.box.DO_Changed_Event += DO_Changed;
Common.localIP = Common.box.GetLocalIP(); Common.localIP = Common.box.GetLocalIP();
Common.localIndex = 0; Common.localIndex = 0;
Common.inputCount = 16;
Common.outputCount = 16;
Common.inputSleep = 100;
Common.outputSleep = 100;
Common.autoUpload = false;
Common.autoRead = false;
} }
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
...@@ -80,8 +75,7 @@ namespace AIOBOX_Debug ...@@ -80,8 +75,7 @@ namespace AIOBOX_Debug
{ {
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog() == DialogResult.OK)
{ {
input.SetCount(Common.inputCount);
output.SetCount(Common.outputCount);
} }
} }
} }
...@@ -97,10 +91,8 @@ namespace AIOBOX_Debug ...@@ -97,10 +91,8 @@ namespace AIOBOX_Debug
} }
else else
{ {
if (ChkLog.Checked)
Common.box.LogPath(Application.StartupPath + "\\", Asa.IOModule.LogType.All);
else
Common.box.LogPath(null, Asa.IOModule.LogType.All);
Common.box.Connect(); Common.box.Connect();
if (Common.box.IsConn) if (Common.box.IsConn)
{ {
...@@ -110,7 +102,7 @@ namespace AIOBOX_Debug ...@@ -110,7 +102,7 @@ namespace AIOBOX_Debug
} }
else else
{ {
MessageBox.Show(Common.box.ErrInfo); MessageBox.Show("no");
} }
} }
} }
......
using System; using log4net.Config;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -14,6 +15,7 @@ namespace AIOBOX_Debug ...@@ -14,6 +15,7 @@ namespace AIOBOX_Debug
[STAThread] [STAThread]
static void Main() static void Main()
{ {
XmlConfigurator.Configure();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmMain()); Application.Run(new FrmMain());
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
// 运行时版本: 4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// 对此文件的更改可能导致不正确的行为,如果 // 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,则所做更改将丢失。 // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace AIOBOX_Debug.Properties namespace AIOBOX_Debug.Properties {
{ using System;
/// <summary> /// <summary>
/// 强类型资源类,用于查找本地化字符串等。 /// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary> /// </summary>
// 此类是由 StronglyTypedResourceBuilder // 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources internal class Resources {
{
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() internal Resources() {
{
} }
/// <summary> /// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。 /// 返回此类使用的缓存 ResourceManager 实例。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager internal static global::System.Resources.ResourceManager ResourceManager {
{ get {
get if (object.ReferenceEquals(resourceMan, null)) {
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AIOBOX_Debug.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AIOBOX_Debug.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
...@@ -52,18 +47,15 @@ namespace AIOBOX_Debug.Properties ...@@ -52,18 +47,15 @@ namespace AIOBOX_Debug.Properties
} }
/// <summary> /// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性 /// 重写当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找 /// 重写当前线程的 CurrentUICulture 属性
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture internal static global::System.Globalization.CultureInfo Culture {
{ get {
get
{
return resourceCulture; return resourceCulture;
} }
set set {
{
resourceCulture = value; resourceCulture = value;
} }
} }
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 此代码由工具生成。
// Runtime Version:4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // 对此文件的更改可能会导致不正确的行为,并且如果
// the code is regenerated. // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace AIOBOX_Debug.Properties namespace AIOBOX_Debug.Properties {
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default public static Settings Default {
{ get {
get
{
return defaultInstance; return defaultInstance;
} }
} }
......
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup> </startup>
<log4net>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file value="logs/AIOBOX.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>
<root>
<level value="Debug"/>
<appender-ref ref="AIOBOX"/>
</root>
</log4net>
</configuration> </configuration>
\ No newline at end of file \ No newline at end of file
此文件类型无法预览
272f251626441dc9b6a7d4299113b50176819cc3 ecacc4f6f8c94371b8970d4f613e33846da4701f
...@@ -14,3 +14,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\bin\Deb ...@@ -14,3 +14,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\bin\Deb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\bin\Debug\Asa.IOModule.AIOBOX.pdb D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\bin\Debug\Asa.IOModule.AIOBOX.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\bin\Debug\Asa.IOModule.AIOBOX.xml D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\bin\Debug\Asa.IOModule.AIOBOX.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\obj\Debug\AIOBOX_Debug_old.csproj.CopyComplete D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\obj\Debug\AIOBOX_Debug_old.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AIOBOX\AIOBOX_Debug_old\bin\Debug\log4net.dll
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</startup> </startup>
<log4net> <log4net>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender"> <appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file value="logs/ACStore-RC29-1.log"/> <file value="logs/AIOBOX.log"/>
<param name="Encoding" value="UTF-8"/> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
......
...@@ -30,11 +30,17 @@ ...@@ -30,11 +30,17 @@
{ {
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.button3 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// button1 // button1
// //
this.button1.Location = new System.Drawing.Point(255, 154); this.button1.Location = new System.Drawing.Point(12, 12);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(193, 75); this.button1.Size = new System.Drawing.Size(193, 75);
this.button1.TabIndex = 0; this.button1.TabIndex = 0;
...@@ -44,7 +50,7 @@ ...@@ -44,7 +50,7 @@
// //
// button2 // button2
// //
this.button2.Location = new System.Drawing.Point(255, 235); this.button2.Location = new System.Drawing.Point(12, 93);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(193, 75); this.button2.Size = new System.Drawing.Size(193, 75);
this.button2.TabIndex = 1; this.button2.TabIndex = 1;
...@@ -52,18 +58,60 @@ ...@@ -52,18 +58,60 @@
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click); this.button2.Click += new System.EventHandler(this.button2_Click);
// //
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(469, 93);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(66, 16);
this.checkBox1.TabIndex = 3;
this.checkBox1.Text = "WriteDO";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(469, 66);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(120, 21);
this.numericUpDown1.TabIndex = 4;
//
// numericUpDown2
//
this.numericUpDown2.Location = new System.Drawing.Point(269, 66);
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(120, 21);
this.numericUpDown2.TabIndex = 5;
//
// button3
//
this.button3.Location = new System.Drawing.Point(269, 93);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 6;
this.button3.Text = "button3";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.button3);
this.Controls.Add(this.numericUpDown2);
this.Controls.Add(this.numericUpDown1);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.button2); this.Controls.Add(this.button2);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "Form1"; this.Text = "Form1";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
...@@ -71,6 +119,10 @@ ...@@ -71,6 +119,10 @@
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button2;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.NumericUpDown numericUpDown2;
private System.Windows.Forms.Button button3;
} }
} }
...@@ -21,13 +21,13 @@ namespace WindowsFormsApp1 ...@@ -21,13 +21,13 @@ namespace WindowsFormsApp1
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
box.IP = "192.168.200.24";
box.Connect(); box.Connect();
} }
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
box.Upload = true; //box.Upload = true;
} }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) private void Form1_FormClosing(object sender, FormClosingEventArgs e)
...@@ -39,5 +39,16 @@ namespace WindowsFormsApp1 ...@@ -39,5 +39,16 @@ namespace WindowsFormsApp1
{ {
box.Close(); box.Close();
} }
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
box.WriteDO(Convert.ToInt32(numericUpDown1.Value), checkBox1.Checked ? Asa.IOModule.Box_Sta.On : Asa.IOModule.Box_Sta.Off);
}
private void button3_Click(object sender, EventArgs e)
{
Asa.IOModule.Box_Sta sta = box.ReadDI(Convert.ToInt32(numericUpDown2.Value));
button3.Text = sta == Asa.IOModule.Box_Sta.On ? "ON" : "OFF";
}
} }
} }
...@@ -50,14 +50,14 @@ ...@@ -50,14 +50,14 @@
是否连接 是否连接
</summary> </summary>
</member> </member>
<member name="P:Asa.IOModule.AIOBOX.MonitorDI"> <member name="P:Asa.IOModule.AIOBOX.InputCount">
<summary> <summary>
监控DI输入,索引数组 DI总数
</summary> </summary>
</member> </member>
<member name="P:Asa.IOModule.AIOBOX.MonitorDO"> <member name="P:Asa.IOModule.AIOBOX.OutputCount">
<summary> <summary>
监控DO输出,索引数组 DO总数
</summary> </summary>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.Connect"> <member name="M:Asa.IOModule.AIOBOX.Connect">
...@@ -151,6 +151,12 @@ ...@@ -151,6 +151,12 @@
<param name="sta"></param> <param name="sta"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.IOModule.AIOBOX.GetLocalIP">
<summary>
获取本地IPv4地址
</summary>
<returns></returns>
</member>
<member name="M:Asa.IOModule.AIOBOX.Send"> <member name="M:Asa.IOModule.AIOBOX.Send">
<summary> <summary>
发送命令线程 发送命令线程
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</startup> </startup>
<log4net> <log4net>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender"> <appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file value="logs/ACStore-RC29-1.log"/> <file value="logs/AIOBOX.log"/>
<param name="Encoding" value="UTF-8"/> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
......

\ No newline at end of file \ No newline at end of file
此文件的差异太大,无法显示。
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!