Add project files.

This commit is contained in:
SL 2024-06-18 14:59:58 +08:00
parent a145c0689b
commit 0ad8b250bb
112 changed files with 5489 additions and 0 deletions

View File

@ -0,0 +1,98 @@
<?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>{6C469C0C-A023-458D-87B2-BAD3D136FC8C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AKunSimGUI</RootNamespace>
<AssemblyName>AKunSimGUI</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<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.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

6
AKunSimGUI/App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

9
AKunSimGUI/App.xaml Normal file
View File

@ -0,0 +1,9 @@
<Application x:Class="AKunSimGUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AKunSimGUI"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

17
AKunSimGUI/App.xaml.cs Normal file
View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace AKunSimGUI
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View File

@ -0,0 +1,28 @@
<Window x:Class="AKunSimGUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:AKunSimGUI"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800"
ResizeMode="NoResize">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Margin="5,5,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Temp. SP"/>
<Slider Name="SliderTemp" Grid.Column="1" Maximum="1700" Minimum="600"/>
<TextBox Name="TxtTempSP" Grid.Column="2" IsReadOnly="True" Text="{Binding ElementName=SliderTemp, Path=Value, StringFormat={}{0:F1}}"></TextBox>
</Grid>
<ListBox Grid.Row="1"/>
</Grid>
</Window>

View File

@ -0,0 +1,56 @@
using System;
using System.Windows;
using EthernetVenderConnector;
namespace AKunSimGUI
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private readonly SicGen3 _server = new SicGen3();
public MainWindow()
{
InitializeComponent();
}
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
_server.Start();
_server.StartSendingRandomData();
_server.CommandRecieved += ServerOnCommandRecieved;
}
private void ServerOnCommandRecieved(object sender, ControlCommandEventArgs e)
{
var strArray = e.Command.Split(',');
switch (strArray.Length)
{
case 1:
if (e.Type == ControlCommandEventArgs.ControlCommandType.Stop)
{
_server.StopRandomData = true;
break;
}
if (e.Type != ControlCommandEventArgs.ControlCommandType.Start)
break;
_server.StopRandomData = false;
break;
case 2:
try
{
_server.GateTimeForRandomData = int.Parse(strArray[1]);
break;
}
catch
{
break;
}
}
}
}
}

View File

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AKunSimGUI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AKunSimGUI")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <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 AKunSimGUI.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[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>
/// Returns the cached ResourceManager instance used by this class.
/// </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("AKunSimGUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

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

View File

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

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

48
AKunSimulator.sln Normal file
View File

@ -0,0 +1,48 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35004.147
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Global", "Global\Global.csproj", "{D4693F0A-12E7-4574-8BD8-C1838B9E1C1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SessionLayer", "SessionLayer\SessionLayer.csproj", "{49C427D9-A0F3-4259-8893-A8E0D74E6377}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools", "Tools\Tools.csproj", "{8809ECCE-A9FA-4FC1-817F-25D9653B0135}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AKunSimGUI", "AKunSimGUI\AKunSimGUI.csproj", "{6C469C0C-A023-458D-87B2-BAD3D136FC8C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EthernetVenderConnector", "EthernetVenderConnector\EthernetVenderConnector.csproj", "{D7A8A467-BBE1-4AF2-8270-60D76AF7FBBA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D4693F0A-12E7-4574-8BD8-C1838B9E1C1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4693F0A-12E7-4574-8BD8-C1838B9E1C1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4693F0A-12E7-4574-8BD8-C1838B9E1C1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4693F0A-12E7-4574-8BD8-C1838B9E1C1B}.Release|Any CPU.Build.0 = Release|Any CPU
{49C427D9-A0F3-4259-8893-A8E0D74E6377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49C427D9-A0F3-4259-8893-A8E0D74E6377}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49C427D9-A0F3-4259-8893-A8E0D74E6377}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49C427D9-A0F3-4259-8893-A8E0D74E6377}.Release|Any CPU.Build.0 = Release|Any CPU
{8809ECCE-A9FA-4FC1-817F-25D9653B0135}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8809ECCE-A9FA-4FC1-817F-25D9653B0135}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8809ECCE-A9FA-4FC1-817F-25D9653B0135}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8809ECCE-A9FA-4FC1-817F-25D9653B0135}.Release|Any CPU.Build.0 = Release|Any CPU
{6C469C0C-A023-458D-87B2-BAD3D136FC8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C469C0C-A023-458D-87B2-BAD3D136FC8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C469C0C-A023-458D-87B2-BAD3D136FC8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C469C0C-A023-458D-87B2-BAD3D136FC8C}.Release|Any CPU.Build.0 = Release|Any CPU
{D7A8A467-BBE1-4AF2-8270-60D76AF7FBBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7A8A467-BBE1-4AF2-8270-60D76AF7FBBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7A8A467-BBE1-4AF2-8270-60D76AF7FBBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7A8A467-BBE1-4AF2-8270-60D76AF7FBBA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6B088936-DD9E-4527-B2BC-8E6E8FF36858}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("EthernetVenderConnector")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EthernetVenderConnector")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ce302aad-fa87-4c01-aee3-6e9ab921420f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]

View File

@ -0,0 +1,63 @@
using System;
namespace EthernetVenderConnector
{
public class ControlCommandEventArgs : EventArgs
{
public ControlCommandType Type
{
get
{
ControlCommandType type = ControlCommandType.Unidentified;
if (string.IsNullOrEmpty(Command))
return type;
switch (Command.Split(',').Length)
{
case 1:
if (Command.ToLower().Contains("start"))
{
type = ControlCommandType.Start;
break;
}
if (Command.ToLower().Contains("stop"))
{
type = ControlCommandType.Stop;
break;
}
break;
case 2:
if (Command.ToLower().Contains("gatetime"))
{
type = ControlCommandType.GateTime;
break;
}
break;
case 3:
if (Command.ToLower().Contains("emissivity"))
{
type = ControlCommandType.Emissivity;
break;
}
break;
default:
type = ControlCommandType.Unidentified;
break;
}
return type;
}
}
public string Command { get; private set; }
public ControlCommandEventArgs(string cmd) => Command = cmd;
public enum ControlCommandType
{
Start,
Stop,
GateTime,
Emissivity,
Unidentified,
}
}
}

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Project was exported from assembly: C:\Users\auvkk\Desktop\x64SimIR2\EthernetVenderConnector.dll-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D7A8A467-BBE1-4AF2-8270-60D76AF7FBBA}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>EthernetVenderConnector</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<FileAlignment>512</FileAlignment>
<RootNamespace>EthernetVenderConnector</RootNamespace>
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Core" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="SicGen3.cs" />
<Compile Include="ControlCommandEventArgs.cs" />
<Compile Include="MovingAverageBuffer.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Global\Global.csproj">
<Project>{d4693f0a-12e7-4574-8bd8-c1838b9e1c1b}</Project>
<Name>Global</Name>
</ProjectReference>
<ProjectReference Include="..\SessionLayer\SessionLayer.csproj">
<Project>{49c427d9-a0f3-4259-8893-a8e0d74e6377}</Project>
<Name>SessionLayer</Name>
</ProjectReference>
<ProjectReference Include="..\Tools\Tools.csproj">
<Project>{8809ecce-a9fa-4fc1-817f-25d9653b0135}</Project>
<Name>Tools</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp120</s:String></wpf:ResourceDictionary>

View File

@ -0,0 +1,105 @@
using System.Collections.Generic;
using System.Linq;
namespace EthernetVenderConnector
{
public class MovingAverageBuffer
{
private readonly List<float> _buffer1 = new List<float>();
private readonly List<float> _buffer2 = new List<float>();
private readonly List<float> _buffer3 = new List<float>();
private readonly List<float> _buffer4 = new List<float>();
private readonly List<double> _averagedValue;
private const int Maximum = 5;
private readonly object _locker = new object();
public double Det1Avg
{
get
{
lock (_locker)
return _averagedValue[0];
}
}
public double Det2Avg
{
get
{
lock (_locker)
return _averagedValue[1];
}
}
public double Det3Avg
{
get
{
lock (_locker)
return _averagedValue[2];
}
}
public double Det4Avg
{
get
{
lock (_locker)
return _averagedValue[3];
}
}
public MovingAverageBuffer()
{
_averagedValue = new List<double> { 0, 0, 0, 0, 0, 0 };
}
public void Clear()
{
lock (_locker)
{
_buffer1.Clear();
_buffer2.Clear();
_buffer3.Clear();
_buffer4.Clear();
}
}
public void Add(List<List<float>> v)
{
lock (_locker)
{
if (v.Count >= 4)
{
_buffer1.AddRange((IEnumerable<float>) v[0]);
_buffer2.AddRange((IEnumerable<float>) v[1]);
_buffer3.AddRange((IEnumerable<float>) v[2]);
_buffer4.AddRange((IEnumerable<float>) v[3]);
}
if (_buffer1.Count > 5)
_buffer1.RemoveRange(0, _buffer1.Count - 5);
if (_buffer2.Count > 5)
_buffer2.RemoveRange(0, _buffer2.Count - 5);
if (_buffer3.Count > 5)
_buffer3.RemoveRange(0, _buffer3.Count - 5);
if (_buffer4.Count > 5)
_buffer4.RemoveRange(0, _buffer4.Count - 5);
_averagedValue[0] = (double) _buffer1.Average();
_averagedValue[1] = (double) _buffer2.Average();
_averagedValue[2] = (double) _buffer3.Average();
_averagedValue[3] = (double) _buffer4.Average();
}
}
public void GetAverage(ref double[] v)
{
if (v.Length != 6)
return;
lock (_locker)
{
for (int index = 0; index < 6; ++index)
v[index] = _averagedValue[index];
}
}
}
}

View File

