1 Commits
dev2 ... NET46

Author SHA1 Message Date
gongxh
5ca18b0b3f 修改 2022-03-17 16:34:28 +08:00
15 changed files with 240 additions and 69 deletions

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CleanMachineHMI.Domain</RootNamespace>
<AssemblyName>CleanMachineHMI.Domain</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />

View File

@@ -9,7 +9,7 @@
<add name="CleanMachineHMI.Properties.Settings.NX_CLEAR_MAC_20200915ConnectionString" connectionString="Data Source=.;Initial Catalog=NX_CLEAR_MAC_20200915;Persist Security Info=True;User ID=sa;Password=1q2w3e4r!@" providerName="System.Data.SqlClient"/>
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
<appSettings>

View File

@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>CleanMachineHMI</RootNamespace>
<AssemblyName>CleanMachineHMI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
@@ -122,10 +122,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\public\FastReport.Web.dll</HintPath>
</Reference>
<Reference Include="LEase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\public\LEase.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ReportViewer.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ReportingServices.ReportViewerControl.Winforms.140.1000.523\lib\net40\Microsoft.ReportViewer.Common.dll</HintPath>
</Reference>
@@ -144,10 +140,6 @@
<Reference Include="Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SqlServer.Types.14.0.314.76\lib\net40\Microsoft.SqlServer.Types.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.VisualBasic.PowerPacks">
<HintPath>..\public\Microsoft.VisualBasic.PowerPacks.dll</HintPath>
</Reference>
<Reference Include="NModbus4, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\public\NModbus4.dll</HintPath>
@@ -288,6 +280,7 @@
<Compile Include="FrmUserControl\Base\frmWarning.Designer.cs">
<DependentUpon>frmWarning.cs</DependentUpon>
</Compile>
<Compile Include="Utils\AnimateBase.cs" />
<Compile Include="Utils\GlobalHelper.cs" />
<Compile Include="Model\BasCleanTypeMsg.cs" />
<Compile Include="Model\BasPlcItemMd.cs" />
@@ -446,6 +439,8 @@
<Compile Include="frmMainNew.Designer.cs">
<DependentUpon>frmMainNew.cs</DependentUpon>
</Compile>
<Compile Include="Utils\LEaseMode.cs" />
<Compile Include="Utils\LEaseType.cs" />
<Compile Include="Utils\LEnum.cs" />
<Compile Include="Utils\LEventArgs.cs" />
<Compile Include="Utils\LSwitchButton.cs">

View File

@@ -68,8 +68,7 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonLabel9 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
this.swtbtn_brush2 = new CleanMachineHMI.LSwitchButton();
this.cbt_Brush2StatusTran = new CleanMachineHMI.CircleButton();
this.shapeContainer1 = new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
this.lineShape1 = new Microsoft.VisualBasic.PowerPacks.LineShape();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.kryptonGroupBox1 = new ComponentFactory.Krypton.Toolkit.KryptonGroupBox();
this.kryptonLabel13 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
@@ -515,7 +514,7 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonGroupBox7.Panel.Controls.Add(this.kryptonLabel9);
this.kryptonGroupBox7.Panel.Controls.Add(this.swtbtn_brush2);
this.kryptonGroupBox7.Panel.Controls.Add(this.cbt_Brush2StatusTran);
this.kryptonGroupBox7.Panel.Controls.Add(this.shapeContainer1);
this.kryptonGroupBox7.Size = new System.Drawing.Size(260, 338);
this.kryptonGroupBox7.TabIndex = 5;
this.kryptonGroupBox7.Values.Heading = "";
@@ -811,23 +810,10 @@ namespace CleanMachineHMI.FrmUserControl
this.cbt_Brush2StatusTran.UseVisualStyleBackColor = false;
//
// shapeContainer1
//
this.shapeContainer1.Location = new System.Drawing.Point(0, 0);
this.shapeContainer1.Margin = new System.Windows.Forms.Padding(0);
this.shapeContainer1.Name = "shapeContainer1";
this.shapeContainer1.Shapes.AddRange(new Microsoft.VisualBasic.PowerPacks.Shape[] {
this.lineShape1});
this.shapeContainer1.Size = new System.Drawing.Size(256, 334);
this.shapeContainer1.TabIndex = 45;
this.shapeContainer1.TabStop = false;
//
// lineShape1
//
this.lineShape1.Name = "lineShape1";
this.lineShape1.X1 = 20;
this.lineShape1.X2 = 235;
this.lineShape1.Y1 = 117;
this.lineShape1.Y2 = 117;
//
// tableLayoutPanel2
//
@@ -2915,8 +2901,7 @@ namespace CleanMachineHMI.FrmUserControl
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel9;
private LSwitchButton swtbtn_brush2;
private CircleButton cbt_Brush2StatusTran;
private Microsoft.VisualBasic.PowerPacks.ShapeContainer shapeContainer1;
private Microsoft.VisualBasic.PowerPacks.LineShape lineShape1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private ComponentFactory.Krypton.Toolkit.KryptonGroupBox kryptonGroupBox1;
private ComponentFactory.Krypton.Toolkit.KryptonComboBox kcmb_SheetType;

