Commit 86ed317b 刘韬

1

1 个父辈 2f01f094
...@@ -249,8 +249,10 @@ namespace DeviceLibrary ...@@ -249,8 +249,10 @@ namespace DeviceLibrary
static bool lastHasReel = false; static bool lastHasReel = false;
public static bool? TestHasRight=null; public static bool? TestHasRight=null;
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static bool? TestHasReel(string cameraName) public static bool? TestHasReel(string cameraName,out string srcimg,out string prcimg)
{ {
srcimg = "";
prcimg = "";
int retrytime = 0; int retrytime = 0;
retry: retry:
string logtxt = $"【" + cameraName + "】开始取图片测试是否有料盘"+"\r\n"; string logtxt = $"【" + cameraName + "】开始取图片测试是否有料盘"+"\r\n";
...@@ -283,7 +285,7 @@ namespace DeviceLibrary ...@@ -283,7 +285,7 @@ namespace DeviceLibrary
double threshold = ConfigHelper.Config.Get("CamTestReel_threshold", 0.6); double threshold = ConfigHelper.Config.Get("CamTestReel_threshold", 0.6);
if (ConfigHelper.Config.Get("CamTestReel_debug",false)) if (ConfigHelper.Config.Get("CamTestReel_debug",false))
SaveImageToFile("test", cameraName, bmp); srcimg= SaveImageToFile("test", cameraName, bmp);
double maskcout = 0; double maskcout = 0;
var b = new Bitmap(bmp.Width / 2, bmp.Height / 2, bmp.PixelFormat); var b = new Bitmap(bmp.Width / 2, bmp.Height / 2, bmp.PixelFormat);
...@@ -326,7 +328,7 @@ namespace DeviceLibrary ...@@ -326,7 +328,7 @@ namespace DeviceLibrary
logtxt = ""; logtxt = "";
if (ConfigHelper.Config.Get("CamTestReel_debug", false) || (TestHasRight.HasValue && TestHasRight.Value!= hasReel)) if (ConfigHelper.Config.Get("CamTestReel_debug", false) || (TestHasRight.HasValue && TestHasRight.Value!= hasReel))
SaveImageToFile("test2", cameraName, b); prcimg= SaveImageToFile("test2", cameraName, b);
b.Dispose(); b.Dispose();
TestHasRight = null; TestHasRight = null;
return hasReel; return hasReel;
......
...@@ -115,6 +115,12 @@ ...@@ -115,6 +115,12 @@
<Compile Include="SettingControl.Designer.cs"> <Compile Include="SettingControl.Designer.cs">
<DependentUpon>SettingControl.cs</DependentUpon> <DependentUpon>SettingControl.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\frmHSVdebug.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UC\frmHSVdebug.Designer.cs">
<DependentUpon>frmHSVdebug.cs</DependentUpon>
</Compile>
<Compile Include="UC\FrmPassCheck.cs"> <Compile Include="UC\FrmPassCheck.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -187,6 +193,9 @@ ...@@ -187,6 +193,9 @@
<EmbeddedResource Include="SettingControl.resx"> <EmbeddedResource Include="SettingControl.resx">
<DependentUpon>SettingControl.cs</DependentUpon> <DependentUpon>SettingControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UC\frmHSVdebug.resx">
<DependentUpon>frmHSVdebug.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\FrmPassCheck.resx"> <EmbeddedResource Include="UC\FrmPassCheck.resx">
<DependentUpon>FrmPassCheck.cs</DependentUpon> <DependentUpon>FrmPassCheck.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
namespace TheMachine.UC
{
partial class frmHSVdebug
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.btn_getpic = new System.Windows.Forms.Button();
this.btn_save = new System.Windows.Forms.Button();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(2, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(407, 305);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// btn_getpic
//
this.btn_getpic.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_getpic.Location = new System.Drawing.Point(670, 419);
this.btn_getpic.Name = "btn_getpic";
this.btn_getpic.Size = new System.Drawing.Size(194, 30);
this.btn_getpic.TabIndex = 1;
this.btn_getpic.Text = "获取并测试";
this.btn_getpic.UseVisualStyleBackColor = true;
this.btn_getpic.Click += new System.EventHandler(this.btn_getpic_Click);
//
// btn_save
//
this.btn_save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_save.Location = new System.Drawing.Point(670, 503);
this.btn_save.Name = "btn_save";
this.btn_save.Size = new System.Drawing.Size(194, 30);
this.btn_save.TabIndex = 1;
this.btn_save.Text = "保存配置";
this.btn_save.UseVisualStyleBackColor = true;
//
// pictureBox2
//
this.pictureBox2.Location = new System.Drawing.Point(421, 3);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(407, 305);
this.pictureBox2.TabIndex = 0;
this.pictureBox2.TabStop = false;
//
// frmHSVdebug
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(914, 556);
this.Controls.Add(this.btn_save);
this.Controls.Add(this.btn_getpic);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.pictureBox1);
this.Name = "frmHSVdebug";
this.Text = "HSVdebug";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button btn_getpic;
private System.Windows.Forms.Button btn_save;
private System.Windows.Forms.PictureBox pictureBox2;
}
}
\ No newline at end of file \ No newline at end of file
using DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TheMachine.UC
{
public partial class frmHSVdebug : Form
{
public frmHSVdebug()
{
InitializeComponent();
}
private void btn_getpic_Click(object sender, EventArgs e)
{
ConfigHelper.Config.Set("CamTestReel_debug", true);
var result = CodeManager.TestHasReel(CodeManager.hikNameList[0],out string srcimg,out string prcimg);
if (result == null)
return;
}
}
}
<?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>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!