@ -0,0 +1,442 @@
using Global;
using SessionLayer;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Tools;
namespace EthernetVenderConnector
{
public class SicGen3
{
private readonly Service _server;
private int _connectCnt = 0;
private bool _isExitFlag = false;
private readonly Random _rdm = new Random();
private readonly byte[] _headOfPack = Encoding.Default.GetBytes("<Viper_Control>");
private readonly byte[] _endOfPack = Encoding.Default.GetBytes("<End>");
private readonly List<byte> _controlStream = new List<byte>();
private readonly object _sendLocker = new object();
private bool _eventProcessing = true;
private readonly MovingAverageBuffer _avgBuffer = new MovingAverageBuffer();
private int _statusFlag = 0;
public float IncreamentalSeed;
private float _baseTemp = 600f;
private readonly IntPtr _hRequest = FuncEvent.CreateEvent(IntPtr.Zero, false, false, "AKMemoryDataRequest");
private readonly IntPtr _hReady = FuncEvent.CreateEvent(IntPtr.Zero, false, false, "AKMemoryDataReady");
private IntPtr _hShareSegFile;
private readonly string _mappingFileName = "CircleData";
public event CommandHandler CommandRecieved;
public bool ServerReady { get; private set; }
public int CountOfConnection => _server.SessionCount;
public string RunId { get; set; }
public string SusId { get; set; }
public int StepId { get; set; }
public bool SusceptorBroken { get; set; }
public string WaferTablePath { get; set; }
public bool StopRandomData { get; set; }
public int GateTimeForRandomData { get; set; }
protected virtual void OnCommandRecieved(string cmd)
{
if (CommandRecieved == null)
return;
CommandRecieved((object)this, new ControlCommandEventArgs(cmd));
}
public SicGen3()
{
_server = new Service
{
MaximumSessionCount = 3
};
GateTimeForRandomData = 100;
IncreamentalSeed = 0.1f;
Task.Factory.StartNew((Action)(() =>
{
while (_eventProcessing)
{
try
{
EventProcess();
}
catch
{
}
Thread.Sleep(5);
}
}));
}
public void Start()
{
var ip = new INIClass(PString.SystemSet).IniReadValue(PString.Section_System, "DataIP");
if (string.IsNullOrEmpty(ip))
ip = "127.0.0.1";
const int port = 53888;
lock (_sendLocker)
{
_server.AfterConnect += new ServiceEvent.FuncConnect(Server_AfterConnect);
_server.DisConnect += new ServiceEvent.FuncConnect(Server_DisConnect);
_server.RecvMsg += new ServiceEvent.MsgHook(Server_RecvMsg);
ServerReady = _server.CreateService(ip, port);
}
}
public void Close()
{
_eventProcessing = false;
_isExitFlag = true;
lock (_sendLocker)
{
_server.Close();
}
}
public void SendData(List<List<float>> temperatures)
{
var now = DateTime.Now;
if (temperatures.First<List<float>>().Count == 0)
return;
try
{
try
{
_avgBuffer.Add(temperatures);
}
catch
{
}
var byteList = new List<byte>();
for (var index = 0; index < temperatures.Count; ++index)
{
foreach (var num in temperatures[index])
byteList.AddRange((IEnumerable<byte>)BitConverter.GetBytes(num));
}
var format1 = "<RT_Plus>,Version={0},Size={1},Data=||";
var format2 = "||,CheckSum={0},<End>;";
var num1 = Marshal.SizeOf(typeof(float));
var num2 = new IntPtr(temperatures[0].Count * 4 * num1);
var array = byteList.ToArray();
var bytes1 = Encoding.Default.GetBytes(string.Format(format1, (object)"TP", (object)num2.ToInt32()));
var bytes2 = Encoding.Default.GetBytes(string.Format(format2, (object)CheckSum(array, array.Length)));
lock (_sendLocker)
{
_server.SendMsg(bytes1, bytes1.Length);
_server.SendMsg(array, array.Length);
_server.SendMsg(bytes2, bytes2.Length);
}
}
catch (Exception ex)
{
}
if (DateTime.Now.Subtract(now).TotalSeconds <= 2.0)
return;
Logger.Trace("SDK: Poor network condition");
}
public void StartSendingRandomData()
{
Task.Factory.StartNew((Action)(() =>
{
while (!_isExitFlag)
{
GenerateRandomData();
Thread.Sleep(500);
}
}));
}
private void GenerateRandomData()
{
try
{
var num1 = 0;
if (GateTimeForRandomData > 0)
{
var num2 = 1000 / GateTimeForRandomData / 2;
num1 = num2 == 0 ? 1 : num2;
}
var temperatures = new List<List<float>>();
var floatList1 = new List<float>();
var floatList2 = new List<float>();
var floatList3 = new List<float>();
var floatList4 = new List<float>();
if (!StopRandomData)
{
for (var index = 0; index < num1; ++index)
{
_baseTemp += IncreamentalSeed;
floatList1.Add(_baseTemp + (float)_rdm.NextDouble());
floatList2.Add(_baseTemp + (float)_rdm.NextDouble());
floatList3.Add(_baseTemp + (float)_rdm.NextDouble());
floatList4.Add(_baseTemp + (float)_rdm.NextDouble());
}
}
temperatures.Add(floatList1);
temperatures.Add(floatList2);
temperatures.Add(floatList3);
temperatures.Add(floatList4);
SendData(temperatures);
SendStatus(new IRCurrentStatus()
{
Emissivity = _rdm.NextDouble() / 100.0 + 0.85,
OADate = DateTime.Now.ToOADate(),
Overflow = 0,
Status = 0,
IntegrationTime = GateTimeForRandomData > 0 ? (double)GateTimeForRandomData : 0.0
});
}
catch (Exception ex)
{
}
}
private void Server_AfterConnect(int id, bool isSuccess)
{
if (!isSuccess)
return;
++_connectCnt;
Logger.Trace("SDK: Client connected");
}
private void Server_DisConnect(int id, bool isSuccess)
{
if (!isSuccess || _connectCnt < 1)
return;
--_connectCnt;
Logger.Trace("SDK: Client disconnected");
}
private void Server_RecvMsg(int id, byte[] buf)
{
try
{
for (var cmd = Depack(buf); !string.IsNullOrEmpty(cmd); cmd = Depack(new byte[0]))
{
if (cmd.ToLower() != "wafertable")
OnCommandRecieved(cmd);
else
SendWaferTables();
}
}
catch
{
}
}
private short CheckSum(byte[] buf, int len)
{
short num = 0;
for (var index = 0; index < len; ++index)
num += (short)buf[index];
return num;
}
private int IndexOfArray(List<byte> lsBuffer, byte[] buf)
{
var flag = false;
var num = -1;
for (var index1 = 0; index1 < lsBuffer.Count; ++index1)
{
for (var index2 = 0;
index2 < buf.Length && (int)lsBuffer[index1 + index2] == (int)buf[index2];
++index2)
{
if (index2 == buf.Length - 1)
{
flag = true;
break;
}
}
if (flag)
{
num = index1;
break;
}
}
return num;
}
private string Depack(byte[] buf)
{
try
{
_controlStream.AddRange((IEnumerable<byte>)buf);
if (_controlStream.Count < 1)
return "";
var count = IndexOfArray(_controlStream, _headOfPack);
if (count > 0)
_controlStream.RemoveRange(0, count);
else if (count < 0)
return "";
var num = IndexOfArray(_controlStream, _endOfPack);
if (num < 0)
return "";
var array = _controlStream.ToArray();
_controlStream.RemoveRange(0, num + _endOfPack.Length);
return Encoding.Default.GetString(((IEnumerable<byte>)array).Skip<byte>(_headOfPack.Length)
.Take<byte>(num - _headOfPack.Length).ToArray<byte>());
}
catch
{
return "";
}
}
private void SendWaferTables()
{
try
{
var s = string.Join(",",
((IEnumerable<string>)Directory.GetFiles(WaferTablePath)).Select<string, string>(
(Func<string, string>)(t => Path.GetFileNameWithoutExtension(t))));
var format1 = "<RT_Plus>,Version={0},Size={1},Data=||";
var format2 = "||,CheckSum={0},<End>;";
var bytes1 = Encoding.Default.GetBytes(s);
var bytes2 = Encoding.Default.GetBytes(string.Format(format1, (object)"WT", (object)bytes1.Length));
var bytes3 = Encoding.Default.GetBytes(string.Format(format2, (object)CheckSum(bytes1, bytes1.Length)));
lock (_sendLocker)
{
_server.SendMsg(bytes2, bytes2.Length);
_server.SendMsg(bytes1, bytes1.Length);
_server.SendMsg(bytes3, bytes3.Length);
}
Logger.Trace("SDK: Wafer table has been sent");
}
catch (Exception ex)
{
}
}
public void SendStatus(IRCurrentStatus status)
{
_statusFlag = status.Status;
var format1 = "<RT_Plus>,Version={0},Size={1},Data=||";
var format2 = "||,CheckSum={0},<End>;";
var length = Marshal.SizeOf((object)status);
var numArray = new byte[length];
var num = Marshal.AllocHGlobal(numArray.Length);
try
{
Marshal.StructureToPtr((object)status, num, true);
Marshal.Copy(num, numArray, 0, length);
var bytes1 = Encoding.Default.GetBytes(string.Format(format1, (object)"ST", (object)length));
var bytes2 =
Encoding.Default.GetBytes(string.Format(format2, (object)CheckSum(numArray, numArray.Length)));
lock (_sendLocker)
{
_server.SendMsg(bytes1, bytes1.Length);
_server.SendMsg(numArray, numArray.Length);
_server.SendMsg(bytes2, bytes2.Length);
}
}
finally
{
Marshal.FreeHGlobal(num);
}
}
private void EventProcess()
{
try
{
if (FuncEvent.WaitForSingleObject(_hRequest, 1U) > 0U)
return;
if (_hShareSegFile.ToInt32() == 0)
_hShareSegFile = FuncShareMemory.CreateFileMapping(IntPtr.Zero, IntPtr.Zero, 134217732, 0, 80,
_mappingFileName);
var num1 = new IntPtr();
var num2 = new IntPtr(80);
var lpBaseAddress = FuncShareMemory.MapViewOfFile(_hShareSegFile, 2, 0, 0, num2);
if (lpBaseAddress.ToInt32() == 0)
{
_hShareSegFile = new IntPtr(0);
}
else
{
if (num2.ToInt32() != 80)
throw new Exception("Alloc Error!");
for (var index = 0; index < 10; ++index)
{
var num3 = index * 8;
switch (index)
{
case 0:
Marshal.Copy(new double[1]
{
_avgBuffer.Det1Avg
}, 0, lpBaseAddress + num3, 1);
break;
case 1:
Marshal.Copy(new double[1]
{
_avgBuffer.Det2Avg
}, 0, lpBaseAddress + num3, 1);
break;
case 2:
Marshal.Copy(new double[1]
{
_avgBuffer.Det3Avg
}, 0, lpBaseAddress + num3, 1);
break;
case 3:
Marshal.Copy(new double[1]
{
_avgBuffer.Det4Avg
}, 0, lpBaseAddress + num3, 1);
break;
case 8:
Marshal.Copy(new double[1]
{
(double)_statusFlag
}, 0, lpBaseAddress + num3, 1);
break;
case 9:
Marshal.Copy(new double[1]
{
DateTime.Now.ToOADate()
}, 0, lpBaseAddress + num3, 1);
break;
}
}
FuncShareMemory.FlushViewOfFile(lpBaseAddress, num2);
FuncShareMemory.UnmapViewOfFile(lpBaseAddress);
FuncEvent.SetEvent(_hReady);
}
}
catch (Exception ex)
{
Logger.Trace(ex);
}
}
public delegate void CommandHandler(object sender, ControlCommandEventArgs e);
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

14
Global/AssemblyInfo.cs Normal file
View File

@ -0,0 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Global")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Global")]
[assembly: AssemblyCopyright("版权所有 (C) 2012")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b49483e3-a6de-467f-a143-6e9eaf613dbf")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]

18
Global/BEI_STATUS.cs Normal file
View File

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Global.BEI_STATUS
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum BEI_STATUS
{
ProcessWell,
USBConnectError,
TimeIntervalError,
MemeoryAllocError,
Initializing,
UnStarted,
}
}

View File

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Global.BEI_SYSTEM_STATUS
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct BEI_SYSTEM_STATUS
{
public int nStatus;
public double dAverageInner;
public double dAverageOutter;
public double dAverageWaferInner;
public double dAverageWaferOutter;
}
}

View File

@ -0,0 +1,27 @@
// Decompiled with JetBrains decompiler
// Type: Global.BEI_SYSTEM_STATUS_EX
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Runtime.InteropServices;
namespace Global
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct BEI_SYSTEM_STATUS_EX
{
public int Head;
public int nStatus;
public int DetectorMask;
public int Reserved;
public double SusAvg_1;
public double SusAvg_2;
public double SusAvg_3;
public double SusAvg_4;
public double WaferAvg_1;
public double WaferAvg_2;
public double WaferAvg_3;
public double WaferAvg_4;
}
}

20
Global/BasicSetting.cs Normal file
View File

@ -0,0 +1,20 @@
// Decompiled with JetBrains decompiler
// Type: Global.BasicSetting
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct BasicSetting
{
public int dataCountCycle;
public int waferCount;
public int[,] eachWaferCheckBorder;
public float[,] eachWaferRatio;
public string ringName;
public WaferInfo[] eachwafer;
public bool bRTC;
}
}

30
Global/BinaryData.cs Normal file
View File

@ -0,0 +1,30 @@
// Decompiled with JetBrains decompiler
// Type: Global.BinaryData
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Runtime.InteropServices;
namespace Global
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct BinaryData
{
public BEI_SYSTEM_STATUS_EX status;
public TempData[] zoneInner;
public TempData[] zoneMiddle;
public TempData[] zoneOuter;
public TempData[] zoneEx;
public BinaryData(bool IsCreate)
{
this.status = new BEI_SYSTEM_STATUS_EX();
this.zoneInner = new TempData[18];
this.zoneMiddle = new TempData[36];
this.zoneOuter = new TempData[36];
this.zoneEx = new TempData[72];
}
}
}

16
Global/ChannelSet.cs Normal file
View File

@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Global.ChannelSet
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public class ChannelSet
{
public static int ChannelMax = 1;
public static int[] lEnCh = new int[48];
public static SChannelTab ExchangeTab = new SChannelTab(ETypeChannel.RTPlus3);
}
}

64
Global/CurvatureData.cs Normal file
View File