View File

@@ -1267,7 +1267,8 @@ namespace CleanMachineHMI.FrmUserControl
{
while (GlobalHelper.SysThIsRunFlag)
{
try
{
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacRunStatusNew", PlcItemTypeDesc.M)))
{
Invoke(new Action(() => { cbt_RunStatusTran.BackColor = Color.Lime; }));
@@ -1530,8 +1531,11 @@ namespace CleanMachineHMI.FrmUserControl
//autoCleanNum = 0;
}
FinishWorkingPallet();
}
catch
{
}
Thread.Sleep(200);
}
}

View File

@@ -19,7 +19,7 @@ namespace CleanMachineHMI.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {

View File

@@ -12,7 +12,7 @@ namespace CleanMachineHMI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

View File

@@ -0,0 +1,148 @@
// LEase.AnimateBase
using System;
using LEase;
public class AnimateBase
{
public static double Back(double x, LEaseMode easeMode)
{
switch (easeMode)
{
case LEaseMode.EaseIn:
return 2.70158 * x * x * x - 1.70158 * x * x;
case LEaseMode.EaseOut:
return 1.0 + 2.70158 * Math.Pow(x - 1.0, 3.0) + 1.70158 * Math.Pow(x - 1.0, 2.0);
case LEaseMode.EaseInOut:
return (x < 0.5) ? (Math.Pow(2.0 * x, 2.0) * (7.189819 * x - 2.5949095) / 2.0) : ((Math.Pow(2.0 * x - 2.0, 2.0) * (7.189819 * x - 4.5949095) + 2.0) / 2.0);
default:
return 0.0;
}
}
private static double BounceOut(double x)
{
if (x < 0.36363636363636365)
{
return 7.5625 * x * x;
}
if (x < 0.72727272727272729)
{
return 7.5625 * (x -= 0.54545454545454541) * x + 0.75;
}
if (x < 0.90909090909090906)
{
return 7.5625 * (x -= 0.81818181818181823) * x + 0.9375;
}
return 7.5625 * (x -= 21.0 / 22.0) * x + 63.0 / 64.0;
}
public static double Bounce(double x, LEaseMode easeMode)
{
switch (easeMode)
{
case LEaseMode.EaseIn:
return 1.0 - BounceOut(1.0 - x);
case LEaseMode.EaseOut:
return BounceOut(x);
case LEaseMode.EaseInOut:
return (x < 0.5) ? ((1.0 - BounceOut(1.0 - 2.0 * x)) / 2.0) : ((1.0 + BounceOut(2.0 * x - 1.0)) / 2.0);
default:
return 0.0;
}
}
public static double Circle(double x, LEaseMode easeMode)
{
switch (easeMode)
{
case LEaseMode.EaseIn:
return 1.0 - Math.Sqrt(1.0 - Math.Pow(x, 2.0));
case LEaseMode.EaseOut:
return Math.Sqrt(1.0 - Math.Pow(x - 1.0, 2.0));
case LEaseMode.EaseInOut:
return (x < 0.5) ? ((1.0 - Math.Sqrt(1.0 - Math.Pow(2.0 * x, 2.0))) / 2.0) : ((Math.Sqrt(1.0 - Math.Pow(-2.0 * x + 2.0, 2.0)) + 1.0) / 2.0);
default:
return 0.0;
}
}
public static double Power(double x, LEaseMode easeMode, int power)
{
switch (easeMode)
{
case LEaseMode.EaseIn:
return Math.Pow(x, power);
case LEaseMode.EaseOut:
return 1.0 - Math.Pow(1.0 - x, power);
case LEaseMode.EaseInOut:
return (x < 0.5) ? (Math.Pow(2.0, power - 1) * Math.Pow(x, power)) : (1.0 - Math.Pow(-2.0 * x + 2.0, power) / 2.0);
default:
return 0.0;
}
}
public static double Quadratic(double x, LEaseMode easeMode)
{
return Power(x, easeMode, 2);
}
public static double Cubic(double x, LEaseMode easeMode)
{
return Power(x, easeMode, 3);
}
public static double Quartic(double x, LEaseMode easeMode)
{
return Power(x, easeMode, 4);
}
public static double Quintic(double x, LEaseMode easeMode)
{
return Power(x, easeMode, 5);
}
public static double Elastic(double x, LEaseMode easeMode)
{
switch (easeMode)
{
case LEaseMode.EaseIn:
return (x == 0.0) ? 0.0 : ((x == 1.0) ? 1.0 : ((0.0 - Math.Pow(2.0, 10.0 * x - 10.0)) * Math.Sin((x * 10.0 - 10.75) * 2.0 * Math.PI / 3.0)));
case LEaseMode.EaseOut:
return (x == 0.0) ? 0.0 : ((x == 1.0) ? 1.0 : (Math.Pow(2.0, -10.0 * x) * Math.Sin((x * 10.0 - 0.75) * 2.0 * Math.PI / 3.0) + 1.0));
case LEaseMode.EaseInOut:
return (x == 0.0) ? 0.0 : ((x == 1.0) ? 1.0 : ((x < 0.5) ? ((0.0 - Math.Pow(2.0, 20.0 * x - 10.0) * Math.Sin((x * 20.0 - 11.125) * 2.0 * Math.PI / 4.5)) / 2.0) : (Math.Pow(2.0, -20.0 * x + 10.0) * Math.Sin((x * 20.0 - 11.125) * 2.0 * Math.PI / 4.5) / 2.0 + 1.0)));
default:
return 0.0;
}
}
public static double Exponential(double x, LEaseMode easeMode)
{
switch (easeMode)
{
case LEaseMode.EaseIn:
return (x == 0.0) ? 0.0 : Math.Pow(2.0, 10.0 * x - 10.0);
case LEaseMode.EaseOut:
return (x == 1.0) ? 1.0 : (1.0 - Math.Pow(2.0, -10.0 * x));
case LEaseMode.EaseInOut:
return (x == 0.0) ? 0.0 : ((x == 1.0) ? 1.0 : ((x < 0.5) ? (Math.Pow(2.0, 20.0 * x - 10.0) / 2.0) : ((2.0 - Math.Pow(2.0, -20.0 * x + 10.0)) / 2.0)));
default:
return 0.0;
}
}
public static double Sine(double x, LEaseMode easeMode)
{
switch (easeMode)
{
case LEaseMode.EaseIn:
return 1.0 - Math.Cos(x * Math.PI / 2.0);
case LEaseMode.EaseOut:
return Math.Sin(x * Math.PI / 2.0);
case LEaseMode.EaseInOut:
return (0.0 - (Math.Cos(Math.PI * x) - 1.0)) / 2.0;
default:
return 0.0;
}
}
}

View File

@@ -0,0 +1,9 @@
namespace LEase
{
public enum LEaseMode
{
EaseIn,
EaseOut,
EaseInOut
}
}

View File

@@ -0,0 +1,16 @@
namespace LEase
{
public enum LEaseType
{
Back,
Bounce,
Circle,
Quadratic,
Cubic,
Quartic,
Quintic,
Elastic,
Exponential,
Sine
}
}

View File

@@ -186,6 +186,8 @@ namespace CleanMachineHMI
private void TTimer_Tick(object sender, EventArgs e)
{
bool b = (_IsOpen?(iNow>=0):(iNow<=iDuration));
if (b)
{
@@ -251,7 +253,7 @@ namespace CleanMachineHMI
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
// e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
Pen penBarBack = new Pen(_CloseColor, _BarHight);
Pen penBarFore = new Pen(_OpenColor, _BarHight);

View File

@@ -792,7 +792,18 @@ namespace CleanMachineHMI
WritePlcItem("PlcHeartbeatWriteData", wcsToPlcHeartDataNew.ToString(), PlcItemTypeDesc.D);
}
if (DateTime.Now > HeartbeatTime.AddSeconds(5))//心跳超时
{
isConn = false;
//报警处理。
frmMainNew.Show_Plc_Alarm("PLC heartbeat data is abnormal, PLC loses connection!");
if (ReConnNum % 5 == 0)
{
ClosePlcConn();
PlcInit();
}
ReConnNum++;
}
}
catch
{

View File

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

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LeadDataBaseUtility</RootNamespace>
<AssemblyName>LeadDataBaseUtility</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>

View File

@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NX_LogUtility</RootNamespace>
<AssemblyName>NX_LogUtility</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>