Commit cc671845 张东亮

20220930

1 个父辈 6660d2b8
正在显示 43 个修改的文件 包含 1521 行增加177 行删除
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio Version 17
VisualStudioVersion = 15.0.27130.2024 VisualStudioVersion = 17.3.32811.315
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "source\Common\Common.csproj", "{43CDD09E-FCF3-4960-A01D-3BBFE9933122}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "source\Common\Common.csproj", "{43CDD09E-FCF3-4960-A01D-3BBFE9933122}"
EndProject EndProject
...@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ABBRobotTest", "source\ABBR ...@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ABBRobotTest", "source\ABBR
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoubleLineClient", "source\DoubleLineClient_3D\DoubleLineClient.csproj", "{0D2542F5-DD62-4352-82D0-383D9A045E74}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoubleLineClient", "source\DoubleLineClient_3D\DoubleLineClient.csproj", "{0D2542F5-DD62-4352-82D0-383D9A045E74}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DL.IOModule", "..\RC1250-FeederLineClient\source\DL.IOModule\DL.IOModule.csproj", "{F85A7412-B5B3-4291-A448-A10564602E1A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -45,6 +47,10 @@ Global ...@@ -45,6 +47,10 @@ Global
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.ActiveCfg = Release|Any CPU {0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.Build.0 = Release|Any CPU {0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.Build.0 = Release|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F85A7412-B5B3-4291-A448-A10564602E1A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>ABBRobotTest</RootNamespace> <RootNamespace>ABBRobotTest</RootNamespace>
<AssemblyName>ABBRobotTest</AssemblyName> <AssemblyName>ABBRobotTest</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</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>
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,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>
......
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections> </configSections>
<appSettings> <appSettings>
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1" /> <add key="App_AutoRun" value="1"/>
<add key="App_Title" value="流水线客户端" /> <add key="App_Title" value="流水线客户端"/>
<!--Server address--> <!--Server address-->
<add key="http.server" value="http://localhost/myproject/service/store/emptyPosForPutin"/> <add key="http.server" value="http://localhost/myproject/service/store/emptyPosForPutin"/>
<!--storeType--> <!--storeType-->
<add key="Line_moveEquip_count" value="18" /> <add key="Line_moveEquip_count" value="18"/>
<add key="Line_feedingEquip_count" value="4" /> <add key="Line_feedingEquip_count" value="4"/>
<add key="Line_providingEquip_count" value="4" /> <add key="Line_providingEquip_count" value="4"/>
<add key ="Line_dischargeLine_count" value ="2"/> <add key="Line_dischargeLine_count" value="2"/>
<!--start oneSecondMoveconfig--> <!--start oneSecondMoveconfig-->
<add key="ConfigPath_Line" value="\LineConfig\Config_Line.csv" /> <add key="ConfigPath_Line" value="\LineConfig\Config_Line.csv"/>
<add key="ConfigPath_MoveEquip" value="\LineConfig\MoveEquip\Config_MoveEquip.csv" /> <add key="ConfigPath_MoveEquip" value="\LineConfig\MoveEquip\Config_MoveEquip.csv"/>
<add key="ConfigPath_FeedingEquip" value="\LineConfig\Config_FeedingEquip.csv" /> <add key="ConfigPath_FeedingEquip" value="\LineConfig\Config_FeedingEquip.csv"/>
<add key="ConfigPath_ProvidingEquip" value="\LineConfig\Config_ProvidingEquip.csv" /> <add key="ConfigPath_ProvidingEquip" value="\LineConfig\Config_ProvidingEquip.csv"/>
<add key ="ConfigPath_DischargeLine" value ="\LineConfig\Config_DischargeLine.csv"/> <add key="ConfigPath_DischargeLine" value="\LineConfig\Config_DischargeLine.csv"/>
<add key="Line_Type" value="RC_LINE" /> <add key="Line_Type" value="RC_LINE"/>
<add key="Line_CID" value="rc1250" /> <add key="Line_CID" value="rc1250"/>
<!--end oneSecondMoveconfig--> <!--end oneSecondMoveconfig-->
<!--摄像机名称列表配置,用#分割--> <!--摄像机名称列表配置,用#分割-->
<add key="CameraName" value="GigE:MV-CE100-30GC (00C69898519)#GigE:MV-CE100-30GC (00C95305929)" /> <add key="CameraName" value="GigE:MV-CE100-30GC (00C69898519)#GigE:MV-CE100-30GC (00C95305929)"/>
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code--> <!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="QR Code" /> <add key="CodeType" value="QR Code"/>
<!--<add key="CodeType" value="Data Matrix ECC 200"/>--> <!--<add key="CodeType" value="Data Matrix ECC 200"/>-->
<add key="ACBaudRate" value="115200" /> <add key="ACBaudRate" value="115200"/>
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" /> <add key="CodeParamPath" value="\CodeParam\"/>
<add key="Config_Pwd" value="123456" /> <add key="Config_Pwd" value="123456"/>
<!--出库等待料盘拿走的时间,秒--> <!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10" /> <add key="OutStoreWaitSeconds" value="10"/>
<add key="UseAIOBOX" value="1" /> <add key="UseAIOBOX" value="1"/>
<!--流水线监听端口--> <!--流水线监听端口-->
<add key="TCPServerPort" value="5246" /> <add key="TCPServerPort" value="5246"/>
<add key="ClientSettingsProvider.ServiceUri" value="" /> <add key="ClientSettingsProvider.ServiceUri" value=""/>
<add key ="DIMS" value ="120"/> <add key="DIMS" value="120"/>
<add key ="DOMS" value ="300"/> <add key="DOMS" value="300"/>
<add key ="LineRunTest" value ="1"/> <add key="LineRunTest" value="1"/>
<!--ABB机器人服务器--> <!--ABB机器人服务器-->
<add key ="ABBServerPort" value ="21"/> <add key="ABBServerPort" value="21"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/Line-RC1250.log" /> <file value="logs/Line-RC1250.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"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<root> <root>
<level value="Info" /> <level value="Info"/>
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender"/>
</root> </root>
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
</configuration> </configuration>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
// 运行时版本: 4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// 对此文件的更改可能导致不正确的行为,如果 // 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,则所做更改将丢失。 // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace ABBRobotTest.Properties namespace ABBRobotTest.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", "17.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("ABBRobotTest.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ABBRobotTest.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
...@@ -52,18 +47,15 @@ namespace ABBRobotTest.Properties ...@@ -52,18 +47,15 @@ namespace ABBRobotTest.Properties
} }
/// <summary> /// <summary>
/// 覆盖当前线程的 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 ABBRobotTest.Properties namespace ABBRobotTest.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", "17.3.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;
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace> <RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName> <AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace DL.Com
{
public class ComHelper
{
static UdpClient broadcastClient; //广播客户端
static IPEndPoint broadcastEndPoint; //广播远程节点
static byte[] broadcastBuffer; //远程返回数据
/// <summary>
/// 自动获取IP地址,未连接前使用,必须在同一网段
/// </summary>
/// <param name="localIP">本地IP地址</param>
/// <returns></returns>
public static bool AutoIP(string localIP,out string ip)
{
ip = "";
try
{
IPEndPoint local = new IPEndPoint(IPAddress.Parse(localIP), 55654);
broadcastClient = new UdpClient(local);
broadcastBuffer = null;
Thread tTemp = new Thread(new ThreadStart(GetIP));
tTemp.Start();
broadcastEndPoint = new IPEndPoint(IPAddress.Parse("255.255.255.255"), 1024);
byte[] dgram = new byte[] { 0x05, 0x00, 0x07, 0x00, 0x00, 0xC1, 0x59 };
broadcastClient.Send(dgram, dgram.Length, broadcastEndPoint);
Thread.Sleep(1000);
tTemp.Abort();
broadcastClient.Close();
//ErrInfo = "无法访问";
if (broadcastBuffer == null) return false;
if (broadcastBuffer[0] != 0x3B) return false;
byte[] buff = new byte[broadcastBuffer[7]];
Array.Copy(broadcastBuffer, 9, buff, 0, buff.Length);
ip = buff[buff.Length - 12] + "." + buff[buff.Length - 11] + "." + buff[buff.Length - 10] + "." + buff[buff.Length - 9];
//ErrInfo = "OK";
return true;
}
catch (Exception ex)
{
return false;
}
}
/// <summary>
/// 获取目标IP地址
/// </summary>
static void GetIP()
{
broadcastBuffer = broadcastClient.Receive(ref broadcastEndPoint);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F85A7412-B5B3-4291-A448-A10564602E1A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DL.IOModule</RootNamespace>
<AssemblyName>DL.IOModule</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AIOBOX\AIOBOX.cs" />
<Compile Include="CommHelper.cs" />
<Compile Include="HttpHelper.cs" />
<Compile Include="IOState.cs" />
<Compile Include="IOType.cs" />
<Compile Include="JsonHelper.cs" />
<Compile Include="LogUtil.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Protocol\Modbus\CoilRegister.cs" />
<Compile Include="Protocol\Modbus\DataFrame.cs" />
<Compile Include="Protocol\Modbus\DiscreteInputRegister.cs" />
<Compile Include="Protocol\Modbus\HoldingRegister.cs" />
<Compile Include="Protocol\Modbus\InputRegister.cs" />
<Compile Include="Protocol\Modbus\Register.cs" />
<Compile Include="StringHelper.cs" />
<Compile Include="TCP\ModbusTCPMaster.cs" />
<Compile Include="TCP\TcpClient.cs" />
<Compile Include="TCP\TcpServer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Protocol\Modbus\_system~.ini" />
<None Include="Protocol\_system~.ini" />
<None Include="TCP\_system~.ini" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{43CDD09E-FCF3-4960-A01D-3BBFE9933122}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Utils
{
public class HttpHelper
{
/// <summary>
/// 检查IP是否合法
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public static bool CheckIP(string ip,string name="")
{
//IP合法
string pattern = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$";
bool rtn = System.Text.RegularExpressions.Regex.IsMatch(ip, pattern);
if (!rtn)
{
LogUtil.Error($"【{name}】非法的IP地址:" + ip);
return false;
}
return true;
}
/// <summary>
/// Ping指定IP
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public static bool PingIP(string ip)
{
//Ping服务端
try
{
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply result = ping.Send(ip, 2000);
ping.Dispose();
if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
{
return false;
}
return true;
}
catch (Exception ex)
{
LogUtil.Error($"PingIP{ip}:", ex);
return false;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace DL.IOModule
{
public enum Box_Sta : byte
{
/// <summary>
/// 断开,关闭,低电平
/// </summary>
Off,
/// <summary>
/// 闭合,打开,高电平
/// </summary>
On
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace DL.IOModule
{
/// <summary>
/// IO模块类型
/// </summary>
public enum IOType : byte
{
/// <summary>
/// 数字信号输入
/// </summary>
DI,
/// <summary>
/// 数字信号输出
/// </summary>
DO,
/// <summary>
/// 模拟量输入
/// </summary>
AI,
/// <summary>
/// 模拟量输出
/// </summary>
AO
}
}
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace DL.Utils
{
/// <summary>
/// Json帮助类
/// </summary>
public class JsonHelper
{
/// <summary>
/// 将对象序列化为JSON格式
/// </summary>
/// <param name="o">对象</param>
/// <returns>json字符串</returns>
public static string SerializeObject(object o)
{
string json = JsonConvert.SerializeObject(o);
return json;
}
/// <summary>
/// 解析JSON字符串生成对象实体
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json字符串(eg.{"ID":"112","Name":"石子儿"})</param>
/// <returns>对象实体</returns>
public static T DeserializeJsonToObject<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
T t = o as T;
return t;
}
/// <summary>
/// 解析JSON数组生成对象实体集合
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="json">json数组字符串(eg.[{"ID":"112","Name":"石子儿"}])</param>
/// <returns>对象实体集合</returns>
public static List<T> DeserializeJsonToList<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
List<T> list = o as List<T>;
return list;
}
/// <summary>
/// 反序列化JSON到给定的匿名对象.
/// </summary>
/// <typeparam name="T">匿名对象类型</typeparam>
/// <param name="json">json字符串</param>
/// <param name="anonymousTypeObject">匿名对象</param>
/// <returns>匿名对象</returns>
public static T DeserializeAnonymousType<T>(string json, T anonymousTypeObject)
{
T t = JsonConvert.DeserializeAnonymousType(json, anonymousTypeObject);
return t;
}
}
///// <summary>
///// 与服务器通信用对象
///// </summary>
//public class Operation
//{
// private string _cid = "";
// public string cid
// {
// get { return _cid; }
// set { _cid = value; }
// }
// public int seq { get; set; }
// public int op { get; set; }
// public int status { get; set; }
// private string _error = "";
// public string error
// {
// get { return _error; }
// set { _error = value; }
// }
// private Dictionary<string, string> _data = new Dictionary<string,string>();
// public Dictionary<string, string> data {
// get { return _data; }
// set { _data = value; }
// }
//}
}
using log4net;
using System;
using System.Reflection;
using System.Drawing;
using log4net.Repository;
using log4net.Config;
using System.IO;
using System.Text;
using System.Collections.Generic;
namespace DL.Utils
{
public class LogUtil
{
static Dictionary<string, ILog> LogMap = new Dictionary<string, ILog>();
public delegate void ShowMsg(string msg);
public static event ShowMsg ShowDebug;
public static event ShowMsg ShowInfo;
public static event ShowMsg ShowWarn;
public static event ShowMsg ShowError;
static readonly ILog defaultLog = LogManager.GetLogger("AIOBOX");
public static void Init()
{
XmlConfigurator.Configure(new FileInfo("log4net.config"));
LogMap.Add("AIOBOX", defaultLog);
}
public static void AddLogMap(string key, ILog log)
{
LogMap.Add(key, log);
}
#region Main log
public static void Debug(string msg, ILog log = null)
{
ShowDebug?.Invoke(msg);
if (log == null)
defaultLog.Debug(msg);
else
log.Debug(msg);
}
public static void Info(string msg, ILog log = null)
{
ShowInfo?.Invoke(msg);
if (log == null)
defaultLog.Info(msg);
else
log.Info(msg);
}
public static void Info(string msg, string logName)
{
ShowInfo?.Invoke(msg);
if (string.IsNullOrEmpty(logName))
defaultLog.Info(msg);
else if (LogMap.ContainsKey(logName) && LogMap[logName] != null)
LogMap[logName].Info(msg);
}
public static void Warn(string msg, ILog log = null)
{
ShowWarn?.Invoke(msg);
if (log == null)
defaultLog.Warn(msg);
else
log.Warn(msg);
}
public static void Error(string msg, Exception exception, ILog log)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (log == null)
{
if (exception == null)
defaultLog.Error(msg);
else
{
defaultLog.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
else
{
if (exception == null)
log.Error(msg);
else
{
log.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg, ILog log, Exception exception)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (log == null)
{
if (exception == null)
defaultLog.Error(msg);
else
{
defaultLog.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
else
{
if (exception == null)
log.Error(msg);
else
{
log.Error(msg, exception);
sb.Append(exception.StackTrace);
}
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg, ILog log)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (log == null)
{
defaultLog.Error(msg);
}
else
{
log.Error(msg);
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg, Exception exception)
{
StringBuilder sb = new StringBuilder(msg + "\r\n");
if (exception == null)
defaultLog.Error(msg);
else
{
defaultLog.Error(msg, exception);
sb.Append(exception.StackTrace);
}
ShowError?.Invoke(sb.ToString());
}
public static void Error(string msg)
{
defaultLog.Error(msg);
ShowError?.Invoke(msg);
}
#endregion
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DL.IOModule")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DL.IOModule")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f85a7412-b5b3-4291-a448-a10564602e1a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 线圈寄存器:可读可写。
/// 支持的功能码:
/// 0x01:读线圈
/// 0x05:写线圈
/// 0x0F:写多个线圈
/// </summary>
public class CoilRegister : Register
{
public CoilRegister() : base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x01);
FunctionCodes.Add(RegisterFunction.WriteSingle, 0x05);
FunctionCodes.Add(RegisterFunction.WriteMultiple, 0x0F);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"0{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
/// <summary>
/// 解析写单个线圈
/// </summary>
/// <returns>写入成功</returns>
protected override bool ParseWriteSingle(byte[] respoonse)
{
if (GetResponseResult(respoonse, out byte[] data))
{
//数据部分,发送与接收一致
byte[] senddata = FrameStruct.PDU.Data.ToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
/// <summary>
/// 解析写多个线圈
/// </summary>
/// <returns>写入成功/returns>
protected override bool ParseWriteMultiple(byte[] response)
{
if (GetResponseResult(response, out byte[] data))
{
byte[] senddata = FrameStruct.PDU.Data.AddrValueToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
protected override void SetParamPDU(CmdByte cmd)
{
if (cmd.Function.Equals(RegisterFunction.WriteSingle))
{
SetPDU(cmd.Function, cmd.StartAddr, cmd.Count.Equals(new Byte2 { ByteH = 0x00, ByteL = 0x00 }) ? cmd.Count : new Byte2 { ByteH = 0xFF, ByteL = 0x00 }, cmd.ByteLength, cmd.ValuesOfMultiple);
}
else if (cmd.Function.Equals(RegisterFunction.WriteMultiple))
{
SetPDU(cmd.Function, cmd.StartAddr, cmd.Count, cmd.ByteLength, cmd.ValuesOfMultiple);
}
else
{
SetPDU(RegisterFunction.Read, cmd.StartAddr, cmd.Count);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 离散输入寄存器
/// 功能码0x02
/// </summary>
public class DiscreteInputRegister:Register
{
/// <summary>
/// 离散输入寄存器
/// 功能码0x02
/// </summary>
public DiscreteInputRegister() :base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x02);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"1{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
protected override bool ParseWriteMultiple(byte[] response)
{
throw new NotImplementedException();
}
protected override bool ParseWriteSingle(byte[] response)
{
throw new NotImplementedException();
}
protected override void SetParamPDU(CmdByte cmdByte)
{
SetPDU(RegisterFunction.Read, cmdByte.StartAddr, cmdByte.Count);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 保持寄存器
/// 0x03
/// </summary>
public class HoldingRegister : Register
{
public HoldingRegister() : base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x03);
FunctionCodes.Add(RegisterFunction.WriteSingle, 0x06);
FunctionCodes.Add(RegisterFunction.WriteMultiple, 0x10);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"4{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
public override byte[] GetRequestBytes(RegisterFunction func, ushort startAddr, ushort countOrValue,byte equipAddr=1, ushort[] ValuesOfMultiple = null)
{
CmdByte cmdByte = new CmdByte();
cmdByte.StartAddr = Byte2.GetStru2Byte(startAddr);
cmdByte.Function = func;
cmdByte.Count = Byte2.GetStru2Byte(countOrValue);
if (func.Equals(RegisterFunction.WriteMultiple))
{
if (ValuesOfMultiple == null)
return null;
List<byte> values = new List<byte>();
foreach (var item in ValuesOfMultiple)
{
values.AddRange(Byte2.GetStru2Byte(item).ToBytes());
}
cmdByte.ByteLength = (byte)(countOrValue * 2);
cmdByte.ValuesOfMultiple = values.ToArray();
}
SetMBAP(_serialnum, equipAddr);
SetParamPDU(cmdByte);
return DataFrame;
}
protected override void SetParamPDU(CmdByte cmdByte)
{
if (cmdByte.Function.Equals(RegisterFunction.WriteSingle))
{
SetPDU(cmdByte.Function, cmdByte.StartAddr, cmdByte.Count, cmdByte.ByteLength, cmdByte.ValuesOfMultiple);
}
else if (cmdByte.Function.Equals(RegisterFunction.WriteMultiple))
{
SetPDU(cmdByte.Function, cmdByte.StartAddr, cmdByte.Count, cmdByte.ByteLength, cmdByte.ValuesOfMultiple);
}
else
SetPDU(RegisterFunction.Read, cmdByte.StartAddr, cmdByte.Count);
}
protected override bool ParseWriteSingle(byte[] response)
{
if (GetResponseResult(response, out byte[] data))
{
//数据部分,发送与接收一致
byte[] senddata = FrameStruct.PDU.Data.ToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
protected override bool ParseWriteMultiple(byte[] response)
{
if (GetResponseResult(response, out byte[] data))
{
byte[] senddata = FrameStruct.PDU.Data.AddrValueToBytes();
if (data != null && data.Length != senddata.Length)
return false;
for (int i = 0; i < senddata.Length; i++)
{
if (senddata[i] != data[i])
{
return false;
}
}
return true;
}
return false;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DL.Com.Protocol.Modbus
{
/// <summary>
/// 输入寄存器
/// 支持的功能码0x04
/// </summary>
public class InputRegister : Register
{
public InputRegister() : base()
{
FunctionCodes.Add(RegisterFunction.Read, 0x04);
}
/// <summary>
/// PLC地址
/// </summary>
public new string PLCAddress
{
get { return $"3{FrameStruct.PDU.Data.Addr.GetIntValue()}"; }
}
protected override bool ParseWriteMultiple(byte[] response)
{
throw new NotImplementedException();
}
protected override bool ParseWriteSingle(byte[] response)
{
throw new NotImplementedException();
}
protected override void SetParamPDU(CmdByte cmdByte)
{
SetPDU(RegisterFunction.Read, cmdByte.StartAddr, cmdByte.Count);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DL.Utils
{
public class StringHelper
{
/// <summary>
/// 字节转十六进制字符串
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
public static string ToHexString(byte[] buff)
{
StringBuilder sb = new StringBuilder("");
if (buff == null || buff.Length<1) return sb.ToString();
for (int i = 0; i < buff.Length; i++)
{
sb.Append(buff[i].ToString("X2"));
sb.Append(" ");
}
sb.Remove(sb.Length - 1, 1);
return sb.ToString();
}
public static string ToBinaryString(byte[] data)
{
StringBuilder stringBuilder = new StringBuilder("");
if (data == null || data.Length < 1) return stringBuilder.ToString();
stringBuilder.Append("【");
foreach (var item in data)
{
stringBuilder.Append(Convert.ToString(item, 2).PadLeft(8, '0'));
stringBuilder.Append(" ");
}
stringBuilder.Remove(stringBuilder.Length - 1, 1);
stringBuilder.Append("】");
return stringBuilder.ToString();
}
public static string ToHexString(byte data)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("【");
stringBuilder.Append(data.ToString("x2"));
stringBuilder.Append("】");
return stringBuilder.ToString();
}
public static byte[] StrToHexByte(string hexString)
{
hexString = hexString.Replace(" ", "");
if ((hexString.Length % 2) != 0)
hexString += " ";
byte[] returnBytes = new byte[hexString.Length / 2];
for (int i = 0; i < returnBytes.Length; i++)
{
returnBytes[i]=Convert.ToByte(hexString.Substring(i*2,2),16);
}
return returnBytes;
}
/// <summary>
/// 获取类的属性名及其值
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="t"></param>
/// <returns></returns>
public static string GetPropertiesStr<T>(T t)
{
StringBuilder sb = new StringBuilder("");
if (t == null)
{
return sb.ToString();
}
System.Reflection.PropertyInfo[] properties = t.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
if (properties.Length <= 0)
{
return sb.ToString();
}
sb.Append("{");
foreach (System.Reflection.PropertyInfo property in properties)
{
string name = property.Name;
object value = property.GetValue(t, null);
if (property.PropertyType.IsValueType || property.PropertyType.Name.StartsWith("String"))
{
sb.Append($"{name}:{value},");
}
else if(property.PropertyType.IsGenericType)
{
var listVal = property.GetValue(t, null) as IEnumerable<object>;
if (listVal == null) continue;
sb.Append("[");
foreach (var item1 in listVal)
{
sb.Append(GetPropertiesStr(item1));
}
sb.Append("]");
}
else if(property.PropertyType.IsArray)
{
var listVal = property.GetValue(t, null) as IEnumerable<object>;
if (listVal == null) continue;
sb.Append("[");
foreach (var item1 in listVal)
{
sb.Append(GetPropertiesStr(item1));
}
sb.Append("]");
}
else
{
sb.Append(GetPropertiesStr(value));
}
}
sb.Append("}");
return sb.ToString();
}
}
}
using DL.Utils;
using log4net;
using System;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
namespace DL.Com.TCP
{
public class TcpClient
{
public delegate void HandleMessage(string message, byte[] data);
private Socket m_clientSocket = null;
private byte[] m_receiveBuffer = new byte[1024];
private HandleMessage onReceived;
public int TimeOutTime = 0;
public string IP { get; set; }
public int Port { get; set; }
public TcpClient()
{
}
/// <summary>
/// 当前连接状态
/// </summary>
public bool IsConnected()
{
if (m_clientSocket == null)
{
return false;
}
return m_clientSocket.Connected;
//if (m_clientSocket.Connected)
//{
// return true;
//}
#region remarks
/********************************************************************************************
* 当Socket.Conneted为false时, 如果您需要确定连接的当前状态,请进行非阻塞、零字节的 Send 调用。
* 如果该调用成功返回或引发 WAEWOULDBLOCK 错误代码 (10035),则该套接字仍然处于连接状态;
* 否则,该套接字不再处于连接状态。
* Depending on http://msdn.microsoft.com/zh-cn/library/system.net.sockets.socket.connected.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2
********************************************************************************************/
#endregion
try
{
#region 过程
// This is how you can determine whether a socket is still connected.
bool connectState = true;
bool blockingState = m_clientSocket.Blocking;
try
{
byte[] tmp = new byte[1];
m_clientSocket.Blocking = false;
m_clientSocket.Send(tmp, 0, 0);
//Console.WriteLine("Connected!");
connectState = true; //若Send错误会跳去执行catch体,而不会执行其try体里其之后的代码
}
catch (SocketException e)
{
// 10035 == WSAEWOULDBLOCK
if (e.NativeErrorCode.Equals(10035))
{
connectState = true;
}
else
{
connectState = false;
}
}
finally
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Blocking = blockingState;
}
}
//Console.WriteLine("Connected: {0}", client.Connected);
return connectState;
#endregion
}
catch (Exception ex)
{
//Log.Error("IsConnected 出错", log, ex);
return false;
}
}
/// <summary>
/// 连接服务器
/// </summary>
public bool Connect(string serverIP, int serverPort, HandleMessage HandleMessage)
{
IP=serverIP;
Port=serverPort;
m_clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
if (TimeOutTime <= 0)
{
IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse(serverIP), serverPort);
m_clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
try
{
if (!m_clientSocket.Connected)
{
m_clientSocket.Connect(remoteEndPoint);
}
if (m_clientSocket.Connected)
{
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
onReceived = HandleMessage;
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " success!");
return true;
}
else
{
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " fail!");
}
}
catch (Exception ex)
{
LogUtil.Error("Connect to " + serverIP + ":" + serverPort + " fail!", ex);
//m_clientSocket = null;
}
}
else
{
m_clientSocket.ReceiveTimeout = TimeOutTime;
m_clientSocket.SendTimeout = TimeOutTime;
IAsyncResult connResult = m_clientSocket.BeginConnect(serverIP, serverPort, null, null);
connResult.AsyncWaitHandle.WaitOne(this.TimeOutTime, true); //等待2秒
if (!connResult.IsCompleted || (!m_clientSocket.Connected))
{
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " fail!");
m_clientSocket.Close();
//处理连接不成功的动作
return false;
}
else
{
//处理连接成功的动作
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
onReceived = HandleMessage;
LogUtil.Info("Connect to " + serverIP + ":" + serverPort + " success!");
return true;
}
}
return false;
}
/// <summary>
/// 断开连接
/// </summary>
public void Close()
{
try
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Shutdown(SocketShutdown.Both);
//Thread.Sleep(300);
//m_clientSocket.Disconnect(true);
//Thread.Sleep(300);
m_clientSocket.Close();
//m_clientSocket = null;
LogUtil.Info("Socket closed!");
}
else
{
LogUtil.Error("No socket is running!");
}
}
catch (Exception ex)
{
LogUtil.Error("close error", ex);
}
}
/// <summary>
/// 发送信息
/// </summary>
public void Send(string strSendData)
{
byte[] sendBuffer = new byte[1024];
sendBuffer = Encoding.UTF8.GetBytes(strSendData);
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Send(sendBuffer);
LogUtil.Debug("Send >> " + strSendData);
}
}
public bool Send(byte[] bytes)
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
m_clientSocket.Send(bytes);
LogUtil.Debug("Send >> " + StringHelper.ToHexString(bytes));
return true;
}
return false;
}
private void ReceiveCallBack(IAsyncResult ar)
{
try
{
if (m_clientSocket != null && m_clientSocket.Connected)
{
int REnd = m_clientSocket.EndReceive(ar);
string strReceiveData = Encoding.Default.GetString(m_receiveBuffer, 0, REnd);
byte[] tmp = new byte[REnd];
Array.Copy(m_receiveBuffer, tmp, REnd);
onReceived(strReceiveData, tmp);
Thread.Sleep(100);
m_clientSocket.BeginReceive(m_receiveBuffer, 0, m_receiveBuffer.Length, 0, new AsyncCallback(ReceiveCallBack), null);
}
}
catch (Exception ex)
{
LogUtil.Error("socket received error", ex);
}
}
}
}

using DL.Utils;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DL.Com
{
public class UdpServer
{
static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod()?.DeclaringType);
private Thread m_serverThread;
private Socket udpServer;
public delegate void ReviceMsg(EndPoint address, string Msg);
/// <summary>
/// 接受到数据事件
/// </summary>
public event ReviceMsg ReviceMsgEvent;
private bool isRun = true;
private int serverPort;
private void logLocalIp()
{
string[] addresses = GetLocalAddresses();
string iplist = "本机IP:[";
if (addresses.Length > 0)
{
for (int i = 0; i < addresses.Length; i++)
{
if (addresses.Length != 0)
{
iplist = iplist + " " + addresses[i];
}
}
}
LogUtil.Info(iplist + "]",log);
}
public UdpServer(int m_serverPort)
{
serverPort = m_serverPort;
}
/// <summary>
/// 开始服务
/// </summary>
public bool Start()
{
try
{
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, serverPort);//定义一网络端点
udpServer = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);//定义一个Socket
udpServer.Bind(ipep);//Socket与本地的一个终结点相关联
m_serverThread = new Thread(new ThreadStart(ReceiveData));
m_serverThread.Start();
logLocalIp();
isRun = true;
return true;
}
catch (Exception ex)
{
LogUtil.Error("启动udpserver出错" ,log,ex);
}
return false;
}
/// <summary>
/// 停止服务
/// </summary>
public bool Stop()
{
try
{
isRun = false;
m_serverThread.Interrupt(); // 线程终止
udpServer.Close(); // Socket Close
return true;
}
catch (Exception ex)
{
LogUtil.Error("Stop Udpserver出错",log,ex);
}
return false;
}
private StringBuilder sb = new StringBuilder(); //这个是用来保存:接收到了的,但是还没有结束的消息
private int receiveBufferSize = 1024;
/// <summary>
/// 结束符
/// </summary>
public string terminateString = "\r";
private void ReceiveData()
{
try
{
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);//定义要发送的计算机的地址
EndPoint Remote = (EndPoint)(sender);//
while (true)
{
byte[] buffer = new byte[receiveBufferSize];
int receivedSize = udpServer.ReceiveFrom(buffer, ref Remote);
if (receivedSize > 0)
{
string rawMsg = Encoding.ASCII.GetString(buffer, 0, receivedSize);
int rnFixLength = terminateString.Length; //这个是指消息结束符的长度,此处为\r\n
for (int i = 0; i < rawMsg.Length;) //遍历接收到的整个buffer文本
{
if (i <= rawMsg.Length - rnFixLength)
{
if (rawMsg.Substring(i, rnFixLength) != terminateString)//非消息结束符,则加入sb
{
sb.Append(rawMsg[i]);
i++;
}
else
{
this.ReviceMsgEvent.Invoke(Remote, sb.ToString());//找到了消息结束符,触发消息接收完成事件
sb = new StringBuilder();
i += rnFixLength;
}
}
else
{
sb.Append(rawMsg[i]);
i++;
}
}
}
Thread.Sleep(500);
}
}
catch (Exception ex)
{
LogUtil.Error("启动udpserver出错:" ,log,ex);
}
}
/// <summary>
/// 获取本机地址列表
/// </summary>
public string[] GetLocalAddresses()
{
// 获取主机名
string strHostName = Dns.GetHostName();
// 根据主机名进行查找
IPHostEntry iphostentry = Dns.GetHostEntry(strHostName);
string[] retval = new string[iphostentry.AddressList.Length];
int i = 0;
foreach (IPAddress ipaddress in iphostentry.AddressList)
{
if (ipaddress.AddressFamily != AddressFamily.InterNetworkV6)
{
retval[i] = ipaddress.ToString();
i++;
}
}
return retval;
}
public bool IsOnline(string addr = "")
{
return isRun;
}
public string GetAddr()
{
return $"{string.Join(",",GetLocalAddresses())}:{serverPort}";
}
}
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace> <RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName> <AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
...@@ -41,9 +41,6 @@ ...@@ -41,9 +41,6 @@
<Reference Include="ABB.Robotics.Controllers.PC"> <Reference Include="ABB.Robotics.Controllers.PC">
<HintPath>..\..\dll\ABB\ABB.Robotics.Controllers.PC.dll</HintPath> <HintPath>..\..\dll\ABB\ABB.Robotics.Controllers.PC.dll</HintPath>
</Reference> </Reference>
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID.HiStation, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Asa.RFID.HiStation, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Asa.RFID.HiStation.dll</HintPath> <HintPath>..\..\dll\Asa.RFID.HiStation.dll</HintPath>
...@@ -123,6 +120,10 @@ ...@@ -123,6 +120,10 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\RC1250-FeederLineClient\source\DL.IOModule\DL.IOModule.csproj">
<Project>{f85a7412-b5b3-4291-a448-a10564602e1a}</Project>
<Name>DL.IOModule</Name>
</ProjectReference>
<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>
......
...@@ -8,7 +8,8 @@ using System.Threading; ...@@ -8,7 +8,8 @@ using System.Threading;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System.Threading.Tasks; using System.Threading.Tasks;
using Asa.IOModule; //using Asa.IOModule;
using DL.IOModule;
using System.Windows.Forms; using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
...@@ -82,16 +83,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,16 +83,10 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
aioBox = new AIOBOX(); aioBox = new AIOBOX();
//aioBox.LogPath(Application.StartupPath + @"\logs\aio\", LogType.OnlyError);
aioBox.IP = ioIp; aioBox.IP = ioIp;
aioBox.Upload = true; aioBox.SetType(IOType.DI, DILength, IOType.DO, DOLength);
aioBox.SetType(Box_Type.DI, DILength, Box_Type.DO, DOLength);
//aioBox.SetInput(Asa.IOModule.Box_Type.DI, DILength);
//aioBox.SetOutput(Asa.IOModule.Box_Type.DO, DOLength);
//DI主动上传 //DI主动上传
//aioBox.AutoReadInput(true,DIMS); aioBox.Upload = true;
//aioBox.AutoReadOutput(false, DOMS);
aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ; aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ;
......
...@@ -349,11 +349,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -349,11 +349,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_C07_ToS1)) else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_C07_ToS1))
{ {
if(SOneMoveInfo.IsTimeOut(15)) //if(SOneMoveInfo.IsTimeOut(15))
{ //{
S1LineRun(SOneMoveInfo); // S1LineRun(SOneMoveInfo);
} //}
else //else
{ {
IOMove(IO_Type.M_LineRun, IO_VALUE.LOW); IOMove(IO_Type.M_LineRun, IO_VALUE.LOW);
S1_WaitTopUp(); S1_WaitTopUp();
...@@ -398,6 +398,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -398,6 +398,7 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove(IO_Type.M_RightStopCylinder, IO_VALUE.HIGH); CheckAndMove(IO_Type.M_RightStopCylinder, IO_VALUE.HIGH);
IOMove(IO_Type.LHigh_LineRun, IO_VALUE.HIGH); IOMove(IO_Type.LHigh_LineRun, IO_VALUE.HIGH);
IOMove(IO_Type.M_LineBackRun, IO_VALUE.LOW);
IOMove(IO_Type.M_LineRun, IO_VALUE.HIGH); IOMove(IO_Type.M_LineRun, IO_VALUE.HIGH);
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LHigh_LineRun, IO_VALUE.HIGH, true)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LHigh_LineRun, IO_VALUE.HIGH, true));
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.M_LineRun, IO_VALUE.HIGH, true)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.M_LineRun, IO_VALUE.HIGH, true));
...@@ -411,6 +412,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -411,6 +412,7 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove(IO_Type.M_RightStopCylinder, IO_VALUE.LOW); CheckAndMove(IO_Type.M_RightStopCylinder, IO_VALUE.LOW);
IOMove(IO_Type.RHigh_LineRun, IO_VALUE.HIGH); IOMove(IO_Type.RHigh_LineRun, IO_VALUE.HIGH);
IOMove(IO_Type.M_LineRun, IO_VALUE.LOW);
IOMove(IO_Type.M_LineBackRun, IO_VALUE.HIGH); IOMove(IO_Type.M_LineBackRun, IO_VALUE.HIGH);
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RHigh_LineRun, IO_VALUE.HIGH, true)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RHigh_LineRun, IO_VALUE.HIGH, true));
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.M_RightStopCheck, IO_VALUE.HIGH)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.M_RightStopCheck, IO_VALUE.HIGH));
...@@ -520,7 +522,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -520,7 +522,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_D19_ToS1)) else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_D19_ToS1))
{ {
if(SOneMoveInfo.IsTimeOut(15)) if (SOneMoveInfo.IsTimeOut(15))
{ {
S1LineRun(SOneMoveInfo); S1LineRun(SOneMoveInfo);
} }
...@@ -642,22 +644,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -642,22 +644,17 @@ namespace OnlineStore.DeviceLibrary
SOneMoveInfo.NextMoveStep(MoveStep.S1_42_WaitInLeft); SOneMoveInfo.NextMoveStep(MoveStep.S1_42_WaitInLeft);
S1Log(" 右->S1切换 ,等待" + S1SName + " 完全进入左侧"); S1Log(" 右->S1切换 ,等待" + S1SName + " 完全进入左侧");
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.PreS1_NegStopCheck, IO_VALUE.HIGH)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.PreS1_NegStopCheck, IO_VALUE.HIGH));
//SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_NegStopCheck, IO_VALUE.LOW));
// SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
} }
else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_42_WaitInLeft)) else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_42_WaitInLeft))
{ {
IOMove(IO_Type.S1_NegStopCylinder, IO_VALUE.LOW);
SOneMoveInfo.NextMoveStep(MoveStep.S1_43_WaitRightToS1); SOneMoveInfo.NextMoveStep(MoveStep.S1_43_WaitRightToS1);
IOMove(IO_Type.S1_NegStopCylinder, IO_VALUE.LOW);
CheckAndMove(IO_Type.S1_PosStopCylinder, IO_VALUE.HIGH);
S1Log(" 右->S1切换 :" + S1SName + "到达左侧,记录料架号,等待右侧料架可以切换到S1"); S1Log(" 右->S1切换 :" + S1SName + "到达左侧,记录料架号,等待右侧料架可以切换到S1");
S1_LeftShelfId = S1_CurrShelfId; S1_LeftShelfId = S1_CurrShelfId;
S1_CurrShelfId = ""; S1_CurrShelfId = "";
S2CanGetShelf = false; S2CanGetShelf = false;
//SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S2_LineRun, IO_VALUE.LOW));
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_NegStopCheck, IO_VALUE.HIGH)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_NegStopCheck, IO_VALUE.HIGH));
CheckAndMove(IO_Type.S1_NegStopCylinder, IO_VALUE.LOW);
CheckAndMove(IO_Type.S1_PosStopCylinder, IO_VALUE.HIGH);
} }
else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_43_WaitRightToS1)) else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_43_WaitRightToS1))
...@@ -668,25 +665,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -668,25 +665,18 @@ namespace OnlineStore.DeviceLibrary
RFIDManager.ReadRFID(Config.S1_Rfid, true); RFIDManager.ReadRFID(Config.S1_Rfid, true);
CheckAndMove(IO_Type.S1_NegStopCylinder, IO_VALUE.LOW); CheckAndMove(IO_Type.S1_NegStopCylinder, IO_VALUE.LOW);
CheckAndMove(IO_Type.S1_PosStopCylinder, IO_VALUE.HIGH); CheckAndMove(IO_Type.S1_PosStopCylinder, IO_VALUE.HIGH);
S1BackRun(); S1BackRun(SOneMoveInfo);
//S2BackRun();
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.AftS1_StopCheck, IO_VALUE.LOW)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.AftS1_StopCheck, IO_VALUE.LOW));
} }
else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_44_RightToS1)) else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_44_RightToS1))
{ {
if(SOneMoveInfo.IsTimeOut(15))
{
S1BackRun();
}
else
{
SOneMoveInfo.NextMoveStep(MoveStep.S1_44_WaitShelfInS1); SOneMoveInfo.NextMoveStep(MoveStep.S1_44_WaitShelfInS1);
S1Log(" 右->S1切换 :等待" + RightSName + "完全在S1"); S1Log(" 右->S1切换 :等待" + RightSName + "完全在S1");
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_NegStopCheck, IO_VALUE.HIGH)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_NegStopCheck, IO_VALUE.HIGH));
} SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
} }
else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_44_WaitShelfInS1)) else if (SOneMoveInfo.MoveStep.Equals(MoveStep.S1_44_WaitShelfInS1))
{ {
...@@ -695,10 +685,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -695,10 +685,7 @@ namespace OnlineStore.DeviceLibrary
S2CanGetShelf = true; S2CanGetShelf = true;
SOneMoveInfo.NextMoveStep(MoveStep.S1_45_LeftOnS1); SOneMoveInfo.NextMoveStep(MoveStep.S1_45_LeftOnS1);
S1Log(" 右->S1切换 :" + RightSName + "到达S1,S1停止,S2停止,等待300后顶升"); S1Log(" 右->S1切换 :" + RightSName + "到达S1,S1停止,S2停止,等待300后顶升");
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
S1LineStop(SOneMoveInfo); S1LineStop(SOneMoveInfo);
//S2LineStop(SOneMoveInfo);
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
} }
...@@ -1016,12 +1003,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -1016,12 +1003,10 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SOneMoveInfo, IO_Type.S1_TopCylinderUp, IO_Type.S1_TopCylinderDown); CylinderMove(SOneMoveInfo, IO_Type.S1_TopCylinderUp, IO_Type.S1_TopCylinderDown);
Thread.Sleep(100); Thread.Sleep(100);
S1LineRun(SOneMoveInfo); S1LineRun(SOneMoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_TopCylinderDown1, IO_VALUE.HIGH)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_TopCylinderDown1, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_TopCylinderDown2, IO_VALUE.HIGH)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_TopCylinderDown2, IO_VALUE.HIGH));
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.AftS1_StopCheck, IO_VALUE.HIGH)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.AftS1_StopCheck, IO_VALUE.HIGH));
SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_PosStopCheck, IO_VALUE.LOW)); SOneMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.S1_PosStopCheck, IO_VALUE.LOW));
Thread.Sleep(100);
S1LineRun();
} }
private void Start_LeftShelfToS1(MoveStep nextStep, string movetype) private void Start_LeftShelfToS1(MoveStep nextStep, string movetype)
......
...@@ -142,6 +142,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -142,6 +142,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("左侧双层线_" + "入口提升机中有料架 开始料架进入处理"); LogUtil.info("左侧双层线_" + "入口提升机中有料架 开始料架进入处理");
//开始料架进入处理 //开始料架进入处理
MoveInfo.NewMove(LineMoveType.LeftShelf, MoveStep.SI01_ShelfInLeft); MoveInfo.NewMove(LineMoveType.LeftShelf, MoveStep.SI01_ShelfInLeft);
IOMove(IO_Type.Line_StopCylinder, IO_VALUE.LOW);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_InCheck, IO_VALUE.HIGH)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_InCheck, IO_VALUE.HIGH));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_StopCheck, IO_VALUE.HIGH)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_StopCheck, IO_VALUE.HIGH));
} }
...@@ -174,6 +175,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -174,6 +175,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
inLineWatch.Stop(); inLineWatch.Stop();
CheckAndMove(IO_Type.Line_StopCylinder, IO_VALUE.LOW);
} }
//右侧出口 //右侧出口
...@@ -246,6 +248,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -246,6 +248,7 @@ namespace OnlineStore.DeviceLibrary
if (LeftUpdownCanMove()) if (LeftUpdownCanMove())
{ {
MoveInfo.NextMoveStep(MoveStep.SI03_UpdownMove); MoveInfo.NextMoveStep(MoveStep.SI03_UpdownMove);
LeftUpdownRFID = RFIDManager.ReadRFID(Config.L_Updown_Rfid, true).NumStr();
if (LeftUpdownRFID.StartsWith(Static_String.SmallShelf_RFID_Prefix)) if (LeftUpdownRFID.StartsWith(Static_String.SmallShelf_RFID_Prefix))
{ {
LogUtil.info(Name + MoveInfo.SLog + " :左侧新料架=" + LeftUpdownRFID + ",升降机上升"); LogUtil.info(Name + MoveInfo.SLog + " :左侧新料架=" + LeftUpdownRFID + ",升降机上升");
...@@ -274,6 +277,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -274,6 +277,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_StopCylinder, IO_VALUE.HIGH, true)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_StopCylinder, IO_VALUE.HIGH, true));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.L_InLineRun, IO_VALUE.HIGH, true)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.L_InLineRun, IO_VALUE.HIGH, true));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_InCheck, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_InCheck, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_StopCheck, IO_VALUE.LOW));
} }
else if (MoveInfo.MoveStep.Equals(MoveStep.SI04_InStopDown)) else if (MoveInfo.MoveStep.Equals(MoveStep.SI04_InStopDown))
{ {
...@@ -282,13 +286,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -282,13 +286,12 @@ namespace OnlineStore.DeviceLibrary
LeftLineMove(IO_VALUE.HIGH, MoveInfo); LeftLineMove(IO_VALUE.HIGH, MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000));
IOMove(IO_Type.L_InLineRun, IO_VALUE.HIGH); IOMove(IO_Type.L_InLineRun, IO_VALUE.HIGH);
IOMove(IO_Type.Line_StopCylinder, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.L_InLineRun, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.L_InLineRun, IO_VALUE.HIGH));
if (LeftUpdownRFID.StartsWith(Static_String.SmallShelf_RFID_Prefix)) //if (LeftUpdownRFID.StartsWith(Static_String.SmallShelf_RFID_Prefix))
{ //{
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_StopCheck, IO_VALUE.LOW)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_StopCheck, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_InCheck, IO_VALUE.LOW)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_InCheck, IO_VALUE.LOW));
} //}
} }
else if (MoveInfo.MoveStep.Equals(MoveStep.SI05_WaitCheck1High)) else if (MoveInfo.MoveStep.Equals(MoveStep.SI05_WaitCheck1High))
{ {
...@@ -307,6 +310,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -307,6 +310,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.SI06_WaitCheck1Low); MoveInfo.NextMoveStep(MoveStep.SI06_WaitCheck1Low);
LogUtil.info(Name + MoveInfo.SLog + ":阻挡上升,等待检测1灭,或者再等待10秒"); LogUtil.info(Name + MoveInfo.SLog + ":阻挡上升,等待检测1灭,或者再等待10秒");
LeftLineMove(IO_VALUE.HIGH, null); LeftLineMove(IO_VALUE.HIGH, null);
LeftUpdownRFID = RFIDManager.ReadRFID(Config.L_Updown_Rfid, true).NumStr();
IOMove(IO_Type.Line_StopCylinder, IO_VALUE.LOW); IOMove(IO_Type.Line_StopCylinder, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
if (LeftUpdownRFID.StartsWith(Static_String.SmallShelf_RFID_Prefix)) if (LeftUpdownRFID.StartsWith(Static_String.SmallShelf_RFID_Prefix))
...@@ -364,6 +368,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -364,6 +368,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(MoveStep.SI08_UpdownDown)) else if (MoveInfo.MoveStep.Equals(MoveStep.SI08_UpdownDown))
{ {
MoveInfo.NextMoveStep(MoveStep.SI09_WaitStopRun); MoveInfo.NextMoveStep(MoveStep.SI09_WaitStopRun);
LeftUpdownRFID = RFIDManager.ReadRFID(Config.L_Updown_Rfid, true).NumStr();
MoveInfo.TimeOutSeconds = 30; MoveInfo.TimeOutSeconds = 30;
LogUtil.info(Name + MoveInfo.SLog + " 等待检测2亮,转动30秒"); LogUtil.info(Name + MoveInfo.SLog + " 等待检测2亮,转动30秒");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000));
...@@ -394,13 +399,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -394,13 +399,18 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(MoveStep.SI09_WaitStopRun)) else if (MoveInfo.MoveStep.Equals(MoveStep.SI09_WaitStopRun))
{ {
if (IOValue(IO_Type.LLow_StopCheck2).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.LLow_StopCheck2).Equals(IO_VALUE.LOW) || IOValue(IO_Type.LHigh_StopCheck2).Equals(IO_VALUE.LOW))
{ {
LeftLineMove(IO_VALUE.HIGH); LeftLineMove(IO_VALUE.HIGH);
if (LeftUpdownRFID.StartsWith(Static_String.BigShelf_RFID_Prefix))
{
IOMove(IO_Type.Line_StopCylinder, IO_VALUE.HIGH);
}
} }
else else
{ {
LogUtil.info(Name + MoveInfo.SLog + " 停止链条转动,结束处理"); LogUtil.info(Name + MoveInfo.SLog + " 停止链条转动,结束处理");
IOMove(IO_Type.Line_StopCylinder, IO_VALUE.LOW);
LeftLineMove(IO_VALUE.LOW); LeftLineMove(IO_VALUE.LOW);
MoveInfo.EndMove(); MoveInfo.EndMove();
} }
......
...@@ -381,7 +381,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -381,7 +381,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.LOW); IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.LOW);
IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH); IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH);
} }
else if (benQOutStep.IsTimeOut(5000)) else if (benQOutStep.IsTimeOut(15000))
{ {
IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.HIGH); IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.HIGH);
IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH); IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH);
......
...@@ -191,8 +191,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -191,8 +191,8 @@ namespace OnlineStore.DeviceLibrary
benQInFromOutStep.AddIoWait(IO_Type.RHigh_FullCheck, IO_VALUE.HIGH); benQInFromOutStep.AddIoWait(IO_Type.RHigh_FullCheck, IO_VALUE.HIGH);
CheckAndMove(IO_Type.RHigh_LineRun, IO_VALUE.HIGH);//右侧上层链条运行 CheckAndMove(IO_Type.RHigh_LineRun, IO_VALUE.HIGH);//右侧上层链条运行
CheckAndMove(IO_Type.R_OutLineBackRun, IO_VALUE.HIGH); CheckAndMove(IO_Type.R_OutLineBackRun, IO_VALUE.HIGH);
IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH, 5000); IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH);
IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.HIGH, 5000); IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.HIGH);
} }
} }
...@@ -212,12 +212,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -212,12 +212,12 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.R_Updown_Up, IO_Type.R_Updown_Down); CylinderMove(MoveInfo, IO_Type.R_Updown_Up, IO_Type.R_Updown_Down);
benQInFromOutStep.AddTimeWait(5000); benQInFromOutStep.AddTimeWait(5000);
} }
else if (benQInFromOutStep.IsTimeOut(10000)) else if (benQInFromOutStep.IsTimeOut(15000))
{ {
KeepLineRun(IO_Type.RHigh_LineRun); KeepLineRun(IO_Type.RHigh_LineRun);
CheckAndMove(IO_Type.R_OutLineBackRun, IO_VALUE.HIGH); CheckAndMove(IO_Type.R_OutLineBackRun, IO_VALUE.HIGH);
IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH, 5000); IOMove(IO_Type.R_RightStopCylinder, IO_VALUE.HIGH);
IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.HIGH, 5000); IOMove(IO_Type.R_LeftStopCylinder, IO_VALUE.HIGH);
} }
} }
else if (benQInFromOutStep.IsStep(BenQ_IN_FROM_OUT_STEP.SHELF_DOWN)) else if (benQInFromOutStep.IsStep(BenQ_IN_FROM_OUT_STEP.SHELF_DOWN))
......
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections> </configSections>
<appSettings> <appSettings>
<!--是否开机自动启动双层流水线--> <!--是否开机自动启动双层流水线-->
<add key="App_AutoRun" value="1" /> <add key="App_AutoRun" value="1"/>
<add key="App_Title" value="双层料架流水线" /> <add key="App_Title" value="双层料架流水线"/>
<!--Server address--> <!--Server address-->
<add key="httpAddr" value="http://10.85.162.124/myproject/rest/api/qisda/device/"/> <add key="httpAddr" value="http://10.85.162.124/myproject/rest/api/qisda/device/"/>
<!--start one store config--> <!--start one store config-->
<add key="Line_Config" value="\LineConfig\DoubleLineConfig.csv" /> <add key="Line_Config" value="\LineConfig\DoubleLineConfig.csv"/>
<add key="Config_Pwd" value="123456" /> <add key="Config_Pwd" value="123456"/>
<!--IO配置--> <!--IO配置-->
<add key="UseAIOBOX" value="1" /> <add key="UseAIOBOX" value="1"/>
<add key="DIMS" value="150" /> <add key="DIMS" value="150"/>
<add key="DOMS" value="300" /> <add key="DOMS" value="300"/>
<!--AGV料仓调度服务器地址--> <!--AGV料仓调度服务器地址-->
<add key="AgvServerIp" value="127.0.0.1" /> <add key="AgvServerIp" value="127.0.0.1"/>
<!--AGV产线调度服务器地址--> <!--AGV产线调度服务器地址-->
<add key="Line_AGV" value="10.85.197.3" /> <add key="Line_AGV" value="10.85.197.3"/>
<!--是否调试状态--> <!--是否调试状态-->
<add key="IsInDebug" value="1" /> <add key="IsInDebug" value="1"/>
<add key ="Agv_Log_Open" value ="1"/> <add key="Agv_Log_Open" value="1"/>
<!--ABB机器人服务器--> <!--ABB机器人服务器-->
<add key ="ABBServerPort" value ="10021"/> <add key="ABBServerPort" value="10021"/>
<add key ="DefaultSpeed" value ="1000"/> <add key="DefaultSpeed" value="1000"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="logs/DoubleLine.log" /> <file type="log4net.Util.PatternString" value="logs/DoubleLine.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="60"/> <param name="MaxSizeRollBackups" value="60"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="TheRFID" type="log4net.Appender.RollingFileAppender"> <appender name="TheRFID" type="log4net.Appender.RollingFileAppender">
<file value="logs/TheRFID-dbline.log"/> <file value="logs/TheRFID-dbline.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<param name="MaxSizeRollBackups" value="10"/> <param name="MaxSizeRollBackups" value="10"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="AIOBOX" type="log4net.Appender.RollingFileAppender"> <appender name="AIOBOX" type="log4net.Appender.RollingFileAppender">
<file value="logs/aio/AIOBOX.log"/> <file value="logs/aio/AIOBOX.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<param name="MaxSizeRollBackups" value="15"/> <param name="MaxSizeRollBackups" value="15"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<logger name="AIOBOX"> <logger name="AIOBOX">
<level value="Info" /> <level value="Info"/>
<appender-ref ref="AIOBOX" /> <appender-ref ref="AIOBOX"/>
</logger> </logger>
<logger name="TheRFID"> <logger name="TheRFID">
<level value="Error" /> <level value="Error"/>
<appender-ref ref="TheRFID" /> <appender-ref ref="TheRFID"/>
</logger> </logger>
<root name="RollingLogFileAppender"> <root name="RollingLogFileAppender">
<level value="Info" /> <level value="Info"/>
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender"/>
</root> </root>
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
<system.web> <system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider"> <membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers> <providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" /> <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
</providers> </providers>
</membership> </membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true"> <roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers> <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" /> <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> </providers>
</roleManager> </roleManager>
</system.web> </system.web>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.DoubleLineClient</RootNamespace> <RootNamespace>OnlineStore.DoubleLineClient</RootNamespace>
<AssemblyName>DoubleLineClient</AssemblyName> <AssemblyName>DoubleLineClient</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl> <PublishUrl>publish\</PublishUrl>
......
...@@ -19,7 +19,7 @@ namespace OnlineStore.DoubleLineClient.Properties { ...@@ -19,7 +19,7 @@ namespace OnlineStore.DoubleLineClient.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.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 {
...@@ -47,8 +47,8 @@ namespace OnlineStore.DoubleLineClient.Properties { ...@@ -47,8 +47,8 @@ namespace OnlineStore.DoubleLineClient.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 {
......
...@@ -12,7 +12,7 @@ namespace OnlineStore.DoubleLineClient.Properties { ...@@ -12,7 +12,7 @@ namespace OnlineStore.DoubleLineClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.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())));
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace> <RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName> <AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UserFromControl</RootNamespace> <RootNamespace>UserFromControl</RootNamespace>
<AssemblyName>UserFromControl</AssemblyName> <AssemblyName>UserFromControl</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!