chore: 初始化东安动力MES采集程序

This commit is contained in:
yexingqiang
2026-05-29 13:57:19 +08:00
commit b5c49a5d86
1121 changed files with 168795 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?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" />
<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.6.1" />
</startup>
</configuration>

View File

@@ -0,0 +1,99 @@
<?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>{7675A31A-4E0A-4A46-B5DC-D7B9747A8347}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>MesFun</RootNamespace>
<AssemblyName>MesFun</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MesFunction.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MesFunction.Designer.cs">
<DependentUpon>MesFunction.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
<Name>00MesWorkMqtt</Name>
</ProjectReference>
<ProjectReference Include="..\..\MisDataFunDll\MisDataFunDll\13.4MisDataFunDll.csproj">
<Project>{a0de975b-3afc-4f39-920e-29a874480a36}</Project>
<Name>13.4MisDataFunDll</Name>
</ProjectReference>
<ProjectReference Include="..\..\MIS_FuntionSaveData\MIS_FuntionSaveData\13.3MIS_FuntionSaveData.csproj">
<Project>{55b510c1-59e9-4bfd-ae84-d76d46f6e365}</Project>
<Name>13.3MIS_FuntionSaveData</Name>
</ProjectReference>
<ProjectReference Include="..\..\TagTypeCodeID\TagTypeCodeID\13.2TagTypeCodeID.csproj">
<Project>{807fcc00-d1d5-45df-a60d-e295640eb6aa}</Project>
<Name>13.2TagTypeCodeID</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,40 @@
namespace MesFun
{
partial class MesFunction
{
/// <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.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@@ -0,0 +1,42 @@
using MisDataSaveDate;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MesFun
{
public partial class MesFunction : Form
{
public MesFunction()
{
InitializeComponent();
}
private void InitMqtt()
{
string url;
string topicMqttTargetTopicPLC;
string topicMqttTargetTopicTagTypeCodeID;
url = ConfigurationManager.AppSettings["MqttUrl"];
//与web页面返回监控的主题一样的
topicMqttTargetTopicPLC = ConfigurationManager.AppSettings["MqttTargetTopicPLC"];
topicMqttTargetTopicTagTypeCodeID = ConfigurationManager.AppSettings["MqttTargetTopicTagTypeCodeID"];
//变量变化日志
new InitMqtt2(url, topicMqttTargetTopicTagTypeCodeID);
MesWorkMqtt.Mqtt.StartAsync();
//保存质量数据
new MisDataSaveDate.Funtion().InitMqtt2(url, topicMqttTargetTopicPLC);
//处理MES业务的Function
new MisDataFunDll.MisDataFun().InitMqtt2(url, topicMqttTargetTopicPLC);
}
}
}

View File

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

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("MesFun")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MesFun")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("7675a31a-4e0a-4a46-b5dc-d7b9747a8347")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MesFun.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MesFun.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MesFun.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View 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>

View File

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

View File

@@ -0,0 +1,48 @@
<?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>{FA0F10D0-7898-49F2-BB4B-BE550F511F57}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MesFunDll</RootNamespace>
<AssemblyName>MesFunDll</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="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="MesFunDll.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("MesFunDll")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MesFunDll")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("fa0f10d0-7898-49f2-bb4b-be550f511f57")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

211
MisDataFun/MisDataFun.sln Normal file
View File

@@ -0,0 +1,211 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MisDataFun", "MisDataFun\MisDataFun.csproj", "{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "00-0Json8.3.1", "..\Common\00-1Json8.3\Json8.3\00-0Json8.3.1.csproj", "{1A10FDB2-1A6A-44A8-AB4D-33387563247E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "00MesWorkMqtt", "..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj", "{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01_01DoWhatPlc", "..\Common\01DoWhatPlc\01_01DoWhatPlc.csproj", "{0D1AF432-439A-4920-8692-43AE139F5530}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04-DataBaseAccess", "..\Common\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj", "{F434E066-4C59-47C8-AA82-6F48CC84501A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "07BusinessFacade", "..\Common\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj", "{F0A0C525-03FD-428A-9B17-7F54AA0E4475}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "08-WebFun_base", "..\Common\08WebFun_base\WebFun_base\08-WebFun_base.csproj", "{D98BE764-ADEB-488D-9714-61E308AA8201}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09-MesDataFunction", "..\Common\09MesDataFunction\MesDataFunction\09-MesDataFunction.csproj", "{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03Function", "03Function", "{4BF576F8-7AFE-41D3-A998-2AE62375DEC6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01Common", "01Common", "{7CAB05BF-8588-4D5C-B369-C2F773F1A16E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "13.3MIS_FuntionSaveData", "..\MIS_FuntionSaveData\MIS_FuntionSaveData\13.3MIS_FuntionSaveData.csproj", "{55B510C1-59E9-4BFD-AE84-D76D46F6E365}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "13.4MisDataFunction", "..\MisDataFunDll\MisDataFunDll\13.4MisDataFunction.csproj", "{A0DE975B-3AFC-4F39-920E-29A874480A36}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "00-1AppConfigSetForm", "..\Common\00-2AppConfigSet\AppConfigSet\00-1AppConfigSetForm.csproj", "{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10MesControl", "..\Common\10SignalChangeMonitorControl\10MesControl.csproj", "{FAB322CC-531D-4AEA-986A-B921B64D8D3F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "11MonitorForm", "..\Common\11MonitorForm\11MonitorForm.csproj", "{488BADD9-579F-4BF3-91DC-9FA95E3181A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "12SendMessageToWeb", "SendMessageToWebMqtt\12SendMessageToWeb.csproj", "{E4EB6420-906D-4672-947A-CA33DDCDADFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "00_MyLog4Net", "..\Common\MyLog4Net\00_MyLog4Net.csproj", "{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Function53801", "..\MisDataFunction\MesServer.Function\Function53801\Function53801.csproj", "{8B938C93-1751-450E-984A-E8237A4EAF75}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Function53802", "..\MisDataFunction\MesServer.Function\Function53802\Function53802.csproj", "{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Debug|x86.ActiveCfg = Debug|Any CPU
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Debug|x86.Build.0 = Debug|Any CPU
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Release|Any CPU.Build.0 = Release|Any CPU
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Release|x86.ActiveCfg = Release|Any CPU
{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}.Release|x86.Build.0 = Release|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Debug|x86.ActiveCfg = Debug|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Debug|x86.Build.0 = Debug|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Release|Any CPU.Build.0 = Release|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Release|x86.ActiveCfg = Release|Any CPU
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Release|x86.Build.0 = Release|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Debug|x86.ActiveCfg = Debug|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Debug|x86.Build.0 = Debug|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Release|Any CPU.Build.0 = Release|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Release|x86.ActiveCfg = Release|Any CPU
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Release|x86.Build.0 = Release|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Debug|x86.ActiveCfg = Debug|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Debug|x86.Build.0 = Debug|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Release|Any CPU.Build.0 = Release|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Release|x86.ActiveCfg = Release|Any CPU
{0D1AF432-439A-4920-8692-43AE139F5530}.Release|x86.Build.0 = Release|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Debug|x86.ActiveCfg = Debug|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Debug|x86.Build.0 = Debug|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Release|Any CPU.Build.0 = Release|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Release|x86.ActiveCfg = Release|Any CPU
{F434E066-4C59-47C8-AA82-6F48CC84501A}.Release|x86.Build.0 = Release|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|x86.ActiveCfg = Debug|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|x86.Build.0 = Debug|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|Any CPU.Build.0 = Release|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|x86.ActiveCfg = Release|Any CPU
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|x86.Build.0 = Release|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Debug|x86.ActiveCfg = Debug|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Debug|x86.Build.0 = Debug|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Release|Any CPU.Build.0 = Release|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Release|x86.ActiveCfg = Release|Any CPU
{D98BE764-ADEB-488D-9714-61E308AA8201}.Release|x86.Build.0 = Release|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|x86.ActiveCfg = Debug|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|x86.Build.0 = Debug|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|Any CPU.Build.0 = Release|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|x86.ActiveCfg = Release|Any CPU
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|x86.Build.0 = Release|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Debug|x86.ActiveCfg = Debug|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Debug|x86.Build.0 = Debug|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Release|Any CPU.Build.0 = Release|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Release|x86.ActiveCfg = Release|Any CPU
{55B510C1-59E9-4BFD-AE84-D76D46F6E365}.Release|x86.Build.0 = Release|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Debug|x86.ActiveCfg = Debug|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Debug|x86.Build.0 = Debug|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Release|Any CPU.Build.0 = Release|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Release|x86.ActiveCfg = Release|Any CPU
{A0DE975B-3AFC-4F39-920E-29A874480A36}.Release|x86.Build.0 = Release|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Debug|x86.ActiveCfg = Debug|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Debug|x86.Build.0 = Debug|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Release|Any CPU.Build.0 = Release|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Release|x86.ActiveCfg = Release|Any CPU
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF}.Release|x86.Build.0 = Release|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Debug|x86.ActiveCfg = Debug|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Debug|x86.Build.0 = Debug|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Release|Any CPU.Build.0 = Release|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Release|x86.ActiveCfg = Release|Any CPU
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Release|x86.Build.0 = Release|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Debug|x86.ActiveCfg = Debug|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Debug|x86.Build.0 = Debug|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Release|Any CPU.Build.0 = Release|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Release|x86.ActiveCfg = Release|Any CPU
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Release|x86.Build.0 = Release|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Debug|x86.ActiveCfg = Debug|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Debug|x86.Build.0 = Debug|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Release|Any CPU.Build.0 = Release|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Release|x86.ActiveCfg = Release|Any CPU
{E4EB6420-906D-4672-947A-CA33DDCDADFC}.Release|x86.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}.Debug|x86.ActiveCfg = Debug|Any CPU
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Debug|x86.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
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Release|x86.ActiveCfg = Release|Any CPU
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Release|x86.Build.0 = Release|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Debug|x86.ActiveCfg = Debug|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Debug|x86.Build.0 = Debug|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Release|Any CPU.Build.0 = Release|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Release|x86.ActiveCfg = Release|Any CPU
{8B938C93-1751-450E-984A-E8237A4EAF75}.Release|x86.Build.0 = Release|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Debug|x86.ActiveCfg = Debug|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Debug|x86.Build.0 = Debug|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Release|Any CPU.Build.0 = Release|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Release|x86.ActiveCfg = Release|Any CPU
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1A10FDB2-1A6A-44A8-AB4D-33387563247E} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{0D1AF432-439A-4920-8692-43AE139F5530} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{F434E066-4C59-47C8-AA82-6F48CC84501A} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{F0A0C525-03FD-428A-9B17-7F54AA0E4475} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{D98BE764-ADEB-488D-9714-61E308AA8201} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{90E76FB4-646D-45E2-95DB-0B8AB4E465D6} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{5FD5DE57-CC26-4FD0-B852-5362123BC4FF} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{FAB322CC-531D-4AEA-986A-B921B64D8D3F} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{488BADD9-579F-4BF3-91DC-9FA95E3181A5} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{E4EB6420-906D-4672-947A-CA33DDCDADFC} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F} = {7CAB05BF-8588-4D5C-B369-C2F773F1A16E}
{8B938C93-1751-450E-984A-E8237A4EAF75} = {4BF576F8-7AFE-41D3-A998-2AE62375DEC6}
{AF1B57A2-587D-4DE6-8D05-5DA12E18E154} = {4BF576F8-7AFE-41D3-A998-2AE62375DEC6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9BB32B35-134E-4853-B853-73A014D416DF}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!--变量模拟测试开关1为开启-->
<add key="IsDemoMesServer" value="1" />
<!--是启用写监控报错日志-->
<add key="IsWriteMonitorLog" value="1" />
<!--是启用保存监控变量到数据库-->
<add key="IsRecordTagStatus" value="1" />
<add key="MqttUrl" value="127.0.0.1:1883,WEB/InstantMessaging/BQ/MisServer"/>
<add key="TopicList" value="PLC/InstantMessaging/BQ/+,PLC|WEB/InstantMessaging/BQ/MisServer,WEB"/>
<!--Function 发送信息到 web 端-->
<add key="MqttTargetTopic" value="MES/InstantMessaging/BQ"/>
<!--WEB发送信息到FUNCTION MES端 按钮的 无用-->
<add key="MqttTargetTopicWEB" value="WEB/InstantMessaging/BQ/MisServer"/>
<!--WEB发送信息到FUNCTION MES端 这个是甘特图用到的 -->
<add key="MqttTargetTopicBAR" value="BAR/InstantMessaging/BQ"/>
<add key="Url_WebApi" value="http://localhost:41186"/>
<add key="ConnectionString_MES" value="server=.;User ID=sa;Password=126.com;database=MES_ZGHF_538;Connection Reset=FALSE"/>
<add key="ConnectionString_DT" value="server=.;User ID=sa;Password=126.com;database=MES_ZGHF_538;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>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MisDataName
{
public struct ControlData
{
public ControlData(Control Ctrl, string OpName)
{
string[] Array_NameSplit;
Array_NameSplit = Ctrl.Name.Split('_');
TagType = Convert.ToInt32(Array_NameSplit[2]);
opName = OpName;
btn = Ctrl;
}
public int TagType;
public string opName;
public Control btn;
}
public struct ControlChangeByTagType
{
public ControlChangeByTagType(int tagType, string value)
{
TagType = tagType;
Value = value;
}
public int TagType;
public string Value;
}
}

View File

@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using SystemFramework;
namespace MisDataName
{
public partial class MisData
{
void OpenSecondForm_Thread()
{
try
{
ToolStripMenuItem_VWSStatus.Checked = true;
Thread t = new Thread(new ParameterizedThreadStart(OpenSecondForm));
t.Start(this);
SecondForm.MainMenuRefresh = new MisDataName.SecondAct(RefreshToolStripMenuItem_Checked_ByName);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message );
}
}
Form Sencondform;
void OpenSecondForm( object ThisForm)
{
try
{
SecondForm f1 = new SecondForm( ThisForm);
Sencondform = f1;
f1.ShowDialog();
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message );
}
}
void RefreshToolStripMenuItem_Checked_ByName(string ControlName)
{
try
{
ToolStripItem[] tsItems = menuStrip_Main.Items.Find(ControlName, true);
ToolStripMenuItem tsmItem = (ToolStripMenuItem)tsItems[0];
if (PlcChange == null)
{
tsmItem.Checked = false;
}
else
{
tsmItem.Checked = true;
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message );
}
}
object QueryFormPosition(object obj)
{
try
{
return new Point(this.Left + this.Width, this.Top);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
return null;
}
}
}
}

View File

@@ -0,0 +1,515 @@
using BasicData;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using SystemFramework;
namespace MisDataName
{
public partial class MisData
{
public void InitFormBtnColor()
{
try
{
if (!Cbx_StatusDisplay.Checked) return;
string OpName = WorkStationNum_Now;
foreach (Control GroupBox in this.groupBox_SignialSimulator.Controls)
{
foreach (Control Btn in GroupBox.Controls)
{
if (Btn.Name.Length < 8) continue;
if (Btn.Name.Substring(0, 8) == "Btn_PLC_" || Btn.Name.Substring(0, 8) == "Btn_MES_")
{
ControlData Ctrl1 = new ControlData(Btn, OpName);
Thread t=new Thread(new ParameterizedThreadStart(InitFormBtn_Thread));
t.Start(Ctrl1);
}
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
static object test;
static void InitFormBtn_Thread(Object obj)
{
try
{
ControlData Btn = (ControlData)obj;
test = ReadPLC(Btn.TagType, Btn.opName);
bool Result = Convert.ToBoolean(test);
if (Btn.btn.InvokeRequired)
{
Action<System.Drawing.Color> actionDelegate = (x) => { Btn.btn.BackColor = x; };
if (Result)
{
Btn.btn.BeginInvoke(actionDelegate, System.Drawing.Color.Green);
}
else
{
Btn.btn.BeginInvoke(actionDelegate, System.Drawing.Color.SlateGray);
}
}
else
{
if (Result)
{
Btn.btn.BackColor = System.Drawing.Color.Green;
}
else
{
Btn.btn.BackColor = System.Drawing.Color.SlateGray;
}
}
}
catch (Exception err)
{
ControlData Btn = (ControlData)obj;
ApplicationLog.WriteLog(err, err.Message+"采集数据值:"+ ";按钮名称:"+test+ Btn.btn .Name +"工位号"+ WorkStationNum_Now);
}
}
/// <summary>
/// 通过点击界面按钮写入Bool信号
/// </summary>
/// <param name="tagType"></param>
/// <param name="opName"></param>
private void WriteBoolSignalByFormBtn(Object Sender)
{
try
{
string BtnName = ((System.Windows.Forms.Control)Sender).Name;
string[] Array_BtnNameSplit = BtnName.Split('_');
int tagType = Convert.ToInt32(Array_BtnNameSplit[2]);
string OpName = WorkStationNum_Now;
QualityDataQueryStruct QualityQueryStruct = new QualityDataQueryStruct(OpName, tagType);
Thread t = new Thread(new ParameterizedThreadStart(WriteBoolSignal_Thread));
t.Start(QualityQueryStruct);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void WriteBoolSignal_Thread(object obj)
{
try
{
QualityDataQueryStruct QDQ = (QualityDataQueryStruct)obj;
if (IsDemoMesServer==1)
{
string tagValueStr = "";
Read_TagTypeID(QDQ.tagType, QDQ.OpName, out tagValueStr);
if (tagValueStr=="1")
{
tagValueStr = "True";
}
else if (tagValueStr == "0")
{
tagValueStr = "False";
}
bool ReadResult = Convert.ToBoolean(tagValueStr);
if (ReadResult)
{
Write_TagTypeID(QDQ.tagType, QDQ.OpName, false);
}
else
{
Write_TagTypeID(QDQ.tagType, QDQ.OpName, true);
}
}
else
{
bool ReadResult = Convert.ToBoolean(MesDataFunction.OpcOperation.ReadPLC(QDQ.tagType, QDQ.OpName));
if (ReadResult)
{
MesDataFunction.OpcOperation.WritePLC(QDQ.tagType, QDQ.OpName, false);
}
else
{
MesDataFunction.OpcOperation.WritePLC(QDQ.tagType, QDQ.OpName, true);
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
/// <summary>
/// 写入机型
/// </summary>
/// <param name="Sender"></param>
private void WriteNormalDataBygroupBox_SignialSimulatorWriteBtn(object Sender)
{
try
{
string BtnName = ((System.Windows.Forms.Control)Sender).Name;
string OpName = WorkStationNum_Now;
if (BtnName == "Btn_Write_PLC")
{
foreach (Control Tbx in this.groupBox_PLC.Controls)
{
if (Tbx.Name.Length < 12) continue;
if (Tbx.Name.Substring(0, 8) != "Tbx_PLC_") continue;
string[] TbxName_Split = Tbx.Name.Split('_');
int TagType = Convert.ToInt32(TbxName_Split[2]);
int tagDataType = Convert.ToInt32(MesDataFunction.OpcOperation.hashtable_TagTypeDataType[TagType.ToString()]);
string tagValue = Tbx.Text.Trim();
short tagValue_int;
string tagValue_str;
byte tagValue_byte;
bool tagValue_bool;
switch (tagDataType)
{
case 2:
if (!Regex.IsMatch(tagValue, @"^[-]?\d*$"))
{
MessageBox.Show("文本框\"" + Tbx.Name + "\"输入不是整数!");
return;
}
if (tagValue == "") return;
tagValue_int = Convert.ToInt16(tagValue);
WriteAnyData_Thread(TagType, OpName, tagValue_int);
break;
case 8:
tagValue_str = tagValue.ToString();
WriteAnyData_Thread(TagType, OpName, tagValue_str);
break;
case 17:
if (!Regex.IsMatch(tagValue, @"^[-]?\d*$"))
{
MessageBox.Show("文本框\"" + Tbx.Name + "\"输入不是整数!");
return;
}
if (Convert.ToInt32(tagValue) > 255)
{
MessageBox.Show("文本框\"" + Tbx.Name + "\"输入数据不在范围内");
return;
}
if (tagValue == "") return;
tagValue_byte = Convert.ToByte(tagValue);
WriteAnyData_Thread(TagType, OpName, tagValue_byte);
break;
case 11:
tagValue_bool = Convert.ToBoolean(Convert.ToInt32(tagValue));
WriteAnyData_Thread(TagType, OpName, tagValue_bool);
break;
default:
tagValue_str = tagValue.ToString();
WriteAnyData_Thread(TagType, OpName, tagValue_str);
break;
}
}
}
else if (BtnName == "Btn_Write_MES")
{
foreach (Control Tbx in this.groupBox_MES.Controls)
{
if (Tbx.Name.Length < 12) continue;
if (Tbx.Name.Substring(0, 8) != "Tbx_MES_") continue;
string[] TbxName_Split = Tbx.Name.Split('_');
int TagType = Convert.ToInt32(TbxName_Split[2]);
int tagDataType = Convert.ToInt32(MesDataFunction.OpcOperation.hashtable_TagTypeDataType[TagType.ToString()]);
string tagValue = Tbx.Text.Trim();
short tagValue_int;
string tagValue_str;
byte tagValue_byte;
bool tagValue_bool;
switch (tagDataType)
{
case 2:
if (!Regex.IsMatch(tagValue, @"^[-]?\d*$"))
{
MessageBox.Show("文本框\"" + Tbx.Name + "\"输入不是整数!");
return;
}
tagValue_int = Convert.ToInt16(tagValue);
WriteAnyData_Thread(TagType, OpName, tagValue_int);
break;
case 8:
tagValue_str = tagValue.ToString();
WriteAnyData_Thread(TagType, OpName, tagValue_str);
break;
case 17:
if (!Regex.IsMatch(tagValue, @"^[-]?\d*$"))
{
MessageBox.Show("文本框\"" + Tbx.Name + "\"输入不是整数!");
return;
}
if (Convert.ToInt32(tagValue) > 255)
{
MessageBox.Show("文本框\"" + Tbx.Name + "\"输入数据不在范围内");
return;
}
tagValue_byte = Convert.ToByte(tagValue);
WriteAnyData_Thread(TagType, OpName, tagValue_byte);
break;
case 11:
tagValue_bool = Convert.ToBoolean(Convert.ToInt32(tagValue));
WriteAnyData_Thread(TagType, OpName, tagValue_bool);
break;
default:
tagValue_str = tagValue.ToString();
WriteAnyData_Thread(TagType, OpName, tagValue_str);
break;
}
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void WriteAnyData_Thread(int tagType, string opName, object tagValue)
{
try
{
QualityDataQueryStruct QualityStruct = new QualityDataQueryStruct(opName, tagType, tagValue);
Thread t = new Thread(new ParameterizedThreadStart(WriteNormalDataBygroupBox_SignialSimulatorWriteBtn_Thread));
t.Start(QualityStruct);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void WriteNormalDataBygroupBox_SignialSimulatorWriteBtn_Thread(object obj)
{
try
{
QualityDataQueryStruct QualityStruct = (QualityDataQueryStruct)obj;
WritePLC(QualityStruct.tagType, QualityStruct. OpName, QualityStruct.tagValue);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
/// <summary>
/// 根据工位号查询质量数据,返回质量数据列表
/// </summary>
/// <param name="opName"></param>
/// <returns></returns>
QualityDataType[] ReadPLC_ValueListForQualityDataTypeArray(string opName)
{
try
{
int i1 = 0;
Hashtable valueList;
valueList = MisDataFunction.Function.ReadPLC_Sync_DataList_MesRead(opName);
if (valueList != null)
{
QualityDataType[] QualityValue = new QualityDataType[valueList.Count];
foreach (DictionaryEntry de in valueList)
{
try
{
QualityValue[i1] = (QualityDataType)de.Value;
i1++;
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
//ThisWorkStationData = QualityValue;
return QualityValue;
}
return null;
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
return null;
}
}
public QualityDataType[] ThisWorkStationData
{ get; set; }
object QueryThisWorkStationDataByTagTypeFromThisWorkStationDataProperty(int TagType)
{
try
{
foreach (QualityDataType Data in ThisWorkStationData)
{
if (Data.tagValueType == TagType)
{
return Data.tagValue;
}
}
return null;
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
return null;
}
}
void RefreshBtnColor(object obj)
{
try
{
ControlChangeByTagType ControlValue = (ControlChangeByTagType)obj;
if (!Cbx_StatusDisplay.Checked) return;
string OpName = WorkStationNum_Now;
foreach (Control GroupBox in this.groupBox_SignialSimulator.Controls)
{
foreach (Control Btn in GroupBox.Controls)
{
if (Btn.Name.Length < 8) continue;
if (Btn.Name.Substring(0, 8) == "Btn_PLC_" || Btn.Name.Substring(0, 8) == "Btn_MES_")
{
string BtnName = Btn.Name;
string[] BtnName_SplitArray = BtnName.Split('_');
if (Btn.InvokeRequired)
{
Action<System.Drawing.Color> ActionDelegate = (x) => { Btn.BackColor = x; };
if (Convert.ToInt32(BtnName_SplitArray[2]) == ControlValue.TagType)
{
if (ControlValue.Value == "1")
{
Btn.BeginInvoke(ActionDelegate, System.Drawing.Color.Green);
}
else
{
Btn.BeginInvoke(ActionDelegate, System.Drawing.Color.LightGray);
}
}
}
else
{
if (Convert.ToInt32(BtnName_SplitArray[2]) == ControlValue.TagType)
{
if (ControlValue.Value == "1")
{
Btn.BackColor = System.Drawing.Color.Green;
}
else
{
Btn.BackColor = System.Drawing.Color.LightGray;
}
}
}
}
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void RefreshBtnColor_Thread(int TagType, string Value)
{
ControlChangeByTagType ControlValue = new ControlChangeByTagType(TagType, Value);
Thread t = new Thread(new ParameterizedThreadStart(RefreshBtnColor));
t.Start(ControlValue);
}
/// <summary>
/// 按钮颜色还原
/// </summary>
void RefreshBtnColorWriteNull()
{
try
{
string OpName = WorkStationNum_Now;
foreach (Control GroupBox in this.groupBox_SignialSimulator.Controls)
{
foreach (Control Btn in GroupBox.Controls)
{
if (Btn.Name.Length < 8) continue;
if (Btn.Name.Substring(0, 8) == "Btn_PLC_" || Btn.Name.Substring(0, 8) == "Btn_MES_")
{
if (Btn.InvokeRequired)
{
Action<System.Drawing.Color> ActionDelegate = (x) => { Btn.BackColor = x; };
Btn.BeginInvoke(ActionDelegate, System.Drawing.Color.LightGray);
}
else
{
Btn.BackColor = System.Drawing.Color.LightGray;
}
}
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
}
}

View File

@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using SystemFramework;
namespace MisDataName
{
partial class MisData
{
void TestPlcConnectInit()
{
//try
//{
// DataTable dt_OpName = (DataTable)FunctionForm_HashiTable.OpName_Hash_Read("OpNameList");
// for (int i=0;i< dt_OpName.Rows .Count;i++)
// {
// TestPlcConnect NewPlcConnect = new TestPlcConnect(dt_OpName.Rows [i][0].ToString ());
// TestPlcConnect.TestPlcTimerChangedDelegate += NewPlcConnect.ExternalTimerExcute;
// NewPlcConnect.PlcConnect += PlcStatusChanged_Connect;
// NewPlcConnect.PlcBreak += PlcStatusChanged_Break;
// TestPlcConnect.HashTable_Write(TestPlcConnect.WorkStationTestExample, dt_OpName.Rows[i][0].ToString(), NewPlcConnect);
// }
//}
//catch (Exception err)
//{
// ApplicationLog.WriteLog(err, err.Message);
//}
}
public static void PlcStatusChanged_Connect(object sender, EventArgs e)
{
try
{
//查询在线工位数量
int i= TestPlcConnect. CalculateWorkStationCount("OnlineWorkStation");
if (MisData.TestPlcStatusDel!=null )
MisData.TestPlcStatusDel(i.ToString (), e);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
public static void PlcStatusChanged_Break(object sender, EventArgs e)
{
try
{
//查询在线工位数量
int i = TestPlcConnect.CalculateWorkStationCount("OnlineWorkStation");
if (MisData.TestPlcStatusDel != null)
MisData.TestPlcStatusDel(i.ToString(), e);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void ListBox1_Item_Init()
{
listBox1.Items.Clear();
try
{
if (MesDataFunction.OpcOperation.hashtable_TagType == null) return;
foreach (var i in MesDataFunction.OpcOperation.hashtable_TagType)
{
listBox1.Items.Add("MES|" + i.ToString() + "|" + WorkStationNum_Now + "|1");
}
}
catch
{
}
}
}
}

View File

@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MisDataSaveDate
{
public struct QualityDataQueryStruct
{
public QualityDataQueryStruct(string opName, Control ctrl)
{
OpName = opName;
Ctrl = ctrl;
tagType = 0;
tagValue = "";
tagID = "";
tagTypeID = 0;
tempForm = null;
tagValue2 = null;
}
public QualityDataQueryStruct(string opName, int TagType)
{
OpName = opName;
Ctrl = null;
tagType = TagType;
tagValue = "";
tagID = "";
tagTypeID = 0;
tempForm = null;
tagValue2 = null;
}
public QualityDataQueryStruct(string opName, int TagType, Control ctrl)
{
OpName = opName;
Ctrl = ctrl;
tagType = TagType;
tagValue = "";
tagID = "";
tagTypeID = 0;
tempForm = null;
tagValue2 = null;
}
public QualityDataQueryStruct(string opName, int TagType, object TagValue)
{
OpName = opName;
Ctrl = null;
tagType = TagType;
tagValue = TagValue;
tagID = "";
tagTypeID = 0;
tempForm = null;
tagValue2 = null;
}
public QualityDataQueryStruct(string TagID, int TagTypeID, object TagValue, object TagValue2, Form TempForm)
{
OpName = "";
Ctrl = null;
tagType = 0;
tagValue = TagValue;
tagID = TagID;
tagTypeID = TagTypeID;
tempForm = TempForm;
tagValue2 = TagValue2;
}
public string OpName;
public Control Ctrl;
public int tagType;
public object tagValue;
public object tagValue2;
public string tagID;
public int tagTypeID;
public Form tempForm;
}
}

View File

@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using SystemFramework;
namespace MisDataName
{
public partial class MisData
{
void ReadPLC_ProductInfo()
{
try
{
foreach (Control Tbx in this.groupBox_PLC.Controls)
{
Thread t = new Thread(new ParameterizedThreadStart(ReadPLC_ProductInfo_Thread));
t.Start(Tbx);
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void ReadPLC_ProductInfo_Thread(object obj)
{
try
{
Control Tbx = (Control)obj;
if (Tbx.Name.Length < 12) return;
if (Tbx.Name.Substring(0, 8) != "Tbx_PLC_") return;
string[] TbxName_Split = Tbx.Name.Split('_');
int TagType = Convert.ToInt32(TbxName_Split[2]);
if (Tbx.InvokeRequired )
{
Action<string> actionDelegate = (x) => { Tbx.Text = x; };
Tbx.BeginInvoke(actionDelegate, ReadPLC(TagType, WorkStationNum_Now).ToString());
}
else
{
Tbx.Text = ReadPLC(TagType, WorkStationNum_Now).ToString();
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void ReadMES_ProductInfo()
{
try
{
foreach (Control Tbx in this.groupBox_MES.Controls)
{
Thread t = new Thread(new ParameterizedThreadStart(ReadMES_ProductInfo_Thread));
t.Start(Tbx);
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void ReadMES_ProductInfo_Thread(object obj)
{
try
{
Control Tbx = (Control)obj;
if (Tbx.Name.Length < 12) return;
if (Tbx.Name.Substring(0, 8) != "Tbx_MES_") return;
string[] TbxName_Split = Tbx.Name.Split('_');
int TagType = Convert.ToInt32(TbxName_Split[2]);
if (Tbx .InvokeRequired )
{
Action<string> ActionDelegate = (x) => { Tbx.Text = x; };
Tbx.BeginInvoke(ActionDelegate, ReadPLC(TagType, WorkStationNum_Now).ToString());
}
else
{
Tbx.Text = ReadPLC(TagType, WorkStationNum_Now).ToString();
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
}
}

View File

@@ -0,0 +1,175 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace MisDataName
{
public delegate void TestPlcDelegate();
public class TestPlcConnect
{
public static Hashtable WorkStationStatus_Hash = new Hashtable();
public static Hashtable WorkStationTestExample = new Hashtable();
string WorkStationStr = "";
public EventHandler PlcBreak,PlcConnect;
bool PlcStatus=false ;
static int testTime = 10;
int TestInterval = testTime;
string OpName;
public TestPlcConnect(string opName)
{
OpName = opName;
}
public void ExternalSignalChange()
{
TestInterval = testTime;
if(!PlcStatus)
{
WorkStationStr=ReadWorkStationStr("OnlineWorkStation");
HashTable_Write(WorkStationStatus_Hash,"OnlineWorkStation", String_Combine(WorkStationStr, OpName));
WorkStationStr = ReadWorkStationStr("DownlineWorkStation");
HashTable_Write(WorkStationStatus_Hash, "DownlineWorkStation", String_Spl(WorkStationStr, OpName));
if (PlcConnect != null)
{
PlcConnect(OpName, null);
}
PlcStatus = true;
}
}
public void ExternalTimerExcute()
{
if (TestInterval>0)
{
TestInterval--;
}
else
{
if(PlcStatus)
{
WorkStationStr = ReadWorkStationStr("DownlineWorkStation");
HashTable_Write(WorkStationStatus_Hash, "DownlineWorkStation", String_Combine(WorkStationStr, OpName));
WorkStationStr = ReadWorkStationStr("OnlineWorkStation");
HashTable_Write(WorkStationStatus_Hash, "OnlineWorkStation", String_Spl(WorkStationStr, OpName));
if (PlcBreak != null)
{
PlcBreak(OpName, null);
}
PlcStatus = false;
}
}
}
public static void HashTable_Write(Hashtable hashtable, string Key,object obj)
{
if (hashtable.ContainsKey (Key))
{
hashtable[Key] = obj;
}
else
{
hashtable.Add(Key, obj);
}
}
public static object HashTable_Read(Hashtable hashtable, string Key)
{
if (hashtable.ContainsKey(Key))
{
return hashtable[Key];
}
else
{
return null;
}
}
string ReadWorkStationStr(string Key)
{
if ( HashTable_Read(WorkStationStatus_Hash, Key) !=null )
{
return HashTable_Read(WorkStationStatus_Hash, Key).ToString();
}
return "";
}
string String_Combine(string MainStr,string AddStr)
{
return MainStr+ AddStr + "|";
}
string String_Spl(string MainStr, string DelStr)
{
return MainStr.Replace(DelStr + "|", "");
}
public static int CalculateWorkStationCount(string Key)
{
string wksta="";
if(WorkStationStatus_Hash.ContainsKey (Key))
{
wksta = WorkStationStatus_Hash[Key].ToString();
}
string[] wksta_SplitArray = wksta.Split('|');
return wksta_SplitArray.Length-1;
}
public static void HeartBeatChange(string OpName, int TagTypeID)
{
if (TagTypeID == 14)
{
Thread t = new Thread(new ParameterizedThreadStart(HeartBeatChange_Thread));
t.Start(OpName);
}
}
static void HeartBeatChange_Thread(object obj)
{
string OpName = (string)obj;
if (TestPlcConnect.HashTable_Read(TestPlcConnect.WorkStationTestExample, OpName) != null)
{
TestPlcConnect PlcConnectExample = (TestPlcConnect)TestPlcConnect.HashTable_Read(TestPlcConnect.WorkStationTestExample, OpName);
PlcConnectExample.ExternalSignalChange();
}
}
}
}

View File

@@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SystemFramework;
using System.Threading;
namespace MisDataName
{
public partial class MisData
{
void initStationStatus()
{
try
{
if (!Cbx_StatusDisplay.Checked) return;
foreach (Control Tbx in this.groupBox_WorkStationStatus.Controls)
{
Thread t = new Thread(new ParameterizedThreadStart(initStationStatus_Thread));
t.Start(Tbx);
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void initStationStatus_Thread(object obj )
{
try
{
Control Tbx = (Control)obj;
if (Tbx.Name.Length < 12) return ;
if (Tbx.Name.Substring(0, 11) == "Tbx_Status_")
{
string[] TbxNameSplitArray = Tbx.Name.Split('_');
int Tagtype = Convert.ToInt32(TbxNameSplitArray[2]);
if (Tbx .InvokeRequired )
{
Action<string> ActionDelegate = (x) => { Tbx.Text = x; };
Tbx.BeginInvoke(ActionDelegate, MesDataFunction.OpcOperation.ReadPLC(Tagtype, WorkStationNum_Now).ToString());
}
else
{
Tbx.Text = MesDataFunction.OpcOperation.ReadPLC(Tagtype, WorkStationNum_Now).ToString();
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void RefreshStationStatus(object obj)
{
try
{
ControlChangeByTagType ControlValue = (ControlChangeByTagType)obj;
if (!Cbx_StatusDisplay.Checked) return;
foreach (Control Tbx in this.groupBox_WorkStationStatus.Controls)
{
if (Tbx.Name.Length < 12) continue;
if (Tbx.Name.Substring(0, 11) == "Tbx_Status_")
{
string[] TbxNameSplitArray = Tbx.Name.Split('_');
int Tagtype = Convert.ToInt32(TbxNameSplitArray[2]);
if (ControlValue.TagType == Tagtype)
{
if (Tbx.InvokeRequired)
{
Action<string> ActionDelegate = (x) => { Tbx.Text = x; };
Tbx.BeginInvoke(ActionDelegate, ControlValue.Value);
}
else
{
Tbx.Text = ControlValue.Value;
}
}
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void RefreshStationStatus_Thread(int TargetTagtype, string TbxText)
{
ControlChangeByTagType ControlValue = new MisDataName.ControlChangeByTagType(TargetTagtype, TbxText);
Thread t = new Thread(new ParameterizedThreadStart(RefreshStationStatus));
t.Start(ControlValue);
}
void RefreshStationStatusWriteNull()
{
try
{
foreach (Control Tbx in this.groupBox_WorkStationStatus.Controls)
{
if (Tbx.Name.Length < 12) continue;
if (Tbx.Name.Substring(0, 11) == "Tbx_Status_")
{
Tbx.Text = "未开启同步";
}
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
}
}

View File

@@ -0,0 +1,114 @@
namespace MisDataSaveDate
{
partial class WriteQualityValueForm
{
/// <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.label_Message = new System.Windows.Forms.Label();
this.textBox_InputValue = new System.Windows.Forms.TextBox();
this.button_OK = new System.Windows.Forms.Button();
this.button_Cancle = new System.Windows.Forms.Button();
this.comboBox_InputValue = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// label_Message
//
this.label_Message.AutoSize = true;
this.label_Message.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_Message.Location = new System.Drawing.Point(15, 10);
this.label_Message.Name = "label_Message";
this.label_Message.Size = new System.Drawing.Size(41, 12);
this.label_Message.TabIndex = 0;
this.label_Message.Text = "label1";
//
// textBox_InputValue
//
this.textBox_InputValue.Location = new System.Drawing.Point(10, 50);
this.textBox_InputValue.Name = "textBox_InputValue";
this.textBox_InputValue.Size = new System.Drawing.Size(475, 21);
this.textBox_InputValue.TabIndex = 1;
//
// button_OK
//
this.button_OK.Location = new System.Drawing.Point(268, 81);
this.button_OK.Name = "button_OK";
this.button_OK.Size = new System.Drawing.Size(95, 25);
this.button_OK.TabIndex = 2;
this.button_OK.Text = "OK";
this.button_OK.UseVisualStyleBackColor = true;
this.button_OK.Click += new System.EventHandler(this.button_OK_Click);
//
// button_Cancle
//
this.button_Cancle.Location = new System.Drawing.Point(369, 81);
this.button_Cancle.Name = "button_Cancle";
this.button_Cancle.Size = new System.Drawing.Size(95, 25);
this.button_Cancle.TabIndex = 2;
this.button_Cancle.Text = "Cancel";
this.button_Cancle.UseVisualStyleBackColor = true;
this.button_Cancle.Click += new System.EventHandler(this.button_Cancle_Click);
//
// comboBox_InputValue
//
this.comboBox_InputValue.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox_InputValue.FormattingEnabled = true;
this.comboBox_InputValue.Items.AddRange(new object[] {
"false",
"true"});
this.comboBox_InputValue.Location = new System.Drawing.Point(10, 50);
this.comboBox_InputValue.Name = "comboBox_InputValue";
this.comboBox_InputValue.Size = new System.Drawing.Size(475, 20);
this.comboBox_InputValue.TabIndex = 3;
//
// WriteQualityValueForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(494, 111);
this.Controls.Add(this.comboBox_InputValue);
this.Controls.Add(this.button_Cancle);
this.Controls.Add(this.button_OK);
this.Controls.Add(this.textBox_InputValue);
this.Controls.Add(this.label_Message);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "WriteQualityValueForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Write value";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label_Message;
private System.Windows.Forms.TextBox textBox_InputValue;
private System.Windows.Forms.Button button_OK;
private System.Windows.Forms.Button button_Cancle;
private System.Windows.Forms.ComboBox comboBox_InputValue;
}
}

View File

@@ -0,0 +1,275 @@
using System;
using System.Windows.Forms;
using BasicData;
using System.Text.RegularExpressions;
using SystemFramework;
using System.Threading;
using MesDataFunction;
namespace MisDataSaveDate
{
public partial class WriteQualityValueForm : Form
{
QualityDataType SelectListData;
Form MainForm;
public WriteQualityValueForm(QualityDataType SelectData,Form Mainform)
{
try
{
InitializeComponent();
SelectListData = new QualityDataType();
SelectListData = SelectData;
SetForm(SelectData.tagTypeID, SelectData.tagValue);
MainForm = Mainform;
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
private void button_OK_Click(object sender, EventArgs e)
{
try
{
if (!TagTypeID_Confirm(SelectListData.tagTypeID)) return;
this.Hide () ;
QualityDataQueryStruct QualityStruct = new QualityDataQueryStruct(SelectListData.tagID , SelectListData.tagTypeID , comboBox_InputValue.SelectedIndex.ToString(), textBox_InputValue.Text,this);
Thread t = new Thread(new ParameterizedThreadStart(WriteQualityDataByTagID_Thread));
t.Start(QualityStruct);
if (QualityStruct.tagTypeID == 11)
{
MyLog4Net.MyLogHelper.Error($"手动修改值【{SelectListData.opName}】{SelectListData.tagID}", QualityStruct.tagValue.ToString());
}
else
{
MyLog4Net.MyLogHelper.Error($"手动修改值【{SelectListData.opName}】{SelectListData.tagID}", QualityStruct.tagValue2.ToString());
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void WriteQualityDataByTagID_Thread(object obj)
{
try
{
QualityDataQueryStruct QualityStruct = (QualityDataQueryStruct)obj;
Form ThisForm = (Form)QualityStruct.tempForm;
if (QualityStruct.tagTypeID == 11)
{
MesWorkPlc.WritePLC(QualityStruct.tagID, QualityStruct.tagValue.ToString());
}
else
{
MesWorkPlc.WritePLC(SelectListData.tagID, QualityStruct.tagValue2.ToString());
}
MainForm.BeginInvoke (MisDataFun.MainFormRefresh, null, null);
Action ActionDelete = () => { this.Close();this.Dispose(); };
if(this.InvokeRequired )
{
ThisForm.BeginInvoke(ActionDelete);
}
else
{
ActionDelete();
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
private void button_Cancle_Click(object sender, EventArgs e)
{
this.Close();
this.Dispose();
}
void SetForm( int TagTypeID,object TagValue)
{
try
{
switch (TagTypeID)
{
case 11://BOOL
comboBox_InputValue.Enabled = true;
comboBox_InputValue.Visible = true;
textBox_InputValue.Enabled = false;
textBox_InputValue.Visible = false;
label_Message.Text = "Data type: Boolean";
if (Convert.ToBoolean(TagValue))
{
comboBox_InputValue.SelectedIndex = 1;
}
else
{
comboBox_InputValue.SelectedIndex = 0;
}
break;
case 2://INT.
label_Message.Text = "Data type: Int16 Range from -32768 to 32767";
comboBox_InputValue.Enabled = false;
comboBox_InputValue.Visible = false;
textBox_InputValue.Enabled = true;
textBox_InputValue.Visible = true;
textBox_InputValue.Text = TagValue.ToString();
break;
case 17://BYTE
label_Message.Text = "Data type: Byte Range from 0 to 255";
comboBox_InputValue.Enabled = false;
comboBox_InputValue.Visible = false;
textBox_InputValue.Enabled = true;
textBox_InputValue.Visible = true;
textBox_InputValue.Text = TagValue.ToString();
break;
case 8://STRING
label_Message.Text = "Data type: String";
comboBox_InputValue.Enabled = false;
comboBox_InputValue.Visible = false;
textBox_InputValue.Enabled = true;
textBox_InputValue.Visible = true;
textBox_InputValue.Text = TagValue.ToString();
break;
case 18://Word
label_Message.Text = "Data type: UInt16 Range from 0 to 65535";
comboBox_InputValue.Enabled = false;
comboBox_InputValue.Visible = false;
textBox_InputValue.Enabled = true;
textBox_InputValue.Visible = true;
textBox_InputValue.Text = TagValue.ToString();
break;
case 4://real
label_Message.Text = "Data type: Single Range from -3.402823E+38 to 3.402823E+38";
comboBox_InputValue.Enabled = false;
comboBox_InputValue.Visible = false;
textBox_InputValue.Enabled = true;
textBox_InputValue.Visible = true;
textBox_InputValue.Text = TagValue.ToString();
break;
default://Unknow
label_Message.Text = "Data type: Unknow";
comboBox_InputValue.Enabled = false;
comboBox_InputValue.Visible = false;
textBox_InputValue.Enabled = true;
textBox_InputValue.Visible = true;
textBox_InputValue.Text = TagValue.ToString();
break;
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
bool TagTypeID_Confirm( int TagTypeID)
{
try
{
switch (TagTypeID)
{
case 2://INT
//TextBox存在非数字字符 报错
if (!Regex.IsMatch(textBox_InputValue.Text, @"^[-]?\d*$"))
{
MessageBox.Show("输入不是整数!");
return false;
}
if (textBox_InputValue.Text.Length > 9)
{
MessageBox.Show("输入数据不在范围内");
return false;
}
break;
case 17://BYTE
//TextBox存在非数字字符 报错
if (!Regex.IsMatch(textBox_InputValue.Text, @"^[-]?\d*$"))
{
MessageBox.Show("输入不是整数!");
return false;
}
if (Convert.ToInt32(textBox_InputValue.Text.Trim()) > 255)
{
MessageBox.Show("输入数据不在范围内");
return false;
}
break;
case 8://STRING
break;
case 18://Word
//TextBox存在非数字字符 报错
if (!Regex.IsMatch(textBox_InputValue.Text, @"^[-]?\d*$"))
{
MessageBox.Show("输入不是整数!");
return false;
}
if (textBox_InputValue.Text.Trim().Length > 4)
{
MessageBox.Show("输入数据不在范围内");
return false;
}
break;
case 4://real
//TextBox存在非数字字符 报错
//TextBox存在非数字字符 报错
if (!Regex.IsMatch(textBox_InputValue.Text, @"^-?\d+\.?\d*$"))
{
MessageBox.Show("输入不是实数!");
return false;
}
break;
default:
break;
}
return true;
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
return true;
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,923 @@
using bizFacade;
using DataLinkMesWork;
//using DataMirrorToolsPage;
using MesDataFunction;
using MesServerFunctions;
using MesServerWork;
using MesWork;
using MesWork.PLC;
using MesWorkMqtt;
using MisDataFun;
using MQTTnet;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Client.Receiving;
using MQTTnet.Extensions.ManagedClient;
using MQTTnet.Protocol;
using NPOI.XWPF.UserModel;
using OpcData;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using SystemFramework;
using static System.Net.Mime.MediaTypeNames;
namespace MisDataSaveDate
{
/// <summary>
///
/// </summary>
/// <param name="obj1"></param>
/// <param name="obj2"></param>
public delegate void RefreshForm(object obj1, EventArgs obj2);
public partial class MisDataFun: Form
{
static Hashtable hashtableTopicList = new Hashtable();
static bool OnLineMqtt = false;
/// <summary>
///
/// </summary>
public static int IsWriteMonitorLog = Convert.ToInt32(ConfigurationManager.AppSettings["IsWriteMonitorLog"]);
/// <summary>
///
/// </summary>
public static int IsDemoMesServer = Convert.ToInt32(ConfigurationManager.AppSettings["IsDemoMesServer"]);
public static string IsRecordTagStatus = ConfigurationManager.AppSettings["IsRecordTagStatus"];
static bool loadFinish = false;
/// <summary>
/// 允许使用附加功能的变量只有在系统开始加载Tag时才允许读取PLC数据
/// </summary>
public static bool AllowLoad;
/// <summary>
///
/// </summary>
List<String> opNameList;
/// <summary>
///
/// </summary>
DateTime StartTime;
/// <summary>
///
/// </summary>
/// <param name="obj1"></param>
/// <param name="obj2"></param>
public delegate void RefreshForm(object obj1, EventArgs obj2);
/// <summary>
///
/// </summary>
public static RefreshForm MainFormRefresh, TestPlcStatusDel;
public BasicData.QualityDataType[] ThisWorkStationData { get; set; }
public MisDataFun()
{
InitializeComponent();
MisData01();
Init_dataGridView_CheckOpName();
MIS_BASE.InitHashtable_MesServerCode();
InitMesSerVerCode();
}
public void MisData01()
{
DataTable dt_Signal;
DataTable dt_Device;
DataTable dt_TagTypeDataType;
dt_Signal = bizFacade.BaseDataSystemMES.dt_Signal();
dt_Device = bizFacade.BaseDataSystemMES.dt_Device();
dt_TagTypeDataType = bizFacade.BaseDataSystemMES.dt_TagTypeDataType();
var mp = new MesWorkPlc();
StartTime = Convert.ToDateTime(toolStripStatusLabel_StartTime.Text = DateTime.Now.ToString());
Runtime_Thread();
if (mp.LoadOPCData(dt_Signal, dt_Device, IsDemoMesServer, IsWriteMonitorLog, true))
{
MesDataFunction.LoadTagTypeCodeID.Load(dt_TagTypeDataType);
//查询出“全部原始基本数据列表”
var drs = MesWork.PlcLinkForm.dt_BasicData.Select($"是否启用 = 1 and 变量类型代码=101 or 变量类型代码 = 102 or 变量类型代码 = 105 and 监控属性代码 = '{DataLinkMesWork.ApplicationConfig.MES_Code.ToString()}'");
if (drs.Length > 1)
{
MIS_BASE.BasicDataTagValue = MesWork.PlcLinkForm.dt_BasicData.Select($"是否启用 = 1 and 变量类型代码=101 or 变量类型代码 = 102 or 变量类型代码 = 105 and 监控属性代码 = '{DataLinkMesWork.ApplicationConfig.MES_Code.ToString()}'").CopyToDataTable<DataRow>();
if (MIS_BASE.BasicDataTagValue.Columns.Contains("上限值"))
{
MIS_BASE.BasicDataTagValue.Columns["上限值"].ColumnName = "值上限";
}
if (MIS_BASE.BasicDataTagValue.Columns.Contains("下限值"))
{
MIS_BASE.BasicDataTagValue.Columns["下限值"].ColumnName = "值下限";
}
}
// BasicDataTagValue = MesWork.PlcLinkForm.dt_BasicData.Select($"是否启用 = 1 and 监控属性代码 = '{DataLinkMesWork.ApplicationConfig.MES_Code.ToString()}'").CopyToDataTable<DataRow>();
//查询出“MES_基本数据_测量范围”
MesServerWork.MIS_BASE.BasicDataTagValueUpDown = MesWork.PlcLinkForm.dt_BasicData;
if (MesServerWork.MIS_BASE.BasicDataTagValueUpDown.Columns.Contains("上限值"))
{
MesServerWork.MIS_BASE.BasicDataTagValueUpDown.Columns["上限值"].ColumnName = "值上限";
}
if (MesServerWork.MIS_BASE.BasicDataTagValueUpDown.Columns.Contains("下限值"))
{
MesServerWork.MIS_BASE.BasicDataTagValueUpDown.Columns["下限值"].ColumnName = "值下限";
}
// 模拟时,写入质量数据
InitBasicDataTagValue();
// 变量代码与其他字段的对应关系
MesServerWork.MIS_BASE.InitHashtableTagID();
InitcomboBox_OpName();
loadFinish = true;
AllowLoad = true;
MainFormRefresh = new RefreshForm(button_ReadData_Click);
WorkStationNum_Now = comboBox_OpName.SelectedValue.ToString();
TestPlcStatusDel = new RefreshForm(RefreshPlcConnectStatus);
MesWorkPlc.D_OPCTagData_TagDataOnChangeMIS-= OPCTagData_TagDataOnChange;
MesWorkPlc.D_OPCTagData_TagDataOnChangeMIS+= OPCTagData_TagDataOnChange;
}
}
/// <summary>
/// 获得Function调用信息
/// </summary>
private void InitMesSerVerCode()
{
MisDataFunDll.MisDataFun.GetMesServerCodeAndMesDll(out MisDataFunDll.MisDataFun.hashtable_MesServerCode, out MisDataFunDll.MisDataFun.hashtable_MesDll);
MisDataFunDll.MisDataFun.GetBaseData_tagTable_TagName(out MisDataFunDll.MisDataFun.hashtable_TagName, out MisDataFunDll.MisDataFun.hashtable_TagTypeTagName);
FuntionMesRead.GetAlarmInit();
}
public void SaveData_Load(object sender, EventArgs e)
{
MyLog4Net.MyLogHelper.LogCommit += MyLogHelper_LogCommit;
MqttLink();
Thread.Sleep(200);
var deviceState = MesWorkPlc.StartServer(); //开启监控服务
timer_TestPLC.Enabled = true;
}
/// <summary>
/// 模拟时,写入质量数据
/// </summary>
private void InitBasicDataTagValue()
{
if (IsDemoMesServer != 1) return;
string tagID;
double tagValue;
//写工位总合格标志 变量类型代码=21
for (int i = 0; i < MesWork.PlcLinkForm.dt_BasicData.Rows.Count; i++)
{
if (MesWork.PlcLinkForm.dt_BasicData.Rows[i]["变量类型代码"].ToString() == "21")
{
tagID = MesWork.PlcLinkForm.dt_BasicData.Rows[i]["TagID"].ToString();
MesServerWork.MIS_BASE.WritePLC(tagID, 1);
}
}
if (MesServerWork.MIS_BASE.BasicDataTagValue != null)
{
for (int i = 0; i < MesServerWork.MIS_BASE.BasicDataTagValue.Rows.Count; i++)
{
try
{
switch (Convert.ToInt32(MesServerWork.MIS_BASE.BasicDataTagValue.Rows[i]["变量特点"]))
{
case 7:
tagID = MesServerWork.MIS_BASE.BasicDataTagValue.Rows[i]["TagID"].ToString();
MesServerWork.MIS_BASE.WritePLC(tagID, 1);
break;
case 6:
tagID = MesServerWork.MIS_BASE.BasicDataTagValue.Rows[i]["TagID"].ToString();
tagValue = Convert.ToDouble(MesServerWork.MIS_BASE.BasicDataTagValue.Rows[i]["列位置"]) * 100
+ Convert.ToDouble(MesServerWork.MIS_BASE.BasicDataTagValue.Rows[i]["变量排序"]) / 100;
MesServerWork.MIS_BASE.WritePLC(tagID, tagValue);
break;
}
}
catch (Exception ERR)
{
}
}
}
}
/// <summary>
/// 初始化comboBox_OpName工位号
/// </summary>
private void InitcomboBox_OpName()
{
//全部工位号
comboBox_OpName.DataSource = opNameList = MesWork.PlcLinkForm.opNameList;
toolStripStatusLabel_WorkStationNum.Text = MesWork.PlcLinkForm.opNameList.Count.ToString();
toolStripStatusLabel_DownLine.Text = toolStripStatusLabel_WorkStationNum.Text;
}
private void Init_dataGridView_CheckOpName()
{
DataTable dt;
DataTable dt1;
try
{
//dt = BaseDataSystemMES.GetCheckOpName_BQ();
//dataGridView_CheckOpName.DataSource = dt;
dt1 = BaseDataSystemMES.GetCheckOpName();
comboBox_OpNameList.DataSource = dt1;
comboBox_OpNameList.ValueMember = "工位号";
comboBox_OpNameList.DisplayMember = "工位号";
}
catch (Exception ex) { }
}
#region mqtt相关
private void MqttLink()
{
List<MqttTopicFilter> TopicFilterList = new List<MqttTopicFilter>();
string url;
//string topicMqttTargetTopicPLC;
//string topicMqttTargetTopicTagTypeCodeID;
string TopicList;
string[] TopicListFunItems;
string[] TopicListItems;
url = ConfigurationManager.AppSettings["MqttUrl"];
TopicList = ConfigurationManager.AppSettings["TopicList"];
TopicListItems = TopicList.Split('|');
for (int i = 0; i < TopicListItems.Length; i++)
{
TopicListFunItems = TopicListItems[i].Split(',');
hashtableTopicList.Add(TopicListFunItems[0], TopicListFunItems[1]);
}
MesWorkMqtt.Mqtt.StartAsync();
foreach (var topic in TopicListItems)
{
TopicListFunItems = topic.Split(',');
MesWorkMqtt.Mqtt.mqttClient.SubscribeAsync(new MqttTopicFilter { Topic = TopicListFunItems[0] });
}
MesWorkMqtt.Mqtt.mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnSubscriberConnected);
MesWorkMqtt.Mqtt.mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnSubscriberDisconnected);
MesWorkMqtt.Mqtt.mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnSubscriberMessageReceived);
}
/// <summary>
///
/// </summary>
/// <param name="x"></param>
private void OnSubscriberConnected(MqttClientConnectedEventArgs x)
{
MyLog4Net.MyLogHelper.Info("Mqtt", "Mqtt连接成功");
OnLineMqtt = true;
// var rec = x.AuthenticateResult.ResultCode.ToString();
// label_State.Text = rec;
}
/// <summary>
///
/// </summary>
/// <param name="x"></param>
private void OnSubscriberDisconnected(MqttClientDisconnectedEventArgs x)
{
//var rec = x.AuthenticateResult.ResultCode.ToString();
try
{
MyLog4Net.MyLogHelper.Error("Mqtt", "Mqtt断开连接Reason" + x.Reason);
OnLineMqtt = false;
}
catch (Exception err)
{
}
//label_State.Text = rec;
}
/// <summary>
///
/// </summary>
/// <param name="x"></param>
public void OnSubscriberMessageReceived(MqttApplicationMessageReceivedEventArgs x)
{
//var rec = x.ApplicationMessage.ConvertPayloadToString();
// txt_Rec.Text = txt_Rec.Text + rec + System.Environment.NewLine;
ThreadPool.QueueUserWorkItem(MIS_Funtion_WEB, x);
}
#endregion
/// <summary>
/// mqtt 接收web和barcode数据
/// </summary>
/// <param name="e"></param>
public void MIS_Funtion_WEB(object e)
{
try
{
MqttApplicationMessageReceivedEventArgs x = (MqttApplicationMessageReceivedEventArgs)e;
var rec = x.ApplicationMessage.ConvertPayloadToString();
MisDataFunDll.MisDataFun.TransferInfToMES(rec);
}
catch (Exception ex)
{
//MIS_Funtion(topicFunItem, "Exception:" + ex.Message);
}
}
/// <summary>
/// 接收内部PLC数据变化
/// </summary>
/// <param name="e"></param>
public void MIS_Funtion_PLC(object e)
{
var rec = e.ToString();
try
{
MisDataFunDll.MisDataFun.TransferInfToMES(rec);
}
catch (Exception ex)
{
//MIS_Funtion(topicFunItem, "Exception:" + ex.Message);
}
}
static public void TagTypeCodeID_Insert(string opName, string TagTypeCodeID, string TagID, string TagValue, DateTime arrivedTime, DateTime leavedTime, int TimeDiff)
{
string procedureName;
procedureName = "测量数据设备状态日志_增加数据";
SqlParameter[] thisParms = new SqlParameter[7];
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
thisParms[1] = new System.Data.SqlClient.SqlParameter("@信号类型代码", TagTypeCodeID);
thisParms[2] = new System.Data.SqlClient.SqlParameter("@TagID", TagID);
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagValue", TagValue);
thisParms[4] = new System.Data.SqlClient.SqlParameter("@到达时间", arrivedTime);
thisParms[5] = new System.Data.SqlClient.SqlParameter("@离开时间", leavedTime);
thisParms[6] = new System.Data.SqlClient.SqlParameter("@在线时间", TimeDiff);
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
}
private void MisDataFun_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("您确认要退出MES程序吗该操作会停止MES进行数据处理", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
Process.GetCurrentProcess().Kill();
}
else
{
e.Cancel = true;
}
}
private void timer_Status_Tick(object sender, EventArgs e)
{
timer_Status.Enabled = false;
btn_MqttStatus.BackColor = OnLineMqtt ? Color.Green : Color.Red;
timer_Status.Enabled = true;
}
private void MyLogHelper_LogCommit(object sender, MyLog4Net.MyLogEventArgs e)
{
var module = e.Module;
var message = e.Message;
var log = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + " " + module + " " + message + "\r\n";
if (this.InvokeRequired)
{
this.Invoke(new Action(() =>
{
this.richTextBox1_mqtt.AppendText(log);
this.richTextBox1_mqtt.Focus();
}));
}
else
{
this.richTextBox1_mqtt.AppendText(log);
this.richTextBox1_mqtt.Focus();
}
}
public void OPCTagData_TagDataOnChange(OpcData.CustomeEvetnArgs e)
{
// 处理MIS业务 保存数据
// ThreadPool.QueueUserWorkItem(Function.MIS_Funtion, e);
// 处理MES业务 Function
ThreadPool.QueueUserWorkItem(TagData_MisData_TagDataOnChangeCustomeEvetnArgs, e);
//ThreadPool.QueueUserWorkItem(TagData_MisData_TagDataOnChange, e);
// 设备状态日志
ThreadPool.QueueUserWorkItem(TagTypeCodeID_TagDataOnChange, e);
//发送通讯服务器 MES web界面显示用 加工位号
ThreadPool.QueueUserWorkItem(TransferInfToWebServer, e);
//改变控件状态
//showMessagePLCInvoke(e);
//更新状态窗口控件状态
//ExcutePlcChange(e);
}
/// <summary>
/// 发送信号变化到function
/// </summary>
/// <param name="msgEvent"></param>
private void TagData_MisData_TagDataOnChangeCustomeEvetnArgs(object msgEvent)
{
try
{
OpcData.CustomeEvetnArgs e = (OpcData.CustomeEvetnArgs)msgEvent;
string OpName = e.OpName.ToString();//工位号
string MesCode = e.TagType.ToString();//变量类型代码
object tagValue = e.TagValue;//变量0或者1
string TagTypeCodeID = e.TagTypeCodeID.ToString();//变量类型代码
string cmd = "";
cmd = MIS_BASE.hashtable_TagTypeTagName[MesCode];
string mesServerdllName;
mesServerdllName = GetMesServeDllByOpName(OpName);
string fun = "fun_" + cmd;
int mesServerCode;
mesServerCode = GetMesServerCodeByOpName(OpName);
string rvMsg = Newtonsoft.Json.JsonConvert.SerializeObject(e);
string msg;
if (cmd == null)
{
cmd = MesCode;
msg = $"PLC|{cmd}|{OpName}|{rvMsg}";
}
else
{
msg = $"PLC|{cmd}|{OpName}|{rvMsg}";
}
try
{
if (TagTypeCodeID == "14")
{
MesServerWork.MIS_BASE.WritePLC(15, OpName, tagValue);
return;
}
}
catch (Exception err)
{
return;
}
MIS_Funtion_PLC(msg);
// asyncSendMessagePLC(mesServerdllName, msg, OpName);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, "TagData_Lable_TagDataOnChange");
}
}
/// <summary>
/// 根据工位号获取MesServerCode
/// </summary>
/// <param name="OpName"></param>
/// <returns></returns>
private static int GetMesServerCodeByOpName(string OpName)
{
try
{
if (MesServerWork.MIS_BASE.hashtable_MesServerCode.ContainsKey(OpName))
{
return Convert.ToInt32(MesServerWork.MIS_BASE.hashtable_MesServerCode[OpName]);
}
return 0;
}
catch
{
return 0;
}
}
/// <summary>
/// 根据工位号获取MesServerDll
/// </summary>
/// <param name="OpName"></param>
/// <returns></returns>
private static string GetMesServeDllByOpName(string OpName)
{
try
{
if (MesServerWork.MIS_BASE.hashtable_MesDll.ContainsKey(OpName))
{
return MesServerWork.MIS_BASE.hashtable_MesDll[OpName].ToString();
}
return "";
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, "GetMesServeDllByOpName");
return "";
}
}
/// <summary>
/// 数据库记录信号变化
/// </summary>
/// <param name="msg"></param>
private void TagTypeCodeID_TagDataOnChange(object msgEvent)
{
if (IsRecordTagStatus != "1") return;
try
{
CustomeEvetnArgs e = (CustomeEvetnArgs)msgEvent;
string tagValue;
if (e.TagValue == null) return;
switch (e.TagValue.ToString().ToLower())
{
case "1":
case "true":
tagValue = "1";
break;
default:
tagValue = "0";
break;
}
string TagTypeCodeID;
string opName;
string TagID;
string TagValue;
DateTime arrivedTime;
DateTime leavedTime;
int TimeDiff;
opName = e.OpName.ToString();
TagValue = tagValue;
TagTypeCodeID = e.TagTypeCodeID.ToString();
TagID = e.TagID.ToString();
leavedTime = Convert.ToDateTime(e.TimeStamp);
arrivedTime = Convert.ToDateTime(e.TimeStampBefore);
TimeDiff = Convert.ToInt32(e.TagKeepTime);
if (TagTypeCodeID != "14" && TagTypeCodeID != "15")
{
TagTypeCodeID_Insert(opName, TagTypeCodeID, TagID, TagValue, arrivedTime, leavedTime, TimeDiff);
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, "TagTypeCodeID_TagDataOnChange");
}
}
/// <summary>
/// 向MES通讯服务器发送消息
/// </summary>
/// <param name="msg"></param>
private void TransferInfToWebServer(object msg1)
{
int tagType;
string opName;
OpcData.CustomeEvetnArgs msgEvent = (OpcData.CustomeEvetnArgs)msg1;
//e值不能为空
if (msgEvent.TagValue == null) return;
tagType = Convert.ToInt32(msgEvent.TagType);
opName = msgEvent.OpName.ToString();
if (!MesServerWork.MIS_BASE.m_WorkStart_OpName.ContainsKey(opName)) return; //当前系统是否存在该工位
string cmd;
string tagValue;
string msgSvr;
try
{
switch (Convert.ToInt32(msgEvent.TagValueType))
{
case 11:
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
break;
default:
tagValue = msgEvent.TagValue.ToString();
break;
}
cmd = MIS_BASE.hashtable_TagTypeTagName[tagType.ToString()];
if (Convert.ToInt32(MIS_BASE.hashtable_WebTagTypeChange[cmd]) == 0 && MIS_BASE.hashtable_WebTagTypeChange[cmd] != null) return;
if (cmd != "" && cmd != null)
{
msgSvr = "MES|" + cmd + "|" + opName + "|" + tagValue;
}
else
{
return;
}
//MES web界面显示用
MesServerWork.MIS_BASE.asyncSendMessageQos0(msgSvr);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, "TransferInfToWebServer");
}
}
MesWork.OpcForm opcForm = null;
public static string WorkStationNum_Now;
static bool ReadQualityRunning = false;
static Thread ReadQuality_t = null;
private void button_ReadData_Click(object sender, EventArgs e)
{
if (loadFinish)
{
ReadQualityData(WorkStationNum_Now);
}
}
private void ReadQualityData(string opName)
{
try
{
if (ReadQualityRunning) return;
ReadQualityRunning = true;
QualityDataQueryStruct QltyQueryStr = new QualityDataQueryStruct(opName, listView_ShowQualityData);
//ReadQualityData_Thread(QltyQueryStr);
ReadQuality_t = new Thread(new ParameterizedThreadStart(ReadQualityData_Thread));
ReadQuality_t.Start(QltyQueryStr);
//if (ReadQualityRunning) return;
//ReadQualityRunning = true;
//QualityDataQueryStruct QltyQueryStr = new QualityDataQueryStruct(opName, listView_ShowQualityData);
//ReadQuality_t = new Thread(new ParameterizedThreadStart(ReadQualityData_Thread));
//ReadQuality_t.Start(QltyQueryStr);
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void ReadQualityData_Thread(object obj)
{
int fTime = 0;
try
{
QualityDataQueryStruct QualityStruct = (QualityDataQueryStruct)obj;
ListView listViewTemp = (ListView)QualityStruct.Ctrl;
ListViewItem listViewItem = null;
string[] listViewItemString = new string[5];
if (listViewTemp.InvokeRequired)
{
Action ActionDelegate = () => { listViewTemp.Items.Clear(); };
listViewTemp.Invoke(ActionDelegate);
}
else
{
listViewTemp.Items.Clear();
}
//System.Collections.Concurrent.ConcurrentDictionary<string, object> cd = null;
IEnumerable cd = null;
//IEnumerable<string,object> items;
string opName = QualityStruct.OpName;
var opTagList = GetDbAndMaxLengthByOpNameByBytes(opName);
//TagID 排序
//var cd_OpName = opTagList.OrderBy(x => x.Key).ToDictionary(k => k.Key, v => v.Value);
//全部数据
var cd_OpName = from r in opTagList
orderby r.Key
select r;
//质量数据
var query_Qd = from r in opTagList
where ((OpcBasic.TagFormat)r.Value).TagTypeCodeID == 105
orderby r.Key
select r;
//监控变量
var query_Monitor = from r in opTagList
where ((OpcBasic.TagFormat)r.Value).TagTypeCodeID != 105
orderby r.Key
select r;
if (cb_MonitorData.Checked)
{
cd = query_Monitor;
//cd = MesWork.PlcLinkForm.ReadPLC_GroupMonitor(QualityStruct.OpName);
}
if (cb_QdData.Checked)
{
cd = query_Qd;
//cd = MesWork.PlcLinkForm.ReadPLC_GroupData_Qd(QualityStruct.OpName);
}
if (cb_MonitorData.Checked == false & cb_QdData.Checked == false)
{
cd = cd_OpName;
//cd = MesWork.PlcLinkForm.ReadPLC_GroupData(QualityStruct.OpName);
}
if (cb_MonitorData.Checked == true & cb_QdData.Checked == true)
{
cd = cd_OpName;
//cd = MesWork.PlcLinkForm.ReadPLC_GroupData(QualityStruct.OpName);
}
//排序
var result2 = cd;// from pair in cd orderby pair.Key select pair;
ThisWorkStationData = new BasicData.QualityDataType[1000];
foreach (KeyValuePair<string, object> _cd in result2)
{
var tagID = _cd.Key;
var TF = (OpcBasic.TagFormat)_cd.Value;
listViewItemString[0] = TF.TagID;
listViewItemString[1] = TF.ItemName;
listViewItemString[2] = TF.TagValue.ToString();
listViewItemString[3] = TF.OpName;
listViewItemString[4] = "(" + TF.TagType + ")" + TF.TagDbAndStartAdrWrite.ToString();
listViewItem = new ListViewItem(listViewItemString);
if (TF.IsMonitor == 1)
{
listViewItem.BackColor = Color.LimeGreen;
}
if (listViewTemp.InvokeRequired)
{
Action<ListViewItem> ActionDelegate = (x) => { listViewTemp.Items.Add(x); };
listViewTemp.BeginInvoke(ActionDelegate, listViewItem);
}
else
{
listViewTemp.Items.Add(listViewItem);
}
ThisWorkStationData[fTime].opName = TF.OpName;
ThisWorkStationData[fTime].tagID = TF.TagID;
ThisWorkStationData[fTime].tagTypeID = TF.TagTypeID;
ThisWorkStationData[fTime].tagValue = TF.TagValue;
fTime++;
}
ReadQualityRunning = false;
}
catch (Exception err)
{
ReadQualityRunning = false;
ApplicationLog.WriteLog(err, err.Message);
}
}
private ConcurrentDictionary<string, object> GetDbAndMaxLengthByOpNameByBytes(string opName)
{
string tagStartAdr = "";
ushort tagAdrListMaxLength = 0;
PlcLinkForm.GetDbAndMaxLengthByOpName(opName, out tagStartAdr, out tagAdrListMaxLength);
var tagAdrListTagFormat = PlcLinkForm.ReadQualityDataList(opName, tagStartAdr, tagAdrListMaxLength);
return tagAdrListTagFormat;
}
private void comboBox_OpName_SelectedIndexChanged(object sender, EventArgs e)
{
//此处需要异步查询当前工位在线状态
try
{
if (AllowLoad)
{
WorkStationNum_Now = comboBox_OpName.SelectedValue.ToString();
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
private void listView_ShowQualityData_MouseDoubleClick(object sender, MouseEventArgs e)
{
try
{
BasicData.QualityDataType SelectData = new BasicData.QualityDataType();
ListView.SelectedIndexCollection index = new ListView.SelectedIndexCollection(listView_ShowQualityData);
SelectData = ThisWorkStationData[index[0]];
WriteQualityValueForm WriteForm = new WriteQualityValueForm(SelectData, this);
WriteForm.ShowDialog();
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
private void ToolStripMenuItem_PlcDebug_Click(object sender, EventArgs e)
{
if (opcForm != null)
{
opcForm.Close();
opcForm.Dispose();
opcForm = null;
}
opcForm = new MesWork.OpcForm(IsDemoMesServer);
opcForm.Show();
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
new AppConfigSetting.AppConfigSetForm().ShowDialog();
}
/// <summary>
/// 关于迈思按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://www.meswork.com");
}
/// <summary>
/// 版本信息按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
VersionsInformation VersionForm = new VersionsInformation();
VersionForm.ShowDialog();
}
private void timer_TestPLC_Tick(object sender, EventArgs e)
{
try
{
if (!AllowLoad) return;
timer_TestPLC.Enabled = false;
Runtime_Thread();
timer_TestPLC.Enabled = true;
//SystemFramework.SystemClock.SystemClockTimerTick();
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
void RefreshPlcConnectStatus(object sender, EventArgs e)
{
try
{
toolStripStatusLabel_OnlineNum.Text = sender.ToString();
toolStripStatusLabel_DownLine.Text = (Convert.ToInt32(toolStripStatusLabel_WorkStationNum.Text) - Convert.ToInt32(sender.ToString())).ToString();
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Message);
}
}
private void button2_Click(object sender, EventArgs e)
{
FuntionMesRead.GetAlarmInit();
MyLog4Net.MyLogHelper.Info($"报警更新:", "报警信息更新完成!");
}
/// <summary>
/// 界面上的开启时间
/// </summary>
void Runtime_Thread()
{
DateTime Now = DateTime.Now;
TimeSpan x = Now.Subtract(StartTime);
toolStripStatusLabel_RunTime.Text = x.Days.ToString() + "天" + x.Hours.ToString("00") + "小时" + x.Minutes.ToString("00") + "分" + x.Seconds.ToString("00") + "秒";
//Thread t = new Thread(new ParameterizedThreadStart (Runtime));
//t.Start(toolStripStatusLabel_RunTime);
}
}
}

View File

@@ -0,0 +1,266 @@
<?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>{DD9131C7-BF40-45B0-827A-C5E46FC8A89E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>MisDataFun</RootNamespace>
<AssemblyName>MisDataFun</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\MisDataFun\</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>Mes32X32.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Compile Include="MisAddition\QualityDataQueryStruct.cs" />
<Compile Include="MisAddition\WriteQualityValueForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MisAddition\WriteQualityValueForm.Designer.cs">
<DependentUpon>WriteQualityValueForm.cs</DependentUpon>
</Compile>
<Compile Include="MisDataFun.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MisDataFun.Designer.cs">
<DependentUpon>MisDataFun.cs</DependentUpon>
</Compile>
<Compile Include="OrderForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="OrderForm.Designer.cs">
<DependentUpon>OrderForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MisAddition\WriteQualityValueForm.resx">
<DependentUpon>WriteQualityValueForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MisDataFun.resx">
<DependentUpon>MisDataFun.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OrderForm.resx">
<DependentUpon>OrderForm.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="jsconfig1.json" />
<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>
<Reference Include="BasicData">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\BasicData.dll</HintPath>
</Reference>
<Reference Include="BasicEdit">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\BasicEdit.dll</HintPath>
</Reference>
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ConLink, Version=7.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\ConLink.dll</HintPath>
</Reference>
<Reference Include="DataLinkMesWork">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\DataLinkMesWork.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=1.2.0.7, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="MesControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\MesControl.dll</HintPath>
</Reference>
<Reference Include="MesWork.DeviceDriver">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\MesWork.DeviceDriver.dll</HintPath>
</Reference>
<Reference Include="MesWork.PLC">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\MesWork.PLC.dll</HintPath>
</Reference>
<Reference Include="Monitor.MesWork">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\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_fun\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_fun\MQTTnet.Extensions.ManagedClient.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML, Version=2.4.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\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>..\..\..\..\12.大天数控\DTSK-DAS\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>..\..\..\..\12.大天数控\DTSK-DAS\DLL\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="Opc.Ua.Client">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\Opc.Ua.Client.dll</HintPath>
</Reference>
<Reference Include="Opc.Ua.Configuration">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\Opc.Ua.Configuration.dll</HintPath>
</Reference>
<Reference Include="Opc.Ua.Core">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\Opc.Ua.Core.dll</HintPath>
</Reference>
<Reference Include="OpcUaHelper">
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\OpcUaHelper.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Net.Security.dll</HintPath>
</Reference>
<Reference Include="System.Net.WebSockets, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Net.WebSockets.dll</HintPath>
</Reference>
<Reference Include="System.Net.WebSockets.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Net.WebSockets.Client.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.Algorithms.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll_fun\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=3.0.6.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\12.大天数控\DTSK-DAS\DLL\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\00-1Json8.3\Json8.3\00-0Json8.3.1.csproj">
<Project>{1a10fdb2-1a6a-44a8-ab4d-33387563247e}</Project>
<Name>00-0Json8.3.1</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\00-2AppConfigSet\AppConfigSet\00-1AppConfigSetForm.csproj">
<Project>{5fd5de57-cc26-4fd0-b852-5362123bc4ff}</Project>
<Name>00-1AppConfigSetForm</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
<Name>00MesWorkMqtt</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\01DoWhatPlc\01_01DoWhatPlc.csproj">
<Project>{0d1af432-439a-4920-8692-43ae139f5530}</Project>
<Name>01_01DoWhatPlc</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj">
<Project>{f0a0c525-03fd-428a-9b17-7f54aa0e4475}</Project>
<Name>07BusinessFacade</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\08WebFun_base\WebFun_base\08-WebFun_base.csproj">
<Project>{d98be764-adeb-488d-9714-61e308aa8201}</Project>
<Name>08-WebFun_base</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\09MesDataFunction\MesDataFunction\09-MesDataFunction.csproj">
<Project>{90e76fb4-646d-45e2-95db-0b8ab4e465d6}</Project>
<Name>09-MesDataFunction</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\MyLog4Net\00_MyLog4Net.csproj">
<Project>{1dc48c83-1842-4de8-acaf-26e1e7f7c58f}</Project>
<Name>00_MyLog4Net</Name>
</ProjectReference>
<ProjectReference Include="..\..\MisDataFunction\MesServer.Function\Function53801\Function53801.csproj">
<Project>{8b938c93-1751-450e-984a-e8237a4eaf75}</Project>
<Name>Function53801</Name>
</ProjectReference>
<ProjectReference Include="..\..\MisDataFunction\MesServer.Function\Function53802\Function53802.csproj">
<Project>{af1b57a2-587d-4de6-8d05-5da12e18e154}</Project>
<Name>Function53802</Name>
</ProjectReference>
<ProjectReference Include="..\..\MisDataFunDll\MisDataFunDll\13.4MisDataFunction.csproj">
<Project>{a0de975b-3afc-4f39-920e-29a874480a36}</Project>
<Name>13.4MisDataFunction</Name>
</ProjectReference>
<ProjectReference Include="..\..\MIS_FuntionSaveData\MIS_FuntionSaveData\13.3MIS_FuntionSaveData.csproj">
<Project>{55b510c1-59e9-4bfd-ae84-d76d46f6e365}</Project>
<Name>13.3MIS_FuntionSaveData</Name>
</ProjectReference>
<ProjectReference Include="..\SendMessageToWebMqtt\12SendMessageToWeb.csproj">
<Project>{E4EB6420-906D-4672-947A-CA33DDCDADFC}</Project>
<Name>12SendMessageToWeb</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Mes32X32.ico" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,218 @@
<?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="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>138, 17</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="timer_Status.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>258, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>430, 17</value>
</metadata>
<metadata name="timer_TestPLC.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>598, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>59</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>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgChADIAoQIyAKEgMgChczIA
occyAKHqMgChmTIAoTwyAKEJMgChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgChADIAoQQyAKEvMgChdzIA
odYyAKH7MgCh/zIAof8yAKH/MgCh6jIAoacyAKFJMgChEjIAoQAyAKEAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChADIAoQoyAKE+MgChkTIA
oeoyAKH+MgCh+TIAoe0yAKH+MgCh/zIAofwyAKH3MgCh/jIAofgyAKHBMgChZDIAoR4yAKEBMgChAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChATIAoRUyAKFcMgChujIA
ofEyAKH/MgCh9DIAobcyAKFPMgChfjIAof8yAKH/MgCh5TIAoVUyAKGLMgCh4jIAofwyAKH9MgCh2TIA
oYcyAKEoMgChBTIAoQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChAjIAoSYyAKF2MgCh0DIA
ofcyAKH+MgCh8zIAof8yAKGjMgChDTIAoQAyAKFpMgCh/zIAof8yAKHhMgChHjIAoQIyAKEiMgChbjIA
ocoyAKH3MgCh/jIAoeUyAKGfMgChQTIAoQsyAKEAAAAAAAAAAAAAAAAAMgChCDIAoUEyAKGXMgCh4jIA
of4yAKH/MgChzzIAoW0yAKFoMgCh+zIAoZcyAKEAMgChADIAoWkyAKH/MgCh/zIAoeEyAKEeMgChADIA
oQAyAKEBMgChETIAoVAyAKGiMgCh8DIAof8yAKH0MgChuTIAoW0yAKEVMgChADIAoQAyAKG2MgCh7TIA
of8yAKHvMgCh7jIAofgyAKFLMgChADIAoTcyAKH1MgChlzIAoQAyAKEAMgChaTIAof8yAKH/MgCh4TIA
oR4yAKEAAAAAAAAAAAAAAAAAMgChADIAoQcyAKE4MgChijIAod8yAKH9MgCh+zIAoc4yAKFdMgChADIA
of8yAKHlMgChlDIAoToyAKGgMgCh7jIAoSwyAKEAMgChFzIAodgyAKGZMgChADIAoQAyAKFpMgCh/zIA
of8yAKHxMgChfDIAoSkyAKEBMgChAAAAAAAAAAAAAAAAADIAoQAyAKECMgChITIAoW8yAKG/MgCh/zIA
oZYyAKEAMgCh/zIAoZoyAKEBMgChADIAoZkyAKHSMgChEjIAoQAyAKEGMgChujIAoZoyAKEAMgChADIA
oWkyAKH/MgCh/zIAof0yAKH+MgCh4TIAoZIyAKFEMgChDjIAoQAyAKEAAAAAAAAAAAAAAAAAMgChADIA
oUIyAKH7MgChlzIAoQAyAKH/MgChlzIAoQAyAKEAMgChmjIAobMyAKEEMgChADIAoQAyAKGcMgChmzIA
oQAyAKEAMgChaTIAof8yAKH/MgCh4zIAoZYyAKHRMgCh+zIAofQyAKHDMgChZDIAoSIyAKEBMgChAAAA
AAAyAKEAMgChPzIAofsyAKGXMgChADIAof8yAKGXMgChADIAoQAyAKGaMgChiDIAoQAAAAAAMgChADIA
oYgyAKGaMgChADIAoQAyAKFpMgCh/zIAof8yAKHhMgChIDIAoRIyAKFeMgChqzIAoe0yAKH+MgCh3jIA
oYYyAKEqMgChADIAoQAyAKE/MgCh+zIAoZcyAKEAMgCh/zIAoZcyAKEAMgChADIAoZgyAKFtMgChAAAA
AAAyAKEAMgChXDIAoZQyAKEAMgChADIAoWkyAKH/MgCh/zIAoeEyAKEeMgChADIAoQAyAKEGMgChMDIA
oX8yAKHTMgCh+jIAoWkyAKEAMgChADIAoT8yAKH7MgChlzIAoQAyAKH/MgChlzIAoQAyAKEAMgChlTIA
oWMyAKEAAAAAADIAoQAyAKE2MgChhTIAoQAyAKEAMgChaTIAof8yAKH/MgCh4TIAoR4yAKEAAAAAAAAA
AAAyAKEAMgChATIAoRUyAKFYMgChQDIAoQAyAKEAMgChPzIAofsyAKGXMgChADIAof8yAKGXMgChADIA
oQAyAKGLMgChQTIAoQAyAKEFMgChADIAoSMyAKF4MgChADIAoQAyAKFpMgCh/zIAof8yAKHhMgChHjIA
oQAAAAAAAAAAAAAAAAAAAAAAMgChADIAoQAyAKEBMgChADIAoQAyAKE/MgCh+zIAoZcyAKEAMgCh/zIA
oZcyAKEAMgChADIAoXcyAKEkMgChBzIAoUIyAKEBMgChFjIAoWUyAKEBMgChADIAoWkyAKH/MgCh/zIA
oeEyAKEeMgChADIAoQAyAKE5MgChSTIAoQ8yAKEBMgChAAAAAAAAAAAAMgChADIAoT8yAKH7MgChlzIA
oQAyAKH/MgChlzIAoQAyAKECMgChWzIAoQ8yAKEVMgChhTIAoQoyAKEHMgChMzIAoQEyAKEAMgChaTIA
of8yAKH/MgCh4TIAoR4yAKEAMgChADIAoWkyAKH1MgChyzIAoX8yAKE4MgChBTIAoQAyAKEAMgChPzIA
ofsyAKGXMgChADIAof8yAKGXMgChADIAoQMyAKFZMgChCzIAoS4yAKHDMgChGjIAoQAAAAAAAAAAADIA
oQAyAKFpMgCh/zIAof8yAKHhMgChHjIAoQAyAKEAMgChLDIAoaEyAKHkMgCh/DIAoe8yAKGrMgChUzIA
oREyAKFBMgCh+zIAoZcyAKEAMgCh/zIAoZcyAKEAMgChBzIAoVAyAKEEMgChQTIAodoyAKEjMgChAAAA
AAAAAAAAMgChADIAoWkyAKH/MgCh/zIAoeEyAKEeMgChAAAAAAAyAKEAMgChBjIAoSAyAKFyMgChwjIA
ofMyAKH4MgCh0zIAobMyAKH9MgChljIAoQAyAKH/MgChlzIAoQAyAKEBMgChBDIAoQAyAKFKMgCh7jIA
oT0yAKEAAAAAADIAoQAyAKEAMgChbDIAof8yAKH/MgCh4TIAoR8yAKEAAAAAAAAAAAAAAAAAMgChADIA
oQEyAKELMgChRzIAoZYyAKHeMgCh/TIAof8yAKGWMgChADIAof8yAKGXMgChAAAAAAAAAAAAMgChADIA
oW0yAKH/MgChZDIAoQAyAKEEMgChHDIAoWAyAKHPMgCh/zIAof8yAKH3MgChkTIAoS8yAKELMgChADIA
oQAAAAAAAAAAAAAAAAAyAKEAMgChATIAoSAyAKF2MgCh/zIAoZYyAKEAMgCh/zIAoZcyAKEAAAAAADIA
oQAyAKEAMgChljIAof8yAKGeMgChOTIAoZEyAKHcMgCh+TIAof8yAKH/MgCh/zIAof8yAKH+MgCh6jIA
obgyAKFXMgChITIAoQEyAKEAAAAAAAAAAAAAAAAAMgChADIAoT8yAKH7MgChlzIAoQAyAKH/MgChlzIA
oQAAAAAAMgChADIAoQwyAKG9MgCh/zIAofMyAKHyMgCh/jIAof8yAKH/MgCh/zIAofoyAKH3MgCh/jIA
of8yAKH/MgCh/zIAofsyAKHbMgChmzIAoUwyAKENMgChATIAoQAyAKEAMgChPzIAofsyAKGXMgChADIA
of8yAKGXMgChATIAoRkyAKFbMgChsTIAofAyAKH/MgCh/zIAof8yAKH/MgCh/DIAoeYyAKGxMgChVTIA
oUIyAKGFMgCh1TIAofUyAKH/MgCh/zIAof8yAKH/MgCh9DIAocUyAKGDMgChMDIAoQYyAKE/MgCh+zIA
oZcyAKEAMgCh/zIAocEyAKGOMgCh2TIAofcyAKH/MgCh/zIAof8yAKH/MgCh7jIAobMyAKFwMgChJjIA
oQoyAKEAMgChADIAoQEyAKEXMgChTTIAoZsyAKHYMgCh/TIAof8yAKH/MgCh/zIAof4yAKHqMgChszIA
oZgyAKH+MgChljIAoQAyAKH/MgCh/zIAof8yAKH/MgCh/zIAof8yAKH0MgChyTIAoYEyAKE/MgChBzIA
oQAAAAAAMgChADIAoSIyAKF2MgChQjIAoRIyAKEAMgChATIAoR4yAKFjMgChrjIAoecyAKH9MgCh/zIA
of8yAKH/MgCh/zIAof8yAKGWMgChADIAof8yAKH/MgCh/zIAofkyAKHWMgChmjIAoUIyAKERMgChATIA
oQAyAKEGMgChFTIAoQMyAKEAMgChKDIAoZUyAKHHMgChxjIAoXcyAKE3MgChBzIAoQAyAKEGMgChKTIA
oXYyAKHDMgCh7jIAof4yAKH/MgCh/zIAoZYyAKEAMgChrjIAoeYyAKH+MgCh0zIAoVcyAKELMgChADIA
oQAyAKEAMgChADIAoVUyAKHAMgChkjIAoVYyAKEUMgChATIAoRYyAKFhMgChqzIAodUyAKGmMgChZTIA
oR8yAKEDMgChBDIAoS0yAKGiMgCh9DIAofUyAKHGMgChWTIAoQAyAKEGMgChKjIAoWsyAKHBMgCh3DIA
ocEyAKFwMgChJTIAoQYyAKEAMgChDDIAoTgyAKF/MgChyjIAocMyAKGUMgChMzIAoQsyAKEEMgChJjIA
oWUyAKG/MgCh0TIAoaYyAKGoMgCh1TIAodYyAKGNMgChQTIAoRAyAKEAMgChAAAAAAAyAKEAMgChADIA
oQ8yAKE8MgChkDIAoc8yAKHfMgChpDIAoVIyAKEcMgChADIAoQEyAKETMgChRzIAoZ8yAKHGMgChvzIA
oWQyAKEtMgChMzIAoY8yAKHvMgCh5zIAoa8yAKFcMgChHDIAoQMyAKEAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAADIAoQAyAKECMgChFTIAoVcyAKGaMgCh3DIAodEyAKGaMgChSDIAoQsyAKEAMgChATIA
oSUyAKGGMgCh6TIAofEyAKHhMgChtzIAoXAyAKErMgChBTIAoQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgChADIAoQIyAKElMgChXTIAobgyAKHbMgChxTIA
oYUyAKFbMgChqzIAodEyAKHLMgChhDIAoTsyAKELMgChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAKEAMgChCzIA
oTcyAKGTMgCh0zIAofAyAKG2MgChWjIAoRcyAKEBMgChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA/+Af//+AB//8AAD/8AAAP8AIAA8AGDABARg+AQEYD4ERGAPxMZgAcTOY
ADEzmDAxM5g8MTKIPzEgCDDxIAgwMSB4MAEgeDgBJHg+ATxAD8E8AAHxOAAAMQAAAAEAAwABABwgAQBE
BAEBwAABAEAAA+AAAA/4AAB//wAD///gD/8=
</value>
</data>
</root>

View File

@@ -0,0 +1,417 @@
namespace MisDataFun
{
partial class OrderForm
{
/// <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.dataGridView_Order = 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. = 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.dataGridView_OrderOpNameToMobyList = new System.Windows.Forms.DataGridView();
this.comboBox_OpName = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.button_LoadToOpName = new System.Windows.Forms.Button();
this.ID1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.线1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_Order)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_OrderOpNameToMobyList)).BeginInit();
this.SuspendLayout();
//
// dataGridView_Order
//
this.dataGridView_Order.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView_Order.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ID,
this.,
this.,
this.,
this.,
this.,
this.,
this.,
this.线,
this.线,
this.,
this.});
this.dataGridView_Order.Location = new System.Drawing.Point(18, 102);
this.dataGridView_Order.Margin = new System.Windows.Forms.Padding(4);
this.dataGridView_Order.MultiSelect = false;
this.dataGridView_Order.Name = "dataGridView_Order";
this.dataGridView_Order.ReadOnly = true;
this.dataGridView_Order.RowHeadersWidth = 62;
this.dataGridView_Order.RowTemplate.Height = 23;
this.dataGridView_Order.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView_Order.Size = new System.Drawing.Size(1731, 258);
this.dataGridView_Order.TabIndex = 0;
//
// ID
//
this.ID.DataPropertyName = "ID";
this.ID.HeaderText = "ID";
this.ID.MinimumWidth = 8;
this.ID.Name = "ID";
this.ID.ReadOnly = true;
this.ID.Width = 70;
//
// 订单号
//
this..DataPropertyName = "订单号";
this..HeaderText = "订单号";
this..MinimumWidth = 8;
this..Name = "订单号";
this..ReadOnly = true;
this..Width = 150;
//
// 序号
//
this..DataPropertyName = "序号";
this..HeaderText = "序号";
this..MinimumWidth = 8;
this..Name = "序号";
this..ReadOnly = true;
this..Width = 70;
//
// 订单类型
//
this..DataPropertyName = "订单类型";
this..HeaderText = "订单类型";
this..MinimumWidth = 8;
this..Name = "订单类型";
this..ReadOnly = true;
this..Width = 150;
//
// 生产日期
//
this..DataPropertyName = "生产日期";
this..HeaderText = "生产日期";
this..MinimumWidth = 8;
this..Name = "生产日期";
this..ReadOnly = true;
this..Width = 150;
//
// 班次
//
this..DataPropertyName = "班次";
this..HeaderText = "班次";
this..MinimumWidth = 8;
this..Name = "班次";
this..ReadOnly = true;
this..Width = 70;
//
// 零件号
//
this..DataPropertyName = "零件号";
this..HeaderText = "零件号";
this..MinimumWidth = 8;
this..Name = "零件号";
this..ReadOnly = true;
this..Width = 150;
//
// 数量
//
this..DataPropertyName = "数量";
this..HeaderText = "数量";
this..MinimumWidth = 8;
this..Name = "数量";
this..ReadOnly = true;
this..Width = 70;
//
// 上线数量
//
this.线.DataPropertyName = "上线数量";
this.线.HeaderText = "上线数量";
this.线.MinimumWidth = 8;
this.线.Name = "上线数量";
this.线.ReadOnly = true;
this.线.Width = 150;
//
// 下线数量
//
this.线.DataPropertyName = "下线数量";
this.线.HeaderText = "下线数量";
this.线.MinimumWidth = 8;
this.线.Name = "下线数量";
this.线.ReadOnly = true;
this.线.Width = 150;
//
// 订单状态
//
this..DataPropertyName = "订单状态";
this..HeaderText = "订单状态";
this..MinimumWidth = 8;
this..Name = "订单状态";
this..ReadOnly = true;
this..Width = 150;
//
// 备注
//
this..DataPropertyName = "备注";
this..HeaderText = "备注";
this..MinimumWidth = 8;
this..Name = "备注";
this..ReadOnly = true;
this..Width = 150;
//
// dataGridView_OrderOpNameToMobyList
//
this.dataGridView_OrderOpNameToMobyList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView_OrderOpNameToMobyList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ID1,
this.1,
this.1,
this.1,
this.1,
this.1,
this.1,
this.1,
this.1,
this.线1,
this.1,
this.1});
this.dataGridView_OrderOpNameToMobyList.Location = new System.Drawing.Point(18, 394);
this.dataGridView_OrderOpNameToMobyList.Margin = new System.Windows.Forms.Padding(4);
this.dataGridView_OrderOpNameToMobyList.MultiSelect = false;
this.dataGridView_OrderOpNameToMobyList.Name = "dataGridView_OrderOpNameToMobyList";
this.dataGridView_OrderOpNameToMobyList.ReadOnly = true;
this.dataGridView_OrderOpNameToMobyList.RowHeadersWidth = 62;
this.dataGridView_OrderOpNameToMobyList.RowTemplate.Height = 23;
this.dataGridView_OrderOpNameToMobyList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView_OrderOpNameToMobyList.Size = new System.Drawing.Size(1731, 342);
this.dataGridView_OrderOpNameToMobyList.TabIndex = 0;
//
// comboBox_OpName
//
this.comboBox_OpName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox_OpName.FormattingEnabled = true;
this.comboBox_OpName.Location = new System.Drawing.Point(166, 46);
this.comboBox_OpName.Margin = new System.Windows.Forms.Padding(4);
this.comboBox_OpName.Name = "comboBox_OpName";
this.comboBox_OpName.Size = new System.Drawing.Size(260, 26);
this.comboBox_OpName.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(18, 51);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(98, 18);
this.label1.TabIndex = 2;
this.label1.Text = "上线工位号";
//
// button_LoadToOpName
//
this.button_LoadToOpName.Location = new System.Drawing.Point(534, 42);
this.button_LoadToOpName.Margin = new System.Windows.Forms.Padding(4);
this.button_LoadToOpName.Name = "button_LoadToOpName";
this.button_LoadToOpName.Size = new System.Drawing.Size(244, 34);
this.button_LoadToOpName.TabIndex = 3;
this.button_LoadToOpName.Text = "订单下达到上线工位";
this.button_LoadToOpName.UseVisualStyleBackColor = true;
this.button_LoadToOpName.Click += new System.EventHandler(this.button_LoadToOpName_Click);
//
// ID1
//
this.ID1.DataPropertyName = "ID";
this.ID1.HeaderText = "ID";
this.ID1.MinimumWidth = 8;
this.ID1.Name = "ID1";
this.ID1.ReadOnly = true;
this.ID1.Width = 150;
//
// 工位号1
//
this.1.DataPropertyName = "工位号";
this.1.HeaderText = "工位号";
this.1.MinimumWidth = 8;
this.1.Name = "工位号1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 订单号1
//
this.1.DataPropertyName = "订单号";
this.1.HeaderText = "订单号";
this.1.MinimumWidth = 8;
this.1.Name = "订单号1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 序号1
//
this.1.DataPropertyName = "序号";
this.1.HeaderText = "序号";
this.1.MinimumWidth = 8;
this.1.Name = "序号1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 订单类型1
//
this.1.DataPropertyName = "订单类型";
this.1.HeaderText = "订单类型";
this.1.MinimumWidth = 8;
this.1.Name = "订单类型1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 生产日期1
//
this.1.DataPropertyName = "生产日期";
this.1.HeaderText = "生产日期";
this.1.MinimumWidth = 8;
this.1.Name = "生产日期1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 订单班次1
//
this.1.DataPropertyName = "订单班次";
this.1.HeaderText = "订单班次";
this.1.MinimumWidth = 8;
this.1.Name = "订单班次1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 零件号1
//
this.1.DataPropertyName = "零件号";
this.1.HeaderText = "零件号";
this.1.MinimumWidth = 8;
this.1.Name = "零件号1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 数量1
//
this.1.DataPropertyName = "数量";
this.1.HeaderText = "数量";
this.1.MinimumWidth = 8;
this.1.Name = "数量1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 上线数量1
//
this.线1.DataPropertyName = "上线数量";
this.线1.HeaderText = "上线数量";
this.线1.MinimumWidth = 8;
this.线1.Name = "上线数量1";
this.线1.ReadOnly = true;
this.线1.Width = 150;
//
// 备注1
//
this.1.DataPropertyName = "备注";
this.1.HeaderText = "备注";
this.1.MinimumWidth = 8;
this.1.Name = "备注1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// 操作时间1
//
this.1.DataPropertyName = "操作时间";
this.1.HeaderText = "操作时间";
this.1.MinimumWidth = 8;
this.1.Name = "操作时间1";
this.1.ReadOnly = true;
this.1.Width = 150;
//
// OrderForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1767, 754);
this.Controls.Add(this.button_LoadToOpName);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBox_OpName);
this.Controls.Add(this.dataGridView_OrderOpNameToMobyList);
this.Controls.Add(this.dataGridView_Order);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "OrderForm";
this.Text = "OrderForm";
((System.ComponentModel.ISupportInitialize)(this.dataGridView_Order)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_OrderOpNameToMobyList)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DataGridView dataGridView_Order;
private System.Windows.Forms.ComboBox comboBox_OpName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button_LoadToOpName;
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 ;
private System.Windows.Forms.DataGridViewTextBoxColumn 线;
private System.Windows.Forms.DataGridViewTextBoxColumn 线;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridView dataGridView_OrderOpNameToMobyList;
private System.Windows.Forms.DataGridViewTextBoxColumn ID1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 线1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
private System.Windows.Forms.DataGridViewTextBoxColumn 1;
}
}

View File

@@ -0,0 +1,73 @@
using bizFacade;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MisDataFun
{
public partial class OrderForm : Form
{
public OrderForm()
{
InitializeComponent();
InitiOrder();
InitOrderOpName();
InitOredrToOpNameList();
}
private void InitiOrder()
{
DataTable dt;
dt = BaseDataSystemMES.GetOrder_BQ();
dataGridView_Order.DataSource = dt;
if(dt.Rows.Count>0)
{
dataGridView_Order.Rows[0].Selected = true;
}
}
private void InitOrderOpName()
{
DataTable dt;
dt = BaseDataSystemMES.GetOrderOpName_BQ();
comboBox_OpName.DataSource = dt;
comboBox_OpName.DisplayMember = "工位号";
if(comboBox_OpName.Items.Count > 0 )
{
comboBox_OpName.SelectedIndex= 0;
}
}
/// <summary>
/// 下达订单到线首工位
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button_LoadToOpName_Click(object sender, EventArgs e)
{
string orderForm;
string opName;
orderForm = dataGridView_Order.SelectedRows[0].Cells["订单号"].Value.ToString();
opName = comboBox_OpName.Text;
BaseDataSystemMES.DownOrderToOpName(orderForm, opName);
InitOredrToOpNameList();
}
/// <summary>
/// 各个工位订单列表
/// </summary>
private void InitOredrToOpNameList()
{
DataTable dt;
dt = BaseDataSystemMES.DownOrderToOpNameMobyList("");
dataGridView_OrderOpNameToMobyList.DataSource= dt;
}
}
}

View File

@@ -0,0 +1,228 @@
<?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="数量.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>
<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="ID1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="工位号1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="订单号1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="序号1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="订单类型1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="生产日期1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="订单班次1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="零件号1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="数量1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="上线数量1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="备注1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="操作时间1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MisDataSaveDate
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
new System.Threading.Mutex(true, "PassStationSY", out bool bCanRun);
if (!bCanRun)
{
MessageBox.Show("PassStation 程序 已经在运行!不可重复启动!");
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MisDataFun());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("MisDataSaveDate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MisDataSaveDate")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9aede061-8490-436a-b38b-9495dc908f19")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MisDataFun.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("MisDataFun.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MisDataFun.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.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;
}
}
}
}

View 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>

View File

@@ -0,0 +1,10 @@
{
"exclude": [
"**/bin",
"**/bower_components",
"**/jspm_packages",
"**/node_modules",
"**/obj",
"**/platforms"
]
}

View File

@@ -0,0 +1,70 @@
<?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>{E4EB6420-906D-4672-947A-CA33DDCDADFC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SendMessageToWebMqtt</RootNamespace>
<AssemblyName>SendMessageToWebMqtt</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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="InitHashtable_MesServerCode.cs" />
<Compile Include="SendMessage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SendMessageFun.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
<Name>00MesWorkMqtt</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj">
<Project>{f434e066-4c59-47c8-aa82-6f48cc84501a}</Project>
<Name>04-DataBaseAccess</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj">
<Project>{f0a0c525-03fd-428a-9b17-7f54aa0e4475}</Project>
<Name>07BusinessFacade</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\09MesDataFunction\MesDataFunction\09-MesDataFunction.csproj">
<Project>{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}</Project>
<Name>09-MesDataFunction</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,52 @@
using DataLinkMesWork;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MesServerFunctions
{
/// <summary>
/// 命令
///显示托盘信息√ case "ShowMoby":
///显示操作指南√ case "ProcessList":
///显示物料√ case "MaterialList":
///显示操作图片√ case "PicShow":
///显示拧紧位置√ case "ShaftPosition":
///实时显示质量数据√ case "ShowTimelyQuality":
///手动拧紧实时显示质量数据√case "ShowTimelyQuality_Tight":
///√ case "OrderFormList":
///弹窗消息√ case "Notice":
///LED消息提醒√ case "ScrollNotice":
///物料检测初始化√ case "MaterialCheckPosition":
///返修质量数据显示√ case "RepairQuality"
///
/// </summary>
public class MesServerCode
{
/// <summary>
/// MES_基本变量_DB数据结构_获得激发变量
/// </summary>
/// <returns></returns>
public static DataTable BaseData_tagTable_All()
{
int MES_Code = 1;
DataTable dt = null;
string sql;
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
+ " where ((变量类型代码 >= 19 and 变量类型代码 <= 27) or (变量类型代码 = 101) or (变量类型代码 = 102) or (变量类型代码 = 105) or (变量类型代码 = 1000) or (变量类型代码 = 1001) or (变量类型代码 = 1002) or (变量类型代码 = 1003) or (变量类型代码 = 1004)) and (是否启用 = 1) "
+ " and (监控属性代码 = '" + MES_Code.ToString() + "')"
+ " ORDER BY TagID ";
DataAccess.ExecuteDataTable(sql, out dt);
return dt;
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SendMessageToWebMqtt")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SendMessageToWebMqtt")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e4eb6420-906d-4672-947a-ca33ddcdadfc")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,741 @@
using bizFacade;
using MesServerWork;
using MesWorkMqtt;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace MesServerFunctions
{
/// <summary>
/// 命令
///显示托盘信息√ case "ShowMoby":
///显示操作指南√ case "ProcessList":
///显示物料√ case "MaterialList":
///显示操作图片√ case "PicShow":
///显示拧紧位置√ case "ShaftPosition":
///实时显示质量数据√ case "ShowTimelyQuality":
///手动拧紧实时显示质量数据√case "ShowTimelyQuality_Tight":
///√ case "OrderFormList":
///弹窗消息√ case "Notice":
///LED消息提醒√ case "ScrollNotice":
///物料检测初始化√ case "MaterialCheckPosition":
///返修质量数据显示√ case "RepairQuality"
///
/// </summary>
public class SendMessage
{
/// <summary>
/// MES/InstantMessaging/BQ
/// </summary>
public static string MqttTargetTopic = ConfigurationManager.AppSettings["MqttTargetTopic"];
/// <summary>
/// WEB/InstantMessaging/BQ/MisServer
/// </summary>
public static string MqttTargetTopicWEB = ConfigurationManager.AppSettings["MqttTargetTopicWEB"];
/// <summary>
/// BAR/InstantMessaging/BQ
/// </summary>
public static string MqttTargetTopicBAR = ConfigurationManager.AppSettings["MqttTargetTopicBAR"];
public static void SendMessageBARToMES(string opName, string msgText)
{
var topic = $"{MqttTargetTopicBAR}";
if (msgText.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, msgText));
}
SendMessageMESToWEB(opName, msgText);
}
public static void SendMessageMESToWEB(string opName, string msgText)
{
var topic = $"{MqttTargetTopic}/{opName}";
if (msgText.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, msgText));
}
}
public static void SendMessageWEBToMES(string msgText)
{
var topic = $"{MqttTargetTopicWEB}";
if (msgText.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, msgText));
}
}
/// <summary>
/// 5 显示订单、机型信息 上线工位
/// </summary>
/// <param name="opName"></param>
public static void ShowMoby_FirstOpName(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = ShowMoby_String_FirstOpName(opName);
string cmd = "ShowMoby";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
/// <summary>
/// 5 显示订单、机型信息 非上线工位
/// </summary>
/// <param name="opName"></param>
public static void ShowMoby(string opName, int type = 1)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = ShowMoby_String(opName, type);
string cmd = "ShowMoby";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
public static void MaterialList_Dif(string opName, string msgText)
{
var topic = $"{MqttTargetTopic}/{opName}";
string cmd = "MaterialList_Dif";
if (msgText.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{msgText}"));
}
}
public static void AsyncSendMessage_Notice(string opname, string notice)
{
//通知Web界面
BaseDataSystemMES.Web_Notice_Insert(opname, notice);
Notice(opname);
}
public static void Notice(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = Notice_String(opName);
string cmd = "Notice";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
/// <summary>
/// 1直接在界面通过选择机型确认工序内容
/// </summary>
/// <param name="opName"></param>
public static void ProcessList(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = ProcessList_String(opName);
string cmd = "ProcessList";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
public static void ProcessList_FirstOpName(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = ProcessList_String_FirstOpName(opName);
string cmd = "ProcessList";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
/// <summary>
/// 2显示物料
/// </summary>
/// <param name="opName"></param>
public static void MaterialList(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = MaterialList_String(opName);
string cmd = "MaterialList";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
public static void MaterialList_FirstOpName(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = MaterialList_String_FirstOpName(opName);
string cmd = "MaterialList";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
/// <summary>
/// 3显示操作指导图片
/// </summary>
/// <param name="opName"></param>
public static void PicShow(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = PicShow_String(opName);
string cmd = "PicShow";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
public static void PicShow_FirstOpName(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = PicShow_String_FirstOpName(opName);
string cmd = "PicShow";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
/// <summary>
/// 4订单完工模块刷新完成数量
/// </summary>
/// <param name="opName"></param>
public static void OrderFormList(string opName)
{
var topic = $"{MqttTargetTopic}/{opName}";
var responseStr = OrderFormList_String();
string cmd = "OrderFormList";
if (responseStr.Length > 0)
{
Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
}
}
//实时显示质量数据√
public static void ShowTimelyQuality(string opName)
{
}
public static void SendActuallyCount(string OpName, int tagValue)
{
//当工件离开时,更新在线产量、在线节拍
//if (tagValue == 0)
{
try
{
int opNameCount = 0;//在线产量
int opNameCountTime = 0;//在线节拍
BaseDataSystemMES.OpNameCount_BQ(OpName, out opNameCount, out opNameCountTime); //基本数据_工作日历_班次产量查询_New
SendInfomation("ActuallyCount", opNameCount.ToString() + "&" + opNameCountTime.ToString(), OpName);
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function01:SendActuallyCount");
}
}
}
public static void SendInfomation(string Command, string Value, string OpName)
{
string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
}
public static void AsyncSendMessage(string Message)
{
//lock (locker)
{
//"MES|MachinePlan|OpName|Value
var array = Message.Split('|');
var cmd = array[1];
var opName = array[2];
var topic = $"{MqttTargetTopic}/{opName}";
Task.Run(() => Mqtt.Publish(topic, Message));
}
}
private static string ProcessList_String(string OpName)
{
string jsonStr_Process = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
DataTable dt_Proccess;
MES1.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
MES.Process_Select(OpName, EngineTypeID, EngineType, out dt_Proccess);
if (dt_Proccess != null)
{
if (dt_Proccess.Rows.Count > 0)
{
jsonStr_Process = JsonHelper.CreateJsonParameters(dt_Proccess);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ProcessList");
}
return jsonStr_Process;
}
private static string ProcessList_String_FirstOpName(string OpName)
{
string jsonStr_Process = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
DataTable dt_Proccess;
MES1.Moby_Select_FirstOpName(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode);
MES.Process_Select(OpName, EngineTypeID, EngineType, out dt_Proccess);
if (dt_Proccess != null)
{
//if (dt_Proccess.Rows.Count > 0)
//{
// jsonStr_Process = JsonHelper.CreateJsonParameters(dt_Proccess);
//}
jsonStr_Process = JsonHelper.CreateJsonParameters(dt_Proccess);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ProcessList");
}
return jsonStr_Process;
}
//
private static string PicShow_String(string OpName)
{
string data = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
byte[] imgBytesIn;
MES1.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
BaseDataSystemMES.GetImageFile(OpName, EngineTypeID.ToString(), out imgBytesIn);
if (imgBytesIn == null)
{
return data;
}
data = Convert.ToBase64String(imgBytesIn);
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:PictureShow");
}
return data;
}
private static string PicShow_String_FirstOpName(string OpName)
{
string data = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
byte[] imgBytesIn;
MES1.Moby_Select_FirstOpName(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode);
BaseDataSystemMES.GetImageFile(OpName, EngineTypeID.ToString(), out imgBytesIn);
if (imgBytesIn == null)
{
return data;
}
data = Convert.ToBase64String(imgBytesIn);
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:PictureShow");
}
return data;
}
/// <summary>
/// 上线工位
/// </summary>
/// <param name="OpName"></param>
/// <returns></returns>
private static string ShowMoby_String(string OpName, int type = 1)
{
string data = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
//线首工位用
MES1.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString, type);
data = orderNum + "&" + EngineTypeID + "&" + EngineType + "&" + EngineID + "&" + PartPallet_Code + "&" + IsrepairBarcode + "&" + repairBarcode + "&" + EngineTypeString;
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MobySelect");
}
return data;
}//Moby_Select_FirstOpName
private static string ShowMoby_String_FirstOpName(string OpName)
{
string data = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = ""; // BQ
//线首工位用
MES1.Moby_Select_FirstOpName(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode);
data = orderNum + "&" + EngineTypeID + "&" + EngineType + "&" + EngineID + "&" + PartPallet_Code + "&" + IsrepairBarcode + "&" + repairBarcode + "&" + EngineTypeString;
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MobySelect");
}
return data;
}
/// <summary>
/// 非上线工位
/// </summary>
/// <param name="OpName"></param>
/// <returns></returns>
//private static string ShowMoby_String(string OpName)
//{
// string data = "";
// try
// {
// string orderNum = "";
// int EngineTypeID = 0;
// string EngineType = "";
// string EngineID = "";
// string PartPallet_Code = "";
// int IsrepairBarcode = 0;
// string repairBarcode = "";
// MES1.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode);
// data = orderNum + "&" + EngineTypeID + "&" + EngineType + "&" + EngineID + "&" + PartPallet_Code + "&" + IsrepairBarcode + "&" + repairBarcode;
// }
// catch (Exception err)
// {
// ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MobySelect");
// }
// return data;
//}
private static string MaterialList_String(string OpName)
{
string jsonStr_Materail = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
MES1.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
DataTable dt_Material;
MES.PartMaterialVerify_Select(OpName, EngineTypeID, EngineType, out dt_Material);
if (dt_Material != null)
{
if (dt_Material.Rows.Count > 0)
{
jsonStr_Materail = JsonHelper.CreateJsonParameters(dt_Material);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialList");
}
return jsonStr_Materail;
}
private static string MaterialList_String_FirstOpName(string OpName)
{
string jsonStr_Materail = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
MES1.Moby_Select_FirstOpName(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode);
DataTable dt_Material;
MES.PartMaterialVerify_Select(OpName, EngineTypeID, EngineType, out dt_Material);
if (dt_Material != null)
{
if (dt_Material.Rows.Count > 0)
{
jsonStr_Materail = JsonHelper.CreateJsonParameters(dt_Material);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialList");
}
return jsonStr_Materail;
}
private static string ShowTimelyQuality_String(string OpName)
{
string text = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
DataTable dt;
MES1.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
MES.QualitySelect(OpName, EngineID, out dt);
if (dt != null)
{
if (dt.Rows.Count > 0)
{
text = JsonHelper.CreateJsonParameters(dt);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Quality_Select");
}
return text;
}
private static string ShowTimelyQuality_String_FirstOpName(string OpName)
{
string text = "";
try
{
string orderNum = "";
int EngineTypeID = 0;
string EngineType = "";
string EngineID = "";
string PartPallet_Code = "";
int IsrepairBarcode = 0;
string repairBarcode = "";
string EngineTypeString = "";
DataTable dt;
MES1.Moby_Select_FirstOpName(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode);
MES.QualitySelect(OpName, EngineID, out dt);
if (dt != null)
{
if (dt.Rows.Count > 0)
{
text = JsonHelper.CreateJsonParameters(dt);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Quality_Select");
}
return text;
}
private static string OrderFormList_String()
{
string enginetypelist = "";
try
{
System.Data.DataTable dt = null;
ShaftPosition.EngineType_Select(out dt);
if (dt != null)
{
if (dt.Rows.Count > 0)
{
enginetypelist = JsonHelper.DataTableToJson(dt);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Orderenginetypeselect");
}
return enginetypelist;
}
/// <summary>
/// 消息提醒
/// </summary>
/// <returns></returns>
private static string Notice_String(string opname)
{
string text = "";
try
{
System.Data.DataTable dt = null;
MES.ShowWindowNotice(opname, out dt);
if (dt != null)
{
if (dt.Rows.Count > 0)
{
text = JsonHelper.DataTableToJson(dt);
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShowWindowNotice");
}
return text;
}
/// <summary>
/// 批量发送WEB消息Value为BOOL值
/// </summary>
/// <param name="MessageNumm">消息编号组合</param>
/// <param name="Value">消息值组合</param>
/// <param name="OpName">工位号</param>
static public void Sendmessage(string MessageNumm, string Value, string OpName)
{
for (int i = 0; i < MessageNumm.Length; i++)
{
Sendmessage(MessageNumm[i], Value[i].ToString(), OpName);
}
}
/// <summary>
/// 选择发送给WEB的消息
/// </summary>
/// <param name="Num">消息类型</param>
/// <param name="OpName">消息工位</param>
static void Sendmessage(char Num, string Value, string OpName)
{
string SendMessage;
switch (Num)
{
case '1':
//1直接在界面通过选择机型确认工序内容
SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '2':
//2显示物料
SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '3':
//3显示操作指导图片
SendMessage = "MES|PicShow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '4':
//3显示操作指导图片
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '5':
SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '6':
SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '7':
SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '8':
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '9':
SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'a':
SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'b':
SendMessage = "MES|ShaftPosition|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'c':
SendMessage = "MES|ShowQuality|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
}
}
///// <summary>
///// 发送信息到MES通讯服务器或者其他的
///// </summary>
///// <param name="Message"></param>
//static private void AsyncSendMessage1(string Message)
//{
// MIS_BASE.asyncSendMessage(Message);
//}
}
}

View File

@@ -0,0 +1,231 @@
using bizFacade;
using MesServerWork;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MesServerFunctions
{
/// <summary>
/// 命令
///显示托盘信息√ case "ShowMoby":
///显示操作指南√ case "ProcessList":
///显示物料√ case "MaterialList":
///显示操作图片√ case "PicShow":
///显示拧紧位置√ case "ShaftPosition":
///实时显示质量数据√ case "ShowTimelyQuality":
///手动拧紧实时显示质量数据√case "ShowTimelyQuality_Tight":
///√ case "OrderFormList":
///弹窗消息√ case "Notice":
///LED消息提醒√ case "ScrollNotice":
///物料检测初始化√ case "MaterialCheckPosition":
///返修质量数据显示√ case "RepairQuality"
///
/// </summary>
public class SendMessageFun
{
/// <summary>
/// 批量发送WEB消息Value为BOOL值
/// 1:显示工序内容
/// 2显示物料
/// 3显示操作指导图片
/// 5显示机型、工件流水号、订单信息
/// c:显示质量数据
/// </summary>
/// <param name="MessageNumm">消息编号组合</param>
/// <param name="Value">消息值组合</param>
/// <param name="OpName">工位号</param>
static public void SendMessage(string MessageNumm, string Value, string OpName)
{
for (int i = 0; i < MessageNumm.Length; i++)
{
SendMessage(MessageNumm[i], Value[i].ToString(), OpName);
}
}
/// <summary>
/// 向WEB发送信息value为字符串
/// </summary>
/// <param name="Command">消息种类</param>
/// <param name="Value">消息内容</param>
/// <param name="OpName">工位号</param>
static public void SendInfomation(string Command, string Value, string OpName)
{
string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
}
static public void AsyncSendMessage_Notice(string opname, string notice)
{
//通知Web界面
BaseDataSystemMES.Web_Notice_Insert(opname, notice);
string SendMessage = "MES|Notice|" + opname + "|" + "1";
MIS_BASE.asyncSendMessage(SendMessage);
}
/// <summary>
/// 选择发送给WEB的消息
/// 1:显示工序内容
/// 2显示物料
/// 3显示操作指导图片
/// 5显示机型、工件流水号、订单信息
/// c:显示质量数据
/// </summary>
/// <param name="Num">消息类型</param>
/// <param name="OpName">消息工位</param>
static void SendMessage(char Num, string Value, string OpName)
{
string SendMessage;
switch (Num)
{
case '1':
//1直接在界面通过选择机型确认工序内容
SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '2':
//2显示物料
SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '3':
//3显示操作指导图片
SendMessage = "MES|PicShow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '4':
//3显示操作指导图片
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '5':
SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '6':
SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '7':
SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '8':
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '9':
SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'a':
SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'b':
SendMessage = "MES|ShaftPosition|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'c':
//SendMessage = "MES|ShowQuality|" + OpName + "|" + Value;
SendMessage = "MES|ShowTimelyQuality|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
}
}
/// <summary>
/// 向WEB发送信息value为字符串
/// </summary>
/// <param name="Command">消息种类</param>
/// <param name="Value">消息内容</param>
/// <param name="OpName">工位号</param>
//void SendInfomation(string Command, string Value, string OpName)
//{
// string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
// AsyncSendMessage(SendMessage);
//}
/// <summary>
/// 发送在线产量、在线节拍
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void SendActuallyCount(string OpName, int tagValue)
{
//当工件离开时,更新在线产量、在线节拍
if (tagValue == 0)
{
try
{
int opNameCount = 0;//在线产量
int opNameCountTime = 0;//在线节拍
BaseDataSystemMES.OpNameCount_New(OpName, out opNameCount, out opNameCountTime); //基本数据_工作日历_班次产量查询_New
SendInfomation("ActuallyCount", opNameCount.ToString() + "&" + opNameCountTime.ToString(), OpName);
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function01:SendActuallyCount");
}
}
}
/// <summary>
/// 发送信息到MES通讯服务器或者其他的
/// </summary>
/// <param name="Message"></param>
static public void AsyncSendMessage(string Message)
{
MIS_BASE.asyncSendMessage(Message);
}
///// <summary>
///// 发送提示消息
///// </summary>
///// <param name="Message"></param>
//static public void AsyncSendMessage_Notice(string opname, string notice)
//{
// //通知Web界面
// BaseDataSystemMES.Web_Notice_Insert(opname, notice);
// string SendMessage = "MES|Notice|" + opname + "|" + "1";
// MIS_BASE.asyncSendMessage(SendMessage);
//}
/// <summary>
/// 发送信息到打印机
/// </summary>
/// <param name="Message"></param>
private void asyncSendMessageToMark(string Message)
{
string messageSend = (string)Message;
//UDPClientSend.Send_ALL(ApplicationConfig.MES_MarkPortNum, messageSend);
}
/// <summary>
/// 发送信息到LED
/// </summary>
/// <param name="Message"></param>
private void asyncSendMessageLED(string OpName)
{
//发送到大屏幕显示 41104
string strMessage = "MIS|" + OpName + "|" + "0" + "|" + "1";
//UDPClientSend.Send_ALL(ApplicationConfig.Port_ShowLED_ProductCount, strMessage);
}
}
}

View File

@@ -0,0 +1,102 @@
<?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>{624F0E91-00F5-4ED9-8537-8F9EAAEF2F1F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebSubmit</RootNamespace>
<AssemblyName>WebSubmit</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="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="Db.cs" />
<Compile Include="MesServerFunction\Fun_WebSubmit.cs" />
<Compile Include="Methods\EngineGetOverBaseWork.cs" />
<Compile Include="Methods\SubmitToMisweb.cs" />
<Compile Include="Methods\UDP.Send.cs" />
<Compile Include="OpcServer\Barcode.cs" />
<Compile Include="OpcServer\ConfirmOkGo.cs" />
<Compile Include="OpcServer\EngineGetOver.cs" />
<Compile Include="OpcServer\FalseGO.cs" />
<Compile Include="OpcServer\MesRead.cs" />
<Compile Include="OpcServer\MesReadOver.cs" />
<Compile Include="OpcServer\WebSubmit.cs" />
<Compile Include="OpcServer\WorkStart.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\00-1Json8.3\Json8.3\00-0Json8.3.1.csproj">
<Project>{1a10fdb2-1a6a-44a8-ab4d-33387563247e}</Project>
<Name>00-0Json8.3.1</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\00-2AppConfigSet\AppConfigSet\00-1AppConfigSetForm.csproj">
<Project>{5fd5de57-cc26-4fd0-b852-5362123bc4ff}</Project>
<Name>00-1AppConfigSetForm</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
<Name>00MesWorkMqtt</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\01DoWhatPlc\01_01DoWhatPlc.csproj">
<Project>{0d1af432-439a-4920-8692-43ae139f5530}</Project>
<Name>01_01DoWhatPlc</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\02WebApiCall\02_02WebApiCallPLC.csproj">
<Project>{3e6d1dd5-01c9-435f-9941-61f906ce35bb}</Project>
<Name>02_02WebApiCallPLC</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj">
<Project>{f434e066-4c59-47c8-aa82-6f48cc84501a}</Project>
<Name>04-DataBaseAccess</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\07WebBusinessFacade\BusinessFacade\07BusinessFacade.csproj">
<Project>{f0a0c525-03fd-428a-9b17-7f54aa0e4475}</Project>
<Name>07BusinessFacade</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\08WebFun_base\WebFun_base\08-WebFun_base.csproj">
<Project>{d98be764-adeb-488d-9714-61e308aa8201}</Project>
<Name>08-WebFun_base</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\09MesDataFunction\MesDataFunction\09-MesDataFunction.csproj">
<Project>{90e76fb4-646d-45e2-95db-0b8ab4e465d6}</Project>
<Name>09-MesDataFunction</Name>
</ProjectReference>
<ProjectReference Include="..\SendMessageToWebMqtt\12SendMessageToWeb.csproj">
<Project>{e4eb6420-906d-4672-947a-ca33ddcdadfc}</Project>
<Name>12SendMessageToWeb</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataLinkMesWork;
namespace MesServerFunctions
{
public class Db
{
/// <summary>
/// 北汽福田变速器序列号总线上线_获得机型信息
/// </summary>
/// <param name="partSn"></param>
/// <param name="EngineTypeID"></param>
/// <param name="EngineType"></param>
/// <param name="EngineID"></param>
/// <param name="IsRepeatedNumber"> 0 不重号1 重号2失败</param>
/// <returns></returns>
public static bool GetEngineType(string partSn, out int EngineTypeID, out string EngineType, out string EngineID,out int IsRepeatedNumber)
{
DataTable dt = new DataTable();
EngineTypeID = 0;
EngineType = "";
EngineID = "";
IsRepeatedNumber = 2;
string produceName = "北汽福田变速器序列号总线上线_获得机型信息";
SqlParameter[] thisParms = new SqlParameter[1];
thisParms[0] = new System.Data.SqlClient.SqlParameter("@变速器序列号", partSn);
thisParms[2].Direction = ParameterDirection.Output;
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms,out dt))
{
if(dt.Rows.Count > 0)
{
IsRepeatedNumber = Convert.ToInt32( dt.Rows[0]["IsRepeatedNumber"]);
EngineTypeID = Convert.ToInt32(dt.Rows[0]["EngineTypeID"]);
EngineType = dt.Rows[0]["EngineType"].ToString();
EngineID = dt.Rows[0]["EngineID"].ToString();
return true;
}
}
return false;
}
/// <summary>
/// 北汽福田变速器序列号总线上线_增加
/// </summary>
/// <param name="partSn"></param>
/// <param name="EngineTypeID"></param>
/// <param name="EngineType"></param>
/// <param name="OpName"></param>
/// <returns></returns>
public static bool UpLoadOpNameInsert(string partSn, int EngineTypeID, string EngineType, string OpName)
{
string produceName = "北汽福田变速器序列号总线上线_增加";
SqlParameter[] thisParms = new SqlParameter[1];
thisParms[0] = new System.Data.SqlClient.SqlParameter("@变速器序列号", partSn);
thisParms[1] = new System.Data.SqlClient.SqlParameter("@基本型号代码", EngineTypeID);
thisParms[2] = new System.Data.SqlClient.SqlParameter("@基本型号", EngineType);
thisParms[3] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
}
// ALTER PROCEDURE[dbo].[北汽福田变速器序列号总线上线_增加]
// @变速器序列号 nvarchar(50)='1333 050 062 0001*146012023*12345678',--'1333 050 062 0001'
//@基本型号代码 int=1,
//@基本型号 nvarchar(50)='1333 050 062 0001',
//@工位号 nvarchar(50) = 'J05PA010'
}
}

View File

@@ -0,0 +1,100 @@
using System.Threading;
namespace MesServerFunctions
{
public partial class Functions_BASE_WebSubmit
{
//1.工件到位后PLC给MES传递机型(DBX0.4)(44)
//2.MES判断是否扫描完成
//3.若扫描完成则MES给出合格放行(DBX2.5)(51)
/// <summary>
/// 扫描条码
/// </summary>
/// <param name="OpName"></param>
/// <param name="barcode"></param>
public static void fun_Barcode(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(Barcode, e);
}
/// <summary>
/// 传递机型
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
public static void fun_EngineTypeGetOverPLC(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(EngineTypeGetOver_PLC, e);
}
/// <summary>
/// 合格放行
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
public void fun_ConfirmOkGo(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(ConfirmOkGo, e);
}
/// <summary>
/// 不合格放行
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
public void fun_FalseGo(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(FalseGO, e);
}
/// <summary>
/// 保存完成 20
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
public void fun_MesReadOver(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(MesReadOver, e);
}
/// <summary>
/// 保存完成 19
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
public void fun_MesRead(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(MesRead, e);
}
/// <summary>
/// 工件到位离开(清空所有的MES信号)
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
public void fun_WorkStart(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(WorkStart, e);
}
/// <summary>
/// 处理WEB页面发送过来的请求m_Command + "|" + m_Value;
/// </summary>
/// <param name="OpName"></param>
/// <param name="Content"></param>
public void fun_WebSubmit(DoWhatPlc.CustomeEvetnArgs e)
{
ThreadPool.QueueUserWorkItem(WebSubmit, e);
}
public int fun_SubLineLoadPartCountMatch()
{
return SubLineLoadPartCountMatch;
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,286 @@
using System;
using System.Data;
using bizFacade;
using MesServerWork;
//using SystemFramework;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 分线上总线的数量
/// </summary>
public static int SubLineLoadPartCount = 2;
/// <summary>
/// 分线上总线已经匹配的数量
/// </summary>
public static int SubLineLoadPartCountMatch = 0;
/// <summary>
/// 正常逻辑工作
/// </summary>
/// <param name="OpName"></param>
/// <param name="EngineTypeID"></param>
/// <param name="EngineType"></param>
/// <param name="EngineID"></param>
/// <param name="PartPallet_Code"></param>
private static void EngineTypeGetOver_PLC_Work(string OpName, int EngineTypeID, string EngineType, string EngineID, int PartPallet_Code,string OrderForm)
{
int IsAllowWork;
int MES_QualityMask = 1;
int repairPart;//读取返修标志
int IsrepairBarcode = 0;//拆解返修标志
//string OrderForm = "";//订单号
string repairBarcode = "";//拆解返修条码
DataTable dt;//读取订单信息
MIS_BASE.Read_OnlineRepair(OpName, out repairPart);
BaseDataSystemMES.GetEngineID_Select(OpName, EngineID, out dt);
if (dt != null && dt.Rows.Count > 0)
{
//OrderForm = Convert.ToString(dt.Rows[0]["订单号"]);
IsrepairBarcode = Convert.ToInt32(dt.Rows[0]["拆解标志"]);
repairBarcode = Convert.ToString(dt.Rows[0]["拆解返修条码"]);
}
//记录MOBY信息只限总装工位
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, OrderForm,EngineTypeID, EngineType, EngineID, PartPallet_Code, repairPart, IsrepairBarcode, repairBarcode);
SaveMobyMessage(OpName, EngineTypeID, EngineType, EngineID, OrderForm);
BaseDataSystemMES.MaterialPush_EngineIDStatus_Insert(OpName);
BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
Sendmessage("5123", "1111", OpName);
MIS_BASE.Read_PalletInfo(OpName, out MES_QualityMask);
SendInfomation("QualityMask", Convert.ToString(MES_QualityMask), OpName);
if (MES_QualityMask != 1)
{
//工作完成
MIS_BASE.Write_MaterialVerifyOver(OpName, true);
SendInfomation("NgGO", "1", OpName);//显示不合格标志
return;
}
BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
if (IsAllowWork == 1)
{
Match(OpName, EngineID, EngineTypeID, EngineType, PartPallet_Code);//匹配
}
}
/// <summary>
/// 保存MOBY信息
/// </summary>
/// <param name="OpName"></param>
/// <param name="engineTypeID"></param>
/// <param name="engineType"></param>
/// <param name="engineID"></param>
private static void SaveMobyMessage(string OpName, int engineTypeID, string engineType, string engineID, string orderForm)
{
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_EngineTypeID[OpName] = engineTypeID;
}
if (MIS_BASE.hashtable_EngineGetOver_EngineType.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_EngineType[OpName] = engineType;
}
if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_EngineID[OpName] = engineID;
}
if (MIS_BASE.hashtable_EngineGetOver_OrderForm.ContainsKey(OpName))
{
MIS_BASE.hashtable_EngineGetOver_OrderForm[OpName] = orderForm;
}
}
/// <summary>
/// 返修件需要工作
/// </summary>
/// <param name="OpName">工位号</param>
private static void IsNeedRepaire_OK(string OpName)
{
int isRepair;
int engineTypeID;
string engineType = "";
string engineID = "";
string palletCode = "";
string orderForm = "";
string repairCode = "";
//从监控系统中查询出本工位信息
BaseDataSystemMES.OpName_MIS_Moby_Select(OpName,
out orderForm, out engineTypeID, out engineType,
out engineID, out palletCode, out isRepair, out repairCode);
EngineTypeGetOver_PLC_Work(OpName, engineTypeID, engineType, engineID, Convert.ToInt32(palletCode),orderForm);
}
/// <summary>
/// 正常匹配分线和总线
/// </summary>
/// <param name="opName"></param>
/// <param name="engineID">总线工件号</param>
/// <param name="engineTypeID">总线工件机型代码</param>
/// <param name="engineType">总线工件机型</param>
private static void Match(string opName, string engineID, int engineTypeID, string engineType, int PartPallet_Code)
{
try
{
bool m_EngineGetOver_PLC_SubLine;
int engineTypeID_SubLine;
int partPallet_Code_SubLine;
int PalletInfo = 1;//总线托盘状态
string opName_SubLine = "";//分线工件信息
string engineID_SubLine;
string engineType_SubLine;
string AlarmStr;
if (MIS_BASE.hashtable_OpNameRepair == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
//第一步:获取分线中间交互工位号
if (MIS_BASE.hashtable_OpNameRepair.ContainsKey(opName))
{
opName_SubLine = MIS_BASE.hashtable_OpNameRepair[opName].ToString();
}
if (opName_SubLine == "")
{
return;
}
//第二步:获取分线传递机型信号
MIS_BASE.Read_EngineGetOver_PLC(opName_SubLine, out m_EngineGetOver_PLC_SubLine);
if (!m_EngineGetOver_PLC_SubLine) return;//必须工件同时到位才能进行匹配
//第三步:判断合格标志
MIS_BASE.Read_PalletInfo(opName_SubLine, out PalletInfo);
if (PalletInfo == 2) return; //若不合格则返回不进行匹配
string OrderForm;
//第四步:获取分线的信息,匹配验证
MIS_BASE.GetEngineTypeFromPLC(opName_SubLine, out engineTypeID_SubLine, out engineType_SubLine, out engineID_SubLine, out partPallet_Code_SubLine,out OrderForm);
//判断分线数据是否合格
//if (!BaseDataSystemMES.QulityDataVerify(opName, engineID_SubLine, out AlarmStr) && !BaseDataSystemMES.QualityVerifyStatus_Hash_Read(opName))
//{
// SendInfomation("LineoutAlert", AlarmStr, opName);
// return;
//}
if (engineTypeID_SubLine == engineTypeID)
{
BaseDataSystemMES.SubLineLoadPartCountMatch_Select(opName, out SubLineLoadPartCountMatch);
SubLineLoadPartCountMatch = SubLineLoadPartCountMatch + 1;
BaseDataSystemMES.SubLineLoadPartCountMatch_Update(opName, SubLineLoadPartCountMatch);
BaseDataSystemMES.MailLineAndSubLineData_Insert(engineID, engineTypeID, engineType, engineID_SubLine);//分线上总线数据转移
MIS_BASE.Write_Match(opName, true);//匹配结果
MIS_BASE.Write_MatchingCompleted(opName, true);//匹配完成
if(SubLineLoadPartCountMatch== SubLineLoadPartCount)
{
MIS_BASE.Write_FixAllow(opName, true);
SubLineLoadPartCountMatch = 0;
BaseDataSystemMES.SubLineLoadPartCountMatch_Update(opName, SubLineLoadPartCountMatch);
}
SendInfomation("MatchSuccess", "1", opName);
sendmessage(opName, 1, "Match");//匹配结果
}
else
{
MIS_BASE.Write_Match(opName, false);//匹配结果
MIS_BASE.Write_MatchingCompleted(opName, true);//匹配完成//68:1、取消返修2、匹配成功 自己监控发送 MES|MatchingCompleted
//发送匹配完成和匹配结果信息
AsyncSendMessage_Notice(opName,"匹配失败,工件型号不匹配!");
SendInfomation("MatchSuccess", "0", opName);
sendmessage(opName, 0, "Match");//匹配结果
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog("Match:" + err.ToString());
}
}
/// <summary>
/// 强制匹配分线和总线
/// </summary>
/// <param name="opName"></param>
private static void ForceMatch(string opName)
{
try
{
bool m_EngineGetOver_PLC_SubLine;
bool m_EngineGetOver_PLC;
int engineTypeID_SubLine;
int engineTypeID;
int partPallet_Code_SubLine;
int partPallet_Code;
string opName_SubLine = "";//分线工件信息
string engineID_SubLine;
string engineType_SubLine;
string engineID;
string engineType;
if (MIS_BASE.hashtable_OpNameRepair == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
//获取分线中间交互工位号
if (MIS_BASE.hashtable_OpNameRepair.ContainsKey(opName))
{
opName_SubLine = MIS_BASE.hashtable_OpNameRepair[opName].ToString();
}
if (opName_SubLine == "")
{
return;
}
MIS_BASE.Read_EngineGetOver_PLC(opName_SubLine, out m_EngineGetOver_PLC_SubLine);//1:读取分线工件到位的传递机型信号。
if (!m_EngineGetOver_PLC_SubLine) return;//必须工件同时到位才能进行匹配
MIS_BASE.Read_EngineGetOver_PLC(opName, out m_EngineGetOver_PLC);//2:读取总线工件到位的传递机型信号。
if (!m_EngineGetOver_PLC) return;//必须工件同时到位才能进行匹配
string OrderForm;
MIS_BASE.GetEngineTypeFromPLC(opName_SubLine, out engineTypeID_SubLine, out engineType_SubLine, out engineID_SubLine, out partPallet_Code_SubLine,out OrderForm);//获取分线的信息
MIS_BASE.GetEngineTypeFromPLC(opName, out engineTypeID, out engineType, out engineID, out partPallet_Code, out OrderForm);
BaseDataSystemMES.MailLineAndSubLineData_Insert(engineID, engineTypeID, engineType, engineID_SubLine);//分线上总线数据转移
MIS_BASE.Write_Match(opName, true);//匹配结果
MIS_BASE.Write_MatchingCompleted(opName, true);//匹配完成
SendInfomation("MatchSuccess", "1", opName);//界面显示匹配成功
MIS_BASE.Write_FixAllow(opName, true);//允许PLC工作
//发送匹配完成和匹配结果信息
sendmessage(opName, 1, "MatchingComplete");//匹配完成
sendmessage(opName, 1, "Match");//匹配结果
}
catch
{
}
}
}
}

View File

@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using bizFacade;
//using SystemFramework;
namespace MesServerFunctions
{
/// <summary>
/// 此类用于向WEB发送各种类型消息
/// </summary>
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 批量发送WEB消息Value为BOOL值
/// </summary>
/// <param name="MessageNumm">消息编号组合</param>
/// <param name="Value">消息值组合</param>
/// <param name="OpName">工位号</param>
static void Sendmessage(string MessageNumm,string Value, string OpName)
{
for (int i=0;i<MessageNumm.Length;i++)
{
Sendmessage(MessageNumm[i], Value[i].ToString(), OpName);
}
}
/// <summary>
/// 选择发送给WEB的消息
/// </summary>
/// <param name="Num">消息类型</param>
/// <param name="OpName">消息工位</param>
static void Sendmessage(char Num,string Value, string OpName)
{
string SendMessage;
switch (Num)
{
case '1':
//1直接在界面通过选择机型确认工序内容
SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '2':
//2显示物料
SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '3':
//3显示操作指导图片
SendMessage = "MES|PicShow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '4':
//3显示操作指导图片
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '5':
SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '6':
SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" +Value;
AsyncSendMessage(SendMessage);
break;
case '7':
SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '8':
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case '9':
SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'a':
SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'b':
SendMessage = "MES|ShaftPosition|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
case 'c':
SendMessage = "MES|ShowQuality|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
break;
}
}
/// <summary>
/// 向WEB发送信息value为字符串
/// </summary>
/// <param name="Command">消息种类</param>
/// <param name="Value">消息内容</param>
/// <param name="OpName">工位号</param>
static void SendInfomation(string Command, string Value, string OpName)
{
string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
AsyncSendMessage(SendMessage);
}
/// <summary>
/// 发送在线产量、在线节拍
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void SendActuallyCount(string OpName, int tagValue)
{
//当工件离开时,更新在线产量、在线节拍
if (tagValue == 0)
{
try
{
int opNameCount = 0;//在线产量
int opNameCountTime = 0;//在线节拍
BaseDataSystemMES.OpNameCount_New(OpName, out opNameCount, out opNameCountTime); //基本数据_工作日历_班次产量查询_New
SendInfomation("ActuallyCount", opNameCount.ToString() + "&" + opNameCountTime.ToString(), OpName);
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function01:SendActuallyCount");
}
}
}
}
}

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MesServerWork;
//using BasicData;
using System.Collections;
using bizFacade;
//using SystemFramework;
using System.Data;
using System.Threading;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 发送信息到MES通讯服务器或者其他的
/// </summary>
/// <param name="Message"></param>
private static void AsyncSendMessage(string Message)
{
MIS_BASE.asyncSendMessage(Message);
}
/// <summary>
/// 发送提示消息
/// </summary>
/// <param name="Message"></param>
private static void AsyncSendMessage_Notice(string opname, string notice)
{
//通知Web界面
BaseDataSystemMES.Web_Notice_Insert(opname, notice);
string SendMessage = "MES|Notice|" + opname + "|" + "1";
MIS_BASE.asyncSendMessage(SendMessage);
}
/// <summary>
/// 发送信息到打印机
/// </summary>
/// <param name="Message"></param>
private void asyncSendMessageToMark(string Message)
{
string messageSend = (string)Message;
//UDPClientSend.Send_ALL(ApplicationConfig.MES_MarkPortNum, messageSend);
}
/// <summary>
/// 发送信息到LED
/// </summary>
/// <param name="Message"></param>
private void asyncSendMessageLED(string OpName)
{
//发送到大屏幕显示 41104
string strMessage = "MIS|" + OpName + "|" + "0" + "|" + "1";
//UDPClientSend.Send_ALL(ApplicationConfig.Port_ShowLED_ProductCount, strMessage);
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,86 @@
using System;
using bizFacade;
//using SystemFramework;
using MesServerWork;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
///第一步,判断条码类型,根据条码类型,执行对应的存储过程
///第二步,条码类型(将扫描的条码保存到对应的表中)
///第三步,扫描完成之后给出允许工作信号
/// 处理页面扫描条码
/// </summary>
/// <param name="OpName"></param>
/// <param name="barcode"></param>
public static void Barcode(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
string barcode = Convert.ToString(msgEvent.TagValue);
int EngineTypeID;//机型代码
string EngineType;//机型
string EngineID;//工件编号
int IsRepeatedNumber = 2;
//1:获得申请上线信息后,扫描条码才处理业务
bool ispartload;
MIS_BASE.Read_PartLoad(OpName, out ispartload);
if(!ispartload)
{
AsyncSendMessage_Notice(OpName, "设备请发出申请上线信号DBX500.3=1");
return;
}
//2: 判断是否重号, 从数据库获得机型、机型代码等信息
string partSn = barcode;
Db.GetEngineType( partSn, out EngineTypeID, out EngineType, out EngineID, out IsRepeatedNumber);
//IsRepeatedNumber 0 不重号1 重号2失败
switch (IsRepeatedNumber)
{
case 0:
////将产品信息写入PLC
MIS_BASE.Write_EngineTypeID_MES(OpName, EngineTypeID);
MIS_BASE.Write_EngineType_MES(OpName, EngineType);
MIS_BASE.Write_EngineID_MES(OpName, EngineID);
// 工位号],[订单号],[产品型号代码],[变速器序列号],[发动机型号],[机型基本代码],[变速器总成号] ,[托盘号]
// [产品型号代码_MES],[变速器序列号_MES],[发动机型号_MES]
// [机床上电],[循环开始],[机床故障],[上料无件],[下料堵塞],[工件到位]
// [传递机型],[申请上件],[允许保存],[保存完成],[合格标志],[前序合格]
// [工号],[班次],[是否返修件],[合格放行],[不合格放行],[扫描条码]
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, "产品型号代码_MES", EngineTypeID.ToString());
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, "发动机型号_MES", EngineType);
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, "变速器序列号_MES", EngineID);
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, true);
//等待PLC将数据写入RFID写入PLC的DB块通知MES验证RFID机型数据是否正确传递
break;
case 1:
AsyncSendMessage_Notice(OpName, "变速器序列号 重号,请确认!");
break;
case 2:
AsyncSendMessage_Notice(OpName, "变速器序列号获取机型代码失败 ,请确认!");
break;
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:Barcode");
}
}
}
}

View File

@@ -0,0 +1,35 @@
using System;
//using SystemFramework;
using MesServerWork;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 合格放行
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void ConfirmOkGo(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
if (tagValue == 1)
{
MIS_BASE.Write_MaterialVerifyOver(OpName, true);//工作完成
SendInfomation("OrderFormList","1", OpName);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:ConfirmOkGo");
}
}
}
}

View File

@@ -0,0 +1,87 @@
using System;
using bizFacade;
using MesServerWork;
//using SystemFramework;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// PLC传递机型处理
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private static void EngineTypeGetOver_PLC(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
//判断PLC机型与MES机型是否一致
if (tagValue == 1)
{
bool MesRead = false;
int EngineTypeID;//机型代码
int PartPallet_Code;//托盘编号
string EngineType;//机型
string EngineID;//工件编号
int EngineTypeID_MES;//机型代码
string EngineType_MES;//机型
string EngineID_MES;//工件编号
MIS_BASE.Read_QualityData_Read_CF(OpName, out MesRead);
//第一步判断允许保存和保存完成信号是否全部被清空若未清空则通知复位MES&PLC
if (MesRead)
{
//未能清空信号,请求复位
SendInfomation("AskReset", "1", OpName);
return;
}
string OrderForm;
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code,out OrderForm);
MIS_BASE.GetEngineTypeFromPLC_MES(OpName, out EngineTypeID_MES, out EngineType_MES, out EngineID_MES);
// 工位号],[订单号],[产品型号代码],[变速器序列号],[发动机型号],[机型基本代码],[变速器总成号] ,[托盘号]
// [产品型号代码_MES],[变速器序列号_MES],[发动机型号_MES]
// [机床上电],[循环开始],[机床故障],[上料无件],[下料堵塞],[工件到位]
// [传递机型],[申请上件],[允许保存],[保存完成],[合格标志],[前序合格]
// [工号],[班次],[是否返修件],[合格放行],[不合格放行],[扫描条码]
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, MobyTagType.EngineTypeID, EngineTypeID.ToString());
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, MobyTagType.EngineType, EngineType);
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, MobyTagType.EngineID, EngineID);
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, MobyTagType.PartPallet_Code, PartPallet_Code.ToString());
//显示当前订单信息
SendMessage.ShowMoby(OpName);
if (EngineTypeID_MES == EngineTypeID & EngineID_MES == EngineID & EngineType_MES== EngineType)
{
MIS_BASE.Write_FixAllow(OpName, true);
//显示 显示绿脸
return;
}
else
{
SendMessage.AsyncSendMessage_Notice(OpName, "码块RFID机型与MES机型不匹配");
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:EngineTypeGetOver_PLC");
}
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using MesServerWork;
//using SystemFramework;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 返修放行
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void FalseGO(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
if (tagValue == 1)
{
MIS_BASE.Write_MaterialVerifyOver(OpName, true);//工作完成
SendInfomation("OrderFormList", "1", OpName);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:FalseGO");
}
}
}
}

View File

@@ -0,0 +1,49 @@
using System;
using bizFacade;
//using SystemFramework;
using MesServerWork;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 保存完成(针对半自动和手动压装工位)
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void MesRead(object e)
{
try
{
int EngineTypeID;
string EngineType;
string EngineID;
int PartPallet_Code;
string OrderForm;
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
if (tagValue == 1)
{
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
//保存数据到线首表
if (Db.UpLoadOpNameInsert(EngineID, EngineTypeID, EngineType, OpName))
{
MIS_BASE.Write_MesReadOver(OpName, true);
SendMessage.SendActuallyCount(OpName, tagValue);//统计在线产量,在线节拍
}
else
{
SendMessage.AsyncSendMessage_Notice(OpName, "保存上线数据失败!");
}
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
}
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using bizFacade;
//using SystemFramework;
using MesServerWork;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 保存完成(针对半自动和手动压装工位)
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void MesReadOver(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
if (tagValue == 1)
{
BaseDataSystemMES.Material_Insert(OpName, tagValue);
MIS_BASE.Write_ConfirmOkGo(OpName, true);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
}
}
}
}

View File

@@ -0,0 +1,309 @@
using System;
using MesServerWork;
using bizFacade;
//using SystemFramework;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 处理WEB页面发送过来的请求m_Command + "|" + m_Value;
/// </summary>
/// <param name="OpName"></param>
/// <param name="Content"></param>
public static void WebSubmit(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
string Content = Convert.ToString(msgEvent.TagValue);
string opName_SubLine = "";
string engineID = "";//工件信息
string[] dataArray = Content.Split('|');
if (dataArray.Length != 2)
return;
string m_Command = dataArray[0].ToString();//消息类型
string m_Value = dataArray[1].ToString();//消息参数
string[] m_Value_array = m_Value.Split('&');//消息参数数量
int m_Value_length = m_Value_array.Length; //消息参数长度
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
{
engineID = MIS_BASE.hashtable_EngineGetOver_EngineID[OpName].ToString();
}
if (MIS_BASE.hashtable_OpNameRepair == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
//获取分线中间交互工位号
if (MIS_BASE.hashtable_OpNameRepair.ContainsKey(OpName))
{
opName_SubLine = MIS_BASE.hashtable_OpNameRepair[OpName].ToString();
}
//if (opName_SubLine == "")
//{
// return;
//}
DoWhatPlc.CustomeEvetnArgs _e = new DoWhatPlc.CustomeEvetnArgs();
_e.OpName = OpName;
_e.TagValue = m_Value;
//根据请求的命令处理逻辑
switch (m_Command)
{
case "Barcode":
if (m_Value_length > 1) return;
fun_Barcode(_e);
break;
case "ConfirmOkGo"://合格放行
//修改托盘状态
BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
MIS_BASE.Write_ConfirmOkGo(OpName, true);
MIS_BASE.Write_FalseGO(OpName, false);
break;
case "FalseGO"://返修放行
//修改托盘状态
BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
MIS_BASE.Write_FalseGO(OpName, true);
MIS_BASE.Write_ConfirmOkGo(OpName, false);
break;
case "NgGO"://不合格放行
//修改托盘状态
//保存不合格信息(必须保存不合格放行信息由于B5A的Moby没有不合格标志位)
BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Insert(OpName, engineID, "", "");
MIS_BASE.Write_FalseGO(OpName, true);
MIS_BASE.Write_ConfirmOkGo(OpName, false);
break;
case "OnLineState"://在线0、离线1、屏蔽2
try
{
if (m_Value_length > 1) return;
int a = Convert.ToInt32(m_Value);
if (a <= 2)
{
BaseDataSystemMES.IsOnLine_Update(OpName, m_Value.ToString());
MIS_BASE.Write_OnLineState(OpName, Convert.ToInt32(m_Value));
}
}
catch
{
}
break;
case "Reset"://复位将MES所有的信息都复位了
SetMoby(OpName);//将MES所有信号清空
break;
case "FixAllow"://重新拧紧
break;
case "IsAutoGetEngineID"://自动手动申请编号(线首)
if (m_Value_length > 1) return;
MIS_BASE.Write_IsAutoGetEngineID(OpName, Convert.ToInt32(m_Value));
break;
case "PartPalletGoOver"://空托盘放行
MIS_BASE.Write_RepairUpline_MES(opName_SubLine, true);
//MIS_BASE.Write_PalletInfo(opName_SubLine, 4);
//MIS_BASE.Write_UpdatePalletOK(opName_SubLine, true);
MIS_BASE.Write_MaterialVerifyOver(opName_SubLine, true);
break;
case "SetMoby"://清空托盘(线首)
SetMoby(OpName);//将MES所有信号清空
break;
case "RepairUplineMES"://返修上线
MIS_BASE.Write_RepairUpline_MES(OpName, true);
break;
case "CancelRepair"://将返修件置为正常件
break;
case "PartPalletCode"://申请写入托盘号
//MIS_BASE.Write_PartPalletCode_PLC(OpName, 1);
break;
case "WritePartPalletCode"://写入托盘号
if (m_Value_length > 1) return;
MIS_BASE.Write_PalletCode(OpName, Convert.ToInt32(m_Value));
break;
case "Normal"://启用正常拧紧工位
MIS_BASE.Write_Normal(OpName, 1);
MIS_BASE.Write_UnNormal(OpName, 0);
break;
case "UnNormal"://启用备用拧紧工位
MIS_BASE.Write_Normal(OpName, 0);
MIS_BASE.Write_UnNormal(OpName, 1);
break;
case "ResetDevice"://复位设备
MIS_BASE.Write_ResetDevice(OpName, true);
System.Threading.Thread.Sleep(1000);
MIS_BASE.Write_ResetDevice(OpName, false);
break;
case "IsNeedRepaire"://返修上线(返修上线点)
if (Convert.ToInt32(m_Value) == 1)
{
//修改托盘状态
MIS_BASE.Write_PalletInfo(OpName, 3);
//通知修改成功
MIS_BASE.Write_UpdatePalletOK(OpName, true);
IsNeedRepaire_OK(OpName);
}
else if (Convert.ToInt32(m_Value) == 0)
{
//直接给出工作完成
MIS_BASE.Write_MaterialVerifyOver(OpName, true);
}
break;
//强制匹配
case "ForceMatch":
if (Convert.ToInt32(m_Value) == 1)
{
ForceMatch(OpName);
}
break;
case "PalletGO":
if (Convert.ToInt32(m_Value) == 1)
{
//直接给出工作完成
MIS_BASE.Write_MaterialVerifyOver(opName_SubLine, true);
}
break;
case "ContinueMatch":
BaseDataSystemMES.QualityVerifyStatus_Hash_Write(OpName, true);
fun_EngineTypeGetOverPLC(_e);
break;
//初始化网页信号
case "IniSingalToWeb":
InitializeSingalToWeb(OpName);
break;
default: break;
}
}
catch(Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:WebSubmit");
}
}
private static void SetMoby(string OpName)
{
try
{
//清空Moby时需要将MES信号清空
MIS_BASE.Write_ClearMesMoby(OpName);
BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
Sendmessage("5123", "1111", OpName);
MIS_BASE.Write_ResetDevice(OpName, true);
System.Threading.Thread.Sleep(1000);
MIS_BASE.Write_ResetDevice(OpName, false);
}
catch
{
}
}
/// <summary>
/// 网页重现登录,恢复关闭前的页面状态
/// </summary>
/// <param name="Opname">工位号</param>
private static void InitializeSingalToWeb(string Opname)
{
bool S_WorkStart;//工件到位 DBX0.1
bool S_EngineGetOver;//传递机型 DBX0.4
bool S_FixAllow;//允许工作 DBX3.1
bool S_MaterialVerifyOver;//工作完成 DBX2.3
int IsCompleted = 0;
int S_Match = 0;
int PalletInfo_SubLine = 0;//显示分线托盘状态
MIS_BASE.Read_WorkStart(Opname, out S_WorkStart);
if (S_WorkStart == true)
{
SendInfomation("WorkStart", Convert.ToString(Convert.ToInt32(S_WorkStart)), Opname);
sendmessage(Opname, Convert.ToInt32(S_WorkStart), "WorkStart_Subline");
}
sendmessage(Opname, Convert.ToInt32(S_WorkStart), "EngineTypeGetOverMES_Subline");
MIS_BASE.Read_EngineGetOver_PLC(Opname, out S_EngineGetOver);
if (S_EngineGetOver == true)
{
SendInfomation("EngineTypeGetOverPLC", Convert.ToString(Convert.ToInt32(S_EngineGetOver)), Opname);
sendmessage(Opname, Convert.ToInt32(S_EngineGetOver), "EngineTypeGetOverMES_Subline");
}
MIS_BASE.Read_FixAllow(Opname, out S_FixAllow);
if (S_FixAllow == true)
{
SendInfomation("FixAllow", Convert.ToString(Convert.ToInt32(S_FixAllow)), Opname);
}
MIS_BASE.Read_MaterialVerifyOver(Opname, out S_MaterialVerifyOver);
if (S_MaterialVerifyOver == true)
{
SendInfomation("MaterialVerifyOver", Convert.ToString(Convert.ToInt32(S_MaterialVerifyOver)), Opname);
}
MIS_BASE.Read_MatchingCompleted(Opname, out IsCompleted); //DBX1.3 是否匹配
MIS_BASE.Read_Match(Opname, out S_Match); //DBX1.4 匹配结果
if (IsCompleted == 1 && S_Match == 1)//发送匹配完成和匹配结果信息
{
SendInfomation("MatchingCompleted", "1", Opname);
SendInfomation("Match", "1", Opname);
SendInfomation("MatchSuccess", "1", Opname);//界面显示匹配成功
}
else if (IsCompleted == 1 && S_Match == 0)
{
SendInfomation("MatchSuccess", "0", Opname);//界面显示匹配失败
}
if (MIS_BASE.hashtable_OpNameRepair == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
string Opname_SubLine = "";
if (MIS_BASE.hashtable_OpNameRepair.ContainsKey(Opname))
{
Opname_SubLine = MIS_BASE.hashtable_OpNameRepair[Opname].ToString();
}
if (Opname_SubLine == "")
{
return;
}
MIS_BASE.Read_PalletInfo(Opname, out PalletInfo_SubLine);
sendmessage(Opname, PalletInfo_SubLine, "SubQualityMask");
SendInfomation("ShowMobySubLine", Opname_SubLine, Opname);//显示分线机型及流水号
}
//分线发送工件到位信号函数
private static void sendmessage(string OpName, int tagValue, string Command)
{
string SendMessage;
SendMessage = "MES|" + Command + "|" + OpName + "|" + tagValue;
AsyncSendMessage(SendMessage);
}
}
}

View File

@@ -0,0 +1,59 @@
using System;
using bizFacade;
using MesServerWork;
//using SystemFramework;
namespace MesServerFunctions
{
partial class Functions_BASE_WebSubmit
{
/// <summary>
/// 工件到位与离开时清空MES自身信号
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void WorkStart(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
//线首显示订单信息
if (tagValue == 1)
{
//清空MOBY的产品流水号
// 北汽福田工位状态监控MOBY_增加
// 工位号],[订单号],[产品型号代码],[变速器序列号],[发动机型号],[机型基本代码],[变速器总成号] ,[托盘号]
// [产品型号代码_MES],[变速器序列号_MES],[发动机型号_MES]
// [机床上电],[循环开始],[机床故障],[上料无件],[下料堵塞],[工件到位]
// [传递机型],[申请上件],[允许保存],[保存完成],[合格标志],[前序合格]
// [工号],[班次],[是否返修件],[合格放行],[不合格放行],[扫描条码]
//[到达时间],[离开时间],[持续时间]
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, MobyTagType.WorkStartIn, DateTime.Now.ToString());
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, MobyTagType.EngineID, tagValue.ToString());
//5 显示订单、机型信息
SendMessage.ShowMoby(OpName);
//3显示操作指导图片
SendMessage.PicShow(OpName);
//1直接在界面通过选择机型确认工序内容
SendMessage.ProcessList(OpName);
}
else if (tagValue == 0)
{
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, MobyTagType.WorkStartOut, DateTime.Now.ToString());
}
}
catch(Exception err)
{
////ApplicationLog.WriteLog(err, "Function08:WorkStart");
}
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("WebSubmit")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebSubmit")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("624f0e91-00f5-4ed9-8537-8f9eaaef2f1f")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]