@ -0,0 +1,64 @@
// Decompiled with JetBrains decompiler
// Type: Global.CurvatureData
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct CurvatureData
{
public double DateTime;
public double Vertical1;
public double Vertical2;
public double Vertical3;
public double Vertical4;
public double Vertical5;
public double Horizon1;
public double Horizon2;
public double Horizon3;
public double Horizon4;
public double Bow1;
public double Bow2;
public double Bow3;
public double Bow4;
public double Bow5;
public double Vertical11;
public double Vertical12;
public double Vertical13;
public double Vertical14;
public double Vertical21;
public double Vertical22;
public double Vertical23;
public double Vertical24;
public double Vertical31;
public double Vertical32;
public double Vertical33;
public double Vertical34;
public double Vertical41;
public double Vertical42;
public double Vertical43;
public double Vertical44;
public double Vertical51;
public double Vertical52;
public double Vertical53;
public double Vertical54;
public double Horizon11;
public double Horizon12;
public double Horizon13;
public double Horizon14;
public double Horizon21;
public double Horizon22;
public double Horizon23;
public double Horizon24;
public double Horizon31;
public double Horizon32;
public double Horizon33;
public double Horizon34;
public double Horizon41;
public double Horizon42;
public double Horizon43;
public double Horizon44;
}
}

15
Global/DispType.cs Normal file
View File

@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Global.DispType
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum DispType
{
RunTimeDisp,
HistoryDisp,
}
}

22
Global/EChannelVar20.cs Normal file
View File

@ -0,0 +1,22 @@
// Decompiled with JetBrains decompiler
// Type: Global.EChannelVar20
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum EChannelVar20
{
Det01_405,
Det01_940,
Det01_1050,
Det02_405,
Det02_940,
Det02_1050,
Ref,
Trigger,
Max,
}
}

43
Global/EChannelVar30.cs Normal file
View File

@ -0,0 +1,43 @@
// Decompiled with JetBrains decompiler
// Type: Global.EChannelVar30
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum EChannelVar30
{
Trigger,
Ref,
Det01_405,
Det01_940,
Det01_1050,
Det02_405,
Det02_940,
Det02_1050,
Det03_405,
Det03_940,
Det03_1050,
Det04_405,
Det04_940,
Det04_1050,
C_1_x,
C_1_y,
C_1_sum,
C_2_x,
C_2_y,
C_2_sum,
C_3_x,
C_3_y,
C_3_sum,
C_4_x,
C_4_y,
C_4_sum,
C_5_x,
C_5_y,
C_5_sum,
Max,
}
}

47
Global/EChannelVar40.cs Normal file
View File

@ -0,0 +1,47 @@
// Decompiled with JetBrains decompiler
// Type: Global.EChannelVar40
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum EChannelVar40
{
Trigger,
Ref,
Det01_405,
Det01_940,
Det01_1050,
Det02_405,
Det02_940,
Det02_1050,
Det03_405,
Det03_940,
Det03_1050,
Det04_405,
Det04_940,
Det04_1050,
Ref940,
C_1_x,
C_1_y,
C_1_sum,
C_2_x,
C_2_y,
C_2_sum,
C_3_x,
C_3_y,
C_3_sum,
C_4_x,
C_4_y,
C_4_sum,
C_5_x,
C_5_y,
C_5_sum,
C_Se_x,
C_Se_y,
C_Se_sum,
Max,
}
}

View File

@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Global.EChannelVarSerial
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum EChannelVarSerial
{
High_Serial,
Low_Serial,
Max,
}
}

View File

@ -0,0 +1,42 @@
// Decompiled with JetBrains decompiler
// Type: Global.EChannelVar_SICMode
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum EChannelVar_SICMode
{
Trigger,
Det01_940_L,
Det01_940_H,
Det02_940_L,
Det02_940_H,
Det03_940_L,
Det03_940_H,
Det04_940_L,
Det04_940_H,
Ref940,
C_1_x,
C_1_y,
C_1_sum,
C_2_x,
C_2_y,
C_2_sum,
C_3_x,
C_3_y,
C_3_sum,
C_4_x,
C_4_y,
C_4_sum,
C_5_x,
C_5_y,
C_5_sum,
C_Se_x,
C_Se_y,
C_Se_sum,
Max,
}
}

18
Global/EResult.cs Normal file
View File

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Global.EResult
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum EResult
{
Success,
Failed,
Memeory,
IO,
TimeInterval,
}
}

18
Global/ETypeChannel.cs Normal file
View File

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Global.ETypeChannel
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum ETypeChannel
{
RTPlus3,
RTPlus4,
TwoDetector,
RTPlus6,
SerialNumber,
}
}

23
Global/ETypeCurvature.cs Normal file
View File

@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Global.ETypeCurvature
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum ETypeCurvature
{
point5,
point1,
point1Ex,
square4,
typeV,
typeVEx,
cal_2,
racEx,
typeP2,
typeREx,
}
}

View File

@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Global.ETypeDetectorType
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum ETypeDetectorType
{
FivePoint,
OnePoint,
TwoPoint,
}
}

View File

@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Global.ETypeDetectorTypeEx
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum ETypeDetectorTypeEx
{
OnePoint,
TwoPoint,
}
}

17
Global/EWaferStyle.cs Normal file
View File

@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: Global.EWaferStyle
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum EWaferStyle
{
Good,
Shiny,
Diffuse,
Lose,
}
}

46
Global/FuncEvent.cs Normal file
View File

@ -0,0 +1,46 @@
// Decompiled with JetBrains decompiler
// Type: Global.FuncEvent
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System;
using System.Runtime.InteropServices;
namespace Global
{
public class FuncEvent
{
public const string DataRequest = "OptDataRequest";
public const string DataReady = "OptDataReady";
public const string DataRequestVolt = "OptDataRequestVolt";
public const string DataReadyVolt = "OptDataReadyVolt";
public const string DataRequestPyro = "OptDataRequestPyro";
public const string DataReadyPyro = "OptDataReadyPyro";
public const string DataRequest405 = "OptDataRequest405";
public const string DataReady405 = "OptDataReady405";
public const string ControlRequestScanPyro = "CntlRequestScanPyro";
public const string ControlReadyScanPyro = "CntlReadyScanPyro";
public const string TransDataRequest = "ServerWriteEvent";
public const string TransDataReady = "ClientReadEvent";
public const string TransCurvatureDataRequest = "ServerWriteEventCurvature";
public const string TransCurvatureDataReady = "ClientReadEventCurvature";
[DllImport("kernel32.dll")]
public static extern IntPtr CreateEvent(
IntPtr lpEventAttributes,
bool bManualReset,
bool bInitialState,
string lpName);
[DllImport("kernel32.dll")]
public static extern bool SetEvent(IntPtr lpEventAttributes);
[DllImport("kernel32.dll")]
public static extern bool ResetEvent(IntPtr lpEventAttributes);
[DllImport("kernel32.dll")]
public static extern uint WaitForSingleObject(IntPtr lpEventAttributes, uint timeout);
}
}

77
Global/FuncShareMemory.cs Normal file
View File

@ -0,0 +1,77 @@
// Decompiled with JetBrains decompiler
// Type: Global.FuncShareMemory
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System;
using System.Runtime.InteropServices;
namespace Global
{
public class FuncShareMemory
{
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr CreateFile(
string lpFileName,
int dwDesiredAccess,
int dwShareMode,
IntPtr lpSecurityAttributes,
int dwCreationDisposition,
int dwFlagsAndAttributes,
IntPtr hTemplateFile);
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr CreateFileMapping(
IntPtr hFile,
IntPtr lpAttributes,
int flProtect,
int dwMaximumSizeLow,
int dwMaximumSizeHigh,
string lpName);
[DllImport("kernel32", SetLastError = true)]
public static extern bool FlushViewOfFile(IntPtr lpBaseAddress, IntPtr dwNumBytesToFlush);
[DllImport("kernel32", SetLastError = true)]
public static extern IntPtr MapViewOfFile(
IntPtr hFileMappingObject,
int dwDesiredAccess,
int dwFileOffsetHigh,
int dwFileOffsetLow,
IntPtr dwNumBytesToMap);
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr OpenFileMapping(
int dwDesiredAccess,
bool bInheritHandle,
string lpName);
[DllImport("kernel32", SetLastError = true)]
public static extern bool UnmapViewOfFile(IntPtr lpBaseAddress);
[DllImport("kernel32", SetLastError = true)]
public static extern bool CloseHandle(IntPtr handle);
public enum MapProtection
{
PageNone = 0,
PageReadOnly = 2,
PageReadWrite = 4,
PageWriteCopy = 8,
SecImage = 16777216, // 0x01000000
SecReserve = 67108864, // 0x04000000
SecCommit = 134217728, // 0x08000000
SecNoCache = 268435456, // 0x10000000
}
public enum MapAccess
{
FileMapCopy = 1,
FileMapWrite = 2,
FileMapRead = 4,
FileMapAllAccess = 31, // 0x0000001F
}
}
}

100
Global/Global.csproj Normal file
View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Project was exported from assembly: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D4693F0A-12E7-4574-8BD8-C1838B9E1C1B}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>Global</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<FileAlignment>512</FileAlignment>
<RootNamespace>Global</RootNamespace>
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="EResult.cs" />
<Compile Include="EChannelVar20.cs" />
<Compile Include="EChannelVar30.cs" />
<Compile Include="EChannelVar40.cs" />
<Compile Include="EChannelVar_SICMode.cs" />
<Compile Include="EChannelVarSerial.cs" />
<Compile Include="ETypeChannel.cs" />
<Compile Include="SChannelTab.cs" />
<Compile Include="ChannelSet.cs" />
<Compile Include="PSDSet.cs" />
<Compile Include="SwCtrl.cs" />
<Compile Include="ThreadCtrlSet.cs" />
<Compile Include="MemeorySet.cs" />
<Compile Include="SingleValue.cs" />
<Compile Include="WaferIniVar.cs" />
<Compile Include="IRCurrentStatus.cs" />
<Compile Include="FuncEvent.cs" />
<Compile Include="FuncShareMemory.cs" />
<Compile Include="VarType.cs" />
<Compile Include="DispType.cs" />
<Compile Include="BasicSetting.cs" />
<Compile Include="EWaferStyle.cs" />
<Compile Include="WaferInfo.cs" />
<Compile Include="WaferInfoDisplay.cs" />
<Compile Include="WaferInfoOnce.cs" />
<Compile Include="WaferSimpleInfo.cs" />
<Compile Include="WaferTemperatureInfo.cs" />
<Compile Include="BEI_STATUS.cs" />
<Compile Include="TempData.cs" />
<Compile Include="Viper405Data.cs" />
<Compile Include="ScanPyroControlData.cs" />
<Compile Include="CurvatureData.cs" />
<Compile Include="BEI_SYSTEM_STATUS.cs" />
<Compile Include="BEI_SYSTEM_STATUS_EX.cs" />
<Compile Include="BinaryData.cs" />
<Compile Include="SystemParameter.cs" />
<Compile Include="SubtrateType.cs" />
<Compile Include="SaveIndex.cs" />
<Compile Include="TempStatus.cs" />
<Compile Include="TableHead.cs" />
<Compile Include="SWaferData.cs" />
<Compile Include="SWaferDataC.cs" />
<Compile Include="SViper405Data.cs" />
<Compile Include="SProcessID.cs" />
<Compile Include="SStepInfo.cs" />
<Compile Include="ProcessInfo.cs" />
<Compile Include="SStepInfoEx.cs" />
<Compile Include="INIClass.cs" />
<Compile Include="PString.cs" />
<Compile Include="SFI.cs" />
<Compile Include="ETypeCurvature.cs" />
<Compile Include="ETypeDetectorType.cs" />
<Compile Include="ETypeDetectorTypeEx.cs" />
<Compile Include="SSmart.cs" />
<Compile Include="WinApi.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp120</s:String></wpf:ResourceDictionary>

50
Global/INIClass.cs Normal file
View File

@ -0,0 +1,50 @@
// Decompiled with JetBrains decompiler
// Type: Global.INIClass
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace Global
{
public class INIClass
{
public string inipath;
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(
string section,
string key,
string val,
string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(
string section,
string key,
string def,
StringBuilder retVal,
int size,
string filePath);
public INIClass(string INIPath) => this.inipath = INIPath;
public void IniWriteValue(string Section, string Key, string Value)
{
INIClass.WritePrivateProfileString(Section, Key, Value, this.inipath);
}
public string IniReadValue(string Section, string Key)
{
StringBuilder retVal = new StringBuilder(500);
INIClass.GetPrivateProfileString(Section, Key, "", retVal, 500, this.inipath);
return retVal.ToString();
}
public bool ExistINIFile() => File.Exists(this.inipath);
}
}

18
Global/IRCurrentStatus.cs Normal file
View File

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Global.IRCurrentStatus
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct IRCurrentStatus
{
public double IntegrationTime;
public double Emissivity;
public double OADate;
public int Status;
public int Overflow;
}
}

