Commit bf3534a9 刘韬

1

1 个父辈 4fe3a74d
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
...@@ -20,16 +20,16 @@ ...@@ -20,16 +20,16 @@
</logger> </logger>
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
<system.serviceModel> <system.serviceModel>
<bindings> <bindings>
<webHttpBinding> <webHttpBinding>
<binding maxReceivedMessageSize="90000000" maxBufferPoolSize="90000000" maxBufferSize="90000000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:01:00" sendTimeout="00:01:00"> <binding maxReceivedMessageSize="90000000" maxBufferPoolSize="90000000" maxBufferSize="90000000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:01:00" sendTimeout="00:01:00">
<readerQuotas maxStringContentLength="90000000" maxArrayLength="90000000" maxBytesPerRead="90000000" /> <readerQuotas maxStringContentLength="90000000" maxArrayLength="90000000" maxBytesPerRead="90000000"/>
<security mode="None"/> <security mode="None"/>
</binding> </binding>
</webHttpBinding> </webHttpBinding>
</bindings> </bindings>
</system.serviceModel> </system.serviceModel>
</configuration>
\ No newline at end of file \ No newline at end of file
</configuration>
...@@ -42,6 +42,7 @@ namespace ScanCodeServer ...@@ -42,6 +42,7 @@ namespace ScanCodeServer
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.btn_test = new System.Windows.Forms.Button(); this.btn_test = new System.Windows.Forms.Button();
this.参数ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
...@@ -73,14 +74,15 @@ namespace ScanCodeServer ...@@ -73,14 +74,15 @@ namespace ScanCodeServer
// contextMenuStrip1 // contextMenuStrip1
// //
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.参数ToolStripMenuItem,
this.退出ToolStripMenuItem}); this.退出ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(101, 26); this.contextMenuStrip1.Size = new System.Drawing.Size(181, 70);
// //
// 退出ToolStripMenuItem // 退出ToolStripMenuItem
// //
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem"; this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(100, 22); this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.退出ToolStripMenuItem.Text = "退出"; this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click); this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
// //
...@@ -154,6 +156,13 @@ namespace ScanCodeServer ...@@ -154,6 +156,13 @@ namespace ScanCodeServer
this.btn_test.UseVisualStyleBackColor = true; this.btn_test.UseVisualStyleBackColor = true;
this.btn_test.Click += new System.EventHandler(this.btn_test_Click); this.btn_test.Click += new System.EventHandler(this.btn_test_Click);
// //
// 参数ToolStripMenuItem
//
this.参数ToolStripMenuItem.Name = "参数ToolStripMenuItem";
this.参数ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.参数ToolStripMenuItem.Text = "参数";
this.参数ToolStripMenuItem.Click += new System.EventHandler(this.参数ToolStripMenuItem_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -189,6 +198,7 @@ namespace ScanCodeServer ...@@ -189,6 +198,7 @@ namespace ScanCodeServer
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btn_test; private System.Windows.Forms.Button btn_test;
private System.Windows.Forms.ToolStripMenuItem 参数ToolStripMenuItem;
} }
} }
...@@ -144,5 +144,11 @@ namespace ScanCodeServer ...@@ -144,5 +144,11 @@ namespace ScanCodeServer
remoteDecodeParam.timeout = 3000; remoteDecodeParam.timeout = 3000;
webWork.Process(ho_Image, bitmap, remoteDecodeParam); webWork.Process(ho_Image, bitmap, remoteDecodeParam);
} }
private void 参数ToolStripMenuItem_Click(object sender, EventArgs e)
{
AdvanceConfigForm advanceConfigForm = new AdvanceConfigForm();
advanceConfigForm.ShowDialog();
}
} }
} }
...@@ -328,6 +328,8 @@ namespace ScanCodeServer ...@@ -328,6 +328,8 @@ namespace ScanCodeServer
ho_SymbolRegions.Dispose(); ho_SymbolRegions.Dispose();
HOperatorSet.CreateBarCodeModel(new HTuple(), new HTuple(), out hv_BarCodeHandle); HOperatorSet.CreateBarCodeModel(new HTuple(), new HTuple(), out hv_BarCodeHandle);
if (Setting.HOperatorSet_element_size_min >= 0)
HOperatorSet.SetBarCodeParam(hv_BarCodeHandle, "element_size_min", (int)Setting.HOperatorSet_element_size_min);
HOperatorSet.FindBarCode(ho_GrayImage, out ho_SymbolRegions, hv_BarCodeHandle, "auto", out hv_DecodedDataStrings); HOperatorSet.FindBarCode(ho_GrayImage, out ho_SymbolRegions, hv_BarCodeHandle, "auto", out hv_DecodedDataStrings);
//HOperatorSet.AreaCenterXld(ho_SymbolRegions, out hv_Area, out hv_Row1, out hv_Column, out hv_PointOrder); //HOperatorSet.AreaCenterXld(ho_SymbolRegions, out hv_Area, out hv_Row1, out hv_Column, out hv_PointOrder);
......
using System; using ConfigHelper;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
...@@ -21,6 +22,7 @@ namespace ScanCodeServer ...@@ -21,6 +22,7 @@ namespace ScanCodeServer
return; return;
} }
Config.LoadMyConfig(new Setting().GetType());
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new Form1());
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
// 运行时版本: 4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// 对此文件的更改可能导致不正确的行为,如果 // 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,则所做更改将丢失。 // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace ScanCodeServer.Properties {
namespace ScanCodeServer.Properties using System;
{
/// <summary> /// <summary>
/// 强类型资源类,用于查找本地化字符串等。 /// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary> /// </summary>
// 此类是由 StronglyTypedResourceBuilder // 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources internal class Resources {
{
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() internal Resources() {
{
} }
/// <summary> /// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。 /// 返回此类使用的缓存 ResourceManager 实例。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager internal static global::System.Resources.ResourceManager ResourceManager {
{ get {
get if (object.ReferenceEquals(resourceMan, null)) {
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScanCodeServer.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScanCodeServer.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;
} }
} }
/// <summary> /// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对 /// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。 /// 使用此强类型资源类的所有资源查找执行重写。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture internal static global::System.Globalization.CultureInfo Culture {
{ get {
get
{
return resourceCulture; return resourceCulture;
} }
set set {
{
resourceCulture = value; resourceCulture = value;
} }
} }
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 此代码由工具生成。
// Runtime Version:4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // 对此文件的更改可能会导致不正确的行为,并且如果
// the code is regenerated. // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace ScanCodeServer.Properties {
namespace ScanCodeServer.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [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", "17.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default public static Settings Default {
{ get {
get
{
return defaultInstance; return defaultInstance;
} }
} }
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>ScanCodeServer</RootNamespace> <RootNamespace>ScanCodeServer</RootNamespace>
<AssemblyName>ScanCodeServer</AssemblyName> <AssemblyName>ScanCodeServer</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
...@@ -77,6 +78,7 @@ ...@@ -77,6 +78,7 @@
<Compile Include="Monitor.cs" /> <Compile Include="Monitor.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting.cs" />
<Compile Include="WebServer.cs" /> <Compile Include="WebServer.cs" />
<Compile Include="WebWork.cs" /> <Compile Include="WebWork.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="Form1.resx">
...@@ -90,6 +92,7 @@ ...@@ -90,6 +92,7 @@
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="app.manifest" /> <None Include="app.manifest" />
<None Include="packages.config" /> <None Include="packages.config" />
......
using ConfigHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ScanCodeServer
{
class Setting
{
[MyConfigComment("element_size_min -1不启用")]
public static MyConfig<int> HOperatorSet_element_size_min = -1;
}
}
...@@ -87,12 +87,13 @@ namespace ScanCodeServer ...@@ -87,12 +87,13 @@ namespace ScanCodeServer
{ {
foreach (CodeInfo c in cc) foreach (CodeInfo c in cc)
{ {
c.CodeType = codeType; if (string.IsNullOrEmpty(c.CodeType))
c.CodeType = codeType;
c.CodeStr = RemoveInvalidXMLChars(c.CodeStr); c.CodeStr = RemoveInvalidXMLChars(c.CodeStr);
//c.CodeStr = "<![CDATA[" + c.CodeStr+"]]"; //c.CodeStr = "<![CDATA[" + c.CodeStr+"]]";
lock (code) lock (code)
{ {
if (!code.Contains(c.CodeStr)) //if (!code.Contains(c.CodeStr))
{ {
Common.log.Info("识别到:" + c.CodeType + ", " + c.CodeStr); Common.log.Info("识别到:" + c.CodeType + ", " + c.CodeStr);
code.Add(c.CodeStr); code.Add(c.CodeStr);
...@@ -120,9 +121,12 @@ namespace ScanCodeServer ...@@ -120,9 +121,12 @@ namespace ScanCodeServer
using (MemoryStream respStream = new MemoryStream()) using (MemoryStream respStream = new MemoryStream())
{ {
XmlSerializer xff = new XmlSerializer(typeof(List<CodeInfo>)); XmlSerializer xff = new XmlSerializer(typeof(List<CodeInfo>));
xff.Serialize(respStream, res.CodeInfos); xff.Serialize(respStream, res.CodeInfos);
var b64= Convert.ToBase64String(respStream.ToArray(),Base64FormattingOptions.None);
//Common.log.Info("b64:" + b64);
//Common.log.Info("txt:" + Convert.FromBase64String(b64));
Monitor.Test(); Monitor.Test();
return Convert.ToBase64String(respStream.ToArray()); return b64;
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!