chore: 初始化合力驱动桥MES采集程序
25
MesMonitor/--PlcMonitor/PlcMonitor.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32929.386
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlcMonitor", "PlcMonitor\PlcMonitor.csproj", "{67F90D19-10E5-4CFB-8667-BFF6AFDAF6C0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{67F90D19-10E5-4CFB-8667-BFF6AFDAF6C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{67F90D19-10E5-4CFB-8667-BFF6AFDAF6C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{67F90D19-10E5-4CFB-8667-BFF6AFDAF6C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{67F90D19-10E5-4CFB-8667-BFF6AFDAF6C0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F0FF1176-C12C-41BC-9ED3-6FE5BE278F63}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
6
MesMonitor/--PlcMonitor/PlcMonitor/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
||||
41
MesMonitor/--PlcMonitor/PlcMonitor/Form1.Designer.cs
generated
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
namespace PlcMonitor
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows 窗体设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "Form1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
20
MesMonitor/--PlcMonitor/PlcMonitor/Form1.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PlcMonitor
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
80
MesMonitor/--PlcMonitor/PlcMonitor/PlcMonitor.csproj
Normal file
@@ -0,0 +1,80 @@
|
||||
<?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>{67F90D19-10E5-4CFB-8667-BFF6AFDAF6C0}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>PlcMonitor</RootNamespace>
|
||||
<AssemblyName>PlcMonitor</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
22
MesMonitor/--PlcMonitor/PlcMonitor/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PlcMonitor
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("PlcMonitor")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PlcMonitor")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("67f90d19-10e5-4cfb-8667-bff6afdaf6c0")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
70
MesMonitor/--PlcMonitor/PlcMonitor/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace PlcMonitor.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("PlcMonitor.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
MesMonitor/--PlcMonitor/PlcMonitor/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
29
MesMonitor/--PlcMonitor/PlcMonitor/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 PlcMonitor.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
103
MesMonitor/--SignalChangeMonitor/FunctionForm_HashiTable.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
class FunctionForm_HashiTable
|
||||
{
|
||||
public static Hashtable OpName_Hash = new Hashtable();
|
||||
public static object OpName_Hash_Read(string Key)
|
||||
{
|
||||
if (OpName_Hash.ContainsKey(Key))
|
||||
{
|
||||
return OpName_Hash[Key];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void OpName_Hash_Write(string Key, object obj)
|
||||
{
|
||||
|
||||
if (OpName_Hash.ContainsKey(Key))
|
||||
{
|
||||
|
||||
OpName_Hash[Key] = obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
OpName_Hash.Add(Key, obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Hashtable SignalName = new Hashtable();
|
||||
public static string SignalName_Hash_Read(string Key)
|
||||
{
|
||||
if (SignalName.ContainsKey(Key))
|
||||
{
|
||||
return SignalName[Key].ToString ();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void SignalName_Hash_Write(string Key, string str)
|
||||
{
|
||||
|
||||
if (SignalName.ContainsKey(Key))
|
||||
{
|
||||
|
||||
SignalName[Key] = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
SignalName.Add(Key, str);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Hashtable SignalConfig = new Hashtable();
|
||||
public static object SignalConfig_Hash_Read(string Key)
|
||||
{
|
||||
if (SignalConfig.ContainsKey(Key))
|
||||
{
|
||||
return SignalConfig[Key];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void SignalConfig_Write(string Key, object str)
|
||||
{
|
||||
|
||||
if (SignalConfig.ContainsKey(Key))
|
||||
{
|
||||
|
||||
SignalConfig[Key] = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
SignalConfig.Add(Key, str);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
55
MesMonitor/--SignalChangeMonitor/MainSignalChangeEvent.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SystemFramework;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public partial class SecondForm
|
||||
{
|
||||
|
||||
void InitMainSignalEvent()
|
||||
{
|
||||
MisData.PlcChange = new PlcChangeEvent(MainSignalChange);
|
||||
}
|
||||
|
||||
void MainSignalChange(OpcData.CustomeEvetnArgs msgEvent)
|
||||
{
|
||||
try
|
||||
{
|
||||
int tagType;
|
||||
string opName, tagValue;
|
||||
|
||||
if (msgEvent.TagValue == null) return;
|
||||
tagType = Convert.ToInt32(msgEvent.TagType);
|
||||
opName = msgEvent.OpName.ToString();
|
||||
switch (Convert.ToInt32(msgEvent.TagValueType))
|
||||
{
|
||||
case 11:
|
||||
tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
|
||||
break;
|
||||
default:
|
||||
tagValue = msgEvent.TagValue.ToString();
|
||||
break;
|
||||
}
|
||||
|
||||
if (Convert.ToInt32(msgEvent.TagValueType)==11)
|
||||
{
|
||||
|
||||
WriteWorkStationSignal(opName, tagType.ToString(), Convert.ToBoolean(Convert.ToInt32(tagValue)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
138
MesMonitor/--SignalChangeMonitor/PlcSignalDynamicCreate.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using MesControl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using SystemFramework;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public delegate void ControlConnectPLC();
|
||||
public partial class SecondForm
|
||||
{
|
||||
ControlConnectPLC PlcConnectTimer;
|
||||
|
||||
void InitFormDynamicControls()
|
||||
{
|
||||
try
|
||||
{
|
||||
// DataTable dt_OpName=(DataTable) FunctionForm_HashiTable.OpName_Hash_Read("OpNameList");
|
||||
|
||||
List<MesBoolSignal> signalItems = InitWorkStationSignal();
|
||||
RecordWorkStationSignal(signalItems);
|
||||
|
||||
int RowsWidth = SignalPanel.Width-20;
|
||||
int RowsNum = RowsWidth / 133;
|
||||
int i = 0;
|
||||
|
||||
foreach (var opName in MesWork.PlcLinkForm.opNameList)
|
||||
{
|
||||
PlcWorkStationSignal plcWorkStationSignal = new PlcWorkStationSignal();
|
||||
|
||||
plcWorkStationSignal.BackColor = System.Drawing.Color.Transparent;
|
||||
plcWorkStationSignal.Location = new System.Drawing.Point(3 + ((i % RowsNum) * 133), (i / RowsNum) * ((signalItems.Count * 25) + 60));
|
||||
plcWorkStationSignal.MaximumSize = new System.Drawing.Size(0, 0);
|
||||
plcWorkStationSignal.MinimumSize = new System.Drawing.Size(0, 0);
|
||||
plcWorkStationSignal.Name = "plcWorkStationSignal_" + opName;
|
||||
plcWorkStationSignal.Size = new System.Drawing.Size(136, 60);
|
||||
plcWorkStationSignal.TabIndex = i;
|
||||
plcWorkStationSignal.SignalItems = signalItems;
|
||||
plcWorkStationSignal.WorkStationNameText = opName;
|
||||
plcWorkStationSignal.WS_PlcLabelText = "PLC连接";
|
||||
plcWorkStationSignal.TestPLC_Interval = 10000;
|
||||
|
||||
plcWorkStationSignal.TestPLC_Enable = true;
|
||||
PlcConnectTimer += plcWorkStationSignal.ExternalTimerExcute;
|
||||
|
||||
this.SignalPanel.Controls.Add(plcWorkStationSignal);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<MesBoolSignal> InitWorkStationSignal()
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MesBoolSignal> signalItems = new List<MesBoolSignal>();
|
||||
MesBoolSignal MBS;
|
||||
signalItems.Clear();
|
||||
XDocument SystemConfig = XDocument.Load("SystemConfig.xml");
|
||||
IEnumerable<XElement> plc = SystemConfig.Descendants ("PLC");
|
||||
IEnumerable<XElement> plcSignal = plc.Elements();
|
||||
foreach (XElement PlcSignal in plcSignal)
|
||||
{
|
||||
XElement Name = PlcSignal.Element("Name");
|
||||
XElement TagType = PlcSignal.Element("TagType");
|
||||
XElement Text = PlcSignal.Element("Text");
|
||||
XElement Index = PlcSignal.Element("Index");
|
||||
XElement Enabled = PlcSignal.Element("Enabled");
|
||||
|
||||
MBS = new MesBoolSignal();
|
||||
MBS.Name = "TagType_" + TagType.Value ;
|
||||
MBS.SignalText = Text.Value ;
|
||||
MBS.SignalImage = MesBoolSignal.SignalImage_Enum.none;
|
||||
|
||||
if (Convert.ToBoolean(Enabled.Value))
|
||||
{
|
||||
signalItems.Add(MBS);
|
||||
}
|
||||
}
|
||||
IEnumerable<XElement> mes = SystemConfig.Descendants("MES");
|
||||
IEnumerable<XElement> mesSignal = mes.Elements();
|
||||
foreach (XElement MesSignal in mesSignal)
|
||||
{
|
||||
XElement Name = MesSignal.Element("Name");
|
||||
XElement TagType = MesSignal.Element("TagType");
|
||||
XElement Text = MesSignal.Element("Text");
|
||||
XElement Index = MesSignal.Element("Index");
|
||||
XElement Enabled = MesSignal.Element("Enabled");
|
||||
|
||||
MBS = new MesBoolSignal();
|
||||
MBS.Name = "TagType_" + TagType.Value;
|
||||
MBS.SignalText = Text.Value;
|
||||
MBS.SignalImage = MesBoolSignal.SignalImage_Enum.none;
|
||||
|
||||
if (Convert .ToBoolean ( Enabled .Value))
|
||||
{
|
||||
signalItems.Add(MBS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return signalItems;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string[] SignalNames = new string[50];
|
||||
|
||||
void RecordWorkStationSignal(List<MesBoolSignal> items)
|
||||
{
|
||||
|
||||
for (int i=0;i< items.Count;i++)
|
||||
{
|
||||
SignalNames[i] = items[i].Name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
91
MesMonitor/--SignalChangeMonitor/SecondForm.Designer.cs
generated
Normal file
@@ -0,0 +1,91 @@
|
||||
namespace MisDataName
|
||||
{
|
||||
partial class SecondForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.SignalPanel = new System.Windows.Forms.Panel();
|
||||
this.groupBox_PlcSignal = new System.Windows.Forms.GroupBox();
|
||||
this.timer_ControlInternalChange = new System.Windows.Forms.Timer(this.components);
|
||||
this.groupBox_PlcSignal.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// SignalPanel
|
||||
//
|
||||
this.SignalPanel.AutoScroll = true;
|
||||
this.SignalPanel.Location = new System.Drawing.Point(6, 20);
|
||||
this.SignalPanel.Name = "SignalPanel";
|
||||
this.SignalPanel.Size = new System.Drawing.Size(706, 650);
|
||||
this.SignalPanel.TabIndex = 0;
|
||||
//
|
||||
// groupBox_PlcSignal
|
||||
//
|
||||
this.groupBox_PlcSignal.Controls.Add(this.SignalPanel);
|
||||
this.groupBox_PlcSignal.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBox_PlcSignal.Name = "groupBox_PlcSignal";
|
||||
this.groupBox_PlcSignal.Size = new System.Drawing.Size(718, 676);
|
||||
this.groupBox_PlcSignal.TabIndex = 1;
|
||||
this.groupBox_PlcSignal.TabStop = false;
|
||||
this.groupBox_PlcSignal.Text = "LineStatus";
|
||||
//
|
||||
// timer_ControlInternalChange
|
||||
//
|
||||
this.timer_ControlInternalChange.Enabled = true;
|
||||
this.timer_ControlInternalChange.Interval = 400;
|
||||
this.timer_ControlInternalChange.Tick += new System.EventHandler(this.timer_ControlInternalChange_Tick);
|
||||
//
|
||||
// SecondForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(741, 700);
|
||||
this.Controls.Add(this.groupBox_PlcSignal);
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(757, 738);
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(757, 738);
|
||||
this.Name = "SecondForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "PlcSignal";
|
||||
this.TopMost = true;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SecondForm_FormClosing);
|
||||
this.LocationChanged += new System.EventHandler(this.SecondForm_LocationChanged);
|
||||
this.groupBox_PlcSignal.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel SignalPanel;
|
||||
private System.Windows.Forms.GroupBox groupBox_PlcSignal;
|
||||
private System.Windows.Forms.Timer timer_ControlInternalChange;
|
||||
}
|
||||
}
|
||||
231
MesMonitor/--SignalChangeMonitor/SecondForm.cs
Normal file
@@ -0,0 +1,231 @@
|
||||
using MesControl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using SystemFramework;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public partial class SecondForm : Form
|
||||
{
|
||||
|
||||
|
||||
public SecondForm(Point Position)
|
||||
{
|
||||
InitializeComponent();
|
||||
InitFormDynamicControls();
|
||||
InitMainSignalEvent();
|
||||
FormPositionInit(Position);
|
||||
InitOtherFormAction();
|
||||
SyncForm_Init();
|
||||
|
||||
}
|
||||
Form MainForm;
|
||||
public SecondForm(object mainForm)
|
||||
{
|
||||
MainForm = (Form)mainForm;
|
||||
InitializeComponent();
|
||||
InitFormDynamicControls();
|
||||
InitMainSignalEvent();
|
||||
Point Position = new Point(MainForm.Left + MainForm.Width, MainForm.Top);
|
||||
|
||||
FormPositionInit(Position);
|
||||
InitOtherFormAction();
|
||||
SyncForm_Init();
|
||||
|
||||
}
|
||||
|
||||
void WorkStation_RefreshWorkStationStatus(string OpName, bool value)
|
||||
{
|
||||
try
|
||||
{
|
||||
PlcWorkStationSignal plcWorkStationSignal = (PlcWorkStationSignal)Controls.Find("plcWorkStationSignal_" + OpName, true)[0];
|
||||
plcWorkStationSignal.PlcConnectStatusChange(value);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WriteWorkStationSignal(string OpName,string SignalName,bool value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Array.IndexOf(SignalNames, "TagType_"+SignalName)!=-1)
|
||||
{
|
||||
PlcWorkStationSignal plcWorkStationSignal = (PlcWorkStationSignal)Controls.Find("plcWorkStationSignal_" + OpName, true)[0];
|
||||
plcWorkStationSignal.SignalChange("TagType_"+SignalName, value);
|
||||
if (SignalName=="14")
|
||||
{
|
||||
WorkStation_RefreshWorkStationStatus(OpName, value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void SecondForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
MisData.PlcChange =null;
|
||||
if (MisData.SyncSecondForm != null)
|
||||
{
|
||||
SyncForm_Cancel();
|
||||
}
|
||||
CancelOtherFormAction();
|
||||
MainForm.BeginInvoke(MainMenuRefresh, "ToolStripMenuItem_VWSStatus");
|
||||
this.Dispose();
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SyncForm_Init()
|
||||
{
|
||||
try
|
||||
{
|
||||
MisData.SyncSecondForm = new SyncOtherForm(FormSync);
|
||||
MisData.MainFormActive = new MisDataName.SyncOtherForm(MainFormActive);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
void SyncForm_Cancel()
|
||||
{
|
||||
MisData.SyncSecondForm = null;
|
||||
MisData.MainFormActive = null;
|
||||
}
|
||||
|
||||
void FormPositionInit(Point Position)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Location = (Point)new Size(Position);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FormSync(object Position)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Location = (Point)Position;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
void MainFormActive(object obj)
|
||||
{
|
||||
|
||||
if(Convert .ToBoolean (obj ))
|
||||
{
|
||||
this.TopMost = true;
|
||||
this.TopMost = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void InitOtherFormAction()
|
||||
{
|
||||
try
|
||||
{
|
||||
MisData.SecondFormClose = new MainAct(this.Close);
|
||||
MisData.OtherFormHide = new MainAct(HideThisForm);
|
||||
MisData.OtherFormShow = new MainAct(ShowThisForm);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
void CancelOtherFormAction()
|
||||
{
|
||||
MisData.SecondFormClose = null;
|
||||
MisData.OtherFormHide = null;
|
||||
MisData.OtherFormShow = null;
|
||||
|
||||
}
|
||||
|
||||
void ShowThisForm()
|
||||
{
|
||||
this.Show();
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
}
|
||||
|
||||
void HideThisForm()
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SecondForm_LocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Point MainPosation=(Point)MisData.QueryMainFormPosition(null);
|
||||
|
||||
if(Math.Abs ( MainPosation .X -this .Left)<25&& Math.Abs(MainPosation.Y - this.Top ) < 20)
|
||||
{
|
||||
if (MisData.SyncSecondForm == null)
|
||||
{
|
||||
SyncForm_Init();
|
||||
MainForm.Invoke(MisData.MainActived);
|
||||
FormSync(MainPosation);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MisData.SyncSecondForm != null)
|
||||
{
|
||||
SyncForm_Cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void timer_ControlInternalChange_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if(PlcConnectTimer!=null)
|
||||
{
|
||||
PlcConnectTimer();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
123
MesMonitor/--SignalChangeMonitor/SecondForm.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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="timer_ControlInternalChange.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
15
MesMonitor/--SignalChangeMonitor/SecondFormDelegate.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public delegate void SecondAct(string ControlName);
|
||||
|
||||
public partial class SecondForm
|
||||
{
|
||||
public static SecondAct MainMenuRefresh;
|
||||
|
||||
}
|
||||
}
|
||||
BIN
MesMonitor/--SignalChangeMonitor/vssver2.scc
Normal file
16
MesMonitor/MonitorForm/App.config
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
|
||||
<!--变量模拟测试开关1为开启-->
|
||||
<add key="IsDemoMesServer" value="1" />
|
||||
<add key="ConnectionString_DT" value="server=.\MSSQLSERVER2012;database=MW_DataFactory_App;uid=sa;pwd=126.com;Connection Reset=FALSE;Max Pool Size = 1000" />
|
||||
<add key="Url_WebApiDT" value="http://localhost:41181" />
|
||||
<add key="Url_WebApi" value="http://localhost:41186" />
|
||||
<add key="MqttUrl" value="124.220.15.242:1883,MES/InstantMessaging/SY/MisServer" />
|
||||
<add key="MqttTargetTopicPLC" value="MES/InstantMessaging/SY/MisServer" />
|
||||
</appSettings>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
||||
41
MesMonitor/MonitorForm/Form1.Designer.cs
generated
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
namespace MonitorFrom
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows 窗体设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "Form1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
20
MesMonitor/MonitorForm/Form1.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MonitorFrom
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
103
MesMonitor/MonitorForm/FunctionForm_HashiTable.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
class FunctionForm_HashiTable
|
||||
{
|
||||
public static Hashtable OpName_Hash = new Hashtable();
|
||||
public static object OpName_Hash_Read(string Key)
|
||||
{
|
||||
if (OpName_Hash.ContainsKey(Key))
|
||||
{
|
||||
return OpName_Hash[Key];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void OpName_Hash_Write(string Key, object obj)
|
||||
{
|
||||
|
||||
if (OpName_Hash.ContainsKey(Key))
|
||||
{
|
||||
|
||||
OpName_Hash[Key] = obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
OpName_Hash.Add(Key, obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Hashtable SignalName = new Hashtable();
|
||||
public static string SignalName_Hash_Read(string Key)
|
||||
{
|
||||
if (SignalName.ContainsKey(Key))
|
||||
{
|
||||
return SignalName[Key].ToString ();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void SignalName_Hash_Write(string Key, string str)
|
||||
{
|
||||
|
||||
if (SignalName.ContainsKey(Key))
|
||||
{
|
||||
|
||||
SignalName[Key] = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
SignalName.Add(Key, str);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Hashtable SignalConfig = new Hashtable();
|
||||
public static object SignalConfig_Hash_Read(string Key)
|
||||
{
|
||||
if (SignalConfig.ContainsKey(Key))
|
||||
{
|
||||
return SignalConfig[Key];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void SignalConfig_Write(string Key, object str)
|
||||
{
|
||||
|
||||
if (SignalConfig.ContainsKey(Key))
|
||||
{
|
||||
|
||||
SignalConfig[Key] = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
SignalConfig.Add(Key, str);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
126
MesMonitor/MonitorForm/MainSignalChangeEvent.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using DoWhatPlc;
|
||||
using MesControl;
|
||||
using MQTTnet;
|
||||
using MQTTnet.Client.Connecting;
|
||||
using MQTTnet.Client.Disconnecting;
|
||||
using MQTTnet.Client.Receiving;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public partial class SecondForm
|
||||
{
|
||||
public MesWorkMqtt.Mqtt2 mqtt2;
|
||||
public void InitMqtt2(string url, string topic)
|
||||
{
|
||||
mqtt2 = new MesWorkMqtt.Mqtt2();
|
||||
mqtt2.MqttUrl = url;
|
||||
mqtt2.topic = topic;
|
||||
mqtt2.StartAsync();
|
||||
mqtt2.mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnSubscriberConnected);
|
||||
mqtt2.mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnSubscriberDisconnected);
|
||||
mqtt2.mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnSubscriberMessageReceived);
|
||||
|
||||
//MesServerCode哈希表创建
|
||||
//MesServerWork.MIS_BASE.InitHashtable_MesServerCode();
|
||||
|
||||
}
|
||||
private void OnSubscriberConnected(MqttClientConnectedEventArgs x)
|
||||
{
|
||||
var rec = x.AuthenticateResult.ResultCode.ToString();
|
||||
|
||||
}
|
||||
|
||||
private void OnSubscriberDisconnected(MqttClientDisconnectedEventArgs x)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnSubscriberMessageReceived(MqttApplicationMessageReceivedEventArgs x)
|
||||
{
|
||||
var rec = x.ApplicationMessage.ConvertPayloadToString();
|
||||
|
||||
|
||||
//处理MES业务
|
||||
ThreadPool.QueueUserWorkItem(MainSignalChange, rec);
|
||||
}
|
||||
|
||||
|
||||
void WorkStation_RefreshWorkStationStatus(string OpName, bool value)
|
||||
{
|
||||
try
|
||||
{
|
||||
PlcWorkStationSignal plcWorkStationSignal = (PlcWorkStationSignal)Controls.Find("plcWorkStationSignal_" + OpName, true)[0];
|
||||
plcWorkStationSignal.PlcConnectStatusChange(value);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
void InitMainSignalEvent()
|
||||
{
|
||||
//MisData.PlcChange = new PlcChangeEvent(MainSignalChange);
|
||||
}
|
||||
|
||||
void MainSignalChange(object e)
|
||||
{
|
||||
string recData = e.ToString();
|
||||
string[] dataArray = recData.Split('|');
|
||||
if (dataArray.Length != 4)
|
||||
return;
|
||||
//消息来源
|
||||
string m_Source = dataArray[0].ToString();
|
||||
//消息类型
|
||||
string m_Command = dataArray[1].ToString();
|
||||
//工位号
|
||||
string m_OpName = dataArray[2].ToString();
|
||||
//消息参数
|
||||
string m_Value = dataArray[3].ToString();
|
||||
|
||||
DoWhatPlc.ReturnValueString rv = Newtonsoft.Json.JsonConvert.DeserializeObject<DoWhatPlc.ReturnValueString>(m_Value);
|
||||
//Console.WriteLine($"【【{rv.TagID}【【【【{ rv.TagKeepTime}");
|
||||
|
||||
int tagType;
|
||||
string opName;
|
||||
string tagValue;
|
||||
int tagid;
|
||||
DoWhatPlc.ReturnValueString msgEvent = rv;
|
||||
if (msgEvent.TagValue == null) return;
|
||||
tagType = Convert.ToInt32(msgEvent.TagTypeID);
|
||||
opName = msgEvent.OpName.ToString();
|
||||
tagid = Convert.ToInt32(msgEvent.TagID);
|
||||
int tagTypeCodeID = Convert.ToInt32(msgEvent.TagTypeCodeID);
|
||||
switch (tagType)
|
||||
{
|
||||
case 11:
|
||||
switch (msgEvent.TagValue.ToLower())
|
||||
{
|
||||
case "1":
|
||||
case "true":
|
||||
tagValue = "1";
|
||||
break;
|
||||
default:
|
||||
tagValue = "0";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
tagValue = msgEvent.TagValue.ToString();
|
||||
break;
|
||||
}
|
||||
if (tagType == 11)
|
||||
{
|
||||
|
||||
WriteWorkStationSignal(opName, tagTypeCodeID.ToString(), Convert.ToBoolean(Convert.ToInt32(tagValue)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
BIN
MesMonitor/MonitorForm/Mes32X32.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
136
MesMonitor/MonitorForm/MonitorForm.csproj
Normal file
@@ -0,0 +1,136 @@
|
||||
<?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>{488BADD9-579F-4BF3-91DC-9FA95E3181A5}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>MonitorFrom</RootNamespace>
|
||||
<AssemblyName>MonitorFrom</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\MonitorForm\</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>
|
||||
<Reference Include="MQTTnet, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Common\dll\MQTTnet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MQTTnet.Extensions.ManagedClient, Version=3.0.15.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Common\dll\MQTTnet.Extensions.ManagedClient.dll</HintPath>
|
||||
</Reference>
|
||||
<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="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FunctionForm_HashiTable.cs" />
|
||||
<Compile Include="MainSignalChangeEvent.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcSignalDynamicCreate.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SecondForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SecondForm.Designer.cs">
|
||||
<DependentUpon>SecondForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecondFormDelegate.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<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>
|
||||
<EmbeddedResource Include="SecondForm.resx">
|
||||
<DependentUpon>SecondForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<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\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\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="..\SignalChangeMonitorControl\MesControl.csproj">
|
||||
<Project>{fab322cc-531d-4aea-986a-b921b64d8d3f}</Project>
|
||||
<Name>MesControl</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Mes32X32.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
25
MesMonitor/MonitorForm/MonitorForm.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32901.82
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorForm", "MonitorForm.csproj", "{488BADD9-579F-4BF3-91DC-9FA95E3181A5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2139453F-8DE4-42E7-92A1-7A305D62E5B6}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
138
MesMonitor/MonitorForm/PlcSignalDynamicCreate.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using MesControl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public delegate void ControlConnectPLC();
|
||||
public partial class SecondForm
|
||||
{
|
||||
ControlConnectPLC PlcConnectTimer;
|
||||
|
||||
void InitFormDynamicControls()
|
||||
{
|
||||
try
|
||||
{
|
||||
// DataTable dt_OpName=(DataTable) FunctionForm_HashiTable.OpName_Hash_Read("OpNameList");
|
||||
|
||||
List<MesBoolSignal> signalItems = InitWorkStationSignal();
|
||||
RecordWorkStationSignal(signalItems);
|
||||
|
||||
int RowsWidth = SignalPanel.Width-20;
|
||||
int RowsNum = RowsWidth / 133;
|
||||
int i = 0;
|
||||
var opNameList = DtWebApi.OpcDemo.Get_opNameList();
|
||||
foreach (var opName in opNameList)
|
||||
{
|
||||
PlcWorkStationSignal plcWorkStationSignal = new PlcWorkStationSignal();
|
||||
|
||||
plcWorkStationSignal.BackColor = System.Drawing.Color.Transparent;
|
||||
plcWorkStationSignal.Location = new System.Drawing.Point(3 + ((i % RowsNum) * 133), (i / RowsNum) * ((signalItems.Count * 25) + 60));
|
||||
plcWorkStationSignal.MaximumSize = new System.Drawing.Size(0, 0);
|
||||
plcWorkStationSignal.MinimumSize = new System.Drawing.Size(0, 0);
|
||||
plcWorkStationSignal.Name = "plcWorkStationSignal_" + opName;
|
||||
plcWorkStationSignal.Size = new System.Drawing.Size(136, 60);
|
||||
plcWorkStationSignal.TabIndex = i;
|
||||
plcWorkStationSignal.SignalItems = signalItems;
|
||||
plcWorkStationSignal.WorkStationNameText = opName;
|
||||
plcWorkStationSignal.WS_PlcLabelText = "PLC连接";
|
||||
plcWorkStationSignal.TestPLC_Interval = 10000;
|
||||
|
||||
plcWorkStationSignal.TestPLC_Enable = true;
|
||||
PlcConnectTimer += plcWorkStationSignal.ExternalTimerExcute;
|
||||
|
||||
this.SignalPanel.Controls.Add(plcWorkStationSignal);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<MesBoolSignal> InitWorkStationSignal()
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MesBoolSignal> signalItems = new List<MesBoolSignal>();
|
||||
MesBoolSignal MBS;
|
||||
signalItems.Clear();
|
||||
XDocument SystemConfig = XDocument.Load("SystemConfig.xml");
|
||||
IEnumerable<XElement> plc = SystemConfig.Descendants ("PLC");
|
||||
IEnumerable<XElement> plcSignal = plc.Elements();
|
||||
foreach (XElement PlcSignal in plcSignal)
|
||||
{
|
||||
XElement Name = PlcSignal.Element("Name");
|
||||
XElement TagType = PlcSignal.Element("TagType");
|
||||
XElement Text = PlcSignal.Element("Text");
|
||||
XElement Index = PlcSignal.Element("Index");
|
||||
XElement Enabled = PlcSignal.Element("Enabled");
|
||||
|
||||
MBS = new MesBoolSignal();
|
||||
MBS.Name = "TagType_" + TagType.Value ;
|
||||
MBS.SignalText = Text.Value ;
|
||||
MBS.SignalImage = MesBoolSignal.SignalImage_Enum.none;
|
||||
|
||||
if (Convert.ToBoolean(Enabled.Value))
|
||||
{
|
||||
signalItems.Add(MBS);
|
||||
}
|
||||
}
|
||||
IEnumerable<XElement> mes = SystemConfig.Descendants("MES");
|
||||
IEnumerable<XElement> mesSignal = mes.Elements();
|
||||
foreach (XElement MesSignal in mesSignal)
|
||||
{
|
||||
XElement Name = MesSignal.Element("Name");
|
||||
XElement TagType = MesSignal.Element("TagType");
|
||||
XElement Text = MesSignal.Element("Text");
|
||||
XElement Index = MesSignal.Element("Index");
|
||||
XElement Enabled = MesSignal.Element("Enabled");
|
||||
|
||||
MBS = new MesBoolSignal();
|
||||
MBS.Name = "TagType_" + TagType.Value;
|
||||
MBS.SignalText = Text.Value;
|
||||
MBS.SignalImage = MesBoolSignal.SignalImage_Enum.none;
|
||||
|
||||
if (Convert .ToBoolean ( Enabled .Value))
|
||||
{
|
||||
signalItems.Add(MBS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return signalItems;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, err.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string[] SignalNames;
|
||||
|
||||
void RecordWorkStationSignal(List<MesBoolSignal> items)
|
||||
{
|
||||
SignalNames = new string[items.Count];
|
||||
for (int i=0;i< items.Count;i++)
|
||||
{
|
||||
SignalNames[i] = items[i].Name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
22
MesMonitor/MonitorForm/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new SecondForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
MesMonitor/MonitorForm/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("MonitorFrom")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MonitorFrom")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("488badd9-579f-4bf3-91dc-9fa95e3181a5")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
70
MesMonitor/MonitorForm/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace MonitorFrom.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("MonitorFrom.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
MesMonitor/MonitorForm/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
29
MesMonitor/MonitorForm/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 MonitorFrom.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
MesMonitor/MonitorForm/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
83
MesMonitor/MonitorForm/SecondForm.Designer.cs
generated
Normal file
@@ -0,0 +1,83 @@
|
||||
namespace MisDataName
|
||||
{
|
||||
partial class SecondForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SecondForm));
|
||||
this.groupBox_PlcSignal = new System.Windows.Forms.GroupBox();
|
||||
this.SignalPanel = new MisDataName.MyPanel();
|
||||
this.groupBox_PlcSignal.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox_PlcSignal
|
||||
//
|
||||
this.groupBox_PlcSignal.Controls.Add(this.SignalPanel);
|
||||
this.groupBox_PlcSignal.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBox_PlcSignal.Name = "groupBox_PlcSignal";
|
||||
this.groupBox_PlcSignal.Size = new System.Drawing.Size(718, 676);
|
||||
this.groupBox_PlcSignal.TabIndex = 1;
|
||||
this.groupBox_PlcSignal.TabStop = false;
|
||||
this.groupBox_PlcSignal.Text = "LineStatus";
|
||||
//
|
||||
// SignalPanel
|
||||
//
|
||||
this.SignalPanel.AutoScroll = true;
|
||||
this.SignalPanel.Location = new System.Drawing.Point(6, 20);
|
||||
this.SignalPanel.Name = "SignalPanel";
|
||||
this.SignalPanel.Size = new System.Drawing.Size(706, 650);
|
||||
this.SignalPanel.TabIndex = 0;
|
||||
//
|
||||
// SecondForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(741, 699);
|
||||
this.Controls.Add(this.groupBox_PlcSignal);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(757, 738);
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(757, 738);
|
||||
this.Name = "SecondForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "PlcSignal 2022-10-16";
|
||||
this.TopMost = true;
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SecondForm_FormClosing);
|
||||
this.groupBox_PlcSignal.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private MyPanel SignalPanel;
|
||||
private System.Windows.Forms.GroupBox groupBox_PlcSignal;
|
||||
}
|
||||
}
|
||||
86
MesMonitor/MonitorForm/SecondForm.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using MesControl;
|
||||
using MQTTnet;
|
||||
using MQTTnet.Client.Connecting;
|
||||
using MQTTnet.Client.Disconnecting;
|
||||
using MQTTnet.Client.Receiving;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public partial class SecondForm : Form
|
||||
{
|
||||
public SecondForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitFormDynamicControls();
|
||||
InitMainSignalEvent();
|
||||
//InitOtherFormAction();
|
||||
//SyncForm_Init();
|
||||
|
||||
string url;
|
||||
string topic;
|
||||
url = System.Configuration.ConfigurationManager.AppSettings["MqttUrl"];
|
||||
topic = System.Configuration.ConfigurationManager.AppSettings["MqttTargetTopicPLC"];
|
||||
|
||||
InitMqtt2(url, topic);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void WriteWorkStationSignal(string OpName,string SignalName,bool value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Array.IndexOf(SignalNames, "TagType_"+SignalName)!=-1)
|
||||
{
|
||||
PlcWorkStationSignal plcWorkStationSignal = (PlcWorkStationSignal)Controls.Find("plcWorkStationSignal_" + OpName, true)[0];
|
||||
plcWorkStationSignal.SignalChange("TagType_"+SignalName, value);
|
||||
if (SignalName=="14")
|
||||
{
|
||||
WorkStation_RefreshWorkStationStatus(OpName, value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void SecondForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Dispose();
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
//ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyPanel : Panel
|
||||
{
|
||||
public MyPanel()
|
||||
{
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
197
MesMonitor/MonitorForm/SecondForm.resx
Normal file
@@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.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>
|
||||
15
MesMonitor/MonitorForm/SecondFormDelegate.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MisDataName
|
||||
{
|
||||
public delegate void SecondAct(string ControlName);
|
||||
|
||||
public partial class SecondForm
|
||||
{
|
||||
public static SecondAct MainMenuRefresh;
|
||||
|
||||
}
|
||||
}
|
||||
79
MesMonitor/SignalChangeMonitorControl/MesBoolSignal.Designer.cs
generated
Normal file
@@ -0,0 +1,79 @@
|
||||
namespace MesControl
|
||||
{
|
||||
partial class MesBoolSignal
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pictureBox_Signal = new System.Windows.Forms.PictureBox();
|
||||
this.label_SignalName = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox_Signal)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pictureBox_Signal
|
||||
//
|
||||
this.pictureBox_Signal.BackgroundImage = global::MesControl.Properties.Resources.none;
|
||||
this.pictureBox_Signal.Location = new System.Drawing.Point(3, 1);
|
||||
this.pictureBox_Signal.Name = "pictureBox_Signal";
|
||||
this.pictureBox_Signal.Size = new System.Drawing.Size(20, 20);
|
||||
this.pictureBox_Signal.TabIndex = 0;
|
||||
this.pictureBox_Signal.TabStop = false;
|
||||
//
|
||||
// label_SignalName
|
||||
//
|
||||
this.label_SignalName.AutoSize = true;
|
||||
this.label_SignalName.Font = new System.Drawing.Font("宋体", 12F);
|
||||
this.label_SignalName.Location = new System.Drawing.Point(32, 3);
|
||||
this.label_SignalName.MaximumSize = new System.Drawing.Size(72, 16);
|
||||
this.label_SignalName.MinimumSize = new System.Drawing.Size(72, 16);
|
||||
this.label_SignalName.Name = "label_SignalName";
|
||||
this.label_SignalName.Size = new System.Drawing.Size(72, 16);
|
||||
this.label_SignalName.TabIndex = 1;
|
||||
this.label_SignalName.Text = "心跳信号";
|
||||
//
|
||||
// MesBoolSignal
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Controls.Add(this.label_SignalName);
|
||||
this.Controls.Add(this.pictureBox_Signal);
|
||||
this.MaximumSize = new System.Drawing.Size(110, 22);
|
||||
this.MinimumSize = new System.Drawing.Size(110, 22);
|
||||
this.Name = "MesBoolSignal";
|
||||
this.Size = new System.Drawing.Size(110, 22);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox_Signal)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox pictureBox_Signal;
|
||||
private System.Windows.Forms.Label label_SignalName;
|
||||
}
|
||||
}
|
||||
111
MesMonitor/SignalChangeMonitorControl/MesBoolSignal.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MesControl
|
||||
{
|
||||
public partial class MesBoolSignal : UserControl
|
||||
{
|
||||
public MesBoolSignal()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 外部调用控件触发的信号
|
||||
/// </summary>
|
||||
/// <param name="Signal"></param>
|
||||
public void InputBoolSignal(bool Signal)
|
||||
{
|
||||
|
||||
if (Signal)
|
||||
{
|
||||
|
||||
pictureBox_Signal.BackgroundImage = Properties.Resources.green;
|
||||
}
|
||||
else
|
||||
{
|
||||
pictureBox_Signal.BackgroundImage = Properties.Resources.init;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("控件中显示的文本内容"), Category("SignalText"), DefaultValue("")]
|
||||
public string SignalText
|
||||
{
|
||||
get
|
||||
{
|
||||
return label_SignalName.Text;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
label_SignalName.Text = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SignalImage_Enum enum1;
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("控件用于显示状态的图片"), Category("SignalImage"), DefaultValue("none")]
|
||||
public SignalImage_Enum SignalImage
|
||||
{
|
||||
get
|
||||
{
|
||||
return enum1;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetSignalImage(value);
|
||||
enum1 = value;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum SignalImage_Enum
|
||||
{
|
||||
|
||||
none, init, green, yellow, red
|
||||
|
||||
}
|
||||
|
||||
void SetSignalImage(SignalImage_Enum Image)
|
||||
{
|
||||
switch (Image)
|
||||
{
|
||||
case SignalImage_Enum.none:
|
||||
pictureBox_Signal.BackgroundImage = Properties.Resources.none;
|
||||
break;
|
||||
case SignalImage_Enum.init:
|
||||
pictureBox_Signal.BackgroundImage = Properties.Resources.init;
|
||||
break;
|
||||
case SignalImage_Enum.green:
|
||||
pictureBox_Signal.BackgroundImage = Properties.Resources.green;
|
||||
break;
|
||||
case SignalImage_Enum.yellow:
|
||||
pictureBox_Signal.BackgroundImage = Properties.Resources.yellow;
|
||||
break;
|
||||
case SignalImage_Enum.red:
|
||||
pictureBox_Signal.BackgroundImage = Properties.Resources.red;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
126
MesMonitor/SignalChangeMonitorControl/MesBoolSignal.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?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="pictureBox_Signal.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label_SignalName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
139
MesMonitor/SignalChangeMonitorControl/MesControl.csproj
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{FAB322CC-531D-4AEA-986A-B921B64D8D3F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MesControl</RootNamespace>
|
||||
<AssemblyName>MesControl</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<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>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</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>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</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.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MesBoolSignal.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MesBoolSignal.Designer.cs">
|
||||
<DependentUpon>MesBoolSignal.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlcWorkStationSignal.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcWorkStationSignal.Designer.cs">
|
||||
<DependentUpon>PlcWorkStationSignal.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlcConnect.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcConnect.Designer.cs">
|
||||
<DependentUpon>PlcConnect.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SignalInit.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MesBoolSignal.resx">
|
||||
<DependentUpon>MesBoolSignal.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PlcWorkStationSignal.resx">
|
||||
<DependentUpon>PlcWorkStationSignal.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PlcConnect.resx">
|
||||
<DependentUpon>PlcConnect.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\BreakPLC.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\green.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\init.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\none.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\PlcConnectBig.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\PlcConnectSmall.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\red.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\yellow.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\PlcConnect0.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\PlcConnect1.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\PlcConnect2.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\PlcConnect3.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\PlcConnect4.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
55
MesMonitor/SignalChangeMonitorControl/MesControl.sln
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32901.82
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MesControl", "MesControl.csproj", "{FAB322CC-531D-4AEA-986A-B921B64D8D3F}"
|
||||
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}") = "02_02WebApiCallPLC", "..\..\Common\02WebApiCall\02_02WebApiCallPLC.csproj", "{3E6D1DD5-01C9-435F-9941-61F906CE35BB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorForm", "..\MonitorForm\MonitorForm.csproj", "{488BADD9-579F-4BF3-91DC-9FA95E3181A5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FAB322CC-531D-4AEA-986A-B921B64D8D3F}.Release|Any CPU.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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1A10FDB2-1A6A-44A8-AB4D-33387563247E}.Release|Any CPU.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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F55DA1A0-A982-4479-8C47-0D9A5AAF3E18}.Release|Any CPU.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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0D1AF432-439A-4920-8692-43AE139F5530}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3E6D1DD5-01C9-435F-9941-61F906CE35BB}.Release|Any CPU.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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{488BADD9-579F-4BF3-91DC-9FA95E3181A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {6372AD35-C9E4-4A9A-A52E-4F41531AC05B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
81
MesMonitor/SignalChangeMonitorControl/PlcConnect.Designer.cs
generated
Normal file
@@ -0,0 +1,81 @@
|
||||
namespace MesControl
|
||||
{
|
||||
partial class PlcConnect
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pictureBox_OpName = new System.Windows.Forms.PictureBox();
|
||||
this.label_OpName = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox_OpName)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pictureBox_OpName
|
||||
//
|
||||
this.pictureBox_OpName.BackgroundImage = global::MesControl.Properties.Resources.BreakPLC;
|
||||
this.pictureBox_OpName.Location = new System.Drawing.Point(3, 1);
|
||||
this.pictureBox_OpName.MaximumSize = new System.Drawing.Size(20, 20);
|
||||
this.pictureBox_OpName.MinimumSize = new System.Drawing.Size(20, 20);
|
||||
this.pictureBox_OpName.Name = "pictureBox_OpName";
|
||||
this.pictureBox_OpName.Size = new System.Drawing.Size(20, 20);
|
||||
this.pictureBox_OpName.TabIndex = 0;
|
||||
this.pictureBox_OpName.TabStop = false;
|
||||
//
|
||||
// label_OpName
|
||||
//
|
||||
this.label_OpName.AutoSize = true;
|
||||
this.label_OpName.Font = new System.Drawing.Font("宋体", 12F);
|
||||
this.label_OpName.Location = new System.Drawing.Point(32, 3);
|
||||
this.label_OpName.MaximumSize = new System.Drawing.Size(72, 16);
|
||||
this.label_OpName.MinimumSize = new System.Drawing.Size(72, 16);
|
||||
this.label_OpName.Name = "label_OpName";
|
||||
this.label_OpName.Size = new System.Drawing.Size(72, 16);
|
||||
this.label_OpName.TabIndex = 1;
|
||||
this.label_OpName.Text = "通讯状态";
|
||||
//
|
||||
// PlcConnect
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Controls.Add(this.label_OpName);
|
||||
this.Controls.Add(this.pictureBox_OpName);
|
||||
this.MaximumSize = new System.Drawing.Size(110, 22);
|
||||
this.MinimumSize = new System.Drawing.Size(110, 22);
|
||||
this.Name = "PlcConnect";
|
||||
this.Size = new System.Drawing.Size(110, 22);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox_OpName)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox pictureBox_OpName;
|
||||
private System.Windows.Forms.Label label_OpName;
|
||||
}
|
||||
}
|
||||
221
MesMonitor/SignalChangeMonitorControl/PlcConnect.cs
Normal file
@@ -0,0 +1,221 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MesControl
|
||||
{
|
||||
public delegate void PlcStatusHandle();
|
||||
public partial class PlcConnect: UserControl
|
||||
{
|
||||
public PlcConnect()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
public static PlcStatusHandle PlcBreakChange,PlcConnectChange;
|
||||
|
||||
|
||||
#region 内部变量
|
||||
int externalTimerTimes =0;
|
||||
|
||||
int testPlcBreakInterval=10000;
|
||||
|
||||
int testPlcBreakTime=0;
|
||||
|
||||
int externalTimerInterval = 200;
|
||||
|
||||
bool isBreakPLC = true;
|
||||
|
||||
bool plcTestEnable;
|
||||
|
||||
bool plcBreakIsChanged=false;
|
||||
bool plcConnectIsChanged = false;
|
||||
|
||||
#endregion
|
||||
#region 内部方法
|
||||
|
||||
void TimerTimeChange()
|
||||
{
|
||||
if (externalTimerTimes == 999)
|
||||
{
|
||||
externalTimerTimes = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
externalTimerTimes++;
|
||||
}
|
||||
|
||||
if (testPlcBreakTime > 0)
|
||||
{
|
||||
testPlcBreakTime--;
|
||||
plcBreakIsChanged = false;
|
||||
|
||||
if (PlcConnectChange!=null&&!plcConnectIsChanged)
|
||||
{
|
||||
PlcConnectChange();
|
||||
plcConnectIsChanged = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plcTestEnable)
|
||||
{
|
||||
if(PlcBreakChange != null&& !plcBreakIsChanged)
|
||||
{
|
||||
PlcBreakChange();
|
||||
plcBreakIsChanged = true;
|
||||
}
|
||||
plcConnectIsChanged = false;
|
||||
}
|
||||
isBreakPLC = true;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 外部方法
|
||||
public void ExternalTimer()
|
||||
{
|
||||
|
||||
if (!isBreakPLC)
|
||||
{
|
||||
switch (externalTimerTimes % 5)
|
||||
{
|
||||
case 0:
|
||||
pictureBox_OpName.BackgroundImage = Properties.Resources.PlcConnect0;
|
||||
break;
|
||||
case 1:
|
||||
pictureBox_OpName.BackgroundImage = Properties.Resources.PlcConnect1;
|
||||
break;
|
||||
case 2:
|
||||
pictureBox_OpName.BackgroundImage = Properties.Resources.PlcConnect2;
|
||||
break;
|
||||
case 3:
|
||||
pictureBox_OpName.BackgroundImage = Properties.Resources.PlcConnect3;
|
||||
break;
|
||||
case 4:
|
||||
pictureBox_OpName.BackgroundImage = Properties.Resources.PlcConnect4;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pictureBox_OpName.BackgroundImage = Properties.Resources.BreakPLC;
|
||||
}
|
||||
|
||||
|
||||
TimerTimeChange();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void ExternalPlcConnect()
|
||||
{
|
||||
testPlcBreakTime = (testPlcBreakInterval / externalTimerInterval) + 1;
|
||||
isBreakPLC = false;
|
||||
|
||||
}
|
||||
|
||||
public void PlcBreak()
|
||||
{
|
||||
pictureBox_OpName.BackgroundImage = Properties.Resources.BreakPLC;
|
||||
isBreakPLC = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 属性
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("控件中显示的文本内容"), Category("外观"), DefaultValue("OP0000")]
|
||||
public string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return label_OpName.Text;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
label_OpName.Text = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("外部定时器周期"), Category("行为"), DefaultValue("200")]
|
||||
public int ExternalTimerInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
return externalTimerInterval;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
externalTimerInterval = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("检测PLC在线状态超时,超过此时间,PLC为离线状态"), Category("行为"), DefaultValue("200")]
|
||||
public int TestPlcBreakInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
return testPlcBreakInterval;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
testPlcBreakInterval = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("指示PLC是否为断开状态"), Category("行为"), DefaultValue("True")]
|
||||
public bool IsBreakPLC
|
||||
{
|
||||
get
|
||||
{
|
||||
return isBreakPLC;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
isBreakPLC = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("是否启用检测PLC在线状态功能"), Category("行为"), DefaultValue("True")]
|
||||
public bool PlcTestEnable
|
||||
{
|
||||
get
|
||||
{
|
||||
return plcTestEnable;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
plcTestEnable = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
129
MesMonitor/SignalChangeMonitorControl/PlcConnect.resx
Normal file
@@ -0,0 +1,129 @@
|
||||
<?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="pictureBox_OpName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label_OpName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
80
MesMonitor/SignalChangeMonitorControl/PlcWorkStationSignal.Designer.cs
generated
Normal file
@@ -0,0 +1,80 @@
|
||||
namespace MesControl
|
||||
{
|
||||
partial class PlcWorkStationSignal
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.groupBox_WorkStationGrp = new System.Windows.Forms.GroupBox();
|
||||
this.plcConnect_WorkStation = new MesControl.PlcConnect();
|
||||
this.groupBox_WorkStationGrp.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox_WorkStationGrp
|
||||
//
|
||||
this.groupBox_WorkStationGrp.BackColor = System.Drawing.Color.Transparent;
|
||||
this.groupBox_WorkStationGrp.Controls.Add(this.plcConnect_WorkStation);
|
||||
this.groupBox_WorkStationGrp.Location = new System.Drawing.Point(4, 4);
|
||||
this.groupBox_WorkStationGrp.Name = "groupBox_WorkStationGrp";
|
||||
this.groupBox_WorkStationGrp.Size = new System.Drawing.Size(125, 50);
|
||||
this.groupBox_WorkStationGrp.TabIndex = 0;
|
||||
this.groupBox_WorkStationGrp.TabStop = false;
|
||||
this.groupBox_WorkStationGrp.Text = "OP0000";
|
||||
//
|
||||
// plcConnect_WorkStation
|
||||
//
|
||||
this.plcConnect_WorkStation.BackColor = System.Drawing.Color.Transparent;
|
||||
this.plcConnect_WorkStation.ExternalTimerInterval = 200;
|
||||
this.plcConnect_WorkStation.IsBreakPLC = false;
|
||||
this.plcConnect_WorkStation.LabelText = "通讯状态";
|
||||
this.plcConnect_WorkStation.Location = new System.Drawing.Point(7, 21);
|
||||
this.plcConnect_WorkStation.MaximumSize = new System.Drawing.Size(110, 22);
|
||||
this.plcConnect_WorkStation.MinimumSize = new System.Drawing.Size(110, 22);
|
||||
this.plcConnect_WorkStation.Name = "plcConnect_WorkStation";
|
||||
this.plcConnect_WorkStation.PlcTestEnable = false;
|
||||
this.plcConnect_WorkStation.Size = new System.Drawing.Size(110, 22);
|
||||
this.plcConnect_WorkStation.TabIndex = 0;
|
||||
this.plcConnect_WorkStation.TestPlcBreakInterval = 0;
|
||||
//
|
||||
// PlcWorkStationSignal
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Controls.Add(this.groupBox_WorkStationGrp);
|
||||
this.Name = "PlcWorkStationSignal";
|
||||
this.Size = new System.Drawing.Size(136, 60);
|
||||
this.groupBox_WorkStationGrp.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox_WorkStationGrp;
|
||||
private PlcConnect plcConnect_WorkStation;
|
||||
}
|
||||
}
|
||||
228
MesMonitor/SignalChangeMonitorControl/PlcWorkStationSignal.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MesControl
|
||||
{
|
||||
public delegate void WorkStationPlcBreakChanged();
|
||||
public partial class PlcWorkStationSignal : UserControl
|
||||
{
|
||||
public PlcWorkStationSignal()
|
||||
{
|
||||
InitializeComponent();
|
||||
PlcConnect.PlcBreakChange = new PlcStatusHandle(internalPlcBreak);
|
||||
PlcConnect.PlcConnectChange = new PlcStatusHandle(internalPlcConnect);
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
|
||||
}
|
||||
|
||||
public EventHandler WorkStationPlcStatusChange;
|
||||
|
||||
#region 工位信号方法与属性
|
||||
|
||||
public void InitSignalControl()
|
||||
{
|
||||
|
||||
|
||||
for (int i = 0; i < SignalItems.Count; i++)
|
||||
{
|
||||
|
||||
MesBoolSignal mesBoolSignalNew = new MesBoolSignal();
|
||||
this.groupBox_WorkStationGrp.Controls.Add(mesBoolSignalNew);//扩展GroupBox
|
||||
mesBoolSignalNew.BackColor = System.Drawing.Color.Transparent;
|
||||
mesBoolSignalNew.Location = new System.Drawing.Point(7, 46 + (25 * i));
|
||||
mesBoolSignalNew.Name = SignalItems[i].Name;
|
||||
mesBoolSignalNew.SignalImage = MesBoolSignal.SignalImage_Enum.none;
|
||||
mesBoolSignalNew.SignalText = SignalItems[i].SignalText;
|
||||
mesBoolSignalNew.Size = new System.Drawing.Size(110, 22);
|
||||
mesBoolSignalNew.TabIndex = i;
|
||||
|
||||
}
|
||||
|
||||
//groupbox大小
|
||||
groupBox_WorkStationGrp.Size = new Size(125, 50 + (SignalItems.Count * 25));
|
||||
//控件大小
|
||||
this.Size = new Size(136, 60 + (SignalItems.Count * 25));
|
||||
|
||||
}
|
||||
|
||||
private List<MesBoolSignal> signalItems = new List<MesBoolSignal>();
|
||||
[Browsable(true)]
|
||||
[Description("MES信号控件集合"), Category("数据")]
|
||||
[TypeConverter(typeof(System.ComponentModel.CollectionConverter))]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||
public List<MesBoolSignal> SignalItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return signalItems;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
signalItems = value;
|
||||
InitSignalControl();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///更改工位各个信号状态(默认)
|
||||
/// </summary>
|
||||
/// <param name="SignalName"></param>
|
||||
/// <param name="Value"></param>
|
||||
public void SignalChange(string SignalName, bool Value)
|
||||
{
|
||||
MesBoolSignal thisControl = (MesBoolSignal)Controls.Find(SignalName, true)[0];
|
||||
if (thisControl != null)
|
||||
thisControl.SignalImage = Value ? MesBoolSignal.SignalImage_Enum.green : MesBoolSignal.SignalImage_Enum.init;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PLC在线状态属性与方法
|
||||
|
||||
///////////////////////////////////////////////方法///////////////////////////////////////////////////
|
||||
|
||||
public void PlcConnectStatusChange(bool value)
|
||||
{
|
||||
plcConnect_WorkStation.ExternalPlcConnect();
|
||||
|
||||
}
|
||||
public void ExternalTimerExcute()
|
||||
{
|
||||
plcConnect_WorkStation.ExternalTimer();
|
||||
}
|
||||
|
||||
public void PlcBreak()
|
||||
{
|
||||
plcConnect_WorkStation.PlcBreak();
|
||||
}
|
||||
|
||||
void internalPlcBreak()
|
||||
{
|
||||
if (WorkStationPlcStatusChange != null)
|
||||
{
|
||||
WorkStationPlcStatusChange(groupBox_WorkStationGrp.Text+"&Breaked",null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void internalPlcConnect()
|
||||
{
|
||||
if (WorkStationPlcStatusChange != null)
|
||||
{
|
||||
WorkStationPlcStatusChange(groupBox_WorkStationGrp.Text + "&Connected", null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////属性///////////////////////////////////////////////
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("检测PLC在线状态开关"), Category("行为"), DefaultValue(true)]
|
||||
public bool TestPLC_Enable
|
||||
{
|
||||
get
|
||||
{
|
||||
return plcConnect_WorkStation.PlcTestEnable;
|
||||
}
|
||||
set
|
||||
{
|
||||
plcConnect_WorkStation.PlcTestEnable = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("PLC心跳超时(超过此时间认为PLC离线)"), Category("行为"), DefaultValue(10000)]
|
||||
public int TestPLC_Interval
|
||||
{
|
||||
get
|
||||
{
|
||||
return plcConnect_WorkStation.TestPlcBreakInterval;
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
plcConnect_WorkStation.TestPlcBreakInterval = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("外部定时器循环时间"), Category("行为"), DefaultValue(200)]
|
||||
public int ExternalTimerInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
return plcConnect_WorkStation.ExternalTimerInterval;
|
||||
}
|
||||
set
|
||||
{
|
||||
plcConnect_WorkStation.ExternalTimerInterval = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("PLC在线状态"), Category("行为"), DefaultValue(false)]
|
||||
public bool PLC_ConnectStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return plcConnect_WorkStation.IsBreakPLC;
|
||||
}
|
||||
set
|
||||
{
|
||||
plcConnect_WorkStation.IsBreakPLC = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 当前控件方法与属性
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("控件显示的工位号"), Category("外观"), DefaultValue("OP0000")]
|
||||
public string WorkStationNameText
|
||||
{
|
||||
get
|
||||
{
|
||||
return groupBox_WorkStationGrp.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
groupBox_WorkStationGrp.Text = value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("控件中plc通讯显示的文本内容"), Category("外观"), DefaultValue("PLC连接")]
|
||||
public string WS_PlcLabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return plcConnect_WorkStation.LabelText ;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
plcConnect_WorkStation.LabelText = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
123
MesMonitor/SignalChangeMonitorControl/PlcWorkStationSignal.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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="plcConnect_WorkStation.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("MesControl")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MesControl")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//将 ComVisible 设置为 false 将使此程序集中的类型
|
||||
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("fab322cc-531d-4aea-986a-b921b64d8d3f")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
193
MesMonitor/SignalChangeMonitorControl/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,193 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MesControl.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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("MesControl.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性
|
||||
/// 重写当前线程的 CurrentUICulture 属性。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap BreakPLC {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("BreakPLC", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap green {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("green", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap init {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("init", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap none {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("none", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PlcConnect0 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PlcConnect0", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PlcConnect1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PlcConnect1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PlcConnect2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PlcConnect2", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PlcConnect3 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PlcConnect3", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PlcConnect4 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PlcConnect4", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PlcConnectBig {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PlcConnectBig", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PlcConnectSmall {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PlcConnectSmall", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap red {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("red", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap yellow {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("yellow", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
160
MesMonitor/SignalChangeMonitorControl/Properties/Resources.resx
Normal file
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="red" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\red.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="yellow" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\yellow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PlcConnect1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PlcConnect1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PlcConnect0" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PlcConnect0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PlcConnect3" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PlcConnect3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="none" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\none.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PlcConnectSmall" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PlcConnectSmall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PlcConnect2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PlcConnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="init" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\init.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PlcConnectBig" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PlcConnectBig.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="BreakPLC" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\BreakPLC.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="green" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PlcConnect4" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PlcConnect4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
MesMonitor/SignalChangeMonitorControl/Resources/BreakPLC.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/PlcConnect0.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/PlcConnect1.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/PlcConnect2.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/PlcConnect3.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/PlcConnect4.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/green.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/init.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/none.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/red.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
MesMonitor/SignalChangeMonitorControl/Resources/yellow.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
37
MesMonitor/SignalChangeMonitorControl/SignalInit.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MesControl
|
||||
{
|
||||
public partial class PlcWorkStationSignal
|
||||
{
|
||||
void initsignal()
|
||||
{
|
||||
//private PlcConnect plcConnect_WorkStation;
|
||||
//this.plcConnect_WorkStation = new MesControl.PlcConnect();
|
||||
//this.groupBox_WorkStationGrp.Controls.Add(this.plcConnect_WorkStation);
|
||||
|
||||
////
|
||||
//// plcConnect_WorkStation
|
||||
////
|
||||
//this.plcConnect_WorkStation.BackColor = System.Drawing.Color.Transparent;
|
||||
//this.plcConnect_WorkStation.ExternalTimerInterval = 200;
|
||||
//this.plcConnect_WorkStation.IsBreakPLC = false;
|
||||
//this.plcConnect_WorkStation.LabelText = "通讯状态";
|
||||
//this.plcConnect_WorkStation.Location = new System.Drawing.Point(7, 21);
|
||||
//this.plcConnect_WorkStation.MaximumSize = new System.Drawing.Size(110, 22);
|
||||
//this.plcConnect_WorkStation.MinimumSize = new System.Drawing.Size(110, 22);
|
||||
//this.plcConnect_WorkStation.Name = "plcConnect_WorkStation";
|
||||
//this.plcConnect_WorkStation.PlcTestEnable = false;
|
||||
//this.plcConnect_WorkStation.Size = new System.Drawing.Size(110, 22);
|
||||
//this.plcConnect_WorkStation.TabIndex = 0;
|
||||
//this.plcConnect_WorkStation.TestPlcBreakInterval = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||