15
Global/MemeorySet.cs Normal file
View File

@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Global.MemeorySet
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public class MemeorySet
{
public const int MaxCachePacket = 1024;
public const int MaxCacheCountForDraw = 1024000;
}
}

56
Global/PSDSet.cs Normal file
View File

@ -0,0 +1,56 @@
// Decompiled with JetBrains decompiler
// Type: Global.PSDSet
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public class PSDSet
{
public static bool[][] PSDOppXY = new bool[2][]
{
new bool[5],
new bool[5]
};
public static bool[][] PSDOppSingle = new bool[2][]
{
new bool[5],
new bool[5]
};
public static void SetPSD(int ring, string type)
{
switch (type)
{
case "C4":
PSDSet.PSDOppXY[ring] = new bool[5]
{
false,
true,
false,
true,
false
};
PSDSet.PSDOppSingle[ring] = new bool[5]
{
false,
false,
false,
true,
false
};
break;
case "C7":
PSDSet.PSDOppXY[ring] = new bool[5];
PSDSet.PSDOppSingle[ring] = new bool[5];
break;
default:
PSDSet.PSDOppXY[ring] = new bool[5];
PSDSet.PSDOppSingle[ring] = new bool[5];
break;
}
}
}
}

27
Global/PString.cs Normal file
View File

@ -0,0 +1,27 @@
// Decompiled with JetBrains decompiler
// Type: Global.PString
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System;
namespace Global
{
public class PString
{
public static string SystemSet = Environment.CurrentDirectory + "\\SystemSet.ini";
public static string WaferSegSet = Environment.CurrentDirectory + "\\WaferSeg.ini";
public static string CurvatureSet = Environment.CurrentDirectory + "\\CurvatureSet.ini";
public static string DetectorSet = Environment.CurrentDirectory + "\\Detector.ini";
public static string ScanPyroSet = Environment.CurrentDirectory + "\\Scan.ini";
public static string Section_System = "system parameter";
public static string Section_1 = "Det#1";
public static string Section_2 = "Det#2";
public static string Section_3 = "Det#3";
public static string Section_4 = "Det#4";
public static string Section_C = "Det#Curvature";
public static string Section_C_Ex = "Det#CurvatureEx";
}
}

15
Global/ProcessInfo.cs Normal file
View File

@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Global.ProcessInfo
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public class ProcessInfo
{
public static SProcessID IDInfo = new SProcessID(0);
public static SStepInfo RecipeStepInfo = new SStepInfo(1);
}
}

370
Global/SChannelTab.cs Normal file
View File

@ -0,0 +1,370 @@
// Decompiled with JetBrains decompiler
// Type: Global.SChannelTab
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct SChannelTab
{
public ETypeChannel Mode;
public int AsyncTrigger;
public int Trigger;
public int Ref;
public int Det01_405;
public int Det01_940;
public int Det01_1050;
public int Det02_405;
public int Det02_940;
public int Det02_1050;
public int Det03_405;
public int Det03_940;
public int Det03_1050;
public int Det04_405;
public int Det04_940;
public int Det04_1050;
public int Ref_940;
public int C_1_x;
public int C_1_y;
public int C_1_sum;
public int C_2_x;
public int C_2_y;
public int C_2_sum;
public int C_3_x;
public int C_3_y;
public int C_3_sum;
public int C_4_x;
public int C_4_y;
public int C_4_sum;
public int C_5_x;
public int C_5_y;
public int C_5_sum;
public int C_Se_x;
public int C_Se_y;
public int C_Se_sum;
public int HighSerial;
public int LowSerial;
public bool IsDynamicShift;
public SChannelTab(ETypeChannel type)
{
this.Mode = type;
this.AsyncTrigger = 0;
this.Trigger = 0;
this.Ref = 1;
this.Det01_405 = 2;
this.Det01_940 = 3;
this.Det01_1050 = 4;
this.Det02_405 = 5;
this.Det02_940 = 6;
this.Det02_1050 = 7;
this.Det03_405 = 8;
this.Det03_940 = 9;
this.Det03_1050 = 10;
this.Det04_405 = 11;
this.Det04_940 = 12;
this.Det04_1050 = 13;
this.Ref_940 = 14;
this.C_1_x = 15;
this.C_1_y = 16;
this.C_1_sum = 17;
this.C_2_x = 18;
this.C_2_y = 19;
this.C_2_sum = 20;
this.C_3_x = 21;
this.C_3_y = 22;
this.C_3_sum = 23;
this.C_4_x = 24;
this.C_4_y = 25;
this.C_4_sum = 26;
this.C_5_x = 27;
this.C_5_y = 28;
this.C_5_sum = 29;
this.C_Se_x = 30;
this.C_Se_y = 31;
this.C_Se_sum = 32;
this.HighSerial = 0;
this.LowSerial = 0;
this.IsDynamicShift = false;
this.LoadSet(type);
}
public void LoadSet(ETypeChannel type)
{
this.Mode = type;
switch (type)
{
case ETypeChannel.RTPlus3:
this.LoadMode3();
break;
case ETypeChannel.RTPlus4:
this.LoadMode4();
break;
case ETypeChannel.TwoDetector:
this.LoadMode2();
break;
case ETypeChannel.RTPlus6:
this.LoadMode6();
break;
case ETypeChannel.SerialNumber:
this.LoadModeSerial();
break;
}
}
public void SetDynamicShiftMode(bool Active = true)
{
this.IsDynamicShift = Active;
switch (this.Mode)
{
case ETypeChannel.RTPlus3:
ChannelSet.ExchangeTab.Trigger = Active ? 1 : 0;
break;
case ETypeChannel.TwoDetector:
ChannelSet.ExchangeTab.Trigger = Active ? 6 : 7;
break;
}
}
private void LoadModeSerial()
{
int[] numArray = new int[48];
numArray[16] = 1;
numArray[17] = 1;
ChannelSet.lEnCh = numArray;
this.HighSerial = 0;
this.LowSerial = 1;
ChannelSet.ChannelMax = 2;
}
private void LoadMode3()
{
this.AsyncTrigger = 0;
this.Trigger = 0;
this.Ref = 1;
this.Det01_405 = 2;
this.Det01_940 = 3;
this.Det01_1050 = 4;
this.Det02_405 = 5;
this.Det02_940 = 6;
this.Det02_1050 = 7;
this.Det03_405 = 8;
this.Det03_940 = 9;
this.Det03_1050 = 10;
this.Det04_405 = 11;
this.Det04_940 = 12;
this.Det04_1050 = 13;
this.C_1_x = 14;
this.C_1_y = 15;
this.C_1_sum = 16;
this.C_2_x = 17;
this.C_2_y = 18;
this.C_2_sum = 19;
this.C_3_x = 20;
this.C_3_y = 21;
this.C_3_sum = 22;
this.C_4_x = 23;
this.C_4_y = 24;
this.C_4_sum = 25;
this.C_5_x = 26;
this.C_5_y = 27;
this.C_5_sum = 28;
this.C_Se_x = 14;
this.C_Se_y = 15;
this.C_Se_sum = 16;
ChannelSet.lEnCh = new int[48]
{
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0
};
ChannelSet.ChannelMax = 29;
}
private void LoadMode4()
{
this.AsyncTrigger = 0;
this.Trigger = 0;
this.Ref = 1;
this.Det01_405 = 2;
this.Det01_940 = 3;
this.Det01_1050 = 4;
this.Det02_405 = 5;
this.Det02_940 = 6;
this.Det02_1050 = 7;
this.Det03_405 = 8;
this.Det03_940 = 9;
this.Det03_1050 = 10;
this.Det04_405 = 11;
this.Det04_940 = 12;
this.Det04_1050 = 13;
this.Ref_940 = 14;
this.C_1_x = 15;
this.C_1_y = 16;
this.C_1_sum = 17;
this.C_2_x = 18;
this.C_2_y = 19;
this.C_2_sum = 20;
this.C_3_x = 21;
this.C_3_y = 22;
this.C_3_sum = 23;
this.C_4_x = 24;
this.C_4_y = 25;
this.C_4_sum = 26;
this.C_5_x = 27;
this.C_5_y = 28;
this.C_5_sum = 29;
this.C_Se_x = 30;
this.C_Se_y = 31;
this.C_Se_sum = 32;
ChannelSet.lEnCh = new int[48]
{
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0
};
ChannelSet.ChannelMax = 33;
}
private void LoadMode6()
{
this.LoadMode4();
this.AsyncTrigger = 1;
this.Trigger = 0;
SingleValue.TriggleLowValue = 35000;
SingleValue.TriggleHighValue = 38000;
}
private void LoadMode2()
{
this.AsyncTrigger = 7;
this.Trigger = 7;
this.Ref = 6;
this.Det01_405 = 0;
this.Det01_940 = 1;
this.Det01_1050 = 2;
this.Det02_405 = 3;
this.Det02_940 = 4;
this.Det02_1050 = 5;
this.Det03_405 = 0;
this.Det03_940 = 1;
this.Det03_1050 = 2;
this.Det04_405 = 3;
this.Det04_940 = 4;
this.Det04_1050 = 5;
this.C_1_x = 6;
this.C_1_y = 6;
this.C_1_sum = 6;
this.C_2_x = 6;
this.C_2_y = 6;
this.C_2_sum = 6;
this.C_3_x = 6;
this.C_3_y = 6;
this.C_3_sum = 6;
this.C_4_x = 6;
this.C_4_y = 6;
this.C_4_sum = 6;
this.C_5_x = 6;
this.C_5_y = 6;
this.C_5_sum = 6;
this.C_Se_x = 6;
this.C_Se_y = 6;
this.C_Se_sum = 6;
for (int index = 8; index < 48; ++index)
ChannelSet.lEnCh[index] = 0;
ChannelSet.ChannelMax = 8;
}
}
}

67
Global/SFI.cs Normal file
View File

@ -0,0 +1,67 @@
// Decompiled with JetBrains decompiler
// Type: Global.SFI
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Text.RegularExpressions;
namespace Global
{
public struct SFI
{
public double oa;
public long date;
public string file;
public string name;
public string NumSerial;
public bool isFolder;
private static MatchEvaluator myEvaluator = new MatchEvaluator(SFI.MakeRegularNum);
private static MatchEvaluator myEvaluatorRev = new MatchEvaluator(SFI.MakeRegularNumRev);
public void MakeValue(string name)
{
if (this.isFolder)
this.NumSerial = Regex.Replace(name, "\\d+", SFI.myEvaluatorRev);
else
this.NumSerial = Regex.Replace(name, "\\d+", SFI.myEvaluator);
}
private static string MakeRegularNum(Match m) => long.Parse(m.Value).ToString("0000000000");
private static string MakeRegularNumRev(Match m)
{
return (10000000000L - long.Parse(m.Value)).ToString("0000000000");
}
public static int ComparisonByName(SFI a, SFI b) => a.file.CompareTo(b.file);
public static int ComparisonByRegularName(SFI a, SFI b) => a.NumSerial.CompareTo(b.NumSerial);
public static int ComparisonByDate(SFI a, SFI b)
{
if (a.date > b.date)
return 1;
return a.date < b.date ? -1 : 0;
}
public static int ComparisonByRegular(SFI a, SFI b)
{
if (a.name == null)
return -1;
if (b.name == null || a.name.Contains("Curvature") && !b.name.Contains("Curvature"))
return 1;
return !a.name.Contains("Curvature") && b.name.Contains("Curvature") ? -1 : SFI.ComparisonByRegularName(a, b);
}
public static int ComparisonByRegular(string a, string b)
{
if (a == null)
return -1;
if (b == null || a.Contains("Curvature") && !b.Contains("Curvature"))
return 1;
return !a.Contains("Curvature") && b.Contains("Curvature") ? -1 : a.CompareTo(b);
}
}
}

32
Global/SProcessID.cs Normal file
View File

