init: 北航大学BH-DAS项目首次入库
12
.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.vs/
|
||||||
|
packages/
|
||||||
|
bin/
|
||||||
|
obj/
|
||||||
|
*.user
|
||||||
|
*.suo
|
||||||
|
*.cache
|
||||||
|
*.log
|
||||||
|
*.zip
|
||||||
|
*.rar
|
||||||
|
*.7z
|
||||||
|
_system~.ini
|
||||||
43
BH.sln
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.5.33516.290
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BH", "CCYQ_JieFang\BH.csproj", "{A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01_MyLog4Net", "MyLog4Net\01_MyLog4Net.csproj", "{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03_CallWebApi", "CallWebApi\03_CallWebApi.csproj", "{727A1B50-D83A-4319-BDF6-E923F4BD41B3}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DK_DC_Tool", "DK_DC_Tool\DK_DC_Tool.csproj", "{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {9338DC32-EA20-43C9-9073-F048C086886F}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
65
CCYQ_JieFang/App.config
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<appSettings>
|
||||||
|
<add key="IsDemoMesServer" value="0" />
|
||||||
|
<add key="MqttUrl" value="127.0.0.1:1883,MesWork" />
|
||||||
|
<add key="MesServer_IpPortName" value="127.0.0.1:41102,MesWork" />
|
||||||
|
<add key="ConnectionString" value="server=.;database=BH_DAS;uid=sa;pwd=126.com;Connection Reset=FALSE;Max Pool Size = 1000" />
|
||||||
|
<!--基础数据Excel表名称-->
|
||||||
|
<add key="BasicDataTableFile" value="TYZG-50.xlsx"/>
|
||||||
|
<add key="WebSvrUrlPort" value="http://0.0.0.0:9981" />
|
||||||
|
<add key="IpcConfigPath" value="C:\IPC_config.txt" />
|
||||||
|
<!--这里开始定义的是上传接口请求地址-->
|
||||||
|
|
||||||
|
<add key="IPC_product" value="http://127.0.0.1:9981/IPC/product" />
|
||||||
|
<add key="IPC_RequestEnterOrLeave" value="http://127.0.0.1:9981/IPC/RequestEnterOrLeave" />
|
||||||
|
<add key="IPC_WorkFinsih" value="http://127.0.0.1:9981/IPC/WorkFinsih" />
|
||||||
|
|
||||||
|
<!--FSS-接收允许进入或离开-->
|
||||||
|
<add key="ResponseEnterOrLeaveUrl" value="http://192.168.11.81:8893/lx/ResponseEnterOrLeave" />
|
||||||
|
<!--FSS-接收IPC下料请求-->
|
||||||
|
<add key="FinishCallUrl" value="http://192.168.11.81:8893/lx/FinishCall" />
|
||||||
|
<!--FSS-接收IPC状态变化-->
|
||||||
|
<add key="DeviceStatusUrl" value="http://192.168.11.81:8893/lx/DeviceStatus" />
|
||||||
|
|
||||||
|
<!--日志文件路径-->
|
||||||
|
<add key="TraceFolderPath" value="C:\MW\2023_04_08" />
|
||||||
|
<!--是启用写监控报错日志-->
|
||||||
|
<add key="IsWriteMonitorLog" value="0" />
|
||||||
|
<!--日志文件路径-->
|
||||||
|
<add key="LogFilePath" value=".\log" />
|
||||||
|
<add key="IsLogFilePath" value="0" />
|
||||||
|
<!--定时更新到数据库,单位:ms-->
|
||||||
|
<add key="TimerUpdateSql" value="60000" />
|
||||||
|
<!--设备状态更新时间、存储时间,单位:ms-->
|
||||||
|
<add key="StationStatus_Interval_Read" value="5000" />
|
||||||
|
<add key="StationStatus_Interval_Update" value="5000" />
|
||||||
|
<add key="StationStatus_Interval_Insert" value="60000" />
|
||||||
|
<!--调度时间,单位:小时-->
|
||||||
|
<add key="ExecSql_Interval" value="24" />
|
||||||
|
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||||
|
</appSettings>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
|
</startup>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-1.8.4.0" newVersion="1.8.4.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<system.web>
|
||||||
|
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||||
|
<providers>
|
||||||
|
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||||
|
</providers>
|
||||||
|
</membership>
|
||||||
|
<roleManager defaultProvider="ClientRoleProvider" enabled="false">
|
||||||
|
<providers>
|
||||||
|
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||||
|
</providers>
|
||||||
|
</roleManager>
|
||||||
|
</system.web>
|
||||||
|
</configuration>
|
||||||
394
CCYQ_JieFang/BH.csproj
Normal file
@@ -0,0 +1,394 @@
|
|||||||
|
<?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>{A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>CCYQ_JieFang</RootNamespace>
|
||||||
|
<AssemblyName>BH-DAS</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Disk</InstallFrom>
|
||||||
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</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>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>任务管理.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="BasicData">
|
||||||
|
<HintPath>..\DLL\BasicData.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="BouncyCastle.Crypto, Version=1.8.4.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\BouncyCastle.Crypto.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ConLink, Version=7.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\ConLink.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ConLink19">
|
||||||
|
<HintPath>..\DLL\ConLink19.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DataLinkMesWork">
|
||||||
|
<HintPath>..\DLL\DataLinkMesWork.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Fanuc.Interface">
|
||||||
|
<HintPath>..\DLL\Fanuc.Interface.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ICSharpCode.SharpZipLib, Version=1.2.0.7, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MesControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\MesControl.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MesWork.DeviceDriver, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\MesWork.DeviceDriver.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MesWork.PLC, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\MesWork.PLC.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Monitor.MesWork, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\Monitor.MesWork.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MQTTnet, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\MQTTnet.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MQTTnet.Extensions.ManagedClient, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\MQTTnet.Extensions.ManagedClient.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MySql.Data">
|
||||||
|
<HintPath>..\DLL\MySql.Data.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NPOI, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\NPOI.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NPOI.OOXML, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\NPOI.OOXML.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NPOI.OpenXml4Net, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\NPOI.OpenXml4Net.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NPOI.OpenXmlFormats, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\NPOI.OpenXmlFormats.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Opc.Ua.Client, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\Opc.Ua.Client.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Opc.Ua.Configuration, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\Opc.Ua.Configuration.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Opc.Ua.Core, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\Opc.Ua.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="OpcUaHelper, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\OpcUaHelper.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SqlCmd, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\SqlCmd.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Net.Http.Formatting">
|
||||||
|
<HintPath>..\DLL\System.Net.Http.Formatting.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web.Cors">
|
||||||
|
<HintPath>..\DLL\System.Web.Cors.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web.Extensions" />
|
||||||
|
<Reference Include="System.Web.Http">
|
||||||
|
<HintPath>..\DLL\System.Web.Http.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web.Http.Cors">
|
||||||
|
<HintPath>..\DLL\System.Web.Http.Cors.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web.Http.SelfHost">
|
||||||
|
<HintPath>..\DLL\System.Web.Http.SelfHost.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<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" />
|
||||||
|
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\DLL\Ubiety.Dns.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="WeifenLuo.WinFormsUI.Docking">
|
||||||
|
<HintPath>..\DLL\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="OP\logInfo.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\logInfo.Designer.cs">
|
||||||
|
<DependentUpon>logInfo.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP20\DAS_OP20.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP20\DAS_OP20.Designer.cs">
|
||||||
|
<DependentUpon>DAS_OP20.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP30\DAS_OP30.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP30\DAS_OP30.Designer.cs">
|
||||||
|
<DependentUpon>DAS_OP30.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP40\DAS_OP40.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP40\DAS_OP40.Designer.cs">
|
||||||
|
<DependentUpon>DAS_OP40.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP50\DAS_OP50.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP50\DAS_OP50.Designer.cs">
|
||||||
|
<DependentUpon>DAS_OP50.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\AgvTest.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\AgvTest.Designer.cs">
|
||||||
|
<DependentUpon>AgvTest.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\MeasureRangeSet.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\MeasureRangeSet.Designer.cs">
|
||||||
|
<DependentUpon>MeasureRangeSet.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\partInfo.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\partInfo.Designer.cs">
|
||||||
|
<DependentUpon>partInfo.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="webApi\AnalysisMsg.cs" />
|
||||||
|
<Compile Include="BusinessCode\DispatchSql.cs" />
|
||||||
|
<Compile Include="webApi\Controller\FSSController.cs" />
|
||||||
|
<Compile Include="webApi\Controller\IpcController.cs" />
|
||||||
|
<Compile Include="webApi\IPC_product.cs" />
|
||||||
|
<Compile Include="webApi\msgResHeader.cs" />
|
||||||
|
<Compile Include="MesWork.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MesWork.Designer.cs">
|
||||||
|
<DependentUpon>MesWork.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP10\DAS_OP10.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OP\OP10\DAS_OP10.Designer.cs">
|
||||||
|
<DependentUpon>DAS_OP10.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MW.OnStart.cs" />
|
||||||
|
<Compile Include="BusinessCode\AppConfig.cs" />
|
||||||
|
<Compile Include="Core\ExecSqlServer.cs" />
|
||||||
|
<Compile Include="BusinessCode\Heartbeat.cs" />
|
||||||
|
<Compile Include="Core\LogRecord.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Core\LogRecord.Designer.cs">
|
||||||
|
<DependentUpon>LogRecord.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BusinessCode\MesRead.cs" />
|
||||||
|
<Compile Include="BusinessCode\MIS_Funtion.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Core\Remote.Receive.cs" />
|
||||||
|
<Compile Include="BusinessCode\B_DB_Opera.cs" />
|
||||||
|
<Compile Include="BusinessCode\PLC_State.cs" />
|
||||||
|
<Compile Include="OP\publicCore.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Core\TagTypeCodeID.cs" />
|
||||||
|
<Compile Include="BusinessCode\WorkStart.cs" />
|
||||||
|
<Compile Include="webApi\InitServer.cs" />
|
||||||
|
<EmbeddedResource Include="Core\LogRecord.resx">
|
||||||
|
<DependentUpon>LogRecord.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\logInfo.resx">
|
||||||
|
<DependentUpon>logInfo.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="MesWork.resx">
|
||||||
|
<DependentUpon>MesWork.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\OP10\DAS_OP10.resx">
|
||||||
|
<DependentUpon>DAS_OP10.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\OP20\DAS_OP20.resx">
|
||||||
|
<DependentUpon>DAS_OP20.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\OP30\DAS_OP30.resx">
|
||||||
|
<DependentUpon>DAS_OP30.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\OP40\DAS_OP40.resx">
|
||||||
|
<DependentUpon>DAS_OP40.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\OP50\DAS_OP50.resx">
|
||||||
|
<DependentUpon>DAS_OP50.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\AgvTest.resx">
|
||||||
|
<DependentUpon>AgvTest.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\MeasureRangeSet.resx">
|
||||||
|
<DependentUpon>MeasureRangeSet.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OP\partInfo.resx">
|
||||||
|
<DependentUpon>partInfo.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>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="app.manifest" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="icon\04-微型减速机.png" />
|
||||||
|
<None Include="icon\02 涡喷发动机.png" />
|
||||||
|
<None Include="icon\StartWorkCircle.gif" />
|
||||||
|
<None Include="icon\green.png" />
|
||||||
|
<None Include="icon\red.png" />
|
||||||
|
<None Include="icon\断开连接.png" />
|
||||||
|
<None Include="icon\关闭系统.png" />
|
||||||
|
<None Include="icon\连接.png" />
|
||||||
|
<None Include="icon\01-微型减速机.png" />
|
||||||
|
<None Include="icon\03-卫星模型.png" />
|
||||||
|
<None Include="icon\05-微型减速机.png" />
|
||||||
|
<None Include="icon\下压.gif" />
|
||||||
|
<None Include="icon\下压OK.png" />
|
||||||
|
<Content Include="任务管理.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<WCFMetadata Include="Connected Services\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Nai.Communication.Robot.FanucVarProxy">
|
||||||
|
<Version>1.2.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Newtonsoft.Json">
|
||||||
|
<Version>13.0.1</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Robot.Common">
|
||||||
|
<Version>2.1.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Robot.MessageBus">
|
||||||
|
<Version>1.0.3</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="RobotMapper">
|
||||||
|
<Version>2.5.2</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Robots">
|
||||||
|
<Version>1.1.10</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Serilog.Extensions.Logging">
|
||||||
|
<Version>3.1.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\DK_DC_Tool\DK_DC_Tool.csproj">
|
||||||
|
<Project>{3c6fef50-2014-4157-a12b-93fb4ad20fe7}</Project>
|
||||||
|
<Name>DK_DC_Tool</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\MyLog4Net\01_MyLog4Net.csproj">
|
||||||
|
<Project>{1dc48c83-1842-4de8-acaf-26e1e7f7c58f}</Project>
|
||||||
|
<Name>01_MyLog4Net</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
409
CCYQ_JieFang/BusinessCode/AppConfig.cs
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
using CCYQ_JieFang;
|
||||||
|
using DeviceDriver_BasicData;
|
||||||
|
using DK_DC_Tool;
|
||||||
|
using NJ_ZC;
|
||||||
|
using OpcBasic;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
using static System.Configuration.ConfigurationManager;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class Temp {
|
||||||
|
public static MesWorkForm mesWorkForm = null;
|
||||||
|
public static DAS_OP10 mesWorkForm1 = null;
|
||||||
|
public static DAS_OP20 mesWorkForm2 = null;
|
||||||
|
public static DAS_OP30 mesWorkForm3 = null;
|
||||||
|
public static DAS_OP40 mesWorkForm4 = null;
|
||||||
|
public static DAS_OP50 mesWorkForm5 = null;
|
||||||
|
}
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
public static string BasicDataTableFile = AppSettings["BasicDataTableFile"];
|
||||||
|
public static int IsDemoMesServer = Convert.ToInt32(AppSettings["IsDemoMesServer"]);
|
||||||
|
public static int IsWriteMonitorLog = Convert.ToInt32(AppSettings["IsWriteMonitorLog"]);
|
||||||
|
|
||||||
|
public static string ConnectionString = AppSettings["ConnectionString"];
|
||||||
|
|
||||||
|
public static string MesServer_IpPortName = AppSettings["MesServer_IpPortName"];
|
||||||
|
public static string MesServer_SendProtocol = AppSettings["MesServer_SendProtocol"];
|
||||||
|
public static string MesServer_SendTagProtocol = AppSettings["MesServer_SendTagProtocol"];
|
||||||
|
public static string MesServer_SendTagProtocol_MES = AppSettings["MesServer_SendTagProtocol_MES"];
|
||||||
|
|
||||||
|
//机床测量数据
|
||||||
|
public static string MeasureDataString = AppSettings["MeasureDataString"];
|
||||||
|
public static string ProgramDataString = AppSettings["ProgramDataString"];
|
||||||
|
|
||||||
|
public static string WebSvrUrlPort = AppSettings["WebSvrUrlPort"];
|
||||||
|
|
||||||
|
|
||||||
|
public static string ResponseEnterOrLeaveUrl = AppSettings["ResponseEnterOrLeaveUrl"];
|
||||||
|
public static string FinishCallUrl = AppSettings["FinishCallUrl"];
|
||||||
|
public static string DeviceStatusUrl = AppSettings["DeviceStatusUrl"];
|
||||||
|
|
||||||
|
public static string IPC_product = AppSettings["IPC_product"];
|
||||||
|
public static string IPC_RequestEnterOrLeave = AppSettings["IPC_RequestEnterOrLeave"];
|
||||||
|
public static string IPC_WorkFinsih = AppSettings["IPC_WorkFinsih"];
|
||||||
|
|
||||||
|
// MQTT
|
||||||
|
// public static int connectType = Convert.ToInt32(AppSettings["connectType"]);
|
||||||
|
// public static string MqttUrl = AppSettings["MqttUrl"];
|
||||||
|
// public static string MqttTargetTopic = AppSettings["MqttTargetTopic"];
|
||||||
|
|
||||||
|
public static int TimerUpdateSql = Convert.ToInt32(AppSettings["TimerUpdateSql"]);
|
||||||
|
public static int StationStatus_Interval_Read = Convert.ToInt32(AppSettings["StationStatus_Interval_Read"]);
|
||||||
|
public static int StationStatus_Interval_Update = Convert.ToInt32(AppSettings["StationStatus_Interval_Update"]);
|
||||||
|
public static int StationStatus_Interval_Insert = Convert.ToInt32(AppSettings["StationStatus_Interval_Insert"]);
|
||||||
|
|
||||||
|
public static int ExecSql_Interval = Convert.ToInt32(AppSettings["ExecSql_Interval"]);
|
||||||
|
|
||||||
|
public static string IsLogFilePath = AppSettings["IsLogFilePath"];
|
||||||
|
public static string LogFilePath = AppSettings["LogFilePath"];
|
||||||
|
public static string IpcConfigPath = AppSettings["IpcConfigPath"];
|
||||||
|
|
||||||
|
private static StreamWriter streamWriter;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static ConcurrentQueue<ParamT> taskSql = new ConcurrentQueue<ParamT>();
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static string StationName = "DDV";
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static DataTable dt_Robot = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static DataTable dt_EEM = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static DataTable dt_EEM_PLC = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static DataTable dt_CNC = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static DataTable dt_pmc = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static DataTable dt_pmc_Simplify = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static DataTable dt_PLC_Data = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static Hashtable ht_PLM_Old = new Hashtable();
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static Hashtable ht_PLM_Curr = new Hashtable();
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static Hashtable ht_OpName_Status = new Hashtable();
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static Hashtable ht_OpName_PMCReadTagIDArray = new Hashtable();
|
||||||
|
/// <summary>
|
||||||
|
/// 监控数据的所有变化,从这里产生
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
public override void OPCTagData_TagDataOnChangeMIS(object sender, CustomeEvetnArgs e)
|
||||||
|
{
|
||||||
|
ThreadPool.QueueUserWorkItem(MIS_Funtion, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Tighten_E_ScanContent(string hex_str, string raw_str)
|
||||||
|
{
|
||||||
|
ThreadPool.QueueUserWorkItem(MIS_Tighten, new TightenParam
|
||||||
|
{
|
||||||
|
hex = hex_str ,
|
||||||
|
raw = raw_str
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 定时触发,检测PLC在线状态,周期:3 s
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="eState"></param>
|
||||||
|
public override void PlcStateEvent(object sender, PlcStateEvetnArgs eState)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string currentOpName = "";
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
|
||||||
|
new System.Threading.Mutex(true, "Device Data SCADA", out bool bCanRun);
|
||||||
|
if (!bCanRun)
|
||||||
|
{
|
||||||
|
MessageBox.Show("设备数据采集 程序 已经在运行!不可重复启动!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(Temp.mesWorkForm = new MesWorkForm());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 读写取方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="readWhat"></param>
|
||||||
|
/// <param name="opOrIp"></param>
|
||||||
|
private void DemoRead(string doWhat, string opOrIp)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string opName = "OP1010";
|
||||||
|
object tagValue = 1;
|
||||||
|
bool result = false;
|
||||||
|
ConcurrentDictionary<string, object> tagAdrListTagFormat = null;
|
||||||
|
|
||||||
|
switch (doWhat)
|
||||||
|
{
|
||||||
|
case "TagID":
|
||||||
|
tagValue = ReadPLC("71010001");
|
||||||
|
result = WritePLC("71010001", tagValue);
|
||||||
|
break;
|
||||||
|
case "TagTypeCodeID":
|
||||||
|
tagValue = ReadPLC(10, opName);
|
||||||
|
result = WritePLC(10, opName, tagValue);
|
||||||
|
break;
|
||||||
|
//case "Cmd":
|
||||||
|
// tagValue = ReadPLC((int)EnumTagTypeCodeID.EngineID, opName);
|
||||||
|
// result = WritePLC((int)EnumTagTypeCodeID.EngineID, opName, tagValue);
|
||||||
|
// break;
|
||||||
|
case "OpAllTag"://OP所有点
|
||||||
|
tagAdrListTagFormat = ReadPLC_GroupData(opOrIp);
|
||||||
|
break;
|
||||||
|
case "OpMonitorTag"://OP监控点
|
||||||
|
tagAdrListTagFormat = ReadPLC_GroupMonitor(opOrIp);
|
||||||
|
break;
|
||||||
|
case "IpAllTag"://IP所有点
|
||||||
|
tagAdrListTagFormat = ReadPLC_IpTag(opOrIp);
|
||||||
|
break;
|
||||||
|
case "IpMonitorTag"://IP监控点
|
||||||
|
tagAdrListTagFormat = ReadPLC_IpMonitorTag(opOrIp);
|
||||||
|
break;
|
||||||
|
case "RegionRead"://按区域读取(起始地址 + 长度)
|
||||||
|
{
|
||||||
|
string tagStartAdr = "DB411.10";
|
||||||
|
ushort tagAdrListMaxLength = 100;
|
||||||
|
GetDbAndMaxLengthByOpName(opOrIp, out tagStartAdr, out tagAdrListMaxLength);
|
||||||
|
tagAdrListTagFormat = ReadQualityDataList(opOrIp, tagStartAdr, tagAdrListMaxLength);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "ReadBytes"://按区域读取(起始地址 + 长度)
|
||||||
|
{
|
||||||
|
string tagStartAdr = "DB411.10";
|
||||||
|
ushort tagAdrListMaxLength = 100;
|
||||||
|
var bates1 = ReadByteData_Op(opOrIp, tagStartAdr, tagAdrListMaxLength);
|
||||||
|
var bates2 = ReadByteData_Ip(opOrIp, tagStartAdr, tagAdrListMaxLength);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "WriteBytes"://按区域读取(起始地址 + 长度)
|
||||||
|
{
|
||||||
|
string tagStartAdr = "DB411.10";
|
||||||
|
var result1 = WritePLC_Bytes_Op(opOrIp, tagStartAdr, new byte[1024]);
|
||||||
|
var result2 = WritePLC_Bytes_Ip(opOrIp, tagStartAdr, new byte[1024]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//ReadByteData_Op(string opName, string startAdrr, ushort length)
|
||||||
|
foreach (System.Collections.Generic.KeyValuePair<string, object> de in tagAdrListTagFormat)//得到工位监控点哈希表
|
||||||
|
{
|
||||||
|
TagFormat TF = (TagFormat)de.Value;
|
||||||
|
string recResult = TF.OpName + " (" + TF.TagTypeCodeID + ")" + TF.TagValue.ToString(); ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (System.Exception err)
|
||||||
|
{
|
||||||
|
ApplicationLog.WriteLog("listView_ShowQualityData_Init" + err);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Hello_You_All_Never_Know(string[] args)
|
||||||
|
{
|
||||||
|
return Guid.NewGuid().ToString()+ Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void Button1_Click(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
ConcurrentDictionary<string, object> tagTypeCodeIDList = DriverCache[CacheType.Cache_OpTagTypeCodeIDList];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void SavePrintLog(int type, string message)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (IsLogFilePath == "0") return;
|
||||||
|
string directPath = LogFilePath.Trim();
|
||||||
|
if (!Directory.Exists(directPath)) //判断文件夹是否存在,如果不存在则创建
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(directPath);
|
||||||
|
}
|
||||||
|
directPath += string.Format(@"\{0}.log", DateTime.Now.ToString("yyyy-MM-dd"));
|
||||||
|
if (streamWriter == null)
|
||||||
|
{
|
||||||
|
streamWriter = !File.Exists(directPath) ? File.CreateText(directPath) : File.AppendText(directPath); //判断文件是否存在如果不存在则创建,如果存在则添加。
|
||||||
|
}
|
||||||
|
streamWriter.WriteLine("***********************************************************************");
|
||||||
|
streamWriter.WriteLine(DateTime.Now.ToString("HH:mm:ss"));
|
||||||
|
if (message != null)
|
||||||
|
{
|
||||||
|
if (type == 0)
|
||||||
|
{
|
||||||
|
streamWriter.WriteLine("记录信息:\r\n" + message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
streamWriter.WriteLine("异常信息:\r\n" + message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (streamWriter != null)
|
||||||
|
{
|
||||||
|
streamWriter.Flush();
|
||||||
|
streamWriter.Dispose();
|
||||||
|
streamWriter = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static private void Loop()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
taskSql.TryDequeue(out ParamT tp);
|
||||||
|
if (tp != null)
|
||||||
|
{
|
||||||
|
var procedureName = tp.procedureName;
|
||||||
|
var sqlParameter = tp.sqlParameter;
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref sqlParameter, out string errorMessage);
|
||||||
|
if (errorMessage.Length > 0)
|
||||||
|
{
|
||||||
|
errorMessage = errorMessage.Replace("'","**");
|
||||||
|
LogRecord.LogRecord.Insert_Log(LogRecord.LogRecord.Type_Log.Alarm, errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taskSql.Count < 5)
|
||||||
|
{
|
||||||
|
Thread.Sleep(15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void DatatableCol_Simplify(DataTable dt_pmc)
|
||||||
|
{
|
||||||
|
dt_pmc_Simplify = new DataTable();
|
||||||
|
dt_pmc_Simplify.Columns.Add("TagID");
|
||||||
|
dt_pmc_Simplify.Columns.Add("TagName");
|
||||||
|
dt_pmc_Simplify.Columns.Add("TagValue");
|
||||||
|
dt_pmc_Simplify.Columns.Add("工位号");
|
||||||
|
dt_pmc_Simplify.Columns.Add("数据来源");
|
||||||
|
dt_pmc_Simplify.Columns.Add("IP");
|
||||||
|
dt_pmc_Simplify.Columns.Add("TagTypeID");
|
||||||
|
dt_pmc_Simplify.Columns.Add("TagLong");
|
||||||
|
dt_pmc_Simplify.Columns.Add("DbName");
|
||||||
|
dt_pmc_Simplify.Columns.Add("变量类型");
|
||||||
|
dt_pmc_Simplify.Columns.Add("变量地址");
|
||||||
|
dt_pmc_Simplify.Columns.Add("变量其它");
|
||||||
|
dt_pmc_Simplify.Columns.Add("列位置");
|
||||||
|
dt_pmc_Simplify.Columns.Add("变量类型代码");
|
||||||
|
dt_pmc_Simplify.Columns.Add("变量类型名称");
|
||||||
|
dt_pmc_Simplify.Columns.Add("是否启用");
|
||||||
|
dt_pmc_Simplify.Columns.Add("是否监控");
|
||||||
|
|
||||||
|
var dt_pmcT = dt_pmc.Copy();
|
||||||
|
|
||||||
|
for (int i = 0; i < dt_pmcT.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
var TagID = dt_pmcT.Rows[i]["TagID"].ToString();
|
||||||
|
var TagName = dt_pmcT.Rows[i]["TagName"].ToString();
|
||||||
|
var TagValue = "0";
|
||||||
|
var 工位号 = dt_pmcT.Rows[i]["工位号"].ToString();
|
||||||
|
var 数据来源 = dt_pmcT.Rows[i]["数据来源"].ToString();
|
||||||
|
var IP = dt_pmcT.Rows[i]["IP"].ToString();
|
||||||
|
var TagTypeID = dt_pmcT.Rows[i]["TagTypeID"].ToString();
|
||||||
|
var TagLong = dt_pmcT.Rows[i]["TagLong"].ToString();
|
||||||
|
var DbName = dt_pmcT.Rows[i]["DbName"].ToString();
|
||||||
|
var 变量类型 = dt_pmcT.Rows[i]["变量类型"].ToString();
|
||||||
|
var 变量地址 = dt_pmcT.Rows[i]["变量地址"].ToString();
|
||||||
|
var 变量其它 = dt_pmcT.Rows[i]["变量其它"].ToString();
|
||||||
|
var 列位置 = dt_pmcT.Rows[i]["列位置"].ToString();
|
||||||
|
var 变量类型代码 = dt_pmcT.Rows[i]["变量类型代码"].ToString();
|
||||||
|
var 变量类型名称 = dt_pmcT.Rows[i]["变量类型名称"].ToString();
|
||||||
|
var 是否启用 = dt_pmcT.Rows[i]["是否启用"].ToString();
|
||||||
|
var 是否监控 = dt_pmcT.Rows[i]["是否监控"].ToString();
|
||||||
|
|
||||||
|
ht_PLM_Old.Add(TagID, "0");
|
||||||
|
|
||||||
|
dt_pmc_Simplify.Rows.Add(
|
||||||
|
TagID,
|
||||||
|
TagName,
|
||||||
|
TagValue,
|
||||||
|
工位号 ,
|
||||||
|
数据来源 ,
|
||||||
|
IP ,
|
||||||
|
TagTypeID ,
|
||||||
|
TagLong ,
|
||||||
|
DbName ,
|
||||||
|
变量类型,
|
||||||
|
变量地址 ,
|
||||||
|
变量其它 ,
|
||||||
|
列位置,
|
||||||
|
变量类型代码,
|
||||||
|
变量类型名称,
|
||||||
|
是否启用,
|
||||||
|
是否监控
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
268
CCYQ_JieFang/BusinessCode/B_DB_Opera.cs
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Diagnostics.Eventing.Reader;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class B_DB_Opera
|
||||||
|
{
|
||||||
|
|
||||||
|
public static void Event_WorkStart(string opName, int tagTypeCodeID, string partType, string tagID)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "Event_WorkStart",
|
||||||
|
sqlParameter = new SqlParameter[] {
|
||||||
|
new SqlParameter("@OpName", opName),
|
||||||
|
new SqlParameter("@TagTypeCodeID", tagTypeCodeID),
|
||||||
|
new SqlParameter("@PartType", partType),
|
||||||
|
new SqlParameter("@ChangeTime",ChangeTime),
|
||||||
|
new SqlParameter("@TagID", tagID)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Event_WorkEnd(string opName, int tagTypeCodeID, string partType
|
||||||
|
, string barCode, int qualityMask, int outCount, int duration
|
||||||
|
, string tagID)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
/*
|
||||||
|
@OpName nvarchar(50) = null,
|
||||||
|
@TagTypeCodeID int = 0,
|
||||||
|
@PartType int = 0,
|
||||||
|
@BarCode nvarchar(2048) = null,
|
||||||
|
@QualityMask int = 0,
|
||||||
|
@OutCount int = 0,
|
||||||
|
@Duration int = 0,
|
||||||
|
@ChangeTime datetime = null,
|
||||||
|
@TagID nvarchar(200) = null
|
||||||
|
*/
|
||||||
|
|
||||||
|
var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "Event_WorkEnd",
|
||||||
|
sqlParameter = new SqlParameter[] {
|
||||||
|
new SqlParameter("@OpName", opName),
|
||||||
|
new SqlParameter("@TagTypeCodeID", tagTypeCodeID),
|
||||||
|
new SqlParameter("@PartType", partType),
|
||||||
|
new SqlParameter("@BarCode", barCode),
|
||||||
|
new SqlParameter("@QualityMask", qualityMask),
|
||||||
|
new SqlParameter("@OutCount", outCount),
|
||||||
|
new SqlParameter("@Duration", duration),
|
||||||
|
new SqlParameter("@ChangeTime",ChangeTime),
|
||||||
|
new SqlParameter("@TagID", tagID)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void Event_Signal_Log(string opName, int tagTypeCodeID, string value, string tagID)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "Event_Signal_Log",
|
||||||
|
sqlParameter = new SqlParameter[] {
|
||||||
|
new SqlParameter("@OpName", opName),
|
||||||
|
new SqlParameter("@TagTypeCodeID", tagTypeCodeID),
|
||||||
|
new SqlParameter("@Value", value),
|
||||||
|
new SqlParameter("@ChangeTime",ChangeTime),
|
||||||
|
new SqlParameter("@TagID", tagID)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void Event_Alarm_Start(string opName, int tagTypeCodeID, string alarmText, string tagID)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "Event_Alarm_Start",
|
||||||
|
sqlParameter = new SqlParameter[] {
|
||||||
|
new SqlParameter("@OpName", opName),
|
||||||
|
new SqlParameter("@TagTypeCodeID", tagTypeCodeID),
|
||||||
|
new SqlParameter("@AlarmText", alarmText),
|
||||||
|
new SqlParameter("@ChangeTime",ChangeTime),
|
||||||
|
new SqlParameter("@TagID", tagID)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void Event_Alarm_End(string opName, int tagTypeCodeID, string alarmText, string tagID)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
var ChangeTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "Event_Alarm_End",
|
||||||
|
sqlParameter = new SqlParameter[] {
|
||||||
|
new SqlParameter("@OpName", opName),
|
||||||
|
new SqlParameter("@TagTypeCodeID", tagTypeCodeID),
|
||||||
|
new SqlParameter("@AlarmText", alarmText),
|
||||||
|
new SqlParameter("@ChangeTime",ChangeTime),
|
||||||
|
new SqlParameter("@TagID", tagID)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//public static void MES_ToolDataSave(string opName, string toolNum, string toolLife, string toolCount)
|
||||||
|
//{
|
||||||
|
// SqlParameter[] thisParms = new SqlParameter[4];
|
||||||
|
// thisParms[0] = new SqlParameter("@opName", opName);
|
||||||
|
// thisParms[1] = new SqlParameter("@刀具代码", toolNum);
|
||||||
|
// thisParms[2] = new SqlParameter("@刀具额定寿命", Convert.ToInt32(toolLife));
|
||||||
|
// thisParms[3] = new SqlParameter("@已用寿命", Convert.ToInt32(toolCount));
|
||||||
|
|
||||||
|
// MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
// {
|
||||||
|
// procedureName = "LG_刀具管理_刀具设备台账编辑",
|
||||||
|
// sqlParameter = thisParms
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
//public static void MES_MeasureDataSave(string opName, string partId, decimal value, string time, string measureDataAddress, string monitorData)
|
||||||
|
//{
|
||||||
|
// SqlParameter[] thisParms = new SqlParameter[6];
|
||||||
|
// thisParms[0] = new SqlParameter("@opName", opName);
|
||||||
|
// thisParms[1] = new SqlParameter("@partId", partId);
|
||||||
|
// thisParms[2] = new SqlParameter("@recordTime", time);
|
||||||
|
// thisParms[3] = new SqlParameter("@Value", value);
|
||||||
|
// thisParms[4] = new SqlParameter("@measureDataAddress", measureDataAddress);
|
||||||
|
// thisParms[5] = new SqlParameter("@monitorData", monitorData);
|
||||||
|
|
||||||
|
// MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
// {
|
||||||
|
// procedureName = "LG_临工看板_质量管理_增加数据",
|
||||||
|
// sqlParameter = thisParms
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public static void MES_ProgramStatusDataSave(string opName, string serialNumber, int status, string time)
|
||||||
|
//{
|
||||||
|
// SqlParameter[] thisParms = new SqlParameter[4];
|
||||||
|
// thisParms[0] = new SqlParameter("@opName", opName);
|
||||||
|
// thisParms[1] = new SqlParameter("@serialNumber", serialNumber);
|
||||||
|
// thisParms[2] = new SqlParameter("@recordTime", time);
|
||||||
|
// thisParms[3] = new SqlParameter("@status", status);
|
||||||
|
|
||||||
|
// MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
// {
|
||||||
|
// procedureName = "LG_临工看板_程序状态管理_增加数据",
|
||||||
|
// sqlParameter = thisParms
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public static void MES_PartDataSave(string opName, string partId, string time, int type, int isOk, string FLOW_NUM, string passTime, int durationTime)
|
||||||
|
//{
|
||||||
|
// SqlParameter[] thisParms = new SqlParameter[8];
|
||||||
|
// thisParms[0] = new SqlParameter("@opName", opName);
|
||||||
|
// thisParms[1] = new SqlParameter("@partId", partId);
|
||||||
|
// thisParms[2] = new SqlParameter("@scanTime", time);
|
||||||
|
// thisParms[3] = new SqlParameter("@type", type);
|
||||||
|
// thisParms[4] = new SqlParameter("@是否合格", isOk);
|
||||||
|
// thisParms[5] = new SqlParameter("@FLOW_NUM", FLOW_NUM);
|
||||||
|
// thisParms[6] = new SqlParameter("@passTime", passTime);
|
||||||
|
// thisParms[7] = new SqlParameter("@durationTime", durationTime);
|
||||||
|
|
||||||
|
// MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
// {
|
||||||
|
// procedureName = "LG_临工看板_产量管理_增加数据",
|
||||||
|
// sqlParameter = thisParms
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
public static void MES_StatusChange(string opName, int StatusCode, string TriggerTime)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[3];
|
||||||
|
thisParms[0] = new SqlParameter("@opName", opName);
|
||||||
|
thisParms[1] = new SqlParameter("@StatusCode", StatusCode);
|
||||||
|
thisParms[2] = new SqlParameter("@TriggerTime", TriggerTime);
|
||||||
|
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "设备管理_状态变化新增",
|
||||||
|
sqlParameter = thisParms
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//public static void MES_StatusChange_WorkModel(string opName, int shutdown, int emergency, int auto, int debug, int manual, string TriggerTime)
|
||||||
|
//{
|
||||||
|
// SqlParameter[] thisParms = new SqlParameter[7];
|
||||||
|
// thisParms[0] = new SqlParameter("@opName", opName);
|
||||||
|
// thisParms[1] = new SqlParameter("@shutdown", shutdown);
|
||||||
|
// thisParms[2] = new SqlParameter("@emergency", emergency);
|
||||||
|
// thisParms[3] = new SqlParameter("@auto", auto);
|
||||||
|
// thisParms[4] = new SqlParameter("@debug", debug);
|
||||||
|
// thisParms[5] = new SqlParameter("@manual", manual);
|
||||||
|
// thisParms[6] = new SqlParameter("@TriggerTime", TriggerTime);
|
||||||
|
|
||||||
|
// MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
// {
|
||||||
|
// procedureName = "LG_临工看板_设备管理_状态变化新增数据_工作模式",
|
||||||
|
// sqlParameter = thisParms
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
//public static void MES_MachineParamsSave(string opName, float feedRate, float spindleSpeed, string recordTime)
|
||||||
|
//{
|
||||||
|
// SqlParameter[] thisParms = new SqlParameter[4];
|
||||||
|
// thisParms[0] = new SqlParameter("@opName", opName);
|
||||||
|
// thisParms[1] = new SqlParameter("@feedRate", feedRate);
|
||||||
|
// thisParms[2] = new SqlParameter("@spindleSpeed", spindleSpeed);
|
||||||
|
// thisParms[3] = new SqlParameter("@recordTime", recordTime);
|
||||||
|
|
||||||
|
// MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
// {
|
||||||
|
// procedureName = "LG_临工看板_设备管理_增加数据",
|
||||||
|
// sqlParameter = thisParms
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
|
||||||
|
public static void ClearLog()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "Event_Delete_Station_记录_日志_运行日志",
|
||||||
|
sqlParameter = new SqlParameter[] {
|
||||||
|
new SqlParameter("@工位号", "DDV")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Exec_DispatchSql()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
MesWorkForm.taskSql.Enqueue(new NJ_ZC.ParamT
|
||||||
|
{
|
||||||
|
procedureName = "Event_Delete_部分历史数据",
|
||||||
|
sqlParameter = new SqlParameter[] {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
31
CCYQ_JieFang/BusinessCode/DispatchSql.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class Temp { }
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
|
||||||
|
private void Task_DispatchSql()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
B_DB_Opera.Exec_DispatchSql();
|
||||||
|
LogRecord.LogRecord.Insert_Log(LogRecord.LogRecord.Type_Log.Tip, "执行一次数据库调度【Task_DispatchSql】");
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Thread.Sleep(ExecSql_Interval*60*60*1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
26
CCYQ_JieFang/BusinessCode/Heartbeat.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class Temp { }
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
|
||||||
|
private static void Heartbeat(string opName, string tagValue)
|
||||||
|
{
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.HeartBeatMIS, opName, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.HeartBeatMIS, opName, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
196
CCYQ_JieFang/BusinessCode/MIS_Funtion.cs
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
using DK_DC_Tool;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using OpcBasic;
|
||||||
|
using Robots.Commands;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void MIS_Tighten(object e)
|
||||||
|
{
|
||||||
|
var param = (TightenParam)e;
|
||||||
|
var hex = param.hex;
|
||||||
|
var raw = param.raw;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
. . . . . T 0 2 0 2 0 0 0 1 0 = 0 . 1 1 8 , 0 . 0 0 0 , 3 . 0 0 0 , 6 8 8 . 1 2 2 ; 0 0 0 1 1 = 2 ; 0 0 0 1 2 = 5 2 ; 0 1 0 1 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 1 1 = 1 ; 0 1 0 2 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 2 1 = 1 ; 0 1 0 3 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 3 1 = 1 ; 0 1 0 4 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 4 1 = 1 ; 0 1 0 5 0 = 0 . 1 1 8 , 6 8 8 . 1 2 2 , 2 . 9 9 9 ; 0 1 0 5 1 = 6 ; .
|
||||||
|
1.去除所有空格
|
||||||
|
.....T020200010=0.118,0.000,3.000,688.122;00011=2;00012=52;01010=0.000,0.000,0.000;01011=1;01020=0.000,0.000,0.000;01021=1;01030=0.000,0.000,0.000;01031=1;01040=0.000,0.000,0.000;01041=1;01050=0.118,688.122,2.999;01051=6;.
|
||||||
|
2.从索引10开始截取,最后一位不要
|
||||||
|
00010=0.118,0.000,3.000,688.122;00011=2;00012=52;01010=0.000,0.000,0.000;01011=1;01020=0.000,0.000,0.000;01021=1;01030=0.000,0.000,0.000;01031=1;01040=0.000,0.000,0.000;01041=1;01050=0.118,688.122,2.999;01051=6;
|
||||||
|
3.按照分号拆分,留前三组
|
||||||
|
00010=0.118,0.000,3.000,688.122 最终扭矩 ;监测角度 ;最终时间 ;最终角度 ;
|
||||||
|
00011=2 0= 无定意;1=OK,拧紧合格;2=NG,拧紧不合格;
|
||||||
|
00012=52 00= 无定意;01= 最终扭矩过大;02= 最终扭矩过大;03= 最终角度过大;04= 最终角度过小;n1= 第 n 步扭矩过大;n2= 第 n 步时间超限;1<n<5;90= 总时间超限;
|
||||||
|
4.按照等号拆分,取后面的值
|
||||||
|
第一组还需要按照逗号拆分
|
||||||
|
其他组按照等号拆分 TightenNG_Code
|
||||||
|
*/
|
||||||
|
// 1.去除所有空格
|
||||||
|
var str = raw.Replace(" ", "");
|
||||||
|
|
||||||
|
if (str.Contains("T0202"))
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("Tighten", "Info", "【拧紧枪数据】" + raw);
|
||||||
|
str = str.Replace(";......", ";|.....");
|
||||||
|
var strFinal = str.Split('|');
|
||||||
|
for (int i = 0; i < strFinal.Length; i++)
|
||||||
|
{
|
||||||
|
string strFinalStr = strFinal[i];
|
||||||
|
if (strFinalStr.Contains("T0202"))
|
||||||
|
{
|
||||||
|
// 2.从索引10开始截取,最后一位不要
|
||||||
|
str = strFinalStr.Substring(10, strFinalStr.Length - 11);
|
||||||
|
string isStartTighten = MesWorkForm.ReadPLC(56, currentOpName).ToString();
|
||||||
|
|
||||||
|
if (isStartTighten.ToLower() == "true" || isStartTighten.ToLower() == "1")
|
||||||
|
{
|
||||||
|
if (str.Length > 20)
|
||||||
|
{
|
||||||
|
// 3.按照分号拆分,留前三组
|
||||||
|
var arr = str.Split(';');
|
||||||
|
if (arr.Length > 3)
|
||||||
|
{
|
||||||
|
// 无效数据
|
||||||
|
string 最终扭矩 = arr[0].Split('=')[1].Split(',')[0];
|
||||||
|
string 监测角度 = arr[0].Split('=')[1].Split(',')[1];
|
||||||
|
string 最终时间 = arr[0].Split('=')[1].Split(',')[2];
|
||||||
|
string 最终角度 = arr[0].Split('=')[1].Split(',')[3];
|
||||||
|
string isOk = arr[1].Split('=')[1];
|
||||||
|
string NG_Code = arr[2].Split('=')[1];
|
||||||
|
string NG_CodeStr = "";
|
||||||
|
if (isOk == "2") NG_CodeStr = Tighten.TightenNG_Code[NG_Code];
|
||||||
|
|
||||||
|
// 第几个孔位
|
||||||
|
int MeasurePosition = Convert.ToInt32(MesWorkForm.ReadPLC(55, currentOpName));
|
||||||
|
int partPosition = Convert.ToInt32(MesWorkForm.ReadPLC(54, currentOpName));
|
||||||
|
string IsOK = isOk;
|
||||||
|
|
||||||
|
publicCore.LogInsert("Tighten", "Info", $"【保存拧紧枪数据】工件位置{partPosition},拧紧位置{MeasurePosition}" + raw);
|
||||||
|
// 保存质量数
|
||||||
|
publicCore.QualityData_MobyInsert(partPosition, MeasurePosition, currentOpName, 最终扭矩, IsOK, NG_CodeStr, out string errMsg);
|
||||||
|
MesWorkForm.WritePLC(83, currentOpName, true);
|
||||||
|
publicCore.LogInsert(currentOpName, "Info", "【IPC_读电批完成置位】");
|
||||||
|
// 拧紧状态显示
|
||||||
|
if (MIS_Funtion_PLC_MeasureFinish != null)
|
||||||
|
{
|
||||||
|
MIS_Funtion_PLC_MeasureFinish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (str.Length > 20)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert(currentOpName, "Error", "拧紧枪发送数据,但是PLC读电批值为:" + isStartTighten);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert(currentOpName, "Info", "订阅拧紧枪数据!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("Tighten", "Error", "【拧紧枪数据错误】" + err);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 处理MIS逻辑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void MIS_Funtion(object e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||||
|
if (msgEvent.TagValue == null) return;
|
||||||
|
|
||||||
|
var tagID = msgEvent.TagID.ToString ();
|
||||||
|
var opName = msgEvent.OpName.ToString();
|
||||||
|
var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
|
||||||
|
var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
|
||||||
|
// EnumTagTypeCodeID TagTypeCodeID = (EnumTagTypeCodeID)tagTypeCodeID;
|
||||||
|
string tagValue;
|
||||||
|
switch (tagTypeID)
|
||||||
|
{
|
||||||
|
case EnumTagTypeID.BOOL:
|
||||||
|
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tagValue = msgEvent.TagValue.ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch(opName)
|
||||||
|
{
|
||||||
|
// PLC心跳
|
||||||
|
case "OP10":
|
||||||
|
if (DAS_OP10.MIS_Funtion_PLC_OP != null)
|
||||||
|
{
|
||||||
|
DAS_OP10.MIS_Funtion_PLC_OP(msgEvent);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP20":
|
||||||
|
if (DAS_OP20.MIS_Funtion_PLC_OP != null)
|
||||||
|
{
|
||||||
|
DAS_OP20.MIS_Funtion_PLC_OP(msgEvent);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP30":
|
||||||
|
if (DAS_OP30.MIS_Funtion_PLC_OP != null)
|
||||||
|
{
|
||||||
|
DAS_OP30.MIS_Funtion_PLC_OP(msgEvent);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP40":
|
||||||
|
if (DAS_OP40.MIS_Funtion_PLC_OP != null)
|
||||||
|
{
|
||||||
|
DAS_OP40.MIS_Funtion_PLC_OP(msgEvent);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP50":
|
||||||
|
if (DAS_OP50.MIS_Funtion_PLC_OP != null)
|
||||||
|
{
|
||||||
|
DAS_OP50.MIS_Funtion_PLC_OP(msgEvent);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
144
CCYQ_JieFang/BusinessCode/MesRead.cs
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class Temp { }
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 允许保存(针对半自动和手动压装工位)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="OpName"></param>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private static void MesRead(string opName, string tagValue, int tagID)
|
||||||
|
{
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
// Hashtable valueList = ReadPLC_Sync_DataList_MesRead(opName);
|
||||||
|
|
||||||
|
// long id_tagCF;
|
||||||
|
// InsertQualityDataIndex(out id_tagCF);
|
||||||
|
|
||||||
|
//InsertQualityData(id_tagCF);
|
||||||
|
//// //Insert(System.Data.DataTable dt);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//static public void InsertQualityDataIndex(out long id_tagCF)
|
||||||
|
//{
|
||||||
|
// string tableName;
|
||||||
|
// ParamData[] paramWhere;
|
||||||
|
|
||||||
|
// int tagID = 81010003;
|
||||||
|
// int engineTypeID = 1;
|
||||||
|
// string engineID = "TestEn0001";
|
||||||
|
// string engineType = "Type001";
|
||||||
|
|
||||||
|
// paramWhere = new ParamData[4];
|
||||||
|
|
||||||
|
|
||||||
|
// tableName = "测量数据合格索引";
|
||||||
|
// paramWhere[0].name = "TagID_CF";
|
||||||
|
// paramWhere[0].value = tagID.ToString();
|
||||||
|
// paramWhere[1].name = "EngineTypeID";
|
||||||
|
// paramWhere[1].value = engineTypeID.ToString();
|
||||||
|
// paramWhere[2].name = "EngineID";
|
||||||
|
// paramWhere[2].value = engineID.ToString();
|
||||||
|
// paramWhere[3].name = "EngineType";
|
||||||
|
// paramWhere[3].value = engineType.ToString();
|
||||||
|
|
||||||
|
// Insert(tableName, paramWhere, out id_tagCF);
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
//static public void InsertQualityData(long id_tagCF)
|
||||||
|
//{
|
||||||
|
// int tagID = 81010003;
|
||||||
|
// int engineTypeID = 1;
|
||||||
|
// string engineID = "TestEn0001";
|
||||||
|
// string engineType = "Type001";
|
||||||
|
// string tagValue;
|
||||||
|
// int isgood = 1;
|
||||||
|
// string tableName;
|
||||||
|
// tableName = "测量数据合格";
|
||||||
|
|
||||||
|
// DataTable dt = BuildDataTables_WWW(tableName);
|
||||||
|
// object[] value = new object[10];
|
||||||
|
|
||||||
|
// tagValue = "10001";
|
||||||
|
|
||||||
|
// value[0] = id_tagCF;
|
||||||
|
// value[1] = engineTypeID;
|
||||||
|
// value[2] = engineID;
|
||||||
|
// value[3] = tagID;
|
||||||
|
// value[4] = tagValue;
|
||||||
|
// value[5] = isgood;
|
||||||
|
// value[6] = "测量位置01";
|
||||||
|
// value[7] = "测量项目01";
|
||||||
|
// value[8] = "工位号01";
|
||||||
|
// value[9] = "理论值01";
|
||||||
|
// dt.Rows.Add(value);
|
||||||
|
|
||||||
|
// tagValue = "10002";
|
||||||
|
|
||||||
|
// value[0] = id_tagCF;
|
||||||
|
// value[1] = engineTypeID;
|
||||||
|
// value[2] = engineID;
|
||||||
|
// value[3] = tagID;
|
||||||
|
// value[4] = tagValue;
|
||||||
|
// value[5] = isgood;
|
||||||
|
// value[6] = "测量位置02";
|
||||||
|
// value[7] = "测量项目02";
|
||||||
|
// value[8] = "工位号02";
|
||||||
|
// value[9] = "理论值02";
|
||||||
|
// dt.Rows.Add(value);
|
||||||
|
|
||||||
|
// Insert(dt);
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
static public DataTable BuildDataTables_WWW(string tableName)
|
||||||
|
{
|
||||||
|
DataTable table;
|
||||||
|
DataColumnCollection columns;
|
||||||
|
table = new DataTable(tableName);
|
||||||
|
columns = table.Columns;
|
||||||
|
table.Columns.Add("Id_tagCF", typeof(System.Int32));
|
||||||
|
table.Columns.Add("EngineTypeID", typeof(System.Int32));
|
||||||
|
table.Columns.Add("EngineID", typeof(System.String));
|
||||||
|
table.Columns.Add("TagID", typeof(System.String));
|
||||||
|
table.Columns.Add("TagValue", typeof(System.String));
|
||||||
|
table.Columns.Add("IsGoodBad", typeof(System.Int32));
|
||||||
|
table.Columns.Add("测量位置", typeof(System.String));
|
||||||
|
table.Columns.Add("测量项目", typeof(System.String));
|
||||||
|
table.Columns.Add("工位号", typeof(System.String));
|
||||||
|
table.Columns.Add("理论值", typeof(System.String));
|
||||||
|
table.Columns.Add("上限值", typeof(System.String));
|
||||||
|
table.Columns.Add("下限值", typeof(System.String));
|
||||||
|
table.Columns.Add("测量单位", typeof(System.String));
|
||||||
|
table.Columns.Add("列位置", typeof(System.Int32));
|
||||||
|
table.Columns.Add("变量排序", typeof(System.Int32));
|
||||||
|
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
26
CCYQ_JieFang/BusinessCode/PLC_State.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class Temp { }
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// PLC状态展示
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj"></param>
|
||||||
|
void ShowPlcStateList(object obj)
|
||||||
|
{
|
||||||
|
OpcData.PlcStateEvetnArgs eState = (OpcData.PlcStateEvetnArgs)obj;
|
||||||
|
string ip = eState.IP.ToString();
|
||||||
|
string onState = eState.OnLine.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
37
CCYQ_JieFang/BusinessCode/WorkStart.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class Temp { }
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 工件到位与离开时,清空MES自身信号
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="opName"></param>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private static void WorkStart(string opName, string tagValue)
|
||||||
|
{
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.EngineTypeGetOverMES, opName, false);//MES传递机型5
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.FixAllow, opName, false);//允许工作66
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.ConfirmOkGo, opName, false);//合格放行51
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.FalseGo, opName, false);//不合格放行8
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.MaterialVerifyOver, opName, false);//工作完成7
|
||||||
|
WritePLC((int)EnumTagTypeCodeID.MesReadOver, opName, false);//保存完成20
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
28
CCYQ_JieFang/Core/ExecSqlServer.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using MesWork;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace NJ_ZC
|
||||||
|
{
|
||||||
|
|
||||||
|
public class ParamT
|
||||||
|
{
|
||||||
|
public string procedureName
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = "";
|
||||||
|
|
||||||
|
public SqlParameter[] sqlParameter
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
222
CCYQ_JieFang/Core/LogRecord.Designer.cs
generated
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
|
||||||
|
namespace LogRecord
|
||||||
|
{
|
||||||
|
partial class LogRecord
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
|
this.dgv_Log = new System.Windows.Forms.DataGridView();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.button2 = new System.Windows.Forms.Button();
|
||||||
|
this.button3 = new System.Windows.Forms.Button();
|
||||||
|
this.btn_Refresh = new System.Windows.Forms.Button();
|
||||||
|
this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.工位号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.类型 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.时间 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.内容 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgv_Log)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// dgv_Log
|
||||||
|
//
|
||||||
|
this.dgv_Log.AllowUserToAddRows = false;
|
||||||
|
this.dgv_Log.AllowUserToDeleteRows = false;
|
||||||
|
this.dgv_Log.AllowUserToResizeRows = false;
|
||||||
|
this.dgv_Log.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.dgv_Log.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
|
||||||
|
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||||
|
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
|
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||||
|
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||||
|
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||||
|
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||||
|
this.dgv_Log.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||||
|
this.dgv_Log.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
this.dgv_Log.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
|
this.序号,
|
||||||
|
this.工位号,
|
||||||
|
this.类型,
|
||||||
|
this.时间,
|
||||||
|
this.内容});
|
||||||
|
this.dgv_Log.Location = new System.Drawing.Point(12, 51);
|
||||||
|
this.dgv_Log.MultiSelect = false;
|
||||||
|
this.dgv_Log.Name = "dgv_Log";
|
||||||
|
this.dgv_Log.ReadOnly = true;
|
||||||
|
this.dgv_Log.RowHeadersVisible = false;
|
||||||
|
this.dgv_Log.RowTemplate.Height = 26;
|
||||||
|
this.dgv_Log.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
this.dgv_Log.Size = new System.Drawing.Size(1277, 745);
|
||||||
|
this.dgv_Log.TabIndex = 72;
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Location = new System.Drawing.Point(358, 12);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.button1.TabIndex = 73;
|
||||||
|
this.button1.Text = "报警";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Visible = false;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
this.button2.Location = new System.Drawing.Point(439, 12);
|
||||||
|
this.button2.Name = "button2";
|
||||||
|
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.button2.TabIndex = 73;
|
||||||
|
this.button2.Text = "登录";
|
||||||
|
this.button2.UseVisualStyleBackColor = true;
|
||||||
|
this.button2.Visible = false;
|
||||||
|
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||||
|
//
|
||||||
|
// button3
|
||||||
|
//
|
||||||
|
this.button3.Location = new System.Drawing.Point(520, 12);
|
||||||
|
this.button3.Name = "button3";
|
||||||
|
this.button3.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.button3.TabIndex = 73;
|
||||||
|
this.button3.Text = "提示";
|
||||||
|
this.button3.UseVisualStyleBackColor = true;
|
||||||
|
this.button3.Visible = false;
|
||||||
|
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||||
|
//
|
||||||
|
// btn_Refresh
|
||||||
|
//
|
||||||
|
this.btn_Refresh.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
|
this.btn_Refresh.Location = new System.Drawing.Point(12, 10);
|
||||||
|
this.btn_Refresh.Name = "btn_Refresh";
|
||||||
|
this.btn_Refresh.Size = new System.Drawing.Size(320, 35);
|
||||||
|
this.btn_Refresh.TabIndex = 74;
|
||||||
|
this.btn_Refresh.Text = "刷新";
|
||||||
|
this.btn_Refresh.UseVisualStyleBackColor = true;
|
||||||
|
this.btn_Refresh.Click += new System.EventHandler(this.btn_Refresh_Click);
|
||||||
|
//
|
||||||
|
// 序号
|
||||||
|
//
|
||||||
|
this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
|
||||||
|
this.序号.DataPropertyName = "序号";
|
||||||
|
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
|
||||||
|
this.序号.DefaultCellStyle = dataGridViewCellStyle2;
|
||||||
|
this.序号.HeaderText = "序号";
|
||||||
|
this.序号.Name = "序号";
|
||||||
|
this.序号.ReadOnly = true;
|
||||||
|
this.序号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||||
|
this.序号.Width = 60;
|
||||||
|
//
|
||||||
|
// 工位号
|
||||||
|
//
|
||||||
|
this.工位号.DataPropertyName = "工位号";
|
||||||
|
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
|
||||||
|
this.工位号.DefaultCellStyle = dataGridViewCellStyle3;
|
||||||
|
this.工位号.HeaderText = "工位号";
|
||||||
|
this.工位号.Name = "工位号";
|
||||||
|
this.工位号.ReadOnly = true;
|
||||||
|
this.工位号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||||
|
this.工位号.Visible = false;
|
||||||
|
this.工位号.Width = 250;
|
||||||
|
//
|
||||||
|
// 类型
|
||||||
|
//
|
||||||
|
this.类型.DataPropertyName = "类型";
|
||||||
|
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
|
||||||
|
this.类型.DefaultCellStyle = dataGridViewCellStyle4;
|
||||||
|
this.类型.HeaderText = "类型";
|
||||||
|
this.类型.Name = "类型";
|
||||||
|
this.类型.ReadOnly = true;
|
||||||
|
this.类型.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||||
|
this.类型.Width = 90;
|
||||||
|
//
|
||||||
|
// 时间
|
||||||
|
//
|
||||||
|
this.时间.DataPropertyName = "时间";
|
||||||
|
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
|
||||||
|
dataGridViewCellStyle5.Format = "G";
|
||||||
|
this.时间.DefaultCellStyle = dataGridViewCellStyle5;
|
||||||
|
this.时间.HeaderText = "时间";
|
||||||
|
this.时间.Name = "时间";
|
||||||
|
this.时间.ReadOnly = true;
|
||||||
|
this.时间.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||||
|
this.时间.Width = 190;
|
||||||
|
//
|
||||||
|
// 内容
|
||||||
|
//
|
||||||
|
this.内容.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||||
|
this.内容.DataPropertyName = "内容";
|
||||||
|
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
|
||||||
|
this.内容.DefaultCellStyle = dataGridViewCellStyle6;
|
||||||
|
this.内容.HeaderText = "内容";
|
||||||
|
this.内容.Name = "内容";
|
||||||
|
this.内容.ReadOnly = true;
|
||||||
|
this.内容.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||||
|
//
|
||||||
|
// LogRecord
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1298, 808);
|
||||||
|
this.Controls.Add(this.btn_Refresh);
|
||||||
|
this.Controls.Add(this.button3);
|
||||||
|
this.Controls.Add(this.button2);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.dgv_Log);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.Name = "LogRecord";
|
||||||
|
this.ShowIcon = false;
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "日志";
|
||||||
|
this.Load += new System.EventHandler(this.LogRecord_Load);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgv_Log)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.DataGridView dgv_Log;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.Button button2;
|
||||||
|
private System.Windows.Forms.Button button3;
|
||||||
|
private System.Windows.Forms.Button btn_Refresh;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 序号;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 工位号;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 类型;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 时间;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 内容;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
144
CCYQ_JieFang/Core/LogRecord.cs
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
using MesWork;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using static System.Configuration.ConfigurationManager;
|
||||||
|
|
||||||
|
namespace LogRecord
|
||||||
|
{
|
||||||
|
public partial class LogRecord : Form
|
||||||
|
{
|
||||||
|
public LogRecord()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.WindowState = FormWindowState.Maximized;
|
||||||
|
}
|
||||||
|
public LogRecord(int _Width,int _Height)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.Width = _Width;
|
||||||
|
this.Height = _Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LogRecord_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Refresh_Log();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Refresh_Log()
|
||||||
|
{
|
||||||
|
var dt = Select_Log();
|
||||||
|
dgv_Log.DataSource = dt;
|
||||||
|
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
var 类型 = (Type_Log)Enum.Parse(typeof(Type_Log),dt.Rows[i]["类型"].ToString());
|
||||||
|
switch (类型)
|
||||||
|
{
|
||||||
|
case Type_Log.Alarm:
|
||||||
|
RowsColor(i, Color.Red, dgv_Log);
|
||||||
|
break;
|
||||||
|
case Type_Log.Login:
|
||||||
|
RowsColor(i, Color.Green, dgv_Log);
|
||||||
|
break;
|
||||||
|
case Type_Log.Tip:
|
||||||
|
RowsColor(i, Color.Yellow, dgv_Log);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
RowsColor(i, Color.Gray, dgv_Log);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dgv_Log.ClearSelection();
|
||||||
|
//dgv_Log.CurrentCell = null;
|
||||||
|
//dgv_Log.Rows[0].Selected = false;
|
||||||
|
}
|
||||||
|
private void RowsColor(int row, Color color, DataGridView dgv)
|
||||||
|
{
|
||||||
|
var dt = (System.Data.DataTable)dgv.DataSource;
|
||||||
|
for (int i = 0; i < dt.Columns.Count; i++)
|
||||||
|
{
|
||||||
|
dgv.Rows[row].Cells[i].Style.BackColor = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool Insert_Log(Type_Log LogType, string Log_Content)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
/*
|
||||||
|
SELECT [IDG],[Log_Station],[Log_Type],[Log_Time],[Log_Content] FROM [记录_日志_运行日志]
|
||||||
|
*/
|
||||||
|
bool success = false;
|
||||||
|
var sql =
|
||||||
|
$" INSERT INTO [记录_日志_运行日志]([Log_Station],[Log_Type],[Log_Time],[Log_Content])" +
|
||||||
|
$" VALUES('{MesWorkForm.StationName}','{LogType.ToString()}',getdate(),'{Log_Content}')";
|
||||||
|
success = DataLinkMesWork.SQLCommon.ExecuteSql(sql, MesWorkForm.ConnectionString, out string err2);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
|
||||||
|
}
|
||||||
|
public static DataTable Select_Log()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
SELECT [IDG],[Log_Station],[Log_Type],[Log_Time],[Log_Content] FROM [记录_日志_运行日志]
|
||||||
|
*/
|
||||||
|
var sql =
|
||||||
|
$" (SELECT " +
|
||||||
|
$" row_number() over(order by [Log_Time]) AS 序号" +
|
||||||
|
$" ,[Log_Station] AS 工位号" +
|
||||||
|
$" ,[Log_Type] AS 类型" +
|
||||||
|
$" ,[Log_Time] AS 时间" +
|
||||||
|
$" ,[Log_Content] AS 内容" +
|
||||||
|
|
||||||
|
$" FROM [记录_日志_运行日志]" +
|
||||||
|
$" WHERE [Log_Station] = '{MesWorkForm.StationName}')" +
|
||||||
|
$" ORDER BY 序号 DESC";
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteDataTable(sql, MesWorkForm.ConnectionString,out DataTable dt, out string err2);
|
||||||
|
return dt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Insert_Log(Type_Log.Alarm, "dfghjkjfdfghjk法国红酒看官方一股好久哦i反对牛v军方肯定没得查看你的孙女i的女哦i的妇女哦看v哦对妇女的发");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Insert_Log(Type_Log.Login, "废物");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button3_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Insert_Log(Type_Log.Tip, "滚");
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum Type_Log
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 报警
|
||||||
|
/// </summary>
|
||||||
|
Alarm = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// 登录
|
||||||
|
/// </summary>
|
||||||
|
Login = 2,
|
||||||
|
/// <summary>
|
||||||
|
/// 提示
|
||||||
|
/// </summary>
|
||||||
|
Tip = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btn_Refresh_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Refresh_Log();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
135
CCYQ_JieFang/Core/LogRecord.resx
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="序号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="工位号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="类型.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="内容.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
||||||
45
CCYQ_JieFang/Core/Remote.Receive.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class QingYa_OP0010 { }
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_Msg"></param>
|
||||||
|
public void LoadClientInfo(object _Msg)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string recStr = (string)_Msg;
|
||||||
|
string m_Source = recStr.Split('|')[0];
|
||||||
|
string cmd = recStr.Split('|')[1];
|
||||||
|
//string OpName = recStr.Split('|')[2];
|
||||||
|
//string tagValue = recStr.Split('|')[3];
|
||||||
|
|
||||||
|
switch (m_Source)
|
||||||
|
{
|
||||||
|
case "DT":
|
||||||
|
break;
|
||||||
|
case "MES":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
466
CCYQ_JieFang/Core/TagTypeCodeID.cs
Normal file
@@ -0,0 +1,466 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
///1 X WorkStart 2 工件到位(PLC) 工件到位。托盘到达工位,并且托盘上有工件。
|
||||||
|
///2 X RepairPartStatusPLC 3 RepairPartStatusPLC 备用
|
||||||
|
///3 STRING RepairPathString 4 RepairPathString "工位返修字符串(121211112222111),前2位是西门子字符串格式,第一位是总长度,第二位是实际长度"
|
||||||
|
///4 X EngineTypeGetOverMES 5 传递机型(MES) MES传递总成信息给PLC(上线工位)
|
||||||
|
///5 X PartPalletGoOver 6 PartPalletGoOver 上线工位。0:正常工作;1:空托盘放行,PLC读取到此标志不走申请上线逻辑。
|
||||||
|
///6 X MaterialVerifyOver 7 MaterialVerifyOver MES保存完质量数据,物料数据等与PLC信号交互完成后通知PLC,所以工步都完成,才可以放行工件,正常工作时工件放行的必要条件。
|
||||||
|
///7 X FalseGo 8 FalseGo 按MES界面[不合格放行]按钮,MES发送此信号。操作者判断工件不合格,通知设备,按不合格方式放行工件,工件流转到返修下线工位后,返修下线。MES工作完成MES0.3=1,MES合格放行MES0.5=0,MES0.4=1
|
||||||
|
///8 INT EngineTypeID 9 EngineTypeID MES发动机机型标志(必须PLC)
|
||||||
|
///9 STRING EngineID 10 EngineID MES发动机编号(必须PLC)
|
||||||
|
///10 STRING EngineType 11 机型(MES) MES发动机机型(必须PLC)
|
||||||
|
///11 X PartPalletStatus 13 PartPalletStatus MES激发变量托盘到位离开(必须PLC)
|
||||||
|
///12 X HeartBeatPLC 14 HeartBeatPLC 心跳处理:PLC收到MES心跳信号后,PLC延时5秒后,数值取反再写回PLC,写回PLC开始计时,如果5秒钟MES无反馈报通讯故障。
|
||||||
|
///13 X HeartBeatMIS 15 HeartBeatMIS 间隔时间5S,心跳处理。收到PLC心跳信号后,MES按原值回写。PLC收到MES信号后延时5秒,取反写入,以此循环。
|
||||||
|
///14 X TargetTimeRead 16 TargetTimeRead MES允许可读工位运行时间
|
||||||
|
///15 Int MachineTargetTime 17 MachineTargetTime 目标运行时间
|
||||||
|
///16 Int MachineActualTime 18 MachineActualTime 实际运行时间
|
||||||
|
///17 X MesRead 19 允许保存(PLC) 质量数据可以读数据
|
||||||
|
///18 X MesReadOver 20 保存完成(MES) MES保存完数据(必须MIS)
|
||||||
|
///19 INT QualityMask 21 合格标志(PLC) 质量数据工位合格标志0:没有工作;1:合格 ;2 :不合格(必须PLC)
|
||||||
|
///20 B PalletInfo 22 PalletInfo 0空托盘,1合格件,2不合格件
|
||||||
|
///21 INT RepairStatusPLC 23 RepairStatusPLC 0正常件,1返修件
|
||||||
|
///22 INT OrderNo 24 订单号(MES) 订单号(MES)
|
||||||
|
///23 X StorageNo 25 库位号(MES) 库位号(MES)
|
||||||
|
///24 X AllowPass 26 允许放行(MES) 允许放行
|
||||||
|
///25 X PartLoadFinish 27 PartLoadFinish PartLoadFinish
|
||||||
|
///26 X Reserved_7 28 Reserved_7 备用
|
||||||
|
///27 X Reserved_8 29 Reserved_8 备用
|
||||||
|
///28 X Reserved_9 30 Reserved_9 备用
|
||||||
|
///29 X Reserved_10 31 Reserved_10 备用
|
||||||
|
///30 X Reserved_11 32 Reserved_11 备用
|
||||||
|
///31 X Reserved_12 33 Reserved_12 备用
|
||||||
|
///32 X Reserved_13 34 Reserved_13 备用
|
||||||
|
///33 X Reserved_14 35 Reserved_14 备用
|
||||||
|
///34 Int PLCSPareint1 36 PLCSPareint1 备用
|
||||||
|
///35 Int PLCSPareint2 37 PLCSPareint2 备用
|
||||||
|
///36 Int PLCSPareint3 38 PLCSPareint3 备用
|
||||||
|
///37 STRING PLCSarestring1 39 PLCSarestring1 备用
|
||||||
|
///38 STRING PLCSarestring2 40 PLCSarestring2 备用
|
||||||
|
///39 STRING MarkID 42 MarkID 机体打标号(MES)前2位是西门子字符串格式,第一位是总长度,第二位是实际长度
|
||||||
|
///40 X PartLoad 43 PartLoad 上线工位,PLC向MES申请总成编号。收到该信号后,MES将机型标志(DBB22 ~23)、总成号(DBB24 ~63)、总成机型DBB64 ~103写入PLC。之后MES通过信号“传递机型(DBX0.1)”通知PLC。
|
||||||
|
///41 X EngineTypeGetOverPLC 44 传递机型(PLC) PLC将机型标志(DBB50…51)、工件编号(DBB52…101)、产品型号(DBB102…187)、托盘编号(DBB188…189)准备完毕后,通知MES。
|
||||||
|
///42 X PartLoadOK 48 PartLoadOK 备用
|
||||||
|
///43 X Reserved_18 49 Reserved_18 备用
|
||||||
|
///44 X PalletDown 50 PalletDown 暂时保留,项目未使用
|
||||||
|
///45 X ConfirmOkGo 51 ConfirmOkGo 按MES界面[合格放行]按钮,MES发送此信号。操作者判断工件合格,通知设备,工件按合格方式放行工件。MES工作完成MES0.3=1,MES合格放行MES0.5=1,MES0.4=0
|
||||||
|
///46 X ResetDevice 52 ResetDevice 针对手动工位,无HMI,需要复位设备在MES页面操作。
|
||||||
|
///47 X UnloadCompleted 53 UnloadCompleted 暂时保留,项目未使用
|
||||||
|
///48 X MachineTime_ReadOver 54 MachineTime_ReadOver 备用
|
||||||
|
///49 X Reserved_19 58 Reserved_19 备用
|
||||||
|
///50 X FixOK 59 FixOK 手动拧紧工位,单工步螺栓拧紧完成,通知PC读取数据。
|
||||||
|
///51 X Reserved_21 61 Reserved_21 备用
|
||||||
|
///52 X Reserved_22 62 Reserved_22 备用
|
||||||
|
///53 X Reserved_23 63 Reserved_23 备用
|
||||||
|
///54 X Reserved_24 64 Reserved_24 备用
|
||||||
|
///55 X Reserved_25 65 Reserved_25 备用
|
||||||
|
///56 X FixAllow 66 FixAllow "设备工作的必须信号,对于有物料验证的工位,MES验证完成给出此信号,对于无物料验证工位,MES直接给出此信号。"
|
||||||
|
///57 X FixOver 67 FixOver 用于手动拧紧且有质量数据工位。通知设备当前工步拧紧螺钉工作结束。
|
||||||
|
///58 X MatchingCompleted 68 MatchingCompleted 分线上总线,匹配成功是1;不成功是0。
|
||||||
|
///59 X Match 69 Match 分线上总线,匹配成功是1;不成功是0。
|
||||||
|
///60 X Reserved_2 70 Reserved_2 备用
|
||||||
|
///61 X IsAutoGetEngineID 71 IsAutoGetEngineID 自动手动申请工件编号。0是自动方式;1:手动方式。暂时保留,生成流水号方式是在数据库中实现的
|
||||||
|
///62 X RepairUplineMES 72 RepairUplineMES 上线清空MOBY(针对上线工位):通知PLC从新开始申请上线流程
|
||||||
|
///63 INT EngineTypeID_MES 73 机型代码(MES) MES发动机机型标志(必须MES)
|
||||||
|
///64 STRING EngineID_MES 74 工件编号(MES) MES发动机编号(必须MES)
|
||||||
|
///65 STRING EngineType_MES 75 EngineType_MES MES发动机机型(必须MES)
|
||||||
|
///66 X Reserved_20 76 Reserved_20 备用
|
||||||
|
///67 INT ProcessCode 77 ProcessCode 手动拧紧工位:由MES通知PLC拧紧序号
|
||||||
|
///68 B OnLineState 79 OnLineState 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线:0正常状态,实现正常功能。1离线:设备脱离MES工作,进入不交互模式。
|
||||||
|
///69 INT PartPalletCode 80 托盘号(MES) 托盘编号(B5A)
|
||||||
|
///70 INT BoltCode 88 BoltCode 手动拧紧工位:指导PLC所用套筒
|
||||||
|
///71 INT RepairStatus 93 RepairStatus "0正常件,1返修件。对于上线工位MES给出是正常上线还是返修上线,返修路径"
|
||||||
|
///72 DInt Reserved_15 110 Reserved_15 备用
|
||||||
|
///73 DInt Reserved_16 111 Reserved_16 备用
|
||||||
|
///74 B Reserved_17 112 Reserved_17 备用
|
||||||
|
///75 INT SPareint1 113 SPareint1 备用int1
|
||||||
|
///76 INT SPareint2 114 SPareint2 备用int2
|
||||||
|
///77 INT SPareint3 115 SPareint3 备用int3
|
||||||
|
///78 STRING Sparestring1 116 Sparestring1 备用字符串1
|
||||||
|
///79 STRING Sparestring2 117 Sparestring2 备用字符串2
|
||||||
|
///80 X MachineStatusPutOn 1000 机床上电(PLC) 机床上电(必须PLC)
|
||||||
|
///81 X MachineStatusWorkOn 1001 循环开始(PLC) 循环开始(必须PLC)
|
||||||
|
///82 X MachineStatusAlarm 1002 设备报警(PLC) 机床故障(必须PLC)
|
||||||
|
///83 X MachineStatusNoPart 1003 MachineStatusNoPart 上料无件(必须PLC)
|
||||||
|
///84 X MachineStatusBlock 1004 MachineStatusBlock 下料堵塞(必须PLC)
|
||||||
|
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 这是变量类型代码的配置,几乎是不变的
|
||||||
|
/// 请不要随意修改,为了保证变量版本同一,并且方便维护,请联系发行人修改!
|
||||||
|
/// 请注意,此修改为全局修改!
|
||||||
|
/// </summary>
|
||||||
|
public enum EnumTagTypeCodeID
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 工件到位(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// 解释:托盘到达工位,并且托盘上有工件。
|
||||||
|
/// </summary>
|
||||||
|
WorkStart = 2,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
RepairPartStatusPLC = 3,
|
||||||
|
/// <summary>
|
||||||
|
/// 工位返修字符串
|
||||||
|
/// 变量类型:String
|
||||||
|
/// 解释:工位返修字符串
|
||||||
|
/// </summary>
|
||||||
|
RepairPathString = 4,
|
||||||
|
/// <summary>
|
||||||
|
/// 传递机型(MES)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// 解释:MES传递总成信息给PLC(上线工位)
|
||||||
|
/// </summary>
|
||||||
|
EngineTypeGetOverMES = 5,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PartPalletGoOver = 6,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
MaterialVerifyOver = 7,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
FalseGo = 8,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
EngineTypeID = 9,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
EngineID = 10,
|
||||||
|
/// <summary>
|
||||||
|
/// 机型(MES)
|
||||||
|
/// 变量类型:String
|
||||||
|
/// </summary>
|
||||||
|
EngineType = 11,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PartPalletStatus = 13,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
HeartBeatPLC = 14,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
HeartBeatMIS = 15,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
TargetTimeRead = 16,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
MachineTargetTime = 17,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
MachineActualTime = 18,
|
||||||
|
/// <summary>
|
||||||
|
/// 允许保存(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
MesRead = 19,
|
||||||
|
/// <summary>
|
||||||
|
/// 保存完成(MES)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
MesReadOver = 20,
|
||||||
|
/// <summary>
|
||||||
|
/// 合格标志(PLC)
|
||||||
|
/// 变量类型:Int
|
||||||
|
/// </summary>
|
||||||
|
QualityMask = 21,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PalletInfo = 22,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
RepairStatusPLC = 23,
|
||||||
|
/// <summary>
|
||||||
|
/// 订单号(MES)
|
||||||
|
/// 变量类型:Int
|
||||||
|
/// </summary>
|
||||||
|
OrderNo = 24,
|
||||||
|
/// <summary>
|
||||||
|
/// 库位号(MES)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
StorageNo = 25,
|
||||||
|
/// <summary>
|
||||||
|
/// 允许放行(MES)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
AllowPass = 26,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PartLoadFinish = 27,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_7 = 28,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_8 = 29,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_9 = 30,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_10 = 31,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_11 = 32,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_12 = 33,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_13 = 34,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_14 = 35,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PLCSPareint1 = 36,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PLCSPareint2 = 37,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PLCSPareint3 = 38,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PLCSarestring1 = 39,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PLCSarestring2 = 40,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
MarkID = 42,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PartLoad = 43,
|
||||||
|
/// <summary>
|
||||||
|
/// 传递机型(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
EngineTypeGetOverPLC = 44,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PartLoadOK = 48,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_18 = 49,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
PalletDown = 50,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
ConfirmOkGo = 51,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
ResetDevice = 52,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
UnloadCompleted = 53,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
MachineTime_ReadOver = 54,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_19 = 58,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
FixOK = 59,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_21 = 61,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_22 = 62,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_23 = 63,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_24 = 64,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_25 = 65,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
FixAllow = 66,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
FixOver = 67,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
MatchingCompleted = 68,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Match = 69,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_2 = 70,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
IsAutoGetEngineID = 71,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
RepairUplineMES = 72,
|
||||||
|
/// <summary>
|
||||||
|
/// 机型代码(MES)
|
||||||
|
/// 变量类型:Int
|
||||||
|
/// </summary>
|
||||||
|
EngineTypeID_MES = 73,
|
||||||
|
/// <summary>
|
||||||
|
/// 工件编号(MES)
|
||||||
|
/// 变量类型:String
|
||||||
|
/// </summary>
|
||||||
|
EngineID_MES = 74,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
EngineType_MES = 75,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_20 = 76,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
ProcessCode = 77,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
OnLineState = 79,
|
||||||
|
/// <summary>
|
||||||
|
/// 托盘号(MES)
|
||||||
|
/// 变量类型:Int
|
||||||
|
/// </summary>
|
||||||
|
PartPalletCode = 80,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
BoltCode = 88,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
RepairStatus = 93,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_15 = 110,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_16 = 111,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Reserved_17 = 112,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
SPareint1 = 113,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
SPareint2 = 114,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
SPareint3 = 115,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Sparestring1 = 116,
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
Sparestring2 = 117,
|
||||||
|
/// <summary>
|
||||||
|
/// 机床上电(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
MachineStatusPutOn = 1000,
|
||||||
|
/// <summary>
|
||||||
|
/// 循环开始(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
MachineStatusWorkOn = 1001,
|
||||||
|
/// <summary>
|
||||||
|
/// 设备报警(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
MachineStatusAlarm = 1002,
|
||||||
|
/// <summary>
|
||||||
|
/// 上料无件(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
MachineStatusNoPart = 1003,
|
||||||
|
/// <summary>
|
||||||
|
/// 下料堵塞(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
MachineStatusBlock = 1004,
|
||||||
|
/// <summary>
|
||||||
|
/// 下料堵塞(PLC)
|
||||||
|
/// 变量类型:Bool
|
||||||
|
/// </summary>
|
||||||
|
havePart70 = 10003,
|
||||||
|
}
|
||||||
|
}
|
||||||
22
CCYQ_JieFang/MW.OnStart.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class Temp { }
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
protected override void OnShown(EventArgs e)
|
||||||
|
{
|
||||||
|
//ThreadPool.SetMaxThreads(2000, 800);
|
||||||
|
//Never_Know.Hello_You_All_Never_Know = Hello_You_All_Never_Know;
|
||||||
|
//new ApplicationLog();
|
||||||
|
//LoadOPCData(MesWorkForm.BasicDataTableFile, MesWorkForm.IsDemoMesServer, MesWorkForm.IsWriteMonitorLog, true);
|
||||||
|
//initServer = new InitServer(MesWorkForm.WebSvrUrlPort);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
181
CCYQ_JieFang/MesWork.Designer.cs
generated
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
using System.Windows.Forms;
|
||||||
|
using global::Init;
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
partial class MesWorkForm : PlcLinkForm
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MesWorkForm));
|
||||||
|
this.panel_Page = new System.Windows.Forms.Panel();
|
||||||
|
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||||
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
|
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||||
|
this.文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.上下限设置ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.系统日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.ToolStripMenuItem_exit = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.监控ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.pLC监控ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.查询ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.aGV调试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.tableLayoutPanel1.SuspendLayout();
|
||||||
|
this.panel2.SuspendLayout();
|
||||||
|
this.menuStrip1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel_Page
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.panel_Page, "panel_Page");
|
||||||
|
this.panel_Page.Name = "panel_Page";
|
||||||
|
//
|
||||||
|
// tableLayoutPanel1
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
|
||||||
|
this.tableLayoutPanel1.Controls.Add(this.panel_Page, 0, 1);
|
||||||
|
this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 0);
|
||||||
|
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||||
|
//
|
||||||
|
// panel2
|
||||||
|
//
|
||||||
|
this.panel2.Controls.Add(this.button1);
|
||||||
|
this.panel2.Controls.Add(this.menuStrip1);
|
||||||
|
resources.ApplyResources(this.panel2, "panel2");
|
||||||
|
this.panel2.Name = "panel2";
|
||||||
|
//
|
||||||
|
// menuStrip1
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.menuStrip1, "menuStrip1");
|
||||||
|
this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(2, 2, 0, 2);
|
||||||
|
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||||
|
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.文件ToolStripMenuItem,
|
||||||
|
this.监控ToolStripMenuItem,
|
||||||
|
this.查询ToolStripMenuItem,
|
||||||
|
this.aGV调试ToolStripMenuItem});
|
||||||
|
this.menuStrip1.Name = "menuStrip1";
|
||||||
|
//
|
||||||
|
// 文件ToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.文件ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.上下限设置ToolStripMenuItem1,
|
||||||
|
this.系统日志ToolStripMenuItem,
|
||||||
|
this.ToolStripMenuItem_exit});
|
||||||
|
this.文件ToolStripMenuItem.Name = "文件ToolStripMenuItem";
|
||||||
|
resources.ApplyResources(this.文件ToolStripMenuItem, "文件ToolStripMenuItem");
|
||||||
|
//
|
||||||
|
// 上下限设置ToolStripMenuItem1
|
||||||
|
//
|
||||||
|
this.上下限设置ToolStripMenuItem1.Name = "上下限设置ToolStripMenuItem1";
|
||||||
|
resources.ApplyResources(this.上下限设置ToolStripMenuItem1, "上下限设置ToolStripMenuItem1");
|
||||||
|
this.上下限设置ToolStripMenuItem1.Click += new System.EventHandler(this.上下限设置ToolStripMenuItem1_Click);
|
||||||
|
//
|
||||||
|
// 系统日志ToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.系统日志ToolStripMenuItem.Name = "系统日志ToolStripMenuItem";
|
||||||
|
resources.ApplyResources(this.系统日志ToolStripMenuItem, "系统日志ToolStripMenuItem");
|
||||||
|
this.系统日志ToolStripMenuItem.Click += new System.EventHandler(this.系统日志ToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// ToolStripMenuItem_exit
|
||||||
|
//
|
||||||
|
this.ToolStripMenuItem_exit.Name = "ToolStripMenuItem_exit";
|
||||||
|
resources.ApplyResources(this.ToolStripMenuItem_exit, "ToolStripMenuItem_exit");
|
||||||
|
this.ToolStripMenuItem_exit.Click += new System.EventHandler(this.ToolStripMenuItem_exit_Click);
|
||||||
|
//
|
||||||
|
// 监控ToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.监控ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.pLC监控ToolStripMenuItem});
|
||||||
|
this.监控ToolStripMenuItem.Name = "监控ToolStripMenuItem";
|
||||||
|
resources.ApplyResources(this.监控ToolStripMenuItem, "监控ToolStripMenuItem");
|
||||||
|
//
|
||||||
|
// pLC监控ToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.pLC监控ToolStripMenuItem.Name = "pLC监控ToolStripMenuItem";
|
||||||
|
resources.ApplyResources(this.pLC监控ToolStripMenuItem, "pLC监控ToolStripMenuItem");
|
||||||
|
this.pLC监控ToolStripMenuItem.Click += new System.EventHandler(this.pLC监控ToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// 查询ToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.查询ToolStripMenuItem.Name = "查询ToolStripMenuItem";
|
||||||
|
resources.ApplyResources(this.查询ToolStripMenuItem, "查询ToolStripMenuItem");
|
||||||
|
this.查询ToolStripMenuItem.Click += new System.EventHandler(this.查询ToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// aGV调试ToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.aGV调试ToolStripMenuItem.Name = "aGV调试ToolStripMenuItem";
|
||||||
|
resources.ApplyResources(this.aGV调试ToolStripMenuItem, "aGV调试ToolStripMenuItem");
|
||||||
|
this.aGV调试ToolStripMenuItem.Click += new System.EventHandler(this.aGV调试ToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.button1, "button1");
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// MesWorkForm
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this, "$this");
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||||
|
this.BackColor = System.Drawing.Color.White;
|
||||||
|
this.Controls.Add(this.tableLayoutPanel1);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MainMenuStrip = this.menuStrip1;
|
||||||
|
this.Name = "MesWorkForm";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MesWorkForm_FormClosing);
|
||||||
|
this.Load += new System.EventHandler(this.MesWorkForm_Load);
|
||||||
|
this.tableLayoutPanel1.ResumeLayout(false);
|
||||||
|
this.panel2.ResumeLayout(false);
|
||||||
|
this.panel2.PerformLayout();
|
||||||
|
this.menuStrip1.ResumeLayout(false);
|
||||||
|
this.menuStrip1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Panel panel_Page;
|
||||||
|
private TableLayoutPanel tableLayoutPanel1;
|
||||||
|
private Panel panel2;
|
||||||
|
private MenuStrip menuStrip1;
|
||||||
|
private ToolStripMenuItem 文件ToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem ToolStripMenuItem_exit;
|
||||||
|
private ToolStripMenuItem 监控ToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem pLC监控ToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem 查询ToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem 上下限设置ToolStripMenuItem1;
|
||||||
|
private ToolStripMenuItem 系统日志ToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem aGV调试ToolStripMenuItem;
|
||||||
|
private Button button1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
224
CCYQ_JieFang/MesWork.cs
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
using CCYQ_JieFang;
|
||||||
|
using DK_DC_Tool;
|
||||||
|
using MQTTnet.Server;
|
||||||
|
using Robots;
|
||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
public partial class MesWorkForm
|
||||||
|
{
|
||||||
|
InitServer initServer = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 测量完成委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action MIS_Funtion_PLC_MeasureFinish = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public MesWorkForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
CheckForIllegalCrossThreadCalls = false;
|
||||||
|
currentOpName = File.ReadAllText(IpcConfigPath).ToString();
|
||||||
|
Never_Know.Hello_You_All_Never_Know = Hello_You_All_Never_Know;
|
||||||
|
|
||||||
|
publicCore.LogInsert(currentOpName, "Info", "开启程序!");
|
||||||
|
|
||||||
|
ThreadPool.SetMaxThreads(2000, 800);
|
||||||
|
LoadOPCData(MesWorkForm.BasicDataTableFile, MesWorkForm.IsDemoMesServer, MesWorkForm.IsWriteMonitorLog, false, false, out string err);
|
||||||
|
if (err.Length > 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"LoadOPCData报错:{err}");
|
||||||
|
Process.GetCurrentProcess().Kill();
|
||||||
|
}
|
||||||
|
switch (currentOpName)
|
||||||
|
{
|
||||||
|
case "OP10":
|
||||||
|
{
|
||||||
|
Temp.mesWorkForm1 = new DAS_OP10(currentOpName);
|
||||||
|
Temp.mesWorkForm1.FormBorderStyle = FormBorderStyle.None; //隐藏子窗体边框(去除最小花,最大化,关闭等按钮)
|
||||||
|
Temp.mesWorkForm1.TopLevel = false; //指示子窗体非顶级窗体
|
||||||
|
Temp.mesWorkForm1.Dock = DockStyle.Fill;//将窗体最大化填充
|
||||||
|
panel_Page.Controls.Add(Temp.mesWorkForm1);
|
||||||
|
Temp.mesWorkForm1.Show();
|
||||||
|
Temp.mesWorkForm1.Load -= OpFormLoad;
|
||||||
|
Temp.mesWorkForm1.Load += OpFormLoad;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP20":
|
||||||
|
Temp.mesWorkForm2 = new DAS_OP20(currentOpName);
|
||||||
|
Temp.mesWorkForm2.FormBorderStyle = FormBorderStyle.None; //隐藏子窗体边框(去除最小花,最大化,关闭等按钮)
|
||||||
|
Temp.mesWorkForm2.TopLevel = false; //指示子窗体非顶级窗体
|
||||||
|
Temp.mesWorkForm2.Dock = DockStyle.Fill;//将窗体最大化填充
|
||||||
|
panel_Page.Controls.Add(Temp.mesWorkForm2);
|
||||||
|
Temp.mesWorkForm2.Show();
|
||||||
|
Temp.mesWorkForm2.Load -= OpFormLoad;
|
||||||
|
Temp.mesWorkForm2.Load += OpFormLoad;
|
||||||
|
break;
|
||||||
|
case "OP30":
|
||||||
|
Temp.mesWorkForm3 = new DAS_OP30(currentOpName);
|
||||||
|
Temp.mesWorkForm3.FormBorderStyle = FormBorderStyle.None; //隐藏子窗体边框(去除最小花,最大化,关闭等按钮)
|
||||||
|
Temp.mesWorkForm3.TopLevel = false; //指示子窗体非顶级窗体
|
||||||
|
Temp.mesWorkForm3.Dock = DockStyle.Fill;//将窗体最大化填充
|
||||||
|
panel_Page.Controls.Add(Temp.mesWorkForm3);
|
||||||
|
Temp.mesWorkForm3.Show();
|
||||||
|
Temp.mesWorkForm3.Load -= OpFormLoad;
|
||||||
|
Temp.mesWorkForm3.Load += OpFormLoad;
|
||||||
|
break;
|
||||||
|
case "OP40":
|
||||||
|
Temp.mesWorkForm4 = new DAS_OP40(currentOpName);
|
||||||
|
Temp.mesWorkForm4.FormBorderStyle = FormBorderStyle.None; //隐藏子窗体边框(去除最小花,最大化,关闭等按钮)
|
||||||
|
Temp.mesWorkForm4.TopLevel = false; //指示子窗体非顶级窗体
|
||||||
|
Temp.mesWorkForm4.Dock = DockStyle.Fill;//将窗体最大化填充
|
||||||
|
panel_Page.Controls.Add(Temp.mesWorkForm4);
|
||||||
|
Temp.mesWorkForm4.Show();
|
||||||
|
Temp.mesWorkForm4.Load -= OpFormLoad;
|
||||||
|
Temp.mesWorkForm4.Load += OpFormLoad;
|
||||||
|
break;
|
||||||
|
case "OP50":
|
||||||
|
Temp.mesWorkForm5 = new DAS_OP50(currentOpName);
|
||||||
|
Temp.mesWorkForm5.FormBorderStyle = FormBorderStyle.None; //隐藏子窗体边框(去除最小花,最大化,关闭等按钮)
|
||||||
|
Temp.mesWorkForm5.TopLevel = false; //指示子窗体非顶级窗体
|
||||||
|
Temp.mesWorkForm5.Dock = DockStyle.Fill;//将窗体最大化填充
|
||||||
|
panel_Page.Controls.Add(Temp.mesWorkForm5);
|
||||||
|
Temp.mesWorkForm5.Show();
|
||||||
|
Temp.mesWorkForm5.Load -= OpFormLoad;
|
||||||
|
Temp.mesWorkForm5.Load += OpFormLoad;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
MessageBox.Show("未找到对应工位!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpFormLoad(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// 开启PLC监控
|
||||||
|
StartServer();
|
||||||
|
|
||||||
|
// 开启webApi
|
||||||
|
initServer = new InitServer(MesWorkForm.WebSvrUrlPort);
|
||||||
|
|
||||||
|
Tighten.E_LogInsert -= publicCore.LogInsert;
|
||||||
|
Tighten.E_LogInsert += publicCore.LogInsert;
|
||||||
|
|
||||||
|
Tighten.E_ScanContent -= Tighten_E_ScanContent;
|
||||||
|
Tighten.E_ScanContent += Tighten_E_ScanContent;
|
||||||
|
|
||||||
|
//string hex_str = "";
|
||||||
|
//string raw_str = " . . . . . A 0 2 0 4 A C K . . . . . Z T 0 2 0 4 0 1 0 1 = 1 ; 0 2 0 1 = 0 , 2 . 0 0 , 2 . 1 0 , 1 . 0 0 , 0 . 6 0 , 2 . 0 0 , 5 0 0 0 , 0 , 3 0 . 0 0 , - 2 0 0 , 1 0 0 , 3 , 5 , - 1 0 0 , - 1 8 0 , - 3 . 6 0 , 3 . 0 0 , 1 0 0 , 9 0 , 3 . 6 0 , 3 . 0 0 , 6 0 0 , 3 6 0 0 , 3 . 6 0 , 6 . 0 0 , 8 0 , 0 . 4 0 , 3 . 6 0 , 3 . 0 0 , 6 0 0 , 2 . 0 0 , 2 . 1 0 , 3 . 0 0 , - 1 0 0 , - 1 8 0 , - 3 . 6 0 , 3 . 0 0 , 2 0 0 , 9 0 , 3 . 6 0 , 3 . 0 0 , 8 0 0 , 2 6 0 0 , 3 . 6 0 , 3 . 0 0 , 8 0 , 0 . 2 0 , 0 . 6 0 , 3 . 0 0 , 3 0 , 2 . 0 0 , 2 . 1 0 , 3 . 0 0 , 2 0 , 9 0 , 0 . 7 2 , 3 . 0 0 , 3 0 0 , 5 7 , 0 . 7 2 , 3 . 0 0 , 2 0 0 , 1 4 4 4 , 0 . 7 2 , 3 . 0 0 , 1 0 0 , 0 . 2 0 , 0 . 7 2 , 3 . 0 0 , 4 0 , 2 . 0 0 , 2 . 1 0 , 3 . 0 0 ; . . . . . . T 0 2 0 2 0 0 0 1 0 = 0 . 1 1 6 , 0 . 0 0 0 , 1 . 7 5 9 , 3 4 1 5 . 9 7 4 ; 0 0 0 1 1 = 2 ; 0 0 0 1 2 = 0 2 ; 0 1 0 1 0 = 0 . 1 8 8 , - 1 7 9 . 9 0 9 , 0 . 3 5 9 ; 0 1 0 1 1 = 1 ; 0 1 0 2 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 2 1 = 1 ; 0 1 0 3 0 = 0 . 1 1 6 , 3 5 9 6 . 4 5 6 , 1 . 3 6 9 ; 0 1 0 3 1 = 1 ; 0 1 0 4 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 4 1 = 1 ; 0 1 0 5 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 5 1 = 1 ; . ";
|
||||||
|
//// string raw_str = " . . . . . T 0 2 0 2 0 0 0 1 0 = 0 . 1 0 1 , 0 . 0 0 0 , 1 . 7 5 9 , 3 4 1 5 . 9 7 4 ; 0 0 0 1 1 = 2 ; 0 0 0 1 2 = 0 2 ; 0 1 0 1 0 = 0 . 1 6 7 , - 1 8 0 . 4 8 2 , 0 . 3 5 8 ; 0 1 0 1 1 = 1 ; 0 1 0 2 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 2 1 = 1 ; 0 1 0 3 0 = 0 . 1 0 1 , 3 5 9 7 . 0 2 9 , 1 . 3 6 9 ; 0 1 0 3 1 = 1 ; 0 1 0 4 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 4 1 = 1 ; 0 1 0 5 0 = 0 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ; 0 1 0 5 1 = 1 ; .";
|
||||||
|
//Tighten.E_ScanContent.Invoke(hex_str, raw_str);
|
||||||
|
|
||||||
|
var dt_Tighten = NPOITest.ExeclHelper.ExcelToDataTable(BasicDataTableFile, "拧紧枪", true);
|
||||||
|
//OpName IP Port IsEnable
|
||||||
|
var dataTable = dt_Tighten.Select($"OpName='{currentOpName}' and IsEnable='1'");
|
||||||
|
if(dataTable.Length > 0)
|
||||||
|
{
|
||||||
|
dt_Tighten = dt_Tighten.Select($"OpName='{currentOpName}' and IsEnable='1'").CopyToDataTable();
|
||||||
|
if (dt_Tighten.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
var IP = dt_Tighten.Rows[0]["IP"].ToString();
|
||||||
|
var Port = Convert.ToInt32(dt_Tighten.Rows[0]["Port"]);
|
||||||
|
var tighten = new Tighten();
|
||||||
|
tighten.Start(IP, Port, currentOpName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MesWorkForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert(currentOpName, "Info", "退出程序!");
|
||||||
|
|
||||||
|
e.Cancel = false;
|
||||||
|
StopServer(2000);
|
||||||
|
Thread.Sleep(500);
|
||||||
|
System.Diagnostics.Process.GetCurrentProcess().Kill();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label_ExitSys_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
CloseDeviceConn();
|
||||||
|
System.Diagnostics.Process.GetCurrentProcess().Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MesWorkForm_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ToolStripMenuItem_exit_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
StopServer(2000);
|
||||||
|
Thread.Sleep(500);
|
||||||
|
System.Diagnostics.Process.GetCurrentProcess().Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pLC监控ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
new OpcForm(IsDemoMesServer).Show(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void 关于ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
MessageBox.Show("关于信息!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void 系统日志ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
new logInfo(currentOpName).Show(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void 查询ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
new partInfo(currentOpName).Show(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void aGV调试ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
new AgvTest(currentOpName).Show(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void 上下限设置ToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
new MeasureRangeSet(currentOpName).Show(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (MessageBox.Show("是否确认跳过本次拧紧?\r\n仅适用于上位机拧紧确认失败的操作", "拧紧确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(83, currentOpName, true);
|
||||||
|
MessageBox.Show("操作完成!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
472
CCYQ_JieFang/MesWork.resx
Normal file
@@ -0,0 +1,472 @@
|
|||||||
|
<?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>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="panel_Page.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
|
<value>Fill</value>
|
||||||
|
</data>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="panel_Page.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>2, 45</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel_Page.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||||
|
<value>2, 2, 2, 2</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel_Page.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>2022, 1046</value>
|
||||||
|
</data>
|
||||||
|
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="panel_Page.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel_Page.Name" xml:space="preserve">
|
||||||
|
<value>panel_Page</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel_Page.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel_Page.Parent" xml:space="preserve">
|
||||||
|
<value>tableLayoutPanel1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel_Page.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>402, -2</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>104, 41</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>2</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.Text" xml:space="preserve">
|
||||||
|
<value>拧紧确认</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.Name" xml:space="preserve">
|
||||||
|
<value>button1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.Parent" xml:space="preserve">
|
||||||
|
<value>panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<data name="menuStrip1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
|
<value>Fill</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuStrip1.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>0, 0</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuStrip1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||||
|
<value>7, 2, 0, 2</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuStrip1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>2022, 39</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuStrip1.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuStrip1.Text" xml:space="preserve">
|
||||||
|
<value>menuStrip1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>menuStrip1.Name" xml:space="preserve">
|
||||||
|
<value>menuStrip1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>menuStrip1.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>menuStrip1.Parent" xml:space="preserve">
|
||||||
|
<value>panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>menuStrip1.ZOrder" xml:space="preserve">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
|
<value>Fill</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>2, 2</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||||
|
<value>2, 2, 2, 2</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>2022, 39</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel2.Name" xml:space="preserve">
|
||||||
|
<value>panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel2.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel2.Parent" xml:space="preserve">
|
||||||
|
<value>tableLayoutPanel1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>panel2.ZOrder" xml:space="preserve">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
|
<value>Fill</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>0, 0</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||||
|
<value>2, 2, 2, 2</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
|
||||||
|
<value>2</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>2026, 1093</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>tableLayoutPanel1.Name" xml:space="preserve">
|
||||||
|
<value>tableLayoutPanel1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>tableLayoutPanel1.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>tableLayoutPanel1.Parent" xml:space="preserve">
|
||||||
|
<value>$this</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>tableLayoutPanel1.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
|
||||||
|
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="panel_Page" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="panel2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,43,Percent,100" /></TableLayoutSettings></value>
|
||||||
|
</data>
|
||||||
|
<data name="文件ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>62, 35</value>
|
||||||
|
</data>
|
||||||
|
<data name="文件ToolStripMenuItem.Text" xml:space="preserve">
|
||||||
|
<value>系统</value>
|
||||||
|
</data>
|
||||||
|
<data name="上下限设置ToolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>200, 34</value>
|
||||||
|
</data>
|
||||||
|
<data name="上下限设置ToolStripMenuItem1.Text" xml:space="preserve">
|
||||||
|
<value>上下限设置</value>
|
||||||
|
</data>
|
||||||
|
<data name="系统日志ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>200, 34</value>
|
||||||
|
</data>
|
||||||
|
<data name="系统日志ToolStripMenuItem.Text" xml:space="preserve">
|
||||||
|
<value>系统日志</value>
|
||||||
|
</data>
|
||||||
|
<data name="ToolStripMenuItem_exit.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>200, 34</value>
|
||||||
|
</data>
|
||||||
|
<data name="ToolStripMenuItem_exit.Text" xml:space="preserve">
|
||||||
|
<value>退出</value>
|
||||||
|
</data>
|
||||||
|
<data name="监控ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>62, 35</value>
|
||||||
|
</data>
|
||||||
|
<data name="监控ToolStripMenuItem.Text" xml:space="preserve">
|
||||||
|
<value>监控</value>
|
||||||
|
</data>
|
||||||
|
<data name="pLC监控ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>178, 34</value>
|
||||||
|
</data>
|
||||||
|
<data name="pLC监控ToolStripMenuItem.Text" xml:space="preserve">
|
||||||
|
<value>PLC监控</value>
|
||||||
|
</data>
|
||||||
|
<data name="查询ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>134, 35</value>
|
||||||
|
</data>
|
||||||
|
<data name="查询ToolStripMenuItem.Text" xml:space="preserve">
|
||||||
|
<value>查询生产信息</value>
|
||||||
|
</data>
|
||||||
|
<data name="aGV调试ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>100, 35</value>
|
||||||
|
</data>
|
||||||
|
<data name="aGV调试ToolStripMenuItem.Text" xml:space="preserve">
|
||||||
|
<value>AGV调试</value>
|
||||||
|
</data>
|
||||||
|
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>49</value>
|
||||||
|
</metadata>
|
||||||
|
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||||
|
<value>144, 144</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.AutoScroll" type="System.Boolean, mscorlib">
|
||||||
|
<value>True</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>2026, 1093</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA
|
||||||
|
AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AxodGBciJSHLKjEuYyoxMlsqM
|
||||||
|
TJbKjEyWyoxMlsqMTJbKjEyWyoxMlsqMTJbKjEyWyoxMlsqMTJbKjEyWyoxMlsqMTJbKjEuYyIlIcsaH
|
||||||
|
RgX///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wC+fToHzI5OuOix
|
||||||
|
eP/wvIX/8LuE//C7hP/wu4T/8LuE//C7hP/wu4T/8LuE//C7hP/wu4T/8LuE//C7hP/wu4T/8LyF/+ix
|
||||||
|
eP/Mjk64v306B////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wDIiUhk3KNn9e+6g//wu4T/8LuE//C8hP/wvIX/77uE/++7hP/vu4T/77uE//C8hf/wvIT/8LuE//C7
|
||||||
|
hP/vuoP/3KNn9ciJSGT///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AMWFQwbGh0ZUyotLk8qMTJbKjEyUyYtKsNKWWPvfp2v/36Zr/9+ma//fp2v/0pZY+8mL
|
||||||
|
SrDKjEyUyoxMlsqLS5PGh0ZUxYVEB////wD///8A////AP///wD///8A////AP///wDIiUgCwoI/CLt5
|
||||||
|
NQm7eTUJu3k1Cbt5NQm7eTUJung0CLNvKga0cCoHtHArB6BWDAPCgT9E3aNo9vvKlf/7yZX/+8mV//vK
|
||||||
|
lf/do2j2woE/RKBWDAO0cCsHtHAqB7NvKQa6eDQIu3k1Cbt5NQm7eTUJu3k1Cbt5NQnCgj8IyIlIAsaH
|
||||||
|
RjbLjUy40JNUwNCTVMDQk1TA0JNUwNCTVMDQk1TA0JNUwNCTVMDQk1TA0JNUv8+SUtDTl1n926Fl/9uh
|
||||||
|
Zf/boWX/26Fl/9OXWf3PklLQ0JNUv9CTVMDQk1TA0JNUwNCTVMDQk1TA0JNUwM+SUsDPklLA0JJTwMuN
|
||||||
|
TLjGh0Y2xIRCSNuhZfT2w47/9sON//bDjf/2w43/9sON//bDjf/2w43/9sON//bDjf/2w43/9sOO//bD
|
||||||
|
jv/2w43/9sON//bDjf/2w43/9sOO//bDjv/2w43/9sON//bDjf/2w43/9sON//bDjf/2w47/9syf//bR
|
||||||
|
qf/2ypv/26Fl9MSEQkjDg0FI3qVq9P7Nmf/+zZn//s2Z//7Nmf/+zZn//s2Z//7Nmf/+zZn//s2Z//7N
|
||||||
|
mf/+zZn//s2Z//7Nmf/+zZn//s2Z//7Nmf/+zZn//s2Z//7Nmf/+zZn//s2Z//7Nmf/+zZn//s2Z//7N
|
||||||
|
mv/+4MD//+rU//7btv/epWn0w4NBSMWGREjRllj036hv/9+ob//fqG//36hv/9+ob//fqG//36hv/9+o
|
||||||
|
b//fqG//36hv/9+ob//fqG//36hv/9+ob//fqG//36hv/9+ob//fqG//36hv/9+ob//fqG//36hv/9+o
|
||||||
|
b//fqG//36hv/9+obv/fqG7/36hu/9GWWPTFhkRIxII9SNmugfTw4dH/8ODQ//Dg0P/w4ND/8ODQ//Dg
|
||||||
|
0P/w4ND/8ODQ//Dg0P/w4ND/8ODQ//Dg0P/w4ND/8ODQ//Dg0P/w4ND/8ODQ//Dg0P/w4ND/8ODQ//Dg
|
||||||
|
0P/w4ND/8ODQ//Dg0P/w4ND/8ODQ//Dg0P/w4dH/2a6B9MSCPUjDfzpI37uV9P//////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
///////////////////////////////////////////////////fu5X0w386SMN/Okjfu5X0////////
|
||||||
|
////////////////////////////////////////////////////////////////////////+vXv//v2
|
||||||
|
8f///////////////////////////////////////////////////////////9+7lfTDfzpIw386SN+7
|
||||||
|
lfT/////////////////////////////////////////////////////////////////////////////
|
||||||
|
///jxKP/4b+c////////////////////////////////////////////////////////////37uV9MN/
|
||||||
|
OkjDfzpI37uV9P//////////////////////////////////////////////////////////////////
|
||||||
|
////////+PDo/9eqe//Vp3b/9ere////////////////////////////////////////////////////
|
||||||
|
///fu5X0w386SMN/Okjfu5X0////////////////////////////////////////////////////////
|
||||||
|
///////////////////myq3/5cip/+vUvP/hvpv//v79////////////////////////////////////
|
||||||
|
/////////////9+7lfTDfzpIw386SN+7lfT/////////////////////////////////////////////
|
||||||
|
////////////////////////+vXv/9qxh//27OL//Pn2/9y1jP/y5NX/////////////////////////
|
||||||
|
////////////////////////37uV9MN/OkjDgDpI3rmS9P36+P/9+vf//fr3//369//9+vf//fr3//36
|
||||||
|
9//9+vf//vz6///////////////////////r1Lz/4sKh////////////7dnF/964kv/8+PT//fr3//36
|
||||||
|
9//9+vf//fr3//369//9+vf//fr3//36+P/euZL0w4A6SMaFQkjQm2T03LSL/9y0iv/ctIr/3LSK/9y0
|
||||||
|
iv/ctIr/3LSK/9uyiP/eupT/+/fy/////////////Pj1/9y1jf/06Nv////////////9+/j/37yX/9qw
|
||||||
|
hf/ctIv/3LSK/9y0iv/ctIr/3LSK/9y0iv/ctIr/3LSL/9CbZPTGhUJIxIE8SNy0i/T48Of/+O/m//jv
|
||||||
|
5v/47+b/+O/m//jv5v/47+b/9+/m/9+6lP/q0bn////////////t2cT/3rqU//79/P//////////////
|
||||||
|
///8+PT/9+/m//jv5v/47+b/+O/m//jv5v/47+b/+O/m//jv5v/48Of/3LSL9MSBPEjDfzpI37uV9P//
|
||||||
|
////////////////////////////////////////9erf/9qvhP/58+3//fz6/922jv/x4dD/////////
|
||||||
|
///////////////////////////////////////////////////////////////////fu5X0w386SMN/
|
||||||
|
Okjfu5X0////////////////////////////////////////////////48Oi/+bKrv/x4ND/3beP//37
|
||||||
|
+v///////////////////////////////////////////////////////////////////////////9+7
|
||||||
|
lfTDfzpIw386SN+7lfT////////////////////////////////////////////////37+b/2a6C/9er
|
||||||
|
ff/u28f/////////////////////////////////////////////////////////////////////////
|
||||||
|
////////37uV9MN/OkjDfzpI37uV9P//////////////////////////////////////////////////
|
||||||
|
///myaz/16p8//z59v//////////////////////////////////////////////////////////////
|
||||||
|
///////////////////fu5X0w386SMN/Okjfu5X0////////////////////////////////////////
|
||||||
|
//////////////r17//16dz/////////////////////////////////////////////////////////
|
||||||
|
/////////////////////////////9+7lfTDfzpIw386SN+7lfT/////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////37uV9MN/OkjEgTxI3LSL9Pjw5//47+f/+O/n//jv
|
||||||
|
5//47+f/+O/n//jv5//47+f/+O/n//jv5//47+f/+O/n//jv5//47+f/+O/n//jv5//47+f/+O/n//jv
|
||||||
|
5//47+f/+O/n//jv5//47+f/+O/n//jv5//47+f/+O/n//jw5//ctIv0xIE8SMaHRTbLkFO40JtkwNCb
|
||||||
|
ZMDQm2TA0JtkwNCbZMDQm2TA0JtkwNCbZMDQm2TA0JtkwNCbZMDQm2TA0JtkwNCbZMDQm2TA0JtkwNCb
|
||||||
|
ZMDQm2TA0JtkwNCbZMDQm2TA0JtkwNCbZMDQm2TA0JtkwNCbZMDQm2TA0JtkwMuQU7jGh0U2yIpKAsJ9
|
||||||
|
NQi6bR4Jum0eCbptHgm6bR4Jum0eCbptHgm6bR4Jum0eCbptHgm6bR4Jum0eCbptHgm6bR4Jum0eCbpt
|
||||||
|
Hgm6bR4Jum0eCbptHgm6bR4Jum0eCbptHgm6bR4Jum0eCbptHgm6bR4Jum0eCbptHgm6bR4Jwn01CMiK
|
||||||
|
SgL///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
|
||||||
|
/wD///8A////AP///wD///8A///////////8AAA//AAAP/4AAH/+AAB/AAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
|
AAAAAAAAAAAAAAAAAAAAAAAA//////////8=
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||||
|
<value>2, 2, 2, 2</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||||
|
<value>CenterScreen</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.Text" xml:space="preserve">
|
||||||
|
<value>监控系统( 2023.1213)</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>文件ToolStripMenuItem.Name" xml:space="preserve">
|
||||||
|
<value>文件ToolStripMenuItem</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>文件ToolStripMenuItem.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>上下限设置ToolStripMenuItem1.Name" xml:space="preserve">
|
||||||
|
<value>上下限设置ToolStripMenuItem1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>上下限设置ToolStripMenuItem1.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>系统日志ToolStripMenuItem.Name" xml:space="preserve">
|
||||||
|
<value>系统日志ToolStripMenuItem</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>系统日志ToolStripMenuItem.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>ToolStripMenuItem_exit.Name" xml:space="preserve">
|
||||||
|
<value>ToolStripMenuItem_exit</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>ToolStripMenuItem_exit.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>监控ToolStripMenuItem.Name" xml:space="preserve">
|
||||||
|
<value>监控ToolStripMenuItem</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>监控ToolStripMenuItem.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>pLC监控ToolStripMenuItem.Name" xml:space="preserve">
|
||||||
|
<value>pLC监控ToolStripMenuItem</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>pLC监控ToolStripMenuItem.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>查询ToolStripMenuItem.Name" xml:space="preserve">
|
||||||
|
<value>查询ToolStripMenuItem</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>查询ToolStripMenuItem.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>aGV调试ToolStripMenuItem.Name" xml:space="preserve">
|
||||||
|
<value>aGV调试ToolStripMenuItem</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>aGV调试ToolStripMenuItem.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>$this.Name" xml:space="preserve">
|
||||||
|
<value>MesWorkForm</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>$this.Type" xml:space="preserve">
|
||||||
|
<value>MesWork.PlcLinkForm, MesWork.PLC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
256
CCYQ_JieFang/OP/AgvTest.Designer.cs
generated
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
partial class AgvTest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.button5 = new System.Windows.Forms.Button();
|
||||||
|
this.button4 = new System.Windows.Forms.Button();
|
||||||
|
this.button3 = new System.Windows.Forms.Button();
|
||||||
|
this.button2 = new System.Windows.Forms.Button();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.checkBox4_position4 = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkBox1_position1 = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkBox3_position3 = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkBox2_position2 = new System.Windows.Forms.CheckBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.panel1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// button5
|
||||||
|
//
|
||||||
|
this.button5.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.button5.Location = new System.Drawing.Point(364, 334);
|
||||||
|
this.button5.Name = "button5";
|
||||||
|
this.button5.Size = new System.Drawing.Size(317, 57);
|
||||||
|
this.button5.TabIndex = 12;
|
||||||
|
this.button5.Text = "4.AGV已经离开工位(下料)";
|
||||||
|
this.button5.UseVisualStyleBackColor = true;
|
||||||
|
this.button5.Click += new System.EventHandler(this.button5_Click);
|
||||||
|
//
|
||||||
|
// button4
|
||||||
|
//
|
||||||
|
this.button4.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.button4.Location = new System.Drawing.Point(29, 334);
|
||||||
|
this.button4.Name = "button4";
|
||||||
|
this.button4.Size = new System.Drawing.Size(309, 57);
|
||||||
|
this.button4.TabIndex = 13;
|
||||||
|
this.button4.Text = "4.AGV已经离开工位(上料)";
|
||||||
|
this.button4.UseVisualStyleBackColor = true;
|
||||||
|
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||||
|
//
|
||||||
|
// button3
|
||||||
|
//
|
||||||
|
this.button3.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.button3.Location = new System.Drawing.Point(364, 193);
|
||||||
|
this.button3.Name = "button3";
|
||||||
|
this.button3.Size = new System.Drawing.Size(317, 57);
|
||||||
|
this.button3.TabIndex = 14;
|
||||||
|
this.button3.Text = "3.AGV请求离开工位";
|
||||||
|
this.button3.UseVisualStyleBackColor = true;
|
||||||
|
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
this.button2.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.button2.Location = new System.Drawing.Point(29, 193);
|
||||||
|
this.button2.Name = "button2";
|
||||||
|
this.button2.Size = new System.Drawing.Size(317, 57);
|
||||||
|
this.button2.TabIndex = 15;
|
||||||
|
this.button2.Text = "2.AGV请求进入工位";
|
||||||
|
this.button2.UseVisualStyleBackColor = true;
|
||||||
|
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.button1.Location = new System.Drawing.Point(29, 50);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(317, 57);
|
||||||
|
this.button1.TabIndex = 16;
|
||||||
|
this.button1.Text = "1.AGV进行送料(允许工作)";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.panel1.Controls.Add(this.checkBox4_position4);
|
||||||
|
this.panel1.Controls.Add(this.checkBox1_position1);
|
||||||
|
this.panel1.Controls.Add(this.checkBox3_position3);
|
||||||
|
this.panel1.Controls.Add(this.checkBox2_position2);
|
||||||
|
this.panel1.Location = new System.Drawing.Point(364, 31);
|
||||||
|
this.panel1.Name = "panel1";
|
||||||
|
this.panel1.Size = new System.Drawing.Size(259, 90);
|
||||||
|
this.panel1.TabIndex = 18;
|
||||||
|
//
|
||||||
|
// checkBox4_position4
|
||||||
|
//
|
||||||
|
this.checkBox4_position4.AutoSize = true;
|
||||||
|
this.checkBox4_position4.Checked = true;
|
||||||
|
this.checkBox4_position4.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
|
this.checkBox4_position4.Location = new System.Drawing.Point(133, 56);
|
||||||
|
this.checkBox4_position4.Name = "checkBox4_position4";
|
||||||
|
this.checkBox4_position4.Size = new System.Drawing.Size(115, 22);
|
||||||
|
this.checkBox4_position4.TabIndex = 19;
|
||||||
|
this.checkBox4_position4.Text = "位置4有料";
|
||||||
|
this.checkBox4_position4.UseVisualStyleBackColor = true;
|
||||||
|
this.checkBox4_position4.CheckedChanged += new System.EventHandler(this.checkBox4_position4_CheckedChanged);
|
||||||
|
//
|
||||||
|
// checkBox1_position1
|
||||||
|
//
|
||||||
|
this.checkBox1_position1.AutoSize = true;
|
||||||
|
this.checkBox1_position1.Checked = true;
|
||||||
|
this.checkBox1_position1.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
|
this.checkBox1_position1.Location = new System.Drawing.Point(12, 15);
|
||||||
|
this.checkBox1_position1.Name = "checkBox1_position1";
|
||||||
|
this.checkBox1_position1.Size = new System.Drawing.Size(115, 22);
|
||||||
|
this.checkBox1_position1.TabIndex = 19;
|
||||||
|
this.checkBox1_position1.Text = "位置1有料";
|
||||||
|
this.checkBox1_position1.UseVisualStyleBackColor = true;
|
||||||
|
this.checkBox1_position1.CheckedChanged += new System.EventHandler(this.checkBox1_position1_CheckedChanged);
|
||||||
|
//
|
||||||
|
// checkBox3_position3
|
||||||
|
//
|
||||||
|
this.checkBox3_position3.AutoSize = true;
|
||||||
|
this.checkBox3_position3.Checked = true;
|
||||||
|
this.checkBox3_position3.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
|
this.checkBox3_position3.Location = new System.Drawing.Point(12, 56);
|
||||||
|
this.checkBox3_position3.Name = "checkBox3_position3";
|
||||||
|
this.checkBox3_position3.Size = new System.Drawing.Size(115, 22);
|
||||||
|
this.checkBox3_position3.TabIndex = 19;
|
||||||
|
this.checkBox3_position3.Text = "位置3有料";
|
||||||
|
this.checkBox3_position3.UseVisualStyleBackColor = true;
|
||||||
|
this.checkBox3_position3.CheckedChanged += new System.EventHandler(this.checkBox3_position3_CheckedChanged);
|
||||||
|
//
|
||||||
|
// checkBox2_position2
|
||||||
|
//
|
||||||
|
this.checkBox2_position2.AutoSize = true;
|
||||||
|
this.checkBox2_position2.Checked = true;
|
||||||
|
this.checkBox2_position2.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
|
this.checkBox2_position2.Location = new System.Drawing.Point(133, 15);
|
||||||
|
this.checkBox2_position2.Name = "checkBox2_position2";
|
||||||
|
this.checkBox2_position2.Size = new System.Drawing.Size(115, 22);
|
||||||
|
this.checkBox2_position2.TabIndex = 19;
|
||||||
|
this.checkBox2_position2.Text = "位置2有料";
|
||||||
|
this.checkBox2_position2.UseVisualStyleBackColor = true;
|
||||||
|
this.checkBox2_position2.CheckedChanged += new System.EventHandler(this.checkBox2_position2_CheckedChanged);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(57, 114);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(17, 18);
|
||||||
|
this.label1.TabIndex = 19;
|
||||||
|
this.label1.Text = ".";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(57, 253);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(17, 18);
|
||||||
|
this.label2.TabIndex = 19;
|
||||||
|
this.label2.Text = ".";
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(361, 253);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(17, 18);
|
||||||
|
this.label3.TabIndex = 19;
|
||||||
|
this.label3.Text = ".";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(57, 394);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(17, 18);
|
||||||
|
this.label4.TabIndex = 19;
|
||||||
|
this.label4.Text = ".";
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(361, 394);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(17, 18);
|
||||||
|
this.label5.TabIndex = 19;
|
||||||
|
this.label5.Text = ".";
|
||||||
|
//
|
||||||
|
// AgvTest
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(718, 465);
|
||||||
|
this.Controls.Add(this.label5);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.panel1);
|
||||||
|
this.Controls.Add(this.button5);
|
||||||
|
this.Controls.Add(this.button4);
|
||||||
|
this.Controls.Add(this.button3);
|
||||||
|
this.Controls.Add(this.button2);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Name = "AgvTest";
|
||||||
|
this.Text = "AGV调试";
|
||||||
|
this.panel1.ResumeLayout(false);
|
||||||
|
this.panel1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button button5;
|
||||||
|
private System.Windows.Forms.Button button4;
|
||||||
|
private System.Windows.Forms.Button button3;
|
||||||
|
private System.Windows.Forms.Button button2;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.Panel panel1;
|
||||||
|
private System.Windows.Forms.CheckBox checkBox1_position1;
|
||||||
|
private System.Windows.Forms.CheckBox checkBox2_position2;
|
||||||
|
private System.Windows.Forms.CheckBox checkBox3_position3;
|
||||||
|
private System.Windows.Forms.CheckBox checkBox4_position4;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
}
|
||||||
|
}
|
||||||
688
CCYQ_JieFang/OP/AgvTest.cs
Normal file
@@ -0,0 +1,688 @@
|
|||||||
|
using MesWork;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Opc.Ua;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
public partial class AgvTest : Form
|
||||||
|
{
|
||||||
|
string currentOpName;
|
||||||
|
public AgvTest(string opName)
|
||||||
|
{
|
||||||
|
currentOpName = opName;
|
||||||
|
InitializeComponent();
|
||||||
|
InitPartInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitPartInfo()
|
||||||
|
{
|
||||||
|
if(publicCore.partCount == 1)
|
||||||
|
{
|
||||||
|
checkBox1_position1.Visible = true;
|
||||||
|
checkBox2_position2.Visible = false;
|
||||||
|
checkBox3_position3.Visible = false;
|
||||||
|
checkBox4_position4.Visible = false;
|
||||||
|
}
|
||||||
|
else if(publicCore.partCount == 2)
|
||||||
|
{
|
||||||
|
checkBox1_position1.Visible = true;
|
||||||
|
checkBox2_position2.Visible = true;
|
||||||
|
checkBox3_position3.Visible = false;
|
||||||
|
checkBox4_position4.Visible = false;
|
||||||
|
}
|
||||||
|
else if(publicCore.partCount == 3)
|
||||||
|
{
|
||||||
|
checkBox1_position1.Visible = true;
|
||||||
|
checkBox2_position2.Visible = true;
|
||||||
|
checkBox3_position3.Visible = true;
|
||||||
|
checkBox4_position4.Visible = false;
|
||||||
|
}
|
||||||
|
else if(publicCore.partCount == 4)
|
||||||
|
{
|
||||||
|
checkBox1_position1.Visible = true;
|
||||||
|
checkBox2_position2.Visible = true;
|
||||||
|
checkBox3_position3.Visible = true;
|
||||||
|
checkBox4_position4.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
label1.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_product", "Info", "正在发送请求,请稍后...");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IPC_product iPC_product = new IPC_product();
|
||||||
|
iPC_product.MsgId = AnalysisMsg.UuidUtil();
|
||||||
|
iPC_product.Location = currentOpName;
|
||||||
|
iPC_product.MsgSource = 2;
|
||||||
|
iPC_product.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
iPC_product.AssemblyInformation = SolveProductCount();
|
||||||
|
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(iPC_product);
|
||||||
|
|
||||||
|
publicCore.LogInsert(currentOpName, "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.IPC_product;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
label1.Text = "请求发送成功!详细信息查看日志";
|
||||||
|
publicCore.LogInsert("IPC_product", "Info", "请求发送成功!详细信息查看日志");
|
||||||
|
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert(currentOpName, "Error", "接口【IPC-接收装配信息】失败!" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert(currentOpName, "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label1.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_product", "Error", "接口【IPC-接收装配信息】失败!" + statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_product", "Error", "接口【IPC-接收装配信息】失败!" + err.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
label2.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Enter", "Info", "正在发送请求,请稍后...");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IPC_RequestEnterOrLeave iPC_RequestEnterOrLeave = new IPC_RequestEnterOrLeave();
|
||||||
|
iPC_RequestEnterOrLeave.MsgId = AnalysisMsg.UuidUtil();
|
||||||
|
iPC_RequestEnterOrLeave.Location = currentOpName;
|
||||||
|
iPC_RequestEnterOrLeave.MsgSource = 2;
|
||||||
|
iPC_RequestEnterOrLeave.RequestType = 1;
|
||||||
|
iPC_RequestEnterOrLeave.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(iPC_RequestEnterOrLeave);
|
||||||
|
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Enter", "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.IPC_RequestEnterOrLeave;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
label2.Text = "请求发送成功!详细信息查看日志";
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Enter", "Info", "请求发送成功!详细信息查看日志");
|
||||||
|
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Enter", "Error", "接口【IPC-AGV请求进入/离开】失败!" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Enter", "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label2.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Enter", "Error", "接口【IPC-AGV请求进入/离开】失败!" + statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert(currentOpName, "Error", "接口【IPC-接收装配信息】失败!" + err.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button3_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
label3.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Leave", "Info", "正在发送请求,请稍后...");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IPC_RequestEnterOrLeave iPC_RequestEnterOrLeave = new IPC_RequestEnterOrLeave();
|
||||||
|
iPC_RequestEnterOrLeave.MsgId = AnalysisMsg.UuidUtil();
|
||||||
|
iPC_RequestEnterOrLeave.Location = currentOpName;
|
||||||
|
iPC_RequestEnterOrLeave.MsgSource = 2;
|
||||||
|
iPC_RequestEnterOrLeave.RequestType = 2;
|
||||||
|
iPC_RequestEnterOrLeave.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(iPC_RequestEnterOrLeave);
|
||||||
|
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Leave", "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.IPC_RequestEnterOrLeave;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
label3.Text = "请求发送成功!详细信息查看日志";
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Leave", "Info", "请求发送成功!详细信息查看日志");
|
||||||
|
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Leave", "Error", "接口【IPC-AGV请求进入/离开】失败!" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Leave", "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label3.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Leave", "Error", "接口【IPC-AGV请求进入/离开】失败!" + statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_RequestEnterOrLeave_Leave", "Error", "接口【IPC-AGV请求进入/离开】失败!" + err.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button4_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
label4.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Up", "Info", "正在发送请求,请稍后...");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IPC_WorkFinsih iPC_WorkFinsih = new IPC_WorkFinsih();
|
||||||
|
iPC_WorkFinsih.MsgId = AnalysisMsg.UuidUtil();
|
||||||
|
iPC_WorkFinsih.Location = currentOpName;
|
||||||
|
iPC_WorkFinsih.MsgSource = 2;
|
||||||
|
iPC_WorkFinsih.FinishType = 1;
|
||||||
|
iPC_WorkFinsih.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(iPC_WorkFinsih);
|
||||||
|
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Up", "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.IPC_WorkFinsih;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
label4.Text = "请求发送成功!详细信息查看日志";
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Up", "Info", "请求发送成功!详细信息查看日志");
|
||||||
|
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Up", "Error", "接口【IPC-AGV上料完成离开】失败!" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Up", "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label4.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Up", "Error", "接口【IPC-AGV上料完成离开】失败!" + statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Up", "Error", "接口【IPC-AGV上料完成离开】失败!" + err.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
label5.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Down", "Info", "正在发送请求,请稍后...");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IPC_WorkFinsih iPC_WorkFinsih = new IPC_WorkFinsih();
|
||||||
|
iPC_WorkFinsih.MsgId = AnalysisMsg.UuidUtil();
|
||||||
|
iPC_WorkFinsih.Location = currentOpName;
|
||||||
|
iPC_WorkFinsih.MsgSource = 2;
|
||||||
|
iPC_WorkFinsih.FinishType = 2;
|
||||||
|
iPC_WorkFinsih.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(iPC_WorkFinsih);
|
||||||
|
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Down", "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.IPC_WorkFinsih;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
label5.Text = "请求发送成功!详细信息查看日志";
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Down", "Info", "请求发送成功!详细信息查看日志");
|
||||||
|
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Down", "Error", "接口【IPC-AGV上料完成离开】失败!" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Down", "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label4.Text = "正在发送请求,请稍后...";
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Down", "Error", "接口【IPC-AGV上料完成离开】失败!" + statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("IPC_WorkFinsih_Down", "Error", "接口【IPC-AGV上料完成离开】失败!" + err.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private List<IPC_product_AssemblyInformation> SolveProductCount()
|
||||||
|
{
|
||||||
|
List<IPC_product_AssemblyInformation> AssemblyInformation = new List<IPC_product_AssemblyInformation>();
|
||||||
|
string currentTime = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||||
|
if (publicCore.partCount == 1)
|
||||||
|
{
|
||||||
|
if(checkBox1_position1.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation1 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation1.productPosition = 1;
|
||||||
|
product_AssemblyInformation1.productNo = currentTime + "_part1";
|
||||||
|
product_AssemblyInformation1.productName = "装配件01";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (publicCore.partCount == 2)
|
||||||
|
{
|
||||||
|
if (checkBox1_position1.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation1 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation1.productPosition = 1;
|
||||||
|
product_AssemblyInformation1.productNo = currentTime + "_part1";
|
||||||
|
product_AssemblyInformation1.productName = "装配件01";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation1);
|
||||||
|
}
|
||||||
|
if (checkBox2_position2.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation2 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation2.productPosition = 2;
|
||||||
|
product_AssemblyInformation2.productNo = currentTime + "_part2";
|
||||||
|
product_AssemblyInformation2.productName = "装配件02";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (publicCore.partCount == 3)
|
||||||
|
{
|
||||||
|
if (checkBox1_position1.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation1 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation1.productPosition = 1;
|
||||||
|
product_AssemblyInformation1.productNo = currentTime + "_part1";
|
||||||
|
product_AssemblyInformation1.productName = "装配件01";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation1);
|
||||||
|
}
|
||||||
|
if (checkBox2_position2.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation2 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation2.productPosition = 2;
|
||||||
|
product_AssemblyInformation2.productNo = currentTime + "_part2";
|
||||||
|
product_AssemblyInformation2.productName = "装配件02";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation2);
|
||||||
|
}
|
||||||
|
if (checkBox3_position3.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation3 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation3.productPosition = 3;
|
||||||
|
product_AssemblyInformation3.productNo = currentTime + "_part3";
|
||||||
|
product_AssemblyInformation3.productName = "装配件03";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (publicCore.partCount == 4)
|
||||||
|
{
|
||||||
|
if (checkBox1_position1.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation1 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation1.productPosition = 1;
|
||||||
|
product_AssemblyInformation1.productNo = currentTime + "_part1";
|
||||||
|
product_AssemblyInformation1.productName = "装配件01";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation1);
|
||||||
|
}
|
||||||
|
if (checkBox2_position2.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation2 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation2.productPosition = 2;
|
||||||
|
product_AssemblyInformation2.productNo = currentTime + "_part2";
|
||||||
|
product_AssemblyInformation2.productName = "装配件02";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation2);
|
||||||
|
}
|
||||||
|
if (checkBox3_position3.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation3 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation3.productPosition = 3;
|
||||||
|
product_AssemblyInformation3.productNo = currentTime + "_part3";
|
||||||
|
product_AssemblyInformation3.productName = "装配件03";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation3);
|
||||||
|
}
|
||||||
|
if (checkBox4_position4.Checked)
|
||||||
|
{
|
||||||
|
IPC_product_AssemblyInformation product_AssemblyInformation4 = new IPC_product_AssemblyInformation();
|
||||||
|
product_AssemblyInformation4.productPosition = 4;
|
||||||
|
product_AssemblyInformation4.productNo = currentTime + "_part4";
|
||||||
|
product_AssemblyInformation4.productName = "装配件04";
|
||||||
|
AssemblyInformation.Add(product_AssemblyInformation4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AssemblyInformation;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBox1_position1_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SolveProductCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBox2_position2_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SolveProductCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBox3_position3_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SolveProductCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBox4_position4_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SolveProductCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
CCYQ_JieFang/OP/AgvTest.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
181
CCYQ_JieFang/OP/MeasureRangeSet.Designer.cs
generated
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
partial class MeasureRangeSet
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.button1_search = new System.Windows.Forms.Button();
|
||||||
|
this.dataGridView1_part = new System.Windows.Forms.DataGridView();
|
||||||
|
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.工位号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.测量项目 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.测量位置 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.单位 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.上限值 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.下限值 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1_part)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// button1_search
|
||||||
|
//
|
||||||
|
this.button1_search.FlatStyle = System.Windows.Forms.FlatStyle.System;
|
||||||
|
this.button1_search.Location = new System.Drawing.Point(12, 10);
|
||||||
|
this.button1_search.Name = "button1_search";
|
||||||
|
this.button1_search.Size = new System.Drawing.Size(75, 32);
|
||||||
|
this.button1_search.TabIndex = 6;
|
||||||
|
this.button1_search.Text = "查询";
|
||||||
|
this.button1_search.UseVisualStyleBackColor = true;
|
||||||
|
this.button1_search.Click += new System.EventHandler(this.button1_search_Click);
|
||||||
|
//
|
||||||
|
// dataGridView1_part
|
||||||
|
//
|
||||||
|
this.dataGridView1_part.AllowUserToAddRows = false;
|
||||||
|
this.dataGridView1_part.AllowUserToDeleteRows = false;
|
||||||
|
this.dataGridView1_part.AllowUserToResizeRows = false;
|
||||||
|
this.dataGridView1_part.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.dataGridView1_part.ColumnHeadersHeight = 29;
|
||||||
|
this.dataGridView1_part.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||||
|
this.dataGridView1_part.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
|
this.ID,
|
||||||
|
this.工位号,
|
||||||
|
this.测量项目,
|
||||||
|
this.测量位置,
|
||||||
|
this.单位,
|
||||||
|
this.上限值,
|
||||||
|
this.下限值});
|
||||||
|
this.dataGridView1_part.Location = new System.Drawing.Point(12, 49);
|
||||||
|
this.dataGridView1_part.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
this.dataGridView1_part.Name = "dataGridView1_part";
|
||||||
|
this.dataGridView1_part.RowHeadersVisible = false;
|
||||||
|
this.dataGridView1_part.RowHeadersWidth = 51;
|
||||||
|
this.dataGridView1_part.RowTemplate.Height = 27;
|
||||||
|
this.dataGridView1_part.Size = new System.Drawing.Size(1364, 604);
|
||||||
|
this.dataGridView1_part.TabIndex = 5;
|
||||||
|
this.dataGridView1_part.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dataGridView1_part_CellBeginEdit);
|
||||||
|
this.dataGridView1_part.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_part_CellEndEdit);
|
||||||
|
this.dataGridView1_part.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.dataGridView1_part_DataError);
|
||||||
|
//
|
||||||
|
// ID
|
||||||
|
//
|
||||||
|
this.ID.DataPropertyName = "Id";
|
||||||
|
this.ID.HeaderText = "ID";
|
||||||
|
this.ID.MinimumWidth = 6;
|
||||||
|
this.ID.Name = "ID";
|
||||||
|
this.ID.ReadOnly = true;
|
||||||
|
this.ID.Width = 80;
|
||||||
|
//
|
||||||
|
// 工位号
|
||||||
|
//
|
||||||
|
this.工位号.DataPropertyName = "工位号";
|
||||||
|
this.工位号.HeaderText = "工位号";
|
||||||
|
this.工位号.MinimumWidth = 6;
|
||||||
|
this.工位号.Name = "工位号";
|
||||||
|
this.工位号.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// 测量项目
|
||||||
|
//
|
||||||
|
this.测量项目.DataPropertyName = "测量项目";
|
||||||
|
this.测量项目.HeaderText = "测量项目";
|
||||||
|
this.测量项目.MinimumWidth = 6;
|
||||||
|
this.测量项目.Name = "测量项目";
|
||||||
|
this.测量项目.ReadOnly = true;
|
||||||
|
this.测量项目.Width = 150;
|
||||||
|
//
|
||||||
|
// 测量位置
|
||||||
|
//
|
||||||
|
this.测量位置.DataPropertyName = "测量位置";
|
||||||
|
this.测量位置.HeaderText = "测量位置";
|
||||||
|
this.测量位置.MinimumWidth = 6;
|
||||||
|
this.测量位置.Name = "测量位置";
|
||||||
|
this.测量位置.ReadOnly = true;
|
||||||
|
//
|
||||||
|
// 单位
|
||||||
|
//
|
||||||
|
this.单位.DataPropertyName = "测量单位";
|
||||||
|
this.单位.HeaderText = "单位";
|
||||||
|
this.单位.MinimumWidth = 8;
|
||||||
|
this.单位.Name = "单位";
|
||||||
|
this.单位.Width = 150;
|
||||||
|
//
|
||||||
|
// 上限值
|
||||||
|
//
|
||||||
|
this.上限值.DataPropertyName = "上限值";
|
||||||
|
this.上限值.HeaderText = "上限值";
|
||||||
|
this.上限值.MinimumWidth = 8;
|
||||||
|
this.上限值.Name = "上限值";
|
||||||
|
this.上限值.Width = 150;
|
||||||
|
//
|
||||||
|
// 下限值
|
||||||
|
//
|
||||||
|
this.下限值.DataPropertyName = "下限值";
|
||||||
|
this.下限值.HeaderText = "下限值";
|
||||||
|
this.下限值.MinimumWidth = 8;
|
||||||
|
this.下限值.Name = "下限值";
|
||||||
|
this.下限值.Width = 150;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(132, 17);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(242, 18);
|
||||||
|
this.label1.TabIndex = 7;
|
||||||
|
this.label1.Text = "可调整单位、上限值、下限值";
|
||||||
|
//
|
||||||
|
// MeasureRangeSet
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1388, 659);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.button1_search);
|
||||||
|
this.Controls.Add(this.dataGridView1_part);
|
||||||
|
this.Name = "MeasureRangeSet";
|
||||||
|
this.Text = "测量数据设定";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1_part)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button button1_search;
|
||||||
|
private System.Windows.Forms.DataGridView dataGridView1_part;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 工位号;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 测量项目;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 测量位置;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 单位;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 上限值;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 下限值;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
}
|
||||||
|
}
|
||||||
121
CCYQ_JieFang/OP/MeasureRangeSet.cs
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
using MesWork;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
public partial class MeasureRangeSet : Form
|
||||||
|
{
|
||||||
|
string currentOpName;
|
||||||
|
object oldValue = null;
|
||||||
|
public MeasureRangeSet(string opName)
|
||||||
|
{
|
||||||
|
currentOpName = opName;
|
||||||
|
InitializeComponent();
|
||||||
|
dataGridView1_part.AutoGenerateColumns = false;
|
||||||
|
SearchPartInit(currentOpName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_search_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchPartInit(Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void SearchPartInit(string opName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SearchMeasureInfo(opName, out DataTable dt, out string errorMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
dataGridView1_part.DataSource = dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private bool UpdateMeasureInfo(string ID, string upVlaue, string downVlaue, string unit, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "基础数据_质量数据_编辑";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[4];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@上限值", upVlaue);
|
||||||
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@下限值", downVlaue);
|
||||||
|
thisParms[3] = new System.Data.SqlClient.SqlParameter("@测量单位", unit);
|
||||||
|
return publicCore.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out errorMsg);
|
||||||
|
}
|
||||||
|
private bool SearchMeasureInfo(string opName, out DataTable dt, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "基础数据_质量数据_查询";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[1];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
return publicCore.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out dt, out errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dataGridView1_part_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
||||||
|
{
|
||||||
|
object newValue = dataGridView1_part.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
|
||||||
|
|
||||||
|
if(oldValue != newValue)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string ID = GetDgvSVal(e, "ID");
|
||||||
|
string upVlaue = GetDgvSVal(e, "上限值");
|
||||||
|
string downVlaue = GetDgvSVal(e, "下限值");
|
||||||
|
|
||||||
|
if (Convert.ToDouble(upVlaue) < Convert.ToDouble(downVlaue))
|
||||||
|
{
|
||||||
|
MessageBox.Show("上限值应大于下限值!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string unit = GetDgvSVal(e, "测量单位");
|
||||||
|
if (UpdateMeasureInfo(ID, upVlaue, downVlaue, unit, out string errMsg))
|
||||||
|
{
|
||||||
|
MessageBox.Show("设置成功!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("设置失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
MessageBox.Show("设置错误!");
|
||||||
|
}
|
||||||
|
SearchPartInit(currentOpName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private string GetDgvSVal(DataGridViewCellEventArgs e, string cellName)
|
||||||
|
{
|
||||||
|
return ((DataTable)dataGridView1_part.DataSource).Rows[e.RowIndex][cellName].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dataGridView1_part_DataError(object sender, DataGridViewDataErrorEventArgs e)
|
||||||
|
{
|
||||||
|
MessageBox.Show(e.Exception.Message.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dataGridView1_part_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
|
||||||
|
{
|
||||||
|
oldValue = dataGridView1_part.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
162
CCYQ_JieFang/OP/MeasureRangeSet.resx
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="工位号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量项目.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量位置.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="单位.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="上限值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="下限值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="工位号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量项目.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量位置.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="单位.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="上限值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="下限值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
||||||
1179
CCYQ_JieFang/OP/OP10/DAS_OP10.Designer.cs
generated
Normal file
654
CCYQ_JieFang/OP/OP10/DAS_OP10.cs
Normal file
@@ -0,0 +1,654 @@
|
|||||||
|
|
||||||
|
using DK_DC_Tool;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using OpcBasic;
|
||||||
|
using Robot.Common;
|
||||||
|
using Serilog.Events;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class DAS_OP10
|
||||||
|
{
|
||||||
|
InitServer initServer = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private static string OpNameCurrent = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个开始测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicStartMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicEndMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量文本框控件,key为测量位置,value文本框的值
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, TextBox> dicMeasureTextBox = new Dictionary<int, TextBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<DeviceDriver_BasicData.CustomeEvetnArgs> MIS_Funtion_PLC_OP = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_change = null;
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托--处理托盘信息
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_Info = null;
|
||||||
|
|
||||||
|
// 每个工位的满工件数量
|
||||||
|
// 工位OP10 2个
|
||||||
|
public static int partCount = 2;
|
||||||
|
|
||||||
|
public static bool isConnect = false;
|
||||||
|
|
||||||
|
public DAS_OP10(string opName)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
publicCore.partCount = partCount;
|
||||||
|
OpNameCurrent = opName;
|
||||||
|
|
||||||
|
Tighten.E_DeviceHeartBeat -= DeviceHeartBeat_NingJinQiang;
|
||||||
|
Tighten.E_DeviceHeartBeat += DeviceHeartBeat_NingJinQiang;
|
||||||
|
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish -= SolvePicAndMeasureValueWorking;
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish += SolvePicAndMeasureValueWorking;
|
||||||
|
|
||||||
|
MIS_Funtion_PLC_OP -= MIS_Funtion_PLC;
|
||||||
|
MIS_Funtion_PLC_OP += MIS_Funtion_PLC;
|
||||||
|
|
||||||
|
AGV_Task_change -= SolveAgvDeviceStatus;
|
||||||
|
AGV_Task_change += SolveAgvDeviceStatus;
|
||||||
|
|
||||||
|
|
||||||
|
if (MesWorkForm.IsDemoMesServer == 1)
|
||||||
|
{
|
||||||
|
MoNiHeartBeat();
|
||||||
|
}
|
||||||
|
SolvePicAndMeasureValueInit();
|
||||||
|
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
|
||||||
|
//var aa =
|
||||||
|
//new Thread(new ThreadStart(delegate () {
|
||||||
|
// while (true)
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// if (!isConnect)
|
||||||
|
// {
|
||||||
|
// if (publicCore.Get_PartPosition(OpNameCurrent) != -1)
|
||||||
|
// {
|
||||||
|
// isConnect = true;
|
||||||
|
// ProductInfo_search();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch (Exception err) { }
|
||||||
|
// Thread.Sleep(1000);
|
||||||
|
// }
|
||||||
|
//}));
|
||||||
|
//aa.IsBackground = true;
|
||||||
|
//aa.Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
public void MIS_Funtion_PLC(DeviceDriver_BasicData.CustomeEvetnArgs msgEvent)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tagID = msgEvent.TagID.ToString();
|
||||||
|
// var opName = msgEvent.OpName.ToString();
|
||||||
|
var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
|
||||||
|
var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
|
||||||
|
string tagValue;
|
||||||
|
switch (tagTypeID)
|
||||||
|
{
|
||||||
|
case EnumTagTypeID.BOOL:
|
||||||
|
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tagValue = msgEvent.TagValue.ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (tagTypeCodeID)
|
||||||
|
{
|
||||||
|
case 14:
|
||||||
|
DeviceHeartBeat(tagValue);
|
||||||
|
break;
|
||||||
|
// AGV任务
|
||||||
|
case 50:
|
||||||
|
publicCore.SolveAgvTaskNum(OpNameCurrent, tagValue);
|
||||||
|
break;
|
||||||
|
// 51 空闲(请求上料)
|
||||||
|
// 52 完成(请求下料)
|
||||||
|
// 53 故障
|
||||||
|
case 51:
|
||||||
|
case 52:
|
||||||
|
case 53:
|
||||||
|
publicCore.SolveDeviceStatus(OpNameCurrent);
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
break;
|
||||||
|
// 54 第几个件
|
||||||
|
case 54:
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
case 55:
|
||||||
|
publicCore.MeasurePositionChange(OpNameCurrent, 2);
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
//读电批
|
||||||
|
case 56:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP10", "Info", "【PLC_读电批置位】");
|
||||||
|
// 不在这个地方写true,写在接收数据的地方写
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP10", "Info", "【PLC_读电批复位】");
|
||||||
|
MesWorkForm.WritePLC(83, OpNameCurrent, false);
|
||||||
|
publicCore.LogInsert("OP10", "Info", "【IPC_读电批完成复位】");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
//读泄漏量1 2或者压力
|
||||||
|
case 59:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
//publicCore.ReadQualityData_LeakageRate(OpNameCurrent);
|
||||||
|
//publicCore.ReadQualityData_Pressure(OpNameCurrent);
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueInit()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dicStartMasurePictureBox.Add(1, pictureBox2_start_1);
|
||||||
|
dicStartMasurePictureBox.Add(2, pictureBox2_start_2);
|
||||||
|
dicStartMasurePictureBox.Add(3, pictureBox2_start_3);
|
||||||
|
dicStartMasurePictureBox.Add(4, pictureBox2_start_4);
|
||||||
|
dicStartMasurePictureBox.Add(5, pictureBox2_start_5);
|
||||||
|
dicStartMasurePictureBox.Add(6, pictureBox2_start_6);
|
||||||
|
dicStartMasurePictureBox.Add(7, pictureBox2_start_7);
|
||||||
|
dicStartMasurePictureBox.Add(8, pictureBox2_start_8);
|
||||||
|
dicStartMasurePictureBox.Add(9, pictureBox2_start_9);
|
||||||
|
dicStartMasurePictureBox.Add(10, pictureBox2_start_10);
|
||||||
|
dicStartMasurePictureBox.Add(11, pictureBox2_start_11);
|
||||||
|
dicStartMasurePictureBox.Add(12, pictureBox2_start_12);
|
||||||
|
|
||||||
|
dicEndMasurePictureBox.Add(1, pictureBox12_end_1);
|
||||||
|
dicEndMasurePictureBox.Add(2, pictureBox12_end_2);
|
||||||
|
dicEndMasurePictureBox.Add(3, pictureBox12_end_3);
|
||||||
|
dicEndMasurePictureBox.Add(4, pictureBox12_end_4);
|
||||||
|
dicEndMasurePictureBox.Add(5, pictureBox12_end_5);
|
||||||
|
dicEndMasurePictureBox.Add(6, pictureBox12_end_6);
|
||||||
|
dicEndMasurePictureBox.Add(7, pictureBox12_end_7);
|
||||||
|
dicEndMasurePictureBox.Add(8, pictureBox12_end_8);
|
||||||
|
dicEndMasurePictureBox.Add(9, pictureBox12_end_9);
|
||||||
|
dicEndMasurePictureBox.Add(10, pictureBox12_end_10);
|
||||||
|
dicEndMasurePictureBox.Add(11, pictureBox12_end_11);
|
||||||
|
dicEndMasurePictureBox.Add(12, pictureBox12_end_12);
|
||||||
|
|
||||||
|
dicMeasureTextBox.Add(1, textBox_MeasureValue_1);
|
||||||
|
dicMeasureTextBox.Add(2, textBox_MeasureValue_2);
|
||||||
|
dicMeasureTextBox.Add(3, textBox_MeasureValue_3);
|
||||||
|
dicMeasureTextBox.Add(4, textBox_MeasureValue_4);
|
||||||
|
dicMeasureTextBox.Add(5, textBox_MeasureValue_5);
|
||||||
|
dicMeasureTextBox.Add(6, textBox_MeasureValue_6);
|
||||||
|
dicMeasureTextBox.Add(7, textBox_MeasureValue_7);
|
||||||
|
dicMeasureTextBox.Add(8, textBox_MeasureValue_8);
|
||||||
|
dicMeasureTextBox.Add(9, textBox_MeasureValue_9);
|
||||||
|
dicMeasureTextBox.Add(10, textBox_MeasureValue_10);
|
||||||
|
dicMeasureTextBox.Add(11, textBox_MeasureValue_11);
|
||||||
|
dicMeasureTextBox.Add(12, textBox_MeasureValue_12);
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in dicStartMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicEndMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicMeasureTextBox)
|
||||||
|
{
|
||||||
|
item.Value.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "1")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 工作时界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueWorking()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "2")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 界面产品编码和装配位置的显示
|
||||||
|
/// </summary>
|
||||||
|
public void ProductInfo_search()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//textBox1_EngineID.Text = "";
|
||||||
|
//textBox1_PartPosition.Text = "";
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, "", Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, "", Color.White);
|
||||||
|
int PartPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetProductInfo_Init(OpNameCurrent, PartPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, dt.Rows[0]["发动机号"].ToString(), Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, dt.Rows[0]["装配位置"].ToString(), Color.White);
|
||||||
|
//textBox1_EngineID.Text = dt.Rows[0]["发动机号"].ToString();
|
||||||
|
//textBox1_PartPosition.Text = dt.Rows[0]["装配位置"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ShowPicBoxControl(Control c, bool ststus)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Visible = ststus;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowTextBoxControl(Control c, string value, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Text = value;
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowLabelControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
//if (c.InvokeRequired)
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// c.ForeColor = color;
|
||||||
|
//}
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.ForeColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowButtonControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化设备状态
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// </summary>
|
||||||
|
private void SolveDeviceStatusInit(string currentStatus)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Gray);
|
||||||
|
ShowButtonControl(button_finished, Color.Gray);
|
||||||
|
ShowButtonControl(button_empty, Color.Gray);
|
||||||
|
ShowButtonControl(button_alarm, Color.Gray);
|
||||||
|
//button_running.BackColor = Color.Gray;
|
||||||
|
//button_finished.BackColor = Color.Gray;
|
||||||
|
//button_empty.BackColor = Color.Gray;
|
||||||
|
//button_alarm.BackColor = Color.Gray;
|
||||||
|
|
||||||
|
if (currentStatus == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Green);
|
||||||
|
//button_running.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "2")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_empty, Color.SkyBlue);
|
||||||
|
|
||||||
|
//button_empty.BackColor = Color.SkyBlue;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "3")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_finished, Color.DarkOrange);
|
||||||
|
|
||||||
|
//button_finished.BackColor = Color.DarkOrange;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "4")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_alarm, Color.Red);
|
||||||
|
|
||||||
|
//button_alarm.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// AGV设备状态显示
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PLC_AgvTaskNum"></param>
|
||||||
|
private void SolveAgvDeviceStatus(string PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 77 反馈AGV任务
|
||||||
|
switch (PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
case "10":
|
||||||
|
// AGV触发装配任务 正在送料
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Green;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Black);
|
||||||
|
|
||||||
|
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "11":
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
// 允许AGV进行上料 --允许进入
|
||||||
|
// 允许AGV进行下料 --允许进入
|
||||||
|
case "2":
|
||||||
|
case "4":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
case "21":
|
||||||
|
// AGV 上料完成
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
// 1.调用FSS-接收IPC下料请求的接口
|
||||||
|
// 2.反馈任务号:30 AGV已呼叫成功正在去往下料区
|
||||||
|
break;
|
||||||
|
case "31":
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Green);
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Green;
|
||||||
|
// AGV已到达下料区
|
||||||
|
break;
|
||||||
|
case "41":
|
||||||
|
// AGV下料完成
|
||||||
|
break;
|
||||||
|
// 允许AGV离开
|
||||||
|
case "5":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Green);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "51":
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Green;
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Green);
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳button5_heartBeat_Ning
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat(string tagValue)
|
||||||
|
{
|
||||||
|
WritePLC(15, OpNameCurrent, tagValue);
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Gray);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat_NingJinQiang(string tagValue)
|
||||||
|
{
|
||||||
|
if (tagValue != "0")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Red);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void MoNiHeartBeat()
|
||||||
|
{
|
||||||
|
bool tv = false;
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WritePLC(14, OpNameCurrent, tv);
|
||||||
|
tv = !tv;
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBox_MeasureValue_4_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
144
CCYQ_JieFang/OP/OP10/DAS_OP10.resx
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="timHSCZ.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>432, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="timUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>573, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>33</value>
|
||||||
|
</metadata>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
AAABAAEAGhoAAAAAIAAHAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAaAAAAGggGAAAAqUpMzgAAAAFz
|
||||||
|
UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABnElEQVRIS+2Uz2rC
|
||||||
|
QBDGfZRc+h7ec/Mmxhgx2CQGYi65ivUB9NZCArl4EC/SqwgePBRKwUfw0AfZzrfshvVPY1IjlNKBj0xm
|
||||||
|
Z+a3m0xS+7ciZhjGqN1uM0iE7mO/D9RsNh+QXEZkRpIkDArDcJsLoqQREofDYUrFrIwkpBTItu3VaSPX
|
||||||
|
dVkURWwymXD/dL0yECDSB0xdgyoD4RQAqEBVlYGu6a6gfv8x828GbTYfXPP5ik2nz1zwZbxS0Gz2wkzT
|
||||||
|
PBJilYMcx2NBELDl8pUtFivuI3YzSP1g1+t3foLx+Ik3huAjhrUfgeI4rgOGq2xQ9ERpmmpUa6HecZw0
|
||||||
|
F6SaCiryjkQZN7q//lOl3Wq6ru9RjPFFM+i7qZMj7vv+djAYpOhRCETJdSrKdpon9TtCDYQedF/sRPjd
|
||||||
|
0OSVEmpokwf0AEiKN71kOL7cned5rNvtbqkAj/Kier3eTuYDhCciWuVbp9PZobllWXt5/FardaArRvZI
|
||||||
|
Io6cT9Q1Go03AieiVb6JQi7a8YgaaGLpzLBGORblZt8NiQ/EX7da7Qtz50LQDuTBxQAAAABJRU5ErkJg
|
||||||
|
gg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
1064
CCYQ_JieFang/OP/OP20/DAS_OP20.Designer.cs
generated
Normal file
648
CCYQ_JieFang/OP/OP20/DAS_OP20.cs
Normal file
@@ -0,0 +1,648 @@
|
|||||||
|
|
||||||
|
using DK_DC_Tool;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using OpcBasic;
|
||||||
|
using Robot.Common;
|
||||||
|
using Serilog.Events;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class DAS_OP20
|
||||||
|
{
|
||||||
|
InitServer initServer = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private static string OpNameCurrent = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个开始测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicStartMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicEndMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量文本框控件,key为测量位置,value文本框的值
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, TextBox> dicMeasureTextBox = new Dictionary<int, TextBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<DeviceDriver_BasicData.CustomeEvetnArgs> MIS_Funtion_PLC_OP = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_change = null;
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托--处理托盘信息
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_Info = null;
|
||||||
|
|
||||||
|
// 每个工位的满工件数量
|
||||||
|
// 工位OP20 3个
|
||||||
|
public static int partCount = 3;
|
||||||
|
|
||||||
|
public static bool isConnect = false;
|
||||||
|
|
||||||
|
public DAS_OP20(string opName)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
publicCore.partCount = partCount;
|
||||||
|
OpNameCurrent = opName;
|
||||||
|
|
||||||
|
Tighten.E_DeviceHeartBeat -= DeviceHeartBeat_NingJinQiang;
|
||||||
|
Tighten.E_DeviceHeartBeat += DeviceHeartBeat_NingJinQiang;
|
||||||
|
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish -= SolvePicAndMeasureValueWorking;
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish += SolvePicAndMeasureValueWorking;
|
||||||
|
|
||||||
|
MIS_Funtion_PLC_OP -= MIS_Funtion_PLC;
|
||||||
|
MIS_Funtion_PLC_OP += MIS_Funtion_PLC;
|
||||||
|
|
||||||
|
AGV_Task_change -= SolveAgvDeviceStatus;
|
||||||
|
AGV_Task_change += SolveAgvDeviceStatus;
|
||||||
|
|
||||||
|
|
||||||
|
if (MesWorkForm.IsDemoMesServer == 1)
|
||||||
|
{
|
||||||
|
MoNiHeartBeat();
|
||||||
|
}
|
||||||
|
SolvePicAndMeasureValueInit();
|
||||||
|
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
|
||||||
|
//var aa =
|
||||||
|
//new Thread(new ThreadStart(delegate () {
|
||||||
|
// while (true)
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// if (!isConnect)
|
||||||
|
// {
|
||||||
|
// if (publicCore.Get_PartPosition(OpNameCurrent) != -1)
|
||||||
|
// {
|
||||||
|
// isConnect = true;
|
||||||
|
// ProductInfo_search();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch (Exception err) { }
|
||||||
|
// Thread.Sleep(1000);
|
||||||
|
// }
|
||||||
|
//}));
|
||||||
|
//aa.IsBackground = true;
|
||||||
|
//aa.Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
public void MIS_Funtion_PLC(DeviceDriver_BasicData.CustomeEvetnArgs msgEvent)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tagID = msgEvent.TagID.ToString();
|
||||||
|
// var opName = msgEvent.OpName.ToString();
|
||||||
|
var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
|
||||||
|
var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
|
||||||
|
string tagValue;
|
||||||
|
switch (tagTypeID)
|
||||||
|
{
|
||||||
|
case EnumTagTypeID.BOOL:
|
||||||
|
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tagValue = msgEvent.TagValue.ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (tagTypeCodeID)
|
||||||
|
{
|
||||||
|
case 14:
|
||||||
|
DeviceHeartBeat(tagValue);
|
||||||
|
break;
|
||||||
|
// AGV任务
|
||||||
|
case 50:
|
||||||
|
publicCore.SolveAgvTaskNum(OpNameCurrent, tagValue);
|
||||||
|
break;
|
||||||
|
// 51 空闲(请求上料)
|
||||||
|
// 52 完成(请求下料)
|
||||||
|
// 53 故障
|
||||||
|
case 51:
|
||||||
|
case 52:
|
||||||
|
case 53:
|
||||||
|
publicCore.SolveDeviceStatus(OpNameCurrent);
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
break;
|
||||||
|
// 54 第几个件
|
||||||
|
case 54:
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
case 55:
|
||||||
|
publicCore.MeasurePositionChange(OpNameCurrent, 2);
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
//读电批
|
||||||
|
case 56:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP20", "Info", "【PLC_读电批置位】");
|
||||||
|
// 不在这个地方写true,写在接收数据的地方写
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP20", "Info", "【PLC_读电批复位】");
|
||||||
|
MesWorkForm.WritePLC(83, OpNameCurrent, false);
|
||||||
|
publicCore.LogInsert("OP20", "Info", "【IPC_读电批完成复位】");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
//读泄漏量1 2或者压力
|
||||||
|
case 59:
|
||||||
|
if(tagValue == "1")
|
||||||
|
{
|
||||||
|
//publicCore.ReadQualityData_LeakageRate(OpNameCurrent);
|
||||||
|
//publicCore.ReadQualityData_Pressure(OpNameCurrent);
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueInit()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dicStartMasurePictureBox.Add(1, pictureBox2_start_1);
|
||||||
|
dicStartMasurePictureBox.Add(2, pictureBox2_start_2);
|
||||||
|
dicStartMasurePictureBox.Add(3, pictureBox2_start_3);
|
||||||
|
dicStartMasurePictureBox.Add(4, pictureBox2_start_4);
|
||||||
|
dicStartMasurePictureBox.Add(5, pictureBox2_start_5);
|
||||||
|
dicStartMasurePictureBox.Add(6, pictureBox2_start_6);
|
||||||
|
dicStartMasurePictureBox.Add(7, pictureBox2_start_7);
|
||||||
|
dicStartMasurePictureBox.Add(8, pictureBox2_start_8);
|
||||||
|
dicStartMasurePictureBox.Add(9, pictureBox2_start_9);
|
||||||
|
dicStartMasurePictureBox.Add(10, pictureBox2_start_10);
|
||||||
|
|
||||||
|
dicEndMasurePictureBox.Add(1, pictureBox12_end_1);
|
||||||
|
dicEndMasurePictureBox.Add(2, pictureBox12_end_2);
|
||||||
|
dicEndMasurePictureBox.Add(3, pictureBox12_end_3);
|
||||||
|
dicEndMasurePictureBox.Add(4, pictureBox12_end_4);
|
||||||
|
dicEndMasurePictureBox.Add(5, pictureBox12_end_5);
|
||||||
|
dicEndMasurePictureBox.Add(6, pictureBox12_end_6);
|
||||||
|
dicEndMasurePictureBox.Add(7, pictureBox12_end_7);
|
||||||
|
dicEndMasurePictureBox.Add(8, pictureBox12_end_8);
|
||||||
|
dicEndMasurePictureBox.Add(9, pictureBox12_end_9);
|
||||||
|
dicEndMasurePictureBox.Add(10, pictureBox12_end_10);
|
||||||
|
|
||||||
|
dicMeasureTextBox.Add(1, textBox_MeasureValue_1);
|
||||||
|
dicMeasureTextBox.Add(2, textBox_MeasureValue_2);
|
||||||
|
dicMeasureTextBox.Add(3, textBox_MeasureValue_3);
|
||||||
|
dicMeasureTextBox.Add(4, textBox_MeasureValue_4);
|
||||||
|
dicMeasureTextBox.Add(5, textBox_MeasureValue_5);
|
||||||
|
dicMeasureTextBox.Add(6, textBox_MeasureValue_6);
|
||||||
|
dicMeasureTextBox.Add(7, textBox_MeasureValue_7);
|
||||||
|
dicMeasureTextBox.Add(8, textBox_MeasureValue_8);
|
||||||
|
dicMeasureTextBox.Add(9, textBox_MeasureValue_9);
|
||||||
|
dicMeasureTextBox.Add(10, textBox_MeasureValue_10);
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in dicStartMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicEndMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicMeasureTextBox)
|
||||||
|
{
|
||||||
|
item.Value.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "1")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 工作时界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueWorking()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "2")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 界面产品编码和装配位置的显示
|
||||||
|
/// </summary>
|
||||||
|
public void ProductInfo_search()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//textBox1_EngineID.Text = "";
|
||||||
|
//textBox1_PartPosition.Text = "";
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, "", Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, "", Color.White);
|
||||||
|
int PartPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetProductInfo_Init(OpNameCurrent, PartPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, dt.Rows[0]["发动机号"].ToString(), Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, dt.Rows[0]["装配位置"].ToString(), Color.White);
|
||||||
|
//textBox1_EngineID.Text = dt.Rows[0]["发动机号"].ToString();
|
||||||
|
//textBox1_PartPosition.Text = dt.Rows[0]["装配位置"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ShowPicBoxControl(Control c,bool ststus)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Visible = ststus;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowTextBoxControl(Control c, string value, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Text = value;
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowLabelControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
//if (c.InvokeRequired)
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// c.ForeColor = color;
|
||||||
|
//}
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.ForeColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowButtonControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化设备状态
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// </summary>
|
||||||
|
private void SolveDeviceStatusInit(string currentStatus)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Gray);
|
||||||
|
ShowButtonControl(button_finished, Color.Gray);
|
||||||
|
ShowButtonControl(button_empty, Color.Gray);
|
||||||
|
ShowButtonControl(button_alarm, Color.Gray);
|
||||||
|
//button_running.BackColor = Color.Gray;
|
||||||
|
//button_finished.BackColor = Color.Gray;
|
||||||
|
//button_empty.BackColor = Color.Gray;
|
||||||
|
//button_alarm.BackColor = Color.Gray;
|
||||||
|
|
||||||
|
if (currentStatus == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Green);
|
||||||
|
//button_running.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "2")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_empty, Color.SkyBlue);
|
||||||
|
|
||||||
|
//button_empty.BackColor = Color.SkyBlue;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "3")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_finished, Color.DarkOrange);
|
||||||
|
|
||||||
|
//button_finished.BackColor = Color.DarkOrange;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "4")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_alarm, Color.Red);
|
||||||
|
|
||||||
|
//button_alarm.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// AGV设备状态显示
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PLC_AgvTaskNum"></param>
|
||||||
|
private void SolveAgvDeviceStatus(string PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 77 反馈AGV任务
|
||||||
|
switch (PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
case "10":
|
||||||
|
// AGV触发装配任务 正在送料
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Green;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Black);
|
||||||
|
|
||||||
|
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "11":
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
// 允许AGV进行上料 --允许进入
|
||||||
|
// 允许AGV进行下料 --允许进入
|
||||||
|
case "2":
|
||||||
|
case "4":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
case "21":
|
||||||
|
// AGV 上料完成
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
// 1.调用FSS-接收IPC下料请求的接口
|
||||||
|
// 2.反馈任务号:30 AGV已呼叫成功正在去往下料区
|
||||||
|
break;
|
||||||
|
case "31":
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Green);
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Green;
|
||||||
|
// AGV已到达下料区
|
||||||
|
break;
|
||||||
|
case "41":
|
||||||
|
// AGV下料完成
|
||||||
|
break;
|
||||||
|
// 允许AGV离开
|
||||||
|
case "5":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Green);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "51":
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Green;
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Green);
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳button5_heartBeat_Ning
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat(string tagValue)
|
||||||
|
{
|
||||||
|
WritePLC(15, OpNameCurrent, tagValue);
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Gray);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat_NingJinQiang(string tagValue)
|
||||||
|
{
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Red);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void MoNiHeartBeat()
|
||||||
|
{
|
||||||
|
bool tv = false;
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WritePLC(14, OpNameCurrent, tv);
|
||||||
|
tv = !tv;
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBox_MeasureValue_4_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
144
CCYQ_JieFang/OP/OP20/DAS_OP20.resx
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="timHSCZ.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>432, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="timUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>573, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>33</value>
|
||||||
|
</metadata>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
AAABAAEAGhoAAAAAIAAHAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAaAAAAGggGAAAAqUpMzgAAAAFz
|
||||||
|
UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABnElEQVRIS+2Uz2rC
|
||||||
|
QBDGfZRc+h7ec/Mmxhgx2CQGYi65ivUB9NZCArl4EC/SqwgePBRKwUfw0AfZzrfshvVPY1IjlNKBj0xm
|
||||||
|
Z+a3m0xS+7ciZhjGqN1uM0iE7mO/D9RsNh+QXEZkRpIkDArDcJsLoqQREofDYUrFrIwkpBTItu3VaSPX
|
||||||
|
dVkURWwymXD/dL0yECDSB0xdgyoD4RQAqEBVlYGu6a6gfv8x828GbTYfXPP5ik2nz1zwZbxS0Gz2wkzT
|
||||||
|
PBJilYMcx2NBELDl8pUtFivuI3YzSP1g1+t3foLx+Ik3huAjhrUfgeI4rgOGq2xQ9ERpmmpUa6HecZw0
|
||||||
|
F6SaCiryjkQZN7q//lOl3Wq6ru9RjPFFM+i7qZMj7vv+djAYpOhRCETJdSrKdpon9TtCDYQedF/sRPjd
|
||||||
|
0OSVEmpokwf0AEiKN71kOL7cned5rNvtbqkAj/Kier3eTuYDhCciWuVbp9PZobllWXt5/FardaArRvZI
|
||||||
|
Io6cT9Q1Go03AieiVb6JQi7a8YgaaGLpzLBGORblZt8NiQ/EX7da7Qtz50LQDuTBxQAAAABJRU5ErkJg
|
||||||
|
gg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
610
CCYQ_JieFang/OP/OP30/DAS_OP30.Designer.cs
generated
Normal file
@@ -0,0 +1,610 @@
|
|||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
partial class DAS_OP30: PlcLinkForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.components = new System.ComponentModel.Container();
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DAS_OP30));
|
||||||
|
this.timHSCZ = new System.Windows.Forms.Timer(this.components);
|
||||||
|
this.label9 = new System.Windows.Forms.Label();
|
||||||
|
this.timUI = new System.Windows.Forms.Timer(this.components);
|
||||||
|
this.labelTime = new System.Windows.Forms.Label();
|
||||||
|
this.label18 = new System.Windows.Forms.Label();
|
||||||
|
this.panel7 = new System.Windows.Forms.Panel();
|
||||||
|
this.panel3 = new System.Windows.Forms.Panel();
|
||||||
|
this.pictureBox12_end_2 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.pictureBox2_start_2 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.pictureBox12_end_1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.pictureBox2_start_1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.textBox_MeasureValue_2 = new System.Windows.Forms.TextBox();
|
||||||
|
this.textBox_MeasureValue_1 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.label16 = new System.Windows.Forms.Label();
|
||||||
|
this.button_running = new System.Windows.Forms.Button();
|
||||||
|
this.button_alarm = new System.Windows.Forms.Button();
|
||||||
|
this.button_finished = new System.Windows.Forms.Button();
|
||||||
|
this.button_empty = new System.Windows.Forms.Button();
|
||||||
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
|
this.label_AgvLeaved = new System.Windows.Forms.Label();
|
||||||
|
this.label19 = new System.Windows.Forms.Label();
|
||||||
|
this.label_AgvCanLeave = new System.Windows.Forms.Label();
|
||||||
|
this.label15 = new System.Windows.Forms.Label();
|
||||||
|
this.label_AgvRequestLeave = new System.Windows.Forms.Label();
|
||||||
|
this.button5_heartBeat_Ning = new System.Windows.Forms.Button();
|
||||||
|
this.button5_heartBeat = new System.Windows.Forms.Button();
|
||||||
|
this.label_AgvCanEnter = new System.Windows.Forms.Label();
|
||||||
|
this.textBox1_PartPosition = new System.Windows.Forms.TextBox();
|
||||||
|
this.label_AgvSongliao = new System.Windows.Forms.Label();
|
||||||
|
this.label_AgvRequestEnter = new System.Windows.Forms.Label();
|
||||||
|
this.label17 = new System.Windows.Forms.Label();
|
||||||
|
this.textBox1_EngineID = new System.Windows.Forms.TextBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||||
|
this.panel7.SuspendLayout();
|
||||||
|
this.panel3.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox12_end_2)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox2_start_2)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox12_end_1)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox2_start_1)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
|
this.panel1.SuspendLayout();
|
||||||
|
this.panel2.SuspendLayout();
|
||||||
|
this.tableLayoutPanel1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// timHSCZ
|
||||||
|
//
|
||||||
|
this.timHSCZ.Enabled = true;
|
||||||
|
//
|
||||||
|
// label9
|
||||||
|
//
|
||||||
|
this.label9.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold);
|
||||||
|
this.label9.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||||
|
this.label9.Location = new System.Drawing.Point(-136, -165);
|
||||||
|
this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label9.Name = "label9";
|
||||||
|
this.label9.Size = new System.Drawing.Size(685, 50);
|
||||||
|
this.label9.TabIndex = 22;
|
||||||
|
this.label9.Text = "微型减速机";
|
||||||
|
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// timUI
|
||||||
|
//
|
||||||
|
this.timUI.Enabled = true;
|
||||||
|
//
|
||||||
|
// labelTime
|
||||||
|
//
|
||||||
|
this.labelTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F);
|
||||||
|
this.labelTime.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||||
|
this.labelTime.Location = new System.Drawing.Point(898, -165);
|
||||||
|
this.labelTime.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.labelTime.Name = "labelTime";
|
||||||
|
this.labelTime.Size = new System.Drawing.Size(647, 58);
|
||||||
|
this.labelTime.TabIndex = 23;
|
||||||
|
this.labelTime.Text = "2021-03-09 12:30:30";
|
||||||
|
this.labelTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||||
|
//
|
||||||
|
// label18
|
||||||
|
//
|
||||||
|
this.label18.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.label18.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.label18.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||||
|
this.label18.Font = new System.Drawing.Font("微软雅黑", 10.5F);
|
||||||
|
this.label18.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||||
|
this.label18.Location = new System.Drawing.Point(188, 177);
|
||||||
|
this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label18.Name = "label18";
|
||||||
|
this.label18.Size = new System.Drawing.Size(93, 54);
|
||||||
|
this.label18.TabIndex = 1;
|
||||||
|
this.label18.Text = "查询";
|
||||||
|
this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
|
this.label18.Visible = false;
|
||||||
|
//
|
||||||
|
// panel7
|
||||||
|
//
|
||||||
|
this.panel7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
|
||||||
|
this.panel7.Controls.Add(this.label18);
|
||||||
|
this.panel7.Location = new System.Drawing.Point(-144, -112);
|
||||||
|
this.panel7.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||||
|
this.panel7.Name = "panel7";
|
||||||
|
this.panel7.Size = new System.Drawing.Size(1688, 68);
|
||||||
|
this.panel7.TabIndex = 24;
|
||||||
|
//
|
||||||
|
// panel3
|
||||||
|
//
|
||||||
|
this.panel3.Controls.Add(this.pictureBox12_end_2);
|
||||||
|
this.panel3.Controls.Add(this.pictureBox2_start_2);
|
||||||
|
this.panel3.Controls.Add(this.pictureBox12_end_1);
|
||||||
|
this.panel3.Controls.Add(this.pictureBox2_start_1);
|
||||||
|
this.panel3.Controls.Add(this.textBox_MeasureValue_2);
|
||||||
|
this.panel3.Controls.Add(this.textBox_MeasureValue_1);
|
||||||
|
this.panel3.Controls.Add(this.label6);
|
||||||
|
this.panel3.Controls.Add(this.label5);
|
||||||
|
this.panel3.Controls.Add(this.pictureBox1);
|
||||||
|
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.panel3.Location = new System.Drawing.Point(3, 77);
|
||||||
|
this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.panel3.Name = "panel3";
|
||||||
|
this.panel3.Size = new System.Drawing.Size(1767, 684);
|
||||||
|
this.panel3.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// pictureBox12_end_2
|
||||||
|
//
|
||||||
|
this.pictureBox12_end_2.Image = global::CCYQ_JieFang.Properties.Resources.下压OK;
|
||||||
|
this.pictureBox12_end_2.Location = new System.Drawing.Point(678, 238);
|
||||||
|
this.pictureBox12_end_2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.pictureBox12_end_2.Name = "pictureBox12_end_2";
|
||||||
|
this.pictureBox12_end_2.Size = new System.Drawing.Size(57, 53);
|
||||||
|
this.pictureBox12_end_2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
|
this.pictureBox12_end_2.TabIndex = 9;
|
||||||
|
this.pictureBox12_end_2.TabStop = false;
|
||||||
|
//
|
||||||
|
// pictureBox2_start_2
|
||||||
|
//
|
||||||
|
this.pictureBox2_start_2.Image = global::CCYQ_JieFang.Properties.Resources.下压;
|
||||||
|
this.pictureBox2_start_2.Location = new System.Drawing.Point(678, 238);
|
||||||
|
this.pictureBox2_start_2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.pictureBox2_start_2.Name = "pictureBox2_start_2";
|
||||||
|
this.pictureBox2_start_2.Size = new System.Drawing.Size(57, 53);
|
||||||
|
this.pictureBox2_start_2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
|
this.pictureBox2_start_2.TabIndex = 10;
|
||||||
|
this.pictureBox2_start_2.TabStop = false;
|
||||||
|
//
|
||||||
|
// pictureBox12_end_1
|
||||||
|
//
|
||||||
|
this.pictureBox12_end_1.Image = global::CCYQ_JieFang.Properties.Resources.下压OK;
|
||||||
|
this.pictureBox12_end_1.Location = new System.Drawing.Point(678, 161);
|
||||||
|
this.pictureBox12_end_1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.pictureBox12_end_1.Name = "pictureBox12_end_1";
|
||||||
|
this.pictureBox12_end_1.Size = new System.Drawing.Size(57, 53);
|
||||||
|
this.pictureBox12_end_1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
|
this.pictureBox12_end_1.TabIndex = 9;
|
||||||
|
this.pictureBox12_end_1.TabStop = false;
|
||||||
|
//
|
||||||
|
// pictureBox2_start_1
|
||||||
|
//
|
||||||
|
this.pictureBox2_start_1.Image = global::CCYQ_JieFang.Properties.Resources.下压;
|
||||||
|
this.pictureBox2_start_1.Location = new System.Drawing.Point(678, 161);
|
||||||
|
this.pictureBox2_start_1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.pictureBox2_start_1.Name = "pictureBox2_start_1";
|
||||||
|
this.pictureBox2_start_1.Size = new System.Drawing.Size(57, 53);
|
||||||
|
this.pictureBox2_start_1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
|
this.pictureBox2_start_1.TabIndex = 10;
|
||||||
|
this.pictureBox2_start_1.TabStop = false;
|
||||||
|
//
|
||||||
|
// textBox_MeasureValue_2
|
||||||
|
//
|
||||||
|
this.textBox_MeasureValue_2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.textBox_MeasureValue_2.Font = new System.Drawing.Font("宋体", 17F);
|
||||||
|
this.textBox_MeasureValue_2.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||||
|
this.textBox_MeasureValue_2.Location = new System.Drawing.Point(505, 246);
|
||||||
|
this.textBox_MeasureValue_2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.textBox_MeasureValue_2.Name = "textBox_MeasureValue_2";
|
||||||
|
this.textBox_MeasureValue_2.ReadOnly = true;
|
||||||
|
this.textBox_MeasureValue_2.Size = new System.Drawing.Size(158, 40);
|
||||||
|
this.textBox_MeasureValue_2.TabIndex = 4;
|
||||||
|
this.textBox_MeasureValue_2.Text = "0";
|
||||||
|
//
|
||||||
|
// textBox_MeasureValue_1
|
||||||
|
//
|
||||||
|
this.textBox_MeasureValue_1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.textBox_MeasureValue_1.Font = new System.Drawing.Font("宋体", 17F);
|
||||||
|
this.textBox_MeasureValue_1.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||||
|
this.textBox_MeasureValue_1.Location = new System.Drawing.Point(505, 169);
|
||||||
|
this.textBox_MeasureValue_1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.textBox_MeasureValue_1.Name = "textBox_MeasureValue_1";
|
||||||
|
this.textBox_MeasureValue_1.ReadOnly = true;
|
||||||
|
this.textBox_MeasureValue_1.Size = new System.Drawing.Size(158, 40);
|
||||||
|
this.textBox_MeasureValue_1.TabIndex = 4;
|
||||||
|
this.textBox_MeasureValue_1.Text = "0";
|
||||||
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
this.label6.AutoSize = true;
|
||||||
|
this.label6.BackColor = System.Drawing.Color.White;
|
||||||
|
this.label6.Font = new System.Drawing.Font("宋体", 17F);
|
||||||
|
this.label6.Location = new System.Drawing.Point(411, 250);
|
||||||
|
this.label6.Name = "label6";
|
||||||
|
this.label6.Size = new System.Drawing.Size(86, 29);
|
||||||
|
this.label6.TabIndex = 6;
|
||||||
|
this.label6.Text = "压力2";
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.BackColor = System.Drawing.Color.White;
|
||||||
|
this.label5.Font = new System.Drawing.Font("宋体", 17F);
|
||||||
|
this.label5.Location = new System.Drawing.Point(411, 173);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(86, 29);
|
||||||
|
this.label5.TabIndex = 6;
|
||||||
|
this.label5.Text = "压力1";
|
||||||
|
//
|
||||||
|
// pictureBox1
|
||||||
|
//
|
||||||
|
this.pictureBox1.BackColor = System.Drawing.Color.White;
|
||||||
|
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||||
|
this.pictureBox1.Image = global::CCYQ_JieFang.Properties.Resources._03_卫星模型;
|
||||||
|
this.pictureBox1.Location = new System.Drawing.Point(116, 13);
|
||||||
|
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
|
this.pictureBox1.Size = new System.Drawing.Size(1501, 668);
|
||||||
|
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
|
this.pictureBox1.TabIndex = 0;
|
||||||
|
this.pictureBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
this.panel1.Controls.Add(this.label16);
|
||||||
|
this.panel1.Controls.Add(this.button_running);
|
||||||
|
this.panel1.Controls.Add(this.button_alarm);
|
||||||
|
this.panel1.Controls.Add(this.button_finished);
|
||||||
|
this.panel1.Controls.Add(this.button_empty);
|
||||||
|
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.panel1.Location = new System.Drawing.Point(3, 765);
|
||||||
|
this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.panel1.Name = "panel1";
|
||||||
|
this.panel1.Size = new System.Drawing.Size(1767, 71);
|
||||||
|
this.panel1.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// label16
|
||||||
|
//
|
||||||
|
this.label16.BackColor = System.Drawing.Color.Black;
|
||||||
|
this.label16.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||||
|
this.label16.Location = new System.Drawing.Point(0, 3);
|
||||||
|
this.label16.Name = "label16";
|
||||||
|
this.label16.Size = new System.Drawing.Size(1760, 3);
|
||||||
|
this.label16.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// button_running
|
||||||
|
//
|
||||||
|
this.button_running.BackColor = System.Drawing.Color.Gray;
|
||||||
|
this.button_running.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
||||||
|
this.button_running.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
|
this.button_running.ForeColor = System.Drawing.Color.White;
|
||||||
|
this.button_running.Location = new System.Drawing.Point(34, 12);
|
||||||
|
this.button_running.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.button_running.Name = "button_running";
|
||||||
|
this.button_running.Size = new System.Drawing.Size(296, 55);
|
||||||
|
this.button_running.TabIndex = 4;
|
||||||
|
this.button_running.Text = "设备运行(禁止上下料)";
|
||||||
|
this.button_running.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
|
// button_alarm
|
||||||
|
//
|
||||||
|
this.button_alarm.BackColor = System.Drawing.Color.Gray;
|
||||||
|
this.button_alarm.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
||||||
|
this.button_alarm.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
|
this.button_alarm.ForeColor = System.Drawing.Color.White;
|
||||||
|
this.button_alarm.Location = new System.Drawing.Point(1113, 13);
|
||||||
|
this.button_alarm.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.button_alarm.Name = "button_alarm";
|
||||||
|
this.button_alarm.Size = new System.Drawing.Size(296, 55);
|
||||||
|
this.button_alarm.TabIndex = 5;
|
||||||
|
this.button_alarm.Text = "设备故障";
|
||||||
|
this.button_alarm.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
|
// button_finished
|
||||||
|
//
|
||||||
|
this.button_finished.BackColor = System.Drawing.Color.Gray;
|
||||||
|
this.button_finished.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
||||||
|
this.button_finished.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
|
this.button_finished.ForeColor = System.Drawing.Color.White;
|
||||||
|
this.button_finished.Location = new System.Drawing.Point(393, 12);
|
||||||
|
this.button_finished.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.button_finished.Name = "button_finished";
|
||||||
|
this.button_finished.Size = new System.Drawing.Size(296, 55);
|
||||||
|
this.button_finished.TabIndex = 6;
|
||||||
|
this.button_finished.Text = "完成装配(请求下料)";
|
||||||
|
this.button_finished.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
|
// button_empty
|
||||||
|
//
|
||||||
|
this.button_empty.BackColor = System.Drawing.Color.Gray;
|
||||||
|
this.button_empty.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
|
||||||
|
this.button_empty.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
|
this.button_empty.ForeColor = System.Drawing.Color.White;
|
||||||
|
this.button_empty.Location = new System.Drawing.Point(754, 13);
|
||||||
|
this.button_empty.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.button_empty.Name = "button_empty";
|
||||||
|
this.button_empty.Size = new System.Drawing.Size(296, 55);
|
||||||
|
this.button_empty.TabIndex = 7;
|
||||||
|
this.button_empty.Text = "设备空闲(请求上料)";
|
||||||
|
this.button_empty.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
|
// panel2
|
||||||
|
//
|
||||||
|
this.panel2.Controls.Add(this.label_AgvLeaved);
|
||||||
|
this.panel2.Controls.Add(this.label19);
|
||||||
|
this.panel2.Controls.Add(this.label_AgvCanLeave);
|
||||||
|
this.panel2.Controls.Add(this.label15);
|
||||||
|
this.panel2.Controls.Add(this.label_AgvRequestLeave);
|
||||||
|
this.panel2.Controls.Add(this.button5_heartBeat_Ning);
|
||||||
|
this.panel2.Controls.Add(this.button5_heartBeat);
|
||||||
|
this.panel2.Controls.Add(this.label_AgvCanEnter);
|
||||||
|
this.panel2.Controls.Add(this.textBox1_PartPosition);
|
||||||
|
this.panel2.Controls.Add(this.label_AgvSongliao);
|
||||||
|
this.panel2.Controls.Add(this.label_AgvRequestEnter);
|
||||||
|
this.panel2.Controls.Add(this.label17);
|
||||||
|
this.panel2.Controls.Add(this.textBox1_EngineID);
|
||||||
|
this.panel2.Controls.Add(this.label1);
|
||||||
|
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.panel2.Location = new System.Drawing.Point(3, 2);
|
||||||
|
this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.panel2.Name = "panel2";
|
||||||
|
this.panel2.Size = new System.Drawing.Size(1767, 71);
|
||||||
|
this.panel2.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// label_AgvLeaved
|
||||||
|
//
|
||||||
|
this.label_AgvLeaved.AutoSize = true;
|
||||||
|
this.label_AgvLeaved.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label_AgvLeaved.Location = new System.Drawing.Point(1238, 10);
|
||||||
|
this.label_AgvLeaved.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label_AgvLeaved.Name = "label_AgvLeaved";
|
||||||
|
this.label_AgvLeaved.Size = new System.Drawing.Size(134, 19);
|
||||||
|
this.label_AgvLeaved.TabIndex = 9;
|
||||||
|
this.label_AgvLeaved.Text = "●AGV已经离开";
|
||||||
|
//
|
||||||
|
// label19
|
||||||
|
//
|
||||||
|
this.label19.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.label19.Location = new System.Drawing.Point(1561, 13);
|
||||||
|
this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label19.Name = "label19";
|
||||||
|
this.label19.Size = new System.Drawing.Size(2, 37);
|
||||||
|
this.label19.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// label_AgvCanLeave
|
||||||
|
//
|
||||||
|
this.label_AgvCanLeave.AutoSize = true;
|
||||||
|
this.label_AgvCanLeave.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label_AgvCanLeave.Location = new System.Drawing.Point(1089, 38);
|
||||||
|
this.label_AgvCanLeave.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label_AgvCanLeave.Name = "label_AgvCanLeave";
|
||||||
|
this.label_AgvCanLeave.Size = new System.Drawing.Size(134, 19);
|
||||||
|
this.label_AgvCanLeave.TabIndex = 9;
|
||||||
|
this.label_AgvCanLeave.Text = "●AGV可以离开";
|
||||||
|
//
|
||||||
|
// label15
|
||||||
|
//
|
||||||
|
this.label15.BackColor = System.Drawing.Color.Black;
|
||||||
|
this.label15.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||||
|
this.label15.Location = new System.Drawing.Point(0, 62);
|
||||||
|
this.label15.Name = "label15";
|
||||||
|
this.label15.Size = new System.Drawing.Size(1760, 3);
|
||||||
|
this.label15.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// label_AgvRequestLeave
|
||||||
|
//
|
||||||
|
this.label_AgvRequestLeave.AutoSize = true;
|
||||||
|
this.label_AgvRequestLeave.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label_AgvRequestLeave.Location = new System.Drawing.Point(1089, 10);
|
||||||
|
this.label_AgvRequestLeave.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label_AgvRequestLeave.Name = "label_AgvRequestLeave";
|
||||||
|
this.label_AgvRequestLeave.Size = new System.Drawing.Size(134, 19);
|
||||||
|
this.label_AgvRequestLeave.TabIndex = 9;
|
||||||
|
this.label_AgvRequestLeave.Text = "●AGV请求离开";
|
||||||
|
//
|
||||||
|
// button5_heartBeat_Ning
|
||||||
|
//
|
||||||
|
this.button5_heartBeat_Ning.BackColor = System.Drawing.Color.Gray;
|
||||||
|
this.button5_heartBeat_Ning.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
|
this.button5_heartBeat_Ning.ForeColor = System.Drawing.Color.White;
|
||||||
|
this.button5_heartBeat_Ning.Location = new System.Drawing.Point(1569, 10);
|
||||||
|
this.button5_heartBeat_Ning.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.button5_heartBeat_Ning.Name = "button5_heartBeat_Ning";
|
||||||
|
this.button5_heartBeat_Ning.Size = new System.Drawing.Size(89, 43);
|
||||||
|
this.button5_heartBeat_Ning.TabIndex = 5;
|
||||||
|
this.button5_heartBeat_Ning.Text = "拧紧枪";
|
||||||
|
this.button5_heartBeat_Ning.UseVisualStyleBackColor = false;
|
||||||
|
this.button5_heartBeat_Ning.Visible = false;
|
||||||
|
//
|
||||||
|
// button5_heartBeat
|
||||||
|
//
|
||||||
|
this.button5_heartBeat.BackColor = System.Drawing.Color.Gray;
|
||||||
|
this.button5_heartBeat.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
|
this.button5_heartBeat.ForeColor = System.Drawing.Color.White;
|
||||||
|
this.button5_heartBeat.Location = new System.Drawing.Point(1674, 10);
|
||||||
|
this.button5_heartBeat.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.button5_heartBeat.Name = "button5_heartBeat";
|
||||||
|
this.button5_heartBeat.Size = new System.Drawing.Size(89, 43);
|
||||||
|
this.button5_heartBeat.TabIndex = 5;
|
||||||
|
this.button5_heartBeat.Text = "PLC";
|
||||||
|
this.button5_heartBeat.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
|
// label_AgvCanEnter
|
||||||
|
//
|
||||||
|
this.label_AgvCanEnter.AutoSize = true;
|
||||||
|
this.label_AgvCanEnter.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label_AgvCanEnter.Location = new System.Drawing.Point(927, 38);
|
||||||
|
this.label_AgvCanEnter.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label_AgvCanEnter.Name = "label_AgvCanEnter";
|
||||||
|
this.label_AgvCanEnter.Size = new System.Drawing.Size(134, 19);
|
||||||
|
this.label_AgvCanEnter.TabIndex = 9;
|
||||||
|
this.label_AgvCanEnter.Text = "●AGV可以进入";
|
||||||
|
//
|
||||||
|
// textBox1_PartPosition
|
||||||
|
//
|
||||||
|
this.textBox1_PartPosition.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.textBox1_PartPosition.Font = new System.Drawing.Font("宋体", 20F);
|
||||||
|
this.textBox1_PartPosition.Location = new System.Drawing.Point(615, 8);
|
||||||
|
this.textBox1_PartPosition.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.textBox1_PartPosition.Name = "textBox1_PartPosition";
|
||||||
|
this.textBox1_PartPosition.ReadOnly = true;
|
||||||
|
this.textBox1_PartPosition.Size = new System.Drawing.Size(105, 46);
|
||||||
|
this.textBox1_PartPosition.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label_AgvSongliao
|
||||||
|
//
|
||||||
|
this.label_AgvSongliao.AutoSize = true;
|
||||||
|
this.label_AgvSongliao.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label_AgvSongliao.Location = new System.Drawing.Point(785, 12);
|
||||||
|
this.label_AgvSongliao.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label_AgvSongliao.Name = "label_AgvSongliao";
|
||||||
|
this.label_AgvSongliao.Size = new System.Drawing.Size(134, 19);
|
||||||
|
this.label_AgvSongliao.TabIndex = 9;
|
||||||
|
this.label_AgvSongliao.Text = "●AGV准备送料";
|
||||||
|
//
|
||||||
|
// label_AgvRequestEnter
|
||||||
|
//
|
||||||
|
this.label_AgvRequestEnter.AutoSize = true;
|
||||||
|
this.label_AgvRequestEnter.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label_AgvRequestEnter.Location = new System.Drawing.Point(927, 10);
|
||||||
|
this.label_AgvRequestEnter.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label_AgvRequestEnter.Name = "label_AgvRequestEnter";
|
||||||
|
this.label_AgvRequestEnter.Size = new System.Drawing.Size(134, 19);
|
||||||
|
this.label_AgvRequestEnter.TabIndex = 9;
|
||||||
|
this.label_AgvRequestEnter.Text = "●AGV请求进入";
|
||||||
|
//
|
||||||
|
// label17
|
||||||
|
//
|
||||||
|
this.label17.AutoSize = true;
|
||||||
|
this.label17.Font = new System.Drawing.Font("宋体", 16F);
|
||||||
|
this.label17.Location = new System.Drawing.Point(467, 15);
|
||||||
|
this.label17.Name = "label17";
|
||||||
|
this.label17.Size = new System.Drawing.Size(147, 27);
|
||||||
|
this.label17.TabIndex = 0;
|
||||||
|
this.label17.Text = "装配位置:";
|
||||||
|
//
|
||||||
|
// textBox1_EngineID
|
||||||
|
//
|
||||||
|
this.textBox1_EngineID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.textBox1_EngineID.Font = new System.Drawing.Font("宋体", 20F);
|
||||||
|
this.textBox1_EngineID.Location = new System.Drawing.Point(151, 8);
|
||||||
|
this.textBox1_EngineID.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.textBox1_EngineID.Name = "textBox1_EngineID";
|
||||||
|
this.textBox1_EngineID.ReadOnly = true;
|
||||||
|
this.textBox1_EngineID.Size = new System.Drawing.Size(310, 46);
|
||||||
|
this.textBox1_EngineID.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Font = new System.Drawing.Font("宋体", 16F);
|
||||||
|
this.label1.Location = new System.Drawing.Point(3, 17);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(147, 27);
|
||||||
|
this.label1.TabIndex = 0;
|
||||||
|
this.label1.Text = "产品编码:";
|
||||||
|
//
|
||||||
|
// tableLayoutPanel1
|
||||||
|
//
|
||||||
|
this.tableLayoutPanel1.ColumnCount = 1;
|
||||||
|
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||||
|
this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 0);
|
||||||
|
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 2);
|
||||||
|
this.tableLayoutPanel1.Controls.Add(this.panel3, 0, 1);
|
||||||
|
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||||
|
this.tableLayoutPanel1.RowCount = 3;
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F));
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F));
|
||||||
|
this.tableLayoutPanel1.Size = new System.Drawing.Size(1773, 838);
|
||||||
|
this.tableLayoutPanel1.TabIndex = 25;
|
||||||
|
//
|
||||||
|
// DAS_OP30
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.White;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1773, 838);
|
||||||
|
this.Controls.Add(this.tableLayoutPanel1);
|
||||||
|
this.Controls.Add(this.label9);
|
||||||
|
this.Controls.Add(this.labelTime);
|
||||||
|
this.Controls.Add(this.panel7);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "DAS_OP30";
|
||||||
|
this.Text = "OP30工位-卫星模型";
|
||||||
|
this.panel7.ResumeLayout(false);
|
||||||
|
this.panel3.ResumeLayout(false);
|
||||||
|
this.panel3.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox12_end_2)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox2_start_2)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox12_end_1)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox2_start_1)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
|
this.panel1.ResumeLayout(false);
|
||||||
|
this.panel2.ResumeLayout(false);
|
||||||
|
this.panel2.PerformLayout();
|
||||||
|
this.tableLayoutPanel1.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private System.Windows.Forms.Timer timHSCZ;
|
||||||
|
private System.Windows.Forms.Label label9;
|
||||||
|
private System.Windows.Forms.Timer timUI;
|
||||||
|
private System.Windows.Forms.Label labelTime;
|
||||||
|
private System.Windows.Forms.Label label18;
|
||||||
|
private System.Windows.Forms.Panel panel7;
|
||||||
|
private System.Windows.Forms.Panel panel3;
|
||||||
|
private System.Windows.Forms.TextBox textBox_MeasureValue_2;
|
||||||
|
private System.Windows.Forms.TextBox textBox_MeasureValue_1;
|
||||||
|
private System.Windows.Forms.Label label6;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox1;
|
||||||
|
private System.Windows.Forms.Panel panel1;
|
||||||
|
private System.Windows.Forms.Label label16;
|
||||||
|
private System.Windows.Forms.Button button_running;
|
||||||
|
private System.Windows.Forms.Button button_alarm;
|
||||||
|
private System.Windows.Forms.Button button_finished;
|
||||||
|
private System.Windows.Forms.Button button_empty;
|
||||||
|
private System.Windows.Forms.Panel panel2;
|
||||||
|
private System.Windows.Forms.Label label_AgvLeaved;
|
||||||
|
private System.Windows.Forms.Label label19;
|
||||||
|
private System.Windows.Forms.Label label_AgvCanLeave;
|
||||||
|
private System.Windows.Forms.Label label15;
|
||||||
|
private System.Windows.Forms.Label label_AgvRequestLeave;
|
||||||
|
private System.Windows.Forms.Button button5_heartBeat;
|
||||||
|
private System.Windows.Forms.Label label_AgvCanEnter;
|
||||||
|
private System.Windows.Forms.TextBox textBox1_PartPosition;
|
||||||
|
private System.Windows.Forms.Label label_AgvRequestEnter;
|
||||||
|
private System.Windows.Forms.Label label17;
|
||||||
|
private System.Windows.Forms.TextBox textBox1_EngineID;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||||
|
private System.Windows.Forms.Label label_AgvSongliao;
|
||||||
|
private System.Windows.Forms.Button button5_heartBeat_Ning;
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox12_end_1;
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox2_start_1;
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox12_end_2;
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox2_start_2;
|
||||||
|
}
|
||||||
|
}
|
||||||
626
CCYQ_JieFang/OP/OP30/DAS_OP30.cs
Normal file
@@ -0,0 +1,626 @@
|
|||||||
|
|
||||||
|
using DK_DC_Tool;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using OpcBasic;
|
||||||
|
using Robot.Common;
|
||||||
|
using Serilog.Events;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class DAS_OP30
|
||||||
|
{
|
||||||
|
InitServer initServer = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private static string OpNameCurrent = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个开始测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicStartMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicEndMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量文本框控件,key为测量位置,value文本框的值
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, TextBox> dicMeasureTextBox = new Dictionary<int, TextBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<DeviceDriver_BasicData.CustomeEvetnArgs> MIS_Funtion_PLC_OP = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_change = null;
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托--处理托盘信息
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_Info = null;
|
||||||
|
|
||||||
|
// 每个工位的满工件数量
|
||||||
|
// 工位OP30 4个
|
||||||
|
public static int partCount = 4;
|
||||||
|
|
||||||
|
public static bool isConnect = false;
|
||||||
|
|
||||||
|
public DAS_OP30(string opName)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
publicCore.partCount = partCount;
|
||||||
|
OpNameCurrent = opName;
|
||||||
|
|
||||||
|
Tighten.E_DeviceHeartBeat -= DeviceHeartBeat_NingJinQiang;
|
||||||
|
Tighten.E_DeviceHeartBeat += DeviceHeartBeat_NingJinQiang;
|
||||||
|
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish -= SolvePicAndMeasureValueWorking;
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish += SolvePicAndMeasureValueWorking;
|
||||||
|
|
||||||
|
MIS_Funtion_PLC_OP -= MIS_Funtion_PLC;
|
||||||
|
MIS_Funtion_PLC_OP += MIS_Funtion_PLC;
|
||||||
|
|
||||||
|
AGV_Task_change -= SolveAgvDeviceStatus;
|
||||||
|
AGV_Task_change += SolveAgvDeviceStatus;
|
||||||
|
|
||||||
|
|
||||||
|
if (MesWorkForm.IsDemoMesServer == 1)
|
||||||
|
{
|
||||||
|
MoNiHeartBeat();
|
||||||
|
}
|
||||||
|
SolvePicAndMeasureValueInit();
|
||||||
|
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
|
||||||
|
//var aa =
|
||||||
|
//new Thread(new ThreadStart(delegate () {
|
||||||
|
// while (true)
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// if (!isConnect)
|
||||||
|
// {
|
||||||
|
// if (publicCore.Get_PartPosition(OpNameCurrent) != -1)
|
||||||
|
// {
|
||||||
|
// isConnect = true;
|
||||||
|
// ProductInfo_search();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch (Exception err) { }
|
||||||
|
// Thread.Sleep(1000);
|
||||||
|
// }
|
||||||
|
//}));
|
||||||
|
//aa.IsBackground = true;
|
||||||
|
//aa.Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
public void MIS_Funtion_PLC(DeviceDriver_BasicData.CustomeEvetnArgs msgEvent)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tagID = msgEvent.TagID.ToString();
|
||||||
|
// var opName = msgEvent.OpName.ToString();
|
||||||
|
var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
|
||||||
|
var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
|
||||||
|
string tagValue;
|
||||||
|
switch (tagTypeID)
|
||||||
|
{
|
||||||
|
case EnumTagTypeID.BOOL:
|
||||||
|
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tagValue = msgEvent.TagValue.ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (tagTypeCodeID)
|
||||||
|
{
|
||||||
|
case 14:
|
||||||
|
DeviceHeartBeat(tagValue);
|
||||||
|
break;
|
||||||
|
// AGV任务
|
||||||
|
case 50:
|
||||||
|
publicCore.SolveAgvTaskNum(OpNameCurrent, tagValue);
|
||||||
|
break;
|
||||||
|
// 51 空闲(请求上料)
|
||||||
|
// 52 完成(请求下料)
|
||||||
|
// 53 故障
|
||||||
|
case 51:
|
||||||
|
case 52:
|
||||||
|
case 53:
|
||||||
|
publicCore.SolveDeviceStatus(OpNameCurrent);
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
break;
|
||||||
|
// 54 第几个件
|
||||||
|
case 54:
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
case 55:
|
||||||
|
publicCore.MeasurePositionChange(OpNameCurrent, 2);
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
//读电批
|
||||||
|
case 56:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP30", "Info", "【PLC_读电批置位】");
|
||||||
|
// 不在这个地方写true,写在接收数据的地方写
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP30", "Info", "【PLC_读电批复位】");
|
||||||
|
MesWorkForm.WritePLC(83, OpNameCurrent, false);
|
||||||
|
publicCore.LogInsert("OP30", "Info", "【IPC_读电批完成复位】");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
//读泄漏量1 2或者压力
|
||||||
|
case 59:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
//publicCore.ReadQualityData_LeakageRate(OpNameCurrent);
|
||||||
|
publicCore.ReadQualityData_Pressure(OpNameCurrent);
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueInit()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dicStartMasurePictureBox.Add(1, pictureBox2_start_1);
|
||||||
|
dicStartMasurePictureBox.Add(2, pictureBox2_start_2);
|
||||||
|
|
||||||
|
dicEndMasurePictureBox.Add(1, pictureBox12_end_1);
|
||||||
|
dicEndMasurePictureBox.Add(2, pictureBox12_end_2);
|
||||||
|
|
||||||
|
dicMeasureTextBox.Add(1, textBox_MeasureValue_1);
|
||||||
|
dicMeasureTextBox.Add(2, textBox_MeasureValue_2);
|
||||||
|
|
||||||
|
foreach (var item in dicStartMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicEndMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicMeasureTextBox)
|
||||||
|
{
|
||||||
|
item.Value.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "1")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 工作时界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueWorking()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "2")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 界面产品编码和装配位置的显示
|
||||||
|
/// </summary>
|
||||||
|
public void ProductInfo_search()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//textBox1_EngineID.Text = "";
|
||||||
|
//textBox1_PartPosition.Text = "";
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, "", Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, "", Color.White);
|
||||||
|
int PartPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetProductInfo_Init(OpNameCurrent, PartPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, dt.Rows[0]["发动机号"].ToString(), Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, dt.Rows[0]["装配位置"].ToString(), Color.White);
|
||||||
|
//textBox1_EngineID.Text = dt.Rows[0]["发动机号"].ToString();
|
||||||
|
//textBox1_PartPosition.Text = dt.Rows[0]["装配位置"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ShowPicBoxControl(Control c, bool ststus)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Visible = ststus;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowTextBoxControl(Control c, string value, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Text = value;
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowLabelControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
//if (c.InvokeRequired)
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// c.ForeColor = color;
|
||||||
|
//}
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.ForeColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowButtonControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化设备状态
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// </summary>
|
||||||
|
private void SolveDeviceStatusInit(string currentStatus)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Gray);
|
||||||
|
ShowButtonControl(button_finished, Color.Gray);
|
||||||
|
ShowButtonControl(button_empty, Color.Gray);
|
||||||
|
ShowButtonControl(button_alarm, Color.Gray);
|
||||||
|
//button_running.BackColor = Color.Gray;
|
||||||
|
//button_finished.BackColor = Color.Gray;
|
||||||
|
//button_empty.BackColor = Color.Gray;
|
||||||
|
//button_alarm.BackColor = Color.Gray;
|
||||||
|
|
||||||
|
if (currentStatus == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Green);
|
||||||
|
//button_running.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "2")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_empty, Color.SkyBlue);
|
||||||
|
|
||||||
|
//button_empty.BackColor = Color.SkyBlue;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "3")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_finished, Color.DarkOrange);
|
||||||
|
|
||||||
|
//button_finished.BackColor = Color.DarkOrange;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "4")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_alarm, Color.Red);
|
||||||
|
|
||||||
|
//button_alarm.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// AGV设备状态显示
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PLC_AgvTaskNum"></param>
|
||||||
|
private void SolveAgvDeviceStatus(string PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 77 反馈AGV任务
|
||||||
|
switch (PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
case "10":
|
||||||
|
// AGV触发装配任务 正在送料
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Green;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Black);
|
||||||
|
|
||||||
|
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "11":
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
// 允许AGV进行上料 --允许进入
|
||||||
|
// 允许AGV进行下料 --允许进入
|
||||||
|
case "2":
|
||||||
|
case "4":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
case "21":
|
||||||
|
// AGV 上料完成
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
// 1.调用FSS-接收IPC下料请求的接口
|
||||||
|
// 2.反馈任务号:30 AGV已呼叫成功正在去往下料区
|
||||||
|
break;
|
||||||
|
case "31":
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Green);
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Green;
|
||||||
|
// AGV已到达下料区
|
||||||
|
break;
|
||||||
|
case "41":
|
||||||
|
// AGV下料完成
|
||||||
|
break;
|
||||||
|
// 允许AGV离开
|
||||||
|
case "5":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Green);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "51":
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Green;
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Green);
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳button5_heartBeat_Ning
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat(string tagValue)
|
||||||
|
{
|
||||||
|
WritePLC(15, OpNameCurrent, tagValue);
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Gray);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat_NingJinQiang(string tagValue)
|
||||||
|
{
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Red);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void MoNiHeartBeat()
|
||||||
|
{
|
||||||
|
bool tv = false;
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WritePLC(14, OpNameCurrent, tv);
|
||||||
|
tv = !tv;
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBox_MeasureValue_4_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
144
CCYQ_JieFang/OP/OP30/DAS_OP30.resx
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="timHSCZ.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>432, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="timUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>573, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>33</value>
|
||||||
|
</metadata>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
AAABAAEAGhoAAAAAIAAHAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAaAAAAGggGAAAAqUpMzgAAAAFz
|
||||||
|
UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABnElEQVRIS+2Uz2rC
|
||||||
|
QBDGfZRc+h7ec/Mmxhgx2CQGYi65ivUB9NZCArl4EC/SqwgePBRKwUfw0AfZzrfshvVPY1IjlNKBj0xm
|
||||||
|
Z+a3m0xS+7ciZhjGqN1uM0iE7mO/D9RsNh+QXEZkRpIkDArDcJsLoqQREofDYUrFrIwkpBTItu3VaSPX
|
||||||
|
dVkURWwymXD/dL0yECDSB0xdgyoD4RQAqEBVlYGu6a6gfv8x828GbTYfXPP5ik2nz1zwZbxS0Gz2wkzT
|
||||||
|
PBJilYMcx2NBELDl8pUtFivuI3YzSP1g1+t3foLx+Ik3huAjhrUfgeI4rgOGq2xQ9ERpmmpUa6HecZw0
|
||||||
|
F6SaCiryjkQZN7q//lOl3Wq6ru9RjPFFM+i7qZMj7vv+djAYpOhRCETJdSrKdpon9TtCDYQedF/sRPjd
|
||||||
|
0OSVEmpokwf0AEiKN71kOL7cned5rNvtbqkAj/Kier3eTuYDhCciWuVbp9PZobllWXt5/FardaArRvZI
|
||||||
|
Io6cT9Q1Go03AieiVb6JQi7a8YgaaGLpzLBGORblZt8NiQ/EX7da7Qtz50LQDuTBxQAAAABJRU5ErkJg
|
||||||
|
gg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
1002
CCYQ_JieFang/OP/OP40/DAS_OP40.Designer.cs
generated
Normal file
648
CCYQ_JieFang/OP/OP40/DAS_OP40.cs
Normal file
@@ -0,0 +1,648 @@
|
|||||||
|
|
||||||
|
using DK_DC_Tool;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using OpcBasic;
|
||||||
|
using Robot.Common;
|
||||||
|
using Serilog.Events;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class DAS_OP40
|
||||||
|
{
|
||||||
|
InitServer initServer = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private static string OpNameCurrent = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个开始测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicStartMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicEndMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量文本框控件,key为测量位置,value文本框的值
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, TextBox> dicMeasureTextBox = new Dictionary<int, TextBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<DeviceDriver_BasicData.CustomeEvetnArgs> MIS_Funtion_PLC_OP = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_change = null;
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托--处理托盘信息
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_Info = null;
|
||||||
|
|
||||||
|
// 每个工位的满工件数量
|
||||||
|
// 工位OP40 2个
|
||||||
|
public static int partCount = 2;
|
||||||
|
|
||||||
|
public static bool isConnect = false;
|
||||||
|
|
||||||
|
public DAS_OP40(string opName)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
publicCore.partCount = partCount;
|
||||||
|
OpNameCurrent = opName;
|
||||||
|
|
||||||
|
Tighten.E_DeviceHeartBeat -= DeviceHeartBeat_NingJinQiang;
|
||||||
|
Tighten.E_DeviceHeartBeat += DeviceHeartBeat_NingJinQiang;
|
||||||
|
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish -= SolvePicAndMeasureValueWorking;
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish += SolvePicAndMeasureValueWorking;
|
||||||
|
|
||||||
|
MIS_Funtion_PLC_OP -= MIS_Funtion_PLC;
|
||||||
|
MIS_Funtion_PLC_OP += MIS_Funtion_PLC;
|
||||||
|
|
||||||
|
AGV_Task_change -= SolveAgvDeviceStatus;
|
||||||
|
AGV_Task_change += SolveAgvDeviceStatus;
|
||||||
|
|
||||||
|
|
||||||
|
if (MesWorkForm.IsDemoMesServer == 1)
|
||||||
|
{
|
||||||
|
MoNiHeartBeat();
|
||||||
|
}
|
||||||
|
SolvePicAndMeasureValueInit();
|
||||||
|
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
}
|
||||||
|
catch (Exception err) {
|
||||||
|
}
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
|
||||||
|
//var aa =
|
||||||
|
//new Thread(new ThreadStart(delegate () {
|
||||||
|
// while (true)
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// if (!isConnect)
|
||||||
|
// {
|
||||||
|
// if (publicCore.Get_PartPosition(OpNameCurrent) != -1)
|
||||||
|
// {
|
||||||
|
// isConnect = true;
|
||||||
|
// ProductInfo_search();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch (Exception err) { }
|
||||||
|
// Thread.Sleep(1000);
|
||||||
|
// }
|
||||||
|
//}));
|
||||||
|
//aa.IsBackground = true;
|
||||||
|
//aa.Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
public void MIS_Funtion_PLC(DeviceDriver_BasicData.CustomeEvetnArgs msgEvent)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tagID = msgEvent.TagID.ToString();
|
||||||
|
// var opName = msgEvent.OpName.ToString();
|
||||||
|
var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
|
||||||
|
var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
|
||||||
|
string tagValue;
|
||||||
|
switch (tagTypeID)
|
||||||
|
{
|
||||||
|
case EnumTagTypeID.BOOL:
|
||||||
|
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tagValue = msgEvent.TagValue.ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (tagTypeCodeID)
|
||||||
|
{
|
||||||
|
case 14:
|
||||||
|
DeviceHeartBeat(tagValue);
|
||||||
|
break;
|
||||||
|
// AGV任务
|
||||||
|
case 50:
|
||||||
|
publicCore.SolveAgvTaskNum(OpNameCurrent, tagValue);
|
||||||
|
break;
|
||||||
|
// 51 空闲(请求上料)
|
||||||
|
// 52 完成(请求下料)
|
||||||
|
// 53 故障
|
||||||
|
case 51:
|
||||||
|
case 52:
|
||||||
|
case 53:
|
||||||
|
publicCore.SolveDeviceStatus(OpNameCurrent);
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
break;
|
||||||
|
// 54 第几个件
|
||||||
|
case 54:
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
// 55 第几个孔
|
||||||
|
case 55:
|
||||||
|
publicCore.MeasurePositionChange(OpNameCurrent, 2);
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
//读电批
|
||||||
|
case 56:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP40", "Info", "【PLC_读电批置位】");
|
||||||
|
// 不在这个地方写true,写在接收数据的地方写
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP40", "Info", "【PLC_读电批复位】");
|
||||||
|
MesWorkForm.WritePLC(83, OpNameCurrent, false);
|
||||||
|
publicCore.LogInsert("OP40", "Info", "【IPC_读电批完成复位】");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
//读泄漏量1 2或者压力
|
||||||
|
case 59:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
publicCore.ReadQualityData_LeakageRate(OpNameCurrent);
|
||||||
|
//publicCore.ReadQualityData_Pressure(OpNameCurrent);
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueInit()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dicStartMasurePictureBox.Add(1, pictureBox2_start_1);
|
||||||
|
dicStartMasurePictureBox.Add(2, pictureBox2_start_2);
|
||||||
|
dicStartMasurePictureBox.Add(3, pictureBox2_start_3);
|
||||||
|
dicStartMasurePictureBox.Add(4, pictureBox2_start_4);
|
||||||
|
dicStartMasurePictureBox.Add(5, pictureBox2_start_5);
|
||||||
|
dicStartMasurePictureBox.Add(6, pictureBox2_start_6);
|
||||||
|
dicStartMasurePictureBox.Add(7, pictureBox2_start_7);
|
||||||
|
dicStartMasurePictureBox.Add(8, pictureBox2_start_8);
|
||||||
|
dicStartMasurePictureBox.Add(9, pictureBox2_start_9);
|
||||||
|
|
||||||
|
dicEndMasurePictureBox.Add(1, pictureBox12_end_1);
|
||||||
|
dicEndMasurePictureBox.Add(2, pictureBox12_end_2);
|
||||||
|
dicEndMasurePictureBox.Add(3, pictureBox12_end_3);
|
||||||
|
dicEndMasurePictureBox.Add(4, pictureBox12_end_4);
|
||||||
|
dicEndMasurePictureBox.Add(5, pictureBox12_end_5);
|
||||||
|
dicEndMasurePictureBox.Add(6, pictureBox12_end_6);
|
||||||
|
dicEndMasurePictureBox.Add(7, pictureBox12_end_7);
|
||||||
|
dicEndMasurePictureBox.Add(8, pictureBox12_end_8);
|
||||||
|
dicEndMasurePictureBox.Add(9, pictureBox12_end_9);
|
||||||
|
|
||||||
|
dicMeasureTextBox.Add(1, textBox_MeasureValue_1);
|
||||||
|
dicMeasureTextBox.Add(2, textBox_MeasureValue_2);
|
||||||
|
dicMeasureTextBox.Add(3, textBox_MeasureValue_3);
|
||||||
|
dicMeasureTextBox.Add(4, textBox_MeasureValue_4);
|
||||||
|
dicMeasureTextBox.Add(5, textBox_MeasureValue_5);
|
||||||
|
dicMeasureTextBox.Add(6, textBox_MeasureValue_6);
|
||||||
|
dicMeasureTextBox.Add(7, textBox_MeasureValue_7);
|
||||||
|
dicMeasureTextBox.Add(8, textBox_MeasureValue_8);
|
||||||
|
dicMeasureTextBox.Add(9, textBox_MeasureValue_9);
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in dicStartMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicEndMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicMeasureTextBox)
|
||||||
|
{
|
||||||
|
item.Value.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "1")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 工作时界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueWorking()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "2")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 界面产品编码和装配位置的显示
|
||||||
|
/// </summary>
|
||||||
|
public void ProductInfo_search()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//textBox1_EngineID.Text = "";
|
||||||
|
//textBox1_PartPosition.Text = "";
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, "", Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, "", Color.White);
|
||||||
|
int PartPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetProductInfo_Init(OpNameCurrent, PartPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, dt.Rows[0]["发动机号"].ToString(), Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, dt.Rows[0]["装配位置"].ToString(), Color.White);
|
||||||
|
//textBox1_EngineID.Text = dt.Rows[0]["发动机号"].ToString();
|
||||||
|
//textBox1_PartPosition.Text = dt.Rows[0]["装配位置"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ShowPicBoxControl(Control c, bool ststus)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Visible = ststus;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowTextBoxControl(Control c, string value, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Text = value;
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowLabelControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
//if (c.InvokeRequired)
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// c.ForeColor = color;
|
||||||
|
//}
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.ForeColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowButtonControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化设备状态
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// </summary>
|
||||||
|
private void SolveDeviceStatusInit(string currentStatus)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Gray);
|
||||||
|
ShowButtonControl(button_finished, Color.Gray);
|
||||||
|
ShowButtonControl(button_empty, Color.Gray);
|
||||||
|
ShowButtonControl(button_alarm, Color.Gray);
|
||||||
|
//button_running.BackColor = Color.Gray;
|
||||||
|
//button_finished.BackColor = Color.Gray;
|
||||||
|
//button_empty.BackColor = Color.Gray;
|
||||||
|
//button_alarm.BackColor = Color.Gray;
|
||||||
|
|
||||||
|
if (currentStatus == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Green);
|
||||||
|
//button_running.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "2")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_empty, Color.SkyBlue);
|
||||||
|
|
||||||
|
//button_empty.BackColor = Color.SkyBlue;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "3")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_finished, Color.DarkOrange);
|
||||||
|
|
||||||
|
//button_finished.BackColor = Color.DarkOrange;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "4")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_alarm, Color.Red);
|
||||||
|
|
||||||
|
//button_alarm.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// AGV设备状态显示
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PLC_AgvTaskNum"></param>
|
||||||
|
private void SolveAgvDeviceStatus(string PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 77 反馈AGV任务
|
||||||
|
switch (PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
case "10":
|
||||||
|
// AGV触发装配任务 正在送料
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Green;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Black);
|
||||||
|
|
||||||
|
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "11":
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
// 允许AGV进行上料 --允许进入
|
||||||
|
// 允许AGV进行下料 --允许进入
|
||||||
|
case "2":
|
||||||
|
case "4":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
case "21":
|
||||||
|
// AGV 上料完成
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
// 1.调用FSS-接收IPC下料请求的接口
|
||||||
|
// 2.反馈任务号:30 AGV已呼叫成功正在去往下料区
|
||||||
|
break;
|
||||||
|
case "31":
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Green);
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Green;
|
||||||
|
// AGV已到达下料区
|
||||||
|
break;
|
||||||
|
case "41":
|
||||||
|
// AGV下料完成
|
||||||
|
break;
|
||||||
|
// 允许AGV离开
|
||||||
|
case "5":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Green);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "51":
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Green;
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Green);
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳button5_heartBeat_Ning
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat(string tagValue)
|
||||||
|
{
|
||||||
|
WritePLC(15, OpNameCurrent, tagValue);
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Gray);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat_NingJinQiang(string tagValue)
|
||||||
|
{
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Red);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void MoNiHeartBeat()
|
||||||
|
{
|
||||||
|
bool tv = false;
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WritePLC(14, OpNameCurrent, tv);
|
||||||
|
tv = !tv;
|
||||||
|
}
|
||||||
|
catch (Exception err) {
|
||||||
|
}
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBox_MeasureValue_4_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
144
CCYQ_JieFang/OP/OP40/DAS_OP40.resx
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="timHSCZ.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>432, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="timUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>573, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>33</value>
|
||||||
|
</metadata>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
AAABAAEAGhoAAAAAIAAHAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAaAAAAGggGAAAAqUpMzgAAAAFz
|
||||||
|
UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABnElEQVRIS+2Uz2rC
|
||||||
|
QBDGfZRc+h7ec/Mmxhgx2CQGYi65ivUB9NZCArl4EC/SqwgePBRKwUfw0AfZzrfshvVPY1IjlNKBj0xm
|
||||||
|
Z+a3m0xS+7ciZhjGqN1uM0iE7mO/D9RsNh+QXEZkRpIkDArDcJsLoqQREofDYUrFrIwkpBTItu3VaSPX
|
||||||
|
dVkURWwymXD/dL0yECDSB0xdgyoD4RQAqEBVlYGu6a6gfv8x828GbTYfXPP5ik2nz1zwZbxS0Gz2wkzT
|
||||||
|
PBJilYMcx2NBELDl8pUtFivuI3YzSP1g1+t3foLx+Ik3huAjhrUfgeI4rgOGq2xQ9ERpmmpUa6HecZw0
|
||||||
|
F6SaCiryjkQZN7q//lOl3Wq6ru9RjPFFM+i7qZMj7vv+djAYpOhRCETJdSrKdpon9TtCDYQedF/sRPjd
|
||||||
|
0OSVEmpokwf0AEiKN71kOL7cned5rNvtbqkAj/Kier3eTuYDhCciWuVbp9PZobllWXt5/FardaArRvZI
|
||||||
|
Io6cT9Q1Go03AieiVb6JQi7a8YgaaGLpzLBGORblZt8NiQ/EX7da7Qtz50LQDuTBxQAAAABJRU5ErkJg
|
||||||
|
gg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
1179
CCYQ_JieFang/OP/OP50/DAS_OP50.Designer.cs
generated
Normal file
654
CCYQ_JieFang/OP/OP50/DAS_OP50.cs
Normal file
@@ -0,0 +1,654 @@
|
|||||||
|
|
||||||
|
using DK_DC_Tool;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using OpcBasic;
|
||||||
|
using Robot.Common;
|
||||||
|
using Serilog.Events;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SystemFramework;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class DAS_OP50
|
||||||
|
{
|
||||||
|
InitServer initServer = null;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private static string OpNameCurrent = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个开始测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicStartMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量图片控件,key为测量位置,value为图片控件
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, PictureBox> dicEndMasurePictureBox = new Dictionary<int, PictureBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// 字典 ,存储12个结束测量文本框控件,key为测量位置,value文本框的值
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, TextBox> dicMeasureTextBox = new Dictionary<int, TextBox>();
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<DeviceDriver_BasicData.CustomeEvetnArgs> MIS_Funtion_PLC_OP = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_change = null;
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托--处理托盘信息
|
||||||
|
/// </summary>
|
||||||
|
public static Action<string> AGV_Task_Info = null;
|
||||||
|
|
||||||
|
// 每个工位的满工件数量
|
||||||
|
// 工位OP50 3个
|
||||||
|
public static int partCount = 3;
|
||||||
|
|
||||||
|
public static bool isConnect = false;
|
||||||
|
|
||||||
|
public DAS_OP50(string opName)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
publicCore.partCount = partCount;
|
||||||
|
OpNameCurrent = opName;
|
||||||
|
|
||||||
|
Tighten.E_DeviceHeartBeat -= DeviceHeartBeat_NingJinQiang;
|
||||||
|
Tighten.E_DeviceHeartBeat += DeviceHeartBeat_NingJinQiang;
|
||||||
|
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish -= SolvePicAndMeasureValueWorking;
|
||||||
|
MesWorkForm.MIS_Funtion_PLC_MeasureFinish += SolvePicAndMeasureValueWorking;
|
||||||
|
|
||||||
|
MIS_Funtion_PLC_OP -= MIS_Funtion_PLC;
|
||||||
|
MIS_Funtion_PLC_OP += MIS_Funtion_PLC;
|
||||||
|
|
||||||
|
AGV_Task_change -= SolveAgvDeviceStatus;
|
||||||
|
AGV_Task_change += SolveAgvDeviceStatus;
|
||||||
|
|
||||||
|
|
||||||
|
if (MesWorkForm.IsDemoMesServer == 1)
|
||||||
|
{
|
||||||
|
MoNiHeartBeat();
|
||||||
|
}
|
||||||
|
SolvePicAndMeasureValueInit();
|
||||||
|
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
|
||||||
|
//var aa =
|
||||||
|
//new Thread(new ThreadStart(delegate () {
|
||||||
|
// while (true)
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// if (!isConnect)
|
||||||
|
// {
|
||||||
|
// if (publicCore.Get_PartPosition(OpNameCurrent) != -1)
|
||||||
|
// {
|
||||||
|
// isConnect = true;
|
||||||
|
// ProductInfo_search();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch (Exception err) { }
|
||||||
|
// Thread.Sleep(1000);
|
||||||
|
// }
|
||||||
|
//}));
|
||||||
|
//aa.IsBackground = true;
|
||||||
|
//aa.Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
public void MIS_Funtion_PLC(DeviceDriver_BasicData.CustomeEvetnArgs msgEvent)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tagID = msgEvent.TagID.ToString();
|
||||||
|
// var opName = msgEvent.OpName.ToString();
|
||||||
|
var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
|
||||||
|
var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
|
||||||
|
string tagValue;
|
||||||
|
switch (tagTypeID)
|
||||||
|
{
|
||||||
|
case EnumTagTypeID.BOOL:
|
||||||
|
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tagValue = msgEvent.TagValue.ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (tagTypeCodeID)
|
||||||
|
{
|
||||||
|
case 14:
|
||||||
|
DeviceHeartBeat(tagValue);
|
||||||
|
break;
|
||||||
|
// AGV任务
|
||||||
|
case 50:
|
||||||
|
publicCore.SolveAgvTaskNum(OpNameCurrent, tagValue);
|
||||||
|
break;
|
||||||
|
// 51 空闲(请求上料)
|
||||||
|
// 52 完成(请求下料)
|
||||||
|
// 53 故障
|
||||||
|
case 51:
|
||||||
|
case 52:
|
||||||
|
case 53:
|
||||||
|
publicCore.SolveDeviceStatus(OpNameCurrent);
|
||||||
|
SolveDeviceStatusInit(publicCore.SolveDeviceStatus_Read(OpNameCurrent));
|
||||||
|
break;
|
||||||
|
// 54 第几个件
|
||||||
|
case 54:
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
case 55:
|
||||||
|
publicCore.MeasurePositionChange(OpNameCurrent, 2);
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
//读电批
|
||||||
|
case 56:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP50", "Info", "【PLC_读电批置位】");
|
||||||
|
// 不在这个地方写true,写在接收数据的地方写
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("OP50", "Info", "【PLC_读电批复位】");
|
||||||
|
MesWorkForm.WritePLC(83, OpNameCurrent, false);
|
||||||
|
publicCore.LogInsert("OP50", "Info", "【IPC_读电批完成复位】");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
//读泄漏量1 2或者压力
|
||||||
|
case 59:
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
//publicCore.ReadQualityData_LeakageRate(OpNameCurrent);
|
||||||
|
//publicCore.ReadQualityData_Pressure(OpNameCurrent);
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(84, OpNameCurrent, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueInit()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dicStartMasurePictureBox.Add(1, pictureBox2_start_1);
|
||||||
|
dicStartMasurePictureBox.Add(2, pictureBox2_start_2);
|
||||||
|
dicStartMasurePictureBox.Add(3, pictureBox2_start_3);
|
||||||
|
dicStartMasurePictureBox.Add(4, pictureBox2_start_4);
|
||||||
|
dicStartMasurePictureBox.Add(5, pictureBox2_start_5);
|
||||||
|
dicStartMasurePictureBox.Add(6, pictureBox2_start_6);
|
||||||
|
dicStartMasurePictureBox.Add(7, pictureBox2_start_7);
|
||||||
|
dicStartMasurePictureBox.Add(8, pictureBox2_start_8);
|
||||||
|
dicStartMasurePictureBox.Add(9, pictureBox2_start_9);
|
||||||
|
dicStartMasurePictureBox.Add(10, pictureBox2_start_10);
|
||||||
|
dicStartMasurePictureBox.Add(11, pictureBox2_start_11);
|
||||||
|
dicStartMasurePictureBox.Add(12, pictureBox2_start_12);
|
||||||
|
|
||||||
|
dicEndMasurePictureBox.Add(1, pictureBox12_end_1);
|
||||||
|
dicEndMasurePictureBox.Add(2, pictureBox12_end_2);
|
||||||
|
dicEndMasurePictureBox.Add(3, pictureBox12_end_3);
|
||||||
|
dicEndMasurePictureBox.Add(4, pictureBox12_end_4);
|
||||||
|
dicEndMasurePictureBox.Add(5, pictureBox12_end_5);
|
||||||
|
dicEndMasurePictureBox.Add(6, pictureBox12_end_6);
|
||||||
|
dicEndMasurePictureBox.Add(7, pictureBox12_end_7);
|
||||||
|
dicEndMasurePictureBox.Add(8, pictureBox12_end_8);
|
||||||
|
dicEndMasurePictureBox.Add(9, pictureBox12_end_9);
|
||||||
|
dicEndMasurePictureBox.Add(10, pictureBox12_end_10);
|
||||||
|
dicEndMasurePictureBox.Add(11, pictureBox12_end_11);
|
||||||
|
dicEndMasurePictureBox.Add(12, pictureBox12_end_12);
|
||||||
|
|
||||||
|
dicMeasureTextBox.Add(1, textBox_MeasureValue_1);
|
||||||
|
dicMeasureTextBox.Add(2, textBox_MeasureValue_2);
|
||||||
|
dicMeasureTextBox.Add(3, textBox_MeasureValue_3);
|
||||||
|
dicMeasureTextBox.Add(4, textBox_MeasureValue_4);
|
||||||
|
dicMeasureTextBox.Add(5, textBox_MeasureValue_5);
|
||||||
|
dicMeasureTextBox.Add(6, textBox_MeasureValue_6);
|
||||||
|
dicMeasureTextBox.Add(7, textBox_MeasureValue_7);
|
||||||
|
dicMeasureTextBox.Add(8, textBox_MeasureValue_8);
|
||||||
|
dicMeasureTextBox.Add(9, textBox_MeasureValue_9);
|
||||||
|
dicMeasureTextBox.Add(10, textBox_MeasureValue_10);
|
||||||
|
dicMeasureTextBox.Add(11, textBox_MeasureValue_11);
|
||||||
|
dicMeasureTextBox.Add(12, textBox_MeasureValue_12);
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in dicStartMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicEndMasurePictureBox)
|
||||||
|
{
|
||||||
|
item.Value.Visible = false;
|
||||||
|
}
|
||||||
|
foreach (var item in dicMeasureTextBox)
|
||||||
|
{
|
||||||
|
item.Value.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "1")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 工作时界面显示
|
||||||
|
/// </summary>
|
||||||
|
private void SolvePicAndMeasureValueWorking()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int partPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetQualityInfo_Init(OpNameCurrent, partPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dt.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
int measureStatus = Convert.ToInt32(dt.Rows[i]["测量状态"]);
|
||||||
|
int measurePosition = Convert.ToInt32(dt.Rows[i]["测量位置"]);
|
||||||
|
string tagValue = dt.Rows[i]["测量值"].ToString();
|
||||||
|
string isOk = dt.Rows[i]["是否合格"].ToString();
|
||||||
|
// 测量状态为1 表示初始状态,两张图片都不显示
|
||||||
|
// 测量状态为2 表示正在测量,显示第二张图片
|
||||||
|
// 测量状态为3 表示测量完成,显示第一张图片
|
||||||
|
|
||||||
|
var control_DicStartMasurePictureBox = dicStartMasurePictureBox[measurePosition];
|
||||||
|
var control_DicEndMasurePictureBox = dicEndMasurePictureBox[measurePosition];
|
||||||
|
var control_DicMeasureTextBox = dicMeasureTextBox[measurePosition];
|
||||||
|
|
||||||
|
if (measureStatus == 1)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 2)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, true);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, false);
|
||||||
|
}
|
||||||
|
else if (measureStatus == 3)
|
||||||
|
{
|
||||||
|
ShowPicBoxControl(control_DicStartMasurePictureBox, false);
|
||||||
|
ShowPicBoxControl(control_DicEndMasurePictureBox, true);
|
||||||
|
}
|
||||||
|
if (isOk == "2")
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.Red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(control_DicMeasureTextBox, tagValue, Color.White);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 界面产品编码和装配位置的显示
|
||||||
|
/// </summary>
|
||||||
|
public void ProductInfo_search()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//textBox1_EngineID.Text = "";
|
||||||
|
//textBox1_PartPosition.Text = "";
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, "", Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, "", Color.White);
|
||||||
|
int PartPosition = publicCore.Get_PartPosition(OpNameCurrent);
|
||||||
|
publicCore.GetProductInfo_Init(OpNameCurrent, PartPosition, out DataTable dt, out string errMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
ShowTextBoxControl(textBox1_EngineID, dt.Rows[0]["发动机号"].ToString(), Color.White);
|
||||||
|
ShowTextBoxControl(textBox1_PartPosition, dt.Rows[0]["装配位置"].ToString(), Color.White);
|
||||||
|
//textBox1_EngineID.Text = dt.Rows[0]["发动机号"].ToString();
|
||||||
|
//textBox1_PartPosition.Text = dt.Rows[0]["装配位置"].ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ShowPicBoxControl(Control c, bool ststus)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Visible = ststus;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowTextBoxControl(Control c, string value, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.Text = value;
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowLabelControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
//if (c.InvokeRequired)
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// c.ForeColor = color;
|
||||||
|
//}
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.ForeColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
private void ShowButtonControl(Control c, Color color)
|
||||||
|
{
|
||||||
|
c.BeginInvoke(new Action(delegate () {
|
||||||
|
c.BackColor = color;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化设备状态
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// </summary>
|
||||||
|
private void SolveDeviceStatusInit(string currentStatus)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Gray);
|
||||||
|
ShowButtonControl(button_finished, Color.Gray);
|
||||||
|
ShowButtonControl(button_empty, Color.Gray);
|
||||||
|
ShowButtonControl(button_alarm, Color.Gray);
|
||||||
|
//button_running.BackColor = Color.Gray;
|
||||||
|
//button_finished.BackColor = Color.Gray;
|
||||||
|
//button_empty.BackColor = Color.Gray;
|
||||||
|
//button_alarm.BackColor = Color.Gray;
|
||||||
|
|
||||||
|
if (currentStatus == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_running, Color.Green);
|
||||||
|
//button_running.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "2")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_empty, Color.SkyBlue);
|
||||||
|
|
||||||
|
//button_empty.BackColor = Color.SkyBlue;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "3")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_finished, Color.DarkOrange);
|
||||||
|
|
||||||
|
//button_finished.BackColor = Color.DarkOrange;
|
||||||
|
}
|
||||||
|
else if (currentStatus == "4")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button_alarm, Color.Red);
|
||||||
|
|
||||||
|
//button_alarm.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// AGV设备状态显示
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PLC_AgvTaskNum"></param>
|
||||||
|
private void SolveAgvDeviceStatus(string PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 77 反馈AGV任务
|
||||||
|
switch (PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
case "10":
|
||||||
|
// AGV触发装配任务 正在送料
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Green;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Black);
|
||||||
|
|
||||||
|
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "11":
|
||||||
|
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
// 允许AGV进行上料 --允许进入
|
||||||
|
// 允许AGV进行下料 --允许进入
|
||||||
|
case "2":
|
||||||
|
case "4":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Green);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Green;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
break;
|
||||||
|
case "21":
|
||||||
|
// AGV 上料完成
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Green);
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
// 1.调用FSS-接收IPC下料请求的接口
|
||||||
|
// 2.反馈任务号:30 AGV已呼叫成功正在去往下料区
|
||||||
|
break;
|
||||||
|
case "31":
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Green);
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Green;
|
||||||
|
// AGV已到达下料区
|
||||||
|
break;
|
||||||
|
case "41":
|
||||||
|
// AGV下料完成
|
||||||
|
break;
|
||||||
|
// 允许AGV离开
|
||||||
|
case "5":
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Green);
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Green;
|
||||||
|
break;
|
||||||
|
case "51":
|
||||||
|
//label_AgvSongliao.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvRequestLeave.ForeColor = Color.Black;
|
||||||
|
//label_AgvRequestEnter.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvCanEnter.ForeColor = Color.Black;
|
||||||
|
//label_AgvCanLeave.ForeColor = Color.Black;
|
||||||
|
|
||||||
|
//label_AgvLeaved.ForeColor = Color.Green;
|
||||||
|
ShowLabelControl(label_AgvSongliao, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvRequestEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanEnter, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvCanLeave, Color.Black);
|
||||||
|
ShowLabelControl(label_AgvLeaved, Color.Green);
|
||||||
|
ProductInfo_search();
|
||||||
|
SolvePicAndMeasureValueWorking();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳button5_heartBeat_Ning
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat(string tagValue)
|
||||||
|
{
|
||||||
|
WritePLC(15, OpNameCurrent, tagValue);
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat, Color.Gray);
|
||||||
|
|
||||||
|
//button5_heartBeat.BackColor = Color.Gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 设备PLC心跳
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tagValue"></param>
|
||||||
|
private void DeviceHeartBeat_NingJinQiang(string tagValue)
|
||||||
|
{
|
||||||
|
if (tagValue == "1")
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Green);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Green;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowButtonControl(button5_heartBeat_Ning, Color.Red);
|
||||||
|
|
||||||
|
//button5_heartBeat_Ning.BackColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void MoNiHeartBeat()
|
||||||
|
{
|
||||||
|
bool tv = false;
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WritePLC(14, OpNameCurrent, tv);
|
||||||
|
tv = !tv;
|
||||||
|
}
|
||||||
|
catch (Exception err) { }
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBox_MeasureValue_4_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
144
CCYQ_JieFang/OP/OP50/DAS_OP50.resx
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="timHSCZ.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>432, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="timUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>573, 221</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>33</value>
|
||||||
|
</metadata>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
AAABAAEAGhoAAAAAIAAHAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAaAAAAGggGAAAAqUpMzgAAAAFz
|
||||||
|
UkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABnElEQVRIS+2Uz2rC
|
||||||
|
QBDGfZRc+h7ec/Mmxhgx2CQGYi65ivUB9NZCArl4EC/SqwgePBRKwUfw0AfZzrfshvVPY1IjlNKBj0xm
|
||||||
|
Z+a3m0xS+7ciZhjGqN1uM0iE7mO/D9RsNh+QXEZkRpIkDArDcJsLoqQREofDYUrFrIwkpBTItu3VaSPX
|
||||||
|
dVkURWwymXD/dL0yECDSB0xdgyoD4RQAqEBVlYGu6a6gfv8x828GbTYfXPP5ik2nz1zwZbxS0Gz2wkzT
|
||||||
|
PBJilYMcx2NBELDl8pUtFivuI3YzSP1g1+t3foLx+Ik3huAjhrUfgeI4rgOGq2xQ9ERpmmpUa6HecZw0
|
||||||
|
F6SaCiryjkQZN7q//lOl3Wq6ru9RjPFFM+i7qZMj7vv+djAYpOhRCETJdSrKdpon9TtCDYQedF/sRPjd
|
||||||
|
0OSVEmpokwf0AEiKN71kOL7cned5rNvtbqkAj/Kier3eTuYDhCciWuVbp9PZobllWXt5/FardaArRvZI
|
||||||
|
Io6cT9Q1Go03AieiVb6JQi7a8YgaaGLpzLBGORblZt8NiQ/EX7da7Qtz50LQDuTBxQAAAABJRU5ErkJg
|
||||||
|
gg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
171
CCYQ_JieFang/OP/logInfo.Designer.cs
generated
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
partial class logInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.dateTimePicker1_log = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.dataGridView1_log = new System.Windows.Forms.DataGridView();
|
||||||
|
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.工位号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.日志类型 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.日志内容 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.操作日期 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.操作时间 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1_log)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// dateTimePicker1_log
|
||||||
|
//
|
||||||
|
this.dateTimePicker1_log.CustomFormat = "yyyy-MM-dd";
|
||||||
|
this.dateTimePicker1_log.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||||
|
this.dateTimePicker1_log.Location = new System.Drawing.Point(6, 14);
|
||||||
|
this.dateTimePicker1_log.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
this.dateTimePicker1_log.Name = "dateTimePicker1_log";
|
||||||
|
this.dateTimePicker1_log.Size = new System.Drawing.Size(162, 28);
|
||||||
|
this.dateTimePicker1_log.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// dataGridView1_log
|
||||||
|
//
|
||||||
|
this.dataGridView1_log.AllowUserToAddRows = false;
|
||||||
|
this.dataGridView1_log.AllowUserToDeleteRows = false;
|
||||||
|
this.dataGridView1_log.AllowUserToResizeRows = false;
|
||||||
|
this.dataGridView1_log.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.dataGridView1_log.ColumnHeadersHeight = 29;
|
||||||
|
this.dataGridView1_log.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||||
|
this.dataGridView1_log.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
|
this.ID,
|
||||||
|
this.工位号,
|
||||||
|
this.日志类型,
|
||||||
|
this.日志内容,
|
||||||
|
this.操作日期,
|
||||||
|
this.操作时间});
|
||||||
|
this.dataGridView1_log.Location = new System.Drawing.Point(6, 52);
|
||||||
|
this.dataGridView1_log.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
this.dataGridView1_log.Name = "dataGridView1_log";
|
||||||
|
this.dataGridView1_log.ReadOnly = true;
|
||||||
|
this.dataGridView1_log.RowHeadersVisible = false;
|
||||||
|
this.dataGridView1_log.RowHeadersWidth = 51;
|
||||||
|
this.dataGridView1_log.RowTemplate.Height = 27;
|
||||||
|
this.dataGridView1_log.Size = new System.Drawing.Size(1302, 793);
|
||||||
|
this.dataGridView1_log.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// ID
|
||||||
|
//
|
||||||
|
this.ID.DataPropertyName = "ID";
|
||||||
|
this.ID.HeaderText = "ID";
|
||||||
|
this.ID.MinimumWidth = 6;
|
||||||
|
this.ID.Name = "ID";
|
||||||
|
this.ID.ReadOnly = true;
|
||||||
|
this.ID.Width = 80;
|
||||||
|
//
|
||||||
|
// 工位号
|
||||||
|
//
|
||||||
|
this.工位号.DataPropertyName = "工位号";
|
||||||
|
this.工位号.HeaderText = "工位号";
|
||||||
|
this.工位号.MinimumWidth = 6;
|
||||||
|
this.工位号.Name = "工位号";
|
||||||
|
this.工位号.ReadOnly = true;
|
||||||
|
this.工位号.Width = 150;
|
||||||
|
//
|
||||||
|
// 日志类型
|
||||||
|
//
|
||||||
|
this.日志类型.DataPropertyName = "日志类型";
|
||||||
|
this.日志类型.HeaderText = "日志类型";
|
||||||
|
this.日志类型.MinimumWidth = 6;
|
||||||
|
this.日志类型.Name = "日志类型";
|
||||||
|
this.日志类型.ReadOnly = true;
|
||||||
|
this.日志类型.Width = 150;
|
||||||
|
//
|
||||||
|
// 日志内容
|
||||||
|
//
|
||||||
|
this.日志内容.DataPropertyName = "日志内容";
|
||||||
|
this.日志内容.HeaderText = "日志内容";
|
||||||
|
this.日志内容.MinimumWidth = 6;
|
||||||
|
this.日志内容.Name = "日志内容";
|
||||||
|
this.日志内容.ReadOnly = true;
|
||||||
|
this.日志内容.Width = 420;
|
||||||
|
//
|
||||||
|
// 操作日期
|
||||||
|
//
|
||||||
|
this.操作日期.DataPropertyName = "操作日期";
|
||||||
|
this.操作日期.HeaderText = "操作日期";
|
||||||
|
this.操作日期.MinimumWidth = 6;
|
||||||
|
this.操作日期.Name = "操作日期";
|
||||||
|
this.操作日期.ReadOnly = true;
|
||||||
|
this.操作日期.Width = 150;
|
||||||
|
//
|
||||||
|
// 操作时间
|
||||||
|
//
|
||||||
|
this.操作时间.DataPropertyName = "操作时间";
|
||||||
|
this.操作时间.HeaderText = "操作时间";
|
||||||
|
this.操作时间.MinimumWidth = 6;
|
||||||
|
this.操作时间.Name = "操作时间";
|
||||||
|
this.操作时间.ReadOnly = true;
|
||||||
|
this.操作时间.Width = 200;
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Location = new System.Drawing.Point(185, 10);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(75, 32);
|
||||||
|
this.button1.TabIndex = 3;
|
||||||
|
this.button1.Text = "查询";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// logInfo
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1314, 859);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.dataGridView1_log);
|
||||||
|
this.Controls.Add(this.dateTimePicker1_log);
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
this.Name = "logInfo";
|
||||||
|
this.Text = "logoInfo";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1_log)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private System.Windows.Forms.DateTimePicker dateTimePicker1_log;
|
||||||
|
private System.Windows.Forms.DataGridView dataGridView1_log;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 工位号;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 日志类型;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 日志内容;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 操作日期;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 操作时间;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
}
|
||||||
|
}
|
||||||
56
CCYQ_JieFang/OP/logInfo.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using MesWork;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
public partial class logInfo : Form
|
||||||
|
{
|
||||||
|
string currentOpName;
|
||||||
|
|
||||||
|
public logInfo(string opName)
|
||||||
|
{
|
||||||
|
currentOpName = opName;
|
||||||
|
InitializeComponent();
|
||||||
|
this.dateTimePicker1_log.CustomFormat = "yyyy-MM-dd";
|
||||||
|
dataGridView1_log.AutoGenerateColumns = false;
|
||||||
|
SearchLogInit(currentOpName, DateTime.Now.ToString("yyyy-MM-dd"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchLogInit(currentOpName, dateTimePicker1_log.Value.ToString());
|
||||||
|
}
|
||||||
|
private void SearchLogInit(string opName, string logDate)
|
||||||
|
{
|
||||||
|
logDate = string.Format("{0:yyyy-MM-dd}", logDate);
|
||||||
|
SearchLog(opName, logDate, out DataTable dt, out string errorMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
dataGridView1_log.DataSource = dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private bool SearchLog(string opName, string logDate, out DataTable dt, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "系统_操作日志_查询";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[2];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作日期", logDate);
|
||||||
|
return publicCore.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out dt, out errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SearchLogInit(currentOpName, dateTimePicker1_log.Value.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
138
CCYQ_JieFang/OP/logInfo.resx
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="工位号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="日志类型.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="日志内容.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="操作日期.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="操作时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
||||||
305
CCYQ_JieFang/OP/partInfo.Designer.cs
generated
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
partial class partInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.dataGridView1_part = new System.Windows.Forms.DataGridView();
|
||||||
|
this.button1_search = new System.Windows.Forms.Button();
|
||||||
|
this.dateTimePicker1_part = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.comboBox1_isOk = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.textBox1_partId = new System.Windows.Forms.TextBox();
|
||||||
|
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.工位号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.产品编码 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.测量项目 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.测量位置 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.测量值 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.是否合格 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.NG原因 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.单位 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.上限值 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.下限值 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
this.测量时间 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1_part)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// dataGridView1_part
|
||||||
|
//
|
||||||
|
this.dataGridView1_part.AllowUserToAddRows = false;
|
||||||
|
this.dataGridView1_part.AllowUserToDeleteRows = false;
|
||||||
|
this.dataGridView1_part.AllowUserToResizeRows = false;
|
||||||
|
this.dataGridView1_part.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.dataGridView1_part.ColumnHeadersHeight = 29;
|
||||||
|
this.dataGridView1_part.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||||
|
this.dataGridView1_part.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
|
this.ID,
|
||||||
|
this.工位号,
|
||||||
|
this.产品编码,
|
||||||
|
this.测量项目,
|
||||||
|
this.测量位置,
|
||||||
|
this.测量值,
|
||||||
|
this.是否合格,
|
||||||
|
this.NG原因,
|
||||||
|
this.单位,
|
||||||
|
this.上限值,
|
||||||
|
this.下限值,
|
||||||
|
this.测量时间});
|
||||||
|
this.dataGridView1_part.Location = new System.Drawing.Point(12, 49);
|
||||||
|
this.dataGridView1_part.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
this.dataGridView1_part.Name = "dataGridView1_part";
|
||||||
|
this.dataGridView1_part.ReadOnly = true;
|
||||||
|
this.dataGridView1_part.RowHeadersVisible = false;
|
||||||
|
this.dataGridView1_part.RowHeadersWidth = 51;
|
||||||
|
this.dataGridView1_part.RowTemplate.Height = 27;
|
||||||
|
this.dataGridView1_part.Size = new System.Drawing.Size(1364, 842);
|
||||||
|
this.dataGridView1_part.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// button1_search
|
||||||
|
//
|
||||||
|
this.button1_search.FlatStyle = System.Windows.Forms.FlatStyle.System;
|
||||||
|
this.button1_search.Location = new System.Drawing.Point(810, 8);
|
||||||
|
this.button1_search.Name = "button1_search";
|
||||||
|
this.button1_search.Size = new System.Drawing.Size(75, 32);
|
||||||
|
this.button1_search.TabIndex = 8;
|
||||||
|
this.button1_search.Text = "查询";
|
||||||
|
this.button1_search.UseVisualStyleBackColor = true;
|
||||||
|
this.button1_search.Click += new System.EventHandler(this.button1_search_Click);
|
||||||
|
//
|
||||||
|
// dateTimePicker1_part
|
||||||
|
//
|
||||||
|
this.dateTimePicker1_part.CustomFormat = "yyyy-MM-dd";
|
||||||
|
this.dateTimePicker1_part.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||||
|
this.dateTimePicker1_part.Location = new System.Drawing.Point(68, 12);
|
||||||
|
this.dateTimePicker1_part.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
this.dateTimePicker1_part.Name = "dateTimePicker1_part";
|
||||||
|
this.dateTimePicker1_part.Size = new System.Drawing.Size(162, 28);
|
||||||
|
this.dateTimePicker1_part.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label1.Location = new System.Drawing.Point(12, 15);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(54, 22);
|
||||||
|
this.label1.TabIndex = 9;
|
||||||
|
this.label1.Text = "日期";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label2.Location = new System.Drawing.Point(566, 15);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(98, 22);
|
||||||
|
this.label2.TabIndex = 9;
|
||||||
|
this.label2.Text = "测量结果";
|
||||||
|
//
|
||||||
|
// comboBox1_isOk
|
||||||
|
//
|
||||||
|
this.comboBox1_isOk.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.comboBox1_isOk.FormattingEnabled = true;
|
||||||
|
this.comboBox1_isOk.Location = new System.Drawing.Point(671, 12);
|
||||||
|
this.comboBox1_isOk.Name = "comboBox1_isOk";
|
||||||
|
this.comboBox1_isOk.Size = new System.Drawing.Size(121, 26);
|
||||||
|
this.comboBox1_isOk.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Font = new System.Drawing.Font("宋体", 11F);
|
||||||
|
this.label3.Location = new System.Drawing.Point(236, 15);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(98, 22);
|
||||||
|
this.label3.TabIndex = 9;
|
||||||
|
this.label3.Text = "产品编码";
|
||||||
|
//
|
||||||
|
// textBox1_partId
|
||||||
|
//
|
||||||
|
this.textBox1_partId.Location = new System.Drawing.Point(338, 12);
|
||||||
|
this.textBox1_partId.Name = "textBox1_partId";
|
||||||
|
this.textBox1_partId.Size = new System.Drawing.Size(222, 28);
|
||||||
|
this.textBox1_partId.TabIndex = 11;
|
||||||
|
//
|
||||||
|
// ID
|
||||||
|
//
|
||||||
|
this.ID.DataPropertyName = "Id";
|
||||||
|
this.ID.HeaderText = "ID";
|
||||||
|
this.ID.MinimumWidth = 6;
|
||||||
|
this.ID.Name = "ID";
|
||||||
|
this.ID.ReadOnly = true;
|
||||||
|
this.ID.Width = 80;
|
||||||
|
//
|
||||||
|
// 工位号
|
||||||
|
//
|
||||||
|
this.工位号.DataPropertyName = "工位号";
|
||||||
|
this.工位号.HeaderText = "工位号";
|
||||||
|
this.工位号.MinimumWidth = 6;
|
||||||
|
this.工位号.Name = "工位号";
|
||||||
|
this.工位号.ReadOnly = true;
|
||||||
|
this.工位号.Width = 80;
|
||||||
|
//
|
||||||
|
// 产品编码
|
||||||
|
//
|
||||||
|
this.产品编码.DataPropertyName = "EngineID";
|
||||||
|
this.产品编码.HeaderText = "产品编码";
|
||||||
|
this.产品编码.MinimumWidth = 6;
|
||||||
|
this.产品编码.Name = "产品编码";
|
||||||
|
this.产品编码.ReadOnly = true;
|
||||||
|
this.产品编码.Width = 150;
|
||||||
|
//
|
||||||
|
// 测量项目
|
||||||
|
//
|
||||||
|
this.测量项目.DataPropertyName = "测量项目";
|
||||||
|
this.测量项目.HeaderText = "测量项目";
|
||||||
|
this.测量项目.MinimumWidth = 6;
|
||||||
|
this.测量项目.Name = "测量项目";
|
||||||
|
this.测量项目.ReadOnly = true;
|
||||||
|
this.测量项目.Width = 80;
|
||||||
|
//
|
||||||
|
// 测量位置
|
||||||
|
//
|
||||||
|
this.测量位置.DataPropertyName = "测量位置";
|
||||||
|
this.测量位置.HeaderText = "测量位置";
|
||||||
|
this.测量位置.MinimumWidth = 6;
|
||||||
|
this.测量位置.Name = "测量位置";
|
||||||
|
this.测量位置.ReadOnly = true;
|
||||||
|
this.测量位置.Width = 80;
|
||||||
|
//
|
||||||
|
// 测量值
|
||||||
|
//
|
||||||
|
this.测量值.DataPropertyName = "TagValue";
|
||||||
|
this.测量值.HeaderText = "测量值";
|
||||||
|
this.测量值.MinimumWidth = 8;
|
||||||
|
this.测量值.Name = "测量值";
|
||||||
|
this.测量值.ReadOnly = true;
|
||||||
|
this.测量值.Width = 150;
|
||||||
|
//
|
||||||
|
// 是否合格
|
||||||
|
//
|
||||||
|
this.是否合格.DataPropertyName = "IsOK";
|
||||||
|
this.是否合格.HeaderText = "是否合格";
|
||||||
|
this.是否合格.MinimumWidth = 8;
|
||||||
|
this.是否合格.Name = "是否合格";
|
||||||
|
this.是否合格.ReadOnly = true;
|
||||||
|
this.是否合格.Width = 80;
|
||||||
|
//
|
||||||
|
// NG原因
|
||||||
|
//
|
||||||
|
this.NG原因.DataPropertyName = "不合格原因";
|
||||||
|
this.NG原因.HeaderText = "NG原因";
|
||||||
|
this.NG原因.MinimumWidth = 8;
|
||||||
|
this.NG原因.Name = "NG原因";
|
||||||
|
this.NG原因.ReadOnly = true;
|
||||||
|
this.NG原因.Width = 150;
|
||||||
|
//
|
||||||
|
// 单位
|
||||||
|
//
|
||||||
|
this.单位.DataPropertyName = "测量单位";
|
||||||
|
this.单位.HeaderText = "单位";
|
||||||
|
this.单位.MinimumWidth = 8;
|
||||||
|
this.单位.Name = "单位";
|
||||||
|
this.单位.ReadOnly = true;
|
||||||
|
this.单位.Width = 80;
|
||||||
|
//
|
||||||
|
// 上限值
|
||||||
|
//
|
||||||
|
this.上限值.DataPropertyName = "上限值";
|
||||||
|
this.上限值.HeaderText = "上限值";
|
||||||
|
this.上限值.MinimumWidth = 8;
|
||||||
|
this.上限值.Name = "上限值";
|
||||||
|
this.上限值.ReadOnly = true;
|
||||||
|
this.上限值.Width = 80;
|
||||||
|
//
|
||||||
|
// 下限值
|
||||||
|
//
|
||||||
|
this.下限值.DataPropertyName = "下限值";
|
||||||
|
this.下限值.HeaderText = "下限值";
|
||||||
|
this.下限值.MinimumWidth = 8;
|
||||||
|
this.下限值.Name = "下限值";
|
||||||
|
this.下限值.ReadOnly = true;
|
||||||
|
this.下限值.Width = 80;
|
||||||
|
//
|
||||||
|
// 测量时间
|
||||||
|
//
|
||||||
|
this.测量时间.DataPropertyName = "操作时间";
|
||||||
|
this.测量时间.HeaderText = "测量时间";
|
||||||
|
this.测量时间.MinimumWidth = 6;
|
||||||
|
this.测量时间.Name = "测量时间";
|
||||||
|
this.测量时间.ReadOnly = true;
|
||||||
|
this.测量时间.Width = 150;
|
||||||
|
//
|
||||||
|
// partInfo
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1388, 897);
|
||||||
|
this.Controls.Add(this.textBox1_partId);
|
||||||
|
this.Controls.Add(this.comboBox1_isOk);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.button1_search);
|
||||||
|
this.Controls.Add(this.dateTimePicker1_part);
|
||||||
|
this.Controls.Add(this.dataGridView1_part);
|
||||||
|
this.Name = "partInfo";
|
||||||
|
this.Text = "产品测量数据";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1_part)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private System.Windows.Forms.DataGridView dataGridView1_part;
|
||||||
|
private System.Windows.Forms.Button button1_search;
|
||||||
|
private System.Windows.Forms.DateTimePicker dateTimePicker1_part;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.ComboBox comboBox1_isOk;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.TextBox textBox1_partId;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 工位号;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 产品编码;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 测量项目;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 测量位置;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 测量值;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 是否合格;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn NG原因;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 单位;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 上限值;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 下限值;
|
||||||
|
private System.Windows.Forms.DataGridViewTextBoxColumn 测量时间;
|
||||||
|
}
|
||||||
|
}
|
||||||
79
CCYQ_JieFang/OP/partInfo.cs
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
using MesWork;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
|
||||||
|
namespace CCYQ_JieFang
|
||||||
|
{
|
||||||
|
public partial class partInfo : Form
|
||||||
|
{
|
||||||
|
string currentOpName;
|
||||||
|
public partInfo(string opName)
|
||||||
|
{
|
||||||
|
currentOpName = opName;
|
||||||
|
InitializeComponent();
|
||||||
|
initMeasureComboBox();
|
||||||
|
dataGridView1_part.AutoGenerateColumns = false;
|
||||||
|
SearchPartInit(currentOpName, "全部", "", DateTime.Now.ToString("yyyy-MM-dd"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initMeasureComboBox()
|
||||||
|
{
|
||||||
|
// 全部 OK NG
|
||||||
|
comboBox1_isOk.Items.Add("全部");
|
||||||
|
comboBox1_isOk.Items.Add("OK");
|
||||||
|
comboBox1_isOk.Items.Add("NG");
|
||||||
|
comboBox1_isOk.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_search_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string selectedItem = comboBox1_isOk.SelectedItem.ToString();
|
||||||
|
SearchPartInit(Name, selectedItem, textBox1_partId.Text, dateTimePicker1_part.Value.ToString("yyyy-MM-dd"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dateTimePicker1_part_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// SearchPartInit(Name, dateTimePicker1_part.Value.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SearchPartInit(string opName, string isOk, string partId, string logDate)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SearchPartInfo(opName, logDate, isOk, partId, out DataTable dt, out string errorMsg);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
dataGridView1_part.DataSource = dt;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataGridView1_part.DataSource = dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private bool SearchPartInfo(string opName, string partDate, string isOk, string partId, out DataTable dt, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "测量数据合格_查询";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[3];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@操作日期", partDate);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@IsOK", isOk);
|
||||||
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", partId);
|
||||||
|
return publicCore.ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out dt, out errorMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
156
CCYQ_JieFang/OP/partInfo.resx
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="工位号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="产品编码.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量项目.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量位置.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="是否合格.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="NG原因.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="单位.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="上限值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="下限值.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="测量时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
||||||
676
CCYQ_JieFang/OP/publicCore.cs
Normal file
@@ -0,0 +1,676 @@
|
|||||||
|
using DataLinkMesWork;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Robot.Common;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public partial class publicCore
|
||||||
|
{
|
||||||
|
public static int partCount = 0;
|
||||||
|
public static string FSSRequestMsgId = "";
|
||||||
|
public static string Hello_You_All_Never_Know(string[] args)
|
||||||
|
{
|
||||||
|
return Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// PLC事件变化委托
|
||||||
|
/// </summary>
|
||||||
|
public static Action<OpcData.CustomeEvetnArgs> MIS_Funtion_PLC_OP = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 读取PLC正在装配第几个件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="opName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static int Get_PartPosition(string opName)
|
||||||
|
{
|
||||||
|
// 当前装配第几个件 54
|
||||||
|
int PartPosition = -1;
|
||||||
|
PartPosition = Convert.ToInt32(MesWorkForm.ReadPLC(54, opName)) ;
|
||||||
|
return PartPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备状态发生变化,处理完成之后,发给管控系统
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// </summary>
|
||||||
|
public static void SolveDeviceStatus(string opName)
|
||||||
|
{
|
||||||
|
// 空闲(请求上料) 51
|
||||||
|
string isFree = "0";
|
||||||
|
// 完成(请求下料) 52
|
||||||
|
string isWorkFinish = "0";
|
||||||
|
// 故障 53
|
||||||
|
string isAlarm = "0";
|
||||||
|
string finalStatus = "0";
|
||||||
|
|
||||||
|
isFree = MesWorkForm.ReadPLC(51, opName).ToString();
|
||||||
|
if (isFree.ToLower() == "true" || isFree.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isFree = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
isWorkFinish = MesWorkForm.ReadPLC(52, opName).ToString();
|
||||||
|
if (isWorkFinish.ToLower() == "true" || isWorkFinish.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isWorkFinish = "1";
|
||||||
|
}
|
||||||
|
isAlarm = MesWorkForm.ReadPLC(53, opName).ToString();
|
||||||
|
if (isAlarm.ToLower() == "true" || isAlarm.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isAlarm = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAlarm == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "4";
|
||||||
|
}
|
||||||
|
else if (isWorkFinish == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "3";
|
||||||
|
}
|
||||||
|
else if (isFree == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "2";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
finalStatus = "1";
|
||||||
|
}
|
||||||
|
if (finalStatus == "3")
|
||||||
|
{
|
||||||
|
QualityData_Insert_Final(opName, out string errMag);
|
||||||
|
publicCore.LogInsert("Quality", "Info", "保存质量数据:" + errMag);
|
||||||
|
|
||||||
|
}
|
||||||
|
AnalysisMsg.DeviceStatus(opName, Convert.ToInt32(finalStatus));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备状态发生变化,处理完成之后,发给管控系统
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// 接口用 不重复保存质量数据
|
||||||
|
/// </summary>
|
||||||
|
public static void SolveDeviceStatus_WebApi_Use(string opName)
|
||||||
|
{
|
||||||
|
// 空闲(请求上料) 51
|
||||||
|
string isFree = "0";
|
||||||
|
// 完成(请求下料) 52
|
||||||
|
string isWorkFinish = "0";
|
||||||
|
// 故障 53
|
||||||
|
string isAlarm = "0";
|
||||||
|
string finalStatus = "0";
|
||||||
|
|
||||||
|
isFree = MesWorkForm.ReadPLC(51, opName).ToString();
|
||||||
|
if (isFree.ToLower() == "true" || isFree.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isFree = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
isWorkFinish = MesWorkForm.ReadPLC(52, opName).ToString();
|
||||||
|
if (isWorkFinish.ToLower() == "true" || isWorkFinish.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isWorkFinish = "1";
|
||||||
|
}
|
||||||
|
isAlarm = MesWorkForm.ReadPLC(53, opName).ToString();
|
||||||
|
if (isAlarm.ToLower() == "true" || isAlarm.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isAlarm = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAlarm == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "4";
|
||||||
|
}
|
||||||
|
else if (isWorkFinish == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "3";
|
||||||
|
}
|
||||||
|
else if (isFree == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "2";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
finalStatus = "1";
|
||||||
|
}
|
||||||
|
AnalysisMsg.DeviceStatus(opName, Convert.ToInt32(finalStatus));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备状态发生变化,处理完成之后,发给管控系统
|
||||||
|
/// 1工作中 2空闲(请求上料) 3完成(请求下料) 4 报警
|
||||||
|
/// </summary>
|
||||||
|
public static string SolveDeviceStatus_Read(string opName)
|
||||||
|
{
|
||||||
|
// 空闲(请求上料) 51
|
||||||
|
string isFree = "0";
|
||||||
|
// 完成(请求下料) 52
|
||||||
|
string isWorkFinish = "0";
|
||||||
|
// 故障 53
|
||||||
|
string isAlarm = "0";
|
||||||
|
string finalStatus = "0";
|
||||||
|
|
||||||
|
isFree = MesWorkForm.ReadPLC(51, opName).ToString();
|
||||||
|
if(isFree.ToLower() == "true" || isFree.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isFree = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
isWorkFinish = MesWorkForm.ReadPLC(52, opName).ToString();
|
||||||
|
if (isWorkFinish.ToLower() == "true" || isWorkFinish.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isWorkFinish = "1";
|
||||||
|
}
|
||||||
|
isAlarm = MesWorkForm.ReadPLC(53, opName).ToString();
|
||||||
|
if (isAlarm.ToLower() == "true" || isAlarm.ToLower() == "1")
|
||||||
|
{
|
||||||
|
isAlarm = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAlarm == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "4";
|
||||||
|
}
|
||||||
|
else if (isWorkFinish == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "3";
|
||||||
|
}
|
||||||
|
else if (isFree == "1")
|
||||||
|
{
|
||||||
|
finalStatus = "2";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
finalStatus = "1";
|
||||||
|
}
|
||||||
|
return finalStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// AGV任务号
|
||||||
|
/// </summary>
|
||||||
|
public static void SolveAgvTaskNum(string OpName, string PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 77 反馈AGV任务
|
||||||
|
switch (PLC_AgvTaskNum)
|
||||||
|
{
|
||||||
|
// AGV已呼叫成功正在去往上料区
|
||||||
|
case "10":
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "10");
|
||||||
|
break;
|
||||||
|
// AGV已到达上料区_带货,申请进入上料位置
|
||||||
|
case "11":
|
||||||
|
string previousTaskValue = MesWorkForm.ReadPLC(77, OpName).ToString();
|
||||||
|
string AgvCanEnter = MesWorkForm.ReadPLC(50, OpName).ToString();
|
||||||
|
if (previousTaskValue == "10")
|
||||||
|
{
|
||||||
|
// 写任务--满AGV是达上料区
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "1");
|
||||||
|
if (AgvCanEnter == "2")
|
||||||
|
{
|
||||||
|
// 1.调用FSS-接收允许进入或离开 (类型:允许进入)的接口
|
||||||
|
AnalysisMsg.ResponseEnterOrLeave(OpName, 1);
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "20");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (previousTaskValue == "30")
|
||||||
|
{
|
||||||
|
// 写任务--空AGV是达上料区
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "3");
|
||||||
|
if (AgvCanEnter == "4")
|
||||||
|
{
|
||||||
|
// 1.调用FSS-接收允许进入或离开 (类型:允许进入)的接口
|
||||||
|
AnalysisMsg.ResponseEnterOrLeave(OpName, 1);
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "40");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 允许AGV进行上料 --允许进入
|
||||||
|
case "2":
|
||||||
|
string FullAgvIsRequestEnter = MesWorkForm.ReadPLC(77, OpName).ToString();
|
||||||
|
// 需要判断前序任务是否完成-- 满AGV是否到达上料区
|
||||||
|
if (FullAgvIsRequestEnter == "1")
|
||||||
|
{
|
||||||
|
// 1.调用FSS-接收允许进入或离开 (类型:允许进入)的接口
|
||||||
|
AnalysisMsg.ResponseEnterOrLeave(OpName, 1);
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "20");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "21":
|
||||||
|
// AGV 上料完成
|
||||||
|
string previousTaskValue1 = MesWorkForm.ReadPLC(77, OpName).ToString();
|
||||||
|
if(previousTaskValue1 == "20")
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "2");
|
||||||
|
}
|
||||||
|
if (previousTaskValue1 == "40")
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "4");
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
// PLC呼叫AGV进行下料
|
||||||
|
case "3":
|
||||||
|
// 1.调用FSS-接收IPC下料请求的接口
|
||||||
|
AnalysisMsg.FinishCall(OpName);
|
||||||
|
// 2.反馈任务号:30 AGV已呼叫成功正在去往下料区
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "30");
|
||||||
|
break;
|
||||||
|
// 允许AGV进行下料 --允许进入
|
||||||
|
case "4":
|
||||||
|
string EmptyAgvIsRequestEnter = MesWorkForm.ReadPLC(77, OpName).ToString();
|
||||||
|
// 需要判断前序任务是否完成-- 空AGV是否到达上料区
|
||||||
|
if (EmptyAgvIsRequestEnter == "3")
|
||||||
|
{
|
||||||
|
// 1.调用FSS-接收允许进入或离开 (类型:允许进入)的接口
|
||||||
|
AnalysisMsg.ResponseEnterOrLeave(OpName, 1);
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "40");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 允许AGV离开
|
||||||
|
case "5":
|
||||||
|
string FullOrEmptyAgvIsRequestLeave = MesWorkForm.ReadPLC(77, OpName).ToString();
|
||||||
|
// 需要判断前序任务是否完成-- AGV上料完成或者下料完成
|
||||||
|
if(FullOrEmptyAgvIsRequestLeave == "2" || FullOrEmptyAgvIsRequestLeave == "4")
|
||||||
|
{
|
||||||
|
// 1.调用FSS-接收允许进入或离开 (类型:允许离开)的接口
|
||||||
|
AnalysisMsg.ResponseEnterOrLeave(OpName, 2);
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "50");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "51":
|
||||||
|
// AGV 已离开 反馈任务号:5
|
||||||
|
MesWorkForm.WritePLC(77, OpName, "5");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (OpName)
|
||||||
|
{
|
||||||
|
case "OP10":
|
||||||
|
if (DAS_OP10.AGV_Task_change != null)
|
||||||
|
{
|
||||||
|
DAS_OP10.AGV_Task_change(PLC_AgvTaskNum);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP20":
|
||||||
|
if (DAS_OP20.AGV_Task_change != null)
|
||||||
|
{
|
||||||
|
DAS_OP20.AGV_Task_change(PLC_AgvTaskNum);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP30":
|
||||||
|
if (DAS_OP30.AGV_Task_change != null)
|
||||||
|
{
|
||||||
|
DAS_OP30.AGV_Task_change(PLC_AgvTaskNum);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP40":
|
||||||
|
if (DAS_OP40.AGV_Task_change != null)
|
||||||
|
{
|
||||||
|
DAS_OP40.AGV_Task_change(PLC_AgvTaskNum);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "OP50":
|
||||||
|
if (DAS_OP50.AGV_Task_change != null)
|
||||||
|
{
|
||||||
|
DAS_OP50.AGV_Task_change(PLC_AgvTaskNum);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 读取泄漏量的数据
|
||||||
|
/// </summary>
|
||||||
|
public static void ReadQualityData_LeakageRate(string opName)
|
||||||
|
{
|
||||||
|
string Pressure = MesWorkForm.ReadPLC(57, opName).ToString();
|
||||||
|
int partPosition = Convert.ToInt32(MesWorkForm.ReadPLC(54, opName));
|
||||||
|
int MeasurePosition = 9;
|
||||||
|
string IsOK = "1";
|
||||||
|
string NgStr = "";
|
||||||
|
//保存质量数
|
||||||
|
QualityData_MobyInsert(partPosition, MeasurePosition, opName, Pressure, IsOK, NgStr, out string errMsg);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拧紧数据的变化
|
||||||
|
/// </summary>
|
||||||
|
public static void MeasurePositionChange(string opName, int MeasureStatus)
|
||||||
|
{
|
||||||
|
int MeasurePosition = Convert.ToInt32(MesWorkForm.ReadPLC(55, opName));
|
||||||
|
int partPosition = Convert.ToInt32(MesWorkForm.ReadPLC(54, opName));
|
||||||
|
QualityData_MobyUpdate(partPosition, MeasurePosition, opName, MeasureStatus, out string errMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 读压力的数据
|
||||||
|
/// </summary>
|
||||||
|
public static void ReadQualityData_Pressure(string opName)
|
||||||
|
{
|
||||||
|
string LeakageRate1 = MesWorkForm.ReadPLC(57, opName).ToString();
|
||||||
|
string LeakageRate2 = MesWorkForm.ReadPLC(58, opName).ToString();
|
||||||
|
int partPosition = Convert.ToInt32(MesWorkForm.ReadPLC(54, opName));
|
||||||
|
int MeasurePosition = 1;
|
||||||
|
string IsOK1 = "1";
|
||||||
|
string NgStr1 = "";
|
||||||
|
//保存质量数
|
||||||
|
QualityData_MobyInsert(partPosition, MeasurePosition, opName, LeakageRate1, IsOK1, NgStr1, out string errMsg);
|
||||||
|
MeasurePosition = 2;
|
||||||
|
string IsOK2 = "1";
|
||||||
|
string NgStr2 = "";
|
||||||
|
QualityData_MobyInsert(partPosition, MeasurePosition, opName, LeakageRate2, IsOK1, NgStr2, out string errMsg1);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 质量数据的保存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PartPosition"></param>
|
||||||
|
/// <param name="MeasurePosition"></param>
|
||||||
|
/// <param name="opName"></param>
|
||||||
|
/// <param name="TagValue"></param>
|
||||||
|
/// <param name="IsOK"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool QualityData_MobyUpdate(int PartPosition, int MeasurePosition, string opName, int MeasureStatus, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "测量数据合格_Moby_更新";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[4];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@测量状态", MeasureStatus);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@测量位置", MeasurePosition);
|
||||||
|
thisParms[3] = new System.Data.SqlClient.SqlParameter("@装配位置", PartPosition);
|
||||||
|
return ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质量数据的保存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PartPosition"></param>
|
||||||
|
/// <param name="MeasurePosition"></param>
|
||||||
|
/// <param name="opName"></param>
|
||||||
|
/// <param name="TagValue"></param>
|
||||||
|
/// <param name="IsOK"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool QualityData_MobyInsert(int PartPosition, int MeasurePosition, string opName, string TagValue, string IsOK, string NgStr, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "测量数据合格_Moby_增加";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[6];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@TagValue", TagValue);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@IsOK", IsOK);
|
||||||
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
thisParms[3] = new System.Data.SqlClient.SqlParameter("@测量位置", MeasurePosition);
|
||||||
|
thisParms[4] = new System.Data.SqlClient.SqlParameter("@装配位置", PartPosition);
|
||||||
|
thisParms[5] = new System.Data.SqlClient.SqlParameter("@不合格原因", NgStr);
|
||||||
|
return ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out errorMsg);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 质量数据的保存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PartPosition"></param>
|
||||||
|
/// <param name="MeasurePosition"></param>
|
||||||
|
/// <param name="opName"></param>
|
||||||
|
/// <param name="TagValue"></param>
|
||||||
|
/// <param name="IsOK"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool QualityData_Insert_Final(string opName, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "测量数据合格_增加";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[1];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
return ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out errorMsg);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 判断来料是否满托盘
|
||||||
|
/// </summary>
|
||||||
|
public static void JudgeMaterialFull(string opName, List<IPC_product_AssemblyInformation> product_AssemblyInformation)
|
||||||
|
{
|
||||||
|
int partCount = product_AssemblyInformation.Count;
|
||||||
|
if (publicCore.partCount == partCount)
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(78, opName, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(78, opName, false);
|
||||||
|
}
|
||||||
|
MesWorkForm.WritePLC(79, opName, false);
|
||||||
|
MesWorkForm.WritePLC(80, opName, false);
|
||||||
|
MesWorkForm.WritePLC(81, opName, false);
|
||||||
|
MesWorkForm.WritePLC(82, opName, false);
|
||||||
|
foreach (var item in product_AssemblyInformation)
|
||||||
|
{
|
||||||
|
if(item.productPosition == 1)
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(79, opName, true);
|
||||||
|
}
|
||||||
|
if (item.productPosition == 2)
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(80, opName, true);
|
||||||
|
}
|
||||||
|
if (item.productPosition == 3)
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(81, opName, true);
|
||||||
|
}
|
||||||
|
if (item.productPosition == 4)
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(82, opName, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
MesWorkForm.WritePLC(60, opName, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 是否允许工作
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="opName"></param>
|
||||||
|
/// <param name="isAllowWork"></param>
|
||||||
|
public static void FixedAllow(string opName, object isAllowWork)
|
||||||
|
{
|
||||||
|
MesWorkForm.WritePLC(85, opName, isAllowWork);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 测量数据_测量信息_初始化查询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PartPosition"></param>
|
||||||
|
/// <param name="MeasurePosition"></param>
|
||||||
|
/// <param name="opName"></param>
|
||||||
|
/// <param name="TagValue"></param>
|
||||||
|
/// <param name="IsOK"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool GetQualityInfo_Init(string opName, int PartPosition, out DataTable dt, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "测量数据_测量信息_初始化查询";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[2];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@装配位置", PartPosition);
|
||||||
|
return ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out dt, out errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool GetProductInfo_Init(string opName, int PartPosition, out DataTable dt, out string errorMsg)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "装配信息_初始化查询";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[2];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@装配位置", PartPosition);
|
||||||
|
return ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out dt, out errorMsg);
|
||||||
|
}
|
||||||
|
public static void LogInsert(string opName, string logType, string log)
|
||||||
|
{
|
||||||
|
string procedureName;
|
||||||
|
procedureName = "系统_操作日志_新增";
|
||||||
|
SqlParameter[] thisParms = new SqlParameter[5];
|
||||||
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||||
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@日志类型", logType);
|
||||||
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@日志内容", log);
|
||||||
|
thisParms[3] = new System.Data.SqlClient.SqlParameter("@操作日期", DateTime.Now.ToString("yyyy-MM-dd"));
|
||||||
|
thisParms[4] = new System.Data.SqlClient.SqlParameter("@操作时间", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
|
||||||
|
ExecuteStoredProcedure(procedureName, MesWorkForm.ConnectionString, ref thisParms, out string errorMsg);
|
||||||
|
}
|
||||||
|
#region 数据库操作
|
||||||
|
/// <summary>
|
||||||
|
/// 提供通用的调用存储过程的方法(需要返回查询的记录集的调用)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="procedureName">存储过程名称</param>
|
||||||
|
/// <param name="connectionString">连库字符串</param>
|
||||||
|
/// <param name="sqlParameters">存储过程参数数组</param>
|
||||||
|
/// <param name="ds">存储过程里面返回的记录集</param>
|
||||||
|
/// <param name="errorMessage">错误信息</param>
|
||||||
|
/// <returns>布尔值,true表示该执行成功,false表示执行失败</returns>
|
||||||
|
public static bool ExecuteStoredProcedure(string procedureName, string connectionString, ref SqlParameter[] sqlParameters, out DataSet ds, out string errorMessage)
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
errorMessage = "";
|
||||||
|
ds = new DataSet();
|
||||||
|
if (connectionString.Length < 1) return false;
|
||||||
|
using (SqlConnection conn = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//if (!SqlServerConnectionStatus) return false;
|
||||||
|
conn.Open();
|
||||||
|
using (SqlDataAdapter dsCommand = new SqlDataAdapter())
|
||||||
|
{
|
||||||
|
dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
|
||||||
|
dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
|
||||||
|
for (int i = 0; i < sqlParameters.Length; i++)
|
||||||
|
{
|
||||||
|
dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
|
||||||
|
}
|
||||||
|
dsCommand.Fill(ds);
|
||||||
|
}
|
||||||
|
// SqlServerConnectionStatus = true;
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
errorMessage = e.ToString();
|
||||||
|
// TestConnection();
|
||||||
|
//ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n存储过程:\r\n" + procedureName + "\r\n连接字符串:\r\n" + connectionString);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (conn.State == ConnectionState.Open)
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 提供通用的调用存储过程的方法(需要返回查询的记录集的调用)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="procedureName">存储过程名称</param>
|
||||||
|
/// <param name="connectionString">连库字符串</param>
|
||||||
|
/// <param name="sqlParameters">存储过程参数数组</param>
|
||||||
|
/// <param name="dt">存储过程里面返回的记录表</param>
|
||||||
|
/// <param name="errorMessage">错误信息</param>
|
||||||
|
/// <returns>布尔值,true表示该执行成功,false表示执行失败</returns>
|
||||||
|
public static bool ExecuteStoredProcedure(string procedureName, string connectionString, ref SqlParameter[] sqlParameters, out DataTable dt, out string errorMessage)
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
errorMessage = "";
|
||||||
|
dt = new DataTable();
|
||||||
|
DataSet ds = new DataSet();
|
||||||
|
if (connectionString.Length < 1) return false;
|
||||||
|
using (SqlConnection conn = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//if (!SqlServerConnectionStatus) return false;
|
||||||
|
conn.Open();
|
||||||
|
using (SqlDataAdapter dsCommand = new SqlDataAdapter())
|
||||||
|
{
|
||||||
|
dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
|
||||||
|
dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
|
||||||
|
for (int i = 0; i < sqlParameters.Length; i++)
|
||||||
|
{
|
||||||
|
dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
|
||||||
|
}
|
||||||
|
dsCommand.Fill(ds);
|
||||||
|
}
|
||||||
|
if (ds.Tables.Count > 0)
|
||||||
|
{
|
||||||
|
dt = ds.Tables[0];
|
||||||
|
}
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
errorMessage = e.ToString();
|
||||||
|
// TestConnection();
|
||||||
|
//ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n存储过程:\r\n" + procedureName + "\r\n连接字符串:\r\n" + connectionString);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (conn.State == ConnectionState.Open)
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 提供通用的调用存储过程的方法(需要返回查询的记录集的调用)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="procedureName">存储过程名称</param>
|
||||||
|
/// <param name="connectionString">连库字符串</param>
|
||||||
|
/// <param name="sqlParameters">存储过程参数数组</param>
|
||||||
|
/// <param name="dt">存储过程里面返回的记录表</param>
|
||||||
|
/// <param name="errorMessage">错误信息</param>
|
||||||
|
/// <returns>布尔值,true表示该执行成功,false表示执行失败</returns>
|
||||||
|
public static bool ExecuteStoredProcedure(string procedureName, string connectionString, ref SqlParameter[] sqlParameters, out string errorMessage)
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
errorMessage = "";
|
||||||
|
DataSet ds = new DataSet();
|
||||||
|
if (connectionString.Length < 1) return false;
|
||||||
|
using (SqlConnection conn = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//if (!SqlServerConnectionStatus) return false;
|
||||||
|
conn.Open();
|
||||||
|
using (SqlDataAdapter dsCommand = new SqlDataAdapter())
|
||||||
|
{
|
||||||
|
dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
|
||||||
|
dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
|
||||||
|
for (int i = 0; i < sqlParameters.Length; i++)
|
||||||
|
{
|
||||||
|
dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
|
||||||
|
}
|
||||||
|
dsCommand.Fill(ds);
|
||||||
|
}
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
errorMessage = e.ToString();
|
||||||
|
// TestConnection();
|
||||||
|
//ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n存储过程:\r\n" + procedureName + "\r\n连接字符串:\r\n" + connectionString);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (conn.State == ConnectionState.Open)
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
36
CCYQ_JieFang/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// 有关程序集的一般信息由以下
|
||||||
|
// 控制。更改这些特性值可修改
|
||||||
|
// 与程序集关联的信息。
|
||||||
|
[assembly: AssemblyTitle("MesWork")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("MesWork")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||||
|
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||||
|
//请将此类型的 ComVisible 特性设置为 true。
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||||
|
[assembly: Guid("a8d0b4ef-e223-4b9a-b2d9-0156b7b8b073")]
|
||||||
|
|
||||||
|
// 程序集的版本信息由下列四个值组成:
|
||||||
|
//
|
||||||
|
// 主版本
|
||||||
|
// 次版本
|
||||||
|
// 生成号
|
||||||
|
// 修订号
|
||||||
|
//
|
||||||
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
|
//通过使用 "*",如下所示:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
193
CCYQ_JieFang/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
// 运行时版本:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||||
|
// 重新生成代码,这些更改将会丢失。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CCYQ_JieFang.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||||
|
/// </summary>
|
||||||
|
// 此类是由 StronglyTypedResourceBuilder
|
||||||
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
|
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
|
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CCYQ_JieFang.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap _01_微型减速机 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("01-微型减速机", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap _02_涡喷发动机 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("02 涡喷发动机", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap _03_卫星模型 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("03-卫星模型", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap _04_微型减速机 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("04-微型减速机", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap _05_微型减速机 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("05-微型减速机", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap green {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("green", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap red {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("red", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap StartWorkCircle {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("StartWorkCircle", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap 下压 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("下压", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap 下压OK {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("下压OK", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap 关闭系统 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("关闭系统", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap 断开连接 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("断开连接", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap 连接 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("连接", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
160
CCYQ_JieFang/Properties/Resources.resx
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<?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>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="关闭系统" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\关闭系统.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="04-微型减速机" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\04-微型减速机.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="StartWorkCircle" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\StartWorkCircle.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="green" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="断开连接" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\断开连接.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="01-微型减速机" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\01-微型减速机.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="red" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\red.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="03-卫星模型" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\03-卫星模型.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="连接" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\连接.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="02 涡喷发动机" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\02 涡喷发动机.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="05-微型减速机" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\05-微型减速机.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="下压" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\下压.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="下压OK" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\icon\下压OK.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
26
CCYQ_JieFang/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
// 运行时版本:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||||
|
// 重新生成代码,这些更改将会丢失。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CCYQ_JieFang.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
CCYQ_JieFang/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?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>
|
||||||
79
CCYQ_JieFang/app.manifest
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- UAC 清单选项
|
||||||
|
如果想要更改 Windows 用户帐户控制级别,请使用
|
||||||
|
以下节点之一替换 requestedExecutionLevel 节点。
|
||||||
|
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||||
|
|
||||||
|
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
|
||||||
|
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
|
||||||
|
元素。
|
||||||
|
-->
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
|
||||||
|
Windows 版本的列表。取消评论适当的元素,
|
||||||
|
Windows 将自动选择最兼容的环境。 -->
|
||||||
|
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||||
|
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
|
||||||
|
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
|
||||||
|
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
|
||||||
|
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
|
||||||
|
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
|
||||||
|
|
||||||
|
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
|
||||||
|
<!--
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||||
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="Microsoft.Windows.Common-Controls"
|
||||||
|
version="6.0.0.0"
|
||||||
|
processorArchitecture="*"
|
||||||
|
publicKeyToken="6595b64144ccf1df"
|
||||||
|
language="*"
|
||||||
|
/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
</assembly>
|
||||||
BIN
CCYQ_JieFang/icon/01-微型减速机.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
CCYQ_JieFang/icon/02 涡喷发动机.png
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
CCYQ_JieFang/icon/03-卫星模型.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
CCYQ_JieFang/icon/04-微型减速机.png
Normal file
|
After Width: | Height: | Size: 132 KiB |
BIN
CCYQ_JieFang/icon/05-微型减速机.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
CCYQ_JieFang/icon/OP10OP50.ico
Normal file
|
After Width: | Height: | Size: 541 B |
BIN
CCYQ_JieFang/icon/StartWorkCircle.gif
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
CCYQ_JieFang/icon/green.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
CCYQ_JieFang/icon/red.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
CCYQ_JieFang/icon/下压.gif
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
CCYQ_JieFang/icon/下压OK.png
Normal file
|
After Width: | Height: | Size: 403 B |
BIN
CCYQ_JieFang/icon/关闭系统.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
CCYQ_JieFang/icon/断开连接.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
CCYQ_JieFang/icon/连接.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
719
CCYQ_JieFang/webApi/AnalysisMsg.cs
Normal file
@@ -0,0 +1,719 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web.Http;
|
||||||
|
using NPOI.POIFS.Properties;
|
||||||
|
using Robots;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using Opc.Ua;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public class AnalysisMsg
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// UUID生成
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string UuidUtil()
|
||||||
|
{
|
||||||
|
string result = Guid.NewGuid().ToString();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// IPC-接收装配信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string product(string url, [FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
string MsgId = "";
|
||||||
|
var result = new msgResHeader();
|
||||||
|
result.Code = "200";
|
||||||
|
result.Message = "";
|
||||||
|
|
||||||
|
int AID = -1;
|
||||||
|
string errorMessage = "";
|
||||||
|
if (jobj == null)
|
||||||
|
{
|
||||||
|
throw new Exception("参数格式不正确!");
|
||||||
|
}
|
||||||
|
int isError = 0;
|
||||||
|
string str = jobj.ToString();
|
||||||
|
publicCore.LogInsert("product", "Info", str);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//存储日志
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var param1 = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",url),
|
||||||
|
new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",str),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param1, out DataTable dt, out errorMessage);
|
||||||
|
if (errorMessage != "")
|
||||||
|
{
|
||||||
|
throw new Exception("数据库存储过程【接口_IOT接口交互日志_请求记录】调用失败!");
|
||||||
|
}
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
// 解析订单内容,存储数据库,根据实际业务来写
|
||||||
|
IPC_product productDataList = JsonConvert.DeserializeObject<IPC_product>(str);
|
||||||
|
List<IPC_product_AssemblyInformation> product_AssemblyInformation = productDataList.AssemblyInformation;
|
||||||
|
string Location = productDataList.Location;
|
||||||
|
MsgId = productDataList.MsgId;
|
||||||
|
if (MsgId == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数MsgId为空!");
|
||||||
|
}
|
||||||
|
if (Location == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数Location为空!");
|
||||||
|
}
|
||||||
|
var parsingParam1 = new SqlParameter[] {
|
||||||
|
new SqlParameter("@Location",Location),
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_工位装配信息_删除", MesWorkForm.ConnectionString, ref parsingParam1, out errorMessage);
|
||||||
|
if (errorMessage != "")
|
||||||
|
{
|
||||||
|
throw new Exception("数据库存储过程【接口_工位装配信息_删除】调用失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var assemblyInformation in product_AssemblyInformation)
|
||||||
|
{
|
||||||
|
if (assemblyInformation.productPosition <= 0)
|
||||||
|
{
|
||||||
|
throw new Exception("参数productPosition不正确!");
|
||||||
|
}
|
||||||
|
if (assemblyInformation.productNo == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数productNo不正确!");
|
||||||
|
}
|
||||||
|
var parsingParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@Location",Location),
|
||||||
|
new SqlParameter("@productNo",assemblyInformation.productNo),
|
||||||
|
new SqlParameter("@MsgId",MsgId),
|
||||||
|
new SqlParameter("@productName",assemblyInformation.productName),
|
||||||
|
new SqlParameter("@productPosition",assemblyInformation.productPosition)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_工位装配信息", MesWorkForm.ConnectionString, ref parsingParam, out errorMessage);
|
||||||
|
if (errorMessage != "")
|
||||||
|
{
|
||||||
|
throw new Exception("数据库存储过程【接口_工位装配信息】调用失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publicCore.SolveAgvTaskNum(Location, "10");
|
||||||
|
publicCore.JudgeMaterialFull(Location, product_AssemblyInformation);
|
||||||
|
publicCore.FixedAllow(Location, true);
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",JsonConvert.SerializeObject(result))
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
result.Code = "500";
|
||||||
|
result.Message = err.Message;
|
||||||
|
result.MsgId = MsgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
string retString = JsonConvert.SerializeObject(result);
|
||||||
|
publicCore.LogInsert("product", "Info", "IPC-接收装配信息:" + retString);
|
||||||
|
return retString;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// IPC-查询设备可进入或可离开状态
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string RequestEnterOrLeave(string url, [FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
string MsgId = "";
|
||||||
|
var result = new msgResHeader();
|
||||||
|
result.Code = "200";
|
||||||
|
result.Message = "";
|
||||||
|
|
||||||
|
int AID = -1;
|
||||||
|
string errorMessage = "";
|
||||||
|
if (jobj == null)
|
||||||
|
{
|
||||||
|
throw new Exception("参数格式不正确!");
|
||||||
|
}
|
||||||
|
int isError = 0;
|
||||||
|
string str = jobj.ToString();
|
||||||
|
publicCore.LogInsert("RequestEnterOrLeave", "Info", str);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//存储日志
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var param1 = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",url),
|
||||||
|
new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",str),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param1, out DataTable dt, out errorMessage);
|
||||||
|
if (errorMessage != "")
|
||||||
|
{
|
||||||
|
throw new Exception("数据库存储过程【接口_IOT接口交互日志_请求记录】调用失败!");
|
||||||
|
}
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
// 解析订单内容,存储数据库,根据实际业务来写
|
||||||
|
IPC_RequestEnterOrLeave requestEnterOrLeave = JsonConvert.DeserializeObject<IPC_RequestEnterOrLeave>(str);
|
||||||
|
string Location = requestEnterOrLeave.Location;
|
||||||
|
int RequestType = requestEnterOrLeave.RequestType;
|
||||||
|
MsgId = requestEnterOrLeave.MsgId;
|
||||||
|
if (MsgId == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数MsgId为空!");
|
||||||
|
}
|
||||||
|
if (Location == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数Location为空!");
|
||||||
|
}
|
||||||
|
if (RequestType != 1 && RequestType != 2)
|
||||||
|
{
|
||||||
|
throw new Exception("参数RequestType错误!");
|
||||||
|
}
|
||||||
|
// 1:查询是否可以进入
|
||||||
|
if (RequestType == 1)
|
||||||
|
{
|
||||||
|
// 这块有问题,需要区分下是送 还是取 的请求进入
|
||||||
|
// 如果是上料的请求进入 执行11
|
||||||
|
// 1.AGV已到达上料区
|
||||||
|
// 如果是下料的请求进入 执行31
|
||||||
|
// 1.AGV已到达下料区
|
||||||
|
publicCore.FSSRequestMsgId = MsgId;
|
||||||
|
publicCore.SolveAgvTaskNum(Location, "11");
|
||||||
|
}
|
||||||
|
// 2:查询是否可以离开
|
||||||
|
if (RequestType == 2)
|
||||||
|
{
|
||||||
|
// 这块有问题,需要区分下是送 还是取 的请求离开
|
||||||
|
// 如果是上料的请求离开 执行21
|
||||||
|
// 1:AGV 上料完成
|
||||||
|
// 如果是下料的请求离开 执行41
|
||||||
|
// AGV正在离开
|
||||||
|
// 里面判断
|
||||||
|
publicCore.FSSRequestMsgId = MsgId;
|
||||||
|
publicCore.SolveAgvTaskNum(Location, "21");
|
||||||
|
}
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",JsonConvert.SerializeObject(result))
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
result.Code = "500";
|
||||||
|
result.Message = err.Message;
|
||||||
|
result.MsgId = MsgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
string retString = JsonConvert.SerializeObject(result);
|
||||||
|
publicCore.LogInsert("RequestEnterOrLeave", "Info", "IPC-查询设备可进入或可离开状态:" + retString);
|
||||||
|
return retString;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// IPC-上下料完成AGV离开
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string WorkFinsih(string url, [FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
|
||||||
|
string MsgId = "";
|
||||||
|
var result = new msgResHeader();
|
||||||
|
result.Code = "200";
|
||||||
|
result.Message = "";
|
||||||
|
|
||||||
|
int AID = -1;
|
||||||
|
string errorMessage = "";
|
||||||
|
if (jobj == null)
|
||||||
|
{
|
||||||
|
throw new Exception("参数格式不正确!");
|
||||||
|
}
|
||||||
|
int isError = 0;
|
||||||
|
string str = jobj.ToString();
|
||||||
|
publicCore.LogInsert("WorkFinsih", "Info", str);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//存储日志
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var param1 = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",url),
|
||||||
|
new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",str),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param1, out DataTable dt, out errorMessage);
|
||||||
|
if (errorMessage != "")
|
||||||
|
{
|
||||||
|
throw new Exception("数据库存储过程【接口_IOT接口交互日志_请求记录】调用失败!");
|
||||||
|
}
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
// 解析订单内容,存储数据库,根据实际业务来写
|
||||||
|
IPC_WorkFinsih WorkFinsih = JsonConvert.DeserializeObject<IPC_WorkFinsih>(str);
|
||||||
|
string Location = WorkFinsih.Location;
|
||||||
|
int finishType = WorkFinsih.FinishType;
|
||||||
|
|
||||||
|
MsgId = WorkFinsih.MsgId;
|
||||||
|
if (MsgId == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数MsgId为空!");
|
||||||
|
}
|
||||||
|
if (Location == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数Location为空!");
|
||||||
|
}
|
||||||
|
if (finishType != 1 && finishType != 2)
|
||||||
|
{
|
||||||
|
throw new Exception("参数FinishType错误!");
|
||||||
|
}
|
||||||
|
if (finishType == 1)
|
||||||
|
{
|
||||||
|
// 1.AGV上料完成 已离开
|
||||||
|
publicCore.SolveAgvTaskNum(Location, "51");
|
||||||
|
}
|
||||||
|
if (finishType == 2)
|
||||||
|
{
|
||||||
|
// 1.AGV下料完成 已离开
|
||||||
|
publicCore.SolveAgvTaskNum(Location, "51");
|
||||||
|
publicCore.FixedAllow(Location, false);
|
||||||
|
}
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",JsonConvert.SerializeObject(result))
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
result.Code = "500";
|
||||||
|
result.Message = err.Message;
|
||||||
|
result.MsgId = MsgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
string retString = JsonConvert.SerializeObject(result);
|
||||||
|
publicCore.LogInsert("WorkFinsih", "Info", "IPC-上下料完成AGV离开res:" + retString);
|
||||||
|
return retString;
|
||||||
|
}
|
||||||
|
public static string IPCDeviceStatus(string url, [FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
|
||||||
|
string MsgId = "";
|
||||||
|
var result = new msgResHeader();
|
||||||
|
result.Code = "200";
|
||||||
|
result.Message = "";
|
||||||
|
|
||||||
|
int AID = -1;
|
||||||
|
string errorMessage = "";
|
||||||
|
if (jobj == null)
|
||||||
|
{
|
||||||
|
throw new Exception("参数格式不正确!");
|
||||||
|
}
|
||||||
|
int isError = 0;
|
||||||
|
string str = jobj.ToString();
|
||||||
|
publicCore.LogInsert("WorkFinsih", "Info", str);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//存储日志
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var param1 = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",url),
|
||||||
|
new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",str),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref param1, out DataTable dt, out errorMessage);
|
||||||
|
if (errorMessage != "")
|
||||||
|
{
|
||||||
|
throw new Exception("数据库存储过程【接口_IOT接口交互日志_请求记录】调用失败!");
|
||||||
|
}
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
// 解析订单内容,存储数据库,根据实际业务来写
|
||||||
|
IPC_DeviceStatus WorkFinsih = JsonConvert.DeserializeObject<IPC_DeviceStatus>(str);
|
||||||
|
string Location = WorkFinsih.Location;
|
||||||
|
MsgId = WorkFinsih.MsgId;
|
||||||
|
if (MsgId == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数MsgId为空!");
|
||||||
|
}
|
||||||
|
if (Location == "")
|
||||||
|
{
|
||||||
|
throw new Exception("参数Location为空!");
|
||||||
|
}
|
||||||
|
// 调用接口 发送当前工位 状态
|
||||||
|
MesWork.publicCore.SolveDeviceStatus_WebApi_Use(Location);
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",JsonConvert.SerializeObject(result))
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(dt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
result.Code = "500";
|
||||||
|
result.Message = err.Message;
|
||||||
|
result.MsgId = MsgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
string retString = JsonConvert.SerializeObject(result);
|
||||||
|
publicCore.LogInsert("WorkFinsih", "Info", "IPC-上下料完成AGV离开res:" + retString);
|
||||||
|
return retString;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// FSS-接收允许进入或离开
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Location"></param>
|
||||||
|
/// <param name="ResponseType"></param>
|
||||||
|
public static void ResponseEnterOrLeave(string Location, int ResponseType)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 创建父集合
|
||||||
|
FSS_ResponseEnterOrLeave responseEnterOrLeave = new FSS_ResponseEnterOrLeave();
|
||||||
|
// 将管控传递来的MsgId 返回回去
|
||||||
|
responseEnterOrLeave.MsgId = publicCore.FSSRequestMsgId; //UuidUtil();
|
||||||
|
if (publicCore.FSSRequestMsgId == "")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("ResponseEnterOrLeave", "Info", "接口【FSS-接收允许进入或离开】未获取到请求时的MsgId 已使用随机UUID 请确认请求是否有误:" );
|
||||||
|
responseEnterOrLeave.MsgId = UuidUtil();
|
||||||
|
}
|
||||||
|
responseEnterOrLeave.ResponseType = ResponseType;
|
||||||
|
responseEnterOrLeave.Location = Location;
|
||||||
|
responseEnterOrLeave.MsgSource = 1;
|
||||||
|
responseEnterOrLeave.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(responseEnterOrLeave);
|
||||||
|
publicCore.LogInsert("ResponseEnterOrLeave", "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.ResponseEnterOrLeaveUrl;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
// 清空FSS 请求MsgId
|
||||||
|
publicCore.FSSRequestMsgId = "";
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("ResponseEnterOrLeave", "Error", "接口【FSS-接收允许进入或离开】失败:" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert("ResponseEnterOrLeave", "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("ResponseEnterOrLeave", "Info", "接口【FSS-接收允许进入或离开】失败:"+ statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("ResponseEnterOrLeave", "Info", "接口【FSS-接收允许进入或离开】失败:" + err.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// FSS-接收IPC下料请求
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Location"></param>
|
||||||
|
/// <param name="ResponseType"></param>
|
||||||
|
public static void FinishCall(string Location)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 创建父集合
|
||||||
|
FSS_FinishCall finishCall = new FSS_FinishCall();
|
||||||
|
finishCall.MsgId = UuidUtil();
|
||||||
|
finishCall.Location = Location;
|
||||||
|
finishCall.MsgSource = 1;
|
||||||
|
finishCall.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(finishCall);
|
||||||
|
publicCore.LogInsert("FinishCall", "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.FinishCallUrl;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("FinishCall", "Error", "接口【FSS-接收IPC下料请求】失败:" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert("FinishCall", "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("FinishCall", "Error", "接口【FSS-接收IPC下料请求】失败:" + statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("FinishCall", "Error", "接口【FSS-接收IPC下料请求】失败:" + err.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// FSS-接收IPC状态变化
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Location"></param>
|
||||||
|
/// <param name="ResponseType"></param>
|
||||||
|
public static void DeviceStatus(string Location, int DeviceStatus)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 创建父集合
|
||||||
|
FSS_DeviceStatus deviceStatus = new FSS_DeviceStatus();
|
||||||
|
deviceStatus.MsgId = UuidUtil();
|
||||||
|
deviceStatus.Location = Location;
|
||||||
|
deviceStatus.DeviceStatus = DeviceStatus;
|
||||||
|
deviceStatus.MsgSource = 1;
|
||||||
|
deviceStatus.SendTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
//准备上传的数据 反序列化
|
||||||
|
string bodydata = JsonConvert.SerializeObject(deviceStatus);
|
||||||
|
publicCore.LogInsert("DeviceStatus", "Info", bodydata);
|
||||||
|
|
||||||
|
string urlstr = MesWorkForm.DeviceStatusUrl;
|
||||||
|
string retString;
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr);
|
||||||
|
request.Method = "post";
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(bodydata);
|
||||||
|
request.Accept = "*/*";
|
||||||
|
request.ContentType = "application/json;charset=utf-8";
|
||||||
|
|
||||||
|
// 反序列化后先把JSON做接口记录
|
||||||
|
//存储日志
|
||||||
|
int AID = -1;
|
||||||
|
var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
//Event_MOM_Log_Insert,@创建时间,@内容
|
||||||
|
var reqParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@接口地址",urlstr),
|
||||||
|
new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口
|
||||||
|
new SqlParameter("@请求内容",bodydata),
|
||||||
|
new SqlParameter("@请求时间",CreateTime)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", MesWorkForm.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage);
|
||||||
|
if (reqDt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
AID = Convert.ToInt32(reqDt.Rows[0]["AID"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.ContentLength = bytes.Length;
|
||||||
|
|
||||||
|
// 准备请求体
|
||||||
|
Stream myResponseStream = request.GetRequestStream();
|
||||||
|
myResponseStream.Write(bytes, 0, bytes.Length);
|
||||||
|
//发送webapi请求 等待相应
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
||||||
|
retString = myStreamReader.ReadToEnd();
|
||||||
|
|
||||||
|
//响应结果
|
||||||
|
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||||
|
var resParam = new SqlParameter[] {
|
||||||
|
new SqlParameter("@AID",AID),
|
||||||
|
new SqlParameter("@响应时间",CreateTime),
|
||||||
|
new SqlParameter("@响应内容",retString)
|
||||||
|
};
|
||||||
|
DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", MesWorkForm.ConnectionString, ref resParam, out errorMessage);
|
||||||
|
|
||||||
|
// 序列化响应内容
|
||||||
|
msgResHeader mrh = JsonConvert.DeserializeObject<msgResHeader>(retString);
|
||||||
|
int statusCode = (int)response.StatusCode;
|
||||||
|
// 对响应内容进行处理 更新数据库标志
|
||||||
|
if (statusCode == 200)
|
||||||
|
{
|
||||||
|
myStreamReader.Close();
|
||||||
|
myResponseStream.Close();
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
// 失败
|
||||||
|
if (mrh.Code != "200")
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("DeviceStatus", "Error", "接口【FSS-接收IPC状态变化】失败" + mrh.Message);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
publicCore.LogInsert("DeviceStatus", "Info", retString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("DeviceStatus", "Error", "接口【FSS-接收IPC状态变化】失败" + statusCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
publicCore.LogInsert("DeviceStatus", "Error", "接口【FSS-接收IPC状态变化】失败" + err.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
67
CCYQ_JieFang/webApi/Controller/FSSController.cs
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Http;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Runtime.Remoting.Messaging;
|
||||||
|
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
|
||||||
|
public class FSSController : ApiController
|
||||||
|
{
|
||||||
|
readonly string headUrl = "Project/";
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[Route("lx/ResponseEnterOrLeave")]
|
||||||
|
// FSS-接收允许进入或离开
|
||||||
|
public HttpResponseMessage ResponseEnterOrLeave([FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
|
||||||
|
var result = new msgResHeader();
|
||||||
|
result.Code = "200";
|
||||||
|
result.Message = "";
|
||||||
|
string retString = JsonConvert.SerializeObject(result);
|
||||||
|
return new HttpResponseMessage
|
||||||
|
{
|
||||||
|
Content = new StringContent(retString, Encoding.GetEncoding("UTF-8"), "application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[Route("lx/FinishCall")]
|
||||||
|
// FSS-接收IPC下料请求
|
||||||
|
public HttpResponseMessage FinishCall([FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
var result = new msgResHeader();
|
||||||
|
result.Code = "200";
|
||||||
|
result.Message = "";
|
||||||
|
string retString = JsonConvert.SerializeObject(result);
|
||||||
|
return new HttpResponseMessage
|
||||||
|
{
|
||||||
|
Content = new StringContent(retString, Encoding.GetEncoding("UTF-8"), "application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
[HttpPost]
|
||||||
|
[Route("lx/DeviceStatus")]
|
||||||
|
// FSS-接收IPC状态变化
|
||||||
|
public HttpResponseMessage DeviceStatus([FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
var result = new msgResHeader();
|
||||||
|
result.Code = "200";
|
||||||
|
result.Message = "";
|
||||||
|
string retString = JsonConvert.SerializeObject(result);
|
||||||
|
return new HttpResponseMessage
|
||||||
|
{
|
||||||
|
Content = new StringContent(retString, Encoding.GetEncoding("UTF-8"), "application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
78
CCYQ_JieFang/webApi/Controller/IpcController.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Http;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Runtime.Remoting.Messaging;
|
||||||
|
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
|
||||||
|
public class IpcController : ApiController
|
||||||
|
{
|
||||||
|
readonly string headUrl = "Project/";
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[Route("IPC/product")]
|
||||||
|
// IPC-接收装配信息
|
||||||
|
public HttpResponseMessage product([FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
return new HttpResponseMessage
|
||||||
|
{
|
||||||
|
Content = new StringContent(AnalysisMsg.product(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[Route("IPC/RequestEnterOrLeave")]
|
||||||
|
// IPC-设备可进入或可离开状态
|
||||||
|
public HttpResponseMessage RequestEnterOrLeave([FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
return new HttpResponseMessage
|
||||||
|
{
|
||||||
|
Content = new StringContent(AnalysisMsg.RequestEnterOrLeave(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
[HttpPost]
|
||||||
|
[Route("IPC/WorkFinsih")]
|
||||||
|
// IPC-上下料完成AGV离开
|
||||||
|
public HttpResponseMessage WorkFinsih([FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
return new HttpResponseMessage
|
||||||
|
{
|
||||||
|
Content = new StringContent(AnalysisMsg.WorkFinsih(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
[HttpPost]
|
||||||
|
[Route("IPC/DeviceStatus")]
|
||||||
|
// IPC-设备状态
|
||||||
|
public HttpResponseMessage DeviceStatus([FromBody] JObject jobj)
|
||||||
|
{
|
||||||
|
return new HttpResponseMessage
|
||||||
|
{
|
||||||
|
Content = new StringContent(AnalysisMsg.IPCDeviceStatus(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
[HttpGet]
|
||||||
|
[Route("getInfo")]
|
||||||
|
public HttpResponseMessage getInfo()
|
||||||
|
{
|
||||||
|
string pp = @"{\""Result\"":\""OK\""}";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
// GlobalVar.log.Error(err.Message);
|
||||||
|
}
|
||||||
|
return new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
126
CCYQ_JieFang/webApi/IPC_product.cs
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public class IPC_product
|
||||||
|
{
|
||||||
|
public string MsgId = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:IPC、2:FSS、3:AGV
|
||||||
|
/// </summary>
|
||||||
|
public int MsgSource = 0;
|
||||||
|
public string Location = "";
|
||||||
|
public List<IPC_product_AssemblyInformation> AssemblyInformation = new List<IPC_product_AssemblyInformation>();
|
||||||
|
public string SendTime = string.Empty;
|
||||||
|
}
|
||||||
|
public class IPC_product_AssemblyInformation
|
||||||
|
{
|
||||||
|
public string productNo = string.Empty;
|
||||||
|
public string productName = string.Empty;
|
||||||
|
public int productPosition = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class IPC_RequestEnterOrLeave
|
||||||
|
{
|
||||||
|
public string MsgId = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:IPC、2:FSS、3:AGV
|
||||||
|
/// </summary>
|
||||||
|
public int MsgSource = 0;
|
||||||
|
public string Location = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:查询是否可以进入
|
||||||
|
/// 2:查询是否可以离开
|
||||||
|
/// </summary>
|
||||||
|
public int RequestType = 0;
|
||||||
|
public string SendTime = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class IPC_WorkFinsih
|
||||||
|
{
|
||||||
|
public string MsgId = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:IPC、2:FSS、3:AGV
|
||||||
|
/// </summary>
|
||||||
|
public int MsgSource = 0;
|
||||||
|
public string Location = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:上料完成离开
|
||||||
|
/// 2:下料完成离开
|
||||||
|
/// </summary>
|
||||||
|
public int FinishType = 0;
|
||||||
|
public string SendTime = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IPC提供WEBAPI接口,接收FSS发过来的请求设备状态 会调用FSS接口放回指定工位状态
|
||||||
|
/// </summary>
|
||||||
|
public class IPC_DeviceStatus
|
||||||
|
{
|
||||||
|
public string MsgId = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:IPC、2:FSS、3:AGV
|
||||||
|
/// </summary>
|
||||||
|
public int MsgSource = 0;
|
||||||
|
public string Location = "";
|
||||||
|
public string SendTime = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// FSS提供WEBAPI接口,接收IPC发过来的AGV可进入或离开设备的接口
|
||||||
|
/// </summary>
|
||||||
|
public class FSS_ResponseEnterOrLeave
|
||||||
|
{
|
||||||
|
public string MsgId = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:IPC、2:FSS、3:AGV
|
||||||
|
/// </summary>
|
||||||
|
public int MsgSource = 0;
|
||||||
|
public string Location = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:可以进入
|
||||||
|
/// 2:可以离开
|
||||||
|
/// </summary>
|
||||||
|
public int ResponseType = 0;
|
||||||
|
public string SendTime = string.Empty;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// FSS提供WEBAPI接口,接收IPC发过来的请求下料接口
|
||||||
|
/// </summary>
|
||||||
|
public class FSS_FinishCall
|
||||||
|
{
|
||||||
|
public string MsgId = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:IPC、2:FSS、3:AGV
|
||||||
|
/// </summary>
|
||||||
|
public int MsgSource = 0;
|
||||||
|
public string Location = "";
|
||||||
|
public string SendTime = string.Empty;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// FSS提供WEBAPI接口,接收IPC发过来的设备状态信息
|
||||||
|
/// </summary>
|
||||||
|
public class FSS_DeviceStatus
|
||||||
|
{
|
||||||
|
public string MsgId = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:IPC、2:FSS、3:AGV
|
||||||
|
/// </summary>
|
||||||
|
public int MsgSource = 0;
|
||||||
|
public string Location = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 1:运行(既不可以上料也不可以下料)
|
||||||
|
/// 2:空闲(可以上料)
|
||||||
|
/// 3:完成(可以下料)
|
||||||
|
/// 4:报警(设备报警)
|
||||||
|
/// </summary>
|
||||||
|
public int DeviceStatus = 0;
|
||||||
|
public string SendTime = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
68
CCYQ_JieFang/webApi/InitServer.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Formatting;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Web.Http;
|
||||||
|
using System.Web.Http.Cors;
|
||||||
|
using System.Web.Http.SelfHost;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public class InitServer
|
||||||
|
{
|
||||||
|
HttpSelfHostConfiguration config = null;
|
||||||
|
HttpSelfHostServer server = null;
|
||||||
|
public InitServer(string Url_WebApi)
|
||||||
|
{
|
||||||
|
// var Url_WebApi = System.Configuration.ConfigurationManager.AppSettings["Url_WebApi"];
|
||||||
|
Init(Url_WebApi);
|
||||||
|
}
|
||||||
|
public void Init(string url)
|
||||||
|
{
|
||||||
|
config = new HttpSelfHostConfiguration(url);
|
||||||
|
|
||||||
|
// 启用跨域
|
||||||
|
config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
|
||||||
|
// 启用特性路由
|
||||||
|
config.MapHttpAttributeRoutes();
|
||||||
|
|
||||||
|
//config.Routes.MapHttpRoute(
|
||||||
|
// name: "DefaultApi",
|
||||||
|
// routeTemplate: "api/{controller}/{id}",
|
||||||
|
// defaults: new { id = RouteParameter.Optional }
|
||||||
|
//);
|
||||||
|
|
||||||
|
// 自定义路由匹配到action
|
||||||
|
config.Routes.MapHttpRoute(
|
||||||
|
name: "API Default",
|
||||||
|
routeTemplate: "api/{controller}/{action}/{id}",
|
||||||
|
defaults: new { id = RouteParameter.Optional }
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
server = new HttpSelfHostServer(config);
|
||||||
|
|
||||||
|
server.OpenAsync().Wait();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
public class JsonContentNegotiator : IContentNegotiator
|
||||||
|
{
|
||||||
|
private readonly JsonMediaTypeFormatter _jsonFormatter;
|
||||||
|
|
||||||
|
public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
|
||||||
|
{
|
||||||
|
_jsonFormatter = formatter;
|
||||||
|
}
|
||||||
|
public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
|
||||||
|
{
|
||||||
|
var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json"));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
CCYQ_JieFang/webApi/msgResHeader.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MesWork
|
||||||
|
{
|
||||||
|
public class msgResHeader
|
||||||
|
{
|
||||||
|
public string Code = string.Empty;
|
||||||
|
public string Message = string.Empty;
|
||||||
|
public string MsgId = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
CCYQ_JieFang/任务管理.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
62
CallWebApi/03_CallWebApi.csproj
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?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>{727A1B50-D83A-4319-BDF6-E923F4BD41B3}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>CallWebApi</RootNamespace>
|
||||||
|
<AssemblyName>CallWebApi</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</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="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</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="CallWebApi.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<WCFMetadata Include="Connected Services\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
57
CallWebApi/App.config
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<appSettings>
|
||||||
|
|
||||||
|
<!--<add key="MqttUrl" value="124.220.32.217:1883,MES/InstantMessaging/MisServer" />-->
|
||||||
|
<add key="MqttUrl" value="124.220.15.242:1883,MES/InstantMessaging/SY/MisServer"/>
|
||||||
|
<add key="MqttTargetTopic" value="MES/InstantMessaging/SY"/>
|
||||||
|
<add key="MqttTargetTopicPLC" value="MES/InstantMessaging/SY/MisServer"/>
|
||||||
|
<add key="MqttTargetTopicTagTypeCodeID" value="MES/TagTypeCodeID"/>
|
||||||
|
<add key="Url_WebApi" value="http://localhost:41186"/>
|
||||||
|
|
||||||
|
<add key="ConnectionString_MES" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
|
||||||
|
<!-- ERP数据库连接-->
|
||||||
|
<add key="ConnectionString_ERP" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
<!-- 订单查询脚本-->
|
||||||
|
<add key="ConnectionString_ERP_Sql_OrderForm" value="select a.fbillno'工单号',a.FID '工单内码',b.FENTRYID '工单分录',bt.FNAME '单据类型',a.fdate '单据日期',org.fname '生产组织',m.FNUMBER '物料代码',m1.FNAME '物料名称',m1.FSPECIFICATION '规格型号',de.FNAME '生产车间',un.FNAME '单位',FBASEUNITQTY '数量',bom.FNUMBER 'BOM版本',b1.FSTATUS '业务状态',b.FPLANSTARTDATE '计划开工时间',b.FPLANFINISHDATE '计划完工时间',
|
||||||
|
b1.FSTARTDATE '开工时间',b1.FFINISHDATE'完工时间',b1.FREPQUAQTY '基本单位汇报合格数量',b1.FREPQUAAUXQTY '单据单位汇报合格数量 ',b1.FBASERPTFINISHQTY '基本单位汇报完成数量',b1.FRPTFINISHQTY'单据单位汇报完成数量' ,b2.FREMWORKSHOPID '产线'
|
||||||
|
from T_PRD_MO a
|
||||||
|
left join T_PRD_MOENTRY b on a.fid=b.fid --生产订单表体
|
||||||
|
left join T_PRD_MOENTRY_A b1 on b.FID=b1.FID and b.FENTRYID=b1.FENTRYID --生产订单表体
|
||||||
|
LEFT join T_PRD_MOENTRY_Q b2 on b.FID=b2.FID and b.FENTRYID=b2.FENTRYID --生产订单明细数量表
|
||||||
|
left join T_ORG_ORGANIZATIONS_L org on org.FORGID=a.FPRDORGID --组织
|
||||||
|
left join T_BD_MATERIAL m on m.FMATERIALID=b.FMATERIALID --生产订单表体物料信息
|
||||||
|
left join T_BD_MATERIAL_L m1 on m.FMATERIALID=m1.FMATERIALID
|
||||||
|
left join T_BD_DEPARTMENT_L de on de.FDEPTID=b.FWORKSHOPID --部门:生产车间
|
||||||
|
left join T_BD_UNIT_L un on un.FUNITID=b.FBASEUNITID --单位表
|
||||||
|
left join T_ENG_BOM bom on bom.FID=b.FBOMID --BOM信息
|
||||||
|
left join T_BAS_BILLTYPE_L bt on bt.FBILLTYPEID=a.FBILLTYPE and bt.FLOCALEID=2052--单据类型"/>
|
||||||
|
<!-- 配送物料查询脚本-->
|
||||||
|
<add key="ConnectionString_ERP_Sql_DistributeMaterials" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
<!-- 补充物料查询脚本-->
|
||||||
|
<add key="ConnectionString_ERP_Sql_SupplementaryMaterials" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
|
||||||
|
<add key="ConnectionString_MES0" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
<add key="ConnectionString_MES1" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
<add key="ConnectionString_MES2" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
<add key="ConnectionString_MES3" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
<add key="ConnectionString_MES4" value="server=124.220.15.242\MSSQLSERVER2012,1433;User ID=meswork;Password=126.com;database=MacroinfBasicDB_SY;Connection Reset=FALSE"/>
|
||||||
|
<add key="OPName01" value="OP1010|1"/>
|
||||||
|
<add key="OPName02" value="OP0050|2"/>
|
||||||
|
<!--扫描枪COM口-->
|
||||||
|
<add key="PortName" value="COM1"/>
|
||||||
|
<!--读超时,即在1000内未读到数据就引起超时异常-->
|
||||||
|
<add key="ReadTimeout" value="1000"/>
|
||||||
|
<!--比特率-->
|
||||||
|
<add key="BaudRate" value="115200"/>
|
||||||
|
<!--祛除后尾乱码-->
|
||||||
|
<add key="ScannerTrim" value="1"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</appSettings>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
205
CallWebApi/CallWebApi.cs
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CallWebApi
|
||||||
|
{
|
||||||
|
public class Post
|
||||||
|
{
|
||||||
|
public static string Postring(string url, Dictionary<string, string> dic)
|
||||||
|
{
|
||||||
|
string result = "";
|
||||||
|
//url = "http://172.16.22.15:8000/" + url;
|
||||||
|
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
req.Method = "POST";
|
||||||
|
req.ContentType = "application/x-www-form-urlencoded";
|
||||||
|
req.Proxy = null;
|
||||||
|
|
||||||
|
req.KeepAlive = false;
|
||||||
|
|
||||||
|
#region 添加Post 参数
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
int i = 0;
|
||||||
|
foreach (var item in dic)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
builder.Append("&");
|
||||||
|
builder.AppendFormat("{0}={1}", item.Key, item.Value);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
byte[] data = Encoding.UTF8.GetBytes(builder.ToString());
|
||||||
|
req.ContentLength = data.Length;
|
||||||
|
using (Stream reqStream = req.GetRequestStream())
|
||||||
|
{
|
||||||
|
reqStream.Write(data, 0, data.Length);
|
||||||
|
reqStream.Close();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
||||||
|
Stream stream = resp.GetResponseStream();
|
||||||
|
|
||||||
|
//获取响应内容
|
||||||
|
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
|
||||||
|
{
|
||||||
|
result = reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Postring1(string url, string token, Dictionary<string, string> dic)
|
||||||
|
{
|
||||||
|
string results = "";
|
||||||
|
//url = "http://172.16.22.15:8000/" + url;
|
||||||
|
|
||||||
|
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
req.Method = "POST";
|
||||||
|
req.ContentType = "application/x-www-form-urlencoded";
|
||||||
|
req.Headers.Add("Authorization", "Bearer " + token);
|
||||||
|
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
int i = 0;
|
||||||
|
foreach (var item in dic)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
builder.Append("&");
|
||||||
|
builder.AppendFormat("{0}={1}", item.Key, item.Value);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
byte[] data = Encoding.UTF8.GetBytes(builder.ToString());
|
||||||
|
req.ContentLength = data.Length;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (Stream reqStream = req.GetRequestStream())
|
||||||
|
{
|
||||||
|
reqStream.Write(data, 0, data.Length);
|
||||||
|
reqStream.Close();
|
||||||
|
}
|
||||||
|
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
||||||
|
Stream stream = resp.GetResponseStream();
|
||||||
|
//获取响应内容
|
||||||
|
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
|
||||||
|
{
|
||||||
|
results = reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
return e.Message;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static string MyPost()
|
||||||
|
{
|
||||||
|
// var url = "http://192.168.1.224:41190/";
|
||||||
|
var url = "http://127.0.0.1:41190/";
|
||||||
|
var controller = "ZSaveTag";
|
||||||
|
var action = "SelectPage";
|
||||||
|
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||||
|
dict.Add("OpName","");
|
||||||
|
dict.Add("StartTime", "2022-06-24 00:00:00");
|
||||||
|
dict.Add("EndTime", "2022-06-30 00:00:00");
|
||||||
|
dict.Add("PageCurrent", "1");
|
||||||
|
dict.Add("PageSize", "2");
|
||||||
|
|
||||||
|
|
||||||
|
var reqUrl = url + "/api/" + controller + "/" + action;
|
||||||
|
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(reqUrl);
|
||||||
|
req.Method = "POST";
|
||||||
|
req.ContentType = "application/json";
|
||||||
|
req.Proxy = null;
|
||||||
|
|
||||||
|
req.KeepAlive = false;
|
||||||
|
|
||||||
|
#region 添加Post 参数
|
||||||
|
JObject jObject = new JObject();
|
||||||
|
jObject.Add("OpName", "");
|
||||||
|
jObject.Add("StartTime", "2022-06-24 00:00:00");
|
||||||
|
jObject.Add("EndTime", "2022-06-30 00:00:00");
|
||||||
|
jObject.Add("PageCurrent", "2");
|
||||||
|
jObject.Add("PageSize", "3");
|
||||||
|
var jStr = jObject.ToString();
|
||||||
|
|
||||||
|
//StringBuilder builder = new StringBuilder();
|
||||||
|
//int i = 0;
|
||||||
|
//foreach (var item in dict)
|
||||||
|
//{
|
||||||
|
// if (i > 0)
|
||||||
|
// builder.Append("&");
|
||||||
|
// builder.AppendFormat("{0}={1}", item.Key, item.Value);
|
||||||
|
// i++;
|
||||||
|
//}
|
||||||
|
//byte[] data = Encoding.UTF8.GetBytes(builder.ToString());
|
||||||
|
byte[] data = Encoding.UTF8.GetBytes(jStr);
|
||||||
|
req.ContentLength = data.Length;
|
||||||
|
using (Stream reqStream = req.GetRequestStream())
|
||||||
|
{
|
||||||
|
reqStream.Write(data, 0, data.Length);
|
||||||
|
reqStream.Close();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
||||||
|
Stream stream = resp.GetResponseStream();
|
||||||
|
|
||||||
|
string result = "";
|
||||||
|
|
||||||
|
//获取响应内容
|
||||||
|
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
|
||||||
|
{
|
||||||
|
result = reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string MyPost(string url,string jsonStr)
|
||||||
|
{
|
||||||
|
string result = "";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||||
|
req.Method = "POST";
|
||||||
|
req.ContentType = "application/json";
|
||||||
|
req.Proxy = null;
|
||||||
|
req.KeepAlive = false;
|
||||||
|
|
||||||
|
byte[] data = Encoding.UTF8.GetBytes(jsonStr);
|
||||||
|
req.ContentLength = data.Length;
|
||||||
|
using (Stream reqStream = req.GetRequestStream())
|
||||||
|
{
|
||||||
|
reqStream.Write(data, 0, data.Length);
|
||||||
|
reqStream.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
||||||
|
Stream stream = resp.GetResponseStream();
|
||||||
|
|
||||||
|
|
||||||
|
//获取响应内容
|
||||||
|
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
|
||||||
|
{
|
||||||
|
result = reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
Console.WriteLine(result);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
Console.WriteLine("<Error> " + err.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
32
CallWebApi/Program.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CallWebApi
|
||||||
|
{
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Post.MyPost();
|
||||||
|
|
||||||
|
var url = "http://localhost:41190/api/ZSaveTag/SelectPage";
|
||||||
|
|
||||||
|
JObject jObject = new JObject();
|
||||||
|
jObject.Add("OpName", "");
|
||||||
|
jObject.Add("StartTime", "2022-06-24 00:00:00");
|
||||||
|
jObject.Add("EndTime", "2022-06-30 00:00:00");
|
||||||
|
jObject.Add("PageCurrent", "2");
|
||||||
|
jObject.Add("PageSize", "3");
|
||||||
|
var jStr = jObject.ToString();
|
||||||
|
|
||||||
|
Post.MyPost(url, jStr);
|
||||||
|
|
||||||
|
Console.ReadKey();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
CallWebApi/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("CallWebApi")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("CallWebApi")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("727a1b50-d83a-4319-bdf6-e923f4bd41b3")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
4
CallWebApi/packages.config
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />
|
||||||
|
</packages>
|
||||||
43
DK_DC_Tool/.gitignore
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
*.pyc
|
||||||
|
*.map
|
||||||
|
*.dblite
|
||||||
|
*.elf
|
||||||
|
*.bin
|
||||||
|
*.hex
|
||||||
|
*.axf
|
||||||
|
*.exe
|
||||||
|
*.pdb
|
||||||
|
*.idb
|
||||||
|
*.ilk
|
||||||
|
*.old
|
||||||
|
build
|
||||||
|
bin
|
||||||
|
obj
|
||||||
|
Debug
|
||||||
|
documentation/html
|
||||||
|
*~
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.out
|
||||||
|
*.bak
|
||||||
|
*.dep
|
||||||
|
*.lib
|
||||||
|
*.i
|
||||||
|
*.d
|
||||||
|
.DS_Stor*
|
||||||
|
.config 3
|
||||||
|
.config 4
|
||||||
|
.config 5
|
||||||
|
Midea-X1
|
||||||
|
*.uimg
|
||||||
|
GPATH
|
||||||
|
GRTAGS
|
||||||
|
GTAGS
|
||||||
|
.vscode
|
||||||
|
JLinkLog.txt
|
||||||
|
JLinkSettings.ini
|
||||||
|
DebugConfig/
|
||||||
|
RTE/
|
||||||
|
settings/
|
||||||
|
*.uvguix*
|
||||||
|
cconfig.h
|
||||||
53
DK_DC_Tool/App.config
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
|
||||||
|
</configSections>
|
||||||
|
<!--站点日志配置部分-->
|
||||||
|
<log4net>
|
||||||
|
<root>
|
||||||
|
<!--控制级别,由低到高: ALL|DEBUG|INFO|WARN|ERROR|FATAL|OFF-->
|
||||||
|
<!--比如定义级别为INFO,则INFO级别向下的级别,比如DEBUG日志将不会被记录-->
|
||||||
|
<!--如果没有定义LEVEL的值,则缺省为DEBUG-->
|
||||||
|
<level value="ALL"/>
|
||||||
|
<appender-ref ref="RollingFileAppender"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
|
||||||
|
<remoteAddress value="127.0.0.1"/>
|
||||||
|
<remotePort value="7171"/>
|
||||||
|
<param name="Encoding" value="utf-8"/>
|
||||||
|
<layout type="log4net.Layout.PatternLayout" value="<log level="%level" app="mlw" thread="%thread" time="%date" logger="%logger"><![CDATA[%message%exception]]></log>"/>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
|
||||||
|
<!--日志文件名开头-->
|
||||||
|
<file value="Log\\Log4net.txt"/>
|
||||||
|
<!--多线程时采用最小锁定-->
|
||||||
|
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
|
||||||
|
<!--日期的格式,每天换一个文件记录,如不设置则永远只记录一天的日志,需设置-->
|
||||||
|
<datePattern value="(yyyyMMdd)"/>
|
||||||
|
<!--是否追加到文件,默认为true,通常无需设置-->
|
||||||
|
<appendToFile value="true"/>
|
||||||
|
<!--变换的形式为日期,这种情况下每天只有一个日志-->
|
||||||
|
<!--此时MaxSizeRollBackups和maximumFileSize的节点设置没有意义-->
|
||||||
|
<!--<rollingStyle value="Date"/>-->
|
||||||
|
<!--变换的形式为日志大小-->
|
||||||
|
<!--这种情况下MaxSizeRollBackups和maximumFileSize的节点设置才有意义-->
|
||||||
|
<RollingStyle value="Size"/>
|
||||||
|
<!--每天记录的日志文件个数,与maximumFileSize配合使用-->
|
||||||
|
<MaxSizeRollBackups value="10"/>
|
||||||
|
<!--每个日志文件的最大大小-->
|
||||||
|
<!--可用的单位:KB|MB|GB-->
|
||||||
|
<!--不要使用小数,否则会一直写入当前日志-->
|
||||||
|
<maximumFileSize value="100MB"/>
|
||||||
|
<!--日志格式-->
|
||||||
|
<layout type="log4net.Layout.PatternLayout">
|
||||||
|
<conversionPattern value="%date [%t]%p: %m%n"/>
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
</log4net>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
104
DK_DC_Tool/DK_DC_Tool.csproj
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
<?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>{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>DK_DC_Tool</RootNamespace>
|
||||||
|
<AssemblyName>DK_DC_Tool</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</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="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Design" />
|
||||||
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Xaml" />
|
||||||
|
<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" />
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Tighten.cs" />
|
||||||
|
<Compile Include="ToolPacket.cs" />
|
||||||
|
<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>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<WCFMetadata Include="Connected Services\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\MyLog4Net\01_MyLog4Net.csproj">
|
||||||
|
<Project>{1dc48c83-1842-4de8-acaf-26e1e7f7c58f}</Project>
|
||||||
|
<Name>01_MyLog4Net</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
25
DK_DC_Tool/DK_DC_Tool.sln
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.31919.166
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DK_DC_Tool", "DK_DC_Tool.csproj", "{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3C6FEF50-2014-4157-A12B-93FB4AD20FE7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {1894CA72-2F06-434D-A73A-03E306A66BA2}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
483
DK_DC_Tool/Form1.Designer.cs
generated
Normal file
@@ -0,0 +1,483 @@
|
|||||||
|
namespace DK_DC_Tool
|
||||||
|
{
|
||||||
|
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.label6 = new System.Windows.Forms.Label();
|
||||||
|
this.cbxDevType = new System.Windows.Forms.ComboBox();
|
||||||
|
this.btnOpen = new System.Windows.Forms.Button();
|
||||||
|
this.gbxSerial = new System.Windows.Forms.GroupBox();
|
||||||
|
this.tbxSerialProtocol = new System.Windows.Forms.TextBox();
|
||||||
|
this.label10 = new System.Windows.Forms.Label();
|
||||||
|
this.tbxSerialAddr = new System.Windows.Forms.TextBox();
|
||||||
|
this.label9 = new System.Windows.Forms.Label();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.cbxSerial = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.cbxSerialCheckSum = new System.Windows.Forms.ComboBox();
|
||||||
|
this.cbxSerialBaud = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.cbxSerialStopBit = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.cbxSerialDataBit = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label8 = new System.Windows.Forms.Label();
|
||||||
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
|
this.tbxTcpDestIP = new System.Windows.Forms.TextBox();
|
||||||
|
this.tbxTcpDestPort = new System.Windows.Forms.TextBox();
|
||||||
|
this.gbxTcp = new System.Windows.Forms.GroupBox();
|
||||||
|
this.gbxProtocol = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnProtocolSend = new System.Windows.Forms.Button();
|
||||||
|
this.tbxProtocolData = new System.Windows.Forms.TextBox();
|
||||||
|
this.label13 = new System.Windows.Forms.Label();
|
||||||
|
this.tbxProtocolMID = new System.Windows.Forms.TextBox();
|
||||||
|
this.label12 = new System.Windows.Forms.Label();
|
||||||
|
this.cbxProtocolOp = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label11 = new System.Windows.Forms.Label();
|
||||||
|
this.tbxProtocolDebug = new System.Windows.Forms.TextBox();
|
||||||
|
this.btnClear = new System.Windows.Forms.Button();
|
||||||
|
this.gbxSerial.SuspendLayout();
|
||||||
|
this.gbxTcp.SuspendLayout();
|
||||||
|
this.gbxProtocol.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
this.label6.AutoSize = true;
|
||||||
|
this.label6.Location = new System.Drawing.Point(30, 21);
|
||||||
|
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label6.Name = "label6";
|
||||||
|
this.label6.Size = new System.Drawing.Size(62, 18);
|
||||||
|
this.label6.TabIndex = 10;
|
||||||
|
this.label6.Text = "类型:";
|
||||||
|
//
|
||||||
|
// cbxDevType
|
||||||
|
//
|
||||||
|
this.cbxDevType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbxDevType.FormattingEnabled = true;
|
||||||
|
this.cbxDevType.Location = new System.Drawing.Point(118, 16);
|
||||||
|
this.cbxDevType.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.cbxDevType.Name = "cbxDevType";
|
||||||
|
this.cbxDevType.Size = new System.Drawing.Size(130, 26);
|
||||||
|
this.cbxDevType.TabIndex = 11;
|
||||||
|
this.cbxDevType.SelectedIndexChanged += new System.EventHandler(this.cbxDevType_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// btnOpen
|
||||||
|
//
|
||||||
|
this.btnOpen.Location = new System.Drawing.Point(418, 12);
|
||||||
|
this.btnOpen.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.btnOpen.Name = "btnOpen";
|
||||||
|
this.btnOpen.Size = new System.Drawing.Size(142, 42);
|
||||||
|
this.btnOpen.TabIndex = 13;
|
||||||
|
this.btnOpen.Text = "打开";
|
||||||
|
this.btnOpen.UseVisualStyleBackColor = true;
|
||||||
|
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
|
||||||
|
//
|
||||||
|
// gbxSerial
|
||||||
|
//
|
||||||
|
this.gbxSerial.Controls.Add(this.tbxSerialProtocol);
|
||||||
|
this.gbxSerial.Controls.Add(this.label10);
|
||||||
|
this.gbxSerial.Controls.Add(this.tbxSerialAddr);
|
||||||
|
this.gbxSerial.Controls.Add(this.label9);
|
||||||
|
this.gbxSerial.Controls.Add(this.label1);
|
||||||
|
this.gbxSerial.Controls.Add(this.cbxSerial);
|
||||||
|
this.gbxSerial.Controls.Add(this.label2);
|
||||||
|
this.gbxSerial.Controls.Add(this.cbxSerialCheckSum);
|
||||||
|
this.gbxSerial.Controls.Add(this.cbxSerialBaud);
|
||||||
|
this.gbxSerial.Controls.Add(this.label5);
|
||||||
|
this.gbxSerial.Controls.Add(this.label3);
|
||||||
|
this.gbxSerial.Controls.Add(this.cbxSerialStopBit);
|
||||||
|
this.gbxSerial.Controls.Add(this.label4);
|
||||||
|
this.gbxSerial.Controls.Add(this.cbxSerialDataBit);
|
||||||
|
this.gbxSerial.Location = new System.Drawing.Point(638, 96);
|
||||||
|
this.gbxSerial.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.gbxSerial.Name = "gbxSerial";
|
||||||
|
this.gbxSerial.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.gbxSerial.Size = new System.Drawing.Size(548, 218);
|
||||||
|
this.gbxSerial.TabIndex = 16;
|
||||||
|
this.gbxSerial.TabStop = false;
|
||||||
|
//
|
||||||
|
// tbxSerialProtocol
|
||||||
|
//
|
||||||
|
this.tbxSerialProtocol.Location = new System.Drawing.Point(400, 120);
|
||||||
|
this.tbxSerialProtocol.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.tbxSerialProtocol.Name = "tbxSerialProtocol";
|
||||||
|
this.tbxSerialProtocol.Size = new System.Drawing.Size(130, 28);
|
||||||
|
this.tbxSerialProtocol.TabIndex = 19;
|
||||||
|
//
|
||||||
|
// label10
|
||||||
|
//
|
||||||
|
this.label10.AutoSize = true;
|
||||||
|
this.label10.Location = new System.Drawing.Point(294, 124);
|
||||||
|
this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label10.Name = "label10";
|
||||||
|
this.label10.Size = new System.Drawing.Size(98, 18);
|
||||||
|
this.label10.TabIndex = 18;
|
||||||
|
this.label10.Text = "协议类型:";
|
||||||
|
//
|
||||||
|
// tbxSerialAddr
|
||||||
|
//
|
||||||
|
this.tbxSerialAddr.Location = new System.Drawing.Point(400, 70);
|
||||||
|
this.tbxSerialAddr.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.tbxSerialAddr.Name = "tbxSerialAddr";
|
||||||
|
this.tbxSerialAddr.Size = new System.Drawing.Size(130, 28);
|
||||||
|
this.tbxSerialAddr.TabIndex = 17;
|
||||||
|
//
|
||||||
|
// label9
|
||||||
|
//
|
||||||
|
this.label9.AutoSize = true;
|
||||||
|
this.label9.Location = new System.Drawing.Point(294, 76);
|
||||||
|
this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label9.Name = "label9";
|
||||||
|
this.label9.Size = new System.Drawing.Size(62, 18);
|
||||||
|
this.label9.TabIndex = 10;
|
||||||
|
this.label9.Text = "地址:";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(12, 26);
|
||||||
|
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(80, 18);
|
||||||
|
this.label1.TabIndex = 0;
|
||||||
|
this.label1.Text = "串口号:";
|
||||||
|
//
|
||||||
|
// cbxSerial
|
||||||
|
//
|
||||||
|
this.cbxSerial.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbxSerial.FormattingEnabled = true;
|
||||||
|
this.cbxSerial.Location = new System.Drawing.Point(100, 21);
|
||||||
|
this.cbxSerial.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.cbxSerial.Name = "cbxSerial";
|
||||||
|
this.cbxSerial.Size = new System.Drawing.Size(130, 26);
|
||||||
|
this.cbxSerial.TabIndex = 1;
|
||||||
|
this.cbxSerial.DropDown += new System.EventHandler(this.cbxSerial_DropDown);
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(12, 76);
|
||||||
|
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(80, 18);
|
||||||
|
this.label2.TabIndex = 2;
|
||||||
|
this.label2.Text = "波特率:";
|
||||||
|
//
|
||||||
|
// cbxSerialCheckSum
|
||||||
|
//
|
||||||
|
this.cbxSerialCheckSum.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbxSerialCheckSum.FormattingEnabled = true;
|
||||||
|
this.cbxSerialCheckSum.Location = new System.Drawing.Point(400, 21);
|
||||||
|
this.cbxSerialCheckSum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.cbxSerialCheckSum.Name = "cbxSerialCheckSum";
|
||||||
|
this.cbxSerialCheckSum.Size = new System.Drawing.Size(130, 26);
|
||||||
|
this.cbxSerialCheckSum.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// cbxSerialBaud
|
||||||
|
//
|
||||||
|
this.cbxSerialBaud.FormattingEnabled = true;
|
||||||
|
this.cbxSerialBaud.Location = new System.Drawing.Point(100, 72);
|
||||||
|
this.cbxSerialBaud.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.cbxSerialBaud.Name = "cbxSerialBaud";
|
||||||
|
this.cbxSerialBaud.Size = new System.Drawing.Size(130, 26);
|
||||||
|
this.cbxSerialBaud.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(294, 26);
|
||||||
|
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(98, 18);
|
||||||
|
this.label5.TabIndex = 8;
|
||||||
|
this.label5.Text = "校验格式:";
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(12, 124);
|
||||||
|
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(80, 18);
|
||||||
|
this.label3.TabIndex = 4;
|
||||||
|
this.label3.Text = "数据位:";
|
||||||
|
//
|
||||||
|
// cbxSerialStopBit
|
||||||
|
//
|
||||||
|
this.cbxSerialStopBit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbxSerialStopBit.FormattingEnabled = true;
|
||||||
|
this.cbxSerialStopBit.Location = new System.Drawing.Point(100, 171);
|
||||||
|
this.cbxSerialStopBit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.cbxSerialStopBit.Name = "cbxSerialStopBit";
|
||||||
|
this.cbxSerialStopBit.Size = new System.Drawing.Size(130, 26);
|
||||||
|
this.cbxSerialStopBit.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(12, 176);
|
||||||
|
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(80, 18);
|
||||||
|
this.label4.TabIndex = 5;
|
||||||
|
this.label4.Text = "停止位:";
|
||||||
|
//
|
||||||
|
// cbxSerialDataBit
|
||||||
|
//
|
||||||
|
this.cbxSerialDataBit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbxSerialDataBit.FormattingEnabled = true;
|
||||||
|
this.cbxSerialDataBit.Location = new System.Drawing.Point(100, 120);
|
||||||
|
this.cbxSerialDataBit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.cbxSerialDataBit.Name = "cbxSerialDataBit";
|
||||||
|
this.cbxSerialDataBit.Size = new System.Drawing.Size(130, 26);
|
||||||
|
this.cbxSerialDataBit.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// label8
|
||||||
|
//
|
||||||
|
this.label8.AutoSize = true;
|
||||||
|
this.label8.Location = new System.Drawing.Point(9, 153);
|
||||||
|
this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label8.Name = "label8";
|
||||||
|
this.label8.Size = new System.Drawing.Size(80, 18);
|
||||||
|
this.label8.TabIndex = 2;
|
||||||
|
this.label8.Text = "端口号:";
|
||||||
|
//
|
||||||
|
// label7
|
||||||
|
//
|
||||||
|
this.label7.AutoSize = true;
|
||||||
|
this.label7.Location = new System.Drawing.Point(9, 51);
|
||||||
|
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label7.Name = "label7";
|
||||||
|
this.label7.Size = new System.Drawing.Size(80, 18);
|
||||||
|
this.label7.TabIndex = 0;
|
||||||
|
this.label7.Text = "IP地址:";
|
||||||
|
//
|
||||||
|
// tbxTcpDestIP
|
||||||
|
//
|
||||||
|
this.tbxTcpDestIP.Location = new System.Drawing.Point(98, 46);
|
||||||
|
this.tbxTcpDestIP.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.tbxTcpDestIP.Name = "tbxTcpDestIP";
|
||||||
|
this.tbxTcpDestIP.Size = new System.Drawing.Size(148, 28);
|
||||||
|
this.tbxTcpDestIP.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// tbxTcpDestPort
|
||||||
|
//
|
||||||
|
this.tbxTcpDestPort.Location = new System.Drawing.Point(98, 148);
|
||||||
|
this.tbxTcpDestPort.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.tbxTcpDestPort.Name = "tbxTcpDestPort";
|
||||||
|
this.tbxTcpDestPort.Size = new System.Drawing.Size(148, 28);
|
||||||
|
this.tbxTcpDestPort.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// gbxTcp
|
||||||
|
//
|
||||||
|
this.gbxTcp.Controls.Add(this.tbxTcpDestPort);
|
||||||
|
this.gbxTcp.Controls.Add(this.tbxTcpDestIP);
|
||||||
|
this.gbxTcp.Controls.Add(this.label7);
|
||||||
|
this.gbxTcp.Controls.Add(this.label8);
|
||||||
|
this.gbxTcp.Location = new System.Drawing.Point(18, 76);
|
||||||
|
this.gbxTcp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.gbxTcp.Name = "gbxTcp";
|
||||||
|
this.gbxTcp.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.gbxTcp.Size = new System.Drawing.Size(548, 218);
|
||||||
|
this.gbxTcp.TabIndex = 15;
|
||||||
|
this.gbxTcp.TabStop = false;
|
||||||
|
//
|
||||||
|
// gbxProtocol
|
||||||
|
//
|
||||||
|
this.gbxProtocol.Controls.Add(this.btnProtocolSend);
|
||||||
|
this.gbxProtocol.Controls.Add(this.tbxProtocolData);
|
||||||
|
this.gbxProtocol.Controls.Add(this.label13);
|
||||||
|
this.gbxProtocol.Controls.Add(this.tbxProtocolMID);
|
||||||
|
this.gbxProtocol.Controls.Add(this.label12);
|
||||||
|
this.gbxProtocol.Controls.Add(this.cbxProtocolOp);
|
||||||
|
this.gbxProtocol.Controls.Add(this.label11);
|
||||||
|
this.gbxProtocol.Location = new System.Drawing.Point(18, 303);
|
||||||
|
this.gbxProtocol.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.gbxProtocol.Name = "gbxProtocol";
|
||||||
|
this.gbxProtocol.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.gbxProtocol.Size = new System.Drawing.Size(548, 488);
|
||||||
|
this.gbxProtocol.TabIndex = 17;
|
||||||
|
this.gbxProtocol.TabStop = false;
|
||||||
|
//
|
||||||
|
// btnProtocolSend
|
||||||
|
//
|
||||||
|
this.btnProtocolSend.Location = new System.Drawing.Point(82, 62);
|
||||||
|
this.btnProtocolSend.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.btnProtocolSend.Name = "btnProtocolSend";
|
||||||
|
this.btnProtocolSend.Size = new System.Drawing.Size(450, 50);
|
||||||
|
this.btnProtocolSend.TabIndex = 23;
|
||||||
|
this.btnProtocolSend.Text = "发送";
|
||||||
|
this.btnProtocolSend.UseVisualStyleBackColor = true;
|
||||||
|
this.btnProtocolSend.Click += new System.EventHandler(this.btnProtocolSend_Click);
|
||||||
|
//
|
||||||
|
// tbxProtocolData
|
||||||
|
//
|
||||||
|
this.tbxProtocolData.Location = new System.Drawing.Point(15, 118);
|
||||||
|
this.tbxProtocolData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.tbxProtocolData.Multiline = true;
|
||||||
|
this.tbxProtocolData.Name = "tbxProtocolData";
|
||||||
|
this.tbxProtocolData.Size = new System.Drawing.Size(516, 358);
|
||||||
|
this.tbxProtocolData.TabIndex = 22;
|
||||||
|
//
|
||||||
|
// label13
|
||||||
|
//
|
||||||
|
this.label13.AutoSize = true;
|
||||||
|
this.label13.Location = new System.Drawing.Point(12, 72);
|
||||||
|
this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label13.Name = "label13";
|
||||||
|
this.label13.Size = new System.Drawing.Size(62, 18);
|
||||||
|
this.label13.TabIndex = 21;
|
||||||
|
this.label13.Text = "数据:";
|
||||||
|
//
|
||||||
|
// tbxProtocolMID
|
||||||
|
//
|
||||||
|
this.tbxProtocolMID.Location = new System.Drawing.Point(400, 21);
|
||||||
|
this.tbxProtocolMID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.tbxProtocolMID.Name = "tbxProtocolMID";
|
||||||
|
this.tbxProtocolMID.Size = new System.Drawing.Size(130, 28);
|
||||||
|
this.tbxProtocolMID.TabIndex = 20;
|
||||||
|
this.tbxProtocolMID.Text = "0202";
|
||||||
|
//
|
||||||
|
// label12
|
||||||
|
//
|
||||||
|
this.label12.AutoSize = true;
|
||||||
|
this.label12.Location = new System.Drawing.Point(339, 26);
|
||||||
|
this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label12.Name = "label12";
|
||||||
|
this.label12.Size = new System.Drawing.Size(53, 18);
|
||||||
|
this.label12.TabIndex = 11;
|
||||||
|
this.label12.Text = "MID:";
|
||||||
|
//
|
||||||
|
// cbxProtocolOp
|
||||||
|
//
|
||||||
|
this.cbxProtocolOp.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbxProtocolOp.FormattingEnabled = true;
|
||||||
|
this.cbxProtocolOp.Location = new System.Drawing.Point(118, 21);
|
||||||
|
this.cbxProtocolOp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.cbxProtocolOp.Name = "cbxProtocolOp";
|
||||||
|
this.cbxProtocolOp.Size = new System.Drawing.Size(130, 26);
|
||||||
|
this.cbxProtocolOp.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// label11
|
||||||
|
//
|
||||||
|
this.label11.AutoSize = true;
|
||||||
|
this.label11.Location = new System.Drawing.Point(12, 26);
|
||||||
|
this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.label11.Name = "label11";
|
||||||
|
this.label11.Size = new System.Drawing.Size(98, 18);
|
||||||
|
this.label11.TabIndex = 9;
|
||||||
|
this.label11.Text = "操作方式:";
|
||||||
|
//
|
||||||
|
// tbxProtocolDebug
|
||||||
|
//
|
||||||
|
this.tbxProtocolDebug.Location = new System.Drawing.Point(590, 12);
|
||||||
|
this.tbxProtocolDebug.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.tbxProtocolDebug.Multiline = true;
|
||||||
|
this.tbxProtocolDebug.Name = "tbxProtocolDebug";
|
||||||
|
this.tbxProtocolDebug.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||||
|
this.tbxProtocolDebug.Size = new System.Drawing.Size(1069, 697);
|
||||||
|
this.tbxProtocolDebug.TabIndex = 23;
|
||||||
|
//
|
||||||
|
// btnClear
|
||||||
|
//
|
||||||
|
this.btnClear.Location = new System.Drawing.Point(590, 735);
|
||||||
|
this.btnClear.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.btnClear.Name = "btnClear";
|
||||||
|
this.btnClear.Size = new System.Drawing.Size(282, 56);
|
||||||
|
this.btnClear.TabIndex = 25;
|
||||||
|
this.btnClear.Text = "清除";
|
||||||
|
this.btnClear.UseVisualStyleBackColor = true;
|
||||||
|
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1702, 808);
|
||||||
|
this.Controls.Add(this.btnClear);
|
||||||
|
this.Controls.Add(this.tbxProtocolDebug);
|
||||||
|
this.Controls.Add(this.gbxProtocol);
|
||||||
|
this.Controls.Add(this.gbxSerial);
|
||||||
|
this.Controls.Add(this.gbxTcp);
|
||||||
|
this.Controls.Add(this.btnOpen);
|
||||||
|
this.Controls.Add(this.cbxDevType);
|
||||||
|
this.Controls.Add(this.label6);
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "DK_DC 报文调试助手";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
|
||||||
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
|
this.gbxSerial.ResumeLayout(false);
|
||||||
|
this.gbxSerial.PerformLayout();
|
||||||
|
this.gbxTcp.ResumeLayout(false);
|
||||||
|
this.gbxTcp.PerformLayout();
|
||||||
|
this.gbxProtocol.ResumeLayout(false);
|
||||||
|
this.gbxProtocol.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private System.Windows.Forms.Label label6;
|
||||||
|
private System.Windows.Forms.ComboBox cbxDevType;
|
||||||
|
private System.Windows.Forms.Button btnOpen;
|
||||||
|
private System.Windows.Forms.GroupBox gbxSerial;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.ComboBox cbxSerial;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.ComboBox cbxSerialCheckSum;
|
||||||
|
private System.Windows.Forms.ComboBox cbxSerialBaud;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.ComboBox cbxSerialStopBit;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.ComboBox cbxSerialDataBit;
|
||||||
|
private System.Windows.Forms.Label label8;
|
||||||
|
private System.Windows.Forms.Label label7;
|
||||||
|
private System.Windows.Forms.TextBox tbxTcpDestIP;
|
||||||
|
private System.Windows.Forms.TextBox tbxTcpDestPort;
|
||||||
|
private System.Windows.Forms.GroupBox gbxTcp;
|
||||||
|
private System.Windows.Forms.Label label9;
|
||||||
|
private System.Windows.Forms.TextBox tbxSerialAddr;
|
||||||
|
private System.Windows.Forms.Label label10;
|
||||||
|
private System.Windows.Forms.TextBox tbxSerialProtocol;
|
||||||
|
private System.Windows.Forms.GroupBox gbxProtocol;
|
||||||
|
private System.Windows.Forms.Label label11;
|
||||||
|
private System.Windows.Forms.Label label12;
|
||||||
|
private System.Windows.Forms.ComboBox cbxProtocolOp;
|
||||||
|
private System.Windows.Forms.TextBox tbxProtocolMID;
|
||||||
|
private System.Windows.Forms.Label label13;
|
||||||
|
private System.Windows.Forms.TextBox tbxProtocolData;
|
||||||
|
private System.Windows.Forms.Button btnProtocolSend;
|
||||||
|
private System.Windows.Forms.TextBox tbxProtocolDebug;
|
||||||
|
private System.Windows.Forms.Button btnClear;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
812
DK_DC_Tool/Form1.cs
Normal file
@@ -0,0 +1,812 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO.Ports;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace DK_DC_Tool
|
||||||
|
{
|
||||||
|
public enum RETURN_ERR_STATE
|
||||||
|
{
|
||||||
|
RETURN_EOK = 0,
|
||||||
|
RETURN_ERR = -1,
|
||||||
|
RETURN_ESTOP = -2,
|
||||||
|
RETURN_ECONNECT = -3,
|
||||||
|
RETURN_ETIMEOUT = -4,
|
||||||
|
RETURN_EDECOMPOSE = -5
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
readonly string[] dev_type_tab = new string[] { "串口", "TCP" };
|
||||||
|
readonly string[] serial_baud_tab = new string[] { "1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200" };
|
||||||
|
readonly string[] serial_databit_tab = new string[] { "5", "6", "7", "8" };
|
||||||
|
readonly string[] serial_stopbit_tab = new string[] { "1", "1.5", "2" };
|
||||||
|
readonly string[] serial_checksum_tab = new string[] { "无", "奇校验", "偶校验", "置1", "置0" };
|
||||||
|
readonly string[] protocol_op_tab = new string[] { "R", "W" };
|
||||||
|
|
||||||
|
enum DevType { DEV_TYPE_SERIAL = 0, DEV_TYPE_TCP };
|
||||||
|
|
||||||
|
int _dev_type;
|
||||||
|
byte _serial_addr = 0;
|
||||||
|
byte _serial_protocol = 0;
|
||||||
|
SerialPort _serial = null;
|
||||||
|
TcpClient _client = null;
|
||||||
|
Thread _parse_tid = null;
|
||||||
|
bool _isconnected = false;
|
||||||
|
bool _is_run = false;
|
||||||
|
bool _is_show_packet = true;
|
||||||
|
bool _is_reconnect = true;
|
||||||
|
bool _first_connect = true;
|
||||||
|
UInt32 _reconnect_cnt = 0;
|
||||||
|
Mutex _hw_mtx = null;
|
||||||
|
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
cbxDevType.Items.AddRange(dev_type_tab);
|
||||||
|
cbxDevType.SelectedIndex = 0;
|
||||||
|
_dev_type = (int)DevType.DEV_TYPE_SERIAL;
|
||||||
|
|
||||||
|
gbxSerial.Visible = true;
|
||||||
|
gbxSerial.BringToFront();
|
||||||
|
gbxTcp.Visible = false;
|
||||||
|
|
||||||
|
string[] ports = SerialPort.GetPortNames();
|
||||||
|
cbxSerial.Items.AddRange(ports);
|
||||||
|
cbxSerial.SelectedIndex = cbxSerial.Items.Count > 0 ? 0 : -1;
|
||||||
|
cbxSerialBaud.Items.AddRange(serial_baud_tab);
|
||||||
|
cbxSerialBaud.SelectedIndex = 7;
|
||||||
|
cbxSerialDataBit.Items.AddRange(serial_databit_tab);
|
||||||
|
cbxSerialDataBit.SelectedIndex = 3;
|
||||||
|
cbxSerialStopBit.Items.AddRange(serial_stopbit_tab);
|
||||||
|
cbxSerialStopBit.SelectedIndex = 0;
|
||||||
|
cbxSerialCheckSum.Items.AddRange(serial_checksum_tab);
|
||||||
|
cbxSerialCheckSum.SelectedIndex = 0;
|
||||||
|
tbxSerialAddr.Text = "1";
|
||||||
|
tbxSerialProtocol.Text = "1";
|
||||||
|
|
||||||
|
//tbxTcpDestIP.Text = "192.168.2.32";
|
||||||
|
tbxTcpDestIP.Text = "192.168.3.31";
|
||||||
|
tbxTcpDestPort.Text = "5000";
|
||||||
|
|
||||||
|
gbxProtocol.Enabled = false;
|
||||||
|
cbxProtocolOp.Items.AddRange(protocol_op_tab);
|
||||||
|
cbxProtocolOp.SelectedIndex = 0;
|
||||||
|
|
||||||
|
_hw_mtx = new Mutex();
|
||||||
|
|
||||||
|
|
||||||
|
_parse_tid = new Thread(new ThreadStart(parse_entry));
|
||||||
|
_parse_tid.Name = "data_parse";
|
||||||
|
_parse_tid.IsBackground = true;
|
||||||
|
_parse_tid.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_parse_tid != null)
|
||||||
|
_parse_tid.Abort();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_parse_tid = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_serial != null)
|
||||||
|
_serial.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_serial = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_client != null)
|
||||||
|
_client.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_client = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnOpen_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (btnOpen.Text == "打开")
|
||||||
|
{
|
||||||
|
if (cbxDevType.SelectedIndex == 0)
|
||||||
|
_dev_type = (int)DevType.DEV_TYPE_SERIAL;
|
||||||
|
else
|
||||||
|
_dev_type = (int)DevType.DEV_TYPE_TCP;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (_dev_type == (int)DevType.DEV_TYPE_SERIAL)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_serial_addr = byte.Parse(tbxSerialAddr.Text);
|
||||||
|
_serial_protocol = byte.Parse(tbxSerialProtocol.Text);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
MessageBox.Show("串口地址和协议类型配置出错");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//_log.Info("\r\n\r\n\r\n");
|
||||||
|
//_log.Info("启动");
|
||||||
|
|
||||||
|
btnOpen.Text = "关闭";
|
||||||
|
cbxDevType.Enabled = false;
|
||||||
|
gbxTcp.Enabled = false;
|
||||||
|
gbxSerial.Enabled = false;
|
||||||
|
gbxProtocol.Enabled = true;
|
||||||
|
|
||||||
|
_is_run = true;
|
||||||
|
|
||||||
|
if (_dev_type == (int)DevType.DEV_TYPE_SERIAL)
|
||||||
|
_is_reconnect = false;
|
||||||
|
else
|
||||||
|
_is_reconnect = true;
|
||||||
|
|
||||||
|
_first_connect = true;
|
||||||
|
_reconnect_cnt = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//_log.Info("\r\n\r\n\r\n");
|
||||||
|
//_log.Info("结束");
|
||||||
|
|
||||||
|
btnOpen.Text = "打开";
|
||||||
|
cbxDevType.Enabled = true;
|
||||||
|
gbxTcp.Enabled = true;
|
||||||
|
gbxSerial.Enabled = true;
|
||||||
|
gbxProtocol.Enabled = false;
|
||||||
|
_is_run = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnClear_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
tbxProtocolDebug.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cbxDevType_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (cbxDevType.SelectedIndex == 0)
|
||||||
|
{
|
||||||
|
gbxSerial.Visible = true;
|
||||||
|
gbxSerial.BringToFront();
|
||||||
|
gbxTcp.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gbxTcp.Visible = true;
|
||||||
|
gbxTcp.BringToFront();
|
||||||
|
gbxSerial.Visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cbxSerial_DropDown(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string[] ports = SerialPort.GetPortNames();
|
||||||
|
cbxSerial.Items.Clear();
|
||||||
|
cbxSerial.Items.AddRange(ports);
|
||||||
|
cbxSerial.SelectedIndex = cbxSerial.Items.Count > 0 ? 0 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//代理
|
||||||
|
private delegate void change_tbx_delegate(string str);
|
||||||
|
|
||||||
|
private void tbxProtocolDebug_show(string str)
|
||||||
|
{
|
||||||
|
if (tbxProtocolDebug.InvokeRequired)
|
||||||
|
{
|
||||||
|
change_tbx_delegate cd = new change_tbx_delegate(tbxProtocolDebug_show);
|
||||||
|
tbxProtocolDebug.Invoke(cd, new object[] { str });
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tbxProtocolDebug.Text += str;
|
||||||
|
tbxProtocolDebug.Text += "\r\n\r\n";
|
||||||
|
tbxProtocolDebug.Select(tbxProtocolDebug.TextLength, 0);
|
||||||
|
tbxProtocolDebug.ScrollToCaret();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string bytes_to_hex_string(byte[] buf, int offset, int len)
|
||||||
|
{
|
||||||
|
string str = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
str += buf[offset + i].ToString("X2") + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string bytes_to_string(byte[] buf, int offset, int len)
|
||||||
|
{
|
||||||
|
string str = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
if ((buf[offset + i] < 32) || (buf[offset + i] > 126))
|
||||||
|
str += " .";
|
||||||
|
else
|
||||||
|
str += " " + ((char)buf[offset + i]).ToString();
|
||||||
|
|
||||||
|
str += " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool serial_open(ref SerialPort port, ComboBox serialNo, ComboBox serialBaud, ComboBox serialDataBit, ComboBox serialStopBit, ComboBox serialCheckSum)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (port != null)
|
||||||
|
port.Close();
|
||||||
|
port = null;
|
||||||
|
|
||||||
|
port = new SerialPort();
|
||||||
|
port.PortName = serialNo.Text;
|
||||||
|
port.BaudRate = int.Parse(serial_baud_tab[serialBaud.SelectedIndex]);
|
||||||
|
port.DataBits = int.Parse(serial_databit_tab[serialDataBit.SelectedIndex]);
|
||||||
|
|
||||||
|
switch (serialStopBit.SelectedIndex)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
port.StopBits = StopBits.One;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
port.StopBits = StopBits.OnePointFive;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
port.StopBits = StopBits.Two;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
port.StopBits = StopBits.One;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (serialCheckSum.SelectedIndex)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
port.Parity = Parity.None;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
port.Parity = Parity.Odd;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
port.Parity = Parity.Even;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
port.Parity = Parity.Mark;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
port.Parity = Parity.Space;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
port.Parity = Parity.None;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
port.Handshake = Handshake.None;
|
||||||
|
|
||||||
|
port.Open();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
port = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int serial_receive(SerialPort port, byte[] buffer, int offset, int max_len)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
|
||||||
|
if (port == null)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
if (port.IsOpen == false)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
int len = 0;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
while (max_len > 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(35);
|
||||||
|
|
||||||
|
if (!_is_run)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (port.BytesToRead < 0)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port.BytesToRead == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
rc = port.Read(buffer, offset + len, max_len);
|
||||||
|
if (rc <= 0)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
len += rc;
|
||||||
|
max_len -= rc;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc >= 0)
|
||||||
|
rc = len;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int serial_send(SerialPort port, byte[] buffer)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
|
||||||
|
if (port == null)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
if (port.IsOpen == false)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
port.Write(buffer, 0, buffer.Length);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool tcp_connect(ref TcpClient client, string ip, string port)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (client != null)
|
||||||
|
client.Close();
|
||||||
|
client = null;
|
||||||
|
|
||||||
|
client = new TcpClient();
|
||||||
|
if (!client.ConnectAsync(ip, int.Parse(port)).Wait(2000))
|
||||||
|
{
|
||||||
|
client.Close();
|
||||||
|
client = null;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
client = null;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int tcp_receive(TcpClient client, byte[] buffer, int offset, int max_len)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
|
||||||
|
if (client == null)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
if (client.Connected == false)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
NetworkStream networkStream = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
networkStream = client.GetStream();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int len = 0;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
while (max_len > 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(20);
|
||||||
|
|
||||||
|
if (!_is_run)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (networkStream.DataAvailable == false)
|
||||||
|
break;
|
||||||
|
|
||||||
|
rc = networkStream.Read(buffer, offset + len, max_len);
|
||||||
|
if (rc <= 0)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
len += rc;
|
||||||
|
max_len -= rc;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc >= 0)
|
||||||
|
rc = len;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int tcp_send(TcpClient client, byte[] buffer)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
|
||||||
|
if (client == null)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
if (client.Connected == false)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
NetworkStream networkStream = _client.GetStream();
|
||||||
|
networkStream.Write(buffer, 0, buffer.Length);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int hw_receive(byte[] buffer, int offset, int max_len)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
if (_dev_type == (int)DevType.DEV_TYPE_SERIAL)
|
||||||
|
rc = serial_receive(_serial, buffer, offset, max_len);
|
||||||
|
else
|
||||||
|
rc = tcp_receive(_client, buffer, offset, max_len);
|
||||||
|
|
||||||
|
string str = null;
|
||||||
|
if(rc < 0)
|
||||||
|
{
|
||||||
|
if(rc != (int)RETURN_ERR_STATE.RETURN_ESTOP)
|
||||||
|
{
|
||||||
|
string err_str = "接收数据异常";
|
||||||
|
// _log.Warn(err_str);
|
||||||
|
|
||||||
|
str = "\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n";
|
||||||
|
str += err_str + "\r\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (rc > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
//buffer = new byte[] { 0x02 ,0x00, 0x00, 0x00, 0xd9, 0x54, 0x30, 0x32, 0x30, 0x32, 0x30, 0x30, 0x30, 0x31, 0x30, 0x3d, 0x30, 0x2e, 0x32, 0x39, 0x37, 0x2c, 0x33, 0x32, 0x30, 0x38, 0x2e, 0x35, 0x36, 0x33, 0x2c, 0x31, 0x2e, 0x36, 0x35, 0x31, 0x3b, 0x30, 0x30, 0x30, 0x31, 0x31, 0x3d, 0x31, 0x3b, 0x30, 0x30, 0x30, 0x31, 0x32, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x31, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x31, 0x33, 0x2c, 0x2d, 0x38, 0x39, 0x2e, 0x39, 0x35, 0x34, 0x2c, 0x30, 0x2e, 0x31, 0x37, 0x34, 0x3b, 0x30, 0x31, 0x30, 0x31, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x32, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x30, 0x38, 0x2c, 0x38, 0x39, 0x2e, 0x39, 0x35, 0x34, 0x2c, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x32, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x33, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x30, 0x36, 0x2c, 0x32, 0x37, 0x39, 0x39, 0x2e, 0x34, 0x37, 0x32, 0x2c, 0x30, 0x2e, 0x34, 0x30, 0x39, 0x3b, 0x30, 0x31, 0x30, 0x33, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x34, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x35, 0x39, 0x2c, 0x33, 0x30, 0x37, 0x2e, 0x36, 0x37, 0x38, 0x2c, 0x30, 0x2e, 0x32, 0x35, 0x36, 0x3b, 0x30, 0x31, 0x30, 0x34, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x35, 0x30, 0x3d, 0x30, 0x2e, 0x32, 0x39, 0x37, 0x2c, 0x31, 0x30, 0x2e, 0x33, 0x31, 0x33, 0x2c, 0x30, 0x2e, 0x34, 0x39, 0x32, 0x3b, 0x30, 0x31, 0x30, 0x35, 0x31, 0x3d, 0x30, 0x3b, 0x03 };
|
||||||
|
//rc = buffer.Length;
|
||||||
|
|
||||||
|
//_log.Debug("接收到数据");
|
||||||
|
string hex_str = "recv: " + bytes_to_hex_string(buffer, offset, rc);
|
||||||
|
string raw_str = " " + bytes_to_string(buffer, offset, rc);
|
||||||
|
//_log.Debug(hex_str);
|
||||||
|
//_log.Debug(raw_str);
|
||||||
|
|
||||||
|
if (_is_show_packet)
|
||||||
|
{
|
||||||
|
str = "\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n";
|
||||||
|
str += hex_str + "\r\n" + raw_str + "\r\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str != null)
|
||||||
|
tbxProtocolDebug_show(str);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int hw_send(ToolPacket packet)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
ToolPacket send_packet = null;
|
||||||
|
|
||||||
|
if (_dev_type == (int)DevType.DEV_TYPE_SERIAL)
|
||||||
|
{
|
||||||
|
ToolSerialPacket serial_packet = new ToolSerialPacket();
|
||||||
|
serial_packet.addr = _serial_addr;
|
||||||
|
serial_packet.protocol = _serial_protocol;
|
||||||
|
serial_packet.op = packet.op;
|
||||||
|
serial_packet.mid = packet.mid;
|
||||||
|
serial_packet.data_domain_str = packet.data_domain_str;
|
||||||
|
|
||||||
|
send_packet = serial_packet;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
send_packet = packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] buffer = send_packet.compose_protocol();
|
||||||
|
|
||||||
|
_hw_mtx.WaitOne();
|
||||||
|
|
||||||
|
if (_dev_type == (int)DevType.DEV_TYPE_SERIAL)
|
||||||
|
rc = serial_send(_serial, buffer);
|
||||||
|
else
|
||||||
|
rc = tcp_send(_client, buffer);
|
||||||
|
|
||||||
|
_hw_mtx.ReleaseMutex();
|
||||||
|
|
||||||
|
string str = null;
|
||||||
|
if (rc < 0)
|
||||||
|
{
|
||||||
|
if(rc != (int)RETURN_ERR_STATE.RETURN_ESTOP)
|
||||||
|
{
|
||||||
|
string err_str = "发送失败";
|
||||||
|
//_log.Warn(err_str);
|
||||||
|
|
||||||
|
str = "\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n";
|
||||||
|
str += err_str + "\r\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//_log.Debug("发送数据");
|
||||||
|
string hex_str = "send: " + bytes_to_hex_string(buffer, 0, buffer.Length);
|
||||||
|
string raw_str = " " + bytes_to_string(buffer, 0, buffer.Length);
|
||||||
|
//_log.Debug(hex_str);
|
||||||
|
//_log.Debug(raw_str);
|
||||||
|
|
||||||
|
if (_is_show_packet)
|
||||||
|
{
|
||||||
|
str = "\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n";
|
||||||
|
str += hex_str + "\r\n" + raw_str + "\r\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(str != null)
|
||||||
|
tbxProtocolDebug_show(str);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] normal_buf = new byte[1024];
|
||||||
|
|
||||||
|
private void parse_entry()
|
||||||
|
{
|
||||||
|
Control.CheckForIllegalCrossThreadCalls = false;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// 未使能运行时,关闭连接,等待使能
|
||||||
|
if(!_is_run)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_serial != null)
|
||||||
|
_serial.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_serial = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_client != null)
|
||||||
|
_client.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_client = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
_isconnected = false;
|
||||||
|
_first_connect = true;
|
||||||
|
|
||||||
|
Thread.Sleep(50);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 未连接时,连接硬件接口,失败 2s 周期重连
|
||||||
|
if(!_isconnected)
|
||||||
|
{
|
||||||
|
// 不使能重连
|
||||||
|
if(!_is_reconnect && !_first_connect)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_serial != null)
|
||||||
|
_serial.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_serial = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_client != null)
|
||||||
|
_client.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_client = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(50);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_first_connect = false;
|
||||||
|
_reconnect_cnt++;
|
||||||
|
|
||||||
|
if (_dev_type == (int)DevType.DEV_TYPE_SERIAL)
|
||||||
|
{
|
||||||
|
if (serial_open(ref _serial, cbxSerial, cbxSerialBaud, cbxSerialDataBit, cbxSerialStopBit, cbxSerialCheckSum))
|
||||||
|
{
|
||||||
|
tbxProtocolDebug_show("\r\n\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n打开串口成功!\r\n");
|
||||||
|
//_log.Info("打开串口成功!");
|
||||||
|
|
||||||
|
_isconnected = true;
|
||||||
|
Thread.Sleep(50);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tbxProtocolDebug_show("\r\n\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n打开串口失败!\r\n");
|
||||||
|
//_log.Warn("打开串口失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (tcp_connect(ref _client, tbxTcpDestIP.Text, tbxTcpDestPort.Text))
|
||||||
|
{
|
||||||
|
tbxProtocolDebug_show("\r\n\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n网络连接成功!\r\n");
|
||||||
|
//_log.Info("网络连接成功!");
|
||||||
|
|
||||||
|
_isconnected = true;
|
||||||
|
Thread.Sleep(50);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tbxProtocolDebug_show("\r\n\r\n" + DateTime.Now.ToString() + '.' + DateTime.Now.Millisecond.ToString("d3") + "\r\n网络连接失败!\r\n");
|
||||||
|
//_log.Warn("网络连接失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int recv_len = hw_receive(normal_buf, 0, normal_buf.Length);
|
||||||
|
if (recv_len < 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(50);
|
||||||
|
_isconnected = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnProtocolSend_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ToolPacket packet = new ToolPacket();
|
||||||
|
|
||||||
|
if (cbxProtocolOp.SelectedIndex == 0)
|
||||||
|
packet.op = 'R';
|
||||||
|
else
|
||||||
|
packet.op = 'W';
|
||||||
|
packet.mid = tbxProtocolMID.Text;
|
||||||
|
packet.data_domain_str = tbxProtocolData.Text;
|
||||||
|
hw_send(packet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
DK_DC_Tool/Form1.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
22
DK_DC_Tool/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace DK_DC_Tool
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 应用程序的主入口点。
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new Form1());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
DK_DC_Tool/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// 有关程序集的一般信息由以下
|
||||||
|
// 控制。更改这些特性值可修改
|
||||||
|
// 与程序集关联的信息。
|
||||||
|
[assembly: AssemblyTitle("DK_DC_Tool")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("DK_DC_Tool")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||||
|
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||||
|
//请将此类型的 ComVisible 特性设置为 true。
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||||
|
[assembly: Guid("3c6fef50-2014-4157-a12b-93fb4ad20fe7")]
|
||||||
|
|
||||||
|
// 程序集的版本信息由下列四个值组成:
|
||||||
|
//
|
||||||
|
// 主版本
|
||||||
|
// 次版本
|
||||||
|
// 生成号
|
||||||
|
// 修订号
|
||||||
|
//
|
||||||
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
|
//通过使用 "*",如下所示:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
63
DK_DC_Tool/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
// 运行时版本:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||||
|
// 重新生成代码,这些更改将会丢失。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace DK_DC_Tool.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||||
|
/// </summary>
|
||||||
|
// 此类是由 StronglyTypedResourceBuilder
|
||||||
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
|
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
|
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DK_DC_Tool.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
DK_DC_Tool/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
26
DK_DC_Tool/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
// 运行时版本:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||||
|
// 重新生成代码,这些更改将会丢失。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace DK_DC_Tool.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
DK_DC_Tool/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?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>
|
||||||
482
DK_DC_Tool/Tighten.cs
Normal file
@@ -0,0 +1,482 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Runtime.ConstrainedExecution;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace DK_DC_Tool
|
||||||
|
{
|
||||||
|
public class Tighten
|
||||||
|
{
|
||||||
|
public static Dictionary<string, string> TightenNG_Code = new Dictionary<string, string>()
|
||||||
|
{
|
||||||
|
// 00 = 无定意;01 = 最终扭矩过大;02 = 最终扭矩过大;03 = 最终角度过大;04 = 最终角度过小;n1 = 第 n 步扭矩过大;n2 = 第 n 步时间超限;1 < n < 5;90 = 总时间超限;
|
||||||
|
{ "00", "无定意" },
|
||||||
|
{ "01", "最终扭矩过大" },
|
||||||
|
{ "02", "最终扭矩过大" },
|
||||||
|
{ "03", "最终角度过大" },
|
||||||
|
{ "04", "最终角度过小" },
|
||||||
|
{ "11", "第 1 步扭矩过大" },
|
||||||
|
{ "21", "第 2 步扭矩过大" },
|
||||||
|
{ "31", "第 3 步扭矩过大" },
|
||||||
|
{ "41", "第 4 步扭矩过大" },
|
||||||
|
{ "51", "第 5 步扭矩过大" },
|
||||||
|
{ "12", "第 1 步时间超限" },
|
||||||
|
{ "22", "第 2 步时间超限" },
|
||||||
|
{ "32", "第 3 步时间超限" },
|
||||||
|
{ "42", "第 4 步时间超限" },
|
||||||
|
{ "52", "第 5 步时间超限" },
|
||||||
|
{ "90", "总时间超限" }
|
||||||
|
};
|
||||||
|
|
||||||
|
TcpClient _client = null;
|
||||||
|
Thread _parse_tid = null;
|
||||||
|
Thread _tightenHeartBeat = null;
|
||||||
|
bool _isconnected = false;
|
||||||
|
bool _is_run = false;
|
||||||
|
bool _is_reconnect = true;
|
||||||
|
bool _first_connect = true;
|
||||||
|
string ip = "127.0.0.1";
|
||||||
|
int port = 5000;
|
||||||
|
int _reconnect_cnt = 0;
|
||||||
|
string currentOpName = "127.0.0.1";
|
||||||
|
public static Action<String,String> E_ScanContent = null;
|
||||||
|
public static Action<String, String, String> E_LogInsert = null;
|
||||||
|
public static Action<String> E_DeviceHeartBeat = null;
|
||||||
|
|
||||||
|
|
||||||
|
public void Start(string ip ,int port, string opName)
|
||||||
|
{
|
||||||
|
this.currentOpName = opName;
|
||||||
|
this.ip = ip;
|
||||||
|
this.port = port;
|
||||||
|
|
||||||
|
_parse_tid = new Thread(new ThreadStart(parse_entry));
|
||||||
|
_parse_tid.Name = "data_parse";
|
||||||
|
_parse_tid.IsBackground = true;
|
||||||
|
_parse_tid.Start();
|
||||||
|
_tightenHeartBeat = new Thread(new ThreadStart(hw_send_HeartBeat));
|
||||||
|
_tightenHeartBeat.Name = "tightenHeartBeat";
|
||||||
|
_tightenHeartBeat.IsBackground = true;
|
||||||
|
_tightenHeartBeat.Start();
|
||||||
|
|
||||||
|
|
||||||
|
_is_run = true;
|
||||||
|
_is_reconnect = true;
|
||||||
|
_first_connect = true;
|
||||||
|
_reconnect_cnt = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_is_run = false;
|
||||||
|
_is_reconnect = false;
|
||||||
|
_first_connect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//代理
|
||||||
|
private delegate void change_tbx_delegate(string str);
|
||||||
|
|
||||||
|
private string bytes_to_hex_string(byte[] buf, int offset, int len)
|
||||||
|
{
|
||||||
|
string str = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
str += buf[offset + i].ToString("X2") + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string bytes_to_string(byte[] buf, int offset, int len)
|
||||||
|
{
|
||||||
|
string str = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
if ((buf[offset + i] < 32) || (buf[offset + i] > 126))
|
||||||
|
str += " .";
|
||||||
|
else
|
||||||
|
str += " " + ((char)buf[offset + i]).ToString();
|
||||||
|
|
||||||
|
str += " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
private bool tcp_connect(ref TcpClient client, string ip, string port)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (client != null)
|
||||||
|
client.Close();
|
||||||
|
client = null;
|
||||||
|
|
||||||
|
client = new TcpClient();
|
||||||
|
if (!client.ConnectAsync(ip, int.Parse(port)).Wait(2000))
|
||||||
|
{
|
||||||
|
client.Close();
|
||||||
|
client = null;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception err)
|
||||||
|
{
|
||||||
|
E_LogInsert("Tighten", "Error", "165:" + err.Message);
|
||||||
|
if (E_DeviceHeartBeat != null)
|
||||||
|
{
|
||||||
|
E_DeviceHeartBeat.Invoke("0");
|
||||||
|
}
|
||||||
|
client = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int tcp_receive(TcpClient client, byte[] buffer, int offset, int max_len)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
|
||||||
|
if (client == null)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
if (client.Connected == false)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
NetworkStream networkStream = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
networkStream = client.GetStream();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int len = 0;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
while (max_len > 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(20);
|
||||||
|
|
||||||
|
if (!_is_run)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (networkStream.DataAvailable == false)
|
||||||
|
break;
|
||||||
|
|
||||||
|
rc = networkStream.Read(buffer, offset + len, max_len);
|
||||||
|
if (rc <= 0)
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
len += rc;
|
||||||
|
max_len -= rc;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
rc = (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc >= 0)
|
||||||
|
rc = len;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int tcp_send(TcpClient client, byte[] buffer)
|
||||||
|
{
|
||||||
|
if (!_is_run)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ESTOP;
|
||||||
|
|
||||||
|
if (!_isconnected)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ECONNECT;
|
||||||
|
|
||||||
|
if (client == null)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
if (client.Connected == false)
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
NetworkStream networkStream = _client.GetStream();
|
||||||
|
networkStream.Write(buffer, 0, buffer.Length);
|
||||||
|
}
|
||||||
|
catch(Exception err)
|
||||||
|
{
|
||||||
|
E_LogInsert("Tighten", "Error", "270:" + err.Message);
|
||||||
|
return (int)RETURN_ERR_STATE.RETURN_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int hw_receive(byte[] buffer, int offset, int max_len)
|
||||||
|
{
|
||||||
|
int rc = tcp_receive(_client, buffer, offset, max_len);
|
||||||
|
|
||||||
|
string str = null;
|
||||||
|
if(rc < 0)
|
||||||
|
{
|
||||||
|
if(rc != (int)RETURN_ERR_STATE.RETURN_ESTOP)
|
||||||
|
{
|
||||||
|
string err_str = "拧紧枪接收数据异常!";
|
||||||
|
E_LogInsert("Tighten", "Error", err_str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (rc > 0)
|
||||||
|
{
|
||||||
|
//buffer = new byte[] { 0x02 ,0x00, 0x00, 0x00, 0xd9, 0x54, 0x30, 0x32, 0x30, 0x32, 0x30, 0x30, 0x30, 0x31, 0x30, 0x3d, 0x30, 0x2e, 0x32, 0x39, 0x37, 0x2c, 0x33, 0x32, 0x30, 0x38, 0x2e, 0x35, 0x36, 0x33, 0x2c, 0x31, 0x2e, 0x36, 0x35, 0x31, 0x3b, 0x30, 0x30, 0x30, 0x31, 0x31, 0x3d, 0x31, 0x3b, 0x30, 0x30, 0x30, 0x31, 0x32, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x31, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x31, 0x33, 0x2c, 0x2d, 0x38, 0x39, 0x2e, 0x39, 0x35, 0x34, 0x2c, 0x30, 0x2e, 0x31, 0x37, 0x34, 0x3b, 0x30, 0x31, 0x30, 0x31, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x32, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x30, 0x38, 0x2c, 0x38, 0x39, 0x2e, 0x39, 0x35, 0x34, 0x2c, 0x30, 0x2e, 0x31, 0x30, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x32, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x33, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x30, 0x36, 0x2c, 0x32, 0x37, 0x39, 0x39, 0x2e, 0x34, 0x37, 0x32, 0x2c, 0x30, 0x2e, 0x34, 0x30, 0x39, 0x3b, 0x30, 0x31, 0x30, 0x33, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x34, 0x30, 0x3d, 0x30, 0x2e, 0x30, 0x35, 0x39, 0x2c, 0x33, 0x30, 0x37, 0x2e, 0x36, 0x37, 0x38, 0x2c, 0x30, 0x2e, 0x32, 0x35, 0x36, 0x3b, 0x30, 0x31, 0x30, 0x34, 0x31, 0x3d, 0x30, 0x3b, 0x30, 0x31, 0x30, 0x35, 0x30, 0x3d, 0x30, 0x2e, 0x32, 0x39, 0x37, 0x2c, 0x31, 0x30, 0x2e, 0x33, 0x31, 0x33, 0x2c, 0x30, 0x2e, 0x34, 0x39, 0x32, 0x3b, 0x30, 0x31, 0x30, 0x35, 0x31, 0x3d, 0x30, 0x3b, 0x03 };
|
||||||
|
//rc = buffer.Length;
|
||||||
|
var hex_str = bytes_to_hex_string(buffer, offset, rc);
|
||||||
|
var raw_str = bytes_to_string(buffer, offset, rc);
|
||||||
|
if (E_ScanContent != null)
|
||||||
|
{
|
||||||
|
E_ScanContent.Invoke(hex_str, raw_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (str != null)
|
||||||
|
// tbxProtocolDebug_show(str);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int hw_send(ToolPacket packet)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
ToolPacket send_packet = null;
|
||||||
|
|
||||||
|
send_packet = packet;
|
||||||
|
|
||||||
|
byte[] buffer = send_packet.compose_protocol();
|
||||||
|
|
||||||
|
rc = tcp_send(_client, buffer);
|
||||||
|
|
||||||
|
string str = null;
|
||||||
|
if (rc < 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
E_LogInsert("Tighten", "Error", ((RETURN_ERR_STATE)rc).ToString());
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
E_LogInsert("Tighten", "Error", rc.ToString() + "_" + err.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string send_str = "拧紧枪发送数据!";
|
||||||
|
E_LogInsert("Tighten", "Info", send_str);
|
||||||
|
//string hex_str = "send: " + bytes_to_hex_string(buffer, 0, buffer.Length);
|
||||||
|
string raw_str = " " + bytes_to_string(buffer, 0, buffer.Length);
|
||||||
|
E_LogInsert("Tighten", "Info", raw_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
//if(str != null)
|
||||||
|
// tbxProtocolDebug_show(str);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
private void hw_send_HeartBeat()
|
||||||
|
{
|
||||||
|
ToolPacket packet = new ToolPacket();
|
||||||
|
packet.op = 'R';
|
||||||
|
packet.mid = "0204";
|
||||||
|
packet.data_domain_str = "";
|
||||||
|
|
||||||
|
new Thread(new ThreadStart(delegate () {
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
byte[] buffer = packet.compose_protocol();
|
||||||
|
rc = tcp_send(_client, buffer);
|
||||||
|
if (rc < 0)
|
||||||
|
{
|
||||||
|
if (E_DeviceHeartBeat != null)
|
||||||
|
{
|
||||||
|
E_DeviceHeartBeat.Invoke("0");
|
||||||
|
}
|
||||||
|
E_LogInsert("Tighten_HeartBeat", "Error", RETURN_ERR_STATE.RETURN_ESTOP.ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (E_DeviceHeartBeat != null)
|
||||||
|
{
|
||||||
|
E_DeviceHeartBeat.Invoke("1");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
E_LogInsert("Tighten_HeartBeat", "Error", err.Message);
|
||||||
|
if (E_DeviceHeartBeat != null)
|
||||||
|
{
|
||||||
|
E_DeviceHeartBeat.Invoke("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Thread.Sleep(5000);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{ IsBackground = true }.Start();
|
||||||
|
}
|
||||||
|
byte[] normal_buf = new byte[1024];
|
||||||
|
|
||||||
|
private void parse_entry()
|
||||||
|
{
|
||||||
|
Control.CheckForIllegalCrossThreadCalls = false;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
// 未使能运行时,关闭连接,等待使能
|
||||||
|
if(!_is_run)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_client != null)
|
||||||
|
_client.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_client = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
_isconnected = false;
|
||||||
|
_first_connect = true;
|
||||||
|
|
||||||
|
Thread.Sleep(50);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 未连接时,连接硬件接口,失败 2s 周期重连
|
||||||
|
if(!_isconnected)
|
||||||
|
{
|
||||||
|
// 不使能重连
|
||||||
|
if(!_is_reconnect && !_first_connect)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_client != null)
|
||||||
|
_client.Close();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_client = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(50);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_first_connect = false;
|
||||||
|
_reconnect_cnt++;
|
||||||
|
|
||||||
|
if (tcp_connect(ref _client, this.ip, this.port.ToString()))
|
||||||
|
{
|
||||||
|
string send_str = "拧紧枪网络连接成功";
|
||||||
|
E_LogInsert("Tighten", "Info", send_str);
|
||||||
|
_isconnected = true;
|
||||||
|
|
||||||
|
if (E_DeviceHeartBeat != null)
|
||||||
|
{
|
||||||
|
E_DeviceHeartBeat.Invoke("1");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
MID 操作类型 描述 备注
|
||||||
|
0001 R 建立通信连接
|
||||||
|
0002 R 断开连接
|
||||||
|
0103 W Pset选择
|
||||||
|
0201 R 运行状态 Ready/RUN/OK/NG/Err
|
||||||
|
0202 R 最终拧紧结果
|
||||||
|
0203 R 实时曲线数据
|
||||||
|
0301 W 电机运行正转/反转使能 CW/CCW
|
||||||
|
*/
|
||||||
|
var packet = new ToolPacket();
|
||||||
|
packet.op = 'R';
|
||||||
|
packet.mid = "0202";
|
||||||
|
packet.data_domain_str = "";
|
||||||
|
hw_send(packet);
|
||||||
|
|
||||||
|
Thread.Sleep(50);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string send_str = "拧紧枪网络连接失败";
|
||||||
|
E_LogInsert("Tighten", "Error", send_str);
|
||||||
|
if (E_DeviceHeartBeat != null)
|
||||||
|
{
|
||||||
|
E_DeviceHeartBeat.Invoke("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(2000);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int recv_len = hw_receive(normal_buf, 0, normal_buf.Length);
|
||||||
|
if (recv_len < 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(50);
|
||||||
|
_isconnected = false;
|
||||||
|
if (E_DeviceHeartBeat != null)
|
||||||
|
{
|
||||||
|
E_DeviceHeartBeat.Invoke("0");
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TightenParam
|
||||||
|
{
|
||||||
|
public string hex { get; set; }
|
||||||
|
public string raw { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
290
DK_DC_Tool/ToolPacket.cs
Normal file
@@ -0,0 +1,290 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DK_DC_Tool
|
||||||
|
{
|
||||||
|
public class ToolDataDomain
|
||||||
|
{
|
||||||
|
public string pid;
|
||||||
|
public List<string> data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ToolPacket:ICloneable
|
||||||
|
{
|
||||||
|
const byte head = 0x02;
|
||||||
|
const byte tail = 0x03;
|
||||||
|
const byte min_length = 11;
|
||||||
|
|
||||||
|
public int type; //0: TCP 报文格式 1: 串口报文格式
|
||||||
|
public UInt32 data_packet_length;
|
||||||
|
public char op;
|
||||||
|
public string mid;
|
||||||
|
public string data_domain_str;
|
||||||
|
public List<ToolDataDomain> data_domains;
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
ToolPacket packet = (ToolPacket)this.MemberwiseClone();
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<ToolDataDomain> get_data_domains(string str)
|
||||||
|
{
|
||||||
|
List<ToolDataDomain> tds = new List<ToolDataDomain>();
|
||||||
|
|
||||||
|
string[] rs = str.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
foreach (string s in rs)
|
||||||
|
{
|
||||||
|
s.Trim();
|
||||||
|
string[] ds = s.Split(new char[1] { '=' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
if (ds.Length != 2)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ToolDataDomain data_domain = new ToolDataDomain();
|
||||||
|
data_domain.pid = ds[0].Trim();
|
||||||
|
string[] cs = ds[1].Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
foreach (string cs2 in cs)
|
||||||
|
{
|
||||||
|
cs2.Trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
data_domain.data = new List<string>(cs);
|
||||||
|
tds.Add(data_domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update_data_domain_str()
|
||||||
|
{
|
||||||
|
this.data_domain_str = "";
|
||||||
|
|
||||||
|
foreach (ToolDataDomain domain in this.data_domains)
|
||||||
|
{
|
||||||
|
this.data_domain_str += domain.pid + "=";
|
||||||
|
for (int i = 0; i < domain.data.Count; i++)
|
||||||
|
{
|
||||||
|
this.data_domain_str += domain.data[i];
|
||||||
|
if (i != domain.data.Count - 1)
|
||||||
|
this.data_domain_str += ",";
|
||||||
|
}
|
||||||
|
this.data_domain_str += ";";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual byte[] compose_protocol()
|
||||||
|
{
|
||||||
|
List<byte> data_list = new List<byte>();
|
||||||
|
byte[] tmp = new byte[100];
|
||||||
|
|
||||||
|
data_list.Add(head);
|
||||||
|
|
||||||
|
int data_len = 5 + this.data_domain_str.Length;
|
||||||
|
Array.Clear(tmp, 0, tmp.Length);
|
||||||
|
tmp[0] = (byte)(data_len >> 24);
|
||||||
|
tmp[1] = (byte)(data_len >> 16);
|
||||||
|
tmp[2] = (byte)(data_len >> 8);
|
||||||
|
tmp[3] = (byte)(data_len);
|
||||||
|
data_list.AddRange(tmp.Take(4));
|
||||||
|
data_list.Add((byte)this.op);
|
||||||
|
byte[] mid_buf = Encoding.UTF8.GetBytes(this.mid);
|
||||||
|
Array.Clear(tmp, 0, tmp.Length);
|
||||||
|
Array.Copy(mid_buf, tmp, (mid_buf.Length > 4) ? 4 : mid_buf.Length);
|
||||||
|
data_list.AddRange(tmp.Take(4));
|
||||||
|
data_list.AddRange(Encoding.UTF8.GetBytes(this.data_domain_str).ToList());
|
||||||
|
data_list.Add(tail);
|
||||||
|
|
||||||
|
this.type = 0;
|
||||||
|
this.data_domains = get_data_domains(this.data_domain_str);
|
||||||
|
this.data_packet_length = (UInt32)data_list.Count;
|
||||||
|
|
||||||
|
return data_list.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int decompose_protocol(byte[] buf, ToolPacket packet)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (buf.Length - min_length < 0)
|
||||||
|
break;
|
||||||
|
if (buf[0] != head)
|
||||||
|
break;
|
||||||
|
UInt32 _data_packet_len = (((UInt32)buf[1] << 24) +
|
||||||
|
((UInt32)buf[2] << 16) +
|
||||||
|
((UInt32)buf[3] << 8) +
|
||||||
|
(UInt32)buf[4]);
|
||||||
|
if ((buf.Length - (min_length + _data_packet_len - 5)) < 0)
|
||||||
|
break;
|
||||||
|
if (buf[5 + _data_packet_len] != tail)
|
||||||
|
break;
|
||||||
|
if (_data_packet_len < 5)
|
||||||
|
break;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
packet.type = 0;
|
||||||
|
packet.data_packet_length = _data_packet_len;
|
||||||
|
packet.op = (char)buf[5];
|
||||||
|
packet.mid = Encoding.UTF8.GetString(buf, 6, 4);
|
||||||
|
packet.data_domain_str = Encoding.UTF8.GetString(buf, 10, (int)_data_packet_len - 5);
|
||||||
|
packet.data_domains = get_data_domains(packet.data_domain_str);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = 6 + (int)_data_packet_len;
|
||||||
|
} while (false);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class ToolSerialPacket : ToolPacket
|
||||||
|
{
|
||||||
|
const byte head = 0x55;
|
||||||
|
const byte min_length = 7;
|
||||||
|
|
||||||
|
public byte addr;
|
||||||
|
public byte protocol;
|
||||||
|
|
||||||
|
/* Table of CRC values for high-order byte */
|
||||||
|
static Byte[] table_crc_hi = {
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
|
||||||
|
0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
|
||||||
|
0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
|
||||||
|
0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
|
||||||
|
0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
|
||||||
|
0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
|
||||||
|
0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
|
||||||
|
0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
|
||||||
|
0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
|
||||||
|
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
|
||||||
|
0x80, 0x41, 0x00, 0xC1, 0x81, 0x40
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Table of CRC values for low-order byte */
|
||||||
|
static Byte[] table_crc_lo = {
|
||||||
|
0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06,
|
||||||
|
0x07, 0xC7, 0x05, 0xC5, 0xC4, 0x04, 0xCC, 0x0C, 0x0D, 0xCD,
|
||||||
|
0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09,
|
||||||
|
0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A,
|
||||||
|
0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC, 0x14, 0xD4,
|
||||||
|
0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3,
|
||||||
|
0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3,
|
||||||
|
0xF2, 0x32, 0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4,
|
||||||
|
0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A,
|
||||||
|
0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, 0x28, 0xE8, 0xE9, 0x29,
|
||||||
|
0xEB, 0x2B, 0x2A, 0xEA, 0xEE, 0x2E, 0x2F, 0xEF, 0x2D, 0xED,
|
||||||
|
0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26,
|
||||||
|
0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60,
|
||||||
|
0x61, 0xA1, 0x63, 0xA3, 0xA2, 0x62, 0x66, 0xA6, 0xA7, 0x67,
|
||||||
|
0xA5, 0x65, 0x64, 0xA4, 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F,
|
||||||
|
0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68,
|
||||||
|
0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA, 0xBE, 0x7E,
|
||||||
|
0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5,
|
||||||
|
0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71,
|
||||||
|
0x70, 0xB0, 0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92,
|
||||||
|
0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C,
|
||||||
|
0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B,
|
||||||
|
0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89, 0x4B, 0x8B,
|
||||||
|
0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,
|
||||||
|
0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42,
|
||||||
|
0x43, 0x83, 0x41, 0x81, 0x80, 0x40
|
||||||
|
};
|
||||||
|
|
||||||
|
static UInt16 crc16(Byte[] buffer, int buffer_length)
|
||||||
|
{
|
||||||
|
Byte crc_hi = 0xFF; /* high CRC byte initialized */
|
||||||
|
Byte crc_lo = 0xFF; /* low CRC byte initialized */
|
||||||
|
UInt32 i; /* will index into CRC lookup */
|
||||||
|
UInt32 j = 0;
|
||||||
|
|
||||||
|
/* pass through message buffer */
|
||||||
|
while (buffer_length-- > 0)
|
||||||
|
{
|
||||||
|
i = (UInt32)(crc_hi ^ buffer[j++]); /* calculate the CRC */
|
||||||
|
crc_hi = (Byte)(crc_lo ^ table_crc_hi[i]);
|
||||||
|
crc_lo = table_crc_lo[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return (UInt16)(crc_hi << 8 | crc_lo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte[] compose_protocol()
|
||||||
|
{
|
||||||
|
byte[] packet_data = base.compose_protocol();
|
||||||
|
this.type = 1;
|
||||||
|
|
||||||
|
List<byte> data_list = new List<byte>();
|
||||||
|
data_list.Add(head);
|
||||||
|
data_list.Add(this.addr);
|
||||||
|
data_list.Add(this.protocol);
|
||||||
|
int data_len = packet_data.Length;
|
||||||
|
data_list.Add((byte)(data_len >> 8));
|
||||||
|
data_list.Add((byte)data_len);
|
||||||
|
data_list.AddRange(packet_data.ToList());
|
||||||
|
UInt16 crc_calculated = crc16(data_list.ToArray(), data_list.Count);
|
||||||
|
data_list.Add((byte)(crc_calculated >> 8));
|
||||||
|
data_list.Add((byte)crc_calculated);
|
||||||
|
|
||||||
|
return data_list.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int decompose_protocol(byte[] buf, ToolSerialPacket packet)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (buf.Length - min_length < 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (buf[0] != head)
|
||||||
|
break;
|
||||||
|
|
||||||
|
UInt32 _data_packet_len = ((UInt32)buf[3] << 8) + (UInt32)buf[4];
|
||||||
|
if ((buf.Length - (min_length + _data_packet_len)) < 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
UInt16 crc_recv = (UInt16)((buf[5 + _data_packet_len] << 8) + buf[6 + _data_packet_len]);
|
||||||
|
UInt16 crc_calc = crc16(buf, 5 + (int)_data_packet_len);
|
||||||
|
if (crc_recv != crc_calc)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (ToolPacket.decompose_protocol(buf.Skip(5).Take((int)_data_packet_len).ToArray(), packet) <= 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
packet.type = 1;
|
||||||
|
packet.addr = buf[1];
|
||||||
|
packet.protocol = buf[2];
|
||||||
|
|
||||||
|
rc = min_length + (int)_data_packet_len;
|
||||||
|
} while (false);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4
DK_DC_Tool/packages.config
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="log4net" version="2.0.14" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||