From 5d05df27234fcb2bb9d5179a640c59590009f15a Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期四, 24 十二月 2020 10:47:58 +0800 Subject: [PATCH] 保存图片开关和格式配置 --- HalconTools/Properties/Settings.Designer.cs | 4 FileToolkit/FileToolkit.csproj | 7 HalconTools/Properties/Resources.Designer.cs | 4 LLMF/LLMF.csproj | 16 + LLMF/Program.cs | 20 +- Lib/FlyCapture/FlyCapture2Managed_v100.dll | 0 EventTool/Properties/Resources.Designer.cs | 4 LLMF/frmMain.Designer.cs | 114 ++++++++-------- LLMF/frmMain.cs | 150 +++++++++++---------- FileToolkit/Properties/Resources.Designer.cs | 4 HalconTools/ContourModule/ContourResult.cs | 4 README.md | 2 FileToolkit/Properties/Settings.Designer.cs | 4 Lib/FlyCapture/FlyCapture2Managed.dll | 0 HalconTools/HalconTools.csproj | 7 EventTool/Properties/Settings.Designer.cs | 4 LLMF/Toolkit/ConfigStruct.cs | 1 PointGreyAndHalcon/PointGreyAndHalcon/PointGreyAndHalcon.cs | 16 +- LLMF/frmMain.resx | 3 EventTool/EventTool.csproj | 7 LLMF/Properties/Settings.Designer.cs | 4 LLMF/Properties/Resources.Designer.cs | 4 LLMF/app.config | 2 23 files changed, 198 insertions(+), 183 deletions(-) diff --git a/EventTool/EventTool.csproj b/EventTool/EventTool.csproj index 13ccec0..00d9246 100644 --- a/EventTool/EventTool.csproj +++ b/EventTool/EventTool.csproj @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>EventTool</RootNamespace> <AssemblyName>EventTool</AssemblyName> - <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <StartupObject> </StartupObject> @@ -19,6 +19,7 @@ <UpgradeBackupLocation> </UpgradeBackupLocation> <OldToolsVersion>3.5</OldToolsVersion> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -28,6 +29,7 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -36,6 +38,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <ItemGroup> <Reference Include="System" /> diff --git a/EventTool/Properties/Resources.Designer.cs b/EventTool/Properties/Resources.Designer.cs index 7b61084..a3ca83a 100644 --- a/EventTool/Properties/Resources.Designer.cs +++ b/EventTool/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ // 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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/EventTool/Properties/Settings.Designer.cs b/EventTool/Properties/Settings.Designer.cs index 74803eb..9fe66ca 100644 --- a/EventTool/Properties/Settings.Designer.cs +++ b/EventTool/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/FileToolkit/FileToolkit.csproj b/FileToolkit/FileToolkit.csproj index c803437..7da5cf2 100644 --- a/FileToolkit/FileToolkit.csproj +++ b/FileToolkit/FileToolkit.csproj @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>FileToolkit</RootNamespace> <AssemblyName>FileToolkit</AssemblyName> - <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <StartupObject> </StartupObject> @@ -19,6 +19,7 @@ <UpgradeBackupLocation> </UpgradeBackupLocation> <OldToolsVersion>3.5</OldToolsVersion> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -28,6 +29,7 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -36,6 +38,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <ItemGroup> <Reference Include="System" /> diff --git a/FileToolkit/Properties/Resources.Designer.cs b/FileToolkit/Properties/Resources.Designer.cs index a56aec9..b48a63c 100644 --- a/FileToolkit/Properties/Resources.Designer.cs +++ b/FileToolkit/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ // 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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/FileToolkit/Properties/Settings.Designer.cs b/FileToolkit/Properties/Settings.Designer.cs index db12d5f..5cc1bf4 100644 --- a/FileToolkit/Properties/Settings.Designer.cs +++ b/FileToolkit/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/HalconTools/ContourModule/ContourResult.cs b/HalconTools/ContourModule/ContourResult.cs index 4c457fa..7f7c0d3 100644 --- a/HalconTools/ContourModule/ContourResult.cs +++ b/HalconTools/ContourModule/ContourResult.cs @@ -10,12 +10,12 @@ { public ContourResult() { - mContours = new HXLDCont(); + mContours = new HXLDCont(); mContLine = new HXLDCont(); mContPoints = new HXLDCont(); HOperatorSet.GenEmptyObj(out mObject); - // mObject.Dispose(); + // mObject.Dispose(); } /// <summary> diff --git a/HalconTools/HalconTools.csproj b/HalconTools/HalconTools.csproj index 44f4f9d..7b8ce21 100644 --- a/HalconTools/HalconTools.csproj +++ b/HalconTools/HalconTools.csproj @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>HalconTools</RootNamespace> <AssemblyName>HalconTools</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <StartupObject> </StartupObject> @@ -19,6 +19,7 @@ <UpgradeBackupLocation> </UpgradeBackupLocation> <OldToolsVersion>3.5</OldToolsVersion> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -28,6 +29,7 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -36,6 +38,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <ItemGroup> <Reference Include="halcondotnet"> diff --git a/HalconTools/Properties/Resources.Designer.cs b/HalconTools/Properties/Resources.Designer.cs index d46e502..1b772ab 100644 --- a/HalconTools/Properties/Resources.Designer.cs +++ b/HalconTools/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ // 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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/HalconTools/Properties/Settings.Designer.cs b/HalconTools/Properties/Settings.Designer.cs index 7493244..6db60c6 100644 --- a/HalconTools/Properties/Settings.Designer.cs +++ b/HalconTools/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/LLMF/LLMF.csproj b/LLMF/LLMF.csproj index c3a63f3..b0663ff 100644 --- a/LLMF/LLMF.csproj +++ b/LLMF/LLMF.csproj @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -10,7 +10,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>LLMF</RootNamespace> <AssemblyName>LLMF</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ApplicationIcon>ico.ico</ApplicationIcon> <FileUpgradeFlags> @@ -28,8 +28,8 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <PlatformTarget>x86</PlatformTarget> - <Prefer32Bit>false</Prefer32Bit> + <PlatformTarget>AnyCPU</PlatformTarget> + <Prefer32Bit>true</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -43,6 +43,10 @@ <ItemGroup> <Reference Include="dog_net_windows"> <HintPath>..\Lib\SuperDog\dog_net_windows.dll</HintPath> + </Reference> + <Reference Include="FlyCapture2Managed_v100, Version=2.8.3.1, Culture=neutral, PublicKeyToken=76c6583b4a4585f4, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Lib\FlyCapture\FlyCapture2Managed_v100.dll</HintPath> </Reference> <Reference Include="halcondotnet"> <HintPath>..\Lib\halcon\halcondotnet.dll</HintPath> @@ -161,11 +165,11 @@ </ItemGroup> <ItemGroup> <ProjectReference Include="..\EventTool\EventTool.csproj"> - <Project>{2EBB374F-7C87-4A83-8AF4-503CDF0D1B0E}</Project> + <Project>{2ebb374f-7c87-4a83-8af4-503cdf0d1b0e}</Project> <Name>EventTool</Name> </ProjectReference> <ProjectReference Include="..\FileToolkit\FileToolkit.csproj"> - <Project>{EC3A7C8F-C3FB-461C-9AF1-2456E1CBEC46}</Project> + <Project>{ec3a7c8f-c3fb-461c-9af1-2456e1cbec46}</Project> <Name>FileToolkit</Name> </ProjectReference> <ProjectReference Include="..\HalconTools\HalconTools.csproj"> diff --git a/LLMF/Program.cs b/LLMF/Program.cs index d285f55..2c22d37 100644 --- a/LLMF/Program.cs +++ b/LLMF/Program.cs @@ -23,16 +23,16 @@ var status = dog.Login(vendorcodes, defaultScope); if (status != DogStatus.StatusOk) { - if (status == DogStatus.TimeError) - { - MessageBox.Show("绂佹绡℃敼鏃堕棿!"); - return; - } - else - { - MessageBox.Show("璇锋彃鍏ユ湁鏁堢殑鍔犲瘑鐙�!"); - return; - } + //if (status == DogStatus.TimeError) + //{ + // MessageBox.Show("绂佹绡℃敼鏃堕棿!"); + // return; + //} + //else + //{ + // MessageBox.Show("璇锋彃鍏ユ湁鏁堢殑鍔犲瘑鐙�!"); + // return; + //} } } diff --git a/LLMF/Properties/Resources.Designer.cs b/LLMF/Properties/Resources.Designer.cs index 535a2bb..4e4ad02 100644 --- a/LLMF/Properties/Resources.Designer.cs +++ b/LLMF/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ // 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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/LLMF/Properties/Settings.Designer.cs b/LLMF/Properties/Settings.Designer.cs index b902679..6d4d92e 100644 --- a/LLMF/Properties/Settings.Designer.cs +++ b/LLMF/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ 锘�//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/LLMF/Toolkit/ConfigStruct.cs b/LLMF/Toolkit/ConfigStruct.cs index 843eaf1..2861497 100644 --- a/LLMF/Toolkit/ConfigStruct.cs +++ b/LLMF/Toolkit/ConfigStruct.cs @@ -81,6 +81,7 @@ public bool leftUsed; public bool rightUsed; public bool saveImage; + public string saveImageFormat; public long inch13; public long inch15; public long inch16; diff --git a/LLMF/app.config b/LLMF/app.config index c5e1dae..0dff63a 100644 --- a/LLMF/app.config +++ b/LLMF/app.config @@ -1,3 +1,3 @@ <?xml version="1.0"?> <configuration> -<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration> diff --git a/LLMF/frmMain.Designer.cs b/LLMF/frmMain.Designer.cs index 2315594..1ef8a90 100644 --- a/LLMF/frmMain.Designer.cs +++ b/LLMF/frmMain.Designer.cs @@ -82,6 +82,8 @@ this.label2 = new System.Windows.Forms.Label(); this.btnCapture = new System.Windows.Forms.Button(); this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.cboSize = new System.Windows.Forms.ComboBox(); + this.label11 = new System.Windows.Forms.Label(); this.txtSN = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); @@ -127,6 +129,8 @@ this.label7 = new System.Windows.Forms.Label(); this.btnCapture_left = new System.Windows.Forms.Button(); this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.cboSize_Left = new System.Windows.Forms.ComboBox(); + this.label12 = new System.Windows.Forms.Label(); this.txtSN_left = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); this.groupBox7 = new System.Windows.Forms.GroupBox(); @@ -184,10 +188,6 @@ this.lblZ_JinDian = new System.Windows.Forms.Label(); this.lblX_JinDian = new System.Windows.Forms.Label(); this.tVideo_left = new System.Windows.Forms.Timer(this.components); - this.cboSize = new System.Windows.Forms.ComboBox(); - this.label11 = new System.Windows.Forms.Label(); - this.cboSize_Left = new System.Windows.Forms.ComboBox(); - this.label12 = new System.Windows.Forms.Label(); this.statusStrip1.SuspendLayout(); this.panel1.SuspendLayout(); this.toolStrip1.SuspendLayout(); @@ -226,7 +226,7 @@ this.tsslPosition, this.toolStripStatusLabel1, this.tsslAlarm}); - this.statusStrip1.Location = new System.Drawing.Point(0, 747); + this.statusStrip1.Location = new System.Drawing.Point(0, 727); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(1081, 22); this.statusStrip1.TabIndex = 0; @@ -439,7 +439,7 @@ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(3, 3); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(792, 643); + this.panel2.Size = new System.Drawing.Size(792, 623); this.panel2.TabIndex = 2; // // lblAngleDisplay @@ -459,9 +459,9 @@ this.viewPort.ImagePart = new System.Drawing.Rectangle(0, 0, 640, 480); this.viewPort.Location = new System.Drawing.Point(0, 0); this.viewPort.Name = "viewPort"; - this.viewPort.Size = new System.Drawing.Size(792, 643); + this.viewPort.Size = new System.Drawing.Size(792, 623); this.viewPort.TabIndex = 0; - this.viewPort.WindowSize = new System.Drawing.Size(792, 643); + this.viewPort.WindowSize = new System.Drawing.Size(792, 623); // // panel3 // @@ -476,14 +476,14 @@ this.panel3.Dock = System.Windows.Forms.DockStyle.Right; this.panel3.Location = new System.Drawing.Point(795, 3); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(275, 643); + this.panel3.Size = new System.Drawing.Size(275, 623); this.panel3.TabIndex = 3; // // btnDisplay // this.btnDisplay.Dock = System.Windows.Forms.DockStyle.Bottom; this.btnDisplay.Font = new System.Drawing.Font("瀹嬩綋", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnDisplay.Location = new System.Drawing.Point(0, 590); + this.btnDisplay.Location = new System.Drawing.Point(0, 570); this.btnDisplay.Name = "btnDisplay"; this.btnDisplay.Size = new System.Drawing.Size(275, 53); this.btnDisplay.TabIndex = 0; @@ -742,6 +742,26 @@ this.groupBox4.TabIndex = 4; this.groupBox4.TabStop = false; // + // cboSize + // + this.cboSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboSize.FormattingEnabled = true; + this.cboSize.Location = new System.Drawing.Point(39, 19); + this.cboSize.Margin = new System.Windows.Forms.Padding(2); + this.cboSize.Name = "cboSize"; + this.cboSize.Size = new System.Drawing.Size(215, 20); + this.cboSize.TabIndex = 5; + this.cboSize.SelectionChangeCommitted += new System.EventHandler(this.cboSize_SelectionChangeCommitted); + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(5, 21); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(29, 12); + this.label11.TabIndex = 4; + this.label11.Text = "灏哄"; + // // txtSN // this.txtSN.Location = new System.Drawing.Point(39, 47); @@ -898,7 +918,7 @@ this.tabControl1.Location = new System.Drawing.Point(0, 72); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1081, 675); + this.tabControl1.Size = new System.Drawing.Size(1081, 655); this.tabControl1.TabIndex = 4; // // tabPage2 @@ -907,8 +927,8 @@ this.tabPage2.Controls.Add(this.panel3); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); - this.tabPage2.Size = new System.Drawing.Size(1073, 649); + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(1073, 629); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "涓诲伐浣�"; this.tabPage2.UseVisualStyleBackColor = true; @@ -919,7 +939,7 @@ this.tabPage1.Controls.Add(this.panel5); this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Size = new System.Drawing.Size(1073, 649); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "宸﹀伐浣�"; @@ -1223,6 +1243,26 @@ this.groupBox6.TabIndex = 10; this.groupBox6.TabStop = false; // + // cboSize_Left + // + this.cboSize_Left.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboSize_Left.FormattingEnabled = true; + this.cboSize_Left.Location = new System.Drawing.Point(41, 19); + this.cboSize_Left.Margin = new System.Windows.Forms.Padding(2); + this.cboSize_Left.Name = "cboSize_Left"; + this.cboSize_Left.Size = new System.Drawing.Size(215, 20); + this.cboSize_Left.TabIndex = 7; + this.cboSize_Left.SelectionChangeCommitted += new System.EventHandler(this.cboSize_Left_SelectionChangeCommitted); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(7, 21); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(29, 12); + this.label12.TabIndex = 6; + this.label12.Text = "灏哄"; + // // txtSN_left // this.txtSN_left.Location = new System.Drawing.Point(42, 47); @@ -1371,8 +1411,8 @@ this.tabPage3.Controls.Add(this.groupBox1); this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; - this.tabPage3.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); - this.tabPage3.Size = new System.Drawing.Size(1000, 568); + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(1073, 649); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "I/O"; this.tabPage3.UseVisualStyleBackColor = true; @@ -1834,51 +1874,11 @@ this.tVideo_left.Interval = 250; this.tVideo_left.Tick += new System.EventHandler(this.tVideo_left_Tick); // - // cboSize - // - this.cboSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboSize.FormattingEnabled = true; - this.cboSize.Location = new System.Drawing.Point(39, 19); - this.cboSize.Margin = new System.Windows.Forms.Padding(2); - this.cboSize.Name = "cboSize"; - this.cboSize.Size = new System.Drawing.Size(215, 20); - this.cboSize.TabIndex = 5; - this.cboSize.SelectionChangeCommitted += new System.EventHandler(this.cboSize_SelectionChangeCommitted); - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(5, 21); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(29, 12); - this.label11.TabIndex = 4; - this.label11.Text = "灏哄"; - // - // cboSize_Left - // - this.cboSize_Left.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboSize_Left.FormattingEnabled = true; - this.cboSize_Left.Location = new System.Drawing.Point(41, 19); - this.cboSize_Left.Margin = new System.Windows.Forms.Padding(2); - this.cboSize_Left.Name = "cboSize_Left"; - this.cboSize_Left.Size = new System.Drawing.Size(215, 20); - this.cboSize_Left.TabIndex = 7; - this.cboSize_Left.SelectionChangeCommitted += new System.EventHandler(this.cboSize_Left_SelectionChangeCommitted); - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(7, 21); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(29, 12); - this.label12.TabIndex = 6; - this.label12.Text = "灏哄"; - // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1081, 769); + this.ClientSize = new System.Drawing.Size(1081, 749); this.Controls.Add(this.tabControl1); this.Controls.Add(this.panel1); this.Controls.Add(this.statusStrip1); diff --git a/LLMF/frmMain.cs b/LLMF/frmMain.cs index b8141bb..a96d35b 100644 --- a/LLMF/frmMain.cs +++ b/LLMF/frmMain.cs @@ -43,7 +43,7 @@ HTuple ImageHeight = new HTuple(); HTuple ImageWidth = new HTuple(); - + bool isLeftCameraOpen = false; bool isRightCameraOpen = false; bool isDoorOpen = false; @@ -51,7 +51,7 @@ //bool isCylinder2Loosen = false; bool isUUTOut = false; bool isRealyOK = false; - + #endregion WelcomeUser m_WelcomeForm = new WelcomeUser(); //娆㈣繋鐣岄潰 public frmMain() @@ -62,7 +62,7 @@ private void frmMain_Load(object sender, EventArgs e) { m_WelcomeForm.Show(); //鏄剧ず娆㈣繋鐣岄潰 - // m_WelcomeForm.ProgressBar1.Value = 0; //娆㈣繋鐣岄潰杩涘害鏉� + // m_WelcomeForm.ProgressBar1.Value = 0; //娆㈣繋鐣岄潰杩涘害鏉� Application.DoEvents(); //澶勭悊鎵�鏈夌殑褰撳墠鍦ㄦ秷鎭槦鍒椾腑鐨刉indows娑堟伅銆� Log.WriteLog("App main form loading"); @@ -101,13 +101,13 @@ Log.WriteLog("MapTagToControl Enter"); opc.itemReadDict[InputTag.X_JinDian].control = lblX_JinDian; - opc.itemReadDict[InputTag.Z_JinDian].control =lblZ_JinDian; - opc.itemReadDict[InputTag.X_Alarm].control =lblX_Alarm; + opc.itemReadDict[InputTag.Z_JinDian].control = lblZ_JinDian; + opc.itemReadDict[InputTag.X_Alarm].control = lblX_Alarm; opc.itemReadDict[InputTag.Z_Alarm].control = lblZ_Alarm; opc.itemReadDict[InputTag.X_CW].control = lblX_CW; opc.itemReadDict[InputTag.X_CCW].control = lblX_CCW; opc.itemReadDict[InputTag.Z_CW].control = lblZ_CW; - opc.itemReadDict[InputTag.Z_CCW].control =lblZ_CCW; + opc.itemReadDict[InputTag.Z_CCW].control = lblZ_CCW; opc.itemReadDict[InputTag.DingWei_CW].control = lblDingWei_CW; opc.itemReadDict[InputTag.DingWei_CCW].control = lblDingWei_CCW; opc.itemReadDict[InputTag.DingWei_JinDian].control = lblDingWei_JinDian; @@ -119,7 +119,7 @@ opc.itemReadDict[InputTag.E_Stop].control = lblE_Stop; opc.itemReadDict[InputTag.SafeCurtain].control = lblSafeCurtain; opc.itemReadDict[InputTag.OpenJieJin].control = lblOpenJieJin; - opc.itemReadDict[InputTag.CeBianQian].control =lblCeBianQian; + opc.itemReadDict[InputTag.CeBianQian].control = lblCeBianQian; opc.itemReadDict[InputTag.CeBianHou].control = lblCeBianHou; opc.itemReadDict[InputTag.WuGanQian].control = lblWuGanQian; opc.itemReadDict[InputTag.WuGanHou].control = lblWuGanHou; @@ -143,7 +143,7 @@ opc.itemWriteDict[OutputTag.ForApple].control = lblForApple; opc.itemWriteDict[OutputTag.CameraLighto].control = lblCameraLighto; opc.itemWriteDict[OutputTag.WuGanCylider2].control = lblWuGanCylider2; - + Log.WriteLog("MapTagToControl Leave"); } @@ -182,7 +182,7 @@ config.maxAngle = 121; config.pulsePerDegree = 500; config.calAngle = 120; - config.saveImage = true; + config.saveImage = true; sft.SetConfig(configPath, config); } this.tsplabelProductName.Text = config.title; @@ -209,7 +209,7 @@ /// <summary> /// 鍔犺浇鐩告満 /// </summary> - private void initCam_Right() + private void initCam_Right() { Log.WriteLog("initCam_Right Enter"); @@ -219,7 +219,7 @@ Log.WriteLog("initCam_Right Leave"); } - + /// <summary> /// 鍔犺浇HalconTool @@ -284,11 +284,14 @@ if (runStatus != RunStatus.continueCapture) { #region 淇濆瓨鍥剧墖 - string FolderPath = "D:\\Image\\" + DateTime.Now.ToString("yyyyMMdd"); - string fileName = txtSN.Text.Trim() + "-" + DateTime.Now.ToString("HHmmssffff"); + if (config.saveImage) + { + string FolderPath = "D:\\Image\\" + DateTime.Now.ToString("yyyyMMdd"); + string fileName = txtSN.Text.Trim() + "-" + DateTime.Now.ToString("HHmmssffff"); - if (!Directory.Exists(FolderPath)) Directory.CreateDirectory(FolderPath); - cam.SaveImage(FolderPath, fileName); + if (!Directory.Exists(FolderPath)) Directory.CreateDirectory(FolderPath); + cam.SaveImage(FolderPath, fileName, string.IsNullOrWhiteSpace(config.saveImageFormat) ? "png" : config.saveImageFormat); + } #endregion } @@ -298,7 +301,7 @@ ht.JobImage = recImage.CopyImage(); HOperatorSet.GetImageSize(ht.JobImage, out ImageWidth, out ImageHeight); ht.JobResults.Clear(); - + Log.WriteLog("cam_GrabImageDone GrabSuccess run JobLLMF"); ht.Run("JobLLMF"); @@ -348,11 +351,14 @@ if (runStatus_left != RunStatus.continueCapture) { #region 淇濆瓨鍥剧墖 - string FolderPath = "D:\\Image\\" + DateTime.Now.ToString("yyyyMMdd") + "-left"; - string fileName = txtSN.Text.Trim() + "-" + DateTime.Now.ToString("HHmmssffff"); + if (config.saveImage) + { + string FolderPath = "D:\\Image\\" + DateTime.Now.ToString("yyyyMMdd") + "-left"; + string fileName = txtSN.Text.Trim() + "-" + DateTime.Now.ToString("HHmmssffff"); - if (!Directory.Exists(FolderPath)) Directory.CreateDirectory(FolderPath); - cam_left.SaveImage(FolderPath, fileName); + if (!Directory.Exists(FolderPath)) Directory.CreateDirectory(FolderPath); + cam_left.SaveImage(FolderPath, fileName, string.IsNullOrWhiteSpace(config.saveImageFormat) ? "png" : config.saveImageFormat); + } #endregion } @@ -391,7 +397,7 @@ this.BeginInvoke(new MethodInvoker(delegate { - Log.WriteLog("resultCreater_ListenEvent UI, data:" + e.IData.Data.ToString()+ ", runStatus:" + runStatus); + Log.WriteLog("resultCreater_ListenEvent UI, data:" + e.IData.Data.ToString() + ", runStatus:" + runStatus); string s = e.IData.Data.ToString(); if (!s.Equals("JobLLMF_Done")) @@ -438,12 +444,12 @@ Log.WriteLog("resultCreater_ListenEvent UI, ShowDisplayAngle angle: " + tmpAngle.ToString()); ShowDisplayAngle(tmpAngle.ToString("0.00")); - if(booltemAngle==true) + if (booltemAngle == true) { - Log.WriteLog("Camera Get The Alignment tmpAangle"+tmpAngle.ToString()); - + Log.WriteLog("Camera Get The Alignment tmpAangle" + tmpAngle.ToString()); + } - + if (runStatus == RunStatus.calibration) //鏍囧畾 { @@ -465,7 +471,7 @@ //Janhans 澧炲姞鐣岄潰瑙掑害log璁拌浇鐨凢lage 鍙橀噺 booltemAngle booltemAngle = true; - Log.WriteLog("Camera Get The InitAngle "+initAngle.ToString()); + Log.WriteLog("Camera Get The InitAngle " + initAngle.ToString()); } if (tmpAngle >= config.minAngle && tmpAngle <= config.maxAngle) { @@ -475,13 +481,13 @@ sw.Stop(); Log.WriteLog("Camera Get The FinalAngle" + finalAngle); - str=sw.ElapsedMilliseconds.ToString(); - Log.WriteLog("Aangle_Alignment_Time"+str+"ms"); + str = sw.ElapsedMilliseconds.ToString(); + Log.WriteLog("Aangle_Alignment_Time" + str + "ms"); sw.Restart(); Log.WriteLog("resultCreater_ListenEvent UI, opc write OutputTag.Move_OK true begin"); opc.Write(OutputTag.Move_OK, true); Log.WriteLog("resultCreater_ListenEvent UI, opc write OutputTag.Move_OK true end"); - + Log.WriteLog("-------瑙掑害璋冩暣瀹屾垚锛岀户鐢靛櫒涓婄數锛� PC缁欏嚭淇″彿鑷矼acmin-----"); Log.WriteLog("--------Relay turn on------"); isRealyOK = true; @@ -489,7 +495,7 @@ txtResultInitAngle.Text = initAngle.ToString("0.00"); txtResultFinalAngle.Text = finalAngle.ToString("0.00"); booltemAngle = false;//鐣岄潰瑙掑害log璁拌浇鐨凢lage 鍙橀噺 booltemAngle - + //RunEnd(); //Log.WriteLog("resultCreater_ListenEvent UI, RunEnd"); @@ -522,7 +528,7 @@ this.BeginInvoke(new MethodInvoker(delegate { - Log.WriteLog("resultCreater_left_ListenEvent UI, data:"+ e.IData.Data.ToString() + " runStatus: " + runStatus); + Log.WriteLog("resultCreater_left_ListenEvent UI, data:" + e.IData.Data.ToString() + " runStatus: " + runStatus); string s = e.IData.Data.ToString(); if (!s.Equals("JobLLMF_Done")) @@ -628,7 +634,7 @@ void listenEventCreater_ListenEvent(object sender, EventTool.ListenEventArgs e) { - // Log.WriteLog("listenEventCreater_ListenEvent Enter"); + // Log.WriteLog("listenEventCreater_ListenEvent Enter"); this.BeginInvoke(new MethodInvoker(delegate { @@ -674,7 +680,7 @@ Log.WriteLog("------鍙屾墜鍚姩瀹屾垚锛屼骇鍝侀�佹枡寮�濮嬶紝鐩告満鍑嗗鎷嶇収----"); //鍙屾墜鍚姩锛屼骇鍝侀�佹枡寮�濮� sw.Start(); - + StopRightCamera(); Log.WriteLog("listenEventCreater_ListenEvent InputTag.Start opc write OutputTag.Start"); @@ -754,7 +760,7 @@ } })); - // Log.WriteLog("listenEventCreater_ListenEvent Leave"); + // Log.WriteLog("listenEventCreater_ListenEvent Leave"); } void listenOutTageEventCreater_ListenEvent(object sender, EventTool.ListenEventArgs e) { @@ -779,17 +785,17 @@ else { btnDisplay_left.Text = (bool)item.value ? "缁х數鍣ㄤ笂鐢靛苟淇濇寔" : "缁х數鍣ㄦ柇鐢�"; - + } if ((bool)item.value && isRealyOK) { //Log.WriteLog("--------瑙掑害璋冩暣瀹屾垚锛岀户鐢靛櫒涓婄數------"); - + } - else if (!((bool)item.value) && isRealyOK) + else if (!((bool)item.value) && isRealyOK) { Log.WriteLog("--------浜у搧妫�娴嬪畬鎴�,OP澶嶄綅鎿嶄綔锛岀户鐢靛櫒鏂數------"); Log.WriteLog("--------Relay turn off------"); @@ -800,8 +806,8 @@ RunEnd(); Log.WriteLog("resultCreater_ListenEvent UI, RunEnd"); } - - break; + + break; } })); @@ -857,10 +863,10 @@ opc.ReadOneItem_Wrapper(item.Key, ref status); string logstr = (null == item.Value) ? "null" : item.Value.ToString(); Log.WriteLog("UpdateOPC itemReadDict key: " + item.Key + " value:" + logstr); - + switch (item.Key) { - case InputTag.Capture : + case InputTag.Capture: break; case InputTag.Position: @@ -885,7 +891,7 @@ { object status = new Object(); opc.ReadOneItem_Wrapper(item.Key, ref status); - string logstr =(null == item.Value) ? "null" : item.Value.ToString(); + string logstr = (null == item.Value) ? "null" : item.Value.ToString(); Log.WriteLog("UpdateOPC itemWriteDict key: " + item.Key + " value:" + logstr); switch (item.Key) { @@ -902,29 +908,29 @@ ckbCameraLight_left.Text = ckbCameraLight_left.Checked ? "鍏夋簮鍏�" : "鍏夋簮寮�"; break; - //case OutputTag.ForApple: - // if (config.rightUsed == true ) - // { - // btnDisplay.Text = (bool)item.Value.value ? "缁х數鍣ㄤ笂鐢�" : "缁х數鍣ㄦ柇鐢�"; - - - // } - // else - // { - // btnDisplay_left.Text = (bool)item.Value.value ? "缁х數鍣ㄤ笂鐢�" : "缁х數鍣ㄦ柇鐢�"; - - // } + //case OutputTag.ForApple: + // if (config.rightUsed == true ) + // { + // btnDisplay.Text = (bool)item.Value.value ? "缁х數鍣ㄤ笂鐢�" : "缁х數鍣ㄦ柇鐢�"; - // if ((bool)item.Value.value && isRealyOK) - // { - // Log.WriteLog("--------瑙掑害璋冩暣瀹屾垚锛岀户鐢靛櫒涓婄數------"); - // } - // if (!((bool)item.Value.value) && isRealyOK) - // { - // Log.WriteLog("--------浜у搧妫�娴嬪畬鎴�,OP澶嶄綅鎿嶄綔锛岀户鐢靛櫒鏂數------"); - // } - // isRealyOK = false; - // break; + + // } + // else + // { + // btnDisplay_left.Text = (bool)item.Value.value ? "缁х數鍣ㄤ笂鐢�" : "缁х數鍣ㄦ柇鐢�"; + + // } + + // if ((bool)item.Value.value && isRealyOK) + // { + // Log.WriteLog("--------瑙掑害璋冩暣瀹屾垚锛岀户鐢靛櫒涓婄數------"); + // } + // if (!((bool)item.Value.value) && isRealyOK) + // { + // Log.WriteLog("--------浜у搧妫�娴嬪畬鎴�,OP澶嶄綅鎿嶄綔锛岀户鐢靛櫒鏂數------"); + // } + // isRealyOK = false; + // break; } } @@ -1245,21 +1251,21 @@ case 35: alarm.Text = "璋冩暣浼烘湇瑙﹀彂鏋侀檺浣嶏紝璇锋鏌ヤ骇鍝佹墦寮�鐨勫垵濮嬭搴�"; - sw.Stop(); + sw.Stop(); sw.Reset(); Log.WriteLog(alarm.Text.ToString()); break; case 36: alarm.Text = "瀹氫綅鐩告満鍏夋簮鏈墦寮�锛岃妫�鏌ョ浉鏈哄厜婧愮姸鎬佸苟鎬ュ仠澶嶄綅"; - sw.Stop(); + sw.Stop(); sw.Reset(); Log.WriteLog(alarm.Text.ToString()); break; case 37: alarm.Text = "鐩告満鏈媿鐓э紝璇烽噸鍚▼搴忔垨妫�鏌LC鐘舵��"; - sw.Stop(); + sw.Stop(); sw.Reset(); Log.WriteLog(alarm.Text.ToString()); break; @@ -1636,7 +1642,7 @@ { Log.WriteLog("tVideo_left_Tick Enter"); - cam_left.GrabImage(""); + cam_left.GrabImage(""); Log.WriteLog("tVideo_left_Tick Leave"); } @@ -1798,7 +1804,7 @@ if (frmp.isOK) { - frmConfig tmpCon = new frmConfig(opc, config,"Right"); + frmConfig tmpCon = new frmConfig(opc, config, "Right"); tmpCon.ShowDialog(); } @@ -1814,7 +1820,7 @@ if (frmp.isOK) { - frmConfig tmpCon = new frmConfig(opc, config,"Left"); + frmConfig tmpCon = new frmConfig(opc, config, "Left"); tmpCon.ShowDialog(); } @@ -2113,10 +2119,10 @@ private void ckbSaveImage_CheckedChanged(object sender, EventArgs e) { - + if (ckbSaveImage.Checked) { - config.saveImage=true; + config.saveImage = true; sft.SetConfig(configPath, config); } diff --git a/LLMF/frmMain.resx b/LLMF/frmMain.resx index 3c5b33d..fcbfbbc 100644 --- a/LLMF/frmMain.resx +++ b/LLMF/frmMain.resx @@ -123,9 +123,6 @@ <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>522, 17</value> </metadata> - <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>522, 17</value> - </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="toolStripMaxMin.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> diff --git a/Lib/FlyCapture/FlyCapture2Managed.dll b/Lib/FlyCapture/FlyCapture2Managed.dll index 0e7611e..7d02864 100644 --- a/Lib/FlyCapture/FlyCapture2Managed.dll +++ b/Lib/FlyCapture/FlyCapture2Managed.dll Binary files differ diff --git a/Lib/FlyCapture/FlyCapture2Managed_v100.dll b/Lib/FlyCapture/FlyCapture2Managed_v100.dll index b49074c..b4efa3c 100644 --- a/Lib/FlyCapture/FlyCapture2Managed_v100.dll +++ b/Lib/FlyCapture/FlyCapture2Managed_v100.dll Binary files differ diff --git a/PointGreyAndHalcon/PointGreyAndHalcon/PointGreyAndHalcon.cs b/PointGreyAndHalcon/PointGreyAndHalcon/PointGreyAndHalcon.cs index 6c511e8..2fc2fd9 100644 --- a/PointGreyAndHalcon/PointGreyAndHalcon/PointGreyAndHalcon.cs +++ b/PointGreyAndHalcon/PointGreyAndHalcon/PointGreyAndHalcon.cs @@ -10,7 +10,7 @@ namespace PointGreyAndHalcon { - public delegate void GrabImageDoneDelegate(string recData,HImage recImage); + public delegate void GrabImageDoneDelegate(string recData, HImage recImage); public class PointGreyAndHalcon { @@ -30,7 +30,7 @@ //bool isRightCameraOpen = false; #endregion - public PointGreyAndHalcon() + public PointGreyAndHalcon() { //camNum = camInfos.Length; } @@ -52,7 +52,7 @@ catch (Exception ex) { MessageBox.Show("鐩告満" + index.ToString() + "鎵撳紑澶辫触"); - + } } @@ -68,7 +68,7 @@ cam = new ManagedGigECamera(); cam.Connect(guid); - cam.WriteRegister(0x610,0x00000000);//鎺у埗鐩告満涓婄數 + cam.WriteRegister(0x610, 0x00000000);//鎺у埗鐩告満涓婄數 System.Threading.Thread.Sleep(100); cam.WriteRegister(0x610, 0x80000000);//鎺у埗鐩告満涓嬬數 @@ -112,7 +112,7 @@ // Retrieve an image //cam.RetrieveBuffer(rawImage); - + // Create a converted image ManagedImage convertedImage = new ManagedImage(); @@ -319,11 +319,11 @@ /// </summary> /// <param name="filePath"></param> /// <param name="fileName"></param> - public void SaveImage(string filePath, string fileName) + public void SaveImage(string filePath, string fileName, string imgFormat) { - image.WriteImage("tiff", 0, filePath + "\\" + fileName); + image.WriteImage(imgFormat, 0, filePath + "\\" + fileName); } - + public void SetExposure(float exposure) { CameraProperty cp = cam.GetProperty(PropertyType.Shutter); diff --git a/README.md b/README.md index 4a6dbe1..775e853 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,3 @@ 婕忓厜妫�娴� -鍥犱负OPC鍙�傜敤32浣嶏紝halcon鍜岀伆鐐归┍鍔ㄩ兘瀹夎32浣嶉┍鍔紝绋嬪簭缂栬瘧閫夋嫨x86骞冲彴 - -- Gitblit v1.8.0