@ -0,0 +1,32 @@
// Decompiled with JetBrains decompiler
// Type: Global.SProcessID
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Runtime.InteropServices;
using System.Threading;
namespace Global
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SProcessID
{
public static Mutex mutex = new Mutex();
public int id;
public double time;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] runID;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] susceptorID;
public SProcessID(int v)
{
this.id = v;
this.time = 0.0;
this.runID = new byte[128];
this.susceptorID = new byte[128];
}
}
}

138
Global/SSmart.cs Normal file
View File

@ -0,0 +1,138 @@
// Decompiled with JetBrains decompiler
// Type: Global.SSmart
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System;
using System.Collections.Generic;
namespace Global
{
public struct SSmart
{
public bool Det01_Active;
public string Det01_Name;
public bool Det01_Hide;
public bool Det02_Active;
public string Det02_Name;
public bool Det02_Hide;
public bool Det03_Active;
public string Det03_Name;
public bool Det03_Hide;
public bool Det04_Active;
public string Det04_Name;
public bool Det04_Hide;
public bool DetCurvature_Active;
public int DetCurvature_Bind;
public ETypeCurvature DetCurvature_Type;
public ETypeDetectorType DetectorType;
public int DetCurvature_Laser;
public bool DetCurvatureEx_Active;
public int DetCurvatureEx_Bind;
public ETypeCurvature DetCurvatureEx_Type;
public ETypeDetectorTypeEx DetectorTypeEx;
public bool ReadFrom405;
public List<int> CurRingIndexArray;
public SSmart(int val)
{
this.Det01_Active = true;
this.Det02_Active = true;
this.Det03_Active = true;
this.Det04_Active = true;
this.DetCurvature_Active = true;
this.Det01_Hide = true;
this.Det02_Hide = true;
this.Det03_Hide = true;
this.Det04_Hide = true;
this.Det01_Name = "Det01";
this.Det02_Name = "Det02";
this.Det03_Name = "Det02";
this.Det04_Name = "Det03";
this.DetCurvature_Bind = 3;
this.DetCurvature_Laser = 0;
this.DetCurvature_Type = ETypeCurvature.point5;
this.DetectorType = ETypeDetectorType.FivePoint;
this.DetCurvatureEx_Active = false;
this.DetCurvatureEx_Bind = 1;
this.DetCurvatureEx_Type = ETypeCurvature.point1Ex;
this.DetectorTypeEx = ETypeDetectorTypeEx.OnePoint;
this.CurRingIndexArray = new List<int>();
this.ReadFrom405 = true;
}
public void LoadFromSetting(string path)
{
INIClass iniClass = new INIClass(path);
this.Det01_Active = bool.Parse(iniClass.IniReadValue("Detector#1", "Activation"));
this.Det01_Name = iniClass.IniReadValue("Detector#1", "Name");
bool result1;
this.Det01_Hide = bool.TryParse(iniClass.IniReadValue("Detector#1", "Hide"), out result1) && result1;
this.Det02_Active = bool.Parse(iniClass.IniReadValue("Detector#2", "Activation"));
this.Det02_Name = iniClass.IniReadValue("Detector#2", "Name");
this.Det02_Hide = bool.TryParse(iniClass.IniReadValue("Detector#2", "Hide"), out result1) && result1;
this.Det03_Active = bool.Parse(iniClass.IniReadValue("Detector#3", "Activation"));
this.Det03_Name = iniClass.IniReadValue("Detector#3", "Name");
bool.TryParse(iniClass.IniReadValue("Detector#3", "Hide"), out result1);
this.Det03_Hide = bool.TryParse(iniClass.IniReadValue("Detector#3", "Hide"), out result1) && result1;
this.Det04_Active = bool.Parse(iniClass.IniReadValue("Detector#4", "Activation"));
this.Det04_Name = iniClass.IniReadValue("Detector#4", "Name");
this.Det04_Hide = bool.TryParse(iniClass.IniReadValue("Detector#4", "Hide"), out result1) && result1;
this.DetCurvature_Active = bool.Parse(iniClass.IniReadValue("Detector#Curvature", "Activation"));
this.DetCurvature_Laser = int.Parse(iniClass.IniReadValue("Detector#Curvature", "LaserRate"));
this.DetCurvature_Type = (ETypeCurvature) int.Parse(iniClass.IniReadValue("Detector#Curvature", "Type"));
this.DetCurvature_Bind = int.Parse(iniClass.IniReadValue("Detector#Curvature", "Binding"));
int result2 = 0;
int.TryParse(iniClass.IniReadValue("Detector#Curvature", "DetectorType"), out result2);
this.DetectorType = (ETypeDetectorType) result2;
this.DetCurvatureEx_Active = bool.Parse(iniClass.IniReadValue("Detector#CurvatureEx", "Activation"));
this.DetCurvatureEx_Bind = int.Parse(iniClass.IniReadValue("Detector#CurvatureEx", "Binding"));
this.DetCurvatureEx_Type = (ETypeCurvature) int.Parse(iniClass.IniReadValue("Detector#CurvatureEx", "Type"));
int result3 = 0;
int.TryParse(iniClass.IniReadValue("Detector#CurvatureEx", "DetectorType"), out result3);
this.DetectorTypeEx = (ETypeDetectorTypeEx) result3;
try
{
this.ReadFrom405 = new INIClass(PString.SystemSet).IniReadValue(PString.Section_System, "DCOM405").ToUpper() == "TRUE";
}
catch (Exception ex)
{
this.ReadFrom405 = true;
}
}
public int GetDispRingNum(out List<string> names)
{
names = new List<string>();
this.CurRingIndexArray = new List<int>();
int dispRingNum = 0;
if (this.Det01_Active)
{
this.CurRingIndexArray.Add(1);
names.Add(this.Det01_Name);
++dispRingNum;
}
if (this.Det02_Active)
{
this.CurRingIndexArray.Add(2);
names.Add(this.Det02_Name);
++dispRingNum;
}
if (this.Det03_Active)
{
this.CurRingIndexArray.Add(3);
names.Add(this.Det03_Name);
++dispRingNum;
}
if (this.Det04_Active)
{
this.CurRingIndexArray.Add(4);
names.Add(this.Det04_Name);
++dispRingNum;
}
return dispRingNum;
}
}
}

34
Global/SStepInfo.cs Normal file
View File

@ -0,0 +1,34 @@
// Decompiled with JetBrains decompiler
// Type: Global.SStepInfo
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Runtime.InteropServices;
using System.Threading;
namespace Global
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SStepInfo
{
public static Mutex mutex = new Mutex();
public int id;
public double time;
public int step;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] name;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] description;
public SStepInfo(int v)
{
this.id = v;
this.time = 0.0;
this.step = 0;
this.name = new byte[16];
this.description = new byte[64];
}
}
}

19
Global/SStepInfoEx.cs Normal file
View File

@ -0,0 +1,19 @@
// Decompiled with JetBrains decompiler
// Type: Global.SStepInfoEx
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct SStepInfoEx
{
public int id;
public double time;
public double timeAcq;
public int step;
public string name;
public string description;
}
}

42
Global/SViper405Data.cs Normal file
View File

@ -0,0 +1,42 @@
// Decompiled with JetBrains decompiler
// Type: Global.SViper405Data
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Collections.Generic;
namespace Global
{
public class SViper405Data
{
private static int SerialCount;
private int SerialNum = SViper405Data.SerialCount++;
public object tag;
public int IdxRing;
public int IdxWafer;
public float arixOffset;
public int[] SubsetIndex = new int[3]{ -1, -1, -1 };
public List<float> time;
public List<float> temperature;
public SViper405Data(int ring, int wafer)
{
this.IdxRing = ring;
this.IdxWafer = wafer;
}
public void Query()
{
this.time = new List<float>();
this.temperature = new List<float>();
}
public void Clear()
{
this.time.Clear();
this.temperature.Clear();
}
}
}

48
Global/SWaferData.cs Normal file
View File

@ -0,0 +1,48 @@
// Decompiled with JetBrains decompiler
// Type: Global.SWaferData
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Collections.Generic;
namespace Global
{
public class SWaferData
{
private static int SerialCount;
private int SerialNum = SWaferData.SerialCount++;
public object tag;
public int IdxRing;
public int IdxWafer;
public float arixOffset;
public int[] SubsetIndex = new int[3]{ -1, -1, -1 };
public List<float> time;
public List<float> ref405;
public List<float> ref940;
public List<float> temperature;
public SWaferData(int ring, int wafer)
{
this.IdxRing = ring;
this.IdxWafer = wafer;
}
public void Query()
{
this.time = new List<float>();
this.ref405 = new List<float>();
this.ref940 = new List<float>();
this.temperature = new List<float>();
}
public void Clear()
{
this.time.Clear();
this.ref405.Clear();
this.ref940.Clear();
this.temperature.Clear();
}
}
}

108
Global/SWaferDataC.cs Normal file
View File

@ -0,0 +1,108 @@
// Decompiled with JetBrains decompiler
// Type: Global.SWaferDataC
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Collections.Generic;
namespace Global
{
public class SWaferDataC
{
private static int SerialCount;
private int SerialNum = SWaferDataC.SerialCount++;
public object tag;
public ETypeCurvature type;
public int IdxRing;
public int IdxWafer;
public float arixOffset;
public int[] SubsetIndex = new int[9]
{
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1
};
public List<float> time;
public List<float> v1;
public List<float> v2;
public List<float> v3;
public List<float> v4;
public List<float> v5;
public List<float> h1;
public List<float> h2;
public List<float> h3;
public List<float> h4;
public List<float> k1;
public List<float> k2;
public List<float> k3;
public List<float> k4;
public List<float> k5;
public List<float> b1;
public List<float> b2;
public List<float> b3;
public List<float> b4;
public List<float> b5;
public SWaferDataC(int ring, int wafer)
{
this.IdxRing = ring;
this.IdxWafer = wafer;
}
public void Query()
{
this.time = new List<float>();
this.v1 = new List<float>();
this.v2 = new List<float>();
this.v3 = new List<float>();
this.v4 = new List<float>();
this.v5 = new List<float>();
this.h1 = new List<float>();
this.h2 = new List<float>();
this.h3 = new List<float>();
this.h4 = new List<float>();
this.k1 = new List<float>();
this.k2 = new List<float>();
this.k3 = new List<float>();
this.k4 = new List<float>();
this.k5 = new List<float>();
this.b1 = new List<float>();
this.b2 = new List<float>();
this.b3 = new List<float>();
this.b4 = new List<float>();
this.b5 = new List<float>();
}
public void Clear()
{
this.time.Clear();
this.v1.Clear();
this.v2.Clear();
this.v3.Clear();
this.v4.Clear();
this.v5.Clear();
this.h1.Clear();
this.h2.Clear();
this.h3.Clear();
this.h4.Clear();
this.k1.Clear();
this.k2.Clear();
this.k3.Clear();
this.k4.Clear();
this.k5.Clear();
this.b1.Clear();
this.b2.Clear();
this.b3.Clear();
this.b4.Clear();
this.b5.Clear();
}
}
}

29
Global/SaveIndex.cs Normal file
View File

@ -0,0 +1,29 @@
// Decompiled with JetBrains decompiler
// Type: Global.SaveIndex
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum SaveIndex
{
Wave405Reflect,
Wave940Reflect,
Wave1050Reflect,
DarkTemperature,
SurfaceTemperature,
Wave405Emit,
Wave940Emit,
Wave1050Emit,
Wave405ON,
Wave940ON,
Wave1050ON,
Wave405OFF,
Wave940OFF,
Wave1050OFF,
SegmentDarkTemp,
PyroTemp,
}
}

View File

@ -0,0 +1,22 @@
// Decompiled with JetBrains decompiler
// Type: Global.ScanPyroControlData
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Runtime.InteropServices;
namespace Global
{
public struct ScanPyroControlData
{
public bool Start;
public bool Stop;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
public char[] StartParam1;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
public char[] StartParam2;
public double IssuedTime;
}
}

45
Global/SingleValue.cs Normal file
View File

@ -0,0 +1,45 @@
// Decompiled with JetBrains decompiler
// Type: Global.SingleValue
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Collections.Generic;
namespace Global
{
public class SingleValue
{
public static int TriggleMaxCount = 180000;
public static int TriggleMiniCount = 500;
public static int TriggleHighValue = 48000;
public static int TriggleLowValue = 45000;
public static int MidCacheMaxCount = 180000;
public static int[] GetTrigglePoint(ushort[] buf, int MaxCount)
{
List<int> intList = new List<int>();
int num = 0;
bool flag = false;
for (int index = 0; index < buf.Length; ++index)
{
if (flag)
{
if ((int) buf[index] > SingleValue.TriggleHighValue)
{
intList.Add(index);
++num;
if (num < MaxCount)
flag = false;
else
break;
}
}
else if ((int) buf[index] < SingleValue.TriggleLowValue)
flag = true;
}
return intList.ToArray();
}
}
}

18
Global/SubtrateType.cs Normal file
View File

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Global.SubtrateType
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum SubtrateType
{
Sapphire,
PSS,
Silicon,
SiC,
Dummy,
}
}

23
Global/SwCtrl.cs Normal file
View File

@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Global.SwCtrl
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum SwCtrl
{
sw405,
sw940,
sw1050,
swDynamic,
swShutter,
swLaser,
swCDynamic,
swPowRate,
swPowRate2,
swTEC,
}
}

33
Global/SystemParameter.cs Normal file
View File

@ -0,0 +1,33 @@
// Decompiled with JetBrains decompiler
// Type: Global.SystemParameter
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System.Runtime.InteropServices;
namespace Global
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SystemParameter
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string RUNID;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string SUSID;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string RESERVED;
public int STEPID;
public bool SUSCEPTOR_BROKEN;
public SystemParameter(bool IsCreate)
{
this.RUNID = "";
this.SUSID = "";
this.RESERVED = "";
this.STEPID = -1;
this.SUSCEPTOR_BROKEN = false;
}
}
}

19
Global/TableHead.cs Normal file
View File

@ -0,0 +1,19 @@
// Decompiled with JetBrains decompiler
// Type: Global.TableHead
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct TableHead
{
public string Susceptortype;
public string Sapphiretype;
public string PSStype;
public string Dummytype;
public string Silicontype;
public string SiCtype;
}
}

19
Global/TempData.cs Normal file
View File

@ -0,0 +1,19 @@
// Decompiled with JetBrains decompiler
// Type: Global.TempData
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct TempData
{
public double DateTime;
public double Temperature;
public double Para1;
public double Para2;
public double Para3;
public double Para4;
}
}

16
Global/TempStatus.cs Normal file
View File

@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Global.TempStatus
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum TempStatus
{
LowTemp,
RegionTemp,
HighTemp,
}
}

16
Global/ThreadCtrlSet.cs Normal file
View File

@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Global.ThreadCtrlSet
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public class ThreadCtrlSet
{
public const int FreeLoopTime = 100;
public const int MiniLoopTime = 1;
public const int WaitLoopTime = 20;
}
}

18
Global/VarType.cs Normal file
View File

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Global.VarType
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum VarType
{
R405,
R940,
R1050,
Temp,
SurfaceTemp,
}
}

17
Global/Viper405Data.cs Normal file
View File

@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: Global.Viper405Data
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct Viper405Data
{
public double DateTime;
public long Tick;
public bool IsConnected;
public double Temperature;
}
}

28
Global/WaferInfo.cs Normal file
View File

@ -0,0 +1,28 @@
// Decompiled with JetBrains decompiler
// Type: Global.WaferInfo
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public class WaferInfo
{
public int num;
public string name;
public int[] pCheckBorder;
public float left;
public float right;
public string type;
public string substrate;
public string polish;
public string zone;
public bool tsFlag;
public bool twFlag;
public EWaferStyle status;
public float ReviseFactor405 = 1f;
public float ReviseFactor940 = 1f;
public bool IsAvgFake;
}
}

View File

@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: Global.WaferInfoDisplay
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct WaferInfoDisplay
{
public float time;
public float reflect405;
public float reflect940;
public float darkTemperature;
}
}

38
Global/WaferInfoOnce.cs Normal file
View File

@ -0,0 +1,38 @@
// Decompiled with JetBrains decompiler
// Type: Global.WaferInfoOnce
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public class WaferInfoOnce
{
public int num;
public float time;
public double acqTime;
public float reflect405;
public float reflect940;
public float reflect1050;
public float ref405;
public float ref940;
public float darkTemperature;
public float surfaceTemperature;
public float detreflect405;
public float detreflect940;
public float detreflect1050;
public float detDarkTemperature;
public float detSurfaceTemperature;
public float em405;
public float em940;
public float em1050;
public float circleOn405;
public float circleOn940;
public float circleOn1050;
public float circleOff405;
public float circleOff940;
public float circleOff1050;
public string absTime;
}
}

23
Global/WaferIniVar.cs Normal file
View File

@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Global.WaferIniVar
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public enum WaferIniVar
{
num,
type,
substrate,
polish,
zone,
begin,
end,
include,
offset,
analysis,
}
}

43
Global/WaferSimpleInfo.cs Normal file
View File

@ -0,0 +1,43 @@
// Decompiled with JetBrains decompiler
// Type: Global.WaferSimpleInfo
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct WaferSimpleInfo
{
public float time;
public float reflect405;
public float reflect940;
public float reflect1050;
public float darkTemperature;
public float surfaceTemperature;
public float rotation;
public string absTime;
public WaferSimpleInfo(WaferInfoOnce once)
{
this.rotation = 0.0f;
this.time = once.time;
this.reflect405 = once.reflect405;
this.reflect940 = once.reflect940;
this.reflect1050 = once.reflect1050;
this.darkTemperature = once.darkTemperature;
this.surfaceTemperature = once.surfaceTemperature;
this.absTime = "N/A";
}
public void SetValue(WaferInfoOnce once)
{
this.time = once.time;
this.reflect405 = once.reflect405;
this.reflect940 = once.reflect940;
this.reflect1050 = once.reflect1050;
this.darkTemperature = once.darkTemperature;
this.surfaceTemperature = once.surfaceTemperature;
}
}
}

View File

@ -0,0 +1,21 @@
// Decompiled with JetBrains decompiler
// Type: Global.WaferTemperatureInfo
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
namespace Global
{
public struct WaferTemperatureInfo
{
public float time;
public float reflect405;
public float reflect940;
public float darkTmpValue;
public float rotation;
public float K;
public float Ar;
public string absTime;
}
}

61
Global/WinApi.cs Normal file
View File

@ -0,0 +1,61 @@
// Decompiled with JetBrains decompiler
// Type: Global.WinApi
// Assembly: Global, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: C0AE7A64-EC5F-4076-AA61-B93AC1193B2E
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Global.dll
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Global
{
public class WinApi
{
public const int SW_HIDE = 0;
public const int SW_SHOWNOACTIVATE = 4;
public const int SW_SHOW = 5;
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")]
public static extern bool ShowCursor(bool bShow);
[DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr MemCopyArray(byte[] dest, byte[] src, int count);
[DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr MemCopyPoint(IntPtr dest, IntPtr src, int count);
[DllImport("user32.dll")]
public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint control, char vk);
[DllImport("user32.dll")]
public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
[DllImport("kernel32")]
public static extern int GetPrivateProfileInt(
string lpAppName,
string lpKeyName,
int nDefault,
string lpFileName);
[DllImport("kernel32")]
public static extern int GetPrivateProfileString(
string lpAppName,
string lpKeyName,
string lpDefault,
StringBuilder lpReturnedString,
int nSize,
string lpFileName);
[DllImport("kernel32")]
public static extern bool WritePrivateProfileString(
string lpAppName,
string lpKeyName,
string lpString,
string lpFileName);
}
}

View File

@ -0,0 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("RTSimulator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RTSimulator")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1c6b8fd1-1187-4e97-a3e9-ccfc6515bc5d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]

23
RTSimulator/Program.cs Normal file
View File

@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: RTSimulator.Program
// Assembly: RTSimulator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 25BC894F-7E86-47F2-957C-469038C33BC9
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\RTSimulator.exe
using System;
using System.Windows.Forms;
#nullable disable
namespace RTSimulator
{
internal static class Program
{
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run((Form) new Simulator());
}
}
}

View File

@ -0,0 +1,47 @@
// Decompiled with JetBrains decompiler
// Type: RTSimulator.Properties.Resources
// Assembly: RTSimulator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 25BC894F-7E86-47F2-957C-469038C33BC9
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\RTSimulator.exe
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
#nullable disable
namespace RTSimulator.Properties
{
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[DebuggerNonUserCode]
[CompilerGenerated]
internal class Resources
{
private static ResourceManager resourceMan;
private static CultureInfo resourceCulture;
internal Resources()
{
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager
{
get
{
if (RTSimulator.Properties.Resources.resourceMan == null)
RTSimulator.Properties.Resources.resourceMan = new ResourceManager("RTSimulator.Properties.Resources", typeof (RTSimulator.Properties.Resources).Assembly);
return RTSimulator.Properties.Resources.resourceMan;
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture
{
get => RTSimulator.Properties.Resources.resourceCulture;
set => RTSimulator.Properties.Resources.resourceCulture = value;
}
}
}

View File

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

View File

@ -0,0 +1,22 @@
// Decompiled with JetBrains decompiler
// Type: RTSimulator.Properties.Settings
// Assembly: RTSimulator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 25BC894F-7E86-47F2-957C-469038C33BC9
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\RTSimulator.exe
using System.CodeDom.Compiler;
using System.Configuration;
using System.Runtime.CompilerServices;
#nullable disable
namespace RTSimulator.Properties
{
[CompilerGenerated]
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed class Settings : ApplicationSettingsBase
{
private static Settings defaultInstance = (Settings) SettingsBase.Synchronized((SettingsBase) new Settings());
public static Settings Default => Settings.defaultInstance;
}
}

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Project was exported from assembly: C:\Users\auvkk\Desktop\x64SimIR2\RTSimulator.exe-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1520F65D-EFA5-42E6-A116-BCE97D57E84A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AssemblyName>RTSimulator</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<FileAlignment>512</FileAlignment>
<RootNamespace>RTSimulator</RootNamespace>
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="EthernetVenderConnector">
<HintPath>lib\EthernetVenderConnector.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="Simulator.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\Resources.cs" />
<Compile Include="Properties\Settings.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx" />
<EmbeddedResource Include="Simulator.resx" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RTSimulator", "RTSimulator.csproj", "{1520F65D-EFA5-42E6-A116-BCE97D57E84A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1520F65D-EFA5-42E6-A116-BCE97D57E84A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1520F65D-EFA5-42E6-A116-BCE97D57E84A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1520F65D-EFA5-42E6-A116-BCE97D57E84A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1520F65D-EFA5-42E6-A116-BCE97D57E84A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

154
RTSimulator/Simulator.cs Normal file
View File

@ -0,0 +1,154 @@
// Decompiled with JetBrains decompiler
// Type: RTSimulator.Simulator
// Assembly: RTSimulator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 25BC894F-7E86-47F2-957C-469038C33BC9
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\RTSimulator.exe
using EthernetVenderConnector;
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
#nullable disable
namespace RTSimulator
{
public class Simulator : Form
{
private SicGen3 server = new SicGen3();
private IContainer components;
private TextBox TxtLogs;
private CheckBox CkbStopCollecting;
private TextBox textBox1;
private Label label1;
private Button button1;
public Simulator() => this.InitializeComponent();
private void Form1_Load(object sender, EventArgs e)
{
this.server.Start();
this.server.StartSendingRandomData();
TextBox txtLogs = this.TxtLogs;
txtLogs.Text = txtLogs.Text + "Started" + Environment.NewLine;
this.server.CommandRecieved += new SicGen3.CommandHandler(this.Server_CommandRecieved);
this.server.WaferTablePath = Path.Combine(Application.StartupPath, "waferTable");
}
private void Server_CommandRecieved(object sender, ControlCommandEventArgs e)
{
this.TxtLogs.Invoke((Delegate) (() => this.TxtLogs.Text += string.Format("CMD: {0}{1}", (object) e.Command, (object) Environment.NewLine)));
string[] strArray = e.Command.Split(',');
switch (strArray.Length)
{
case 1:
if (e.Type == ControlCommandEventArgs.ControlCommandType.Stop)
{
this.server.StopRandomData = true;
break;
}
if (e.Type != ControlCommandEventArgs.ControlCommandType.Start)
break;
this.server.StopRandomData = false;
break;
case 2:
try
{
this.server.GateTimeForRandomData = int.Parse(strArray[1]);
break;
}
catch
{
break;
}
}
}
private void Simulator_FormClosing(object sender, FormClosingEventArgs e)
{
this.server.Close();
}
private void CkbStopCollecting_CheckedChanged(object sender, EventArgs e)
{
this.server.StopRandomData = this.CkbStopCollecting.Checked;
}
private void button1_Click(object sender, EventArgs e)
{
try
{
this.server.IncreamentalSeed = float.Parse(this.textBox1.Text) / 10f;
}
catch (Exception ex)
{
int num = (int) MessageBox.Show(ex.Message);
}
}
protected override void Dispose(bool disposing)
{
if (disposing && this.components != null)
this.components.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.TxtLogs = new TextBox();
this.CkbStopCollecting = new CheckBox();
this.textBox1 = new TextBox();
this.label1 = new Label();
this.button1 = new Button();
this.SuspendLayout();
this.TxtLogs.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
this.TxtLogs.Location = new Point(266, 3);
this.TxtLogs.Multiline = true;
this.TxtLogs.Name = "TxtLogs";
this.TxtLogs.Size = new Size(444, 452);
this.TxtLogs.TabIndex = 0;
this.CkbStopCollecting.AutoSize = true;
this.CkbStopCollecting.Location = new Point(13, 13);
this.CkbStopCollecting.Name = "CkbStopCollecting";
this.CkbStopCollecting.Size = new Size(84, 16);
this.CkbStopCollecting.TabIndex = 1;
this.CkbStopCollecting.Text = "假装掉采集";
this.CkbStopCollecting.UseVisualStyleBackColor = true;
this.CkbStopCollecting.Visible = false;
this.CkbStopCollecting.CheckedChanged += new EventHandler(this.CkbStopCollecting_CheckedChanged);
this.textBox1.Location = new Point(10, 82);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new Size(100, 21);
this.textBox1.TabIndex = 2;
this.textBox1.Text = "0.01";
this.label1.AutoSize = true;
this.label1.Location = new Point(8, 67);
this.label1.Name = "label1";
this.label1.Size = new Size(197, 12);
this.label1.TabIndex = 3;
this.label1.Text = "Temperature Increment per second";
this.button1.Location = new Point(116, 82);
this.button1.Name = "button1";
this.button1.Size = new Size(56, 23);
this.button1.TabIndex = 4;
this.button1.Text = "Set";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new EventHandler(this.button1_Click);
this.AutoScaleDimensions = new SizeF(6f, 12f);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(722, 459);
this.Controls.Add((Control) this.button1);
this.Controls.Add((Control) this.label1);
this.Controls.Add((Control) this.textBox1);
this.Controls.Add((Control) this.CkbStopCollecting);
this.Controls.Add((Control) this.TxtLogs);
this.Name = nameof (Simulator);
this.Text = "Fake ViperRT";
this.FormClosing += new FormClosingEventHandler(this.Simulator_FormClosing);
this.Load += new EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
}
}

120
RTSimulator/Simulator.resx Normal file
View File

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

3
RTSimulator/app.config Normal file
View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>

Binary file not shown.

View File

@ -0,0 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("SessionLayer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SessionLayer")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c7a3b5b3-96f0-47ad-95dc-20e116584dee")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]

155
SessionLayer/Net.cs Normal file
View File

@ -0,0 +1,155 @@
// Decompiled with JetBrains decompiler
// Type: SessionLayer.Net
// Assembly: SessionLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A69B8FDB-E5A9-48F4-BD42-584EBC88801C
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\SessionLayer.dll
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace SessionLayer
{
public sealed class Net
{
private Net()
{
}
private static void Log(Exception e)
{
}
public static Socket ConnectServer(string ip, int port)
{
Socket socket = (Socket) null;
try
{
IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(ip), port);
socket = new Socket(remoteEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
socket.Connect((EndPoint) remoteEP);
if (!socket.Connected)
socket = (Socket) null;
}
catch (Exception ex)
{
SessionLayer.Net.Log(ex);
}
return socket;
}
public static Socket ConnectServByHostName(string hostName, int port)
{
Socket socket1 = (Socket) null;
try
{
foreach (IPAddress address in Dns.GetHostEntry(hostName).AddressList)
{
IPEndPoint remoteEP = new IPEndPoint(address, port);
Socket socket2 = new Socket(remoteEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
socket2.Connect((EndPoint) remoteEP);
if (socket2.Connected)
{
socket1 = socket2;
break;
}
}
}
catch (Exception ex)
{
SessionLayer.Net.Log(ex);
}
return socket1;
}
public static int SendData(Socket socket, byte[] buffer, int outTime)
{
if (socket == null || !socket.Connected)
throw new ArgumentException("参数socket 为null或者未连接到远程计算机");
if (buffer == null || buffer.Length == 0)
throw new ArgumentException("参数buffer 为null ,或者长度为 0");
int num;
try
{
int length = buffer.Length;
int offset = 0;
while (socket.Poll(outTime * 1000000, SelectMode.SelectWrite))
{
offset = socket.Send(buffer, offset, length, SocketFlags.None);
length -= offset;
if (length == 0)
{
num = 0;
goto label_13;
}
else if (offset <= 0)
{
num = -2;
goto label_13;
}
}
num = -1;
}
catch (SocketException ex)
{
SessionLayer.Net.Log((Exception) ex);
num = -3;
}
label_13:
return num;
}
public static int SendData(Socket socket, string buffer, int outTime)
{
if (buffer == null || buffer.Length == 0)
throw new ArgumentException("待发送的字符串长度不能为零.");
return SessionLayer.Net.SendData(socket, Encoding.Default.GetBytes(buffer), outTime);
}
public static int RecvData(Socket socket, byte[] buffer, int outTime)
{
if (socket == null || !socket.Connected)
throw new ArgumentException("参数socket 为null或者未连接到远程计算机");
if (buffer == null || buffer.Length == 0)
throw new ArgumentException("参数buffer 为null ,或者长度为 0");
buffer.Initialize();
int length = buffer.Length;
int offset = 0;
int num;
try
{
while (socket.Poll(outTime * 1000000, SelectMode.SelectRead))
{
offset = socket.Receive(buffer, offset, length, SocketFlags.None);
length -= offset;
if (length == 0)
{
num = 0;
goto label_12;
}
else if (offset <= 0)
{
num = -2;
goto label_12;
}
}
num = -1;
}
catch (SocketException ex)
{
SessionLayer.Net.Log((Exception) ex);
num = -3;
}
label_12:
return num;
}
public static int RecvData(Socket socket, string buffer, int bufferLen, int outTime)
{
if (bufferLen <= 0)
throw new ArgumentException("存储待接收数据的缓冲区长度必须大于0");
return -1;
}
}
}

140
SessionLayer/Service.cs Normal file
View File

@ -0,0 +1,140 @@
// Decompiled with JetBrains decompiler
// Type: SessionLayer.Service
// Assembly: SessionLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A69B8FDB-E5A9-48F4-BD42-584EBC88801C
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\SessionLayer.dll
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace SessionLayer
{
public class Service
{
private List<Session> lsSession = new List<Session>();
private int maxSesson;
private Thread TDListen;
private bool FlagExit;
private string TagIP;
private int TagPort;
private Socket Skt;
private int SeralsNum = 10000;
public event ServiceEvent.MsgHook RecvMsg;
public event ServiceEvent.FuncConnect AfterConnect;
public event ServiceEvent.FuncConnect DisConnect;
public int SessionCount => this.lsSession.Count;
public int MaximumSessionCount
{
get => this.maxSesson;
set
{
if (value < 1)
this.maxSesson = 1;
else
this.maxSesson = value;
}
}
public Service() => this.AfterConnect += new ServiceEvent.FuncConnect(this.AcceptResult);
~Service()
{
}
public bool CreateService(string ip, int port)
{
this.TagIP = ip;
this.TagPort = port;
IPEndPoint localEP = new IPEndPoint(IPAddress.Parse(this.TagIP), this.TagPort);
this.Skt = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
this.Skt.Bind((EndPoint) localEP);
this.Skt.Listen(20);
this.FlagExit = false;
this.TDListen = new Thread(new ThreadStart(this.ListenThread));
this.TDListen.Name = "Service: " + ip + " : " + port.ToString();
this.TDListen.Start();
return true;
}
public void Close()
{
this.FlagExit = true;
for (int index = 0; index < this.lsSession.Count; ++index)
this.lsSession[index].UnLink();
this.Skt.Dispose();
}
private void ListenThread()
{
while (!this.FlagExit)
{
try
{
Session session = new Session();
if (!session.Query(this.SeralsNum++))
break;
session.DisConnected += new SessionEvent.FuncConnect(this.s_DisConnected);
session.MsgRecv += new SessionEvent.MsgHook(this.s_MsgRecv);
session.Listen(this.Skt);
if (this.lsSession.Count < this.maxSesson)
{
if (session.IsConnected)
this.lsSession.Add(session);
if (this.AfterConnect != null)
this.AfterConnect(session.ID, session.IsConnected);
}
else
session.UnLink();
}
catch (Exception ex)
{
Thread.Sleep(100);
}
}
}
private void AcceptResult(int id, bool IsSuccess)
{
}
private void s_DisConnected(int ID, bool IsResult)
{
this.DisConnect(ID, IsResult);
Session sessionById = this.FindSessionByID(ID);
if (sessionById == null)
return;
sessionById.UnLink();
this.lsSession.Remove(sessionById);
}
private void s_MsgRecv(int id, byte[] buf) => this.RecvMsg(id, buf);
private Session FindSessionByID(int id)
{
try
{
return this.lsSession.Find((Predicate<Session>) (Session => Session.ID == id));
}
catch (Exception ex)
{
return (Session) null;
}
}
public void SendMsg(int id, byte[] data, int len) => this.FindSessionByID(id)?.Send(data, len);
public void SendMsg(byte[] data, int len)
{
foreach (Session session in this.lsSession)
session.Send(data, len);
}
}
}

View File

@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: SessionLayer.ServiceEvent
// Assembly: SessionLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A69B8FDB-E5A9-48F4-BD42-584EBC88801C
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\SessionLayer.dll
namespace SessionLayer
{
public class ServiceEvent
{
public delegate void CallBackFunc();
public delegate void FuncConnect(int id, bool IsSuccess);
public delegate void MsgHook(int id, byte[] buf);
}
}

306
SessionLayer/Session.cs Normal file
View File

@ -0,0 +1,306 @@
// Decompiled with JetBrains decompiler
// Type: SessionLayer.Session
// Assembly: SessionLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A69B8FDB-E5A9-48F4-BD42-584EBC88801C
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\SessionLayer.dll
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Tools;
namespace SessionLayer
{
public class Session
{
public int ID;
private Socket Skt;
private IPEndPoint Target;
public bool IsConnected;
private bool IsSetOn;
public string LastError = "";
private string TagIP;
private int TagPort;
private Thread TDLink;
private Mutex Lock = new Mutex();
private SyncByteList lsSend = new SyncByteList();
private SyncByteList lsRecv = new SyncByteList();
private Thread ThreadTS;
private Thread ThreadTR;
private int FailedCnt;
private const int FailedValue = 10;
public event SessionEvent.CallBackFunc BeforeConnect;
public event SessionEvent.FuncConnect AfterConnect;
public event SessionEvent.FuncConnect DisConnected;
public event SessionEvent.MsgHook MsgRecv;
public Session()
{
this.ID = 0;
this.BeforeConnect += new SessionEvent.CallBackFunc(this.Session_BeforeConnect);
this.AfterConnect += new SessionEvent.FuncConnect(this.Session_AfterConnect);
this.DisConnected += new SessionEvent.FuncConnect(this.Session_DisConnected);
}
~Session() => this.IsSetOn = false;
private void Session_BeforeConnect() => this.CreateSocket();
private void Session_AfterConnect(int ID, bool IsSuccess)
{
if (!IsSuccess)
return;
if (this.ThreadTS == null)
{
this.ThreadTS = new Thread(new ThreadStart(this.ThreadSend));
this.ThreadTS.Name = "Session TS - " + ID.ToString("0000");
this.ThreadTS.Start();
}
if (this.ThreadTR == null)
{
this.ThreadTR = new Thread(new ThreadStart(this.ThreadRecv));
this.ThreadTR.Name = "Session TR - " + ID.ToString("0000");
this.ThreadTR.Start();
}
this.lsRecv.Clear();
this.lsSend.Clear();
}
private void Session_DisConnected(int ID, bool IsUser)
{
}
private bool CreateSocket()
{
try
{
this.Target = new IPEndPoint(IPAddress.Parse(this.TagIP), this.TagPort);
this.Skt = new Socket(this.Target.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
this.Skt.SendTimeout = 5000;
}
catch (Exception ex)
{
this.LastError = ex.Message;
return false;
}
return true;
}
public bool Query(string ip, int port)
{
try
{
this.Lock.WaitOne();
this.TagIP = ip;
this.TagPort = port;
return this.CreateSocket();
}
catch (Exception ex)
{
this.Skt = (Socket) null;
this.LastError = ex.Message;
}
finally
{
this.Lock.ReleaseMutex();
}
return false;
}
public bool Query(int id)
{
this.ID = id;
return true;
}
public bool Link()
{
if (this.Skt == null)
return false;
this.IsSetOn = true;
try
{
this.Lock.WaitOne();
if (this.BeforeConnect != null)
this.BeforeConnect();
this.Skt.Connect((EndPoint) this.Target);
this.IsConnected = this.Skt.Connected;
if (this.AfterConnect != null)
this.AfterConnect(this.ID, this.IsConnected);
}
catch (Exception ex)
{
this.LastError = ex.Message;
this.IsConnected = false;
return false;
}
finally
{
this.Lock.ReleaseMutex();
}
return true;
}
public void UnLink()
{
if (this.Skt == null)
return;
this.IsSetOn = false;
try
{
this.Lock.WaitOne();
this.Skt.Disconnect(false);
this.Skt.Close();
this.IsConnected = this.Skt.Connected;
}
catch (Exception ex)
{
this.LastError = ex.Message;
this.IsConnected = false;
}
finally
{
this.Lock.ReleaseMutex();
}
}
public void LinkAuto()
{
this.IsSetOn = true;
this.Lock.WaitOne();
if (this.TDLink != null)
this.TDLink.Abort();
this.Lock.ReleaseMutex();
this.TDLink = new Thread(new ThreadStart(this.ThreadKeepConnect));
this.TDLink.Name = "Session ThreadKeepConnect";
this.TDLink.Start();
}
public bool Listen(Socket s)
{
try
{
s.Listen(0);
this.Skt = s.Accept();
this.Skt.SendTimeout = 5000;
this.IsSetOn = this.Skt.Connected;
this.IsConnected = this.Skt.Connected;
if (this.AfterConnect != null)
this.AfterConnect(this.ID, true);
}
catch (Exception ex)
{
return false;
}
return true;
}
private void ThreadKeepConnect()
{
if (this.Skt == null)
{
this.LastError = "Null Target";
}
else
{
while (this.IsSetOn)
{
if (!this.IsConnected)
this.Link();
Thread.Sleep(200);
}
}
}
public void Send(byte[] buf, int len)
{
byte[] numArray = new byte[len];
Array.Copy((Array) buf, 0, (Array) numArray, 0, len);
this.lsSend.Push(numArray);
}
private void ThreadSend()
{
while (this.IsSetOn)
{
try
{
if (!this.IsConnected)
{
if (this.lsSend.Length > 100)
this.lsSend.Read();
Thread.Sleep(300);
}
else
{
byte[] buffer = this.lsSend.Read();
if (buffer != null)
{
if (this.Skt.Send(buffer) != buffer.Length)
this.IsConnected = false;
}
else
Thread.Sleep(20);
}
}
catch (Exception ex)
{
this.LastError = ex.Message;
this.IsConnected = false;
if (this.DisConnected != null)
this.DisConnected(this.ID, this.IsSetOn);
}
}
}
private void ThreadRecv()
{
while (this.IsSetOn)
{
if (!this.IsConnected)
{
Thread.Sleep(100);
}
else
{
try
{
byte[] numArray1 = new byte[2048];
int length = this.Skt.Receive(numArray1);
if (length > 0 && this.MsgRecv != null)
{
byte[] numArray2 = new byte[length];
Array.Copy((Array) numArray1, 0, (Array) numArray2, 0, length);
this.MsgRecv(this.ID, numArray2);
}
else
{
this.IsConnected = this.Skt.Connected;
if (this.FailedCnt++ > 10)
{
this.FailedCnt = 0;
this.IsConnected = false;
if (this.DisConnected != null)
this.DisConnected(this.ID, this.IsSetOn);
}
else
Thread.Sleep(20);
}
}
catch (Exception ex)
{
this.IsConnected = false;
this.LastError = ex.Message;
if (this.DisConnected != null)
this.DisConnected(this.ID, this.IsSetOn);
}
}
}
}
}
}

View File

@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: SessionLayer.SessionEvent
// Assembly: SessionLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A69B8FDB-E5A9-48F4-BD42-584EBC88801C
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\SessionLayer.dll
namespace SessionLayer
{
public class SessionEvent
{
public delegate void CallBackFunc();
public delegate void FuncConnect(int id, bool IsSuccess);
public delegate void MsgHook(int id, byte[] buf);
}
}

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--Project was exported from assembly: C:\Users\auvkk\Desktop\x64SimIR2\SessionLayer.dll-->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{49C427D9-A0F3-4259-8893-A8E0D74E6377}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>SessionLayer</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<FileAlignment>512</FileAlignment>
<RootNamespace>SessionLayer</RootNamespace>
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Net.cs" />
<Compile Include="ServiceEvent.cs" />
<Compile Include="Service.cs" />
<Compile Include="SessionEvent.cs" />
<Compile Include="Session.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tools\Tools.csproj">
<Project>{8809ecce-a9fa-4fc1-817f-25d9653b0135}</Project>
<Name>Tools</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

BIN
SessionLayer/lib/Tools.dll Normal file

Binary file not shown.

14
Tools/AssemblyInfo.cs Normal file
View File

@ -0,0 +1,14 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Tools")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("微软中国")]
[assembly: AssemblyProduct("Tools")]
[assembly: AssemblyCopyright("Copyright © 微软中国 2013")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ad401734-f464-432e-9a01-3cad23d2a2a4")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]

161
Tools/Logger.cs Normal file
View File

@ -0,0 +1,161 @@
// Decompiled with JetBrains decompiler
// Type: Tools.Logger
// Assembly: Tools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 93955884-A48B-48F7-87CC-8A20107200CE
// Assembly location: C:\Users\auvkk\Desktop\x64SimIR2\Tools.dll
using System;
using System.Data.SqlClient;
using System.Diagnostics;
using System.IO;
namespace Tools
{
public sealed class Logger
{
private const string trace_message = "\r\n<-----------------------------------------------RT Plus 4.0 LOG SYSTEM----------------------------------------------->\r\n";
private const string trace_sql = "\r\n***********************TRACE_SQL {0}*****************************\r\nTRACE_SQL";
private const string trace_exception = "\r\n***********************TRACE_EXCEPTION {0}***********************";
private static DateTime CurrentLogFileDate = DateTime.Now;
private static TextWriterTraceListener twtl;
private const string log_root_directory = "Log";
private static string log_subdir = "";
private const string FORMAT_TRACE_PARAM = " {0} = {1}";
private static readonly int flag = 2;
static Logger()
{
System.Diagnostics.Trace.AutoFlush = true;
switch (Logger.flag)
{
case 1:
System.Diagnostics.Trace.Listeners.Add((TraceListener) new ConsoleTraceListener());
break;
case 2:
System.Diagnostics.Trace.Listeners.Add((TraceListener) Logger.TWTL);
break;
case 3:
System.Diagnostics.Trace.Listeners.Add((TraceListener) new ConsoleTraceListener());
System.Diagnostics.Trace.Listeners.Add((TraceListener) Logger.TWTL);
break;
}
System.Diagnostics.Trace.WriteLine("\r\n<-----------------------------------------------RT Plus 4.0 LOG SYSTEM----------------------------------------------->\r\n");
}
public static void Trace(string str)
{
new Logger.AsyncLogMessage(Logger.BeginTraceMessage).BeginInvoke(str, (AsyncCallback) null, (object) null);
}
public static void Trace(Exception ex)
{
new Logger.AsyncLogException(Logger.BeginTraceError).BeginInvoke(ex, (AsyncCallback) null, (object) null);
}
public static void Trace(SqlCommand cmd)
{
new Logger.AsyncLogSqlCommand(Logger.BeginTraceSqlCommand).BeginInvoke(cmd, (AsyncCallback) null, (object) null);
}
public static void Trace(string sql, params SqlParameter[] parameter)
{
new Logger.AsyncLogSql(Logger.BeginTraceSql).BeginInvoke(sql, parameter, (AsyncCallback) null, (object) null);
}
private static void TraceAppInfo()
{
Process currentProcess = Process.GetCurrentProcess();
System.Diagnostics.Trace.WriteLine(DateTime.Now.ToString("HH:mm:ss\t") + "PrivateMemory: " + (currentProcess.WorkingSet64 / 1024L / 1024L).ToString() + "Mb\tResponding: " + currentProcess.Responding.ToString() + "\tThreads: " + currentProcess.Threads.Count.ToString());
}
private static void BeginTraceMessage(string msg)
{
if (msg == null)
return;
Logger.StrategyLog();
System.Diagnostics.Trace.WriteLine(DateTime.Now.ToString("HH:mm:ss\t") + msg);
Logger.TraceAppInfo();
}
private static void BeginTraceError(Exception ex)
{
if (ex == null)
return;
Logger.StrategyLog();
for (; ex != null; ex = ex.InnerException)
System.Diagnostics.Trace.WriteLine(DateTime.Now.ToString("HH:mm:ss\t") + string.Format("{0} {1}\r\n{2}\r\nSource:{3}", (object) ex.GetType().Name, (object) ex.Message, (object) ex.StackTrace, (object) ex.Source));
Logger.TraceAppInfo();
}
private static void BeginTraceSqlCommand(SqlCommand cmd)
{
if (cmd == null)
return;
SqlParameter[] array = new SqlParameter[cmd.Parameters.Count];
cmd.Parameters.CopyTo(array, 0);
Logger.BeginTraceSql(cmd.CommandText, array);
}
private static void BeginTraceSql(string sql, params SqlParameter[] parameter)
{
if (string.IsNullOrEmpty(sql))
return;
Logger.StrategyLog();
System.Diagnostics.Trace.WriteLine(sql, string.Format("\r\n***********************TRACE_SQL {0}*****************************\r\nTRACE_SQL", (object) DateTime.Now));
if (parameter == null)
return;
foreach (SqlParameter sqlParameter in parameter)
System.Diagnostics.Trace.WriteLine(string.Format(" {0} = {1}", (object) sqlParameter.ParameterName, sqlParameter.Value));
}
private static void StrategyLog()
{
DateTime now = DateTime.Now;
if (Logger.CurrentLogFileDate.Day == now.Day)
return;
Logger.CurrentLogFileDate = now;
Logger.twtl = (TextWriterTraceListener) null;
System.Diagnostics.Trace.Listeners.Clear();
System.Diagnostics.Trace.Listeners.Add((TraceListener) Logger.TWTL);
System.Diagnostics.Trace.WriteLine("\r\n<-----------------------------------------------RT Plus 4.0 LOG SYSTEM----------------------------------------------->\r\n");
}
private static void BuiderDir(DateTime currentDate)
{
string path = "Log";
if (Directory.Exists(path))
return;
Directory.CreateDirectory(path);
}
private static string GetLogFullPath
{
get => "Log" + (object) '\\' + Logger.CurrentLogFileDate.ToString("yyyy-MM-dd") + ".log";
}
private static TextWriterTraceListener TWTL
{
get
{
if (Logger.twtl == null)
{
if (string.IsNullOrEmpty(Logger.log_subdir))
Logger.BuiderDir(DateTime.Now);
else if (!Directory.Exists(Path.GetDirectoryName(Logger.GetLogFullPath)))
Logger.BuiderDir(DateTime.Now);
Logger.twtl = new TextWriterTraceListener(Logger.GetLogFullPath);
}
return Logger.twtl;
}
}
private delegate void AsyncLogMessage(string str);
private delegate void AsyncLogException(Exception ex);
private delegate void AsyncLogSqlCommand(SqlCommand cmd);
private delegate void AsyncLogSql(string sql, params SqlParameter[] parameter);
}
}

Some files were not shown because too many files have changed in this diff Show More